vue-data-ui 2.3.7 → 2.3.9
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-nwrjVtgP.js → Arrow-CyqlT0ih.js} +1 -1
- package/dist/{Arrow-BZtTM41y.cjs → Arrow-Xy7TAWLU.cjs} +1 -1
- package/dist/{BaseIcon-DWx8aSo2.cjs → BaseIcon-DpzJwh5Z.cjs} +1 -1
- package/dist/{BaseIcon-DLlcdgWI.js → BaseIcon-vF6zgXvp.js} +1 -1
- package/dist/{DataTable-BSoyXOFT.cjs → DataTable-DZ7GOCVh.cjs} +1 -1
- package/dist/{DataTable-BFsn-W_6.js → DataTable-Dj8KLJHc.js} +2 -2
- package/dist/{Legend-DZhpxKg4.cjs → Legend-BNUo8JKO.cjs} +1 -1
- package/dist/{Legend-DThjLfzi.js → Legend-MfrOhwon.js} +1 -1
- package/dist/{Shape-CoCdB8es.cjs → Shape-DBYznwuk.cjs} +1 -1
- package/dist/{Shape-DdhpbOB2.js → Shape-fssaGSn1.js} +1 -1
- package/dist/{Slicer-Bb7zhtxv.cjs → Slicer-B8qDEiI2.cjs} +1 -1
- package/dist/{Slicer-CBsGmIKc.js → Slicer-C2VIWW3F.js} +1 -1
- package/dist/{Title-Ci74YZxW.cjs → Title--kLbBq-N.cjs} +1 -1
- package/dist/{Title-CfofmWzW.js → Title-DM6fKrUI.js} +1 -1
- package/dist/{Tooltip-cIpD1ChA.js → Tooltip-CAmd4pzg.js} +1 -1
- package/dist/{Tooltip-BNMjZUBc.cjs → Tooltip-Dwh7A0L5.cjs} +1 -1
- package/dist/{index-DFXgoR1T.cjs → index-CSlObCMJ.cjs} +1 -1
- package/dist/{index-CGb3gF5A.js → index-D0PI50d6.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{useNestedProp-DCBzUHfz.js → useNestedProp-BNV_Y29K.js} +1 -1
- package/dist/{useNestedProp-CbZUIZc0.cjs → useNestedProp-DUXlSjg2.cjs} +1 -1
- package/dist/{usePrinter-DoFYRZKM.cjs → usePrinter-ClpmcbPy.cjs} +1 -1
- package/dist/{usePrinter-VlAyPtaS.js → usePrinter-DJnJEVGy.js} +1 -1
- package/dist/{vue-data-ui-DT5BwtL1.cjs → vue-data-ui-B5epGKMS.cjs} +1 -1
- package/dist/{vue-data-ui-DkU-TK4x.js → vue-data-ui-DLhyTmG3.js} +55 -55
- package/dist/vue-data-ui.cjs +1 -1
- package/dist/vue-data-ui.js +1 -1
- package/dist/{vue-ui-3d-bar-BwdmaNwO.cjs → vue-ui-3d-bar-Dv5Nu-Kz.cjs} +1 -1
- package/dist/{vue-ui-3d-bar-B2ZdZ5yW.js → vue-ui-3d-bar-JeMsTT6R.js} +7 -7
- package/dist/{vue-ui-accordion-Br7xhAKF.js → vue-ui-accordion-C1dTIdYg.js} +3 -3
- package/dist/{vue-ui-accordion-P9OYffC3.cjs → vue-ui-accordion-IPISean4.cjs} +1 -1
- package/dist/{vue-ui-age-pyramid-D_GP1VkP.js → vue-ui-age-pyramid-BPrB-Srk.js} +8 -8
- package/dist/{vue-ui-age-pyramid-CJGz5iEy.cjs → vue-ui-age-pyramid-ytOUpNe5.cjs} +1 -1
- package/dist/{vue-ui-annotator-C9I6Zikz.cjs → vue-ui-annotator-Bp2ylQ-N.cjs} +1 -1
- package/dist/{vue-ui-annotator-BHI5Uicp.js → vue-ui-annotator-DpY8JI03.js} +1 -1
- package/dist/{vue-ui-candlestick-B3Z-Zw-o.cjs → vue-ui-candlestick-BoDWcJYz.cjs} +1 -1
- package/dist/{vue-ui-candlestick-BMz6lY9I.js → vue-ui-candlestick-D_KnLwpq.js} +9 -9
- package/dist/vue-ui-carousel-table-DWUmj6NW.js +330 -0
- package/dist/vue-ui-carousel-table-tPbrubLn.cjs +1 -0
- package/dist/{vue-ui-chestnut-C4vJDydB.cjs → vue-ui-chestnut-BltZicnq.cjs} +1 -1
- package/dist/{vue-ui-chestnut-DikFweqJ.js → vue-ui-chestnut-gUPyB2F7.js} +6 -6
- package/dist/{vue-ui-cursor-CmWl10Om.js → vue-ui-cursor-CBrYcHgg.js} +2 -2
- package/dist/{vue-ui-cursor-CxvSx8wW.cjs → vue-ui-cursor-Mi9mivGV.cjs} +1 -1
- package/dist/{vue-ui-dashboard-CqNO4CkA.js → vue-ui-dashboard-BvJccz-l.js} +2 -2
- package/dist/{vue-ui-dashboard-BRZFA0Yv.cjs → vue-ui-dashboard-DKJRkuMC.cjs} +1 -1
- package/dist/{vue-ui-digits-Bq86VtLg.js → vue-ui-digits-PvPOOZTT.js} +2 -2
- package/dist/{vue-ui-digits-B5AQ1wb4.cjs → vue-ui-digits-UvPWZIkN.cjs} +1 -1
- package/dist/{vue-ui-donut-BSM49MRr.js → vue-ui-donut-CCnmksR_.js} +9 -9
- package/dist/{vue-ui-donut-fUSFXY5z.cjs → vue-ui-donut-DBD9IyRA.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-D4vsG4oJ.cjs → vue-ui-donut-evolution-C2mbsaP5.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-hXH6wndl.js → vue-ui-donut-evolution-DWz0XIkn.js} +9 -9
- package/dist/{vue-ui-dumbbell-CSxoMYt4.cjs → vue-ui-dumbbell-CdQ1eQN_.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-DF7resYk.js → vue-ui-dumbbell-DnhWlDqn.js} +8 -8
- package/dist/{vue-ui-flow-qhWWfhM9.cjs → vue-ui-flow-CXeTBawu.cjs} +1 -1
- package/dist/{vue-ui-flow-2Wc505ek.js → vue-ui-flow-zTfYWLOo.js} +7 -7
- package/dist/{vue-ui-galaxy-DTYcNRMO.cjs → vue-ui-galaxy-Cr1TLsZ-.cjs} +1 -1
- package/dist/{vue-ui-galaxy-C1tqFf2k.js → vue-ui-galaxy-CviL0-9-.js} +9 -9
- package/dist/{vue-ui-gauge-qkz3wSir.js → vue-ui-gauge-0wjKwTcJ.js} +4 -4
- package/dist/{vue-ui-gauge-4oL43tii.cjs → vue-ui-gauge-C8cqiuMs.cjs} +1 -1
- package/dist/vue-ui-heatmap-BempgzJY.cjs +1 -0
- package/dist/{vue-ui-heatmap-SUwlu7rR.js → vue-ui-heatmap-BjX35pDk.js} +227 -227
- package/dist/{vue-ui-kpi-Bw-xbRgX.cjs → vue-ui-kpi-Cwoq-OQZ.cjs} +1 -1
- package/dist/{vue-ui-kpi-jQgfkbVw.js → vue-ui-kpi-DKPUNPyD.js} +2 -2
- package/dist/{vue-ui-mini-loader-DT-Ww_uE.cjs → vue-ui-mini-loader-DYmuLkr_.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-5YEExcv8.js → vue-ui-mini-loader-umbgz-jE.js} +2 -2
- package/dist/{vue-ui-molecule-DA0NQGMP.cjs → vue-ui-molecule-D04xU1nK.cjs} +1 -1
- package/dist/{vue-ui-molecule-sddRGEOr.js → vue-ui-molecule-DnTFVeGw.js} +9 -9
- package/dist/{vue-ui-mood-radar-BlwtCy7m.js → vue-ui-mood-radar-BdsUM6EW.js} +9 -9
- package/dist/{vue-ui-mood-radar-CUfTRsXf.cjs → vue-ui-mood-radar-wHCxSeNT.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts-CyhCktfb.cjs → vue-ui-nested-donuts--34k7AUI.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts-BYDoEtqK.js → vue-ui-nested-donuts-CX_V9UIk.js} +9 -9
- package/dist/{vue-ui-onion-BiS7G_xb.js → vue-ui-onion-C3scIn1m.js} +9 -9
- package/dist/{vue-ui-onion-DKjJWVtm.cjs → vue-ui-onion-ot5UiFnD.cjs} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-BcZOH5MA.js → vue-ui-parallel-coordinate-plot-BrtFu6_R.js} +10 -10
- package/dist/{vue-ui-parallel-coordinate-plot-CB5WohUW.cjs → vue-ui-parallel-coordinate-plot-CLYNauuG.cjs} +1 -1
- package/dist/{vue-ui-quadrant-BX2Z_BiG.js → vue-ui-quadrant-CZQnq031.js} +10 -10
- package/dist/{vue-ui-quadrant-aRRuJrr1.cjs → vue-ui-quadrant-b3C38Y-z.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-aCDLYVC0.js → vue-ui-quick-chart-CQ_m8VuI.js} +6 -6
- package/dist/{vue-ui-quick-chart-BSov5yuk.cjs → vue-ui-quick-chart-CS1XKyME.cjs} +1 -1
- package/dist/{vue-ui-radar-DGhNZx7E.js → vue-ui-radar-Bk_bQCIc.js} +10 -10
- package/dist/{vue-ui-radar-B3DWzSx8.cjs → vue-ui-radar-ayBCV2nl.cjs} +1 -1
- package/dist/{vue-ui-rating-DI2herA3.cjs → vue-ui-rating-BNAFeqKV.cjs} +1 -1
- package/dist/{vue-ui-rating-QJp1mzIX.js → vue-ui-rating-CwmqAW6j.js} +2 -2
- package/dist/{vue-ui-relation-circle-DRKymwCT.js → vue-ui-relation-circle-B19oCBsQ.js} +5 -5
- package/dist/{vue-ui-relation-circle-Dgk6ILFm.cjs → vue-ui-relation-circle-D__4tmLy.cjs} +1 -1
- package/dist/{vue-ui-rings-m9Gm4w5-.cjs → vue-ui-rings-DWv1YjLY.cjs} +1 -1
- package/dist/{vue-ui-rings-Dc_Xgav-.js → vue-ui-rings-Ekq8eld0.js} +9 -9
- package/dist/{vue-ui-scatter-3p_U1RQz.js → vue-ui-scatter-B5lq6TQb.js} +10 -10
- package/dist/{vue-ui-scatter-CwNnmbpv.cjs → vue-ui-scatter-Djt3w_7K.cjs} +1 -1
- package/dist/{vue-ui-screenshot-Bdg6KSR_.cjs → vue-ui-screenshot-BBTScesQ.cjs} +1 -1
- package/dist/{vue-ui-screenshot-DjN1leGW.js → vue-ui-screenshot-BGEu-1aK.js} +1 -1
- package/dist/{vue-ui-skeleton-B0udzFdQ.js → vue-ui-skeleton-CDB2sB2S.js} +2 -2
- package/dist/{vue-ui-skeleton-CmABeGyu.cjs → vue-ui-skeleton-aEAr9fnx.cjs} +1 -1
- package/dist/{vue-ui-smiley-BJdbZUnl.js → vue-ui-smiley-5sY2rtTd.js} +2 -2
- package/dist/{vue-ui-smiley-CIMwndRh.cjs → vue-ui-smiley-pHCa1uHj.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-BiqhJCi0.cjs → vue-ui-spark-trend-BLYjicGH.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-Bs8wWJc2.js → vue-ui-spark-trend-C6U8pRYP.js} +4 -4
- package/dist/{vue-ui-sparkbar-CDi8i8_Q.js → vue-ui-sparkbar-DdEDQOc8.js} +3 -3
- package/dist/{vue-ui-sparkbar-C2YT0NxS.cjs → vue-ui-sparkbar-e9mZh74f.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-11o7Kgbf.js → vue-ui-sparkgauge-CV0OpVGr.js} +3 -3
- package/dist/{vue-ui-sparkgauge-D7sVelKC.cjs → vue-ui-sparkgauge-S9QibidM.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-DW4yBl5Z.js → vue-ui-sparkhistogram-BCcYAQYV.js} +4 -4
- package/dist/{vue-ui-sparkhistogram-C6nnvqeP.cjs → vue-ui-sparkhistogram-DVc-tjMC.cjs} +1 -1
- package/dist/{vue-ui-sparkline-B-jMIILk.js → vue-ui-sparkline-C6emienJ.js} +3 -3
- package/dist/{vue-ui-sparkline-Bnc9Cv0E.cjs → vue-ui-sparkline-WkYNaf-r.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-cUpn5wUS.js → vue-ui-sparkstackbar-CptWawfp.js} +3 -3
- package/dist/{vue-ui-sparkstackbar-CVyS6viy.cjs → vue-ui-sparkstackbar-oB0fsXWO.cjs} +1 -1
- package/dist/{vue-ui-strip-plot-Dc1Y7Lfz.cjs → vue-ui-strip-plot-D30zeVfM.cjs} +1 -1
- package/dist/{vue-ui-strip-plot-CpfV9-gw.js → vue-ui-strip-plot-Kb7Kk-C8.js} +9 -9
- package/dist/{vue-ui-table-CaCOIekW.js → vue-ui-table-Dqyr1Go9.js} +1 -1
- package/dist/{vue-ui-table-BHENqbW6.cjs → vue-ui-table-FUX1jbtH.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-r9XRz_dD.cjs → vue-ui-table-heatmap-Cqd_rPSG.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-s7r2sGYk.js → vue-ui-table-heatmap-DAWzPS1D.js} +4 -4
- package/dist/{vue-ui-table-sparkline-Dk_FjirH.cjs → vue-ui-table-sparkline-CWSL5RtX.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline-BS7VAPDv.js → vue-ui-table-sparkline-DgUpsNVO.js} +5 -5
- package/dist/{vue-ui-thermometer-DU49ev3a.cjs → vue-ui-thermometer-DDpxHZhQ.cjs} +1 -1
- package/dist/{vue-ui-thermometer-BQLqVj-X.js → vue-ui-thermometer-UZFTkdJs.js} +5 -5
- package/dist/{vue-ui-timer-9QQVkkbc.cjs → vue-ui-timer-CXonfhMU.cjs} +1 -1
- package/dist/{vue-ui-timer-DGM9AHJ5.js → vue-ui-timer-DCexI32t.js} +4 -4
- package/dist/{vue-ui-tiremarks-CJ9xiM-i.cjs → vue-ui-tiremarks-DByzjHco.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-Bxop3uDk.js → vue-ui-tiremarks-UtTUbZUt.js} +5 -5
- package/dist/{vue-ui-treemap-BOEC1m08.cjs → vue-ui-treemap-BT9zMgOs.cjs} +1 -1
- package/dist/{vue-ui-treemap-CQ9rJnkn.js → vue-ui-treemap-DpLJGsie.js} +9 -9
- package/dist/{vue-ui-vertical-bar-CwcIKeM-.js → vue-ui-vertical-bar-B9poCwqT.js} +9 -9
- package/dist/{vue-ui-vertical-bar-BBHN-hhJ.cjs → vue-ui-vertical-bar-BWWvfTkx.cjs} +1 -1
- package/dist/{vue-ui-waffle-DB3cEJx6.js → vue-ui-waffle-BGnyyHVp.js} +83 -83
- package/dist/{vue-ui-waffle-Bg_hB8yK.cjs → vue-ui-waffle-fRaiL6eW.cjs} +1 -1
- package/dist/{vue-ui-wheel-CF6psk6N.js → vue-ui-wheel-7JdR9vyK.js} +5 -5
- package/dist/{vue-ui-wheel-DpTCJpZn.cjs → vue-ui-wheel-C0BVez2R.cjs} +1 -1
- package/dist/{vue-ui-word-cloud-DVu3gTbu.cjs → vue-ui-word-cloud-CDDYvCP9.cjs} +1 -1
- package/dist/{vue-ui-word-cloud-QlpZWR2c.js → vue-ui-word-cloud-S1x3FJQ6.js} +6 -6
- package/dist/{vue-ui-xy-CpcGvBUq.js → vue-ui-xy-DBC1QS_G.js} +12 -12
- package/dist/{vue-ui-xy-DFiOxWGU.cjs → vue-ui-xy-DMkykmZN.cjs} +1 -1
- package/dist/{vue-ui-xy-canvas-CBlzHZ_m.js → vue-ui-xy-canvas-1yb0nuDg.js} +10 -10
- package/dist/{vue-ui-xy-canvas-DR_8n36F.cjs → vue-ui-xy-canvas-B4xzjjjm.cjs} +1 -1
- package/package.json +1 -1
- package/dist/vue-ui-carousel-table-9W-FPpp4.js +0 -314
- package/dist/vue-ui-carousel-table-ZyIsiWGm.cjs +0 -1
- package/dist/vue-ui-heatmap-B8vDpGuW.cjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-DFXgoR1T.cjs"),C=require("./useNestedProp-CbZUIZc0.cjs"),V=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),M={key:0,class:"vue-ui-rating-title",style:{width:"100%"}},F=["src","height","width"],A=["xmlns","height","width"],D=["id"],R=["stop-color"],X=["stop-color"],j=["points","fill","stroke","stroke-width"],I=["src","alt","height","width","id"],O=["xmlns","viewBox","height","id"],Y=["id"],G=["stop-color"],L=["stop-color"],q=["points","fill","stroke"],T=["xmlns","height"],U=["onClick","onMouseenter","onKeyup"],H=["onMouseenter"],K={__name:"vue-ui-rating",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:["rate"],setup($,{expose:k,emit:S}){const s=$,{vue_ui_rating:_}=n.useConfig(),d=e.ref(n.createUid()),p=e.ref(!1),r=e.ref(void 0),g=e.ref([]),t=e.computed(()=>C.useNestedProp({userConfig:s.config,defaultConfig:_})),b=e.computed(()=>typeof s.dataset.rating=="object"&&!Array.isArray(s.dataset.rating)?z(s.dataset.rating):s.dataset.rating),N=e.computed(()=>typeof s.dataset.rating=="object"&&!Array.isArray(s.dataset.rating)),i=e.ref(b.value),f=e.ref(t.value.type==="image"),c=e.ref(t.value.readonly);function z(o){let a=0,l=0;for(const u in o){const E=parseInt(u),h=o[u];a+=E*h,l+=h}if(l===0)return 0;const v=a/l;return Math.min(t.value.to,Math.max(t.value.from,v))}e.onMounted(()=>{n.objectIsEmpty(s.dataset)&&n.error({componentName:"VueUiRating",type:"dataset"});for(let o=t.value.from;o<=t.value.to;o+=1)g.value.push(o)});function y(o,a=!1){return o>r.value||c.value?a?t.value.style.image.inactiveOpacity:t.value.style.star.inactiveColor:a?1:t.value.style.star.useGradient?`url(#star_gradient_under_${d.value})`:t.value.style.star.activeColor}function m(o,a=!1){const l=i.value-o,v=a?1:100;switch(!0){case l<=0:return .001;case l>1:return 1*v;default:return l*v}}function x(o){c.value||(i.value=o,S("rate",o))}function w(){return i.value}function B(o=!0){c.value=o}return k({getData:w,toggleReadonly:B}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`background:${t.value.style.backgroundColor};font-family:${t.value.style.fontFamily};width:100%`),class:"vue-ui-rating",onMouseover:a[2]||(a[2]=l=>p.value=!0),onMouseleave:a[3]||(a[3]=l=>{p.value=!1,r.value=void 0})},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",M,[e.createElementVNode("div",{style:e.normalizeStyle(`color:${t.value.style.title.color};font-weight:${t.value.style.title.bold?"bold":"normal"};text-align:${t.value.style.title.textAlign};margin-bottom:${t.value.style.title.offsetY}px;font-size:${t.value.style.title.fontSize}px`)},e.toDisplayString(t.value.style.title.text),5),t.value.style.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`color:${t.value.style.title.subtitle.color};font-size:${t.value.style.title.subtitle.fontSize}px;text-align:${t.value.style.title.textAlign};margin-bottom:${t.value.style.title.subtitle.offsetY}px;font-weight:${t.value.style.title.subtitle.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.subtitle.text),5)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.rating.show&&t.value.style.rating.position==="top"?(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle(`width:100%;text-align:center;margin-bottom:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};margin-left:${t.value.style.rating.offsetX}px`)},e.toDisplayString(isNaN(i.value)?"":i.value.toFixed(t.value.style.rating.roundingValue)),5)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"vue-ui-rating-wrapper",style:e.normalizeStyle(`height:${t.value.style.itemSize}px;width:100%;display:flex;align-items:center;justify-content:center`)},[t.value.style.rating.show&&t.value.style.rating.position==="left"?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:fit-content;text-align:center;margin-bottom:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};padding-right:${t.value.style.rating.offsetX}px`)},e.toDisplayString(isNaN(i.value)?"":i.value.toFixed(t.value.style.rating.roundingValue)),5)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(l,v)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-rating-unit-container",style:e.normalizeStyle(`position:relative;height:${t.value.style.itemSize}px;width:${t.value.style.itemSize}px`)},[f.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.value.style.image.src,height:t.value.style.itemSize,width:t.value.style.itemSize,class:"vue-ui-rating-unit",style:e.normalizeStyle(`position:absolute;top:0;left:0;opacity:${isNaN(r.value)?t.value.style.image.inactiveOpacity:y(l,!0)}`)},null,12,F)):(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(n.XMLNS),viewBox:"0 0 100 100",height:t.value.style.itemSize,width:t.value.style.itemSize,class:"vue-ui-rating-unit"},[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`star_gradient_under_${d.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(n.shiftHue)(t.value.style.star.activeColor,.05)}`},null,8,R),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.star.activeColor},null,8,X)],8,D)]),e.createElementVNode("polygon",{points:e.unref(n.createStar)({plot:{x:50,y:50},radius:30,apexes:t.value.style.star.apexes}),fill:isNaN(r.value)?t.value.style.star.inactiveColor:y(l),stroke:t.value.style.star.borderColor?t.value.style.star.borderColor:r.value?y(l):t.value.style.star.inactiveColor,"stroke-width":t.value.style.star.borderWidth,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,j)],8,A)),f.value?(e.openBlock(),e.createElementBlock("img",{key:2,src:t.value.style.image.src,alt:`${t.value.style.image.alt} ${l}`,height:t.value.style.itemSize,width:t.value.style.itemSize,id:`active_${d.value}_${l}`,class:"vue-ui-rating-unit",style:e.normalizeStyle(`position:absolute;top:0;left:0;clip:rect(0px,${m(v,!0)*t.value.style.itemSize}px,${t.value.style.itemSize}px,0px`)},null,12,I)):(e.openBlock(),e.createElementBlock("svg",{key:3,xmlns:e.unref(n.XMLNS),viewBox:`0 0 ${m(v)} 100`,height:t.value.style.itemSize,class:"vue-ui-rating-unit",id:`active_${d.value}_${l}`,style:{position:"absolute",top:"0",left:"0"}},[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`star_gradient_over_${d.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(n.shiftHue)(t.value.style.star.activeColor,.05)}`},null,8,G),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.star.activeColor},null,8,L)],8,Y)]),e.createElementVNode("polygon",{points:e.unref(n.createStar)({plot:{x:50,y:50},radius:30,apexes:t.value.style.star.apexes}),fill:t.value.style.star.useGradient?`url(#star_gradient_over_${d.value})`:t.value.style.star.activeColor,stroke:t.value.style.star.activeColor},null,8,q)],8,O)),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(n.XMLNS),viewBox:"0 0 100 100",height:t.value.style.itemSize,class:"vue-ui-rating-unit",style:e.normalizeStyle(`position:absolute;top:0;left:0;${c.value?"":"cursor:pointer"}`)},[c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("rect",{key:0,class:"vue-ui-rating-mouse-trap",x:0,y:0,width:100,height:100,fill:"transparent",onClick:u=>x(l),onMouseenter:u=>r.value=l,onMouseleave:a[0]||(a[0]=u=>r.value=void 0),tabindex:"0",onKeyup:e.withKeys(u=>x(l),["enter"])},null,40,U)),c.value?(e.openBlock(),e.createElementBlock("rect",{key:1,class:"vue-ui-rating-mouse-trap",x:0,y:0,width:100,height:100,fill:"transparent",onMouseenter:u=>r.value=l,onMouseleave:a[1]||(a[1]=u=>r.value=void 0)},null,40,H)):e.createCommentVNode("",!0)],12,T)),t.value.style.tooltip.show&&N.value&&c.value?(e.openBlock(),e.createElementBlock("div",{key:4,class:"vue-ui-rating-tooltip",style:e.normalizeStyle(`border:1px solid ${t.value.style.tooltip.borderColor};position:absolute;top:${-48+t.value.style.tooltip.offsetY}px;left:50%;transform:translateX(-50%);width:fit-content;text-align:center;background:${t.value.style.tooltip.backgroundColor};display:${r.value===l?"block":"none"};padding:2px 12px;border-radius:${t.value.style.tooltip.borderRadius}px;box-shadow:${t.value.style.tooltip.boxShadow}`)},[e.createElementVNode("div",{style:e.normalizeStyle(`width:100%;display:flex;flex-direction:row;gap:6px;position:relative;text-align:center;color:${t.value.style.tooltip.color}`)},[e.createElementVNode("span",{style:e.normalizeStyle(`font-size:${t.value.style.tooltip.fontSize}px`)},e.toDisplayString(l),5),e.createTextVNode(" : "),e.createElementVNode("span",{style:e.normalizeStyle(`font-weight:${t.value.style.tooltip.bold?"bold":"normal"};font-size:${t.value.style.tooltip.fontSize}px`)},e.toDisplayString(s.dataset.rating[l]),5),e.createElementVNode("div",{style:e.normalizeStyle(`font-family:Arial !important;position:absolute;top:calc(100% - 4px);left:50%;transform:translateX(-50%);color:${t.value.style.tooltip.borderColor}`)}," ▼ ",4)],4)],4)):e.createCommentVNode("",!0)],4))),256)),t.value.style.rating.show&&t.value.style.rating.position==="right"?(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle(`width:fit-content;text-align:center;margin-bottom:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};padding-left:${t.value.style.rating.offsetX}px`)},e.toDisplayString(isNaN(i.value)?"":i.value.toFixed(t.value.style.rating.roundingValue)),5)):e.createCommentVNode("",!0)],4),t.value.style.rating.show&&t.value.style.rating.position==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:2,style:e.normalizeStyle(`width:100%;text-align:center;margin-top:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};margin-left:${t.value.style.rating.offsetX}px`)},e.toDisplayString(isNaN(i.value)?"":i.value.toFixed(t.value.style.rating.roundingValue)),5)):e.createCommentVNode("",!0)],36))}},P=V._export_sfc(K,[["__scopeId","data-v-86ced882"]]);exports.default=P;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-CSlObCMJ.cjs"),C=require("./useNestedProp-DUXlSjg2.cjs"),V=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),M={key:0,class:"vue-ui-rating-title",style:{width:"100%"}},F=["src","height","width"],A=["xmlns","height","width"],D=["id"],R=["stop-color"],X=["stop-color"],j=["points","fill","stroke","stroke-width"],I=["src","alt","height","width","id"],O=["xmlns","viewBox","height","id"],Y=["id"],G=["stop-color"],L=["stop-color"],q=["points","fill","stroke"],T=["xmlns","height"],U=["onClick","onMouseenter","onKeyup"],H=["onMouseenter"],K={__name:"vue-ui-rating",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:["rate"],setup($,{expose:k,emit:S}){const s=$,{vue_ui_rating:_}=n.useConfig(),d=e.ref(n.createUid()),p=e.ref(!1),r=e.ref(void 0),g=e.ref([]),t=e.computed(()=>C.useNestedProp({userConfig:s.config,defaultConfig:_})),b=e.computed(()=>typeof s.dataset.rating=="object"&&!Array.isArray(s.dataset.rating)?z(s.dataset.rating):s.dataset.rating),N=e.computed(()=>typeof s.dataset.rating=="object"&&!Array.isArray(s.dataset.rating)),i=e.ref(b.value),f=e.ref(t.value.type==="image"),c=e.ref(t.value.readonly);function z(o){let a=0,l=0;for(const u in o){const E=parseInt(u),h=o[u];a+=E*h,l+=h}if(l===0)return 0;const v=a/l;return Math.min(t.value.to,Math.max(t.value.from,v))}e.onMounted(()=>{n.objectIsEmpty(s.dataset)&&n.error({componentName:"VueUiRating",type:"dataset"});for(let o=t.value.from;o<=t.value.to;o+=1)g.value.push(o)});function y(o,a=!1){return o>r.value||c.value?a?t.value.style.image.inactiveOpacity:t.value.style.star.inactiveColor:a?1:t.value.style.star.useGradient?`url(#star_gradient_under_${d.value})`:t.value.style.star.activeColor}function m(o,a=!1){const l=i.value-o,v=a?1:100;switch(!0){case l<=0:return .001;case l>1:return 1*v;default:return l*v}}function x(o){c.value||(i.value=o,S("rate",o))}function w(){return i.value}function B(o=!0){c.value=o}return k({getData:w,toggleReadonly:B}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`background:${t.value.style.backgroundColor};font-family:${t.value.style.fontFamily};width:100%`),class:"vue-ui-rating",onMouseover:a[2]||(a[2]=l=>p.value=!0),onMouseleave:a[3]||(a[3]=l=>{p.value=!1,r.value=void 0})},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",M,[e.createElementVNode("div",{style:e.normalizeStyle(`color:${t.value.style.title.color};font-weight:${t.value.style.title.bold?"bold":"normal"};text-align:${t.value.style.title.textAlign};margin-bottom:${t.value.style.title.offsetY}px;font-size:${t.value.style.title.fontSize}px`)},e.toDisplayString(t.value.style.title.text),5),t.value.style.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`color:${t.value.style.title.subtitle.color};font-size:${t.value.style.title.subtitle.fontSize}px;text-align:${t.value.style.title.textAlign};margin-bottom:${t.value.style.title.subtitle.offsetY}px;font-weight:${t.value.style.title.subtitle.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.subtitle.text),5)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.rating.show&&t.value.style.rating.position==="top"?(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle(`width:100%;text-align:center;margin-bottom:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};margin-left:${t.value.style.rating.offsetX}px`)},e.toDisplayString(isNaN(i.value)?"":i.value.toFixed(t.value.style.rating.roundingValue)),5)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"vue-ui-rating-wrapper",style:e.normalizeStyle(`height:${t.value.style.itemSize}px;width:100%;display:flex;align-items:center;justify-content:center`)},[t.value.style.rating.show&&t.value.style.rating.position==="left"?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:fit-content;text-align:center;margin-bottom:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};padding-right:${t.value.style.rating.offsetX}px`)},e.toDisplayString(isNaN(i.value)?"":i.value.toFixed(t.value.style.rating.roundingValue)),5)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(l,v)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-rating-unit-container",style:e.normalizeStyle(`position:relative;height:${t.value.style.itemSize}px;width:${t.value.style.itemSize}px`)},[f.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.value.style.image.src,height:t.value.style.itemSize,width:t.value.style.itemSize,class:"vue-ui-rating-unit",style:e.normalizeStyle(`position:absolute;top:0;left:0;opacity:${isNaN(r.value)?t.value.style.image.inactiveOpacity:y(l,!0)}`)},null,12,F)):(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(n.XMLNS),viewBox:"0 0 100 100",height:t.value.style.itemSize,width:t.value.style.itemSize,class:"vue-ui-rating-unit"},[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`star_gradient_under_${d.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(n.shiftHue)(t.value.style.star.activeColor,.05)}`},null,8,R),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.star.activeColor},null,8,X)],8,D)]),e.createElementVNode("polygon",{points:e.unref(n.createStar)({plot:{x:50,y:50},radius:30,apexes:t.value.style.star.apexes}),fill:isNaN(r.value)?t.value.style.star.inactiveColor:y(l),stroke:t.value.style.star.borderColor?t.value.style.star.borderColor:r.value?y(l):t.value.style.star.inactiveColor,"stroke-width":t.value.style.star.borderWidth,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,j)],8,A)),f.value?(e.openBlock(),e.createElementBlock("img",{key:2,src:t.value.style.image.src,alt:`${t.value.style.image.alt} ${l}`,height:t.value.style.itemSize,width:t.value.style.itemSize,id:`active_${d.value}_${l}`,class:"vue-ui-rating-unit",style:e.normalizeStyle(`position:absolute;top:0;left:0;clip:rect(0px,${m(v,!0)*t.value.style.itemSize}px,${t.value.style.itemSize}px,0px`)},null,12,I)):(e.openBlock(),e.createElementBlock("svg",{key:3,xmlns:e.unref(n.XMLNS),viewBox:`0 0 ${m(v)} 100`,height:t.value.style.itemSize,class:"vue-ui-rating-unit",id:`active_${d.value}_${l}`,style:{position:"absolute",top:"0",left:"0"}},[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`star_gradient_over_${d.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(n.shiftHue)(t.value.style.star.activeColor,.05)}`},null,8,G),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.star.activeColor},null,8,L)],8,Y)]),e.createElementVNode("polygon",{points:e.unref(n.createStar)({plot:{x:50,y:50},radius:30,apexes:t.value.style.star.apexes}),fill:t.value.style.star.useGradient?`url(#star_gradient_over_${d.value})`:t.value.style.star.activeColor,stroke:t.value.style.star.activeColor},null,8,q)],8,O)),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(n.XMLNS),viewBox:"0 0 100 100",height:t.value.style.itemSize,class:"vue-ui-rating-unit",style:e.normalizeStyle(`position:absolute;top:0;left:0;${c.value?"":"cursor:pointer"}`)},[c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("rect",{key:0,class:"vue-ui-rating-mouse-trap",x:0,y:0,width:100,height:100,fill:"transparent",onClick:u=>x(l),onMouseenter:u=>r.value=l,onMouseleave:a[0]||(a[0]=u=>r.value=void 0),tabindex:"0",onKeyup:e.withKeys(u=>x(l),["enter"])},null,40,U)),c.value?(e.openBlock(),e.createElementBlock("rect",{key:1,class:"vue-ui-rating-mouse-trap",x:0,y:0,width:100,height:100,fill:"transparent",onMouseenter:u=>r.value=l,onMouseleave:a[1]||(a[1]=u=>r.value=void 0)},null,40,H)):e.createCommentVNode("",!0)],12,T)),t.value.style.tooltip.show&&N.value&&c.value?(e.openBlock(),e.createElementBlock("div",{key:4,class:"vue-ui-rating-tooltip",style:e.normalizeStyle(`border:1px solid ${t.value.style.tooltip.borderColor};position:absolute;top:${-48+t.value.style.tooltip.offsetY}px;left:50%;transform:translateX(-50%);width:fit-content;text-align:center;background:${t.value.style.tooltip.backgroundColor};display:${r.value===l?"block":"none"};padding:2px 12px;border-radius:${t.value.style.tooltip.borderRadius}px;box-shadow:${t.value.style.tooltip.boxShadow}`)},[e.createElementVNode("div",{style:e.normalizeStyle(`width:100%;display:flex;flex-direction:row;gap:6px;position:relative;text-align:center;color:${t.value.style.tooltip.color}`)},[e.createElementVNode("span",{style:e.normalizeStyle(`font-size:${t.value.style.tooltip.fontSize}px`)},e.toDisplayString(l),5),e.createTextVNode(" : "),e.createElementVNode("span",{style:e.normalizeStyle(`font-weight:${t.value.style.tooltip.bold?"bold":"normal"};font-size:${t.value.style.tooltip.fontSize}px`)},e.toDisplayString(s.dataset.rating[l]),5),e.createElementVNode("div",{style:e.normalizeStyle(`font-family:Arial !important;position:absolute;top:calc(100% - 4px);left:50%;transform:translateX(-50%);color:${t.value.style.tooltip.borderColor}`)}," ▼ ",4)],4)],4)):e.createCommentVNode("",!0)],4))),256)),t.value.style.rating.show&&t.value.style.rating.position==="right"?(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle(`width:fit-content;text-align:center;margin-bottom:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};padding-left:${t.value.style.rating.offsetX}px`)},e.toDisplayString(isNaN(i.value)?"":i.value.toFixed(t.value.style.rating.roundingValue)),5)):e.createCommentVNode("",!0)],4),t.value.style.rating.show&&t.value.style.rating.position==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:2,style:e.normalizeStyle(`width:100%;text-align:center;margin-top:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};margin-left:${t.value.style.rating.offsetX}px`)},e.toDisplayString(isNaN(i.value)?"":i.value.toFixed(t.value.style.rating.roundingValue)),5)):e.createCommentVNode("",!0)],36))}},P=V._export_sfc(K,[["__scopeId","data-v-86ced882"]]);exports.default=P;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ref as f, computed as $, onMounted as G, openBlock as l, createElementBlock as i, normalizeStyle as a, createElementVNode as n, toDisplayString as p, createCommentVNode as d, Fragment as E, renderList as L, unref as m, withKeys as U, createTextVNode as D } from "vue";
|
|
2
|
-
import { u as K, c as T, o as H, e as P, X as _, s as N, O as F } from "./index-
|
|
3
|
-
import { u as W } from "./useNestedProp-
|
|
2
|
+
import { u as K, c as T, o as H, e as P, X as _, s as N, O as F } from "./index-D0PI50d6.js";
|
|
3
|
+
import { u as W } from "./useNestedProp-BNV_Y29K.js";
|
|
4
4
|
import { _ as q } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
5
|
const J = {
|
|
6
6
|
key: 0,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { useCssVars as ge, computed as c, ref as u, onMounted as he, onBeforeUnmount as ye, openBlock as a, createElementBlock as o, normalizeStyle as g, createVNode as me, createCommentVNode as C, createBlock as W, unref as _, createSlots as ke, withCtx as E, renderSlot as b, normalizeProps as _e, guardReactiveProps as pe, normalizeClass as z, createElementVNode as $e, Fragment as w, renderList as O, toDisplayString as xe } from "vue";
|
|
2
|
-
import { u as Ce, c as be, t as we, a as Oe, p as X, b as Pe, o as Ae, e as Y, g as Ie, X as Fe } from "./index-
|
|
2
|
+
import { u as Ce, c as be, t as we, a as Oe, p as X, b as Pe, o as Ae, e as Y, g as Ie, X as Fe } from "./index-D0PI50d6.js";
|
|
3
3
|
import { t as Ee, u as ze } from "./useResponsive-NZB-WLRF.js";
|
|
4
|
-
import { _ as Le } from "./Title-
|
|
5
|
-
import { u as Ne, U as Re } from "./usePrinter-
|
|
6
|
-
import Se from "./vue-ui-skeleton-
|
|
7
|
-
import { u as q } from "./useNestedProp-
|
|
4
|
+
import { _ as Le } from "./Title-DM6fKrUI.js";
|
|
5
|
+
import { u as Ne, U as Re } from "./usePrinter-DJnJEVGy.js";
|
|
6
|
+
import Se from "./vue-ui-skeleton-CDB2sB2S.js";
|
|
7
|
+
import { u as q } from "./useNestedProp-BNV_Y29K.js";
|
|
8
8
|
import { _ as Te } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
9
9
|
const Me = ["id"], je = ["xmlns", "viewBox"], Be = ["cx", "cy", "r", "stroke", "stroke-width"], Ge = { key: 0 }, Ue = ["stroke", "d", "stroke-width"], De = { key: 1 }, Ve = ["stroke", "x1", "x2", "y1", "y2"], We = ["text-anchor", "transform", "x", "y", "onClick", "font-weight", "font-size", "fill"], Xe = ["cx", "cy", "fill", "onClick", "r"], Ye = {
|
|
10
10
|
__name: "vue-ui-relation-circle",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-CSlObCMJ.cjs"),N=require("./useResponsive-B3TrDDIG.cjs"),re=require("./Title--kLbBq-N.cjs"),L=require("./usePrinter-ClpmcbPy.cjs"),ne=require("./vue-ui-skeleton-aEAr9fnx.cjs"),T=require("./useNestedProp-DUXlSjg2.cjs"),ie=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),se=["id"],ae=["xmlns","viewBox"],oe=["cx","cy","r","stroke","stroke-width"],ue={key:0},ce=["stroke","d","stroke-width"],de={key:1},ve=["stroke","x1","x2","y1","y2"],fe=["text-anchor","transform","x","y","onClick","font-weight","font-size","fill"],ge=["cx","cy","fill","onClick","r"],ye={__name:"vue-ui-relation-circle",props:{dataset:{type:Array,default(){return[]}},config:{type:Object,default(){return{}}}},setup(R,{expose:M}){const c=R;e.useCssVars(t=>({"69fb0529":W.value,"3158da88":D.value,"2b571f2c":X.value}));const{vue_ui_relation_circle:V}=o.useConfig(),p=e.computed(()=>!!c.dataset&&Object.keys(c.dataset).length),f=e.ref(o.createUid()),$=e.ref(0),m=e.ref(null),b=e.ref(null),r=e.computed(()=>{const t=T.useNestedProp({userConfig:c.config,defaultConfig:V});return t.theme?{...T.useNestedProp({userConfig:o.themes.vue_ui_relation_circle[t.theme]||c.config,defaultConfig:t}),customPalette:o.themePalettes[t.theme]||o.palette}:t}),{isPrinting:j,isImaging:q,generatePdf:w,generateImage:B}=L.usePrinter({elementId:`relation_circle_${f.value}`,fileName:r.value.style.title.text||"vue-ui-relation-circle"}),P=e.computed(()=>o.convertCustomPalette(r.value.customPalette)),v=e.ref([]),g=e.ref([]),s=e.ref({}),u=e.ref([]),G=e.ref(0),_=e.computed(()=>c.dataset.slice(0,r.value.style.limit)),x=e.ref(r.value.style.size),a=e.ref({height:r.value.style.size,width:r.value.style.size}),d=e.computed({get(){return x.value*r.value.style.circle.radiusProportion},set(t){return t}}),U=e.computed(()=>r.value.style.links.curved),D=e.computed(()=>`${r.value.style.animation.speedMs}ms`),W=e.computed(()=>d.value*2),X=e.computed(()=>d.value*4),h=e.ref(null);e.onMounted(()=>{if(o.objectIsEmpty(c.dataset)?o.error({componentName:"VueUiRelationCircle",type:"dataset"}):c.dataset.forEach((i,l)=>{o.getMissingDatasetAttributes({datasetObject:i,requiredAttributes:["id","label","relations","weights"]}).forEach(n=>{o.error({componentName:"VueUiRelationCircle",type:"datasetSerieAttribute",property:n,index:l})})}),r.value.responsive){const i=N.throttle(()=>{const{width:l,height:n}=N.useResponsive({chart:m.value,title:r.value.style.title.text?b.value:null});x.value=Math.min(l,n),a.value.width=l,a.value.height=n,d.value=x.value*r.value.style.circle.radiusProportion,v.value=[],g.value=[],E(),A()});h.value=new ResizeObserver(i),h.value.observe(m.value.parentNode)}else E(),A();document.getElementById(`relation_circle_${f.value}`).addEventListener("click",O)}),e.onBeforeUnmount(()=>{document.getElementById(`relation_circle_${f.value}`).removeEventListener("click",O),h.value&&h.value.disconnect()});function O(t){const i=t.target;i&&Array.from(i.classList).includes("vue-ui-user-options")||i&&Array.from(i.classList).includes("vue-ui-user-options-summary")||i&&Array.from(i.classList).includes("vue-data-ui-button")||i&&Array.from(i.classList).includes("vue-ui-relation-circle-legend")||(s.value={},u.value=[])}function E(){const t=6.28319/_.value.length,i=360/_.value.length;let l=0,n=0;_.value.forEach((y,C)=>{const te=d.value*Math.cos(l)+a.value.width/2,le=d.value*Math.sin(l)+a.value.height/2+r.value.style.circle.offsetY;v.value.push({x:te,y:le,...y,color:y.color?y.color:P.value[C]?P.value[C]:o.palette[C],regAngle:n}),l+=t,n+=i})}function A(){v.value.forEach(t=>{v.value.filter(l=>l.relations.includes(t.id)).forEach((l,n)=>{g.value.push({weight:t.weights&&t.weights[n]?t.weights[n]:1,relationId:`${t.id}_${l.id}`,x1:t.x,y1:t.y,x2:l.x,y2:l.y,colorSource:t.color,colorTarget:l.color,...t})})})}const Y=e.computed(()=>Math.max(...g.value.map(t=>t.weight)));function H(t){return Object.hasOwn(s.value,"x")?u.value.includes(t.id)?"opacity:1":"opacity:0.1":"opacity:1"}function I(t){return Object.hasOwn(s.value,"x")?t.colorTarget:t.colorSource}function S(t){return Object.hasOwn(s.value,"x")?u.value.includes(t.id)&&t.relationId===`${t.id}_${s.value.id}`||t.relationId===`${s.value.id}_${t.id}`?`opacity:1;stroke-width:${F(t)}`:"opacity: 0":"opacity: 1"}function J(t){return t.regAngle>90&&t.regAngle<270?"end":"start"}function K(t){return t.regAngle>90&&t.regAngle<270?t.x-5:t.x+5}function Q(t){return Object.hasOwn(s.value,"x")?s.value.id===t.id||u.value.includes(t.id)?"opacity:1":"opacity:0.2":"opacity:1"}function Z(t){return t.regAngle>90&&t.regAngle<270?`rotate(${t.regAngle+180},${t.x},${t.y})`:`rotate(${t.regAngle},${t.x},${t.y})`}function z(t){G.value=360-t.regAngle,s.value.id&&t.id===s.value.id?(s.value={},u.value=[]):(s.value=t,u.value=[...t.relations])}function F(t){return t.weight/Y.value*r.value.style.links.maxWidth}const k=e.ref(!1);function ee(t){k.value=t,$.value+=1}return M({generatePdf:w,generateImage:B}),(t,i)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"relationCircleChart",ref:m,class:"vue-ui-relation-circle",style:e.normalizeStyle(`width:100%;background:${r.value.style.backgroundColor};text-align:center;${r.value.responsive?"height: 100%":""}`),id:`relation_circle_${f.value}`},[r.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:b,style:e.normalizeStyle(`width:100%;background:${r.value.style.backgroundColor}`)},[e.createVNode(re._sfc_main,{config:{title:{cy:"relation-div-title",...r.value.style.title},subtitle:{cy:"relation-div-subtitle",...r.value.style.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),r.value.userOptions.show&&p.value?(e.openBlock(),e.createBlock(L.UserOptions,{ref:"details",key:`user_options_${$.value}`,backgroundColor:r.value.style.backgroundColor,color:r.value.style.color,isPrinting:e.unref(j),isImaging:e.unref(q),uid:f.value,hasPdf:r.value.userOptions.buttons.pdf,hasImg:r.value.userOptions.buttons.img,hasFullscreen:r.value.userOptions.buttons.img,hasXls:!1,isFullscreen:k.value,titles:{...r.value.userOptions.buttonTitles},chartElement:m.value,onToggleFullscreen:ee,onGeneratePdf:e.unref(w),onGenerateImage:e.unref(B)},e.createSlots({_:2},[t.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,t.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionImg",{},void 0,!0)]),key:"1"}:void 0,t.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:n})=>[e.renderSlot(t.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:n})),void 0,!0)]),key:"2"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(o.XMLNS),class:e.normalizeClass([{"vue-data-ui-fullscreen--on":k.value,"vue-data-ui-fulscreen--off":!k.value},"relation-circle"]),viewBox:`0 0 ${a.value.width<=0?10:a.value.width} ${a.value.height<=0?10:a.value.height}`,width:"100%",style:e.normalizeStyle(`user-select:none; background:${r.value.style.backgroundColor}`)},[e.createElementVNode("circle",{cx:(a.value.width<=0?1e-4:a.value.width)/2,cy:(a.value.height<=0?1e-4:a.value.height)/2+r.value.style.circle.offsetY,r:d.value<=0?1e-4:d.value,stroke:r.value.style.circle.stroke,"stroke-width":r.value.style.circle.strokeWidth,fill:"transparent",class:"main-circle"},null,8,oe),U.value?(e.openBlock(),e.createElementBlock("g",ue,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(l,n)=>(e.openBlock(),e.createElementBlock("path",{key:`relation_${n}`,style:e.normalizeStyle(S(l)),stroke:I(l),class:e.normalizeClass(["relation",{"vue-ui-relation-circle-selected":s.value.hasOwnProperty("id")&&u.value.includes(l.id)}]),d:`M${l.x1},${l.y1} C${l.x1},${l.y1} ${a.value.width/2},${a.value.height/2+r.value.style.circle.offsetY} ${l.x2},${l.y2}`,fill:"none","stroke-width":F(l),"stroke-linecap":"round"},null,14,ce))),128))])):(e.openBlock(),e.createElementBlock("g",de,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(l,n)=>(e.openBlock(),e.createElementBlock("line",{key:`relation_${n}`,stroke:I(l),style:e.normalizeStyle(S(l)),x1:l.x1,x2:l.x2,y1:l.y1,y2:l.y2,class:e.normalizeClass({"vue-ui-relation-circle-selected":s.value.hasOwnProperty("id")&&u.value.includes(l.id)}),"stroke-linecap":"round"},null,14,ve))),128))])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(l,n)=>(e.openBlock(),e.createElementBlock("text",{key:`plot_text_${n}`,"text-anchor":J(l),transform:Z(l),x:K(l),y:l.y+5,onClick:y=>z(l),class:"vue-ui-relation-circle-legend","transform-origin":"start","font-weight":s.value.id===l.id?"900":"400",style:e.normalizeStyle(`font-family:${r.value.style.fontFamily};${Q(l)}`),"font-size":r.value.style.labels.fontSize,fill:r.value.style.labels.color},e.toDisplayString(l.label),13,fe))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(l,n)=>(e.openBlock(),e.createElementBlock("circle",{cx:l.x,cy:l.y,key:`plot_${n}`,style:e.normalizeStyle(H(l)),class:"vue-ui-relation-circle-plot",fill:r.value.style.plot.color,onClick:y=>z(l),r:r.value.style.plot.radius},null,12,ge))),128)),e.renderSlot(t.$slots,"svg",{svg:a.value},void 0,!0)],14,ae)):e.createCommentVNode("",!0),p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ne.default,{key:3,config:{type:"relationCircle",style:{backgroundColor:r.value.style.backgroundColor,relationCircle:{color:"#CCCCCC"}}}},null,8,["config"]))],12,se))}},me=ie._export_sfc(ye,[["__scopeId","data-v-44982e30"]]);exports.default=me;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-DFXgoR1T.cjs"),D=require("./useResponsive-B3TrDDIG.cjs"),re=require("./Title-Ci74YZxW.cjs"),U=require("./usePrinter-DoFYRZKM.cjs"),ne=require("./Tooltip-BNMjZUBc.cjs"),ue=require("./DataTable-BSoyXOFT.cjs"),se=require("./Legend-DZhpxKg4.cjs"),ie=require("./vue-ui-skeleton-CmABeGyu.cjs"),ce=require("./vue-ui-accordion-P9OYffC3.cjs"),H=require("./useNestedProp-CbZUIZc0.cjs"),de=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ve=["id"],pe=["xmlns","viewBox"],he=["id"],ge=["stop-color"],fe=["stop-color"],me=["stroke","cx","cy","r","fill"],ye=["stroke","stroke-width","cx","cy","r","fill"],be=["cx","cy","r","onMouseenter"],ke=["onClick"],Ce={key:0},we={key:1},xe=["innerHTML"],Te={__name:"vue-ui-rings",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(W,{expose:G,emit:j}){const v=W,{vue_ui_rings:X}=n.useConfig(),y=e.ref(!1),x=e.computed(()=>!!v.dataset&&v.dataset.length),b=e.ref(n.createUid()),J=e.ref(null),T=e.ref(!1),_=e.ref(""),m=e.ref(null),V=e.ref(0),k=e.ref(null),F=e.ref(null),L=e.ref(null),t=e.computed(()=>{const l=H.useNestedProp({userConfig:v.config,defaultConfig:X});return l.theme?{...H.useNestedProp({userConfig:n.themes.vue_ui_rings[l.theme]||v.config,defaultConfig:l}),customPalette:n.themePalettes[l.theme]||n.palette}:l}),$=e.ref(null);e.onMounted(()=>{if(n.objectIsEmpty(v.dataset)?n.error({componentName:"VueUiRings",type:"dataset"}):v.dataset.forEach((l,a)=>{n.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(o=>{n.error({componentName:"VueUiRings",type:"datasetSerieAttribute",property:o,index:a})})}),t.value.responsive){const l=D.throttle(()=>{const{width:a,height:o}=D.useResponsive({chart:k.value,title:t.value.style.chart.title.text?F.value:null,legend:t.value.style.chart.legend.show?L.value:null});s.value.width=a,s.value.height=o});$.value=new ResizeObserver(l),$.value.observe(k.value.parentNode)}setTimeout(()=>{y.value=!0},600)}),e.onBeforeUnmount(()=>{$.value&&$.value.disconnect()});const{isPrinting:K,isImaging:Q,generatePdf:E,generateImage:z}=U.usePrinter({elementId:`rings_${b.value}`,fileName:t.value.style.chart.title.text||"vue-ui-rings"}),I=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),g=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),s=e.ref({height:360,width:360}),Y=e.computed(()=>Math.min(s.value.height,s.value.width)),i=e.ref([]);function B(l){i.value.includes(l)?i.value=i.value.filter(a=>a!==l):i.value.push(l),j("selectLegend",c.value.map(a=>({name:a.name,color:a.color,value:a.value})))}const Z=e.computed(()=>Math.max(...N.value.filter(l=>!i.value.includes(l.uid)).map(({value:l})=>l)));function O(l){return l/Z.value}const N=e.computed(()=>v.dataset.map(({values:l,name:a,color:o=null},r)=>{const u=(l||[]).reduce((h,w)=>h+w,0);return{name:a,color:o||n.convertColorToHex(o)||I.value[r]||n.palette[r]||n.palette[r%n.palette.length],value:u,proportion:u/v.dataset.map(h=>(h.values||[]).reduce((w,ae)=>w+ae,0)).reduce((h,w)=>h+w,0),uid:n.createUid()}})),M=e.computed(()=>N.value.map(l=>({...l,shape:"circle",opacity:i.value.includes(l.uid)?.5:1,segregate:()=>B(l.uid),isSegregated:i.value.includes(l.uid)})).toSorted((l,a)=>a.value-l.value)),ee=e.computed(()=>({cy:"rings-div-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":""})),p=e.computed(()=>N.value.filter(l=>!i.value.includes(l.uid)).map(({value:l})=>l).reduce((l,a)=>l+a,0)),c=e.computed(()=>N.value.filter(l=>!i.value.includes(l.uid)).map(({name:l,value:a,color:o=null,uid:r},u)=>({uid:r,name:l,color:o||n.convertColorToHex(o)||I.value[u]||n.palette[u]||n.palette[u%n.palette.length],value:a,proportion:O(a),percentage:a/p.value*100,strokeWidth:t.value.style.chart.layout.rings.strokeWidth*O(a)})).toSorted((l,a)=>a.value-l.value));function te(){return c.value.map(({name:l,color:a,value:o,absoluteValues:r,percentage:u})=>({name:l,color:a,value:o,absoluteValues:r,percentage:u}))}const d=e.computed(()=>Y.value-t.value.style.chart.layout.rings.strokeWidth*2),P=e.ref(null);function le(l,a){if(i.value.length===v.dataset.length)return;P.value={datapoint:a,seriesIndex:l,series:c.value,config:t.value},m.value=l;const o=c.value[l],r=t.value.style.chart.tooltip.customFormat;if(n.isFunction(r)&&n.functionReturnsString(()=>r({seriesIndex:l,datapoint:a,series:c.value,config:t.value})))_.value=r({seriesIndex:l,datapoint:a,series:c.value,config:t.value});else{let u="";u+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${o.name}</div>`,u+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${o.color}" /></svg>`,t.value.style.chart.tooltip.showValue&&(u+=`<b>${n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:o.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.tooltip.roundingValue})}</b>`),t.value.style.chart.tooltip.showPercentage&&(t.value.style.chart.tooltip.showValue?u+=`<span>(${(o.value/p.value*100).toFixed(t.value.style.chart.tooltip.roundingPercentage)}%)</span></div>`:u+=`<b>${(o.value/p.value*100).toFixed(t.value.style.chart.tooltip.roundingPercentage)}%</b></div>`),_.value=u}T.value=!0}const f=e.computed(()=>{const l=c.value.map(o=>({name:o.name,color:o.color})),a=c.value.map(o=>o.value);return{head:l,body:a}}),S=e.computed(()=>{const l=[' <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>',n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:p.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue}),"100%"],a=f.value.head.map((u,h)=>[{color:u.color,name:u.name},n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:f.value.body[h],s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue}),isNaN(f.value.body[h]/p.value)?"-":(f.value.body[h]/p.value*100).toFixed(t.value.table.td.roundingPercentage)+"%"]),o={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},r=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage];return{head:l,body:a,config:o,colNames:r}});function R(){e.nextTick(()=>{const l=f.value.head.map((r,u)=>[[r.name],[f.value.body[u]],[isNaN(f.value.body[u]/p.value)?"-":f.value.body[u]/p.value*100]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),o=n.createCsvContent(a);n.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-rings"})})}const C=e.ref(!1);function oe(l){C.value=l,V.value+=1}function q(){g.value.showTable=!g.value.showTable}function A(){g.value.showTooltip=!g.value.showTooltip}return G({getData:te,generatePdf:E,generateCsv:R,generateImage:z,toggleTable:q,toggleTooltip:A}),(l,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"ringsChart",ref:k,class:e.normalizeClass(`vue-ui-rings ${C.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};text-align:center;width:100%;background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height: 100%":""}`),id:`rings_${b.value}`,onMouseleave:a[3]||(a[3]=o=>{m.value=null,T.value=!1})},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:F,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor}`)},[e.createVNode(re._sfc_main,{config:{title:{cy:"rings-div-title",...t.value.style.chart.title},subtitle:{cy:"rings-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&x.value?(e.openBlock(),e.createBlock(U.UserOptions,{ref_key:"details",ref:J,key:`user_options_${V.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(K),isImaging:e.unref(Q),uid:b.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isTooltip:g.value.showTooltip,isFullscreen:C.value,titles:{...t.value.userOptions.buttonTitles},chartElement:k.value,onToggleFullscreen:oe,onGeneratePdf:e.unref(E),onGenerateCsv:R,onGenerateImage:e.unref(z),onToggleTable:q,onToggleTooltip:A},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:r})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:r})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),x.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(n.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":C.value,"vue-data-ui-fulscreen--off":!C.value}),viewBox:`0 0 ${s.value.width<=0?10:s.value.width} ${s.value.height<=0?10:s.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(o,r)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"30%",r:"50%",fx:"50%",fy:"50%",id:`gradient_${b.value}_${r}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(n.shiftHue)(o.color,.05)}${e.unref(n.opacity)[100-t.value.style.chart.layout.rings.gradient.intensity]}`},null,8,ge),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,fe)],8,he))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(o,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("circle",{class:e.normalizeClass({"vue-ui-rings-item":y.value&&t.value.useCssAnimation,"vue-rings-item-onload":!y.value&&t.value.useCssAnimation,"vue-ui-rings-opacity":m.value!==null&&m.value!==r}),style:e.normalizeStyle(`animation-delay:${r*100}ms`),stroke:t.value.style.chart.layout.rings.stroke,cx:s.value.width/2,cy:r===0?s.value.height/2:s.value.height/2+d.value*c.value[0].proportion/2-d.value*o.proportion/2-2*(r+1),r:d.value*o.proportion/2*.9<=0?1e-4:d.value*o.proportion/2*.9,fill:t.value.style.chart.layout.rings.gradient.underlayerColor},null,14,me),e.createElementVNode("circle",{class:e.normalizeClass({"vue-ui-rings-item":y.value&&t.value.useCssAnimation,"vue-rings-item-onload":!y.value&&t.value.useCssAnimation,"vue-ui-rings-shadow":t.value.style.chart.layout.rings.useShadow,"vue-ui-rings-blur":m.value!==null&&m.value!==r}),style:e.normalizeStyle(`animation-delay:${r*100}ms`),stroke:t.value.style.chart.layout.rings.stroke,"stroke-width":o.strokeWidth<.5?.5:o.strokeWidth,cx:s.value.width/2,cy:r===0?s.value.height/2:s.value.height/2+d.value*c.value[0].proportion/2-d.value*o.proportion/2-2*(r+1),r:d.value*o.proportion/2*.9<=0?1e-4:d.value*o.proportion/2*.9,fill:t.value.style.chart.layout.rings.gradient.show?`url(#gradient_${b.value}_${r})`:o.color},null,14,ye),e.createElementVNode("circle",{"data-cy-trap":"",stroke:"none",cx:s.value.width/2,cy:r===0?s.value.height/2:s.value.height/2+d.value*c.value[0].proportion/2-d.value*o.proportion/2-2*(r+1),r:d.value*o.proportion/2*.9<=0?1e-4:d.value*o.proportion/2*.9,fill:"transparent",onMouseenter:u=>le(r,o),onMouseleave:a[0]||(a[0]=u=>{m.value=null,T.value=!1})},null,40,be)]))),256)),e.renderSlot(l.$slots,"svg",{svg:s.value},void 0,!0)],14,pe)):e.createCommentVNode("",!0),x.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ie.default,{key:3,config:{type:"rings",style:{backgroundColor:t.value.style.chart.backgroundColor,rings:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:L},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(se.Legend,{key:0,legendSet:M.value,config:ee.value,onClickMarker:a[1]||(a[1]=({legend:o})=>B(o.uid))},{item:e.withCtx(({legend:o})=>[e.createElementVNode("div",{"data-cy-legend-item":"",onClick:r=>B(o.uid),style:e.normalizeStyle(`opacity:${i.value.includes(o.uid)?.5:1}`)},[e.createTextVNode(e.toDisplayString(o.name)+": "+e.toDisplayString(e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:o.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.legend.roundingValue}))+" ",1),i.value.includes(o.uid)?(e.openBlock(),e.createElementBlock("span",we," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",Ce," ("+e.toDisplayString(isNaN(o.value/p.value)?"-":(o.value/p.value*100).toFixed(t.value.style.chart.legend.roundingPercentage))+"%) ",1))],12,ke)]),_:1},8,["legendSet","config"])):e.renderSlot(l.$slots,"legend",{key:1,legend:M.value},void 0,!0)],512),e.createVNode(ne._sfc_main,{show:g.value.showTooltip&&T.value&&i.value.length<v.dataset.length,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,fontSize:t.value.style.chart.tooltip.fontSize,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,parent:k.value,content:_.value,isCustom:t.value.style.chart.tooltip.customFormat&&typeof t.value.style.chart.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...P.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...P.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","parent","content","isCustom"]),x.value?(e.openBlock(),e.createBlock(ce.default,{key:4,hideDetails:"",config:{open:g.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(ue.DataTable,{colNames:S.value.colNames,head:S.value.head,body:S.value.body,config:S.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[2]||(a[2]=o=>g.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,xe)]),td:e.withCtx(({td:o})=>[e.createTextVNode(e.toDisplayString(o.name||o),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,ve))}},$e=de._export_sfc(Te,[["__scopeId","data-v-c7da9220"]]);exports.default=$e;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-CSlObCMJ.cjs"),D=require("./useResponsive-B3TrDDIG.cjs"),re=require("./Title--kLbBq-N.cjs"),U=require("./usePrinter-ClpmcbPy.cjs"),ne=require("./Tooltip-Dwh7A0L5.cjs"),ue=require("./DataTable-DZ7GOCVh.cjs"),se=require("./Legend-BNUo8JKO.cjs"),ie=require("./vue-ui-skeleton-aEAr9fnx.cjs"),ce=require("./vue-ui-accordion-IPISean4.cjs"),H=require("./useNestedProp-DUXlSjg2.cjs"),de=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ve=["id"],pe=["xmlns","viewBox"],he=["id"],ge=["stop-color"],fe=["stop-color"],me=["stroke","cx","cy","r","fill"],ye=["stroke","stroke-width","cx","cy","r","fill"],be=["cx","cy","r","onMouseenter"],ke=["onClick"],Ce={key:0},we={key:1},xe=["innerHTML"],Te={__name:"vue-ui-rings",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(W,{expose:G,emit:j}){const v=W,{vue_ui_rings:X}=n.useConfig(),y=e.ref(!1),x=e.computed(()=>!!v.dataset&&v.dataset.length),b=e.ref(n.createUid()),J=e.ref(null),T=e.ref(!1),_=e.ref(""),m=e.ref(null),V=e.ref(0),k=e.ref(null),F=e.ref(null),L=e.ref(null),t=e.computed(()=>{const l=H.useNestedProp({userConfig:v.config,defaultConfig:X});return l.theme?{...H.useNestedProp({userConfig:n.themes.vue_ui_rings[l.theme]||v.config,defaultConfig:l}),customPalette:n.themePalettes[l.theme]||n.palette}:l}),$=e.ref(null);e.onMounted(()=>{if(n.objectIsEmpty(v.dataset)?n.error({componentName:"VueUiRings",type:"dataset"}):v.dataset.forEach((l,a)=>{n.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(o=>{n.error({componentName:"VueUiRings",type:"datasetSerieAttribute",property:o,index:a})})}),t.value.responsive){const l=D.throttle(()=>{const{width:a,height:o}=D.useResponsive({chart:k.value,title:t.value.style.chart.title.text?F.value:null,legend:t.value.style.chart.legend.show?L.value:null});s.value.width=a,s.value.height=o});$.value=new ResizeObserver(l),$.value.observe(k.value.parentNode)}setTimeout(()=>{y.value=!0},600)}),e.onBeforeUnmount(()=>{$.value&&$.value.disconnect()});const{isPrinting:K,isImaging:Q,generatePdf:E,generateImage:z}=U.usePrinter({elementId:`rings_${b.value}`,fileName:t.value.style.chart.title.text||"vue-ui-rings"}),I=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),g=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),s=e.ref({height:360,width:360}),Y=e.computed(()=>Math.min(s.value.height,s.value.width)),i=e.ref([]);function B(l){i.value.includes(l)?i.value=i.value.filter(a=>a!==l):i.value.push(l),j("selectLegend",c.value.map(a=>({name:a.name,color:a.color,value:a.value})))}const Z=e.computed(()=>Math.max(...N.value.filter(l=>!i.value.includes(l.uid)).map(({value:l})=>l)));function O(l){return l/Z.value}const N=e.computed(()=>v.dataset.map(({values:l,name:a,color:o=null},r)=>{const u=(l||[]).reduce((h,w)=>h+w,0);return{name:a,color:o||n.convertColorToHex(o)||I.value[r]||n.palette[r]||n.palette[r%n.palette.length],value:u,proportion:u/v.dataset.map(h=>(h.values||[]).reduce((w,ae)=>w+ae,0)).reduce((h,w)=>h+w,0),uid:n.createUid()}})),M=e.computed(()=>N.value.map(l=>({...l,shape:"circle",opacity:i.value.includes(l.uid)?.5:1,segregate:()=>B(l.uid),isSegregated:i.value.includes(l.uid)})).toSorted((l,a)=>a.value-l.value)),ee=e.computed(()=>({cy:"rings-div-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":""})),p=e.computed(()=>N.value.filter(l=>!i.value.includes(l.uid)).map(({value:l})=>l).reduce((l,a)=>l+a,0)),c=e.computed(()=>N.value.filter(l=>!i.value.includes(l.uid)).map(({name:l,value:a,color:o=null,uid:r},u)=>({uid:r,name:l,color:o||n.convertColorToHex(o)||I.value[u]||n.palette[u]||n.palette[u%n.palette.length],value:a,proportion:O(a),percentage:a/p.value*100,strokeWidth:t.value.style.chart.layout.rings.strokeWidth*O(a)})).toSorted((l,a)=>a.value-l.value));function te(){return c.value.map(({name:l,color:a,value:o,absoluteValues:r,percentage:u})=>({name:l,color:a,value:o,absoluteValues:r,percentage:u}))}const d=e.computed(()=>Y.value-t.value.style.chart.layout.rings.strokeWidth*2),P=e.ref(null);function le(l,a){if(i.value.length===v.dataset.length)return;P.value={datapoint:a,seriesIndex:l,series:c.value,config:t.value},m.value=l;const o=c.value[l],r=t.value.style.chart.tooltip.customFormat;if(n.isFunction(r)&&n.functionReturnsString(()=>r({seriesIndex:l,datapoint:a,series:c.value,config:t.value})))_.value=r({seriesIndex:l,datapoint:a,series:c.value,config:t.value});else{let u="";u+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${o.name}</div>`,u+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${o.color}" /></svg>`,t.value.style.chart.tooltip.showValue&&(u+=`<b>${n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:o.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.tooltip.roundingValue})}</b>`),t.value.style.chart.tooltip.showPercentage&&(t.value.style.chart.tooltip.showValue?u+=`<span>(${(o.value/p.value*100).toFixed(t.value.style.chart.tooltip.roundingPercentage)}%)</span></div>`:u+=`<b>${(o.value/p.value*100).toFixed(t.value.style.chart.tooltip.roundingPercentage)}%</b></div>`),_.value=u}T.value=!0}const f=e.computed(()=>{const l=c.value.map(o=>({name:o.name,color:o.color})),a=c.value.map(o=>o.value);return{head:l,body:a}}),S=e.computed(()=>{const l=[' <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>',n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:p.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue}),"100%"],a=f.value.head.map((u,h)=>[{color:u.color,name:u.name},n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:f.value.body[h],s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue}),isNaN(f.value.body[h]/p.value)?"-":(f.value.body[h]/p.value*100).toFixed(t.value.table.td.roundingPercentage)+"%"]),o={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},r=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage];return{head:l,body:a,config:o,colNames:r}});function R(){e.nextTick(()=>{const l=f.value.head.map((r,u)=>[[r.name],[f.value.body[u]],[isNaN(f.value.body[u]/p.value)?"-":f.value.body[u]/p.value*100]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),o=n.createCsvContent(a);n.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-rings"})})}const C=e.ref(!1);function oe(l){C.value=l,V.value+=1}function q(){g.value.showTable=!g.value.showTable}function A(){g.value.showTooltip=!g.value.showTooltip}return G({getData:te,generatePdf:E,generateCsv:R,generateImage:z,toggleTable:q,toggleTooltip:A}),(l,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"ringsChart",ref:k,class:e.normalizeClass(`vue-ui-rings ${C.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};text-align:center;width:100%;background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height: 100%":""}`),id:`rings_${b.value}`,onMouseleave:a[3]||(a[3]=o=>{m.value=null,T.value=!1})},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:F,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor}`)},[e.createVNode(re._sfc_main,{config:{title:{cy:"rings-div-title",...t.value.style.chart.title},subtitle:{cy:"rings-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&x.value?(e.openBlock(),e.createBlock(U.UserOptions,{ref_key:"details",ref:J,key:`user_options_${V.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(K),isImaging:e.unref(Q),uid:b.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isTooltip:g.value.showTooltip,isFullscreen:C.value,titles:{...t.value.userOptions.buttonTitles},chartElement:k.value,onToggleFullscreen:oe,onGeneratePdf:e.unref(E),onGenerateCsv:R,onGenerateImage:e.unref(z),onToggleTable:q,onToggleTooltip:A},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:r})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:r})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),x.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(n.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":C.value,"vue-data-ui-fulscreen--off":!C.value}),viewBox:`0 0 ${s.value.width<=0?10:s.value.width} ${s.value.height<=0?10:s.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(o,r)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"30%",r:"50%",fx:"50%",fy:"50%",id:`gradient_${b.value}_${r}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(n.shiftHue)(o.color,.05)}${e.unref(n.opacity)[100-t.value.style.chart.layout.rings.gradient.intensity]}`},null,8,ge),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,fe)],8,he))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(o,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("circle",{class:e.normalizeClass({"vue-ui-rings-item":y.value&&t.value.useCssAnimation,"vue-rings-item-onload":!y.value&&t.value.useCssAnimation,"vue-ui-rings-opacity":m.value!==null&&m.value!==r}),style:e.normalizeStyle(`animation-delay:${r*100}ms`),stroke:t.value.style.chart.layout.rings.stroke,cx:s.value.width/2,cy:r===0?s.value.height/2:s.value.height/2+d.value*c.value[0].proportion/2-d.value*o.proportion/2-2*(r+1),r:d.value*o.proportion/2*.9<=0?1e-4:d.value*o.proportion/2*.9,fill:t.value.style.chart.layout.rings.gradient.underlayerColor},null,14,me),e.createElementVNode("circle",{class:e.normalizeClass({"vue-ui-rings-item":y.value&&t.value.useCssAnimation,"vue-rings-item-onload":!y.value&&t.value.useCssAnimation,"vue-ui-rings-shadow":t.value.style.chart.layout.rings.useShadow,"vue-ui-rings-blur":m.value!==null&&m.value!==r}),style:e.normalizeStyle(`animation-delay:${r*100}ms`),stroke:t.value.style.chart.layout.rings.stroke,"stroke-width":o.strokeWidth<.5?.5:o.strokeWidth,cx:s.value.width/2,cy:r===0?s.value.height/2:s.value.height/2+d.value*c.value[0].proportion/2-d.value*o.proportion/2-2*(r+1),r:d.value*o.proportion/2*.9<=0?1e-4:d.value*o.proportion/2*.9,fill:t.value.style.chart.layout.rings.gradient.show?`url(#gradient_${b.value}_${r})`:o.color},null,14,ye),e.createElementVNode("circle",{"data-cy-trap":"",stroke:"none",cx:s.value.width/2,cy:r===0?s.value.height/2:s.value.height/2+d.value*c.value[0].proportion/2-d.value*o.proportion/2-2*(r+1),r:d.value*o.proportion/2*.9<=0?1e-4:d.value*o.proportion/2*.9,fill:"transparent",onMouseenter:u=>le(r,o),onMouseleave:a[0]||(a[0]=u=>{m.value=null,T.value=!1})},null,40,be)]))),256)),e.renderSlot(l.$slots,"svg",{svg:s.value},void 0,!0)],14,pe)):e.createCommentVNode("",!0),x.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ie.default,{key:3,config:{type:"rings",style:{backgroundColor:t.value.style.chart.backgroundColor,rings:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:L},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(se.Legend,{key:0,legendSet:M.value,config:ee.value,onClickMarker:a[1]||(a[1]=({legend:o})=>B(o.uid))},{item:e.withCtx(({legend:o})=>[e.createElementVNode("div",{"data-cy-legend-item":"",onClick:r=>B(o.uid),style:e.normalizeStyle(`opacity:${i.value.includes(o.uid)?.5:1}`)},[e.createTextVNode(e.toDisplayString(o.name)+": "+e.toDisplayString(e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:o.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.legend.roundingValue}))+" ",1),i.value.includes(o.uid)?(e.openBlock(),e.createElementBlock("span",we," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",Ce," ("+e.toDisplayString(isNaN(o.value/p.value)?"-":(o.value/p.value*100).toFixed(t.value.style.chart.legend.roundingPercentage))+"%) ",1))],12,ke)]),_:1},8,["legendSet","config"])):e.renderSlot(l.$slots,"legend",{key:1,legend:M.value},void 0,!0)],512),e.createVNode(ne._sfc_main,{show:g.value.showTooltip&&T.value&&i.value.length<v.dataset.length,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,fontSize:t.value.style.chart.tooltip.fontSize,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,parent:k.value,content:_.value,isCustom:t.value.style.chart.tooltip.customFormat&&typeof t.value.style.chart.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...P.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...P.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","parent","content","isCustom"]),x.value?(e.openBlock(),e.createBlock(ce.default,{key:4,hideDetails:"",config:{open:g.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(ue.DataTable,{colNames:S.value.colNames,head:S.value.head,body:S.value.body,config:S.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[2]||(a[2]=o=>g.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,xe)]),td:e.withCtx(({td:o})=>[e.createTextVNode(e.toDisplayString(o.name||o),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,ve))}},$e=de._export_sfc(Te,[["__scopeId","data-v-c7da9220"]]);exports.default=$e;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { ref as n, computed as v, onMounted as xe, onBeforeUnmount as _e, openBlock as c, createElementBlock as m, normalizeClass as R, normalizeStyle as x, createVNode as U, createCommentVNode as S, createBlock as V, unref as C, createSlots as Ne, withCtx as h, renderSlot as f, normalizeProps as H, guardReactiveProps as X, Fragment as ae, renderList as se, createElementVNode as w, createTextVNode as ue, toDisplayString as B, nextTick as Fe } from "vue";
|
|
2
|
-
import { u as Pe, c as ne, t as Le, a as Se, p as T, o as Ie, e as re, g as Oe, b as Me, d as ie, f as D, X as ze, s as Ae, r as Re, v as Ve, w as Be, n as De, q as We } from "./index-
|
|
2
|
+
import { u as Pe, c as ne, t as Le, a as Se, p as T, o as Ie, e as re, g as Oe, b as Me, d as ie, f as D, X as ze, s as Ae, r as Re, v as Ve, w as Be, n as De, q as We } from "./index-D0PI50d6.js";
|
|
3
3
|
import { t as Ee, u as Ge } from "./useResponsive-NZB-WLRF.js";
|
|
4
|
-
import { _ as Ue } from "./Title-
|
|
5
|
-
import { u as He, U as Xe } from "./usePrinter-
|
|
6
|
-
import { _ as je } from "./Tooltip-
|
|
7
|
-
import { D as qe } from "./DataTable-
|
|
8
|
-
import { L as Je } from "./Legend-
|
|
9
|
-
import Ke from "./vue-ui-skeleton-
|
|
10
|
-
import Qe from "./vue-ui-accordion-
|
|
11
|
-
import { u as ve } from "./useNestedProp-
|
|
4
|
+
import { _ as Ue } from "./Title-DM6fKrUI.js";
|
|
5
|
+
import { u as He, U as Xe } from "./usePrinter-DJnJEVGy.js";
|
|
6
|
+
import { _ as je } from "./Tooltip-CAmd4pzg.js";
|
|
7
|
+
import { D as qe } from "./DataTable-Dj8KLJHc.js";
|
|
8
|
+
import { L as Je } from "./Legend-MfrOhwon.js";
|
|
9
|
+
import Ke from "./vue-ui-skeleton-CDB2sB2S.js";
|
|
10
|
+
import Qe from "./vue-ui-accordion-C1dTIdYg.js";
|
|
11
|
+
import { u as ve } from "./useNestedProp-BNV_Y29K.js";
|
|
12
12
|
import { _ as Ye } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
13
13
|
const Ze = ["id"], et = ["xmlns", "viewBox"], tt = ["id"], lt = ["stop-color"], ot = ["stop-color"], at = ["stroke", "cx", "cy", "r", "fill"], st = ["stroke", "stroke-width", "cx", "cy", "r", "fill"], ut = ["cx", "cy", "r", "onMouseenter"], nt = ["onClick"], rt = { key: 0 }, it = { key: 1 }, vt = ["innerHTML"], ct = {
|
|
14
14
|
__name: "vue-ui-rings",
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { computed as m, ref as b, onMounted as je, onBeforeUnmount as Ee, openBlock as s, createElementBlock as i, normalizeClass as ze, normalizeStyle as X, createVNode as te, createCommentVNode as c, createBlock as U, unref as L, createSlots as Ve, withCtx as _, renderSlot as B, normalizeProps as ne, guardReactiveProps as ve, createElementVNode as y, Fragment as N, renderList as W, toDisplayString as w, createTextVNode as Ge, nextTick as Re } from "vue";
|
|
2
|
-
import { u as qe, c as Ue, t as He, a as Je, p as V, o as Ke, e as ye, b as Qe, g as Se, L as Le, X as Ze, N as et, r as ce, f as H, v as tt, w as lt, n as at, q as ot } from "./index-
|
|
2
|
+
import { u as qe, c as Ue, t as He, a as Je, p as V, o as Ke, e as ye, b as Qe, g as Se, L as Le, X as Ze, N as et, r as ce, f as H, v as tt, w as lt, n as at, q as ot } from "./index-D0PI50d6.js";
|
|
3
3
|
import { t as st, u as ut } from "./useResponsive-NZB-WLRF.js";
|
|
4
|
-
import { _ as it } from "./Title-
|
|
5
|
-
import { u as rt, U as nt } from "./usePrinter-
|
|
6
|
-
import { _ as vt } from "./Tooltip-
|
|
7
|
-
import { L as yt } from "./Legend-
|
|
8
|
-
import { _ as Ae } from "./Shape-
|
|
9
|
-
import { D as ct } from "./DataTable-
|
|
10
|
-
import dt from "./vue-ui-skeleton-
|
|
11
|
-
import ht from "./vue-ui-accordion-
|
|
12
|
-
import { u as Te } from "./useNestedProp-
|
|
4
|
+
import { _ as it } from "./Title-DM6fKrUI.js";
|
|
5
|
+
import { u as rt, U as nt } from "./usePrinter-DJnJEVGy.js";
|
|
6
|
+
import { _ as vt } from "./Tooltip-CAmd4pzg.js";
|
|
7
|
+
import { L as yt } from "./Legend-MfrOhwon.js";
|
|
8
|
+
import { _ as Ae } from "./Shape-fssaGSn1.js";
|
|
9
|
+
import { D as ct } from "./DataTable-Dj8KLJHc.js";
|
|
10
|
+
import dt from "./vue-ui-skeleton-CDB2sB2S.js";
|
|
11
|
+
import ht from "./vue-ui-accordion-C1dTIdYg.js";
|
|
12
|
+
import { u as Te } from "./useNestedProp-BNV_Y29K.js";
|
|
13
13
|
import { _ as pt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
14
14
|
const ft = ["id"], gt = ["xmlns", "viewBox"], xt = { key: 0 }, mt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], bt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], kt = { key: 1 }, _t = ["points", "fill", "stroke-width", "stroke-dasharray", "stroke"], wt = { key: 0 }, $t = ["cx", "cy", "r", "fill", "stroke", "stroke-width", "onMouseover"], Mt = { key: 1 }, Ct = { key: 2 }, zt = ["id"], St = ["stop-color"], Lt = ["stop-color"], At = ["id"], Tt = ["stop-color"], Bt = ["stop-color"], Nt = ["x", "y", "width", "height", "fill", "stroke", "stroke-width", "rx"], Ft = ["x", "y", "height", "width", "fill", "stroke", "stroke-width", "rx"], Wt = { key: 0 }, Pt = ["d", "stroke", "stroke-width"], It = ["d", "stroke", "stroke-width"], Ot = ["d", "stroke", "stroke-width"], Xt = ["d", "stroke", "stroke-width"], Dt = {
|
|
15
15
|
key: 3,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),i=require("./index-DFXgoR1T.cjs"),ue=require("./useResponsive-B3TrDDIG.cjs"),we=require("./Title-Ci74YZxW.cjs"),ie=require("./usePrinter-DoFYRZKM.cjs"),_e=require("./Tooltip-BNMjZUBc.cjs"),Be=require("./Legend-DZhpxKg4.cjs"),ce=require("./Shape-CoCdB8es.cjs"),Ce=require("./DataTable-BSoyXOFT.cjs"),Se=require("./vue-ui-skeleton-CmABeGyu.cjs"),Me=require("./vue-ui-accordion-P9OYffC3.cjs"),ye=require("./useNestedProp-CbZUIZc0.cjs"),Ne=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),$e=["id"],Ee=["xmlns","viewBox"],ze={key:0},Le=["x1","x2","y1","y2","stroke","stroke-width"],Ve=["x1","x2","y1","y2","stroke","stroke-width"],Ae={key:1},Te=["points","fill","stroke-width","stroke-dasharray","stroke"],Fe={key:0},Pe=["cx","cy","r","fill","stroke","stroke-width","onMouseover"],De={key:1},We={key:2},Ie=["id"],Oe=["stop-color"],qe=["stop-color"],Xe=["id"],je=["stop-color"],Ye=["stop-color"],Re=["x","y","width","height","fill","stroke","stroke-width","rx"],Ge=["x","y","height","width","fill","stroke","stroke-width","rx"],Ue={key:0},He=["d","stroke","stroke-width"],Je=["d","stroke","stroke-width"],Ke=["d","stroke","stroke-width"],Qe=["d","stroke","stroke-width"],Ze={key:3,style:{"pointer-events":"none !important"}},et=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],tt=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],lt=["x","y","font-size","fill","font-weight","text-anchor"],ot=["x","y","font-size","fill","font-weight"],at=["cx","cy","r","fill","stroke","stroke-width"],st=["cx","cy","r","fill","stroke","stroke-width"],rt=["x","y","font-size","fill","font-weight","text-anchor"],nt={key:4},ut=["x","y","font-size","fill"],it=["x","y","font-size","fill"],ct=["id","transform","font-size","font-weight","fill"],yt={key:5},dt=["x","y","font-size","fill"],vt=["x","y","font-size","fill"],pt=["font-size","font-weight","fill","x","y"],ht=["id"],mt=["x","y","width","height"],ft={key:6},gt=["x1","x2","y1","y2","stroke-dasharray","stroke","stroke-width","clip-path"],kt=["x","y","fill","font-size","font-weight"],xt=["onClick"],bt={key:0,style:{width:"100%",display:"flex","align-items":"center","justify-content":"center"}},wt={viewBox:"0 0 20 20",height:"20",width:"20",style:{overflow:"hidden",background:"transparent"}},_t={key:0},Bt=["innerHTML"],Ct={__name:"vue-ui-scatter",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(de,{expose:ve}){const S=de,{vue_ui_scatter:pe}=i.useConfig(),F=e.computed(()=>!!S.dataset&&S.dataset.length),g=e.ref(i.createUid()),he=e.ref(null),O=e.ref(!1),q=e.ref(""),U=e.ref(0),A=e.ref(null),H=e.ref(null),J=e.ref(null),t=e.computed(()=>{const o=ye.useNestedProp({userConfig:S.config,defaultConfig:pe});return o.theme?{...ye.useNestedProp({userConfig:i.themes.vue_ui_scatter[o.theme]||S.config,defaultConfig:o}),customPalette:i.themePalettes[o.theme]||i.palette}:o}),P=e.ref(null);e.onMounted(()=>{if(i.objectIsEmpty(S.dataset)&&i.error({componentName:"VueUiScatter",type:"dataset"}),t.value.responsive){const o=ue.throttle(()=>{const{width:n,height:l}=ue.useResponsive({chart:A.value,title:t.value.style.title.text?H.value:null,legend:t.value.style.legend.show?J.value:null});k.value.width=n,k.value.height=l});P.value=new ResizeObserver(o),P.value.observe(A.value.parentNode)}}),e.onBeforeUnmount(()=>{P.value&&P.value.disconnect()});const{isPrinting:me,isImaging:fe,generatePdf:K,generateImage:Q}=ie.usePrinter({elementId:`vue-ui-scatter_${g.value}`,fileName:t.value.style.title.text||"vue-ui-scatter"}),Z=e.computed(()=>i.convertCustomPalette(t.value.customPalette)),M=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.tooltip.show}),k=e.ref({height:t.value.style.layout.height,width:t.value.style.layout.width}),D=e.computed(()=>t.value.style.layout.marginalBars.show?t.value.style.layout.marginalBars.size+t.value.style.layout.marginalBars.offset:0),r=e.computed(()=>({top:t.value.style.layout.padding.top+D.value,right:k.value.width-t.value.style.layout.padding.right-D.value,bottom:k.value.height-t.value.style.layout.padding.bottom,left:t.value.style.layout.padding.left,height:k.value.height-t.value.style.layout.padding.top-t.value.style.layout.padding.bottom-D.value,width:k.value.width-t.value.style.layout.padding.left-t.value.style.layout.padding.right-D.value})),p=e.computed(()=>{S.dataset.forEach((a,u)=>{i.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["values"]}).forEach(h=>{i.error({componentName:"VueUiScatter",type:"datasetSerieAttribute",property:h,index:u})}),a.values&&a.values.forEach((h,E)=>{i.getMissingDatasetAttributes({datasetObject:h,requiredAttributes:["x","y"]}).forEach(V=>{i.error({componentName:"VueUiScatter",type:"datasetSerieAttribute",property:`values.${V}`,index:`${u} - ${E}`})})})});const o=Math.min(...$.value.filter(a=>!v.value.includes(a.id)).flatMap(a=>a.values.map(u=>u.x))),n=Math.max(...$.value.filter(a=>!v.value.includes(a.id)).flatMap(a=>a.values.map(u=>u.x))),l=Math.min(...$.value.filter(a=>!v.value.includes(a.id)).flatMap(a=>a.values.map(u=>u.y))),s=Math.max(...$.value.filter(a=>!v.value.includes(a.id)).flatMap(a=>a.values.map(u=>u.y)));return{xMin:o>=0?0:o,xMax:n,yMin:l>=0?0:l,yMax:s}}),y=e.computed(()=>({x:r.value.left+Math.abs(p.value.xMin)/(p.value.xMax+Math.abs(p.value.xMin))*r.value.width,y:r.value.bottom-Math.abs(p.value.yMin)/(p.value.yMax+Math.abs(p.value.yMin))*r.value.height})),$=e.computed(()=>S.dataset.map((o,n)=>{const l=`cluster_${g.value}_${n}`;return{...o,id:l,color:o.color?o.color:Z.value[n]||i.palette[n]||i.palette[n%i.palette.length],opacity:v.value.includes(l)?.5:1,shape:o.shape??"circle",segregate:()=>ae(l),isSegregated:v.value.includes(l)}})),ge=e.computed(()=>({cy:"scatter-div-legend",backgroundColor:t.value.style.legend.backgroundColor,color:t.value.style.legend.color,fontSize:t.value.style.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.legend.bold?"bold":""})),X=e.computed(()=>$.value.map((o,n)=>({...o,plots:o.values.map(l=>({x:r.value.left+(l.x+Math.abs(p.value.xMin))/(p.value.xMax+Math.abs(p.value.xMin))*r.value.width,y:r.value.bottom-(l.y+Math.abs(p.value.yMin))/(p.value.yMax+Math.abs(p.value.yMin))*r.value.height,v:{...l,name:l.name||""},clusterName:o.name,color:o.color?o.color:Z.value[n]||i.palette[n]||i.palette[n%i.palette.length],id:`plot_${g.value}_${Math.random()}`,weight:l.weight??t.value.style.layout.plots.radius}))})).filter(o=>!v.value.includes(o.id))),x=e.computed(()=>X.value.map(o=>{const n=o.plots.reduce((d,z)=>d+z.x,0)/o.plots.length,l=o.plots.reduce((d,z)=>d+z.y,0)/o.plots.length;let s=0,a=0,u=0;for(const d of o.plots)s+=(d.x-n)*(d.y-l),a+=(d.x-n)**2,u+=(d.y-l)**2;const h=s/Math.sqrt(a*u),E=h*(Math.sqrt(u)/Math.sqrt(a)),V=l-E*n,B={x1:r.value.left,x2:r.value.right,y1:E*r.value.left+V,y2:E*r.value.right+V,coefficient:h},f=(B.y2-B.y1)/(B.x2-B.x1),w=B.y1-f*B.x1,C=Math.min(k.value.width-t.value.style.layout.padding.right,Math.max(t.value.style.layout.padding.left,(r.value.top-w)/f)),I={x:C,y:f*C+w<=t.value.style.layout.padding.top?r.value.top:f*C+w};return{...o,correlation:B,label:I,plots:o.plots.map(d=>{const z=(d.x+f*d.y-f*w)/(1+Math.pow(f,2)),Y=(f*d.x+Math.pow(f,2)*d.y+w)/(1+Math.pow(f,2)),m=Math.sqrt(Math.pow(d.x-z,2)+Math.pow(d.y-Y,2));return{...d,deviation:m,shape:o.shape,color:o.color}})}})),ee=e.computed(()=>Math.max(...x.value.flatMap(o=>o.plots.map(n=>Math.abs(n.deviation)))));function ke(){return x.value}function te(o,n){const l=Array.isArray(o)?o.flatMap(m=>m.plots.map(L=>({x:L.x,y:L.y}))):o.plots.map(m=>({x:m.x,y:m.y}));let s=1/0,a=-1/0,u=1/0,h=-1/0;l.forEach(({x:m,y:L})=>{s=Math.min(s,m),a=Math.max(a,m),u=Math.min(u,L),h=Math.max(h,L)});const E=a-s,V=h-u,B=E/n,f=V/n,w=Array(n).fill(0),C=Array(n).fill(0);l.forEach(({x:m,y:L})=>{const R=Math.floor((m-s)/B),G=Math.floor((L-u)/f);w[R]||(w[R]=0),C[G]||(C[G]=0),w[R]+=1,C[G]+=1});const I=[],d=[];for(let m=0;m<n;m+=1)I.push(s+(m+.5)*B),d.push(u+(m+.5)*f);const z=Math.max(...w),Y=Math.max(...C);return{x:w,y:C,avgX:I,avgY:d,maxX:z,maxY:Y}}const N=e.computed(()=>t.value.style.layout.marginalBars.tranches),b=e.computed(()=>te(X.value,N.value)),xe=e.computed(()=>{const o=r.value.top-t.value.style.layout.marginalBars.offset,n=r.value.right+t.value.style.layout.marginalBars.offset;return X.value.map(l=>{const s=te(l,N.value);return{coords:s,dX:i.createSmoothPath(s.avgX.map((a,u)=>({x:a,y:o-s.x[u]/s.maxX*t.value.style.layout.marginalBars.size}))),dY:i.createSmoothPath(s.avgY.map((a,u)=>({y:a,x:n+t.value.style.layout.marginalBars.size*s.y[u]/s.maxY}))),color:l.color,id:l.id}})}),_=e.ref(void 0),c=e.ref(null),j=e.ref(null);function le(o,n){_.value=o.id,c.value=o;let l="";j.value={datapoint:o,seriesIndex:n,series:x.value,config:t.value};const s=t.value.style.tooltip.customFormat;i.isFunction(s)&&i.functionReturnsString(()=>s({datapoint:o,seriesIndex:n,series:x.value,config:t.value}))?q.value=s({datapoint:o,seriesIndex:n,series:x.value,config:t.value}):(o.clusterName&&(l+=`<div style="display:flex;gap:3px;align-items:center">${o.clusterName}</div>`),o.v.name&&(l+=`<div>${o.v.name}</div>`),l+=`<div style="text-align:left;margin-top:6px;padding-top:6px;border-top:1px solid ${t.value.style.tooltip.borderColor}">`,l+=`<div>${t.value.style.layout.dataLabels.xAxis.name}: <b>${isNaN(o.v.x)?"-":i.dataLabel({p:t.value.style.tooltip.prefix,v:o.v.x,s:t.value.style.tooltip.suffix,r:t.value.style.tooltip.roundingValue})}</b></div>`,l+=`<div>${t.value.style.layout.dataLabels.yAxis.name}: <b>${isNaN(o.v.y)?"-":i.dataLabel({p:t.value.style.tooltip.prefix,v:o.v.y,s:t.value.style.tooltip.suffix,r:t.value.style.tooltip.roundingValue})}</b></div>`,l+=`${t.value.style.layout.plots.deviation.translation}: <b>${i.dataLabel({v:o.deviation,r:t.value.style.layout.plots.deviation.roundingValue})}</b>`,l+="</div>",q.value=`<div>${l}</div>`),O.value=!0}function oe(){O.value=!1,_.value=void 0,c.value=null}const v=e.ref([]);function ae(o){v.value.includes(o)?v.value=v.value.filter(n=>n!==o):v.value.length<S.dataset.length-1&&v.value.push(o)}function se(){e.nextTick(()=>{const o=["",t.value.table.translations.correlationCoefficient,t.value.table.translations.nbrPlots,`${t.value.style.layout.dataLabels.xAxis.name} ${t.value.table.translations.average}`,`${t.value.style.layout.dataLabels.yAxis.name} ${t.value.table.translations.average}`],n=x.value.map(a=>[a.name,a.correlation.coefficient,a.plots.length,a.plots.map(u=>u.v.x).reduce((u,h)=>u+h,0)/a.plots.length,a.plots.map(u=>u.v.y).reduce((u,h)=>u+h,0)/a.plots.length]),l=[[t.value.style.title.text],[t.value.style.title.subtitle.text],[[""],[""],[""]]].concat([o]).concat(n),s=i.createCsvContent(l);i.downloadCsv({csvContent:s,title:t.value.style.title.text||"vue-ui-heatmap"})})}const W=e.computed(()=>{const o=[t.value.table.translations.series,t.value.table.translations.correlationCoefficient,t.value.table.translations.nbrPlots,`${t.value.style.layout.dataLabels.xAxis.name} ${t.value.table.translations.average}`,`${t.value.style.layout.dataLabels.yAxis.name} ${t.value.table.translations.average}`],n=x.value.map(s=>[{shape:s.shape,content:s.name,color:s.color},Number((s.correlation.coefficient??0).toFixed(t.value.table.td.roundingValue)).toLocaleString(),s.plots.length.toLocaleString(),Number((s.plots.map(a=>a.v.x??0).reduce((a,u)=>a+u,0)/s.plots.length).toFixed(t.value.table.td.roundingAverage)).toLocaleString(),Number((s.plots.map(a=>a.v.y??0).reduce((a,u)=>a+u,0)/s.plots.length).toFixed(t.value.table.td.roundingAverage)).toLocaleString()]),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{head:o,body:n,config:l,colNames:o}}),T=e.ref(!1);function be(o){T.value=o,U.value+=1}function re(){M.value.showTable=!M.value.showTable}function ne(){M.value.showTooltip=!M.value.showTooltip}return ve({getData:ke,generatePdf:K,generateCsv:se,generateImage:Q,toggleTable:re,toggleTooltip:ne}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-scatter ${T.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),ref_key:"scatterChart",ref:A,id:`vue-ui-scatter_${g.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;${t.value.style.title.text?"":"padding-top:36px"};background:${t.value.style.backgroundColor};${t.value.responsive?"height: 100%":""}`)},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:H,style:e.normalizeStyle(`width:100%;background:${t.value.style.backgroundColor}`)},[e.createVNode(we._sfc_main,{config:{title:{cy:"scatter-div-title",...t.value.style.title},subtitle:{cy:"scatter-div-subtitle",...t.value.style.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&F.value?(e.openBlock(),e.createBlock(ie.UserOptions,{ref_key:"details",ref:he,key:`user_options_${U.value}`,backgroundColor:t.value.style.backgroundColor,color:t.value.style.color,isImaging:e.unref(fe),isPrinting:e.unref(me),uid:g.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isTooltip:M.value.showTooltip,isFullscreen:T.value,titles:{...t.value.userOptions.buttonTitles},chartElement:A.value,onToggleFullscreen:be,onGeneratePdf:e.unref(K),onGenerateCsv:se,onGenerateImage:e.unref(Q),onToggleTable:re,onToggleTooltip:ne},e.createSlots({_:2},[o.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:s})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:s})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),F.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(i.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":T.value,"vue-data-ui-fulscreen--off":!T.value}),viewBox:`0 0 ${k.value.width<=0?10:k.value.width} ${k.value.height<=0?10:k.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:${t.value.style.backgroundColor};color:${t.value.style.color}`)},[t.value.style.layout.axis.show?(e.openBlock(),e.createElementBlock("g",ze,[e.createElementVNode("line",{x1:y.value.x,x2:y.value.x,y1:r.value.top,y2:r.value.bottom,stroke:t.value.style.layout.axis.stroke,"stroke-width":t.value.style.layout.axis.strokeWidth,"stroke-linecap":"round"},null,8,Le),e.createElementVNode("line",{x1:r.value.left,x2:r.value.right,y1:y.value.y,y2:y.value.y,stroke:t.value.style.layout.axis.stroke,"stroke-width":t.value.style.layout.axis.strokeWidth,"stroke-linecap":"round"},null,8,Ve)])):e.createCommentVNode("",!0),t.value.style.layout.plots.giftWrap.show?(e.openBlock(),e.createElementBlock("g",Ae,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",null,[l.plots.length>2?(e.openBlock(),e.createElementBlock("polygon",{key:0,points:e.unref(i.giftWrap)({series:l.plots}),fill:`${l.color}${e.unref(i.opacity)[t.value.style.layout.plots.giftWrap.fillOpacity*100]}`,"stroke-width":t.value.style.layout.plots.giftWrap.strokeWidth,"stroke-dasharray":t.value.style.layout.plots.giftWrap.strokeDasharray,stroke:l.color,"stroke-linejoin":"round","stroke-linecap":"round"},null,8,Te)):e.createCommentVNode("",!0)]))),256))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",null,[!l.shape||l.shape==="circle"?(e.openBlock(),e.createElementBlock("g",Fe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.plots,(a,u)=>(e.openBlock(),e.createElementBlock("circle",{cx:a.x,cy:a.y,r:_.value&&_.value===a.id?a.weight*2:a.weight,fill:`${l.color}${e.unref(i.opacity)[t.value.style.layout.plots.opacity*100]}`,stroke:t.value.style.layout.plots.stroke,"stroke-width":t.value.style.layout.plots.strokeWidth,onMouseover:h=>le(a,s),onMouseleave:oe,style:e.normalizeStyle(`opacity:${_.value&&_.value===a.id?1:t.value.style.layout.plots.significance.useDistanceOpacity?1-Math.abs(a.deviation)/ee.value:t.value.style.layout.plots.significance.show&&Math.abs(a.deviation)>t.value.style.layout.plots.significance.deviationThreshold?t.value.style.layout.plots.significance.opacity:1}`)},null,44,Pe))),256))])):(e.openBlock(),e.createElementBlock("g",De,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.plots,(a,u)=>(e.openBlock(),e.createBlock(ce._sfc_main,{plot:{x:a.x,y:a.y},radius:_.value&&_.value===a.id?a.weight*2:a.weight,shape:l.shape,color:`${l.color}${e.unref(i.opacity)[t.value.style.layout.plots.opacity*100]}`,stroke:t.value.style.layout.plots.stroke,strokeWidth:t.value.style.layout.plots.strokeWidth,onMouseover:h=>le(a,s),onMouseleave:oe,style:e.normalizeStyle(`opacity:${_.value&&_.value===a.id?1:t.value.style.layout.plots.significance.useDistanceOpacity?1-Math.abs(a.deviation)/ee.value:t.value.style.layout.plots.significance.show&&Math.abs(a.deviation)>t.value.style.layout.plots.significance.deviationThreshold?t.value.style.layout.plots.significance.opacity:1}`)},null,8,["plot","radius","shape","color","stroke","strokeWidth","onMouseover","style"]))),256))]))]))),256)),t.value.style.layout.marginalBars.show?(e.openBlock(),e.createElementBlock("g",We,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`marginal_x_${g.value}`,x1:"0%",y1:"0%",x2:"0%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.layout.marginalBars.fill},null,8,Oe),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.backgroundColor},null,8,qe)],8,Ie),e.createElementVNode("linearGradient",{id:`marginal_y_${g.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.backgroundColor},null,8,je),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.layout.marginalBars.fill},null,8,Ye)],8,Xe)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value.x,(l,s)=>(e.openBlock(),e.createElementBlock("g",null,[l&&b.value.avgX[s]?(e.openBlock(),e.createElementBlock("rect",{key:0,x:b.value.avgX[s]-r.value.width/N.value/2,y:r.value.top-t.value.style.layout.marginalBars.offset-l/b.value.maxX*t.value.style.layout.marginalBars.size,width:r.value.width/N.value<=0?1e-4:r.value.width/N.value,height:l/b.value.maxX*t.value.style.layout.marginalBars.size<=0?1e-4:l/b.value.maxX*t.value.style.layout.marginalBars.size,fill:t.value.style.layout.marginalBars.useGradient?`url(#marginal_x_${g.value})`:t.value.style.layout.marginalBars.fill,style:e.normalizeStyle(`opacity:${t.value.style.layout.marginalBars.opacity}`),stroke:t.value.style.backgroundColor,"stroke-width":t.value.style.layout.marginalBars.strokeWidth,rx:t.value.style.layout.marginalBars.borderRadius},null,12,Re)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value.y,(l,s)=>(e.openBlock(),e.createElementBlock("g",null,[l&&b.value.avgY[s]?(e.openBlock(),e.createElementBlock("rect",{key:0,x:r.value.right+t.value.style.layout.marginalBars.offset,y:b.value.avgY[s]-r.value.height/N.value/2,height:r.value.height/N.value<=0?1e-4:r.value.height/N.value,width:l/b.value.maxY*t.value.style.layout.marginalBars.size<=0?1e-4:l/b.value.maxY*t.value.style.layout.marginalBars.size,fill:t.value.style.layout.marginalBars.useGradient?`url(#marginal_y_${g.value})`:t.value.style.layout.marginalBars.fill,style:e.normalizeStyle(`opacity:${t.value.style.layout.marginalBars.opacity}`),stroke:t.value.style.backgroundColor,"stroke-width":t.value.style.layout.marginalBars.strokeWidth,rx:t.value.style.layout.marginalBars.borderRadius},null,12,Ge)):e.createCommentVNode("",!0)]))),256)),t.value.style.layout.marginalBars.showLines?(e.openBlock(),e.createElementBlock("g",Ue,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xe.value,l=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[v.value.includes(l.id)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("path",{key:0,d:`M ${l.dX}`,stroke:t.value.style.backgroundColor,"stroke-width":t.value.style.layout.marginalBars.linesStrokeWidth+1,"stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,8,He)),v.value.includes(l.id)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("path",{key:1,d:`M ${l.dX}`,stroke:l.color,"stroke-width":t.value.style.layout.marginalBars.linesStrokeWidth,"stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,8,Je)),v.value.includes(l.id)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("path",{key:2,d:`M ${l.dY}`,stroke:t.value.style.backgroundColor,"stroke-width":t.value.style.layout.marginalBars.linesStrokeWidth+1,"stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,8,Ke)),v.value.includes(l.id)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("path",{key:3,d:`M ${l.dY}`,stroke:l.color,"stroke-width":t.value.style.layout.marginalBars.linesStrokeWidth,"stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,8,Qe))],64))),256))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),c.value&&t.value.style.layout.plots.selectors.show?(e.openBlock(),e.createElementBlock("g",Ze,[e.createElementVNode("line",{x1:y.value.x,x2:c.value.x,y1:c.value.y,y2:c.value.y,stroke:t.value.style.layout.plots.selectors.stroke,"stroke-width":t.value.style.layout.plots.selectors.strokeWidth,"stroke-dasharray":t.value.style.layout.plots.selectors.strokeDasharray,"stroke-linecap":"round",class:"line-pointer"},null,8,et),e.createElementVNode("line",{x1:c.value.x,x2:c.value.x,y1:y.value.y,y2:c.value.y,stroke:t.value.style.layout.plots.selectors.stroke,"stroke-width":t.value.style.layout.plots.selectors.strokeWidth,"stroke-dasharray":t.value.style.layout.plots.selectors.strokeDasharray,"stroke-linecap":"round",class:"line-pointer"},null,8,tt),e.createElementVNode("text",{x:y.value.x+(c.value.x>y.value.x?-6:6),y:c.value.y+t.value.style.layout.plots.selectors.labels.fontSize/3,"font-size":t.value.style.layout.plots.selectors.labels.fontSize,fill:t.value.style.layout.plots.selectors.labels.color,"font-weight":t.value.style.layout.plots.selectors.labels.bold?"bold":"normal","text-anchor":c.value.x>y.value.x?"end":"start"},e.toDisplayString(e.unref(i.dataLabel)({p:t.value.style.layout.plots.selectors.labels.prefix,v:c.value.v.y,s:t.value.style.layout.plots.selectors.labels.suffix,r:t.value.style.layout.plots.selectors.labels.rounding})),9,lt),e.createElementVNode("text",{x:c.value.x,y:y.value.y+(c.value.y>y.value.y?-6:t.value.style.layout.plots.selectors.labels.fontSize+6),"font-size":t.value.style.layout.plots.selectors.labels.fontSize,fill:t.value.style.layout.plots.selectors.labels.color,"font-weight":t.value.style.layout.plots.selectors.labels.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(e.unref(i.dataLabel)({p:t.value.style.layout.plots.selectors.labels.prefix,v:c.value.v.x,s:t.value.style.layout.plots.selectors.labels.suffix,r:t.value.style.layout.plots.selectors.labels.rounding})),9,ot),e.createElementVNode("circle",{cx:y.value.x,cy:c.value.y,r:t.value.style.layout.plots.selectors.markers.radius,fill:t.value.style.layout.plots.selectors.markers.fill,stroke:t.value.style.layout.plots.selectors.markers.stroke,"stroke-width":t.value.style.layout.plots.selectors.markers.strokeWidth,class:"line-pointer"},null,8,at),e.createElementVNode("circle",{cx:c.value.x,cy:y.value.y,r:t.value.style.layout.plots.selectors.markers.radius,fill:t.value.style.layout.plots.selectors.markers.fill,stroke:t.value.style.layout.plots.selectors.markers.stroke,"stroke-width":t.value.style.layout.plots.selectors.markers.strokeWidth,class:"line-pointer"},null,8,st),t.value.style.layout.plots.selectors.labels.showName?(e.openBlock(),e.createElementBlock("text",{key:0,x:c.value.x,y:c.value.y+(c.value.y<y.value.y?-t.value.style.layout.plots.selectors.labels.fontSize/2:t.value.style.layout.plots.selectors.labels.fontSize),"font-size":t.value.style.layout.plots.selectors.labels.fontSize,fill:t.value.style.layout.plots.selectors.labels.color,"font-weight":t.value.style.layout.plots.selectors.labels.bold?"bold":"normal","text-anchor":c.value.x<r.value.left+100?"start":c.value.x>r.value.right-100?"end":c.value.x>y.value.x?"start":"end"},e.toDisplayString(c.value.v.name),9,rt)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.layout.dataLabels.xAxis.show?(e.openBlock(),e.createElementBlock("g",nt,[e.createElementVNode("text",{x:r.value.left-5,y:y.value.y+t.value.style.layout.dataLabels.xAxis.fontSize/3,"text-anchor":"end","font-size":t.value.style.layout.dataLabels.xAxis.fontSize,fill:t.value.style.layout.dataLabels.xAxis.color},e.toDisplayString(Number(p.value.xMin.toFixed(t.value.style.layout.dataLabels.xAxis.rounding)).toLocaleString()),9,ut),e.createElementVNode("text",{x:r.value.right+3,y:y.value.y+t.value.style.layout.dataLabels.xAxis.fontSize/3,"text-anchor":"start","font-size":t.value.style.layout.dataLabels.xAxis.fontSize,fill:t.value.style.layout.dataLabels.xAxis.color},e.toDisplayString(Number(p.value.xMax.toFixed(t.value.style.layout.dataLabels.xAxis.rounding)).toLocaleString()),9,it),e.createElementVNode("text",{id:`vue-ui-scatter-xAxis-label-${g.value}`,transform:`translate(${t.value.style.layout.dataLabels.xAxis.fontSize*2}, ${r.value.top+r.value.height/2}), rotate(-90)`,"text-anchor":"middle","font-size":t.value.style.layout.dataLabels.xAxis.fontSize,"font-weight":t.value.style.layout.dataLabels.xAxis.bold?"bold":"normal",fill:t.value.style.layout.dataLabels.xAxis.color},e.toDisplayString(t.value.style.layout.dataLabels.xAxis.name),9,ct)])):e.createCommentVNode("",!0),t.value.style.layout.dataLabels.yAxis.show?(e.openBlock(),e.createElementBlock("g",yt,[e.createElementVNode("text",{x:y.value.x,y:r.value.bottom+t.value.style.layout.dataLabels.yAxis.fontSize+3,"text-anchor":"middle","font-size":t.value.style.layout.dataLabels.yAxis.fontSize,fill:t.value.style.layout.dataLabels.yAxis.color},e.toDisplayString(Number(p.value.yMin.toFixed(t.value.style.layout.dataLabels.yAxis.rounding)).toLocaleString()),9,dt),e.createElementVNode("text",{x:y.value.x,y:r.value.top-t.value.style.layout.dataLabels.yAxis.fontSize/2,"text-anchor":"middle","font-size":t.value.style.layout.dataLabels.yAxis.fontSize,fill:t.value.style.layout.dataLabels.yAxis.color},e.toDisplayString(Number(p.value.yMax.toFixed(t.value.style.layout.dataLabels.yAxis.rounding)).toLocaleString()),9,vt),e.createElementVNode("text",{"text-anchor":"middle","font-size":t.value.style.layout.dataLabels.yAxis.fontSize,"font-weight":t.value.style.layout.dataLabels.yAxis.bold?"bold":"normal",fill:t.value.style.layout.dataLabels.yAxis.color,x:r.value.left+r.value.width/2,y:r.value.bottom+8+t.value.style.layout.dataLabels.yAxis.fontSize*2},e.toDisplayString(t.value.style.layout.dataLabels.yAxis.name),9,pt)])):e.createCommentVNode("",!0),e.createElementVNode("clipPath",{id:`clip_path_${g.value}`},[e.createElementVNode("rect",{x:r.value.left,y:r.value.top,width:r.value.width<=0?1e-4:r.value.width,height:r.value.height<=0?1e-4:r.value.height},null,8,mt)],8,ht),t.value.style.layout.correlation.show?(e.openBlock(),e.createElementBlock("g",ft,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(l,s)=>(e.openBlock(),e.createElementBlock("line",{x1:l.correlation.x1,x2:l.correlation.x2,y1:l.correlation.y1,y2:l.correlation.y2,"stroke-dasharray":t.value.style.layout.correlation.strokeDasharray,stroke:l.color,"stroke-width":t.value.style.layout.correlation.strokeWidth,"clip-path":`url(#clip_path_${g.value})`},null,8,gt))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.layout.correlation.label.show?(e.openBlock(),e.createElementBlock("text",{key:0,x:l.label.x,y:l.label.y,fill:t.value.style.layout.correlation.label.useSerieColor?l.color:t.value.style.layout.correlation.label.color,"font-size":t.value.style.layout.correlation.label.fontSize,"font-weight":t.value.style.layout.correlation.label.bold?"bold":"normal"},e.toDisplayString(Number(l.correlation.coefficient.toFixed(t.value.style.layout.correlation.label.roundingValue)).toLocaleString()),9,kt)):e.createCommentVNode("",!0)]))),256))])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"svg",{svg:k.value},void 0,!0)],14,Ee)):e.createCommentVNode("",!0),F.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Se.default,{key:3,config:{type:"quadrant",style:{backgroundColor:t.value.style.backgroundColor,quadrant:{grid:{color:t.value.style.layout.axis.stroke},plots:{color:t.value.style.layout.axis.stroke,radius:1}}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:J},[t.value.style.legend.show?(e.openBlock(),e.createBlock(Be.Legend,{key:0,legendSet:$.value,config:ge.value,onClickMarker:n[0]||(n[0]=({legend:l})=>ae(l.id))},{item:e.withCtx(({legend:l})=>[e.createElementVNode("div",{onClick:s=>l.segregate(),style:e.normalizeStyle(`opacity:${v.value.includes(l.id)?.5:1}`)},e.toDisplayString(l.name),13,xt)]),_:1},8,["legendSet","config"])):e.renderSlot(o.$slots,"legend",{key:1,legend:$.value},void 0,!0)],512),e.createVNode(_e._sfc_main,{show:M.value.showTooltip&&O.value,backgroundColor:t.value.style.tooltip.backgroundColor,color:t.value.style.tooltip.color,borderRadius:t.value.style.tooltip.borderRadius,borderColor:t.value.style.tooltip.borderColor,borderWidth:t.value.style.tooltip.borderWidth,fontSize:t.value.style.tooltip.fontSize,backgroundOpacity:t.value.style.tooltip.backgroundOpacity,parent:A.value,content:q.value,isCustom:t.value.style.tooltip.customFormat&&typeof t.value.style.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...j.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...j.value})),void 0,!0)]),default:e.withCtx(()=>[t.value.style.tooltip.showShape?(e.openBlock(),e.createElementBlock("div",bt,[(e.openBlock(),e.createElementBlock("svg",wt,[e.createVNode(ce._sfc_main,{shape:c.value.shape,color:c.value.color,plot:{x:10,y:10},radius:7},null,8,["shape","color"])]))])):e.createCommentVNode("",!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","parent","content","isCustom"]),F.value?(e.openBlock(),e.createBlock(Me.default,{key:4,hideDetails:"",config:{open:M.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.backgroundColor,color:t.value.style.color},head:{backgroundColor:t.value.style.backgroundColor,color:t.value.style.color}}},{content:e.withCtx(()=>[e.createVNode(Ce.DataTable,{colNames:W.value.colNames,head:W.value.head,body:W.value.body,config:W.value.config,title:`${t.value.style.title.text}${t.value.style.title.subtitle.text?` : ${t.value.style.title.subtitle.text}`:""}`,onClose:n[1]||(n[1]=l=>M.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createTextVNode(e.toDisplayString(l),1)]),td:e.withCtx(({td:l})=>[l.shape?(e.openBlock(),e.createElementBlock("div",_t,[e.createElementVNode("span",null,e.toDisplayString(l.content),1)])):(e.openBlock(),e.createElementBlock("div",{key:1,innerHTML:l},null,8,Bt))]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,$e))}},St=Ne._export_sfc(Ct,[["__scopeId","data-v-134a7dfd"]]);exports.default=St;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),i=require("./index-CSlObCMJ.cjs"),ue=require("./useResponsive-B3TrDDIG.cjs"),we=require("./Title--kLbBq-N.cjs"),ie=require("./usePrinter-ClpmcbPy.cjs"),_e=require("./Tooltip-Dwh7A0L5.cjs"),Be=require("./Legend-BNUo8JKO.cjs"),ce=require("./Shape-DBYznwuk.cjs"),Ce=require("./DataTable-DZ7GOCVh.cjs"),Se=require("./vue-ui-skeleton-aEAr9fnx.cjs"),Me=require("./vue-ui-accordion-IPISean4.cjs"),ye=require("./useNestedProp-DUXlSjg2.cjs"),Ne=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),$e=["id"],Ee=["xmlns","viewBox"],ze={key:0},Le=["x1","x2","y1","y2","stroke","stroke-width"],Ve=["x1","x2","y1","y2","stroke","stroke-width"],Ae={key:1},Te=["points","fill","stroke-width","stroke-dasharray","stroke"],Fe={key:0},Pe=["cx","cy","r","fill","stroke","stroke-width","onMouseover"],De={key:1},We={key:2},Ie=["id"],Oe=["stop-color"],qe=["stop-color"],Xe=["id"],je=["stop-color"],Ye=["stop-color"],Re=["x","y","width","height","fill","stroke","stroke-width","rx"],Ge=["x","y","height","width","fill","stroke","stroke-width","rx"],Ue={key:0},He=["d","stroke","stroke-width"],Je=["d","stroke","stroke-width"],Ke=["d","stroke","stroke-width"],Qe=["d","stroke","stroke-width"],Ze={key:3,style:{"pointer-events":"none !important"}},et=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],tt=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],lt=["x","y","font-size","fill","font-weight","text-anchor"],ot=["x","y","font-size","fill","font-weight"],at=["cx","cy","r","fill","stroke","stroke-width"],st=["cx","cy","r","fill","stroke","stroke-width"],rt=["x","y","font-size","fill","font-weight","text-anchor"],nt={key:4},ut=["x","y","font-size","fill"],it=["x","y","font-size","fill"],ct=["id","transform","font-size","font-weight","fill"],yt={key:5},dt=["x","y","font-size","fill"],vt=["x","y","font-size","fill"],pt=["font-size","font-weight","fill","x","y"],ht=["id"],mt=["x","y","width","height"],ft={key:6},gt=["x1","x2","y1","y2","stroke-dasharray","stroke","stroke-width","clip-path"],kt=["x","y","fill","font-size","font-weight"],xt=["onClick"],bt={key:0,style:{width:"100%",display:"flex","align-items":"center","justify-content":"center"}},wt={viewBox:"0 0 20 20",height:"20",width:"20",style:{overflow:"hidden",background:"transparent"}},_t={key:0},Bt=["innerHTML"],Ct={__name:"vue-ui-scatter",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(de,{expose:ve}){const S=de,{vue_ui_scatter:pe}=i.useConfig(),F=e.computed(()=>!!S.dataset&&S.dataset.length),g=e.ref(i.createUid()),he=e.ref(null),O=e.ref(!1),q=e.ref(""),U=e.ref(0),A=e.ref(null),H=e.ref(null),J=e.ref(null),t=e.computed(()=>{const o=ye.useNestedProp({userConfig:S.config,defaultConfig:pe});return o.theme?{...ye.useNestedProp({userConfig:i.themes.vue_ui_scatter[o.theme]||S.config,defaultConfig:o}),customPalette:i.themePalettes[o.theme]||i.palette}:o}),P=e.ref(null);e.onMounted(()=>{if(i.objectIsEmpty(S.dataset)&&i.error({componentName:"VueUiScatter",type:"dataset"}),t.value.responsive){const o=ue.throttle(()=>{const{width:n,height:l}=ue.useResponsive({chart:A.value,title:t.value.style.title.text?H.value:null,legend:t.value.style.legend.show?J.value:null});k.value.width=n,k.value.height=l});P.value=new ResizeObserver(o),P.value.observe(A.value.parentNode)}}),e.onBeforeUnmount(()=>{P.value&&P.value.disconnect()});const{isPrinting:me,isImaging:fe,generatePdf:K,generateImage:Q}=ie.usePrinter({elementId:`vue-ui-scatter_${g.value}`,fileName:t.value.style.title.text||"vue-ui-scatter"}),Z=e.computed(()=>i.convertCustomPalette(t.value.customPalette)),M=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.tooltip.show}),k=e.ref({height:t.value.style.layout.height,width:t.value.style.layout.width}),D=e.computed(()=>t.value.style.layout.marginalBars.show?t.value.style.layout.marginalBars.size+t.value.style.layout.marginalBars.offset:0),r=e.computed(()=>({top:t.value.style.layout.padding.top+D.value,right:k.value.width-t.value.style.layout.padding.right-D.value,bottom:k.value.height-t.value.style.layout.padding.bottom,left:t.value.style.layout.padding.left,height:k.value.height-t.value.style.layout.padding.top-t.value.style.layout.padding.bottom-D.value,width:k.value.width-t.value.style.layout.padding.left-t.value.style.layout.padding.right-D.value})),p=e.computed(()=>{S.dataset.forEach((a,u)=>{i.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["values"]}).forEach(h=>{i.error({componentName:"VueUiScatter",type:"datasetSerieAttribute",property:h,index:u})}),a.values&&a.values.forEach((h,E)=>{i.getMissingDatasetAttributes({datasetObject:h,requiredAttributes:["x","y"]}).forEach(V=>{i.error({componentName:"VueUiScatter",type:"datasetSerieAttribute",property:`values.${V}`,index:`${u} - ${E}`})})})});const o=Math.min(...$.value.filter(a=>!v.value.includes(a.id)).flatMap(a=>a.values.map(u=>u.x))),n=Math.max(...$.value.filter(a=>!v.value.includes(a.id)).flatMap(a=>a.values.map(u=>u.x))),l=Math.min(...$.value.filter(a=>!v.value.includes(a.id)).flatMap(a=>a.values.map(u=>u.y))),s=Math.max(...$.value.filter(a=>!v.value.includes(a.id)).flatMap(a=>a.values.map(u=>u.y)));return{xMin:o>=0?0:o,xMax:n,yMin:l>=0?0:l,yMax:s}}),y=e.computed(()=>({x:r.value.left+Math.abs(p.value.xMin)/(p.value.xMax+Math.abs(p.value.xMin))*r.value.width,y:r.value.bottom-Math.abs(p.value.yMin)/(p.value.yMax+Math.abs(p.value.yMin))*r.value.height})),$=e.computed(()=>S.dataset.map((o,n)=>{const l=`cluster_${g.value}_${n}`;return{...o,id:l,color:o.color?o.color:Z.value[n]||i.palette[n]||i.palette[n%i.palette.length],opacity:v.value.includes(l)?.5:1,shape:o.shape??"circle",segregate:()=>ae(l),isSegregated:v.value.includes(l)}})),ge=e.computed(()=>({cy:"scatter-div-legend",backgroundColor:t.value.style.legend.backgroundColor,color:t.value.style.legend.color,fontSize:t.value.style.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.legend.bold?"bold":""})),X=e.computed(()=>$.value.map((o,n)=>({...o,plots:o.values.map(l=>({x:r.value.left+(l.x+Math.abs(p.value.xMin))/(p.value.xMax+Math.abs(p.value.xMin))*r.value.width,y:r.value.bottom-(l.y+Math.abs(p.value.yMin))/(p.value.yMax+Math.abs(p.value.yMin))*r.value.height,v:{...l,name:l.name||""},clusterName:o.name,color:o.color?o.color:Z.value[n]||i.palette[n]||i.palette[n%i.palette.length],id:`plot_${g.value}_${Math.random()}`,weight:l.weight??t.value.style.layout.plots.radius}))})).filter(o=>!v.value.includes(o.id))),x=e.computed(()=>X.value.map(o=>{const n=o.plots.reduce((d,z)=>d+z.x,0)/o.plots.length,l=o.plots.reduce((d,z)=>d+z.y,0)/o.plots.length;let s=0,a=0,u=0;for(const d of o.plots)s+=(d.x-n)*(d.y-l),a+=(d.x-n)**2,u+=(d.y-l)**2;const h=s/Math.sqrt(a*u),E=h*(Math.sqrt(u)/Math.sqrt(a)),V=l-E*n,B={x1:r.value.left,x2:r.value.right,y1:E*r.value.left+V,y2:E*r.value.right+V,coefficient:h},f=(B.y2-B.y1)/(B.x2-B.x1),w=B.y1-f*B.x1,C=Math.min(k.value.width-t.value.style.layout.padding.right,Math.max(t.value.style.layout.padding.left,(r.value.top-w)/f)),I={x:C,y:f*C+w<=t.value.style.layout.padding.top?r.value.top:f*C+w};return{...o,correlation:B,label:I,plots:o.plots.map(d=>{const z=(d.x+f*d.y-f*w)/(1+Math.pow(f,2)),Y=(f*d.x+Math.pow(f,2)*d.y+w)/(1+Math.pow(f,2)),m=Math.sqrt(Math.pow(d.x-z,2)+Math.pow(d.y-Y,2));return{...d,deviation:m,shape:o.shape,color:o.color}})}})),ee=e.computed(()=>Math.max(...x.value.flatMap(o=>o.plots.map(n=>Math.abs(n.deviation)))));function ke(){return x.value}function te(o,n){const l=Array.isArray(o)?o.flatMap(m=>m.plots.map(L=>({x:L.x,y:L.y}))):o.plots.map(m=>({x:m.x,y:m.y}));let s=1/0,a=-1/0,u=1/0,h=-1/0;l.forEach(({x:m,y:L})=>{s=Math.min(s,m),a=Math.max(a,m),u=Math.min(u,L),h=Math.max(h,L)});const E=a-s,V=h-u,B=E/n,f=V/n,w=Array(n).fill(0),C=Array(n).fill(0);l.forEach(({x:m,y:L})=>{const R=Math.floor((m-s)/B),G=Math.floor((L-u)/f);w[R]||(w[R]=0),C[G]||(C[G]=0),w[R]+=1,C[G]+=1});const I=[],d=[];for(let m=0;m<n;m+=1)I.push(s+(m+.5)*B),d.push(u+(m+.5)*f);const z=Math.max(...w),Y=Math.max(...C);return{x:w,y:C,avgX:I,avgY:d,maxX:z,maxY:Y}}const N=e.computed(()=>t.value.style.layout.marginalBars.tranches),b=e.computed(()=>te(X.value,N.value)),xe=e.computed(()=>{const o=r.value.top-t.value.style.layout.marginalBars.offset,n=r.value.right+t.value.style.layout.marginalBars.offset;return X.value.map(l=>{const s=te(l,N.value);return{coords:s,dX:i.createSmoothPath(s.avgX.map((a,u)=>({x:a,y:o-s.x[u]/s.maxX*t.value.style.layout.marginalBars.size}))),dY:i.createSmoothPath(s.avgY.map((a,u)=>({y:a,x:n+t.value.style.layout.marginalBars.size*s.y[u]/s.maxY}))),color:l.color,id:l.id}})}),_=e.ref(void 0),c=e.ref(null),j=e.ref(null);function le(o,n){_.value=o.id,c.value=o;let l="";j.value={datapoint:o,seriesIndex:n,series:x.value,config:t.value};const s=t.value.style.tooltip.customFormat;i.isFunction(s)&&i.functionReturnsString(()=>s({datapoint:o,seriesIndex:n,series:x.value,config:t.value}))?q.value=s({datapoint:o,seriesIndex:n,series:x.value,config:t.value}):(o.clusterName&&(l+=`<div style="display:flex;gap:3px;align-items:center">${o.clusterName}</div>`),o.v.name&&(l+=`<div>${o.v.name}</div>`),l+=`<div style="text-align:left;margin-top:6px;padding-top:6px;border-top:1px solid ${t.value.style.tooltip.borderColor}">`,l+=`<div>${t.value.style.layout.dataLabels.xAxis.name}: <b>${isNaN(o.v.x)?"-":i.dataLabel({p:t.value.style.tooltip.prefix,v:o.v.x,s:t.value.style.tooltip.suffix,r:t.value.style.tooltip.roundingValue})}</b></div>`,l+=`<div>${t.value.style.layout.dataLabels.yAxis.name}: <b>${isNaN(o.v.y)?"-":i.dataLabel({p:t.value.style.tooltip.prefix,v:o.v.y,s:t.value.style.tooltip.suffix,r:t.value.style.tooltip.roundingValue})}</b></div>`,l+=`${t.value.style.layout.plots.deviation.translation}: <b>${i.dataLabel({v:o.deviation,r:t.value.style.layout.plots.deviation.roundingValue})}</b>`,l+="</div>",q.value=`<div>${l}</div>`),O.value=!0}function oe(){O.value=!1,_.value=void 0,c.value=null}const v=e.ref([]);function ae(o){v.value.includes(o)?v.value=v.value.filter(n=>n!==o):v.value.length<S.dataset.length-1&&v.value.push(o)}function se(){e.nextTick(()=>{const o=["",t.value.table.translations.correlationCoefficient,t.value.table.translations.nbrPlots,`${t.value.style.layout.dataLabels.xAxis.name} ${t.value.table.translations.average}`,`${t.value.style.layout.dataLabels.yAxis.name} ${t.value.table.translations.average}`],n=x.value.map(a=>[a.name,a.correlation.coefficient,a.plots.length,a.plots.map(u=>u.v.x).reduce((u,h)=>u+h,0)/a.plots.length,a.plots.map(u=>u.v.y).reduce((u,h)=>u+h,0)/a.plots.length]),l=[[t.value.style.title.text],[t.value.style.title.subtitle.text],[[""],[""],[""]]].concat([o]).concat(n),s=i.createCsvContent(l);i.downloadCsv({csvContent:s,title:t.value.style.title.text||"vue-ui-heatmap"})})}const W=e.computed(()=>{const o=[t.value.table.translations.series,t.value.table.translations.correlationCoefficient,t.value.table.translations.nbrPlots,`${t.value.style.layout.dataLabels.xAxis.name} ${t.value.table.translations.average}`,`${t.value.style.layout.dataLabels.yAxis.name} ${t.value.table.translations.average}`],n=x.value.map(s=>[{shape:s.shape,content:s.name,color:s.color},Number((s.correlation.coefficient??0).toFixed(t.value.table.td.roundingValue)).toLocaleString(),s.plots.length.toLocaleString(),Number((s.plots.map(a=>a.v.x??0).reduce((a,u)=>a+u,0)/s.plots.length).toFixed(t.value.table.td.roundingAverage)).toLocaleString(),Number((s.plots.map(a=>a.v.y??0).reduce((a,u)=>a+u,0)/s.plots.length).toFixed(t.value.table.td.roundingAverage)).toLocaleString()]),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{head:o,body:n,config:l,colNames:o}}),T=e.ref(!1);function be(o){T.value=o,U.value+=1}function re(){M.value.showTable=!M.value.showTable}function ne(){M.value.showTooltip=!M.value.showTooltip}return ve({getData:ke,generatePdf:K,generateCsv:se,generateImage:Q,toggleTable:re,toggleTooltip:ne}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-scatter ${T.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),ref_key:"scatterChart",ref:A,id:`vue-ui-scatter_${g.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;${t.value.style.title.text?"":"padding-top:36px"};background:${t.value.style.backgroundColor};${t.value.responsive?"height: 100%":""}`)},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:H,style:e.normalizeStyle(`width:100%;background:${t.value.style.backgroundColor}`)},[e.createVNode(we._sfc_main,{config:{title:{cy:"scatter-div-title",...t.value.style.title},subtitle:{cy:"scatter-div-subtitle",...t.value.style.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&F.value?(e.openBlock(),e.createBlock(ie.UserOptions,{ref_key:"details",ref:he,key:`user_options_${U.value}`,backgroundColor:t.value.style.backgroundColor,color:t.value.style.color,isImaging:e.unref(fe),isPrinting:e.unref(me),uid:g.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isTooltip:M.value.showTooltip,isFullscreen:T.value,titles:{...t.value.userOptions.buttonTitles},chartElement:A.value,onToggleFullscreen:be,onGeneratePdf:e.unref(K),onGenerateCsv:se,onGenerateImage:e.unref(Q),onToggleTable:re,onToggleTooltip:ne},e.createSlots({_:2},[o.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:s})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:s})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),F.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(i.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":T.value,"vue-data-ui-fulscreen--off":!T.value}),viewBox:`0 0 ${k.value.width<=0?10:k.value.width} ${k.value.height<=0?10:k.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:${t.value.style.backgroundColor};color:${t.value.style.color}`)},[t.value.style.layout.axis.show?(e.openBlock(),e.createElementBlock("g",ze,[e.createElementVNode("line",{x1:y.value.x,x2:y.value.x,y1:r.value.top,y2:r.value.bottom,stroke:t.value.style.layout.axis.stroke,"stroke-width":t.value.style.layout.axis.strokeWidth,"stroke-linecap":"round"},null,8,Le),e.createElementVNode("line",{x1:r.value.left,x2:r.value.right,y1:y.value.y,y2:y.value.y,stroke:t.value.style.layout.axis.stroke,"stroke-width":t.value.style.layout.axis.strokeWidth,"stroke-linecap":"round"},null,8,Ve)])):e.createCommentVNode("",!0),t.value.style.layout.plots.giftWrap.show?(e.openBlock(),e.createElementBlock("g",Ae,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",null,[l.plots.length>2?(e.openBlock(),e.createElementBlock("polygon",{key:0,points:e.unref(i.giftWrap)({series:l.plots}),fill:`${l.color}${e.unref(i.opacity)[t.value.style.layout.plots.giftWrap.fillOpacity*100]}`,"stroke-width":t.value.style.layout.plots.giftWrap.strokeWidth,"stroke-dasharray":t.value.style.layout.plots.giftWrap.strokeDasharray,stroke:l.color,"stroke-linejoin":"round","stroke-linecap":"round"},null,8,Te)):e.createCommentVNode("",!0)]))),256))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",null,[!l.shape||l.shape==="circle"?(e.openBlock(),e.createElementBlock("g",Fe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.plots,(a,u)=>(e.openBlock(),e.createElementBlock("circle",{cx:a.x,cy:a.y,r:_.value&&_.value===a.id?a.weight*2:a.weight,fill:`${l.color}${e.unref(i.opacity)[t.value.style.layout.plots.opacity*100]}`,stroke:t.value.style.layout.plots.stroke,"stroke-width":t.value.style.layout.plots.strokeWidth,onMouseover:h=>le(a,s),onMouseleave:oe,style:e.normalizeStyle(`opacity:${_.value&&_.value===a.id?1:t.value.style.layout.plots.significance.useDistanceOpacity?1-Math.abs(a.deviation)/ee.value:t.value.style.layout.plots.significance.show&&Math.abs(a.deviation)>t.value.style.layout.plots.significance.deviationThreshold?t.value.style.layout.plots.significance.opacity:1}`)},null,44,Pe))),256))])):(e.openBlock(),e.createElementBlock("g",De,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.plots,(a,u)=>(e.openBlock(),e.createBlock(ce._sfc_main,{plot:{x:a.x,y:a.y},radius:_.value&&_.value===a.id?a.weight*2:a.weight,shape:l.shape,color:`${l.color}${e.unref(i.opacity)[t.value.style.layout.plots.opacity*100]}`,stroke:t.value.style.layout.plots.stroke,strokeWidth:t.value.style.layout.plots.strokeWidth,onMouseover:h=>le(a,s),onMouseleave:oe,style:e.normalizeStyle(`opacity:${_.value&&_.value===a.id?1:t.value.style.layout.plots.significance.useDistanceOpacity?1-Math.abs(a.deviation)/ee.value:t.value.style.layout.plots.significance.show&&Math.abs(a.deviation)>t.value.style.layout.plots.significance.deviationThreshold?t.value.style.layout.plots.significance.opacity:1}`)},null,8,["plot","radius","shape","color","stroke","strokeWidth","onMouseover","style"]))),256))]))]))),256)),t.value.style.layout.marginalBars.show?(e.openBlock(),e.createElementBlock("g",We,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`marginal_x_${g.value}`,x1:"0%",y1:"0%",x2:"0%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.layout.marginalBars.fill},null,8,Oe),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.backgroundColor},null,8,qe)],8,Ie),e.createElementVNode("linearGradient",{id:`marginal_y_${g.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.backgroundColor},null,8,je),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.layout.marginalBars.fill},null,8,Ye)],8,Xe)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value.x,(l,s)=>(e.openBlock(),e.createElementBlock("g",null,[l&&b.value.avgX[s]?(e.openBlock(),e.createElementBlock("rect",{key:0,x:b.value.avgX[s]-r.value.width/N.value/2,y:r.value.top-t.value.style.layout.marginalBars.offset-l/b.value.maxX*t.value.style.layout.marginalBars.size,width:r.value.width/N.value<=0?1e-4:r.value.width/N.value,height:l/b.value.maxX*t.value.style.layout.marginalBars.size<=0?1e-4:l/b.value.maxX*t.value.style.layout.marginalBars.size,fill:t.value.style.layout.marginalBars.useGradient?`url(#marginal_x_${g.value})`:t.value.style.layout.marginalBars.fill,style:e.normalizeStyle(`opacity:${t.value.style.layout.marginalBars.opacity}`),stroke:t.value.style.backgroundColor,"stroke-width":t.value.style.layout.marginalBars.strokeWidth,rx:t.value.style.layout.marginalBars.borderRadius},null,12,Re)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value.y,(l,s)=>(e.openBlock(),e.createElementBlock("g",null,[l&&b.value.avgY[s]?(e.openBlock(),e.createElementBlock("rect",{key:0,x:r.value.right+t.value.style.layout.marginalBars.offset,y:b.value.avgY[s]-r.value.height/N.value/2,height:r.value.height/N.value<=0?1e-4:r.value.height/N.value,width:l/b.value.maxY*t.value.style.layout.marginalBars.size<=0?1e-4:l/b.value.maxY*t.value.style.layout.marginalBars.size,fill:t.value.style.layout.marginalBars.useGradient?`url(#marginal_y_${g.value})`:t.value.style.layout.marginalBars.fill,style:e.normalizeStyle(`opacity:${t.value.style.layout.marginalBars.opacity}`),stroke:t.value.style.backgroundColor,"stroke-width":t.value.style.layout.marginalBars.strokeWidth,rx:t.value.style.layout.marginalBars.borderRadius},null,12,Ge)):e.createCommentVNode("",!0)]))),256)),t.value.style.layout.marginalBars.showLines?(e.openBlock(),e.createElementBlock("g",Ue,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xe.value,l=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[v.value.includes(l.id)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("path",{key:0,d:`M ${l.dX}`,stroke:t.value.style.backgroundColor,"stroke-width":t.value.style.layout.marginalBars.linesStrokeWidth+1,"stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,8,He)),v.value.includes(l.id)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("path",{key:1,d:`M ${l.dX}`,stroke:l.color,"stroke-width":t.value.style.layout.marginalBars.linesStrokeWidth,"stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,8,Je)),v.value.includes(l.id)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("path",{key:2,d:`M ${l.dY}`,stroke:t.value.style.backgroundColor,"stroke-width":t.value.style.layout.marginalBars.linesStrokeWidth+1,"stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,8,Ke)),v.value.includes(l.id)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("path",{key:3,d:`M ${l.dY}`,stroke:l.color,"stroke-width":t.value.style.layout.marginalBars.linesStrokeWidth,"stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,8,Qe))],64))),256))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),c.value&&t.value.style.layout.plots.selectors.show?(e.openBlock(),e.createElementBlock("g",Ze,[e.createElementVNode("line",{x1:y.value.x,x2:c.value.x,y1:c.value.y,y2:c.value.y,stroke:t.value.style.layout.plots.selectors.stroke,"stroke-width":t.value.style.layout.plots.selectors.strokeWidth,"stroke-dasharray":t.value.style.layout.plots.selectors.strokeDasharray,"stroke-linecap":"round",class:"line-pointer"},null,8,et),e.createElementVNode("line",{x1:c.value.x,x2:c.value.x,y1:y.value.y,y2:c.value.y,stroke:t.value.style.layout.plots.selectors.stroke,"stroke-width":t.value.style.layout.plots.selectors.strokeWidth,"stroke-dasharray":t.value.style.layout.plots.selectors.strokeDasharray,"stroke-linecap":"round",class:"line-pointer"},null,8,tt),e.createElementVNode("text",{x:y.value.x+(c.value.x>y.value.x?-6:6),y:c.value.y+t.value.style.layout.plots.selectors.labels.fontSize/3,"font-size":t.value.style.layout.plots.selectors.labels.fontSize,fill:t.value.style.layout.plots.selectors.labels.color,"font-weight":t.value.style.layout.plots.selectors.labels.bold?"bold":"normal","text-anchor":c.value.x>y.value.x?"end":"start"},e.toDisplayString(e.unref(i.dataLabel)({p:t.value.style.layout.plots.selectors.labels.prefix,v:c.value.v.y,s:t.value.style.layout.plots.selectors.labels.suffix,r:t.value.style.layout.plots.selectors.labels.rounding})),9,lt),e.createElementVNode("text",{x:c.value.x,y:y.value.y+(c.value.y>y.value.y?-6:t.value.style.layout.plots.selectors.labels.fontSize+6),"font-size":t.value.style.layout.plots.selectors.labels.fontSize,fill:t.value.style.layout.plots.selectors.labels.color,"font-weight":t.value.style.layout.plots.selectors.labels.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(e.unref(i.dataLabel)({p:t.value.style.layout.plots.selectors.labels.prefix,v:c.value.v.x,s:t.value.style.layout.plots.selectors.labels.suffix,r:t.value.style.layout.plots.selectors.labels.rounding})),9,ot),e.createElementVNode("circle",{cx:y.value.x,cy:c.value.y,r:t.value.style.layout.plots.selectors.markers.radius,fill:t.value.style.layout.plots.selectors.markers.fill,stroke:t.value.style.layout.plots.selectors.markers.stroke,"stroke-width":t.value.style.layout.plots.selectors.markers.strokeWidth,class:"line-pointer"},null,8,at),e.createElementVNode("circle",{cx:c.value.x,cy:y.value.y,r:t.value.style.layout.plots.selectors.markers.radius,fill:t.value.style.layout.plots.selectors.markers.fill,stroke:t.value.style.layout.plots.selectors.markers.stroke,"stroke-width":t.value.style.layout.plots.selectors.markers.strokeWidth,class:"line-pointer"},null,8,st),t.value.style.layout.plots.selectors.labels.showName?(e.openBlock(),e.createElementBlock("text",{key:0,x:c.value.x,y:c.value.y+(c.value.y<y.value.y?-t.value.style.layout.plots.selectors.labels.fontSize/2:t.value.style.layout.plots.selectors.labels.fontSize),"font-size":t.value.style.layout.plots.selectors.labels.fontSize,fill:t.value.style.layout.plots.selectors.labels.color,"font-weight":t.value.style.layout.plots.selectors.labels.bold?"bold":"normal","text-anchor":c.value.x<r.value.left+100?"start":c.value.x>r.value.right-100?"end":c.value.x>y.value.x?"start":"end"},e.toDisplayString(c.value.v.name),9,rt)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.layout.dataLabels.xAxis.show?(e.openBlock(),e.createElementBlock("g",nt,[e.createElementVNode("text",{x:r.value.left-5,y:y.value.y+t.value.style.layout.dataLabels.xAxis.fontSize/3,"text-anchor":"end","font-size":t.value.style.layout.dataLabels.xAxis.fontSize,fill:t.value.style.layout.dataLabels.xAxis.color},e.toDisplayString(Number(p.value.xMin.toFixed(t.value.style.layout.dataLabels.xAxis.rounding)).toLocaleString()),9,ut),e.createElementVNode("text",{x:r.value.right+3,y:y.value.y+t.value.style.layout.dataLabels.xAxis.fontSize/3,"text-anchor":"start","font-size":t.value.style.layout.dataLabels.xAxis.fontSize,fill:t.value.style.layout.dataLabels.xAxis.color},e.toDisplayString(Number(p.value.xMax.toFixed(t.value.style.layout.dataLabels.xAxis.rounding)).toLocaleString()),9,it),e.createElementVNode("text",{id:`vue-ui-scatter-xAxis-label-${g.value}`,transform:`translate(${t.value.style.layout.dataLabels.xAxis.fontSize*2}, ${r.value.top+r.value.height/2}), rotate(-90)`,"text-anchor":"middle","font-size":t.value.style.layout.dataLabels.xAxis.fontSize,"font-weight":t.value.style.layout.dataLabels.xAxis.bold?"bold":"normal",fill:t.value.style.layout.dataLabels.xAxis.color},e.toDisplayString(t.value.style.layout.dataLabels.xAxis.name),9,ct)])):e.createCommentVNode("",!0),t.value.style.layout.dataLabels.yAxis.show?(e.openBlock(),e.createElementBlock("g",yt,[e.createElementVNode("text",{x:y.value.x,y:r.value.bottom+t.value.style.layout.dataLabels.yAxis.fontSize+3,"text-anchor":"middle","font-size":t.value.style.layout.dataLabels.yAxis.fontSize,fill:t.value.style.layout.dataLabels.yAxis.color},e.toDisplayString(Number(p.value.yMin.toFixed(t.value.style.layout.dataLabels.yAxis.rounding)).toLocaleString()),9,dt),e.createElementVNode("text",{x:y.value.x,y:r.value.top-t.value.style.layout.dataLabels.yAxis.fontSize/2,"text-anchor":"middle","font-size":t.value.style.layout.dataLabels.yAxis.fontSize,fill:t.value.style.layout.dataLabels.yAxis.color},e.toDisplayString(Number(p.value.yMax.toFixed(t.value.style.layout.dataLabels.yAxis.rounding)).toLocaleString()),9,vt),e.createElementVNode("text",{"text-anchor":"middle","font-size":t.value.style.layout.dataLabels.yAxis.fontSize,"font-weight":t.value.style.layout.dataLabels.yAxis.bold?"bold":"normal",fill:t.value.style.layout.dataLabels.yAxis.color,x:r.value.left+r.value.width/2,y:r.value.bottom+8+t.value.style.layout.dataLabels.yAxis.fontSize*2},e.toDisplayString(t.value.style.layout.dataLabels.yAxis.name),9,pt)])):e.createCommentVNode("",!0),e.createElementVNode("clipPath",{id:`clip_path_${g.value}`},[e.createElementVNode("rect",{x:r.value.left,y:r.value.top,width:r.value.width<=0?1e-4:r.value.width,height:r.value.height<=0?1e-4:r.value.height},null,8,mt)],8,ht),t.value.style.layout.correlation.show?(e.openBlock(),e.createElementBlock("g",ft,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(l,s)=>(e.openBlock(),e.createElementBlock("line",{x1:l.correlation.x1,x2:l.correlation.x2,y1:l.correlation.y1,y2:l.correlation.y2,"stroke-dasharray":t.value.style.layout.correlation.strokeDasharray,stroke:l.color,"stroke-width":t.value.style.layout.correlation.strokeWidth,"clip-path":`url(#clip_path_${g.value})`},null,8,gt))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.layout.correlation.label.show?(e.openBlock(),e.createElementBlock("text",{key:0,x:l.label.x,y:l.label.y,fill:t.value.style.layout.correlation.label.useSerieColor?l.color:t.value.style.layout.correlation.label.color,"font-size":t.value.style.layout.correlation.label.fontSize,"font-weight":t.value.style.layout.correlation.label.bold?"bold":"normal"},e.toDisplayString(Number(l.correlation.coefficient.toFixed(t.value.style.layout.correlation.label.roundingValue)).toLocaleString()),9,kt)):e.createCommentVNode("",!0)]))),256))])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"svg",{svg:k.value},void 0,!0)],14,Ee)):e.createCommentVNode("",!0),F.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Se.default,{key:3,config:{type:"quadrant",style:{backgroundColor:t.value.style.backgroundColor,quadrant:{grid:{color:t.value.style.layout.axis.stroke},plots:{color:t.value.style.layout.axis.stroke,radius:1}}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:J},[t.value.style.legend.show?(e.openBlock(),e.createBlock(Be.Legend,{key:0,legendSet:$.value,config:ge.value,onClickMarker:n[0]||(n[0]=({legend:l})=>ae(l.id))},{item:e.withCtx(({legend:l})=>[e.createElementVNode("div",{onClick:s=>l.segregate(),style:e.normalizeStyle(`opacity:${v.value.includes(l.id)?.5:1}`)},e.toDisplayString(l.name),13,xt)]),_:1},8,["legendSet","config"])):e.renderSlot(o.$slots,"legend",{key:1,legend:$.value},void 0,!0)],512),e.createVNode(_e._sfc_main,{show:M.value.showTooltip&&O.value,backgroundColor:t.value.style.tooltip.backgroundColor,color:t.value.style.tooltip.color,borderRadius:t.value.style.tooltip.borderRadius,borderColor:t.value.style.tooltip.borderColor,borderWidth:t.value.style.tooltip.borderWidth,fontSize:t.value.style.tooltip.fontSize,backgroundOpacity:t.value.style.tooltip.backgroundOpacity,parent:A.value,content:q.value,isCustom:t.value.style.tooltip.customFormat&&typeof t.value.style.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...j.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...j.value})),void 0,!0)]),default:e.withCtx(()=>[t.value.style.tooltip.showShape?(e.openBlock(),e.createElementBlock("div",bt,[(e.openBlock(),e.createElementBlock("svg",wt,[e.createVNode(ce._sfc_main,{shape:c.value.shape,color:c.value.color,plot:{x:10,y:10},radius:7},null,8,["shape","color"])]))])):e.createCommentVNode("",!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","parent","content","isCustom"]),F.value?(e.openBlock(),e.createBlock(Me.default,{key:4,hideDetails:"",config:{open:M.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.backgroundColor,color:t.value.style.color},head:{backgroundColor:t.value.style.backgroundColor,color:t.value.style.color}}},{content:e.withCtx(()=>[e.createVNode(Ce.DataTable,{colNames:W.value.colNames,head:W.value.head,body:W.value.body,config:W.value.config,title:`${t.value.style.title.text}${t.value.style.title.subtitle.text?` : ${t.value.style.title.subtitle.text}`:""}`,onClose:n[1]||(n[1]=l=>M.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createTextVNode(e.toDisplayString(l),1)]),td:e.withCtx(({td:l})=>[l.shape?(e.openBlock(),e.createElementBlock("div",_t,[e.createElementVNode("span",null,e.toDisplayString(l.content),1)])):(e.openBlock(),e.createElementBlock("div",{key:1,innerHTML:l},null,8,Bt))]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,$e))}},St=Ne._export_sfc(Ct,[["__scopeId","data-v-134a7dfd"]]);exports.default=St;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),k=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),k=require("./index-CSlObCMJ.cjs"),V=require("./html2canvas.esm-BA_v9SIU.cjs"),U={__name:"vue-ui-screenshot",props:{config:{type:Object,default(){return{}}}},emits:["postImage"],setup(z,{expose:T,emit:H}){const C=z,{vue_ui_screenshot:B}=k.useConfig(),$=i.ref(`vue-ui-screenshot-${Math.random()}`),n=i.computed(()=>{if(!Object.keys(C.config||{}).length)return B;const e=k.treeShake({defaultConfig:B,userConfig:C.config});return k.convertConfigColors(e)}),a=i.ref(null),d=i.ref(null),v=i.ref(null),M=i.ref(null),S=i.ref(null),y=i.ref(null),h=i.ref(null),p=i.ref(null),f=i.ref(null),b=i.ref(null),x=i.ref(null),w=i.ref(!1),I=i.ref(null);function R(){const e=document.createElement("DIV"),{innerWidth:t,innerHeight:l}=window;return e.style.position="fixed",e.style.top=`${l?l/2-n.value.style.captureArea.initialHeight/2:200}px`,e.style.left=`${t?t/2-n.value.style.captureArea.initialWidth/2:100}px`,e.style.width=`${n.value.style.captureArea.initialWidth}px`,e.style.height=`${n.value.style.captureArea.initialHeight}px`,e.style.background=n.value.style.captureArea.background,e.style.cursor="move",e.style.boxSizing="border-box",e.style.border=n.value.style.captureArea.border,e.style.resize="both",e.style.padding="none !important",e.style.margin="none !important",e.dataset.cy="screenshot-overlay",e}function E(){a.value&&(clearTimeout(I.value),a.value.remove(),a.value=null)}function W(e){const t=document.createElement("DIV");t.classList.add("vue-ui-screenshot-info-text"),t.innerHTML=n.value.translations.info,t.dataset.html2canvasIgnore="true",t.dataset.cy="screenshot-info-text",t.style.background=n.value.style.info.background,t.style.color=n.value.style.info.color,t.style.fontWeight=n.value.style.info.bold?"bold":"normal",t.style.minWidth=`${n.value.style.info.minWidth}px`,t.style.left="50%",t.style.padding=`${n.value.style.info.padding}px`,t.style.position="absolute",t.style.textAlign="center",t.style.top=`${n.value.style.info.top}px`,t.style.transform="translateX(-50%)",t.style.borderRadius=`${n.value.style.info.borderRadius}px`,t.style.boxShadow=n.value.style.info.boxShadow,t.style.fontFamily=n.value.style.info.fontFamily,t.style.fontSize=`${n.value.style.info.fontSize}px`,t.style.border=n.value.style.info.border,t.style.userSelect="none";const l=document.createElement("BUTTON");l.classList.add("vue-ui-screenshot-close-button"),l.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" stroke-width="2.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 6l-12 12" /><path d="M6 6l12 12" /></svg>',l.style.outline="none",l.dataset.cy="screenshot-close-button",l.style.display="flex",l.style.cursor="pointer",l.style.borderRadius="50%",l.style.alignItems="center",l.style.position="absolute",l.style.justifyContent="center",l.style.transformOrigin="center",l.style.top=`${n.value.style.cancelButton.top}px`,l.style.right=`${n.value.style.cancelButton.right}px`,l.style.background=n.value.style.cancelButton.background,l.style.color=n.value.style.cancelButton.color,l.style.border=n.value.style.cancelButton.border,l.style.borderRadius=`${n.value.style.cancelButton.borderRadius}px`,l.style.height=`${n.value.style.cancelButton.size}px`,l.style.width=`${n.value.style.cancelButton.size}px`,l.addEventListener("click",E),t.appendChild(l),e.appendChild(t)}function X(e){a.value&&(w.value=!0,e.touches?(y.value=e.touches[0].clientX,h.value=e.touches[0].clientY):(y.value=e.clientX,h.value=e.clientY),b.value=a.value.getBoundingClientRect().width,x.value=a.value.getBoundingClientRect().height,e.target.addEventListener("mousemove",L),e.target.addEventListener("touchmove",L))}function L(e){if(!a.value)return;let t,l;e.touches?(p.value=e.touches[0].clientX,t=e.touches[0].clientX,f.value=e.touches[0].clientY,l=e.touches[0].clientY):(p.value=e.clientX,t=e.clientX,f.value=e.clientY,l=e.clientY);const u=e.target.classList[0],o=a.value.style;switch(!0){case u==="vue-ui-screenshot-handle-nw":o.top=`${l}px`,o.left=`${t}px`,o.width=`${b.value+(y.value-p.value)}px`,o.height=`${x.value+(h.value-f.value)}px`;break;case u==="vue-ui-screenshot-handle-ne":o.top=`${l}px`,o.width=`${b.value+(p.value-y.value)}px`,o.height=`${x.value+(h.value-f.value)}px`;break;case u==="vue-ui-screenshot-handle-sw":o.left=`${t}px`,o.width=`${b.value+(y.value-p.value)}px`,o.height=`${x.value+(f.value-h.value)}px`;break;case u==="vue-ui-screenshot-handle-se":o.width=`${b.value+(p.value-y.value)}px`,o.height=`${x.value+(f.value-h.value)}px`;break}}function A(e){if(!a.value)return;e.stopPropagation();const t=Array.from(e.target.classList);t.includes("vue-ui-screenshot-handle-se")||t.includes("vue-ui-screenshot-handle-sw")||t.includes("vue-ui-screenshot-handle-nw")||t.includes("vue-ui-screenshot-handle-ne")||(w.value=!0,a.value.style.pointerEvents="auto",e.touches?(d.value=e.touches[0].clientX,v.value=e.touches[0].clientY):(d.value=e.clientX,v.value=e.clientY),M.value=d.value,S.value=v.value,document.addEventListener("mousemove",g),document.addEventListener("touchmove",g),document.addEventListener("mouseup",m),document.addEventListener("touchend",m))}function m(){d.value=null,v.value=null,M.value=null,S.value=null,w.value=!1,document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",m),document.removeEventListener("touchmove",g),document.removeEventListener("touchend",m)}function g(e){if(!a.value)return;const t=a.value.getBoundingClientRect();let l,u;e.touches?(l=e.touches[0].clientX-d.value,u=e.touches[0].clientY-v.value,d.value=e.touches[0].clientX,v.value=e.touches[0].clientY):(l=e.clientX-d.value,u=e.clientY-v.value,d.value=e.clientX,v.value=e.clientY),a.value.style.top=`${t.top+u}px`,a.value.style.left=`${t.left+l}px`}function Y(e){e.target.removeEventListener("mousemove",L),e.target.removeEventListener("touchmove",L),document.removeEventListener("mousemove",g),document.removeEventListener("touchmove",g),document.removeEventListener("mouseup",m),document.removeEventListener("touchend",m),w.value=!1}function D(){const e=navigator.userAgent;return/(tablet|ipad|playbook|silk)|(android(?!.*mobi))/i.test(e)?"tablet":/Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Kindle|Silk-Accelerated|(hpw|web)OS|Opera M(obi|ini)/.test(e)?"mobile":"desktop"}function O(){const e=document.getElementById(`vue-ui-screenshot-button-${$.value}`);e.innerHTML=`<svg id="saveButtonSvg" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 20 20" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
2
2
|
<path fill="none" stroke="currentColor" d="M1 4 1 3C1 2 2 1 3 1L4 1M16 1 17 1C18 1 19 2 19 3L19 4M1 16 1 17C1 18 2 19 3 19L4 19M16 19 17 19C18 19 19 18 19 17L19 16M8 10A1 1 0 0012 10 1 1 0 008 10M5 13 5 8C5 7 5 7 6 7L14 7C15 7 15 7 15 8L15 13C15 14 15 14 14 14L6 14C5 14 5 14 5 13M7 6 13 6" />
|
|
3
3
|
</svg>`,document.getElementById(`vue-ui-screenshot-button-${$.value}`).animate([{opacity:"0.3"},{opacity:"1"},{opacity:"0.3"}],{duration:1e3,iterations:1/0}),e.classList.add("loading"),e.setAttribute("disabled","true")}function _(){if(!a.value)return;O();const e=a.value.getBoundingClientRect();I.value=setTimeout(()=>{V.default(document.body,{allowTaint:!0,width:e.width,height:e.height,x:e.left+window.scrollX,y:e.top+window.scrollY,useCORS:!0,scale:n.value.quality}).then(t=>{const l=t.toDataURL("image/png",1),u=l.split(",")[1],c=atob(u).length/1024;if(n.value.mode==="download"){const s=document.createElement("a");s.download="screenshot.png",s.href=l,s.click()}n.value.mode==="post"&&H("postImage",{createdAt:Date.now(),fileSize:`${c.toFixed(2)} KB`,image:l,x:e.left+window.scrollX,y:e.top+window.scrollY,screenWidth:window.innerWidth>0?window.innerWidth:screen.width,deviceType:D()})}).finally(E)},10)}function F(e){const t=n.value.style.handles.size/2+4,l=document.createElement("DIV");l.style.top=`${-t}px`,l.style.left=`${-t}px`,l.style.cursor="nw-resize",l.classList.add("vue-ui-screenshot-handle-nw"),l.dataset.cy="screenshot-handle-nw";const u=document.createElement("DIV");u.style.top=`${-t}px`,u.style.left="auto",u.style.right=`${-t}px`,u.style.cursor="ne-resize",u.classList.add("vue-ui-screenshot-handle-ne"),u.dataset.cy="screenshot-handle-ne";const o=document.createElement("DIV");o.style.top="auto",o.style.bottom=`${-t}px`,o.style.left=`${-t}px`,o.style.cursor="sw-resize",o.classList.add("vue-ui-screenshot-handle-sw"),o.dataset.cy="screenshot-handle-sw";const c=document.createElement("DIV");c.style.top="auto",c.style.left="auto",c.style.right=`${-t}px`,c.style.bottom=`${-t}px`,c.style.cursor="se-resize",c.classList.add("vue-ui-screenshot-handle-se"),c.dataset.cy="screenshot-handle-se";const s=document.createElement("BUTTON");s.innerHTML=`<svg id="saveButtonSvg" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 20 20" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path fill="none" stroke="currentColor" d="M1 4 1 3C1 2 2 1 3 1L4 1M16 1 17 1C18 1 19 2 19 3L19 4M1 16 1 17C1 18 2 19 3 19L4 19M16 19 17 19C18 19 19 18 19 17L19 16M8 10A1 1 0 0012 10 1 1 0 008 10M5 13 5 8C5 7 5 7 6 7L14 7C15 7 15 7 15 8L15 13C15 14 15 14 14 14L6 14C5 14 5 14 5 13M7 6 13 6" /></svg><span>${n.value.translations.captureButton}</span>`,s.classList.add("vue-ui-screenshot-capture-button"),s.id=`vue-ui-screenshot-button-${$.value}`,s.style.position="absolute",s.style.top="50%",s.style.left="50%",s.style.transform="translate(-50%,-50%)",s.style.background=n.value.style.captureButton.background,s.style.color=n.value.style.captureButton.color,s.style.border=n.value.style.captureButton.border,s.style.outline="none",s.style.cursor="pointer",s.style.padding=n.value.style.captureButton.padding,s.style.fontFamily=n.value.style.captureButton.fontFamily,s.style.fontSize=`${n.value.style.captureButton.fontSize}px`,s.style.minHeight=`${n.value.style.captureButton.minHeight}px`,s.style.width="fit-content",s.style.display="flex",s.style.alignItems="center",s.style.justifyContent="center",s.style.gap="3px",s.style.borderRadius=`${n.value.style.captureButton.borderRadius}px`,s.style.boxShadow=n.value.style.captureButton.boxShadow,s.style.userSelect="none",s.style.opacity="0.95",s.style.textAlign="left",s.style.fontWeight=n.value.style.captureButton.bold?"bold":"normal",s.dataset.cy="screenshot-save-button",s.addEventListener("mouseenter",()=>{s.style.opacity="1"}),s.addEventListener("mouseleave",()=>{s.style.opacity="0.95"}),s.addEventListener("click",_),e.appendChild(s),[l,u,o,c].forEach((r,N)=>{r.classList.add(`handle-${N}`),r.dataset.html2canvasIgnore="true",r.style.position="absolute",r.style.height=`${n.value.style.handles.size}px`,r.style.width=`${n.value.style.handles.size}px`,r.style.background=n.value.style.handles.background,r.style.border=n.value.style.handles.border,r.style.borderRadius=`${n.value.style.handles.borderRadius}px`,r.style.pointerEvents="auto !important",r.addEventListener("mousedown",X),r.addEventListener("touchstart",X),e.appendChild(r)})}function j(){a.value||i.nextTick(()=>{const e=R();e.dataset.html2canvasIgnore=!0,W(e),F(e),a.value=e,e.addEventListener("touchmove",function(t){t.preventDefault()},{passive:!1}),document.body.appendChild(e),document.addEventListener("mousedown",A),document.addEventListener("touchstart",A),document.addEventListener("mouseup",Y),document.addEventListener("touchend",Y)})}return T({shoot:j,close:E}),(e,t)=>(i.openBlock(),i.createElementBlock("div"))}};exports.default=U;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ref as i, computed as N, openBlock as V, createElementBlock as U, nextTick as G } from "vue";
|
|
2
|
-
import { u as K, x as P, y as q } from "./index-
|
|
2
|
+
import { u as K, x as P, y as q } from "./index-D0PI50d6.js";
|
|
3
3
|
import J from "./html2canvas.esm-d2sM-0Wm.js";
|
|
4
4
|
const te = {
|
|
5
5
|
__name: "vue-ui-screenshot",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ref as g, computed as x, openBlock as e, createElementBlock as o, normalizeClass as Z, normalizeStyle as n, unref as s, createElementVNode as t, createCommentVNode as a, Fragment as d, renderList as y, pushScopeId as N, popScopeId as F, createStaticVNode as A } from "vue";
|
|
2
|
-
import { u as O, I as L, X as u, r as h, O as X } from "./index-
|
|
3
|
-
import { u as V } from "./useNestedProp-
|
|
2
|
+
import { u as O, I as L, X as u, r as h, O as X } from "./index-D0PI50d6.js";
|
|
3
|
+
import { u as V } from "./useNestedProp-BNV_Y29K.js";
|
|
4
4
|
import { _ as G } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
5
|
const _ = (w) => (N("data-v-73139463"), w = w(), F(), w), R = ["id"], T = ["xmlns"], Y = ["stroke", "fill"], D = ["xmlns"], U = ["stroke", "fill"], J = ["xmlns"], K = ["stroke"], Q = ["fill"], ll = ["stroke", "fill"], tl = ["stroke", "fill"], el = ["fill"], ol = ["stroke", "fill"], sl = ["stroke", "fill"], rl = ["fill"], il = ["stroke", "fill"], nl = ["stroke", "fill"], al = ["fill"], ul = ["stroke", "fill"], cl = ["stroke", "fill"], dl = ["fill"], hl = ["stroke", "fill"], yl = ["stroke", "fill"], kl = ["xmlns"], vl = ["stroke"], _l = ["stroke"], xl = ["stroke", "fill"], pl = ["stroke", "fill"], gl = ["stroke", "fill"], wl = ["stroke", "fill"], fl = ["stroke", "fill"], ml = ["stroke", "fill"], bl = ["stroke", "fill"], Ml = ["stroke", "fill"], $l = ["stroke", "fill"], Cl = ["stroke", "fill"], Ll = ["stroke", "fill"], Al = ["stroke", "fill"], Bl = ["stroke", "fill"], Wl = ["stroke", "fill"], jl = ["stroke", "fill"], Pl = ["stroke", "fill"], zl = ["stroke", "fill"], ql = ["stroke", "fill"], Hl = ["stroke", "fill"], Sl = ["stroke", "fill"], El = ["stroke", "fill"], Il = ["stroke", "fill"], Zl = ["stroke", "fill"], Nl = ["xmlns"], Fl = ["stroke"], Ol = ["xmlns"], Xl = ["stroke"], Vl = ["xmlns"], Gl = ["stroke"], Rl = ["xmlns"], Tl = ["fill"], Yl = ["fill"], Dl = ["fill"], Ul = ["fill"], Jl = ["fill"], Kl = ["fill"], Ql = ["fill"], lt = ["fill"], tt = ["fill"], et = ["fill"], ot = ["fill"], st = ["fill"], rt = ["xmlns"], it = ["stroke"], nt = ["stroke"], at = ["stroke"], ut = ["stroke"], ct = ["stroke"], dt = ["stroke"], ht = ["xmlns"], yt = ["stroke"], kt = ["stroke"], vt = ["stroke"], _t = ["stroke"], xt = ["stroke"], pt = ["stroke"], gt = ["stroke"], wt = ["stroke"], ft = ["stroke"], mt = ["xmlns"], bt = ["stroke"], Mt = ["xmlns"], $t = ["stroke"], Ct = ["stroke"], Lt = ["stroke"], At = ["stroke"], Bt = ["stroke"], Wt = ["stroke"], jt = ["stroke"], Pt = ["stroke"], zt = ["stroke"], qt = ["xmlns"], Ht = ["x1", "x2", "stroke"], St = ["xmlns"], Et = ["x", "y", "width", "height", "fill"], It = ["y", "width", "height", "fill"], Zt = ["xmlns"], Nt = ["fill"], Ft = ["fill"], Ot = ["fill"], Xt = ["xmlns"], Vt = ["x1", "x2", "y1", "y2", "stroke"], Gt = ["stroke"], Rt = ["fill"], Tt = ["xmlns"], Yt = ["fill"], Dt = ["fill"], Ut = ["x1", "y1", "x2", "y2", "stroke-width", "stroke"], Jt = ["xmlns"], Kt = { key: 0 }, Qt = ["stroke", "stroke-width"], le = ["stroke", "stroke-width"], te = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], ee = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], oe = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], se = ["x", "y", "height", "width", "fill"], re = ["xmlns", "viewBox"], ie = ["x", "y", "stroke", "fill"], ne = ["xmlns"], ae = ["d", "stroke"], ue = ["cx", "cy", "r", "fill", "stroke"], ce = ["cx", "cy", "r", "fill", "stroke"], de = ["x", "y", "width", "fill"], he = ["cx", "cy", "fill"], ye = ["cx", "cy", "fill"], ke = ["stroke"], ve = ["xmlns"], _e = ["stroke", "stroke-width"], xe = ["stroke", "stroke-width"], pe = ["stroke", "stroke-width"], ge = ["fill"], we = ["fill"], fe = ["fill"], me = ["fill"], be = ["fill"], Me = ["fill"], $e = ["xmlns"], Ce = { key: 0 }, Le = ["stroke", "stroke-width"], Ae = ["stroke", "stroke-width"], Be = ["stroke", "stroke-width"], We = { key: 1 }, je = ["r", "fill"], Pe = ["r", "fill"], ze = ["xmlns"], qe = { key: 0 }, He = ["stroke", "stroke-width"], Se = ["stroke", "stroke-width"], Ee = ["fill", "rx", "x", "y", "width", "height"], Ie = ["xmlns"], Ze = ["stroke-width", "stroke"], Ne = ["stroke-width", "stroke"], Fe = ["stroke-width", "stroke"], Oe = ["xmlns"], Xe = ["stroke"], Ve = ["stroke"], Ge = ["stroke"], Re = ["stroke"], Te = ["fill"], Ye = ["stroke"], De = ["xmlns"], Ue = ["stroke", "stroke-width"], Je = ["stroke", "stroke-width"], Ke = ["fill", "r"], Qe = ["fill", "r"], lo = ["fill", "r"], to = ["fill", "r"], eo = ["fill", "r"], oo = ["fill", "r"], so = ["fill", "r"], ro = ["fill", "r"], io = ["fill", "r"], no = ["xmlns"], ao = ["d", "stroke", "stroke-width"], uo = ["d", "stroke", "stroke-width"], co = ["d", "stroke", "stroke-width"], ho = ["d", "stroke", "stroke-width"], yo = ["stroke", "stroke-width"], ko = ["stroke", "stroke-width"], vo = ["stroke", "stroke-width"], _o = ["fill"], xo = ["fill"], po = ["xmlns"], go = ["x", "y", "fill"], wo = ["x", "y", "fill"], fo = ["x", "y", "fill"], mo = ["xmlns"], bo = ["fill"], Mo = ["fill"], $o = ["y1", "y2", "stroke", "stroke-width"], Co = ["x1", "x2", "stroke", "stroke-width"], Lo = ["xmlns", "stroke"], Ao = /* @__PURE__ */ _(() => /* @__PURE__ */ t("path", {
|
|
6
6
|
stroke: "none",
|