vue-data-ui 2.3.67 → 2.3.69
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-C8pYyZqD.js → Arrow-Bs2WRJSk.js} +1 -1
- package/dist/{Arrow-Dswup7Lq.cjs → Arrow-CDLqeekX.cjs} +1 -1
- package/dist/{BaseIcon-Dz58O3w1.js → BaseIcon-D93rtrSm.js} +1 -1
- package/dist/{BaseIcon-wCGYJ8GM.cjs → BaseIcon-HycAYj53.cjs} +1 -1
- package/dist/{DataTable-CzvZIRDs.js → DataTable-Bwco5wF0.js} +2 -2
- package/dist/{DataTable-Dr67tL_4.cjs → DataTable-DkoeHXI5.cjs} +1 -1
- package/dist/{Legend-CkIdFaKE.cjs → Legend-CTlJpdAi.cjs} +1 -1
- package/dist/{Legend-C2DZGZN5.js → Legend-Cpk8DCWi.js} +1 -1
- package/dist/{Shape-qXMEmkXY.js → Shape-Bfeh9GpX.js} +1 -1
- package/dist/{Shape-BfT5b6-S.cjs → Shape-CbiBbFNX.cjs} +1 -1
- package/dist/{Slicer-3itdmkZf.cjs → Slicer-DA9QuPiC.cjs} +1 -1
- package/dist/{Slicer-CnIWgBPY.js → Slicer-DpuUwHC7.js} +2 -2
- package/dist/{Title-BYDRRvqX.cjs → Title-B6PVw0aK.cjs} +1 -1
- package/dist/{Title-BxitYokc.js → Title-CzxknLI3.js} +1 -1
- package/dist/{Tooltip-CtRqM9Sw.cjs → Tooltip-Ci47DnuY.cjs} +1 -1
- package/dist/{Tooltip-DTntJRyb.js → Tooltip-DYVjAqo-.js} +1 -1
- package/dist/{index-DnCegWge.cjs → index-DDwHKEGb.cjs} +1 -1
- package/dist/{index-fMHmzYJu.js → index-b22AFna7.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{useNestedProp-lzTC0cjC.js → useNestedProp-6FL791Qt.js} +1 -1
- package/dist/{useNestedProp-18FTwhUW.cjs → useNestedProp-BbpR9SM4.cjs} +1 -1
- package/dist/{usePrinter-C94KiYaY.cjs → usePrinter-CRKoRqbE.cjs} +1 -1
- package/dist/{usePrinter-BEVwOH5x.js → usePrinter-C_wOlUXy.js} +1 -1
- package/dist/{vue-data-ui-CqFeVAMl.cjs → vue-data-ui-B4ldblBa.cjs} +1 -1
- package/dist/{vue-data-ui-BG25mzqo.js → vue-data-ui-XthQYdCU.js} +57 -57
- package/dist/vue-data-ui.cjs +1 -1
- package/dist/vue-data-ui.js +1 -1
- package/dist/{vue-ui-3d-bar-D8WIzocy.js → vue-ui-3d-bar-DbYTVw48.js} +7 -7
- package/dist/{vue-ui-3d-bar-DyVzM9lj.cjs → vue-ui-3d-bar-ojEQSNLk.cjs} +1 -1
- package/dist/{vue-ui-accordion-CG_G9ock.cjs → vue-ui-accordion-BBDPcl3d.cjs} +1 -1
- package/dist/{vue-ui-accordion-CVzTuENA.js → vue-ui-accordion-H9MtAuZL.js} +3 -3
- package/dist/{vue-ui-age-pyramid-BZEiDo6X.js → vue-ui-age-pyramid-DQ3QiyQZ.js} +8 -8
- package/dist/{vue-ui-age-pyramid-DgAJ_4pC.cjs → vue-ui-age-pyramid-M1J2GKpa.cjs} +1 -1
- package/dist/{vue-ui-annotator-DYMGXQSF.js → vue-ui-annotator-D5DX94Dw.js} +1 -1
- package/dist/{vue-ui-annotator-DwwLMn8x.cjs → vue-ui-annotator-m8EO_6mf.cjs} +1 -1
- package/dist/{vue-ui-candlestick-F7a1z8rF.js → vue-ui-candlestick-B48E6EaX.js} +9 -9
- package/dist/{vue-ui-candlestick-DMh_omoZ.cjs → vue-ui-candlestick-CocQAT0K.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-BAbXjbOY.js → vue-ui-carousel-table-BlVhpRo3.js} +4 -4
- package/dist/{vue-ui-carousel-table-BQZBWVfB.cjs → vue-ui-carousel-table-CBF5ycha.cjs} +1 -1
- package/dist/{vue-ui-chestnut-bdGmk0m5.js → vue-ui-chestnut-BikqvSP7.js} +6 -6
- package/dist/{vue-ui-chestnut-DGUOcpUb.cjs → vue-ui-chestnut-TU1mnoNH.cjs} +1 -1
- package/dist/{vue-ui-cursor-zRPYiTzg.cjs → vue-ui-cursor-36hWYcLz.cjs} +1 -1
- package/dist/{vue-ui-cursor-_Hme39yS.js → vue-ui-cursor-3jMf_DA8.js} +2 -2
- package/dist/{vue-ui-dashboard-sMYoIdL3.js → vue-ui-dashboard-BnmrvYTu.js} +2 -2
- package/dist/{vue-ui-dashboard-BxcYVoZr.cjs → vue-ui-dashboard-r8hBDI5a.cjs} +1 -1
- package/dist/{vue-ui-digits-yn6cZZpI.js → vue-ui-digits-DLWnySuv.js} +2 -2
- package/dist/{vue-ui-digits-Do-yAjSx.cjs → vue-ui-digits-Dudhgq6k.cjs} +1 -1
- package/dist/{vue-ui-donut-CZGAyjMJ.js → vue-ui-donut-BIQqKYci.js} +9 -9
- package/dist/{vue-ui-donut-D8By144q.cjs → vue-ui-donut-BSMPuZag.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-wRc663rx.cjs → vue-ui-donut-evolution-BEkQBKpm.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-euuIoSwG.js → vue-ui-donut-evolution-Cpmro_CO.js} +9 -9
- package/dist/{vue-ui-dumbbell-GwPAVNAr.js → vue-ui-dumbbell-By0EEP7S.js} +8 -8
- package/dist/{vue-ui-dumbbell-DzDU6BtH.cjs → vue-ui-dumbbell-CbxwKTTZ.cjs} +1 -1
- package/dist/{vue-ui-flow-D-2Yx4Pd.js → vue-ui-flow-BIxbPfDE.js} +7 -7
- package/dist/{vue-ui-flow-2tDYyk_d.cjs → vue-ui-flow-DWrZQCzR.cjs} +1 -1
- package/dist/{vue-ui-galaxy-Cr1PHA7e.js → vue-ui-galaxy-DIim6oZe.js} +9 -9
- package/dist/{vue-ui-galaxy-k1zIeVWl.cjs → vue-ui-galaxy-DsphaNAI.cjs} +1 -1
- package/dist/{vue-ui-gauge-DyWEB9zv.cjs → vue-ui-gauge-CxID7_UB.cjs} +1 -1
- package/dist/{vue-ui-gauge-DrG1p_lu.js → vue-ui-gauge-DkB4_mbS.js} +5 -5
- package/dist/{vue-ui-gizmo-Cf6DtKdF.cjs → vue-ui-gizmo-B4TAO8bP.cjs} +1 -1
- package/dist/{vue-ui-gizmo-BUeQIgPm.js → vue-ui-gizmo-C_O9g3YG.js} +2 -2
- package/dist/{vue-ui-heatmap-1s92iamk.js → vue-ui-heatmap-Bs2fOp6v.js} +8 -8
- package/dist/{vue-ui-heatmap-B9gzhzl-.cjs → vue-ui-heatmap-CbY84wiS.cjs} +1 -1
- package/dist/{vue-ui-kpi-DXrL1517.js → vue-ui-kpi-BTQ4X1Rg.js} +3 -3
- package/dist/{vue-ui-kpi-Cocglkc1.cjs → vue-ui-kpi-DhYlfD4Q.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-D1MAsGWr.js → vue-ui-mini-loader-BnS890Lx.js} +2 -2
- package/dist/{vue-ui-mini-loader-3ssTbcFo.cjs → vue-ui-mini-loader-DRzlFN5q.cjs} +1 -1
- package/dist/{vue-ui-molecule-QWFA_72V.js → vue-ui-molecule-CAPwPpHO.js} +9 -9
- package/dist/{vue-ui-molecule-DFD-6XKb.cjs → vue-ui-molecule-N4XGePxD.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-DXLP2L3n.js → vue-ui-mood-radar-B8bsvKcJ.js} +9 -9
- package/dist/{vue-ui-mood-radar-DBq_gQ0i.cjs → vue-ui-mood-radar-CrvDHJHs.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts-Cx4Ia5Ga.cjs → vue-ui-nested-donuts-DQtQroDc.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts-Cx57mbbY.js → vue-ui-nested-donuts-xWRdqX_G.js} +9 -9
- package/dist/{vue-ui-onion-CE4wSxPC.js → vue-ui-onion-CIp-ZmAw.js} +99 -95
- package/dist/vue-ui-onion-DX96edRH.cjs +5 -0
- package/dist/{vue-ui-parallel-coordinate-plot-D8LWLRdK.cjs → vue-ui-parallel-coordinate-plot-DLbub2s5.cjs} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-DVqDX4Xb.js → vue-ui-parallel-coordinate-plot-m3xZjFsy.js} +10 -10
- package/dist/{vue-ui-quadrant-BNyw9TMO.cjs → vue-ui-quadrant-BlKcOAJ5.cjs} +1 -1
- package/dist/{vue-ui-quadrant-XSVao9uA.js → vue-ui-quadrant-CHYKm_gp.js} +10 -10
- package/dist/{vue-ui-quick-chart-uwdSvb9u.cjs → vue-ui-quick-chart-BuQXXXPZ.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-Ik_UH2Wj.js → vue-ui-quick-chart-Bx33h_v_.js} +7 -7
- package/dist/{vue-ui-radar-B5aRCCKL.cjs → vue-ui-radar-DL21Oxie.cjs} +1 -1
- package/dist/{vue-ui-radar-CR6ezAzt.js → vue-ui-radar-E5QES6yN.js} +10 -10
- package/dist/{vue-ui-rating-CguNsO-T.cjs → vue-ui-rating-DMmskFOg.cjs} +1 -1
- package/dist/{vue-ui-rating-CD_nWk1T.js → vue-ui-rating-DoqRRsvo.js} +2 -2
- package/dist/{vue-ui-relation-circle-DT2nom_x.js → vue-ui-relation-circle-D0TOckKJ.js} +5 -5
- package/dist/{vue-ui-relation-circle-8FZkM92K.cjs → vue-ui-relation-circle-DQxPcVUO.cjs} +1 -1
- package/dist/{vue-ui-rings-cpj5NfzL.js → vue-ui-rings-BHvZBASf.js} +9 -9
- package/dist/{vue-ui-rings-CNY7UKKQ.cjs → vue-ui-rings-J4xq1-8a.cjs} +1 -1
- package/dist/{vue-ui-scatter-Bar7v9mt.js → vue-ui-scatter-BDFTTZvz.js} +10 -10
- package/dist/{vue-ui-scatter-lt_SEmmy.cjs → vue-ui-scatter-D5chTu9W.cjs} +1 -1
- package/dist/{vue-ui-screenshot-DgPB2-6h.cjs → vue-ui-screenshot-CfG_-SQf.cjs} +1 -1
- package/dist/{vue-ui-screenshot-DLqFrK48.js → vue-ui-screenshot-D9FGz4Mq.js} +1 -1
- package/dist/{vue-ui-skeleton-Cey15-vY.cjs → vue-ui-skeleton-BeqLQi6X.cjs} +1 -1
- package/dist/{vue-ui-skeleton-DiJmBrEY.js → vue-ui-skeleton-c0TzbjC0.js} +2 -2
- package/dist/{vue-ui-smiley-9d8vQDje.js → vue-ui-smiley-9HsQ_68t.js} +2 -2
- package/dist/{vue-ui-smiley-NcQqECQm.cjs → vue-ui-smiley-CQiyYo-p.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-RIw8O12_.js → vue-ui-spark-trend-DtYPEtR4.js} +4 -4
- package/dist/{vue-ui-spark-trend-gLgFrogO.cjs → vue-ui-spark-trend-SlHRQmbT.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-DpnX31Vt.js → vue-ui-sparkbar-CrlzIgxZ.js} +3 -3
- package/dist/{vue-ui-sparkbar-BJZv7_r3.cjs → vue-ui-sparkbar-DiZ-nGpc.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-Ci1EXG01.js → vue-ui-sparkgauge-BdmdpNtb.js} +3 -3
- package/dist/{vue-ui-sparkgauge-2nfXMS4J.cjs → vue-ui-sparkgauge-oYNntKkm.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-B9Hzrj17.cjs → vue-ui-sparkhistogram-C3fHOiml.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-o1cCgVjJ.js → vue-ui-sparkhistogram-GmY7s2MV.js} +4 -4
- package/dist/{vue-ui-sparkline-Bpbwgdjl.cjs → vue-ui-sparkline-B904fIIV.cjs} +1 -1
- package/dist/{vue-ui-sparkline-CTFZOTQ4.js → vue-ui-sparkline-BMkTUeZx.js} +3 -3
- package/dist/{vue-ui-sparkstackbar-D1a4pKvC.cjs → vue-ui-sparkstackbar-BMvx-rKU.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-Dci-TIxt.js → vue-ui-sparkstackbar-uS7i9oTT.js} +3 -3
- package/dist/{vue-ui-stackbar-uyUtl8SO.cjs → vue-ui-stackbar-BhAHa1Dn.cjs} +1 -1
- package/dist/{vue-ui-stackbar-DX86sbcN.js → vue-ui-stackbar-D4OAp2cH.js} +10 -10
- package/dist/{vue-ui-strip-plot-Br3W0ejH.js → vue-ui-strip-plot-BCKuRBtF.js} +9 -9
- package/dist/{vue-ui-strip-plot-C2NjIy5-.cjs → vue-ui-strip-plot-CryNz9qI.cjs} +1 -1
- package/dist/{vue-ui-table-Ctw9daYW.cjs → vue-ui-table-7C8sLROG.cjs} +1 -1
- package/dist/{vue-ui-table-BFs9-zs7.js → vue-ui-table-E36ZrFlN.js} +1 -1
- package/dist/{vue-ui-table-heatmap-DqoiRtjC.js → vue-ui-table-heatmap-CaXDSUa1.js} +4 -4
- package/dist/{vue-ui-table-heatmap-zAbifnaM.cjs → vue-ui-table-heatmap-DWp3QF6Q.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline-DuUY9yJu.cjs → vue-ui-table-sparkline-BdQUpJPd.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline-h4J419FI.js → vue-ui-table-sparkline-CMVyXbpe.js} +5 -5
- package/dist/{vue-ui-thermometer-Bt-SnP1Y.cjs → vue-ui-thermometer-DkDtdSmc.cjs} +1 -1
- package/dist/{vue-ui-thermometer-D_4mS8Z8.js → vue-ui-thermometer-Li9bmiH0.js} +5 -5
- package/dist/{vue-ui-timer-CPZm7Dif.js → vue-ui-timer-C_4lJH9K.js} +4 -4
- package/dist/{vue-ui-timer-CMsje-f2.cjs → vue-ui-timer-TsyW89JN.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-Bcm8DSj6.cjs → vue-ui-tiremarks-CCG1Ys1M.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-CVBbjezc.js → vue-ui-tiremarks-Cf51w2b-.js} +5 -5
- package/dist/{vue-ui-treemap-1rEDHWrf.js → vue-ui-treemap-BcFsPd4Y.js} +9 -9
- package/dist/{vue-ui-treemap-CB1gz8gX.cjs → vue-ui-treemap-Bos2w-op.cjs} +1 -1
- package/dist/{vue-ui-vertical-bar-CfGS6Snt.js → vue-ui-vertical-bar-D7X05s8-.js} +9 -9
- package/dist/{vue-ui-vertical-bar-DHFaoQcu.cjs → vue-ui-vertical-bar-aKU9mtnf.cjs} +1 -1
- package/dist/{vue-ui-waffle-COf_Yi5Y.cjs → vue-ui-waffle-CFyFmjBl.cjs} +1 -1
- package/dist/{vue-ui-waffle-D-niDah6.js → vue-ui-waffle-DFtpaZsl.js} +9 -9
- package/dist/{vue-ui-wheel-CKoly9Ay.cjs → vue-ui-wheel-BrEgOljm.cjs} +1 -1
- package/dist/{vue-ui-wheel-BPcde5q6.js → vue-ui-wheel-C3nur9i_.js} +5 -5
- package/dist/{vue-ui-word-cloud-CPb5G65W.cjs → vue-ui-word-cloud-BaP5JJKa.cjs} +1 -1
- package/dist/{vue-ui-word-cloud-C9Ok-uiw.js → vue-ui-word-cloud-DPNwIdFC.js} +7 -7
- package/dist/{vue-ui-xy-C9T7Qybt.cjs → vue-ui-xy-KNbn-bUg.cjs} +1 -1
- package/dist/{vue-ui-xy-canvas-DoDgOkMe.cjs → vue-ui-xy-canvas-BaaFmIpg.cjs} +1 -1
- package/dist/{vue-ui-xy-canvas-JpE-OhiQ.js → vue-ui-xy-canvas-OQHq27Ks.js} +10 -10
- package/dist/{vue-ui-xy-BjpH25yC.js → vue-ui-xy-uoeb5Otk.js} +12 -12
- package/package.json +1 -1
- package/dist/vue-ui-onion-CApJ-Npg.cjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),p=require("./index-DnCegWge.cjs"),we=require("./Title-BYDRRvqX.cjs"),re=require("./usePrinter-C94KiYaY.cjs"),$e=require("./DataTable-Dr67tL_4.cjs"),Fe=require("./Tooltip-CtRqM9Sw.cjs"),z=require("./BaseIcon-wCGYJ8GM.cjs"),Pe=require("./vue-ui-skeleton-Cey15-vY.cjs"),Ne=require("./vue-ui-accordion-CG_G9ock.cjs"),ne=require("./useNestedProp-18FTwhUW.cjs"),Ee=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Te=["cx","cy","r","fill","stroke","stroke-width","onClick","onMouseover"],Se={__name:"RecursiveCircles",props:{color:{type:String,default:"#000000"},dataset:{type:Array,default:()=>[]},hoveredUid:{type:String,default:null},linkColor:{type:String,default:"#CCCCCC"},stroke:{type:String,default:"#FFFFFF"},strokeHovered:{type:String,default:"#000000"}},emits:["zoom","hover"],setup(n,{emit:g}){const y=n;function u(a){g("zoom",a)}function c(a){g("hover",a)}return e.toRef(y,"dataset").value.forEach(a=>{a.nodes&&a.nodes.length>0&&a.nodes.forEach(i=>{i.ancestor=a})}),(a,i)=>{const b=e.resolveComponent("RecursiveCircles",!0);return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.dataset,v=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[v.polygonPath&&v.polygonPath.coordinates?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.polygonPath.coordinates,(F,P)=>(e.openBlock(),e.createElementBlock("circle",{cx:F.x,cy:F.y,r:v.circleRadius,fill:`url(#gradient_${v.color})`,stroke:n.hoveredUid&&n.hoveredUid===v.uid?n.strokeHovered:n.stroke,"stroke-width":n.hoveredUid&&n.hoveredUid===v.uid?v.circleRadius/6:v.circleRadius/12,style:{cursor:"pointer"},onClick:e.withModifiers(h=>u(v),["stop"]),onMouseover:h=>c(v),onMouseleave:i[0]||(i[0]=h=>c(null))},null,40,Te))),256)),v.nodes&&v.nodes.length>0?(e.openBlock(),e.createBlock(b,{key:0,dataset:v.nodes,color:n.color,stroke:n.stroke,strokeHovered:n.strokeHovered,hoveredUid:n.hoveredUid,onZoom:u,onHover:c},null,8,["dataset","color","stroke","strokeHovered","hoveredUid"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64))),256)}}},Ve=["x1","y1","x2","y2","stroke","stroke-width"],Re=["x1","y1","x2","y2","stroke","stroke-width"],Le={__name:"RecursiveLinks",props:{dataset:{type:Array,default:()=>[]},color:{type:String,default:"#DDDDDD"},backgroundColor:{type:String,default:"#FFFFFF"}},setup(n){const g=n;return e.toRef(g,"dataset").value.forEach(u=>{u.nodes&&u.nodes.length>0&&u.nodes.forEach(c=>{c.ancestor=u})}),(u,c)=>{const B=e.resolveComponent("RecursiveLinks",!0);return e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.dataset,a=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[a.polygonPath&&a.polygonPath.coordinates?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(a.polygonPath.coordinates,(i,b)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[a.ancestor&&a.ancestor.polygonPath?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("line",{x1:i.x,y1:i.y,x2:a.ancestor.polygonPath.coordinates[0].x,y2:a.ancestor.polygonPath.coordinates[0].y,stroke:n.backgroundColor,"stroke-width":a.circleRadius/1.5},null,8,Ve),e.createElementVNode("line",{x1:i.x,y1:i.y,x2:a.ancestor.polygonPath.coordinates[0].x,y2:a.ancestor.polygonPath.coordinates[0].y,stroke:n.color,"stroke-width":a.circleRadius/2},null,8,Re)],64)):e.createCommentVNode("",!0)],64))),256)):e.createCommentVNode("",!0)],64))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.dataset,a=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[a.polygonPath&&a.polygonPath.coordinates?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[a.nodes&&a.nodes.length>0?(e.openBlock(),e.createBlock(B,{key:0,dataset:a.nodes,color:n.color,backgroundColor:n.backgroundColor},null,8,["dataset","color","backgroundColor"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64))),256))],64)}}},ze=["x","y","fill","font-size"],Me={__name:"RecursiveLabels",props:{color:{type:String,default:"#000000"},dataset:{type:Array,default:()=>[]},hoveredUid:{type:String,default:null}},emits:["zoom","hover"],setup(n,{emit:g}){const y=n;return e.toRef(y,"dataset").value.forEach(c=>{c.nodes&&c.nodes.length>0&&c.nodes.forEach(B=>{B.ancestor=c})}),(c,B)=>{const a=e.resolveComponent("RecursiveLabels",!0);return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.dataset,i=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[i.polygonPath&&i.polygonPath.coordinates?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.polygonPath.coordinates,b=>(e.openBlock(),e.createElementBlock("text",{x:b.x,y:b.y+i.circleRadius*2,fill:n.color,"font-size":i.circleRadius,"text-anchor":"middle",style:{opacity:"0.8","pointer-events":"none"}},e.toDisplayString(i.name),9,ze))),256)),i.nodes&&i.nodes.length>0?(e.openBlock(),e.createBlock(a,{key:0,dataset:i.nodes,color:n.color,hoveredUid:n.hoveredUid},null,8,["dataset","color","hoveredUid"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64))),256)}}},De={style:{position:"relative",height:"100%",width:"100%"}},Ue={__name:"BaseDirectionPad",props:{color:{type:String,default:"#FF0000"},isFullscreen:{type:Boolean,default:!1}},emits:["moveLeft","moveTop","moveRight","moveBottom","reset"],setup(n,{emit:g}){return(y,u)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`position: ${n.isFullscreen?"fixed":"absolute"};bottom:0;right:${n.isFullscreen?"12px":"0"};width:80px;height:80px`),"data-html2canvas-ignore":""},[e.createElementVNode("div",De,[e.createElementVNode("button",{onClick:u[0]||(u[0]=e.withModifiers(c=>g("moveLeft"),["stop"])),style:{position:"absolute",left:"0",top:"50%",transform:"translateY(-50%)",height:"24px",width:"24px",padding:"0",background:"transparent",border:"none",display:"flex","align-items":"center","justify-content":"center"}},[e.createVNode(z.default,{stroke:n.color,name:"arrowLeft",style:{cursor:"pointer"}},null,8,["stroke"])]),e.createElementVNode("button",{onClick:u[1]||(u[1]=e.withModifiers(c=>g("moveTop"),["stop"])),style:{position:"absolute",top:"0",left:"50%",transform:"translateX(-50%)",height:"24px",width:"24px",padding:"0",background:"transparent",border:"none",display:"flex","align-items":"center","justify-content":"center"}},[e.createVNode(z.default,{stroke:n.color,name:"arrowTop",style:{cursor:"pointer"}},null,8,["stroke"])]),e.createElementVNode("button",{onClick:u[2]||(u[2]=e.withModifiers(c=>g("moveRight"),["stop"])),style:{position:"absolute",right:"0",top:"50%",transform:"translateY(-50%)",height:"24px",width:"24px",padding:"0",background:"transparent",border:"none",display:"flex","align-items":"center","justify-content":"center"}},[e.createVNode(z.default,{stroke:n.color,name:"arrowRight",style:{cursor:"pointer"}},null,8,["stroke"])]),e.createElementVNode("button",{onClick:u[3]||(u[3]=e.withModifiers(c=>g("moveBottom"),["stop"])),style:{position:"absolute",bottom:"0",left:"50%",transform:"translateX(-50%)",height:"24px",width:"24px",padding:"0",background:"transparent",border:"none",display:"flex","align-items":"center","justify-content":"center"}},[e.createVNode(z.default,{stroke:n.color,name:"arrowBottom",style:{cursor:"pointer"}},null,8,["stroke"])]),e.createElementVNode("button",{onClick:u[4]||(u[4]=e.withModifiers(c=>g("reset"),["stop"])),style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%,-50%)",height:"24px",width:"24px",padding:"0",background:"transparent",border:"none",display:"flex","align-items":"center","justify-content":"center"}},[e.createVNode(z.default,{stroke:n.color,name:"close",style:{cursor:"pointer"},strokeWidth:2},null,8,["stroke"])])])],4))}},Ie=["id"],Oe=["xmlns","viewBox"],He=["id"],qe=["stop-color"],Ae=["stop-color"],je={key:4,class:"vue-data-ui-watermark"},Ge=["innerHTML"],Xe={__name:"vue-ui-molecule",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(n,{expose:g}){const y=n,{vue_ui_molecule:u}=p.useConfig(),c=e.computed(()=>!!y.dataset&&y.dataset.length);e.onMounted(()=>{p.objectIsEmpty(y.dataset)&&p.error({componentName:"VueUiMolecule",type:"dataset"})});const B=e.ref(p.createUid()),a=e.ref(null),i=e.ref(!1),b=e.ref(""),v=e.ref(null),F=e.ref(null),P=e.ref(!1),h=e.ref(null),G=e.ref(null),D=e.ref(0),o=e.computed(()=>{const t=ne.useNestedProp({userConfig:y.config,defaultConfig:u});return t.theme?{...ne.useNestedProp({userConfig:p.themes.vue_ui_molecule[t.theme]||y.config,defaultConfig:t}),customPalette:p.themePalettes[t.theme]||p.palette}:t}),{isPrinting:X,isImaging:Y,generatePdf:W,generateImage:Z}=re.usePrinter({elementId:`cluster_${B.value}`,fileName:o.value.style.chart.title.text||"vue-ui-molecule"}),ae=e.computed(()=>p.convertCustomPalette(o.value.customPalette)),k=e.ref({showTable:o.value.table.show,showDataLabels:!0,showTooltip:o.value.style.chart.tooltip.show});function J(t,l=0){return Array.isArray(t)&&t.length>0&&t[0].nodes?J(t[0].nodes,l+1):l}function se(){const t=J(y.dataset);let l=100,r=l;for(let d=0;d<t;d+=1)l/=1,r+=l;return{height:r,width:r}}const x=e.ref(se()),U=e.ref(`0 0 ${x.value.width} ${x.value.height}`);function K(t,l={x:-x.value.width/2.43,y:x.value.height/2},r=x.value.width/1.1,d=24,s=0,f=0,V="#BBBBBB"){if(t&&t.length>0){const A=p.createPolygonPath({plot:l,radius:r,sides:t.length,rotation:s});t.forEach((m,$)=>{const R=A.coordinates[$];let w;if(m.ancestor?m.ancestor.ancestor?w=m.ancestor.color||V:(w=ae.value[f]||p.palette[f]||V,f+=1):w=V,m.polygonPath={coordinates:[R]},m.circleRadius=d,m.color=w,m.uid=p.createUid(),m.nodes&&m.nodes.length>0){const j=!m.ancestor||!m.ancestor.ancestor?f:0;m.nodes=K(m.nodes,R,r/2.9,d/2.2,s+Math.PI*$/m.nodes.length,j,w)}})}return t}function ie(t){const l=new Set;function r(s){s.forEach(f=>{f.color&&!l.has(f.color)&&l.add(f.color),f.nodes&&f.nodes.length>0&&r(f.nodes)})}r(t);const d={};return Array.from(l).forEach((s,f)=>{d[s]=`gradient_${f}`}),d}const ue=e.computed(()=>ie(C.value)),C=e.computed(()=>K(y.dataset));function I(){P.value=!1,F.value=null,G.value=null,h.value=null,H({polygonPath:{coordinates:[{x:x.value.width/2,y:x.value.height/2}]},circleRadius:24})}const O=e.ref(null);function H(t){v.value.focus(),e.nextTick(()=>{O.value&&cancelAnimationFrame(O.value);const l=U.value.split(" "),r=parseFloat(l[0]),d=parseFloat(l[1]),s=parseFloat(l[2]),f=parseFloat(l[3]),{x:V,y:A}=t.polygonPath.coordinates[0],{circleRadius:m}=t,$=8.34,R=V-m*$,w=A-m*$,j=m*$*2,ye=m*$*2,ke=Math.sqrt((R-r)**2+(w-d)**2),L=Math.min(1200,Math.max(20,Math.floor(ke/10))),be=(R-r)/L,Ce=(w-d)/L,Be=(j-s)/L,xe=(ye-f)/L;let E=0;function le(){U.value=`${r+be*E} ${d+Ce*E} ${s+Be*E} ${f+xe*E}`,E+=o.value.style.chart.zoom.speed,E<=L&&(O.value=requestAnimationFrame(le))}le()})}function ce(t){F.value===t.uid?I():(F.value=t.uid,G.value=t,h.value={circleRadius:t.circleRadius,polygonPath:{coordinates:[{x:t.polygonPath.coordinates[0].x,y:t.polygonPath.coordinates[0].y}]}},H(t),P.value=t.uid!==C.value[0].uid)}function de(t){if(t.target.nodeName!=="circle")I(),P.value=!1;else return}const q=e.ref(null);function ve(t){q.value={datapoint:t,seriesIndex:-1,series:C.value,config:o.value};const l=o.value.style.chart.tooltip.customFormat;if(p.isFunction(l)&&p.functionReturnsString(()=>l({seriesIndex:-1,datapoint:t,series:C.value,config:o.value})))b.value=l({seriesIndex:-1,datapoint:t,series:C.value,config:o.value});else{let r="";r+=`<div style="display:flex;align-items:center;gap:3px"><div style="color:${t.color}">⬤</div><div>${t.name}</div></div>`,t.details&&(r+=`<div style="width:100%;border-top:1px solid ${o.value.style.chart.tooltip.borderColor};margin-top: 2px">${t.details}</div>`),b.value=`<div style="font-family:inherit">${r}</div>`}}const Q=e.ref(null),T=e.ref(null);function fe(t){Q.value=t,t?(i.value=!0,ve(t),T.value=t.uid):(i.value=!1,b.value="",T.value=null)}function M(t){t==="right"&&(h.value.polygonPath.coordinates[0].x+=h.value.circleRadius),t==="left"&&(h.value.polygonPath.coordinates[0].x-=h.value.circleRadius),t==="top"&&(h.value.polygonPath.coordinates[0].y-=h.value.circleRadius),t==="bottom"&&(h.value.polygonPath.coordinates[0].y+=h.value.circleRadius),H(h.value)}function me(t){const l=[];function r(d){d.forEach(s=>{const f={name:s.name,details:s.details||"-",ancestor:s.ancestor&&s.ancestor.name||"-",color:s.color||""};l.push(f),s.nodes&&s.nodes.length>0&&r(s.nodes,s.name)})}return r(t),l}const pe=e.computed(()=>me(C.value)),N=e.computed(()=>{const t=[o.value.table.translations.nodeName,o.value.table.translations.details,o.value.table.translations.ancestor],l=pe.value.map((s,f)=>[{color:s.color,name:s.name},s.details,s.ancestor||""]),r={th:{backgroundColor:o.value.table.th.backgroundColor,color:o.value.table.th.color,outline:o.value.table.th.outline},td:{backgroundColor:o.value.table.td.backgroundColor,color:o.value.table.td.color,outline:o.value.table.td.outline},breakpoint:o.value.table.responsiveBreakpoint},d=[o.value.table.translations.nodeName,o.value.table.translations.details,o.value.table.translations.ancestor];return{head:t,body:l,config:r,colNames:d}});function _(){e.nextTick(()=>{const t=N.value.body.map((d,s)=>[[d[0].name],[d[1]],[d[2]]]),l=[[o.value.style.chart.title.text],[o.value.style.chart.title.subtitle.text],[[...N.value.head]]].concat(t),r=p.createCsvContent(l);p.downloadCsv({csvContent:r,title:o.value.style.chart.title.text||"vue-ui-molecule"})})}function he(){return C.value}const S=e.ref(!1);function ge(t){S.value=t,D.value+=1}function ee(){k.value.showTable=!k.value.showTable}function te(){k.value.showDataLabels=!k.value.showDataLabels}function oe(){k.value.showTooltip=!k.value.showTooltip}return g({getData:he,generatePdf:W,generateCsv:_,generateImage:Z,toggleTable:ee,toggleLabels:te,toggleTooltip:oe}),(t,l)=>(e.openBlock(),e.createElementBlock("div",{onMouseleave:l[7]||(l[7]=r=>{Q.value=null,T.value=null}),ref_key:"moleculeChart",ref:v,class:e.normalizeClass(`vue-ui-molecule ${S.value?"vue-data-ui-wrapper-fullscreen":""}`),style:e.normalizeStyle(`font-family:${o.value.style.fontFamily};width:100%; text-align:center;background:${o.value.style.chart.backgroundColor}`),id:`cluster_${B.value}`},[o.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:100%;background:${o.value.style.chart.backgroundColor};`)},[e.createVNode(we._sfc_main,{config:{title:{cy:"molecule-div-title",...o.value.style.chart.title},subtitle:{cy:"molecule-div-subtitle",...o.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),o.value.userOptions.show&&c.value?(e.openBlock(),e.createBlock(re.UserOptions,{ref_key:"details",ref:a,key:`user_options_${D.value}`,backgroundColor:o.value.style.chart.backgroundColor,color:o.value.style.chart.color,isPrinting:e.unref(X),isImaging:e.unref(Y),uid:B.value,hasTooltip:o.value.userOptions.buttons.tooltip&&o.value.style.chart.tooltip.show,hasPdf:o.value.userOptions.buttons.pdf,hasXls:o.value.userOptions.buttons.csv,hasImg:o.value.userOptions.buttons.img,hasTable:o.value.userOptions.buttons.table,hasLabel:o.value.userOptions.buttons.labels,hasFullscreen:o.value.userOptions.buttons.fullscreen,isTooltip:k.value.showTooltip,titles:{...o.value.userOptions.buttonTitles},chartElement:v.value,onToggleFullscreen:ge,onGeneratePdf:e.unref(W),onGenerateCsv:_,onGenerateImage:e.unref(Z),onToggleTable:ee,onToggleLabels:te,onToggleTooltip:oe},e.createSlots({_:2},[t.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,t.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,t.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,t.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,t.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,t.$slots.optionLabels?{name:"optionLabels",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionLabels",{},void 0,!0)]),key:"5"}:void 0,t.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:r,isFullscreen:d})=>[e.renderSlot(t.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:r,isFullscreen:d})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasLabel","hasFullscreen","isTooltip","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),c.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(p.XMLNS),viewBox:U.value,class:e.normalizeClass({"vue-data-ui-fullscreen--on":S.value,"vue-data-ui-fulscreen--off":!S.value}),style:e.normalizeStyle(`overflow: hidden; background:${o.value.style.chart.backgroundColor};color:${o.value.style.chart.color}`),onClick:l[0]||(l[0]=e.withModifiers(r=>de(r),["stop"]))},[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Object.keys(ue.value),r=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`gradient_${r}`,cx:"50%",cy:"30%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(p.lightenHexColor)(r,.5)},null,8,qe),e.createElementVNode("stop",{offset:"100%","stop-color":r},null,8,Ae)],8,He))),256))]),e.createVNode(Le,{dataset:C.value,color:o.value.style.chart.links.stroke,backgroundColor:o.value.style.chart.backgroundColor},null,8,["dataset","color","backgroundColor"]),e.createVNode(Se,{dataset:C.value,hoveredUid:T.value,stroke:o.value.style.chart.nodes.stroke,strokeHovered:o.value.style.chart.nodes.strokeHovered,onZoom:ce,onHover:fe},null,8,["dataset","hoveredUid","stroke","strokeHovered"]),k.value.showDataLabels?(e.openBlock(),e.createBlock(Me,{key:0,dataset:C.value,color:o.value.style.chart.color,hoveredUid:T.value},null,8,["dataset","color","hoveredUid"])):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"svg",{svg:x.value},void 0,!0)],14,Oe)):e.createCommentVNode("",!0),P.value?(e.openBlock(),e.createBlock(Ue,{key:`direction_pad_${D.value}`,color:o.value.style.chart.color,isFullscreen:S.value,onMoveLeft:l[1]||(l[1]=r=>M("left")),onMoveRight:l[2]||(l[2]=r=>M("right")),onMoveTop:l[3]||(l[3]=r=>M("top")),onMoveBottom:l[4]||(l[4]=r=>M("bottom")),onReset:l[5]||(l[5]=r=>{I(),P.value=!1})},null,8,["color","isFullscreen"])):e.createCommentVNode("",!0),t.$slots.watermark?(e.openBlock(),e.createElementBlock("div",je,[e.renderSlot(t.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(X)||e.unref(Y)})),void 0,!0)])):e.createCommentVNode("",!0),c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Pe.default,{key:5,config:{type:"molecule",style:{backgroundColor:o.value.style.chart.backgroundColor,molecule:{color:"#CCCCCC"}}}},null,8,["config"])),e.createVNode(Fe._sfc_main,{show:k.value.showTooltip&&i.value,backgroundColor:o.value.style.chart.tooltip.backgroundColor,color:o.value.style.chart.tooltip.color,borderRadius:o.value.style.chart.tooltip.borderRadius,borderColor:o.value.style.chart.tooltip.borderColor,borderWidth:o.value.style.chart.tooltip.borderWidth,fontSize:o.value.style.chart.tooltip.fontSize,backgroundOpacity:o.value.style.chart.tooltip.backgroundOpacity,position:o.value.style.chart.tooltip.position,offsetY:o.value.style.chart.tooltip.offsetY,parent:v.value,content:b.value,isCustom:o.value.style.chart.tooltip.customFormat&&typeof o.value.style.chart.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(t.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...q.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(t.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...q.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isCustom"]),c.value?(e.openBlock(),e.createBlock(Ne.default,{key:6,hideDetails:"",config:{open:k.value.showTable,maxHeight:1e4,body:{backgroundColor:o.value.style.chart.backgroundColor,color:o.value.style.chart.color},head:{backgroundColor:o.value.style.chart.backgroundColor,color:o.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode($e.DataTable,{colNames:N.value.colNames,head:N.value.head,body:N.value.body,config:N.value.config,title:`${o.value.style.chart.title.text}${o.value.style.chart.title.subtitle.text?` : ${o.value.style.chart.title.subtitle.text}`:""}`,onClose:l[6]||(l[6]=r=>k.value.showTable=!1)},{th:e.withCtx(({th:r})=>[e.createElementVNode("div",{innerHTML:r,style:{display:"flex","align-items":"center"}},null,8,Ge)]),td:e.withCtx(({td:r})=>[e.createTextVNode(e.toDisplayString(r.name||r),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,Ie))}},Ye=Ee._export_sfc(Xe,[["__scopeId","data-v-a8f784eb"]]);exports.default=Ye;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),p=require("./index-DDwHKEGb.cjs"),we=require("./Title-B6PVw0aK.cjs"),re=require("./usePrinter-CRKoRqbE.cjs"),$e=require("./DataTable-DkoeHXI5.cjs"),Fe=require("./Tooltip-Ci47DnuY.cjs"),z=require("./BaseIcon-HycAYj53.cjs"),Pe=require("./vue-ui-skeleton-BeqLQi6X.cjs"),Ne=require("./vue-ui-accordion-BBDPcl3d.cjs"),ne=require("./useNestedProp-BbpR9SM4.cjs"),Ee=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Te=["cx","cy","r","fill","stroke","stroke-width","onClick","onMouseover"],Se={__name:"RecursiveCircles",props:{color:{type:String,default:"#000000"},dataset:{type:Array,default:()=>[]},hoveredUid:{type:String,default:null},linkColor:{type:String,default:"#CCCCCC"},stroke:{type:String,default:"#FFFFFF"},strokeHovered:{type:String,default:"#000000"}},emits:["zoom","hover"],setup(n,{emit:g}){const y=n;function u(a){g("zoom",a)}function c(a){g("hover",a)}return e.toRef(y,"dataset").value.forEach(a=>{a.nodes&&a.nodes.length>0&&a.nodes.forEach(i=>{i.ancestor=a})}),(a,i)=>{const b=e.resolveComponent("RecursiveCircles",!0);return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.dataset,v=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[v.polygonPath&&v.polygonPath.coordinates?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.polygonPath.coordinates,(F,P)=>(e.openBlock(),e.createElementBlock("circle",{cx:F.x,cy:F.y,r:v.circleRadius,fill:`url(#gradient_${v.color})`,stroke:n.hoveredUid&&n.hoveredUid===v.uid?n.strokeHovered:n.stroke,"stroke-width":n.hoveredUid&&n.hoveredUid===v.uid?v.circleRadius/6:v.circleRadius/12,style:{cursor:"pointer"},onClick:e.withModifiers(h=>u(v),["stop"]),onMouseover:h=>c(v),onMouseleave:i[0]||(i[0]=h=>c(null))},null,40,Te))),256)),v.nodes&&v.nodes.length>0?(e.openBlock(),e.createBlock(b,{key:0,dataset:v.nodes,color:n.color,stroke:n.stroke,strokeHovered:n.strokeHovered,hoveredUid:n.hoveredUid,onZoom:u,onHover:c},null,8,["dataset","color","stroke","strokeHovered","hoveredUid"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64))),256)}}},Ve=["x1","y1","x2","y2","stroke","stroke-width"],Re=["x1","y1","x2","y2","stroke","stroke-width"],Le={__name:"RecursiveLinks",props:{dataset:{type:Array,default:()=>[]},color:{type:String,default:"#DDDDDD"},backgroundColor:{type:String,default:"#FFFFFF"}},setup(n){const g=n;return e.toRef(g,"dataset").value.forEach(u=>{u.nodes&&u.nodes.length>0&&u.nodes.forEach(c=>{c.ancestor=u})}),(u,c)=>{const B=e.resolveComponent("RecursiveLinks",!0);return e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.dataset,a=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[a.polygonPath&&a.polygonPath.coordinates?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(a.polygonPath.coordinates,(i,b)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[a.ancestor&&a.ancestor.polygonPath?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("line",{x1:i.x,y1:i.y,x2:a.ancestor.polygonPath.coordinates[0].x,y2:a.ancestor.polygonPath.coordinates[0].y,stroke:n.backgroundColor,"stroke-width":a.circleRadius/1.5},null,8,Ve),e.createElementVNode("line",{x1:i.x,y1:i.y,x2:a.ancestor.polygonPath.coordinates[0].x,y2:a.ancestor.polygonPath.coordinates[0].y,stroke:n.color,"stroke-width":a.circleRadius/2},null,8,Re)],64)):e.createCommentVNode("",!0)],64))),256)):e.createCommentVNode("",!0)],64))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.dataset,a=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[a.polygonPath&&a.polygonPath.coordinates?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[a.nodes&&a.nodes.length>0?(e.openBlock(),e.createBlock(B,{key:0,dataset:a.nodes,color:n.color,backgroundColor:n.backgroundColor},null,8,["dataset","color","backgroundColor"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64))),256))],64)}}},ze=["x","y","fill","font-size"],Me={__name:"RecursiveLabels",props:{color:{type:String,default:"#000000"},dataset:{type:Array,default:()=>[]},hoveredUid:{type:String,default:null}},emits:["zoom","hover"],setup(n,{emit:g}){const y=n;return e.toRef(y,"dataset").value.forEach(c=>{c.nodes&&c.nodes.length>0&&c.nodes.forEach(B=>{B.ancestor=c})}),(c,B)=>{const a=e.resolveComponent("RecursiveLabels",!0);return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.dataset,i=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[i.polygonPath&&i.polygonPath.coordinates?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.polygonPath.coordinates,b=>(e.openBlock(),e.createElementBlock("text",{x:b.x,y:b.y+i.circleRadius*2,fill:n.color,"font-size":i.circleRadius,"text-anchor":"middle",style:{opacity:"0.8","pointer-events":"none"}},e.toDisplayString(i.name),9,ze))),256)),i.nodes&&i.nodes.length>0?(e.openBlock(),e.createBlock(a,{key:0,dataset:i.nodes,color:n.color,hoveredUid:n.hoveredUid},null,8,["dataset","color","hoveredUid"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64))),256)}}},De={style:{position:"relative",height:"100%",width:"100%"}},Ue={__name:"BaseDirectionPad",props:{color:{type:String,default:"#FF0000"},isFullscreen:{type:Boolean,default:!1}},emits:["moveLeft","moveTop","moveRight","moveBottom","reset"],setup(n,{emit:g}){return(y,u)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`position: ${n.isFullscreen?"fixed":"absolute"};bottom:0;right:${n.isFullscreen?"12px":"0"};width:80px;height:80px`),"data-html2canvas-ignore":""},[e.createElementVNode("div",De,[e.createElementVNode("button",{onClick:u[0]||(u[0]=e.withModifiers(c=>g("moveLeft"),["stop"])),style:{position:"absolute",left:"0",top:"50%",transform:"translateY(-50%)",height:"24px",width:"24px",padding:"0",background:"transparent",border:"none",display:"flex","align-items":"center","justify-content":"center"}},[e.createVNode(z.default,{stroke:n.color,name:"arrowLeft",style:{cursor:"pointer"}},null,8,["stroke"])]),e.createElementVNode("button",{onClick:u[1]||(u[1]=e.withModifiers(c=>g("moveTop"),["stop"])),style:{position:"absolute",top:"0",left:"50%",transform:"translateX(-50%)",height:"24px",width:"24px",padding:"0",background:"transparent",border:"none",display:"flex","align-items":"center","justify-content":"center"}},[e.createVNode(z.default,{stroke:n.color,name:"arrowTop",style:{cursor:"pointer"}},null,8,["stroke"])]),e.createElementVNode("button",{onClick:u[2]||(u[2]=e.withModifiers(c=>g("moveRight"),["stop"])),style:{position:"absolute",right:"0",top:"50%",transform:"translateY(-50%)",height:"24px",width:"24px",padding:"0",background:"transparent",border:"none",display:"flex","align-items":"center","justify-content":"center"}},[e.createVNode(z.default,{stroke:n.color,name:"arrowRight",style:{cursor:"pointer"}},null,8,["stroke"])]),e.createElementVNode("button",{onClick:u[3]||(u[3]=e.withModifiers(c=>g("moveBottom"),["stop"])),style:{position:"absolute",bottom:"0",left:"50%",transform:"translateX(-50%)",height:"24px",width:"24px",padding:"0",background:"transparent",border:"none",display:"flex","align-items":"center","justify-content":"center"}},[e.createVNode(z.default,{stroke:n.color,name:"arrowBottom",style:{cursor:"pointer"}},null,8,["stroke"])]),e.createElementVNode("button",{onClick:u[4]||(u[4]=e.withModifiers(c=>g("reset"),["stop"])),style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%,-50%)",height:"24px",width:"24px",padding:"0",background:"transparent",border:"none",display:"flex","align-items":"center","justify-content":"center"}},[e.createVNode(z.default,{stroke:n.color,name:"close",style:{cursor:"pointer"},strokeWidth:2},null,8,["stroke"])])])],4))}},Ie=["id"],Oe=["xmlns","viewBox"],He=["id"],qe=["stop-color"],Ae=["stop-color"],je={key:4,class:"vue-data-ui-watermark"},Ge=["innerHTML"],Xe={__name:"vue-ui-molecule",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(n,{expose:g}){const y=n,{vue_ui_molecule:u}=p.useConfig(),c=e.computed(()=>!!y.dataset&&y.dataset.length);e.onMounted(()=>{p.objectIsEmpty(y.dataset)&&p.error({componentName:"VueUiMolecule",type:"dataset"})});const B=e.ref(p.createUid()),a=e.ref(null),i=e.ref(!1),b=e.ref(""),v=e.ref(null),F=e.ref(null),P=e.ref(!1),h=e.ref(null),G=e.ref(null),D=e.ref(0),o=e.computed(()=>{const t=ne.useNestedProp({userConfig:y.config,defaultConfig:u});return t.theme?{...ne.useNestedProp({userConfig:p.themes.vue_ui_molecule[t.theme]||y.config,defaultConfig:t}),customPalette:p.themePalettes[t.theme]||p.palette}:t}),{isPrinting:X,isImaging:Y,generatePdf:W,generateImage:Z}=re.usePrinter({elementId:`cluster_${B.value}`,fileName:o.value.style.chart.title.text||"vue-ui-molecule"}),ae=e.computed(()=>p.convertCustomPalette(o.value.customPalette)),k=e.ref({showTable:o.value.table.show,showDataLabels:!0,showTooltip:o.value.style.chart.tooltip.show});function J(t,l=0){return Array.isArray(t)&&t.length>0&&t[0].nodes?J(t[0].nodes,l+1):l}function se(){const t=J(y.dataset);let l=100,r=l;for(let d=0;d<t;d+=1)l/=1,r+=l;return{height:r,width:r}}const x=e.ref(se()),U=e.ref(`0 0 ${x.value.width} ${x.value.height}`);function K(t,l={x:-x.value.width/2.43,y:x.value.height/2},r=x.value.width/1.1,d=24,s=0,f=0,V="#BBBBBB"){if(t&&t.length>0){const A=p.createPolygonPath({plot:l,radius:r,sides:t.length,rotation:s});t.forEach((m,$)=>{const R=A.coordinates[$];let w;if(m.ancestor?m.ancestor.ancestor?w=m.ancestor.color||V:(w=ae.value[f]||p.palette[f]||V,f+=1):w=V,m.polygonPath={coordinates:[R]},m.circleRadius=d,m.color=w,m.uid=p.createUid(),m.nodes&&m.nodes.length>0){const j=!m.ancestor||!m.ancestor.ancestor?f:0;m.nodes=K(m.nodes,R,r/2.9,d/2.2,s+Math.PI*$/m.nodes.length,j,w)}})}return t}function ie(t){const l=new Set;function r(s){s.forEach(f=>{f.color&&!l.has(f.color)&&l.add(f.color),f.nodes&&f.nodes.length>0&&r(f.nodes)})}r(t);const d={};return Array.from(l).forEach((s,f)=>{d[s]=`gradient_${f}`}),d}const ue=e.computed(()=>ie(C.value)),C=e.computed(()=>K(y.dataset));function I(){P.value=!1,F.value=null,G.value=null,h.value=null,H({polygonPath:{coordinates:[{x:x.value.width/2,y:x.value.height/2}]},circleRadius:24})}const O=e.ref(null);function H(t){v.value.focus(),e.nextTick(()=>{O.value&&cancelAnimationFrame(O.value);const l=U.value.split(" "),r=parseFloat(l[0]),d=parseFloat(l[1]),s=parseFloat(l[2]),f=parseFloat(l[3]),{x:V,y:A}=t.polygonPath.coordinates[0],{circleRadius:m}=t,$=8.34,R=V-m*$,w=A-m*$,j=m*$*2,ye=m*$*2,ke=Math.sqrt((R-r)**2+(w-d)**2),L=Math.min(1200,Math.max(20,Math.floor(ke/10))),be=(R-r)/L,Ce=(w-d)/L,Be=(j-s)/L,xe=(ye-f)/L;let E=0;function le(){U.value=`${r+be*E} ${d+Ce*E} ${s+Be*E} ${f+xe*E}`,E+=o.value.style.chart.zoom.speed,E<=L&&(O.value=requestAnimationFrame(le))}le()})}function ce(t){F.value===t.uid?I():(F.value=t.uid,G.value=t,h.value={circleRadius:t.circleRadius,polygonPath:{coordinates:[{x:t.polygonPath.coordinates[0].x,y:t.polygonPath.coordinates[0].y}]}},H(t),P.value=t.uid!==C.value[0].uid)}function de(t){if(t.target.nodeName!=="circle")I(),P.value=!1;else return}const q=e.ref(null);function ve(t){q.value={datapoint:t,seriesIndex:-1,series:C.value,config:o.value};const l=o.value.style.chart.tooltip.customFormat;if(p.isFunction(l)&&p.functionReturnsString(()=>l({seriesIndex:-1,datapoint:t,series:C.value,config:o.value})))b.value=l({seriesIndex:-1,datapoint:t,series:C.value,config:o.value});else{let r="";r+=`<div style="display:flex;align-items:center;gap:3px"><div style="color:${t.color}">⬤</div><div>${t.name}</div></div>`,t.details&&(r+=`<div style="width:100%;border-top:1px solid ${o.value.style.chart.tooltip.borderColor};margin-top: 2px">${t.details}</div>`),b.value=`<div style="font-family:inherit">${r}</div>`}}const Q=e.ref(null),T=e.ref(null);function fe(t){Q.value=t,t?(i.value=!0,ve(t),T.value=t.uid):(i.value=!1,b.value="",T.value=null)}function M(t){t==="right"&&(h.value.polygonPath.coordinates[0].x+=h.value.circleRadius),t==="left"&&(h.value.polygonPath.coordinates[0].x-=h.value.circleRadius),t==="top"&&(h.value.polygonPath.coordinates[0].y-=h.value.circleRadius),t==="bottom"&&(h.value.polygonPath.coordinates[0].y+=h.value.circleRadius),H(h.value)}function me(t){const l=[];function r(d){d.forEach(s=>{const f={name:s.name,details:s.details||"-",ancestor:s.ancestor&&s.ancestor.name||"-",color:s.color||""};l.push(f),s.nodes&&s.nodes.length>0&&r(s.nodes,s.name)})}return r(t),l}const pe=e.computed(()=>me(C.value)),N=e.computed(()=>{const t=[o.value.table.translations.nodeName,o.value.table.translations.details,o.value.table.translations.ancestor],l=pe.value.map((s,f)=>[{color:s.color,name:s.name},s.details,s.ancestor||""]),r={th:{backgroundColor:o.value.table.th.backgroundColor,color:o.value.table.th.color,outline:o.value.table.th.outline},td:{backgroundColor:o.value.table.td.backgroundColor,color:o.value.table.td.color,outline:o.value.table.td.outline},breakpoint:o.value.table.responsiveBreakpoint},d=[o.value.table.translations.nodeName,o.value.table.translations.details,o.value.table.translations.ancestor];return{head:t,body:l,config:r,colNames:d}});function _(){e.nextTick(()=>{const t=N.value.body.map((d,s)=>[[d[0].name],[d[1]],[d[2]]]),l=[[o.value.style.chart.title.text],[o.value.style.chart.title.subtitle.text],[[...N.value.head]]].concat(t),r=p.createCsvContent(l);p.downloadCsv({csvContent:r,title:o.value.style.chart.title.text||"vue-ui-molecule"})})}function he(){return C.value}const S=e.ref(!1);function ge(t){S.value=t,D.value+=1}function ee(){k.value.showTable=!k.value.showTable}function te(){k.value.showDataLabels=!k.value.showDataLabels}function oe(){k.value.showTooltip=!k.value.showTooltip}return g({getData:he,generatePdf:W,generateCsv:_,generateImage:Z,toggleTable:ee,toggleLabels:te,toggleTooltip:oe}),(t,l)=>(e.openBlock(),e.createElementBlock("div",{onMouseleave:l[7]||(l[7]=r=>{Q.value=null,T.value=null}),ref_key:"moleculeChart",ref:v,class:e.normalizeClass(`vue-ui-molecule ${S.value?"vue-data-ui-wrapper-fullscreen":""}`),style:e.normalizeStyle(`font-family:${o.value.style.fontFamily};width:100%; text-align:center;background:${o.value.style.chart.backgroundColor}`),id:`cluster_${B.value}`},[o.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:100%;background:${o.value.style.chart.backgroundColor};`)},[e.createVNode(we._sfc_main,{config:{title:{cy:"molecule-div-title",...o.value.style.chart.title},subtitle:{cy:"molecule-div-subtitle",...o.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),o.value.userOptions.show&&c.value?(e.openBlock(),e.createBlock(re.UserOptions,{ref_key:"details",ref:a,key:`user_options_${D.value}`,backgroundColor:o.value.style.chart.backgroundColor,color:o.value.style.chart.color,isPrinting:e.unref(X),isImaging:e.unref(Y),uid:B.value,hasTooltip:o.value.userOptions.buttons.tooltip&&o.value.style.chart.tooltip.show,hasPdf:o.value.userOptions.buttons.pdf,hasXls:o.value.userOptions.buttons.csv,hasImg:o.value.userOptions.buttons.img,hasTable:o.value.userOptions.buttons.table,hasLabel:o.value.userOptions.buttons.labels,hasFullscreen:o.value.userOptions.buttons.fullscreen,isTooltip:k.value.showTooltip,titles:{...o.value.userOptions.buttonTitles},chartElement:v.value,onToggleFullscreen:ge,onGeneratePdf:e.unref(W),onGenerateCsv:_,onGenerateImage:e.unref(Z),onToggleTable:ee,onToggleLabels:te,onToggleTooltip:oe},e.createSlots({_:2},[t.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,t.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,t.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,t.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,t.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,t.$slots.optionLabels?{name:"optionLabels",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionLabels",{},void 0,!0)]),key:"5"}:void 0,t.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:r,isFullscreen:d})=>[e.renderSlot(t.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:r,isFullscreen:d})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasLabel","hasFullscreen","isTooltip","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),c.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(p.XMLNS),viewBox:U.value,class:e.normalizeClass({"vue-data-ui-fullscreen--on":S.value,"vue-data-ui-fulscreen--off":!S.value}),style:e.normalizeStyle(`overflow: hidden; background:${o.value.style.chart.backgroundColor};color:${o.value.style.chart.color}`),onClick:l[0]||(l[0]=e.withModifiers(r=>de(r),["stop"]))},[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Object.keys(ue.value),r=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`gradient_${r}`,cx:"50%",cy:"30%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(p.lightenHexColor)(r,.5)},null,8,qe),e.createElementVNode("stop",{offset:"100%","stop-color":r},null,8,Ae)],8,He))),256))]),e.createVNode(Le,{dataset:C.value,color:o.value.style.chart.links.stroke,backgroundColor:o.value.style.chart.backgroundColor},null,8,["dataset","color","backgroundColor"]),e.createVNode(Se,{dataset:C.value,hoveredUid:T.value,stroke:o.value.style.chart.nodes.stroke,strokeHovered:o.value.style.chart.nodes.strokeHovered,onZoom:ce,onHover:fe},null,8,["dataset","hoveredUid","stroke","strokeHovered"]),k.value.showDataLabels?(e.openBlock(),e.createBlock(Me,{key:0,dataset:C.value,color:o.value.style.chart.color,hoveredUid:T.value},null,8,["dataset","color","hoveredUid"])):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"svg",{svg:x.value},void 0,!0)],14,Oe)):e.createCommentVNode("",!0),P.value?(e.openBlock(),e.createBlock(Ue,{key:`direction_pad_${D.value}`,color:o.value.style.chart.color,isFullscreen:S.value,onMoveLeft:l[1]||(l[1]=r=>M("left")),onMoveRight:l[2]||(l[2]=r=>M("right")),onMoveTop:l[3]||(l[3]=r=>M("top")),onMoveBottom:l[4]||(l[4]=r=>M("bottom")),onReset:l[5]||(l[5]=r=>{I(),P.value=!1})},null,8,["color","isFullscreen"])):e.createCommentVNode("",!0),t.$slots.watermark?(e.openBlock(),e.createElementBlock("div",je,[e.renderSlot(t.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(X)||e.unref(Y)})),void 0,!0)])):e.createCommentVNode("",!0),c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Pe.default,{key:5,config:{type:"molecule",style:{backgroundColor:o.value.style.chart.backgroundColor,molecule:{color:"#CCCCCC"}}}},null,8,["config"])),e.createVNode(Fe._sfc_main,{show:k.value.showTooltip&&i.value,backgroundColor:o.value.style.chart.tooltip.backgroundColor,color:o.value.style.chart.tooltip.color,borderRadius:o.value.style.chart.tooltip.borderRadius,borderColor:o.value.style.chart.tooltip.borderColor,borderWidth:o.value.style.chart.tooltip.borderWidth,fontSize:o.value.style.chart.tooltip.fontSize,backgroundOpacity:o.value.style.chart.tooltip.backgroundOpacity,position:o.value.style.chart.tooltip.position,offsetY:o.value.style.chart.tooltip.offsetY,parent:v.value,content:b.value,isCustom:o.value.style.chart.tooltip.customFormat&&typeof o.value.style.chart.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(t.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...q.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(t.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...q.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isCustom"]),c.value?(e.openBlock(),e.createBlock(Ne.default,{key:6,hideDetails:"",config:{open:k.value.showTable,maxHeight:1e4,body:{backgroundColor:o.value.style.chart.backgroundColor,color:o.value.style.chart.color},head:{backgroundColor:o.value.style.chart.backgroundColor,color:o.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode($e.DataTable,{colNames:N.value.colNames,head:N.value.head,body:N.value.body,config:N.value.config,title:`${o.value.style.chart.title.text}${o.value.style.chart.title.subtitle.text?` : ${o.value.style.chart.title.subtitle.text}`:""}`,onClose:l[6]||(l[6]=r=>k.value.showTable=!1)},{th:e.withCtx(({th:r})=>[e.createElementVNode("div",{innerHTML:r,style:{display:"flex","align-items":"center"}},null,8,Ge)]),td:e.withCtx(({td:r})=>[e.createTextVNode(e.toDisplayString(r.name||r),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,Ie))}},Ye=Ee._export_sfc(Xe,[["__scopeId","data-v-a8f784eb"]]);exports.default=Ye;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { computed as c, onMounted as ie, ref as C, openBlock as n, createElementBlock as g, normalizeClass as G, normalizeStyle as T, createVNode as E, createCommentVNode as i, createBlock as h, unref as r, createSlots as de, withCtx as m, renderSlot as p, normalizeProps as U, guardReactiveProps as H, createElementVNode as a, Fragment as R, renderList as X, toDisplayString as $, createTextVNode as K, nextTick as ce } from "vue";
|
|
2
|
-
import { u as ye, o as ve, e as q, c as he, t as me, M as fe, X as ke, w as F, v as ge, N as pe, i as Y, f as A, q as be, r as Ce } from "./index-
|
|
3
|
-
import { _ as xe } from "./Title-
|
|
4
|
-
import { u as _e, U as we } from "./usePrinter-
|
|
5
|
-
import { L as $e } from "./Legend-
|
|
6
|
-
import M from "./BaseIcon-
|
|
7
|
-
import { D as Me } from "./DataTable-
|
|
8
|
-
import Ne from "./vue-ui-skeleton-
|
|
9
|
-
import Pe from "./vue-ui-accordion-
|
|
10
|
-
import { u as J } from "./useNestedProp-
|
|
2
|
+
import { u as ye, o as ve, e as q, c as he, t as me, M as fe, X as ke, w as F, v as ge, N as pe, i as Y, f as A, q as be, r as Ce } from "./index-b22AFna7.js";
|
|
3
|
+
import { _ as xe } from "./Title-CzxknLI3.js";
|
|
4
|
+
import { u as _e, U as we } from "./usePrinter-C_wOlUXy.js";
|
|
5
|
+
import { L as $e } from "./Legend-Cpk8DCWi.js";
|
|
6
|
+
import M from "./BaseIcon-D93rtrSm.js";
|
|
7
|
+
import { D as Me } from "./DataTable-Bwco5wF0.js";
|
|
8
|
+
import Ne from "./vue-ui-skeleton-c0TzbjC0.js";
|
|
9
|
+
import Pe from "./vue-ui-accordion-H9MtAuZL.js";
|
|
10
|
+
import { u as J } from "./useNestedProp-6FL791Qt.js";
|
|
11
11
|
import { _ as Le } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
12
12
|
const Te = ["id"], Ae = ["xmlns", "viewBox"], Ie = ["id"], Fe = ["stop-color"], Oe = ["stop-color"], Se = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], Ve = ["d", "stroke", "stroke-width"], je = ["stroke"], Be = ["fill"], De = ["stroke"], We = ["fill"], ze = ["stroke"], Ge = ["fill"], Ee = ["stroke"], Ue = ["fill"], He = ["stroke"], Re = ["fill"], Xe = ["d", "stroke", "stroke-width", "fill"], Ke = ["x1", "y1", "stroke"], qe = ["cx", "cy", "fill", "stroke"], Ye = ["fill", "stroke"], Je = ["y", "fill", "font-weight"], Qe = ["y", "fill"], Ze = {
|
|
13
13
|
key: 3,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-DnCegWge.cjs"),W=require("./Title-BYDRRvqX.cjs"),B=require("./usePrinter-C94KiYaY.cjs"),G=require("./Legend-CkIdFaKE.cjs"),k=require("./BaseIcon-wCGYJ8GM.cjs"),U=require("./DataTable-Dr67tL_4.cjs"),H=require("./vue-ui-skeleton-Cey15-vY.cjs"),R=require("./vue-ui-accordion-CG_G9ock.cjs"),E=require("./useNestedProp-18FTwhUW.cjs"),X=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),K=["id"],Y=["xmlns","viewBox"],J=["id"],Q=["stop-color"],Z=["stop-color"],ee=["x1","y1","x2","y2","stroke","stroke-width"],te=["d","stroke","stroke-width"],le=["stroke"],oe=["fill"],ae=["stroke"],re=["fill"],ne=["stroke"],se=["fill"],ue=["stroke"],ie=["fill"],ce=["stroke"],de=["fill"],ye=["d","stroke","stroke-width","fill"],ve=["x1","y1","stroke"],me=["cx","cy","fill","stroke"],he=["fill","stroke"],fe=["y","fill","font-weight"],ke=["y","fill"],pe={key:3,class:"vue-data-ui-watermark"},ge=["onClick"],be={style:{"font-weight":"bold"}},Ce=["innerHTML"],Ne={__name:"vue-ui-mood-radar",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(L,{expose:S}){const s=L,{vue_ui_mood_radar:T}=r.useConfig(),m=e.computed(()=>!!s.dataset&&Object.keys(s.dataset).length);e.onMounted(()=>{r.objectIsEmpty(s.dataset)&&r.error({componentName:"VueUiMoodRadar",type:"dataset"})});const h=e.ref(r.createUid()),N=e.ref(null),A=e.ref(null),n=e.ref(null),t=e.computed(()=>{const o=E.useNestedProp({userConfig:s.config,defaultConfig:T});return o.theme?{...E.useNestedProp({userConfig:r.themes.vue_ui_mood_radar[o.theme]||s.config,defaultConfig:o})}:o}),{isPrinting:x,isImaging:w,generatePdf:_,generateImage:V}=B.usePrinter({elementId:h.value,fileName:t.value.style.chart.title.text||"vue-ui-mood-radar"}),p=e.ref({showTable:t.value.table.show}),d=e.computed(()=>({height:256,width:256})),C=e.computed(()=>r.createPolygonPath({plot:{x:128,y:d.value.height/2},radius:90,sides:5,rotation:11}));function I({centerX:o,centerY:a,apexX:l,apexY:u,proportion:c,key:f,value:q}){return{x:o+(l-o)*c,y:a+(u-a)*c,key:f,value:q}}const F=e.computed(()=>Math.max(...Object.values(s.dataset).map(o=>isNaN(o)?0:o))),v=e.computed(()=>Object.values(s.dataset).reduce((o,a)=>(isNaN(o)?0:o)+(isNaN(a)?0:a),0)),i=e.computed(()=>Object.keys(s.dataset).map((o,a)=>{const l=typeof s.dataset[o]!="number"||isNaN(s.dataset[o])?0:s.dataset[o];return{index:a,key:o,value:l,proportion:l/v.value,color:t.value.style.chart.layout.smileys.colors[o]}}).sort((o,a)=>a.key-o.key)),$=e.computed(()=>m.value?(["1","2","3","4","5"].forEach(o=>{[null,void 0].includes(s.dataset[o])&&r.error({componentName:"VueUiMoodRadar",type:"datasetAttribute",property:o})}),C.value.coordinates.map((o,a)=>{const l=I({centerX:d.value.width/2,centerY:d.value.height/2,apexX:o.x,apexY:o.y,proportion:i.value[a].value/F.value,key:i.value[a].key,value:i.value[a].value});return{...o,plots:l,key:i.value[a].key}})):[]),O=e.computed(()=>({cy:"mood-radar-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""}));function D(o){o===n.value?n.value=null:n.value=o}const y=e.computed(()=>{const o=i.value.map(l=>({name:l.key,color:l.color})),a=i.value.map(l=>isNaN(l.value)?0:l.value);return{head:o,body:a}});function M(){e.nextTick(()=>{const o=y.value.head.map((u,c)=>[[u.name],[y.value.body[c]],[isNaN(y.value.body[c]/v.value)?"-":y.value.body[c]/v.value*100]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(o),l=r.createCsvContent(a);r.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-mood-radar"})})}const g=e.computed(()=>{const o=[' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>',Number(v.value.toFixed(t.value.table.td.roundingValue)).toLocaleString(),"100%"],a=y.value.head.map((c,f)=>[{color:c.color,name:c.name},y.value.body[f].toFixed(t.value.table.td.roundingValue),isNaN(y.value.body[f]/v.value)?"-":(y.value.body[f]/v.value*100).toFixed(t.value.table.td.roundingPercentage)+"%"]),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},u=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage];return{head:o,body:a,config:l,colNames:u}});function z(){return i.value}function P(){p.value.showTable=!p.value.showTable}const b=e.ref(!1);function j(o){b.value=o}return S({getData:z,generatePdf:_,generateCsv:M,generateImage:V,toggleTable:P}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-mood-radar ${b.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),ref_key:"moodRadarChart",ref:N,id:`${h.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor}`)},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor}`)},[e.createVNode(W._sfc_main,{config:{title:{cy:"mood-radar-title",...t.value.style.chart.title},subtitle:{cy:"mood-radar-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&m.value?(e.openBlock(),e.createBlock(B.UserOptions,{key:1,ref_key:"details",ref:A,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(x),isImaging:e.unref(w),uid:h.value,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,titles:{...t.value.userOptions.buttonTitles},chartElement:N.value,onToggleFullscreen:j,onGeneratePdf:e.unref(_),onGenerateCsv:M,onGenerateImage:e.unref(V),onToggleTable:P},e.createSlots({_:2},[o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:u})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:u})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),m.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(r.XMLNS),viewBox:`0 0 ${d.value.width} ${d.value.height}`,class:e.normalizeClass({"vue-data-ui-fullscreen--on":b.value,"vue-data-ui-fulscreen--off":!b.value}),style:e.normalizeStyle(`overflow:visible;background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`mood_radar_gradient_${h.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.chart.layout.dataPolygon.color+e.unref(r.opacity)[t.value.style.chart.layout.dataPolygon.opacity]},null,8,Q),e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(r.shiftHue)(t.value.style.chart.layout.dataPolygon.color,t.value.style.chart.layout.dataPolygon.gradient.intensity/100)}${e.unref(r.opacity)[t.value.style.chart.layout.dataPolygon.opacity]}`},null,8,Z)],8,J)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value.coordinates,l=>(e.openBlock(),e.createElementBlock("line",{x1:d.value.width/2,y1:d.value.height/2,x2:l.x,y2:l.y,stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth},null,8,ee))),256)),e.createElementVNode("path",{d:C.value.path,fill:"none",stroke:t.value.style.chart.layout.outerPolygon.stroke,"stroke-width":t.value.style.chart.layout.outerPolygon.strokeWidth,"stroke-linejoin":"round","stroke-linecap":"round"},null,8,te),e.createElementVNode("path",{fill:"none",stroke:t.value.style.chart.layout.smileys.colors[5],"stroke-width":"1","stroke-linecap":"round",d:"M119 25A1 1 0 00137 25 1 1 0 00119 25M123 26C124 33 132 33 133 26L123 26M123 22A1 1 0 00126 22 1 1 0 00123 22M130 22A1 1 0 00133 22 1 1 0 00130 22"},null,8,le),e.createElementVNode("circle",{class:"vue-ui-mood-radar-trap",onMouseenter:a[0]||(a[0]=l=>n.value=5),onMouseleave:a[1]||(a[1]=l=>n.value=null),cx:"128",cy:"25",r:"20",fill:n.value===5?t.value.style.chart.layout.smileys.colors[5]+"33":"transparent"},null,40,oe),e.createElementVNode("path",{fill:"none",stroke:t.value.style.chart.layout.smileys.colors[4],"stroke-width":"1","stroke-linecap":"round",d:"M218 95A1 1 0 00236 95 1 1 0 00218 95M222 97C225 99 229 99 232 97M222 92A1 1 0 00225 92 1 1 0 00222 92M229 92A1 1 0 00232 92 1 1 0 00229 92"},null,8,ae),e.createElementVNode("circle",{class:"vue-ui-mood-radar-trap",onMouseenter:a[2]||(a[2]=l=>n.value=4),onMouseleave:a[3]||(a[3]=l=>n.value=null),cx:"227",cy:"95.5",r:"20",fill:n.value===4?t.value.style.chart.layout.smileys.colors[4]+"33":"transparent"},null,40,re),e.createElementVNode("path",{fill:"none",stroke:t.value.style.chart.layout.smileys.colors[3],"stroke-width":"1","stroke-linecap":"round",d:"M181 213A1 1 0 00199 213 1 1 0 00181 213M185 210A1 1 0 00188 210 1 1 0 00185 210M192 210A1 1 0 00195 210 1 1 0 00192 210M185 215 195 215"},null,8,ne),e.createElementVNode("circle",{class:"vue-ui-mood-radar-trap",onMouseenter:a[4]||(a[4]=l=>n.value=3),onMouseleave:a[5]||(a[5]=l=>n.value=null),cx:"190",cy:"213.5",r:"20",fill:n.value===3?t.value.style.chart.layout.smileys.colors[3]+"33":"transparent"},null,40,se),e.createElementVNode("path",{fill:"none",stroke:t.value.style.chart.layout.smileys.colors[2],"stroke-width":"1","stroke-linecap":"round",d:"M56 213A1 1 0 0074 213 1 1 0 0056 213M60 216C63 214 67 214 70 216M60 210A1 1 0 0063 210 1 1 0 0060 210M67 210A1 1 0 0070 210 1 1 0 0067 210"},null,8,ue),e.createElementVNode("circle",{class:"vue-ui-mood-radar-trap",onMouseenter:a[6]||(a[6]=l=>n.value=2),onMouseleave:a[7]||(a[7]=l=>n.value=null),cx:"65",cy:"213.5",r:"20",fill:n.value===2?t.value.style.chart.layout.smileys.colors[2]+"33":"transparent"},null,40,ie),e.createElementVNode("path",{fill:"none",stroke:t.value.style.chart.layout.smileys.colors[1],"stroke-width":"1","stroke-linecap":"round",d:"M20 96A1 1 0 0038 96 1 1 0 0020 96M24 100C25 95 33 95 34 100L24 100M24 93A1 1 0 0027 93 1 1 0 0024 93M31 93A1 1 0 0034 93 1 1 0 0031 93"},null,8,ce),e.createElementVNode("circle",{class:"vue-ui-mood-radar-trap",onMouseenter:a[8]||(a[8]=l=>n.value=1),onMouseleave:a[9]||(a[9]=l=>n.value=null),cx:"29",cy:"95.5",r:"20",fill:n.value===1?t.value.style.chart.layout.smileys.colors[1]+"33":"transparent"},null,40,de),e.createElementVNode("path",{d:e.unref(r.makePath)($.value.map(l=>l.plots)),stroke:t.value.style.chart.layout.dataPolygon.stroke,"stroke-width":t.value.style.chart.layout.dataPolygon.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round",fill:t.value.style.chart.layout.dataPolygon.gradient.show?`url(#mood_radar_gradient_${h.value})`:t.value.style.chart.layout.dataPolygon.color+e.unref(r.opacity)[t.value.style.chart.layout.dataPolygon.opacity]},null,8,ye),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value.map(l=>l.plots),(l,u)=>(e.openBlock(),e.createElementBlock("g",{class:"vue-ui-mood-radar-trap",style:e.normalizeStyle(`opacity:${n.value==l.key?"1":"0"}`)},[e.createElementVNode("line",{x1:l.x,y1:l.y,x2:128,y2:128,stroke:t.value.style.chart.layout.smileys.colors[l.key]},null,8,ve),e.createElementVNode("circle",{cx:l.x,cy:l.y,fill:t.value.style.chart.layout.smileys.colors[l.key],r:"3",stroke:t.value.style.chart.backgroundColor,"stroke-width":.5},null,8,me),e.createElementVNode("circle",{cx:128,cy:128,fill:t.value.style.chart.layout.smileys.colors[l.key],r:"3",stroke:t.value.style.chart.backgroundColor,"stroke-width":.5},null,8,he),e.createElementVNode("text",{x:128,y:["5",5].includes(l.key)?145:120,fill:t.value.style.chart.layout.dataLabel.color,"font-size":"12","text-anchor":"middle","font-weight":t.value.style.chart.layout.dataLabel.bold?"bold":"normal"},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.dataLabel.formatter,l.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.dataLabel.prefix,v:l.value,s:t.value.style.chart.layout.dataLabel.suffix,r:t.value.style.chart.layout.dataLabel.roundingValue}),{datapoint:l,seriesIndex:u})),9,fe),e.createElementVNode("text",{x:128,y:["5",5].includes(l.key)?163:102,fill:t.value.style.chart.layout.dataLabel.color,"font-size":"12","text-anchor":"middle"}," ("+e.toDisplayString(e.unref(r.dataLabel)({v:l.value/v.value*100,s:"%",r:t.value.style.chart.layout.dataLabel.roundingPercentage}))+") ",9,ke)],4))),256)),e.renderSlot(o.$slots,"svg",{svg:d.value},void 0,!0)],14,Y)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",pe,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(x)||e.unref(w)})),void 0,!0)])):e.createCommentVNode("",!0),m.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(H.default,{key:4,config:{type:"radar",style:{backgroundColor:t.value.style.chart.backgroundColor,radar:{grid:{color:"#CCCCCC"},shapes:{color:"#CCCCCC"}}}}},null,8,["config"])),t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(G.Legend,{key:5,legendSet:i.value,config:O.value,style:{display:"flex","row-gap":"6px"}},{item:e.withCtx(({legend:l,index:u})=>[e.createElementVNode("div",{onClick:()=>D(l.key),style:{display:"flex","flex-direction":"row",gap:"3px","align-items":"center",margin:"3px 0"}},[l.key==1?(e.openBlock(),e.createBlock(k.default,{key:0,strokeWidth:1,name:"moodSad",stroke:t.value.style.chart.layout.smileys.colors[l.key]},null,8,["stroke"])):e.createCommentVNode("",!0),l.key==2?(e.openBlock(),e.createBlock(k.default,{key:1,strokeWidth:1,name:"moodFlat",stroke:t.value.style.chart.layout.smileys.colors[l.key]},null,8,["stroke"])):e.createCommentVNode("",!0),l.key==3?(e.openBlock(),e.createBlock(k.default,{key:2,strokeWidth:1,name:"moodNeutral",stroke:t.value.style.chart.layout.smileys.colors[l.key]},null,8,["stroke"])):e.createCommentVNode("",!0),l.key==4?(e.openBlock(),e.createBlock(k.default,{key:3,strokeWidth:1,name:"smiley",stroke:t.value.style.chart.layout.smileys.colors[l.key]},null,8,["stroke"])):e.createCommentVNode("",!0),l.key==5?(e.openBlock(),e.createBlock(k.default,{key:4,strokeWidth:1,name:"moodHappy",stroke:t.value.style.chart.layout.smileys.colors[l.key]},null,8,["stroke"])):e.createCommentVNode("",!0),e.createElementVNode("span",be,e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.dataLabel.formatter,l.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.dataLabel.prefix,v:l.value,s:t.value.style.chart.layout.dataLabel.suffix,r:t.value.style.chart.layout.dataLabel.roundingValue}),{datapoint:l,seriesIndex:u})),1),e.createTextVNode(" ("+e.toDisplayString(e.unref(r.dataLabel)({v:l.proportion*100,s:"%",r:t.value.style.chart.legend.roundingPercentage}))+") ",1)],8,ge)]),_:1},8,["legendSet","config"])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"legend",{legend:i.value},void 0,!0),m.value?(e.openBlock(),e.createBlock(R.default,{key:6,hideDetails:"",config:{open:p.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.createVNode(U.DataTable,{colNames:g.value.colNames,head:g.value.head,body:g.value.body,config:g.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:a[10]||(a[10]=l=>p.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,Ce)]),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)],14,K))}},xe=X._export_sfc(Ne,[["__scopeId","data-v-1399dfb6"]]);exports.default=xe;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-DDwHKEGb.cjs"),W=require("./Title-B6PVw0aK.cjs"),B=require("./usePrinter-CRKoRqbE.cjs"),G=require("./Legend-CTlJpdAi.cjs"),k=require("./BaseIcon-HycAYj53.cjs"),U=require("./DataTable-DkoeHXI5.cjs"),H=require("./vue-ui-skeleton-BeqLQi6X.cjs"),R=require("./vue-ui-accordion-BBDPcl3d.cjs"),E=require("./useNestedProp-BbpR9SM4.cjs"),X=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),K=["id"],Y=["xmlns","viewBox"],J=["id"],Q=["stop-color"],Z=["stop-color"],ee=["x1","y1","x2","y2","stroke","stroke-width"],te=["d","stroke","stroke-width"],le=["stroke"],oe=["fill"],ae=["stroke"],re=["fill"],ne=["stroke"],se=["fill"],ue=["stroke"],ie=["fill"],ce=["stroke"],de=["fill"],ye=["d","stroke","stroke-width","fill"],ve=["x1","y1","stroke"],me=["cx","cy","fill","stroke"],he=["fill","stroke"],fe=["y","fill","font-weight"],ke=["y","fill"],pe={key:3,class:"vue-data-ui-watermark"},ge=["onClick"],be={style:{"font-weight":"bold"}},Ce=["innerHTML"],Ne={__name:"vue-ui-mood-radar",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(L,{expose:S}){const s=L,{vue_ui_mood_radar:T}=r.useConfig(),m=e.computed(()=>!!s.dataset&&Object.keys(s.dataset).length);e.onMounted(()=>{r.objectIsEmpty(s.dataset)&&r.error({componentName:"VueUiMoodRadar",type:"dataset"})});const h=e.ref(r.createUid()),N=e.ref(null),A=e.ref(null),n=e.ref(null),t=e.computed(()=>{const o=E.useNestedProp({userConfig:s.config,defaultConfig:T});return o.theme?{...E.useNestedProp({userConfig:r.themes.vue_ui_mood_radar[o.theme]||s.config,defaultConfig:o})}:o}),{isPrinting:x,isImaging:w,generatePdf:_,generateImage:V}=B.usePrinter({elementId:h.value,fileName:t.value.style.chart.title.text||"vue-ui-mood-radar"}),p=e.ref({showTable:t.value.table.show}),d=e.computed(()=>({height:256,width:256})),C=e.computed(()=>r.createPolygonPath({plot:{x:128,y:d.value.height/2},radius:90,sides:5,rotation:11}));function I({centerX:o,centerY:a,apexX:l,apexY:u,proportion:c,key:f,value:q}){return{x:o+(l-o)*c,y:a+(u-a)*c,key:f,value:q}}const F=e.computed(()=>Math.max(...Object.values(s.dataset).map(o=>isNaN(o)?0:o))),v=e.computed(()=>Object.values(s.dataset).reduce((o,a)=>(isNaN(o)?0:o)+(isNaN(a)?0:a),0)),i=e.computed(()=>Object.keys(s.dataset).map((o,a)=>{const l=typeof s.dataset[o]!="number"||isNaN(s.dataset[o])?0:s.dataset[o];return{index:a,key:o,value:l,proportion:l/v.value,color:t.value.style.chart.layout.smileys.colors[o]}}).sort((o,a)=>a.key-o.key)),$=e.computed(()=>m.value?(["1","2","3","4","5"].forEach(o=>{[null,void 0].includes(s.dataset[o])&&r.error({componentName:"VueUiMoodRadar",type:"datasetAttribute",property:o})}),C.value.coordinates.map((o,a)=>{const l=I({centerX:d.value.width/2,centerY:d.value.height/2,apexX:o.x,apexY:o.y,proportion:i.value[a].value/F.value,key:i.value[a].key,value:i.value[a].value});return{...o,plots:l,key:i.value[a].key}})):[]),O=e.computed(()=>({cy:"mood-radar-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""}));function D(o){o===n.value?n.value=null:n.value=o}const y=e.computed(()=>{const o=i.value.map(l=>({name:l.key,color:l.color})),a=i.value.map(l=>isNaN(l.value)?0:l.value);return{head:o,body:a}});function M(){e.nextTick(()=>{const o=y.value.head.map((u,c)=>[[u.name],[y.value.body[c]],[isNaN(y.value.body[c]/v.value)?"-":y.value.body[c]/v.value*100]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(o),l=r.createCsvContent(a);r.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-mood-radar"})})}const g=e.computed(()=>{const o=[' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>',Number(v.value.toFixed(t.value.table.td.roundingValue)).toLocaleString(),"100%"],a=y.value.head.map((c,f)=>[{color:c.color,name:c.name},y.value.body[f].toFixed(t.value.table.td.roundingValue),isNaN(y.value.body[f]/v.value)?"-":(y.value.body[f]/v.value*100).toFixed(t.value.table.td.roundingPercentage)+"%"]),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},u=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage];return{head:o,body:a,config:l,colNames:u}});function z(){return i.value}function P(){p.value.showTable=!p.value.showTable}const b=e.ref(!1);function j(o){b.value=o}return S({getData:z,generatePdf:_,generateCsv:M,generateImage:V,toggleTable:P}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-mood-radar ${b.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),ref_key:"moodRadarChart",ref:N,id:`${h.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor}`)},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor}`)},[e.createVNode(W._sfc_main,{config:{title:{cy:"mood-radar-title",...t.value.style.chart.title},subtitle:{cy:"mood-radar-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&m.value?(e.openBlock(),e.createBlock(B.UserOptions,{key:1,ref_key:"details",ref:A,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(x),isImaging:e.unref(w),uid:h.value,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,titles:{...t.value.userOptions.buttonTitles},chartElement:N.value,onToggleFullscreen:j,onGeneratePdf:e.unref(_),onGenerateCsv:M,onGenerateImage:e.unref(V),onToggleTable:P},e.createSlots({_:2},[o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:u})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:u})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),m.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(r.XMLNS),viewBox:`0 0 ${d.value.width} ${d.value.height}`,class:e.normalizeClass({"vue-data-ui-fullscreen--on":b.value,"vue-data-ui-fulscreen--off":!b.value}),style:e.normalizeStyle(`overflow:visible;background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`mood_radar_gradient_${h.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.chart.layout.dataPolygon.color+e.unref(r.opacity)[t.value.style.chart.layout.dataPolygon.opacity]},null,8,Q),e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(r.shiftHue)(t.value.style.chart.layout.dataPolygon.color,t.value.style.chart.layout.dataPolygon.gradient.intensity/100)}${e.unref(r.opacity)[t.value.style.chart.layout.dataPolygon.opacity]}`},null,8,Z)],8,J)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value.coordinates,l=>(e.openBlock(),e.createElementBlock("line",{x1:d.value.width/2,y1:d.value.height/2,x2:l.x,y2:l.y,stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth},null,8,ee))),256)),e.createElementVNode("path",{d:C.value.path,fill:"none",stroke:t.value.style.chart.layout.outerPolygon.stroke,"stroke-width":t.value.style.chart.layout.outerPolygon.strokeWidth,"stroke-linejoin":"round","stroke-linecap":"round"},null,8,te),e.createElementVNode("path",{fill:"none",stroke:t.value.style.chart.layout.smileys.colors[5],"stroke-width":"1","stroke-linecap":"round",d:"M119 25A1 1 0 00137 25 1 1 0 00119 25M123 26C124 33 132 33 133 26L123 26M123 22A1 1 0 00126 22 1 1 0 00123 22M130 22A1 1 0 00133 22 1 1 0 00130 22"},null,8,le),e.createElementVNode("circle",{class:"vue-ui-mood-radar-trap",onMouseenter:a[0]||(a[0]=l=>n.value=5),onMouseleave:a[1]||(a[1]=l=>n.value=null),cx:"128",cy:"25",r:"20",fill:n.value===5?t.value.style.chart.layout.smileys.colors[5]+"33":"transparent"},null,40,oe),e.createElementVNode("path",{fill:"none",stroke:t.value.style.chart.layout.smileys.colors[4],"stroke-width":"1","stroke-linecap":"round",d:"M218 95A1 1 0 00236 95 1 1 0 00218 95M222 97C225 99 229 99 232 97M222 92A1 1 0 00225 92 1 1 0 00222 92M229 92A1 1 0 00232 92 1 1 0 00229 92"},null,8,ae),e.createElementVNode("circle",{class:"vue-ui-mood-radar-trap",onMouseenter:a[2]||(a[2]=l=>n.value=4),onMouseleave:a[3]||(a[3]=l=>n.value=null),cx:"227",cy:"95.5",r:"20",fill:n.value===4?t.value.style.chart.layout.smileys.colors[4]+"33":"transparent"},null,40,re),e.createElementVNode("path",{fill:"none",stroke:t.value.style.chart.layout.smileys.colors[3],"stroke-width":"1","stroke-linecap":"round",d:"M181 213A1 1 0 00199 213 1 1 0 00181 213M185 210A1 1 0 00188 210 1 1 0 00185 210M192 210A1 1 0 00195 210 1 1 0 00192 210M185 215 195 215"},null,8,ne),e.createElementVNode("circle",{class:"vue-ui-mood-radar-trap",onMouseenter:a[4]||(a[4]=l=>n.value=3),onMouseleave:a[5]||(a[5]=l=>n.value=null),cx:"190",cy:"213.5",r:"20",fill:n.value===3?t.value.style.chart.layout.smileys.colors[3]+"33":"transparent"},null,40,se),e.createElementVNode("path",{fill:"none",stroke:t.value.style.chart.layout.smileys.colors[2],"stroke-width":"1","stroke-linecap":"round",d:"M56 213A1 1 0 0074 213 1 1 0 0056 213M60 216C63 214 67 214 70 216M60 210A1 1 0 0063 210 1 1 0 0060 210M67 210A1 1 0 0070 210 1 1 0 0067 210"},null,8,ue),e.createElementVNode("circle",{class:"vue-ui-mood-radar-trap",onMouseenter:a[6]||(a[6]=l=>n.value=2),onMouseleave:a[7]||(a[7]=l=>n.value=null),cx:"65",cy:"213.5",r:"20",fill:n.value===2?t.value.style.chart.layout.smileys.colors[2]+"33":"transparent"},null,40,ie),e.createElementVNode("path",{fill:"none",stroke:t.value.style.chart.layout.smileys.colors[1],"stroke-width":"1","stroke-linecap":"round",d:"M20 96A1 1 0 0038 96 1 1 0 0020 96M24 100C25 95 33 95 34 100L24 100M24 93A1 1 0 0027 93 1 1 0 0024 93M31 93A1 1 0 0034 93 1 1 0 0031 93"},null,8,ce),e.createElementVNode("circle",{class:"vue-ui-mood-radar-trap",onMouseenter:a[8]||(a[8]=l=>n.value=1),onMouseleave:a[9]||(a[9]=l=>n.value=null),cx:"29",cy:"95.5",r:"20",fill:n.value===1?t.value.style.chart.layout.smileys.colors[1]+"33":"transparent"},null,40,de),e.createElementVNode("path",{d:e.unref(r.makePath)($.value.map(l=>l.plots)),stroke:t.value.style.chart.layout.dataPolygon.stroke,"stroke-width":t.value.style.chart.layout.dataPolygon.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round",fill:t.value.style.chart.layout.dataPolygon.gradient.show?`url(#mood_radar_gradient_${h.value})`:t.value.style.chart.layout.dataPolygon.color+e.unref(r.opacity)[t.value.style.chart.layout.dataPolygon.opacity]},null,8,ye),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value.map(l=>l.plots),(l,u)=>(e.openBlock(),e.createElementBlock("g",{class:"vue-ui-mood-radar-trap",style:e.normalizeStyle(`opacity:${n.value==l.key?"1":"0"}`)},[e.createElementVNode("line",{x1:l.x,y1:l.y,x2:128,y2:128,stroke:t.value.style.chart.layout.smileys.colors[l.key]},null,8,ve),e.createElementVNode("circle",{cx:l.x,cy:l.y,fill:t.value.style.chart.layout.smileys.colors[l.key],r:"3",stroke:t.value.style.chart.backgroundColor,"stroke-width":.5},null,8,me),e.createElementVNode("circle",{cx:128,cy:128,fill:t.value.style.chart.layout.smileys.colors[l.key],r:"3",stroke:t.value.style.chart.backgroundColor,"stroke-width":.5},null,8,he),e.createElementVNode("text",{x:128,y:["5",5].includes(l.key)?145:120,fill:t.value.style.chart.layout.dataLabel.color,"font-size":"12","text-anchor":"middle","font-weight":t.value.style.chart.layout.dataLabel.bold?"bold":"normal"},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.dataLabel.formatter,l.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.dataLabel.prefix,v:l.value,s:t.value.style.chart.layout.dataLabel.suffix,r:t.value.style.chart.layout.dataLabel.roundingValue}),{datapoint:l,seriesIndex:u})),9,fe),e.createElementVNode("text",{x:128,y:["5",5].includes(l.key)?163:102,fill:t.value.style.chart.layout.dataLabel.color,"font-size":"12","text-anchor":"middle"}," ("+e.toDisplayString(e.unref(r.dataLabel)({v:l.value/v.value*100,s:"%",r:t.value.style.chart.layout.dataLabel.roundingPercentage}))+") ",9,ke)],4))),256)),e.renderSlot(o.$slots,"svg",{svg:d.value},void 0,!0)],14,Y)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",pe,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(x)||e.unref(w)})),void 0,!0)])):e.createCommentVNode("",!0),m.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(H.default,{key:4,config:{type:"radar",style:{backgroundColor:t.value.style.chart.backgroundColor,radar:{grid:{color:"#CCCCCC"},shapes:{color:"#CCCCCC"}}}}},null,8,["config"])),t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(G.Legend,{key:5,legendSet:i.value,config:O.value,style:{display:"flex","row-gap":"6px"}},{item:e.withCtx(({legend:l,index:u})=>[e.createElementVNode("div",{onClick:()=>D(l.key),style:{display:"flex","flex-direction":"row",gap:"3px","align-items":"center",margin:"3px 0"}},[l.key==1?(e.openBlock(),e.createBlock(k.default,{key:0,strokeWidth:1,name:"moodSad",stroke:t.value.style.chart.layout.smileys.colors[l.key]},null,8,["stroke"])):e.createCommentVNode("",!0),l.key==2?(e.openBlock(),e.createBlock(k.default,{key:1,strokeWidth:1,name:"moodFlat",stroke:t.value.style.chart.layout.smileys.colors[l.key]},null,8,["stroke"])):e.createCommentVNode("",!0),l.key==3?(e.openBlock(),e.createBlock(k.default,{key:2,strokeWidth:1,name:"moodNeutral",stroke:t.value.style.chart.layout.smileys.colors[l.key]},null,8,["stroke"])):e.createCommentVNode("",!0),l.key==4?(e.openBlock(),e.createBlock(k.default,{key:3,strokeWidth:1,name:"smiley",stroke:t.value.style.chart.layout.smileys.colors[l.key]},null,8,["stroke"])):e.createCommentVNode("",!0),l.key==5?(e.openBlock(),e.createBlock(k.default,{key:4,strokeWidth:1,name:"moodHappy",stroke:t.value.style.chart.layout.smileys.colors[l.key]},null,8,["stroke"])):e.createCommentVNode("",!0),e.createElementVNode("span",be,e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.dataLabel.formatter,l.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.dataLabel.prefix,v:l.value,s:t.value.style.chart.layout.dataLabel.suffix,r:t.value.style.chart.layout.dataLabel.roundingValue}),{datapoint:l,seriesIndex:u})),1),e.createTextVNode(" ("+e.toDisplayString(e.unref(r.dataLabel)({v:l.proportion*100,s:"%",r:t.value.style.chart.legend.roundingPercentage}))+") ",1)],8,ge)]),_:1},8,["legendSet","config"])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"legend",{legend:i.value},void 0,!0),m.value?(e.openBlock(),e.createBlock(R.default,{key:6,hideDetails:"",config:{open:p.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.createVNode(U.DataTable,{colNames:g.value.colNames,head:g.value.head,body:g.value.body,config:g.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:a[10]||(a[10]=l=>p.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,Ce)]),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)],14,K))}},xe=X._export_sfc(Ne,[["__scopeId","data-v-1399dfb6"]]);exports.default=xe;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-DDwHKEGb.cjs"),ae=require("./useResponsive-B3TrDDIG.cjs"),ye=require("./Title-B6PVw0aK.cjs"),oe=require("./usePrinter-CRKoRqbE.cjs"),me=require("./DataTable-DkoeHXI5.cjs"),be=require("./Tooltip-Ci47DnuY.cjs"),ge=require("./Legend-CTlJpdAi.cjs"),ke=require("./vue-ui-skeleton-BeqLQi6X.cjs"),Ce=require("./vue-ui-accordion-BBDPcl3d.cjs"),ne=require("./useNestedProp-BbpR9SM4.cjs"),Le=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),A=x=>(e.pushScopeId("data-v-7f596bd8"),x=x(),e.popScopeId(),x),xe=["id"],we=["xmlns","viewBox"],Be=["id","fr"],_e=A(()=>e.createElementVNode("stop",{offset:"0%","stop-color":"#FFFFFF","stop-opacity":"0"},null,-1)),Ne=["offset","stop-opacity"],$e=A(()=>e.createElementVNode("stop",{offset:"100%","stop-color":"#FFFFFF","stop-opacity":"0"},null,-1)),Se=["id"],Ee=["id"],Ve=A(()=>e.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)),Fe=["id"],Te=["flood-color"],De=["cx","cy","r","fill","filter"],ze=["d","fill","stroke","stroke-width","filter"],Pe={key:0},Ie=["d","fill"],Oe={key:1},Ae=["x","y","font-size","font-weight","fill"],Me={key:2},Re=["filter"],Ue=["text-anchor","x","y","fill","font-size","font-weight"],qe=["text-anchor","x","y","fill","font-size","font-weight"],Ye=["text-anchor","x","y","fill","font-size","font-weight"],Xe=["d","fill","onMouseenter","onClick"],Ge={key:3,class:"vue-data-ui-watermark"},We={key:0,class:"vue-ui-nested-donuts-legend-title"},He=["onClick"],Je=["innerHTML"],Ke={__name:"vue-ui-nested-donuts",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(x,{expose:re,emit:M}){const C=x,{vue_ui_nested_donuts:se}=r.useConfig(),N=e.computed(()=>!!C.dataset&&C.dataset.length),f=e.ref(r.createUid()),F=e.ref(!1),T=e.ref(""),ue=e.ref(null),R=e.ref(0),w=e.ref(null),U=e.ref(null),D=e.ref(null),B=e.ref(!1);function ie(l){B.value=l,R.value+=1}const t=e.computed(()=>{const l=ne.useNestedProp({userConfig:C.config,defaultConfig:se});return l.theme?{...ne.useNestedProp({userConfig:r.themes.vue_ui_nested_donuts[l.theme]||C.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}),$=e.ref(null);e.onMounted(()=>{if(r.objectIsEmpty(C.dataset)&&r.error({componentName:"VueUiNestedDonuts",type:"dataset"}),t.value.responsive){const l=ae.throttle(()=>{const{width:s,height:a}=ae.useResponsive({chart:w.value,title:t.value.style.chart.title.text?U.value:null,legend:t.value.style.chart.legend.show?D.value:null});c.value.width=s,c.value.height=a});$.value=new ResizeObserver(l),$.value.observe(w.value.parentNode)}}),e.onBeforeUnmount(()=>{$.value&&$.value.disconnect()});const{isPrinting:q,isImaging:Y,generatePdf:X,generateImage:G}=oe.usePrinter({elementId:`nested_donuts_${f.value}`,fileName:t.value.style.chart.title.text||"vue-ui-nested-donuts"}),ce=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),p=e.ref({dataLabels:{show:t.value.style.chart.layout.labels.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),c=e.ref({height:512,width:512});function de({datapoint:l,index:s}){M("selectDatapoint",{datapoint:l,index:s})}const v=e.ref([]),m=e.computed(()=>(C.dataset.forEach((l,s)=>{[null,void 0].includes(l.name)&&r.error({componentName:"VueUiNestedDonuts",type:"datasetSerieAttribute",property:"name",index:s}),[null,void 0].includes(l.series)?r.error({componentName:"VueUiNestedDonuts",type:"datasetSerieAttribute",property:"series",index:s}):l.series.length===0?r.error({componentName:"VueUiNestedDonuts",type:"datasetAttributeEmpty",property:`series at index ${s}`}):l.series.forEach((a,o)=>{[null,void 0].includes(a.name)&&r.error({componentName:"VueUiNestedDonuts",type:"datasetSerieAttribute",property:"name",index:o,key:"serie"}),[null,void 0].includes(a.values)&&r.error({componentName:"VueUiNestedDonuts",type:"datasetSerieAttribute",property:"values",index:o,key:"serie"})})}),C.dataset.map((l,s)=>({...l,total:l.series.filter(a=>!v.value.includes(a.id)).map(a=>r.sanitizeArray(a.values).reduce((o,n)=>o+n,0)).reduce((a,o)=>a+o,0),datasetIndex:s,id:`${f.value}_${s}`,series:l.series.map((a,o)=>({name:a.name,arcOf:l.name,arcOfId:`${f.value}_${s}`,id:`${f.value}_${s}_${o}`,seriesIndex:o,datasetIndex:s,color:r.convertColorToHex(a.color)||ce.value[o]||r.palette[o]||r.palette[o%r.palette.length],value:r.sanitizeArray(a.values).reduce((n,u)=>n+u,0),absoluteValues:a.values||[]}))}))));e.ref(t.value.style.chart.layout.donut.strokeWidth);const b=e.computed(()=>Math.min(c.value.height,c.value.width)*(t.value.style.chart.layout.donut.strokeWidth/512)),W=e.computed(()=>[...m.value].map((l,s)=>{const a=l.series.filter(o=>!v.value.includes(o.id)).map(o=>o.value).reduce((o,n)=>o+n,0);return{...l,total:a,series:l.series.filter(o=>!v.value.includes(o.id)).map(o=>({...o,proportion:o.value/a}))}}));function ve(l,s,a){let o=0;for(let n=0;n<l.length;n+=1)a.includes(l[n])&&(o+=1);return o<s}const d=e.ref(W.value);e.watch(()=>W.value,l=>d.value=l);const H=e.ref(null),J=e.ref(null);function z(l){M("selectLegend",l);const s=m.value.flatMap(i=>i.series).find(i=>i.id===l.id),a=d.value.flatMap(i=>i.series).find(i=>i.id===l.id);let n=a?a.value:0;const u=m.value.find(i=>i.id===s.arcOfId).series.map(i=>i.id),h=ve(u,u.length-1,v.value);if(v.value.includes(l.id)){let i=function(){n>s.value?(cancelAnimationFrame(H.value),d.value=d.value.map(y=>({...y,series:y.series.map(g=>g.id==l.id?{...g,value:s.value}:g)}))):(n+=s.value*.025,d.value=d.value.map(y=>({...y,series:y.series.map(g=>g.id===l.id?{...g,value:n}:g)})),H.value=requestAnimationFrame(i))};v.value=v.value.filter(y=>y!==l.id),i()}else if(h){let i=function(){n<.1?(cancelAnimationFrame(J.value),v.value.push(l.id),d.value=d.value.map((y,g)=>({...y,series:y.series.map(L=>L.id===l.id?{...L,value:0}:L)}))):(n/=1.1,d.value=d.value.map((y,g)=>({...y,series:y.series.map(L=>L.id===l.id?{...L,value:n}:L)})),J.value=requestAnimationFrame(i))};i()}}const _=e.computed(()=>d.value.map((l,s)=>{const a=s*b.value/m.value.length;return{...l,radius:b.value-a,donut:r.makeDonut({series:l.series},c.value.width/2,c.value.height/2,b.value-a,b.value-a,1.99999,2,1,360,105.25,b.value/m.value.length*t.value.style.chart.layout.donut.spacingRatio)}})),K=e.computed(()=>[...m.value].map((l,s)=>{const a=s*b.value/m.value.length;return{sizeRatio:a,donut:r.makeDonut({series:[{value:1}]},c.value.width/2,c.value.height/2,b.value-a,b.value-a,1.99999,2,1,360,105.25,b.value/m.value.length*t.value.style.chart.layout.donut.spacingRatio)[0]}})),Q=e.ref(null),S=e.ref(null),E=e.ref(null),P=e.ref(null);function fe({datapoint:l,_relativeIndex:s,seriesIndex:a}){Q.value=l.arcOfId,S.value=l.id,E.value=a,P.value={datapoint:l,seriesIndex:a,series:d.value,config:t.value};const o=t.value.style.chart.tooltip.customFormat;if(r.isFunction(o)&&r.functionReturnsString(()=>o({seriesIndex:a,datapoint:l,series:d.value,config:t.value})))T.value=o({seriesIndex:a,datapoint:l,series:d.value,config:t.value});else{let n="";if(t.value.style.chart.tooltip.showAllItemsAtIndex&&v.value.length===0){const u=d.value.map(h=>h.series.find(i=>i.seriesIndex===a));u.forEach((h,i)=>{if(!h)return"";n+=`
|
|
2
2
|
<div style="display:flex; flex-direction: column; justify-content:flex-start; align-items:flex-start;padding:6px 0; ${i<u.length-1?`border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor}`:""}">
|
|
3
3
|
<div style="display:flex; flex-direction: row; gap: 3px; justify-content:flex-start; align-items:center;">
|
|
4
4
|
<svg viewBox="0 0 20 20" height="${t.value.style.chart.tooltip.fontSize}" width="${t.value.style.chart.tooltip.fontSize}">
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { computed as L, ref as c, onMounted as Ue, onBeforeUnmount as Re, watch as Ee, openBlock as u, createElementBlock as n, normalizeClass as P, normalizeStyle as se, createVNode as ue, createCommentVNode as y, createBlock as H, unref as r, createSlots as Ge, withCtx as m, renderSlot as _, normalizeProps as q, guardReactiveProps as J, createElementVNode as b, Fragment as w, renderList as $, toDisplayString as F, createTextVNode as K, nextTick as Ye, pushScopeId as Xe, popScopeId as We } from "vue";
|
|
2
|
-
import { u as He, c as qe, t as Je, a as Ke, p as Q, o as Qe, e as O, b as Ze, F as Ce, d as je, m as Ne, f as C, X as et, H as tt, k as A, n as ne, i as R, x as Se, y as lt, q as at, r as ot } from "./index-
|
|
2
|
+
import { u as He, c as qe, t as Je, a as Ke, p as Q, o as Qe, e as O, b as Ze, F as Ce, d as je, m as Ne, f as C, X as et, H as tt, k as A, n as ne, i as R, x as Se, y as lt, q as at, r as ot } from "./index-b22AFna7.js";
|
|
3
3
|
import { t as st, u as ut } from "./useResponsive-NZB-WLRF.js";
|
|
4
|
-
import { _ as nt } from "./Title-
|
|
5
|
-
import { u as rt, U as it } from "./usePrinter-
|
|
6
|
-
import { D as dt } from "./DataTable-
|
|
7
|
-
import { _ as ct } from "./Tooltip-
|
|
8
|
-
import { L as vt } from "./Legend-
|
|
9
|
-
import ht from "./vue-ui-skeleton-
|
|
10
|
-
import ft from "./vue-ui-accordion-
|
|
11
|
-
import { u as Te } from "./useNestedProp-
|
|
4
|
+
import { _ as nt } from "./Title-CzxknLI3.js";
|
|
5
|
+
import { u as rt, U as it } from "./usePrinter-C_wOlUXy.js";
|
|
6
|
+
import { D as dt } from "./DataTable-Bwco5wF0.js";
|
|
7
|
+
import { _ as ct } from "./Tooltip-DYVjAqo-.js";
|
|
8
|
+
import { L as vt } from "./Legend-Cpk8DCWi.js";
|
|
9
|
+
import ht from "./vue-ui-skeleton-c0TzbjC0.js";
|
|
10
|
+
import ft from "./vue-ui-accordion-H9MtAuZL.js";
|
|
11
|
+
import { u as Te } from "./useNestedProp-6FL791Qt.js";
|
|
12
12
|
import { _ as yt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
13
13
|
const re = (V) => (Xe("data-v-7f596bd8"), V = V(), We(), V), bt = ["id"], pt = ["xmlns", "viewBox"], gt = ["id", "fr"], mt = /* @__PURE__ */ re(() => /* @__PURE__ */ b("stop", {
|
|
14
14
|
offset: "0%",
|