vue-data-ui 2.10.5 → 2.10.6
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-Badwqciu.cjs → Arrow-Cl3tB80E.cjs} +1 -1
- package/dist/{Arrow-Bb5xelJS.js → Arrow-rRiIHng2.js} +1 -1
- package/dist/{BaseIcon-HDOMbyJq.js → BaseIcon-COlnFbOq.js} +1 -1
- package/dist/{BaseIcon-CvuQ41yl.cjs → BaseIcon-CiINppo2.cjs} +1 -1
- package/dist/{ColorPicker-NOWXYDyd.cjs → ColorPicker-9QCAgrqp.cjs} +1 -1
- package/dist/{ColorPicker-BODnRb0v.js → ColorPicker-UNzkvlGG.js} +3 -3
- package/dist/{DataTable-CGMCHKzY.js → DataTable-CXbN2mJi.js} +2 -2
- package/dist/{DataTable-Bu_0tRZE.cjs → DataTable-DOiZOQ3J.cjs} +1 -1
- package/dist/{Legend-CLZW3_-V.js → Legend-BU9C5fBQ.js} +2 -2
- package/dist/{Legend-BDIC5aus.cjs → Legend-CFqKBI0j.cjs} +1 -1
- package/dist/{PackageVersion-DrU5ubC-.js → PackageVersion-0Lu6RIig.js} +1 -1
- package/dist/{PackageVersion-CKutD59c.cjs → PackageVersion-BMNt7NsQ.cjs} +1 -1
- package/dist/{PenAndPaper-Bnvy0XRn.cjs → PenAndPaper-BUwLP3Wx.cjs} +1 -1
- package/dist/{PenAndPaper-BF6RVx_0.js → PenAndPaper-D4Uu-GqW.js} +3 -3
- package/dist/{Shape-NYJ-EMUq.cjs → Shape-2NRWULE_.cjs} +1 -1
- package/dist/{Shape-D5Dtzm3x.js → Shape-BavMx2aa.js} +1 -1
- package/dist/{Slicer-BrajQoJL.js → Slicer-B_qJHvNR.js} +2 -2
- package/dist/{Slicer-Cdgf9oDx.cjs → Slicer-Ct8BAk8F.cjs} +1 -1
- package/dist/{Title-Cj4tUZSu.cjs → Title-BkfQdTEX.cjs} +1 -1
- package/dist/{Title-BNsKKvQy.js → Title-DrVDm1wy.js} +1 -1
- package/dist/{Tooltip-Dm2APAls.js → Tooltip-BFT6mZ5a.js} +1 -1
- package/dist/{Tooltip-CLjMKc28.cjs → Tooltip-BK88meti.cjs} +1 -1
- package/dist/{dom-to-png-Z6Fps788.js → dom-to-png-0WSGIcUV.js} +1 -1
- package/dist/{dom-to-png-BlAkXMo8.cjs → dom-to-png-CyVwBzNm.cjs} +1 -1
- package/dist/{img-DhPFunow.js → img-BT-UmGcu.js} +1 -1
- package/dist/{img-0HoPau8z.cjs → img-DqK-SXIP.cjs} +1 -1
- package/dist/index-Cai0fWP7.cjs +9 -0
- package/dist/{index-D2h9qRb4.js → index-hMo72hAq.js} +18 -9
- package/dist/{pdf-Dm8bjLUW.cjs → pdf-DY3kwqSx.cjs} +1 -1
- package/dist/{pdf-BpYF_lP6.js → pdf-G7o-GM_m.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/types/vue-data-ui.d.cts +9 -0
- package/dist/types/vue-data-ui.d.ts +9 -0
- package/dist/{useNestedProp-CAbtwUJj.cjs → useNestedProp-DcWhlk8h.cjs} +1 -1
- package/dist/{useNestedProp-DlWfv-mw.js → useNestedProp-DhEaBTgF.js} +1 -1
- package/dist/{usePrinter-B9NkBzf5.cjs → usePrinter-B4ojFS2B.cjs} +1 -1
- package/dist/{usePrinter-BGkHpXM9.js → usePrinter-D2z-bUtX.js} +3 -3
- package/dist/{vue-data-ui-DPoOpdO-.cjs → vue-data-ui-BR4hs3ky.cjs} +1 -1
- package/dist/{vue-data-ui-kWX-2oPX.js → vue-data-ui-BTkU5knB.js} +62 -62
- package/dist/vue-data-ui.cjs +1 -1
- package/dist/vue-data-ui.js +7 -7
- package/dist/{vue-ui-3d-bar-CwsCsbwY.cjs → vue-ui-3d-bar-Cx2zND3j.cjs} +1 -1
- package/dist/{vue-ui-3d-bar-CAJh6lT_.js → vue-ui-3d-bar-DD3_LLbq.js} +9 -9
- package/dist/{vue-ui-accordion-C-v1kmEc.js → vue-ui-accordion-CHMdpjnX.js} +3 -3
- package/dist/{vue-ui-accordion-ChE9WO8Q.cjs → vue-ui-accordion-DUGBjyB1.cjs} +1 -1
- package/dist/{vue-ui-age-pyramid-DdwMF6_I.js → vue-ui-age-pyramid-CUS2cIAl.js} +10 -10
- package/dist/{vue-ui-age-pyramid-CAtI3F1S.cjs → vue-ui-age-pyramid-WpMKbqUM.cjs} +1 -1
- package/dist/{vue-ui-annotator-DQ0W7Q5C.cjs → vue-ui-annotator-B5VYzARK.cjs} +1 -1
- package/dist/{vue-ui-annotator-bkpTEqep.js → vue-ui-annotator-Ckyjvy1h.js} +2 -2
- package/dist/{vue-ui-bullet-CQtNg-wR.cjs → vue-ui-bullet-Clccjys0.cjs} +1 -1
- package/dist/{vue-ui-bullet-BEAyOY56.js → vue-ui-bullet-i97qMAx7.js} +8 -8
- package/dist/{vue-ui-candlestick-DJtpSDju.cjs → vue-ui-candlestick-B35fn-Jo.cjs} +1 -1
- package/dist/{vue-ui-candlestick-DKYirN9r.js → vue-ui-candlestick-Dmu21ktX.js} +11 -11
- package/dist/{vue-ui-carousel-table-VFiMfJos.cjs → vue-ui-carousel-table-23ggTo5D.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-q1hGM_Iw.js → vue-ui-carousel-table-cvW3wpY7.js} +4 -4
- package/dist/{vue-ui-chestnut-B1VUR7mU.js → vue-ui-chestnut-CZpShJyS.js} +8 -8
- package/dist/{vue-ui-chestnut-DRGps83_.cjs → vue-ui-chestnut-CkuDV8dp.cjs} +1 -1
- package/dist/{vue-ui-circle-pack-Bw_j7w4u.js → vue-ui-circle-pack-B6d9PjE2.js} +9 -9
- package/dist/{vue-ui-circle-pack-CkpLDinw.cjs → vue-ui-circle-pack-C2IQV5_6.cjs} +1 -1
- package/dist/{vue-ui-cursor-ZkCZRUcy.js → vue-ui-cursor-CG4bTWjj.js} +2 -2
- package/dist/{vue-ui-cursor-D_ZN42gT.cjs → vue-ui-cursor-CZBmEqOC.cjs} +1 -1
- package/dist/{vue-ui-dashboard-Bcj-LfoN.cjs → vue-ui-dashboard-D-95GOHa.cjs} +1 -1
- package/dist/{vue-ui-dashboard-DnEpTStU.js → vue-ui-dashboard-DqM_deY-.js} +62 -62
- package/dist/{vue-ui-digits-Bsseebr6.js → vue-ui-digits-CKpey7p1.js} +2 -2
- package/dist/{vue-ui-digits-p0PWcPJX.cjs → vue-ui-digits-Cdauuy8X.cjs} +1 -1
- package/dist/{vue-ui-donut-CwvMWv_q.js → vue-ui-donut-Dp2Yy4fh.js} +36 -36
- package/dist/{vue-ui-donut-evolution-C9eui30b.cjs → vue-ui-donut-evolution-Cg1VnagT.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-BzNh2QwP.js → vue-ui-donut-evolution-ClL_5jhm.js} +11 -11
- package/dist/{vue-ui-donut-C3mhQ-03.cjs → vue-ui-donut-j519aqqU.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-BvNEHy9Z.js → vue-ui-dumbbell-C8tOQUbs.js} +10 -10
- package/dist/{vue-ui-dumbbell-BheHAxmy.cjs → vue-ui-dumbbell-CNJ9en-A.cjs} +1 -1
- package/dist/{vue-ui-flow-vz29fymj.cjs → vue-ui-flow-BYypzs-j.cjs} +1 -1
- package/dist/{vue-ui-flow-DBuLJlEV.js → vue-ui-flow-Ouw_lvpb.js} +9 -9
- package/dist/{vue-ui-funnel-DhoOe49e.js → vue-ui-funnel-CfxmaNEA.js} +9 -9
- package/dist/{vue-ui-funnel-D8brKLer.cjs → vue-ui-funnel-DbVCaDxm.cjs} +1 -1
- package/dist/{vue-ui-galaxy-DUQ5z3km.js → vue-ui-galaxy-dm_p5xAR.js} +11 -11
- package/dist/{vue-ui-galaxy-YP3Gl3vG.cjs → vue-ui-galaxy-zBDItFVz.cjs} +1 -1
- package/dist/{vue-ui-gauge-WH6OGXAD.cjs → vue-ui-gauge-Dr-7ojj9.cjs} +1 -1
- package/dist/{vue-ui-gauge-C_8QgadB.js → vue-ui-gauge-DwwvbGca.js} +7 -7
- package/dist/{vue-ui-gizmo-D2AJKoeB.cjs → vue-ui-gizmo-CB5NfNit.cjs} +1 -1
- package/dist/{vue-ui-gizmo-DFy9X5IT.js → vue-ui-gizmo-Cq0SpTfm.js} +3 -3
- package/dist/{vue-ui-heatmap-DH93m9RC.js → vue-ui-heatmap-DNSOppoO.js} +10 -10
- package/dist/{vue-ui-heatmap-Dx8XPeob.cjs → vue-ui-heatmap-DtRSx7DO.cjs} +1 -1
- package/dist/{vue-ui-history-plot-Cmc7KMnB.cjs → vue-ui-history-plot-BvC3L9g3.cjs} +1 -1
- package/dist/{vue-ui-history-plot-C-9fJrMv.js → vue-ui-history-plot-r9eLYJCe.js} +11 -11
- package/dist/{vue-ui-kpi-C6cv6sCW.js → vue-ui-kpi-BBpxo07S.js} +3 -3
- package/dist/{vue-ui-kpi-DqpTRLkQ.cjs → vue-ui-kpi-raHWFHjI.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-BH-Hztc3.js → vue-ui-mini-loader-CGtQXPzk.js} +2 -2
- package/dist/{vue-ui-mini-loader-CpxzfBja.cjs → vue-ui-mini-loader-STx0NSvX.cjs} +1 -1
- package/dist/{vue-ui-molecule-avfEzaAy.cjs → vue-ui-molecule-B4WJo2V5.cjs} +1 -1
- package/dist/{vue-ui-molecule-1475qvln.js → vue-ui-molecule-EYSvyl-h.js} +11 -11
- package/dist/{vue-ui-mood-radar-CnAmD4WX.cjs → vue-ui-mood-radar-CfHUyyMY.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-SJjT1sCF.js → vue-ui-mood-radar-Crk-XB3O.js} +11 -11
- package/dist/vue-ui-nested-donuts-DRJZT5Bv.cjs +17 -0
- package/dist/vue-ui-nested-donuts-Rm4P3uEP.js +1137 -0
- package/dist/{vue-ui-onion-CA2N8k0p.cjs → vue-ui-onion-Bgvs96ms.cjs} +1 -1
- package/dist/{vue-ui-onion-DzreNeV2.js → vue-ui-onion-Dzl_kjlE.js} +11 -11
- package/dist/{vue-ui-parallel-coordinate-plot-CyoOsjFp.js → vue-ui-parallel-coordinate-plot-98c0XRsu.js} +12 -12
- package/dist/{vue-ui-parallel-coordinate-plot-V6vt-U3H.cjs → vue-ui-parallel-coordinate-plot-YuLiWTox.cjs} +1 -1
- package/dist/{vue-ui-quadrant-C7Fb-DVA.cjs → vue-ui-quadrant-CiqJKJu1.cjs} +1 -1
- package/dist/{vue-ui-quadrant-DkMAnQHE.js → vue-ui-quadrant-Dd1ryxBx.js} +40 -40
- package/dist/{vue-ui-quick-chart-BNf57IFn.js → vue-ui-quick-chart-CTsvK-CY.js} +9 -9
- package/dist/{vue-ui-quick-chart-CQp5GSbr.cjs → vue-ui-quick-chart-DMceIo39.cjs} +1 -1
- package/dist/{vue-ui-radar-DHxUS4r0.js → vue-ui-radar-CHYpedpk.js} +12 -12
- package/dist/{vue-ui-radar-DVv2P3B3.cjs → vue-ui-radar-Dp8-SmYd.cjs} +1 -1
- package/dist/{vue-ui-rating-2dp8n1gK.js → vue-ui-rating-DSsm92zG.js} +10 -10
- package/dist/{vue-ui-rating-CA5buZm1.cjs → vue-ui-rating-uVphq_sK.cjs} +1 -1
- package/dist/{vue-ui-relation-circle-BGY0EsvO.cjs → vue-ui-relation-circle-46wKUZTv.cjs} +1 -1
- package/dist/{vue-ui-relation-circle-hU35G-pb.js → vue-ui-relation-circle-BPVBRieo.js} +7 -7
- package/dist/{vue-ui-ridgeline-CTE25ofY.js → vue-ui-ridgeline-B6GA2tXb.js} +49 -49
- package/dist/{vue-ui-ridgeline-dhS0sX29.cjs → vue-ui-ridgeline-OULIMr6I.cjs} +1 -1
- package/dist/{vue-ui-rings-BgJT1xPm.js → vue-ui-rings-Cl-607b8.js} +12 -12
- package/dist/{vue-ui-rings-2XntvE5b.cjs → vue-ui-rings-HVHIYYrh.cjs} +1 -1
- package/dist/{vue-ui-scatter-Brh98c-o.cjs → vue-ui-scatter-BZ4DPyoL.cjs} +1 -1
- package/dist/{vue-ui-scatter-YKeV-y-p.js → vue-ui-scatter-ClYbim5F.js} +44 -44
- package/dist/{vue-ui-skeleton-CNP_4H8z.js → vue-ui-skeleton-C3t9bL6f.js} +19 -19
- package/dist/{vue-ui-skeleton-CK5DdXVo.cjs → vue-ui-skeleton-C954hFY-.cjs} +1 -1
- package/dist/{vue-ui-smiley-3uIAUF4w.cjs → vue-ui-smiley-BBGCa2S0.cjs} +1 -1
- package/dist/{vue-ui-smiley-BUlzuzq6.js → vue-ui-smiley-DsKnKBFv.js} +2 -2
- package/dist/{vue-ui-spark-trend-CfhhjekZ.cjs → vue-ui-spark-trend-CBa0FhIy.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-DmwQZLUP.js → vue-ui-spark-trend-Da-HE7x2.js} +5 -5
- package/dist/{vue-ui-sparkbar-BxKGdAq3.cjs → vue-ui-sparkbar-CUul3e3U.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-TLxa0K9v.js → vue-ui-sparkbar-DgQxbUeJ.js} +4 -4
- package/dist/{vue-ui-sparkgauge-CIwnnQYW.js → vue-ui-sparkgauge-BKA5GnGO.js} +4 -4
- package/dist/{vue-ui-sparkgauge-CWXLMSHa.cjs → vue-ui-sparkgauge-DYPVqz6I.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-Df0Edni4.cjs → vue-ui-sparkhistogram-CNN9tXh1.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-w1rEgV9S.js → vue-ui-sparkhistogram-CdZy4SfH.js} +5 -5
- package/dist/{vue-ui-sparkline-BQCbVZw5.cjs → vue-ui-sparkline-BCP4gyTp.cjs} +1 -1
- package/dist/{vue-ui-sparkline-C2Sf6sF4.js → vue-ui-sparkline-DCNNoruu.js} +15 -15
- package/dist/{vue-ui-sparkstackbar-BaVuTNxy.js → vue-ui-sparkstackbar-BAXGFcPk.js} +5 -5
- package/dist/{vue-ui-sparkstackbar-BlyzQCK8.cjs → vue-ui-sparkstackbar-sgehFSit.cjs} +1 -1
- package/dist/{vue-ui-stackbar-ypv8uR9d.cjs → vue-ui-stackbar-87l909wS.cjs} +1 -1
- package/dist/{vue-ui-stackbar-D4H8uFQ5.js → vue-ui-stackbar-Cto9A9WG.js} +13 -13
- package/dist/{vue-ui-strip-plot-Dxh7xzZf.js → vue-ui-strip-plot-C0F8_S_g.js} +11 -11
- package/dist/{vue-ui-strip-plot-CmrAJ6uF.cjs → vue-ui-strip-plot-Deegqmms.cjs} +1 -1
- package/dist/{vue-ui-table-BD8QgS2P.js → vue-ui-table-1vUkkwSp.js} +3 -3
- package/dist/{vue-ui-table-BmyVGToW.cjs → vue-ui-table-BUxFdYM7.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-DZIrV6Bq.js → vue-ui-table-heatmap-PPGfjMxh.js} +4 -4
- package/dist/{vue-ui-table-heatmap-CXTW4REL.cjs → vue-ui-table-heatmap-uDH3owRO.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline--R1CzNtx.cjs → vue-ui-table-sparkline-CPSlJVB1.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline-B0aYy2JL.js → vue-ui-table-sparkline-D9LEgrxj.js} +5 -5
- package/dist/{vue-ui-thermometer-Dh0nVf-h.js → vue-ui-thermometer-BxngpuEZ.js} +7 -7
- package/dist/{vue-ui-thermometer-DtOy35Jd.cjs → vue-ui-thermometer-D8P88pea.cjs} +1 -1
- package/dist/{vue-ui-timer-Bo3p5wjo.cjs → vue-ui-timer-B_dh6otW.cjs} +1 -1
- package/dist/{vue-ui-timer-C4JkVftX.js → vue-ui-timer-C3dxY--Q.js} +5 -5
- package/dist/{vue-ui-tiremarks-GLU60Yzo.js → vue-ui-tiremarks-_oZ6wL6K.js} +7 -7
- package/dist/{vue-ui-tiremarks-B-3AEiND.cjs → vue-ui-tiremarks-mISKtpmD.cjs} +1 -1
- package/dist/{vue-ui-treemap-ZiuUtYjs.cjs → vue-ui-treemap-CZZXcX0f.cjs} +1 -1
- package/dist/{vue-ui-treemap-QyQqnbJc.js → vue-ui-treemap-D5Dcd84h.js} +12 -12
- package/dist/{vue-ui-vertical-bar-DHZvOGpR.cjs → vue-ui-vertical-bar-C-KAVKXj.cjs} +1 -1
- package/dist/{vue-ui-vertical-bar-CbwZCrcW.js → vue-ui-vertical-bar-CtWXk6co.js} +12 -12
- package/dist/{vue-ui-waffle-D_zRZStV.js → vue-ui-waffle-BD2GnRkO.js} +12 -12
- package/dist/{vue-ui-waffle-Yi5W6qYr.cjs → vue-ui-waffle-C9qyTIzz.cjs} +1 -1
- package/dist/{vue-ui-wheel-D85CwfOC.cjs → vue-ui-wheel-CKfr_7kH.cjs} +1 -1
- package/dist/{vue-ui-wheel-D_wbd08e.js → vue-ui-wheel-HydW49fo.js} +7 -7
- package/dist/{vue-ui-word-cloud-CkActnvX.cjs → vue-ui-word-cloud-C4ISeFpy.cjs} +1 -1
- package/dist/{vue-ui-word-cloud-jMOFgeRb.js → vue-ui-word-cloud-C9Pbi6ey.js} +10 -10
- package/dist/{vue-ui-world-aTdY2yXo.cjs → vue-ui-world-BlAD3UPb.cjs} +1 -1
- package/dist/{vue-ui-world-XMoqQwg7.js → vue-ui-world-D-AsGwlW.js} +11 -11
- package/dist/{vue-ui-xy-DL6V_DZs.js → vue-ui-xy-CMw6P4C0.js} +16 -16
- package/dist/{vue-ui-xy-DYEFXjnb.cjs → vue-ui-xy-CS-xjZVI.cjs} +2 -2
- package/dist/{vue-ui-xy-canvas-K0Qm3FPR.cjs → vue-ui-xy-canvas-Dd7IFwSK.cjs} +1 -1
- package/dist/{vue-ui-xy-canvas-DpX9D7Ny.js → vue-ui-xy-canvas-DtKI-IQA.js} +12 -12
- package/package.json +1 -1
- package/dist/index-D6F-xMcR.cjs +0 -9
- package/dist/vue-ui-nested-donuts-6MGMcByL.js +0 -937
- package/dist/vue-ui-nested-donuts-BkQJr_zV.cjs +0 -17
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-D6F-xMcR.cjs"),F=require("./useNestedProp-CAbtwUJj.cjs"),A=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),R={key:0,class:"vue-ui-rating-title",style:{width:"100%"}},j={key:0,style:{position:"relative"}},O={key:0,style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%"}},X={key:1,style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%"}},I=["src","height","width"],Y=["xmlns","height","width"],G=["id"],P=["stop-color"],U=["stop-color"],q=["points","fill","stroke","stroke-width"],H=["src","alt","height","width","id"],K=["xmlns","viewBox","height","id"],T=["id"],W=["stop-color"],J=["stop-color"],Q=["points","fill","stroke"],Z=["xmlns","height"],ee=["onClick","onMouseenter","onFocus","onKeyup"],te=["onMouseenter","onFocus"],le={__name:"vue-ui-rating",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:["rate"],setup(S,{expose:_,emit:z}){const{vue_ui_rating:w}=a.useConfig(),i=S,v=e.ref(a.createUid()),g=e.ref(!1),r=e.ref(void 0),y=e.ref(void 0),p=e.ref([]),B=e.useSlots();e.onMounted(()=>{B["chart-background"]&&console.warn("VueUiRating does not support the #chart-background slot.")});const V=z,t=e.computed({get:()=>m(),set:o=>o});function m(){return F.useNestedProp({userConfig:i.config,defaultConfig:w})}e.watch(()=>i.config,o=>{t.value=m(),k()},{deep:!0});const N=e.computed(()=>typeof i.dataset.rating=="object"&&!Array.isArray(i.dataset.rating)?E(i.dataset.rating):i.dataset.rating),C=e.computed(()=>typeof i.dataset.rating=="object"&&!Array.isArray(i.dataset.rating)),u=e.ref(N.value),h=e.computed(()=>t.value.type==="image"),c=e.computed(()=>t.value.readonly);function E(o){let n=0,l=0;for(const s in o){const D=parseInt(s),x=o[s];n+=D*x,l+=x}if(l===0)return 0;const d=n/l;return Math.min(t.value.to,Math.max(t.value.from,d))}e.onMounted(()=>{k()});function k(){(!Object.hasOwn(i.dataset,"rating")||a.objectIsEmpty(i.dataset))&&a.error({componentName:"VueUiRating",type:"datasetAttribute",property:"rating"}),p.value=[];for(let o=t.value.from;o<=t.value.to;o+=1)p.value.push(o)}function f(o,n=!1){return o>r.value||c.value?n?t.value.style.image.inactiveOpacity:t.value.style.star.inactiveColor:n?1:t.value.style.star.useGradient?`url(#star_gradient_under_${v.value})`:t.value.style.star.activeColor}function $(o,n=!1){const l=u.value-o,d=n?1:100;switch(!0){case l<=0:return .001;case l>1:return 1*d;default:return l*d}}function b(o){c.value||(u.value=o,V("rate",o))}function L(){return u.value}function M(o=!0){c.value=o}return _({getData:L,toggleReadonly:M}),(o,n)=>(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:n[4]||(n[4]=l=>g.value=!0),onMouseleave:n[5]||(n[5]=l=>{g.value=!1,r.value=void 0})},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",R,[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(e.unref(a.applyDataLabel)(t.value.style.rating.formatter,u.value,e.unref(a.dataLabel)({v:u.value,r:t.value.style.rating.roundingValue}),t.value)),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(e.unref(a.applyDataLabel)(t.value.style.rating.formatter,u.value,e.unref(a.dataLabel)({v:u.value,r:t.value.style.rating.roundingValue}),t.value)),5)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,(l,d)=>(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`)},[o.$slots["layer-under"]||o.$slots["layer-above"]?(e.openBlock(),e.createElementBlock("div",j,[o.$slots["layer-under"]?(e.openBlock(),e.createElementBlock("div",O,[e.renderSlot(o.$slots,"layer-under",e.mergeProps({ref_for:!0},{value:l,size:t.value.style.itemSize,hoveredValue:r.value,focusedValue:y.value}),void 0,!0)])):e.createCommentVNode("",!0),o.$slots["layer-above"]?(e.openBlock(),e.createElementBlock("div",X,[e.renderSlot(o.$slots,"layer-above",e.mergeProps({ref_for:!0},{value:l,size:t.value.style.itemSize,hoveredValue:r.value,focusedValue:y.value}),void 0,!0)])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[h.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:f(l,!0)}`)},null,12,I)):(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(a.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_${v.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(a.shiftHue)(t.value.style.star.activeColor,.05)}`},null,8,P),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.star.activeColor},null,8,U)],8,G)]),e.createElementVNode("polygon",{points:e.unref(a.createStar)({plot:{x:50,y:50},radius:30,apexes:t.value.style.star.apexes}),fill:isNaN(r.value)?t.value.style.star.inactiveColor:f(l),stroke:t.value.style.star.borderColor?t.value.style.star.borderColor:r.value?f(l):t.value.style.star.inactiveColor,"stroke-width":t.value.style.star.borderWidth,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,q)],8,Y)),h.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_${v.value}_${l}`,class:"vue-ui-rating-unit",style:e.normalizeStyle(`position:absolute;top:0;left:0;clip:rect(0px,${$(d,!0)*t.value.style.itemSize}px,${t.value.style.itemSize}px,0px`)},null,12,H)):(e.openBlock(),e.createElementBlock("svg",{key:3,xmlns:e.unref(a.XMLNS),viewBox:`0 0 ${$(d)} 100`,height:t.value.style.itemSize,class:"vue-ui-rating-unit",id:`active_${v.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_${v.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(a.shiftHue)(t.value.style.star.activeColor,.05)}`},null,8,W),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.star.activeColor},null,8,J)],8,T)]),e.createElementVNode("polygon",{points:e.unref(a.createStar)({plot:{x:50,y:50},radius:30,apexes:t.value.style.star.apexes}),fill:t.value.style.star.useGradient?`url(#star_gradient_over_${v.value})`:t.value.style.star.activeColor,stroke:t.value.style.star.activeColor},null,8,Q)],8,K))],64)),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(a.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:s=>b(l),onMouseenter:s=>r.value=l,onMouseleave:n[0]||(n[0]=s=>r.value=void 0),onFocus:s=>y.value=l,onBlur:n[1]||(n[1]=s=>y.value=void 0),tabindex:"0",onKeyup:e.withKeys(s=>b(l),["enter"])},null,40,ee)),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:s=>r.value=l,onMouseleave:n[2]||(n[2]=s=>r.value=void 0),onFocus:s=>y.value=l,onBlur:n[3]||(n[3]=s=>y.value=void 0)},null,40,te)):e.createCommentVNode("",!0)],12,Z)),t.value.style.tooltip.show&&C.value&&c.value?(e.openBlock(),e.createElementBlock("div",{key:2,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.createElementVNode("span",{style:e.normalizeStyle(`font-weight:${t.value.style.tooltip.bold?"bold":"normal"};font-size:${t.value.style.tooltip.fontSize}px`)},e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.tooltip.formatter,i.dataset.rating[l],e.unref(a.dataLabel)({v:i.dataset.rating[l],r:t.value.style.tooltip.roundingValue}),t.value)),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(e.unref(a.applyDataLabel)(t.value.style.rating.formatter,u.value,e.unref(a.dataLabel)({v:u.value,r:t.value.style.rating.roundingValue}),t.value)),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(e.unref(a.applyDataLabel)(t.value.style.rating.formatter,u.value,e.unref(a.dataLabel)({v:u.value,r:t.value.style.rating.roundingValue}),t.value)),5)):e.createCommentVNode("",!0)],36))}},oe=A._export_sfc(le,[["__scopeId","data-v-e9ed619f"]]);exports.default=oe;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-Cai0fWP7.cjs"),F=require("./useNestedProp-DcWhlk8h.cjs"),A=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),R={key:0,class:"vue-ui-rating-title",style:{width:"100%"}},j={key:0,style:{position:"relative"}},O={key:0,style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%"}},X={key:1,style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%"}},I=["src","height","width"],Y=["xmlns","height","width"],G=["id"],P=["stop-color"],U=["stop-color"],q=["points","fill","stroke","stroke-width"],H=["src","alt","height","width","id"],K=["xmlns","viewBox","height","id"],T=["id"],W=["stop-color"],J=["stop-color"],Q=["points","fill","stroke"],Z=["xmlns","height"],ee=["onClick","onMouseenter","onFocus","onKeyup"],te=["onMouseenter","onFocus"],le={__name:"vue-ui-rating",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:["rate"],setup(S,{expose:_,emit:z}){const{vue_ui_rating:w}=a.useConfig(),i=S,v=e.ref(a.createUid()),g=e.ref(!1),r=e.ref(void 0),y=e.ref(void 0),p=e.ref([]),B=e.useSlots();e.onMounted(()=>{B["chart-background"]&&console.warn("VueUiRating does not support the #chart-background slot.")});const V=z,t=e.computed({get:()=>m(),set:o=>o});function m(){return F.useNestedProp({userConfig:i.config,defaultConfig:w})}e.watch(()=>i.config,o=>{t.value=m(),k()},{deep:!0});const N=e.computed(()=>typeof i.dataset.rating=="object"&&!Array.isArray(i.dataset.rating)?E(i.dataset.rating):i.dataset.rating),C=e.computed(()=>typeof i.dataset.rating=="object"&&!Array.isArray(i.dataset.rating)),u=e.ref(N.value),h=e.computed(()=>t.value.type==="image"),c=e.computed(()=>t.value.readonly);function E(o){let n=0,l=0;for(const s in o){const D=parseInt(s),x=o[s];n+=D*x,l+=x}if(l===0)return 0;const d=n/l;return Math.min(t.value.to,Math.max(t.value.from,d))}e.onMounted(()=>{k()});function k(){(!Object.hasOwn(i.dataset,"rating")||a.objectIsEmpty(i.dataset))&&a.error({componentName:"VueUiRating",type:"datasetAttribute",property:"rating"}),p.value=[];for(let o=t.value.from;o<=t.value.to;o+=1)p.value.push(o)}function f(o,n=!1){return o>r.value||c.value?n?t.value.style.image.inactiveOpacity:t.value.style.star.inactiveColor:n?1:t.value.style.star.useGradient?`url(#star_gradient_under_${v.value})`:t.value.style.star.activeColor}function $(o,n=!1){const l=u.value-o,d=n?1:100;switch(!0){case l<=0:return .001;case l>1:return 1*d;default:return l*d}}function b(o){c.value||(u.value=o,V("rate",o))}function L(){return u.value}function M(o=!0){c.value=o}return _({getData:L,toggleReadonly:M}),(o,n)=>(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:n[4]||(n[4]=l=>g.value=!0),onMouseleave:n[5]||(n[5]=l=>{g.value=!1,r.value=void 0})},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",R,[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(e.unref(a.applyDataLabel)(t.value.style.rating.formatter,u.value,e.unref(a.dataLabel)({v:u.value,r:t.value.style.rating.roundingValue}),t.value)),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(e.unref(a.applyDataLabel)(t.value.style.rating.formatter,u.value,e.unref(a.dataLabel)({v:u.value,r:t.value.style.rating.roundingValue}),t.value)),5)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,(l,d)=>(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`)},[o.$slots["layer-under"]||o.$slots["layer-above"]?(e.openBlock(),e.createElementBlock("div",j,[o.$slots["layer-under"]?(e.openBlock(),e.createElementBlock("div",O,[e.renderSlot(o.$slots,"layer-under",e.mergeProps({ref_for:!0},{value:l,size:t.value.style.itemSize,hoveredValue:r.value,focusedValue:y.value}),void 0,!0)])):e.createCommentVNode("",!0),o.$slots["layer-above"]?(e.openBlock(),e.createElementBlock("div",X,[e.renderSlot(o.$slots,"layer-above",e.mergeProps({ref_for:!0},{value:l,size:t.value.style.itemSize,hoveredValue:r.value,focusedValue:y.value}),void 0,!0)])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[h.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:f(l,!0)}`)},null,12,I)):(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(a.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_${v.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(a.shiftHue)(t.value.style.star.activeColor,.05)}`},null,8,P),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.star.activeColor},null,8,U)],8,G)]),e.createElementVNode("polygon",{points:e.unref(a.createStar)({plot:{x:50,y:50},radius:30,apexes:t.value.style.star.apexes}),fill:isNaN(r.value)?t.value.style.star.inactiveColor:f(l),stroke:t.value.style.star.borderColor?t.value.style.star.borderColor:r.value?f(l):t.value.style.star.inactiveColor,"stroke-width":t.value.style.star.borderWidth,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,q)],8,Y)),h.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_${v.value}_${l}`,class:"vue-ui-rating-unit",style:e.normalizeStyle(`position:absolute;top:0;left:0;clip:rect(0px,${$(d,!0)*t.value.style.itemSize}px,${t.value.style.itemSize}px,0px`)},null,12,H)):(e.openBlock(),e.createElementBlock("svg",{key:3,xmlns:e.unref(a.XMLNS),viewBox:`0 0 ${$(d)} 100`,height:t.value.style.itemSize,class:"vue-ui-rating-unit",id:`active_${v.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_${v.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(a.shiftHue)(t.value.style.star.activeColor,.05)}`},null,8,W),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.star.activeColor},null,8,J)],8,T)]),e.createElementVNode("polygon",{points:e.unref(a.createStar)({plot:{x:50,y:50},radius:30,apexes:t.value.style.star.apexes}),fill:t.value.style.star.useGradient?`url(#star_gradient_over_${v.value})`:t.value.style.star.activeColor,stroke:t.value.style.star.activeColor},null,8,Q)],8,K))],64)),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(a.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:s=>b(l),onMouseenter:s=>r.value=l,onMouseleave:n[0]||(n[0]=s=>r.value=void 0),onFocus:s=>y.value=l,onBlur:n[1]||(n[1]=s=>y.value=void 0),tabindex:"0",onKeyup:e.withKeys(s=>b(l),["enter"])},null,40,ee)),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:s=>r.value=l,onMouseleave:n[2]||(n[2]=s=>r.value=void 0),onFocus:s=>y.value=l,onBlur:n[3]||(n[3]=s=>y.value=void 0)},null,40,te)):e.createCommentVNode("",!0)],12,Z)),t.value.style.tooltip.show&&C.value&&c.value?(e.openBlock(),e.createElementBlock("div",{key:2,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.createElementVNode("span",{style:e.normalizeStyle(`font-weight:${t.value.style.tooltip.bold?"bold":"normal"};font-size:${t.value.style.tooltip.fontSize}px`)},e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.tooltip.formatter,i.dataset.rating[l],e.unref(a.dataLabel)({v:i.dataset.rating[l],r:t.value.style.tooltip.roundingValue}),t.value)),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(e.unref(a.applyDataLabel)(t.value.style.rating.formatter,u.value,e.unref(a.dataLabel)({v:u.value,r:t.value.style.rating.roundingValue}),t.value)),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(e.unref(a.applyDataLabel)(t.value.style.rating.formatter,u.value,e.unref(a.dataLabel)({v:u.value,r:t.value.style.rating.roundingValue}),t.value)),5)):e.createCommentVNode("",!0)],36))}},oe=A._export_sfc(le,[["__scopeId","data-v-e9ed619f"]]);exports.default=oe;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-D6F-xMcR.cjs"),ee=require("./useResponsive-DQmBAoBf.cjs"),Be=require("./Title-Cj4tUZSu.cjs"),te=require("./usePrinter-B9NkBzf5.cjs"),$e=require("./vue-ui-skeleton-CK5DdXVo.cjs"),le=require("./useNestedProp-CAbtwUJj.cjs"),_e=require("./PackageVersion-CKutD59c.cjs"),Pe=require("./PenAndPaper-Bnvy0XRn.cjs"),Le=require("./useUserOptionState-BgepsfED.cjs"),ze=require("./useChartAccessibility-Cm7nkzTG.cjs"),Oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Se=["id"],Ee=["xmlns","viewBox"],Ae=["width","height"],Ne=["cx","cy","r","stroke","stroke-width"],Ie={key:1},Ve=["stroke","d","stroke-width"],Fe={style:{"pointer-events":"none"}},Me=["cx","cy","fill","r","stroke"],Re=["x","y","fill","font-size"],Te={key:2},qe=["stroke","stroke-width","x1","x2","y1","y2"],je={style:{"pointer-events":"none"}},De=["cx","cy","fill","r","stroke"],Ue=["x","y","fill","font-size"],Ge=["text-anchor","transform","x","y","onClick","font-weight","font-size","fill"],We=["cx","cy","fill","stroke","onClick","r"],Ye={key:5,class:"vue-data-ui-watermark"},Xe={__name:"vue-ui-relation-circle",props:{dataset:{type:Array,default(){return[]}},config:{type:Object,default(){return{}}}},setup(re,{expose:ne}){e.useCssVars(t=>({cc1109c8:ce.value,fd19c20a:ue.value,"0d0b359d":de.value}));const{vue_ui_relation_circle:oe}=s.useConfig(),y=re,$=e.computed(()=>!!y.dataset&&Object.keys(y.dataset).length),w=e.ref(s.createUid()),E=e.ref(0),b=e.ref(null),A=e.ref(null),N=e.ref(null),I=e.ref(null),V=e.ref(0),r=e.computed({get:()=>T(),set:t=>t}),{userOptionsVisible:_,setUserOptionsVisibility:F,keepUserOptionState:M}=Le.useUserOptionState({config:r.value}),{svgRef:R}=ze.useChartAccessibility({config:r.value.style.title});function T(){const t=le.useNestedProp({userConfig:y.config,defaultConfig:oe});return t.theme?{...le.useNestedProp({userConfig:s.themes.vue_ui_relation_circle[t.theme]||y.config,defaultConfig:t}),customPalette:s.themePalettes[t.theme]||s.palette}:t}e.watch(()=>y.config,t=>{r.value=T(),_.value=!r.value.userOptions.showOnChartHover,X(),V.value+=1},{deep:!0});const{isPrinting:q,isImaging:j,generatePdf:D,generateImage:U}=te.usePrinter({elementId:`relation_circle_${w.value}`,fileName:r.value.style.title.text||"vue-ui-relation-circle",options:r.value.userOptions.print}),se=e.computed(()=>r.value.userOptions.show&&!r.value.style.title.text),G=e.computed(()=>s.convertCustomPalette(r.value.customPalette)),h=e.ref([]),d=e.ref([]),i=e.ref({}),v=e.ref([]),ae=e.ref(0),P=e.computed(()=>y.dataset.slice(0,r.value.style.limit)),k=e.ref(r.value.style.size),f=e.ref(r.value.style.weightLabels.size),W=e.ref(r.value.style.plot.radius),Y=e.ref(r.value.style.labels.fontSize),a=e.ref({height:r.value.style.size,width:r.value.style.size}),m=e.computed({get(){return k.value*r.value.style.circle.radiusProportion},set(t){return t}}),ie=e.computed(()=>r.value.style.links.curved),ue=e.computed(()=>`${r.value.style.animation.speedMs}ms`),ce=e.computed(()=>m.value*2),de=e.computed(()=>m.value*4),x=e.ref(null);e.onMounted(()=>{X(),document.getElementById(`relation_circle_${w.value}`).addEventListener("click",H)});function X(){if(s.objectIsEmpty(y.dataset)?s.error({componentName:"VueUiRelationCircle",type:"dataset"}):y.dataset.forEach((t,n)=>{s.getMissingDatasetAttributes({datasetObject:t,requiredAttributes:["id","label","relations","weights"]}).forEach(l=>{s.error({componentName:"VueUiRelationCircle",type:"datasetSerieAttribute",property:l,index:n})})}),r.value.responsive){const t=ee.throttle(()=>{const{width:n,height:l}=ee.useResponsive({chart:b.value,title:r.value.style.title.text?A.value:null,source:N.value,noTitle:I.value});requestAnimationFrame(()=>{k.value=Math.min(n,l),a.value.width=n,a.value.height=l,m.value=k.value*r.value.style.circle.radiusProportion,h.value=[],d.value=[],J(),K(),f.value=s.translateSize({relator:k.value,adjuster:r.value.style.size,source:r.value.style.weightLabels.size,threshold:6,fallback:6}),W.value=s.translateSize({relator:k.value,adjuster:r.value.style.size,source:r.value.style.plot.radius,threshold:1,fallback:1}),Y.value=s.translateSize({relator:k.value,adjuster:r.value.style.size,source:r.value.style.labels.fontSize,threshold:6,fallback:6})})});x.value=new ResizeObserver(t),x.value.observe(b.value.parentNode)}else h.value=[],d.value=[],J(),K()}e.onBeforeUnmount(()=>{document.getElementById(`relation_circle_${w.value}`).removeEventListener("click",H),x.value&&x.value.disconnect()});function H(t){const n=t.target;n&&Array.from(n.classList).includes("vue-ui-user-options")||n&&Array.from(n.classList).includes("vue-ui-user-options-summary")||n&&Array.from(n.classList).includes("vue-data-ui-button")||n&&Array.from(n.classList).includes("vue-ui-relation-circle-legend")||(i.value={},v.value=[])}function J(){const t=6.28319/P.value.length,n=360/P.value.length;let l=0,o=0;P.value.forEach((c,u)=>{const O=c.weights.reduce((xe,Ce)=>xe+Ce,0),S=m.value*Math.cos(l)+a.value.width/2,be=m.value*Math.sin(l)+a.value.height/2+r.value.style.circle.offsetY;h.value.push({x:S,y:be,...c,color:c.color?c.color:G.value[u]?G.value[u]:s.palette[u],regAngle:o,totalWeight:O}),l+=t,o+=n})}function ve(t,n){const l=(t.x+n.x)/2,o=(t.y+n.y)/2;return{x:l,y:o}}function K(){d.value=[],h.value.forEach(t=>{h.value.filter(l=>l.relations.includes(t.id)).forEach((l,o)=>{const c=l.relations.indexOf(t.id);d.value.push({weight:l.weights[c]?l.weights[c]:0,relationId:`${t.id}_${l.id}`,x1:t.x,y1:t.y,x2:l.x,y2:l.y,colorSource:t.color,colorTarget:l.color,midPointLine:ve({x:t.x,y:t.y},{x:l.x,y:l.y}),midPointBezier:fe({x1:t.x,x2:l.x,y1:t.y,y2:l.y}),...t})})})}function fe(t){const n={x:t.x1,y:t.y1},l={x:t.x2,y:t.y2},o={x:t.x1,y:t.y1},c={x:a.value.width/2,y:a.value.height/2+r.value.style.circle.offsetY},u=.5,O=Math.pow(1-u,3)*n.x+3*Math.pow(1-u,2)*u*o.x+3*(1-u)*Math.pow(u,2)*c.x+Math.pow(u,3)*l.x,S=Math.pow(1-u,3)*n.y+3*Math.pow(1-u,2)*u*o.y+3*(1-u)*Math.pow(u,2)*c.y+Math.pow(u,3)*l.y;return{x:O,y:S}}const ye=e.computed(()=>Math.max(...d.value.map(t=>t.weight)));function ge(t){return Object.hasOwn(i.value,"x")?v.value.includes(t.id)?"opacity:1":"opacity:0.1":"opacity:1"}function g(t){return t.colorSource}function Q(t){return Object.hasOwn(i.value,"x")?v.value.includes(t.id)&&t.relationId===`${t.id}_${i.value.id}`||t.relationId===`${i.value.id}_${t.id}`?`opacity:1;stroke-width:${L(t)}`:"opacity: 0":"opacity: 1"}function p(t){return Object.hasOwn(i.value,"x")?!!(v.value.includes(t.id)&&t.relationId===`${t.id}_${i.value.id}`||t.relationId===`${i.value.id}_${t.id}`):!1}function he(t){return t.regAngle>90&&t.regAngle<270?"end":"start"}function me(t){return t.regAngle>90&&t.regAngle<270?t.x-5:t.x+5}function ke(t){return Object.hasOwn(i.value,"x")?i.value.id===t.id||v.value.includes(t.id)?"opacity:1":"opacity:0.2":"opacity:1"}function pe(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){ae.value=360-t.regAngle,i.value.id&&t.id===i.value.id?(i.value={},v.value=[]):(i.value=t,v.value=[...t.relations])}function L(t){const n=t.weight/ye.value*r.value.style.links.maxWidth;return Math.max(.3,n)}const C=e.ref(!1);function we(t){C.value=t,E.value+=1}const B=e.ref(!1);function z(){B.value=!B.value}return ne({generatePdf:D,generateImage:U,toggleAnnotator:z}),(t,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"relationCircleChart",ref:b,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_${w.value}`,onMouseenter:n[0]||(n[0]=()=>e.unref(F)(!0)),onMouseleave:n[1]||(n[1]=()=>e.unref(F)(!1))},[r.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Pe._sfc_main,{key:0,svgRef:e.unref(R),backgroundColor:r.value.style.backgroundColor,color:r.value.style.color,active:B.value,onClose:z},null,8,["svgRef","backgroundColor","color","active"])):e.createCommentVNode("",!0),se.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:I,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),r.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:A,style:"width:100%;background:transparent"},[(e.openBlock(),e.createBlock(Be._sfc_main,{key:`title_${V.value}`,config:{title:{cy:"relation-div-title",...r.value.style.title},subtitle:{cy:"relation-div-subtitle",...r.value.style.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),r.value.userOptions.show&&$.value&&(e.unref(M)||e.unref(_))?(e.openBlock(),e.createBlock(te.UserOptions,{ref:"details",key:`user_options_${E.value}`,backgroundColor:r.value.style.backgroundColor,color:r.value.style.color,isPrinting:e.unref(q),isImaging:e.unref(j),uid:w.value,hasPdf:r.value.userOptions.buttons.pdf,hasImg:r.value.userOptions.buttons.img,hasFullscreen:r.value.userOptions.buttons.img,hasXls:!1,isFullscreen:C.value,titles:{...r.value.userOptions.buttonTitles},chartElement:b.value,position:r.value.userOptions.position,hasAnnotator:r.value.userOptions.buttons.annotator,isAnnotation:B.value,onToggleFullscreen:we,onGeneratePdf:e.unref(D),onGenerateImage:e.unref(U),onToggleAnnotator:z,style:e.normalizeStyle({visibility:e.unref(M)?e.unref(_)?"visible":"hidden":"visible"})},e.createSlots({_:2},[t.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:l,color:o})=>[e.renderSlot(t.$slots,"menuIcon",e.normalizeProps(e.guardReactiveProps({isOpen:l,color:o})),void 0,!0)]),key:"0"}:void 0,t.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,t.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,t.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:o})=>[e.renderSlot(t.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:o})),void 0,!0)]),key:"3"}:void 0,t.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:o})=>[e.renderSlot(t.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:o})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),$.value?(e.openBlock(),e.createElementBlock("svg",{key:4,ref_key:"svgRef",ref:R,xmlns:e.unref(s.XMLNS),class:e.normalizeClass([{"vue-data-ui-fullscreen--on":C.value,"vue-data-ui-fulscreen--off":!C.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:"user-select:none; background:transparent"},[e.createVNode(_e._sfc_main),t.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:a.value.width<=0?10:a.value.width,height:a.value.height<=0?10:a.value.height,style:{pointerEvents:"none"}},[e.renderSlot(t.$slots,"chart-background",{},void 0,!0)],8,Ae)):e.createCommentVNode("",!0),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:m.value<=0?1e-4:m.value,stroke:r.value.style.circle.stroke,"stroke-width":r.value.style.circle.strokeWidth,fill:"transparent",class:"main-circle"},null,8,Ne),ie.value?(e.openBlock(),e.createElementBlock("g",Ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,o)=>(e.openBlock(),e.createElementBlock("path",{key:`relation_${o}`,style:e.normalizeStyle(Q(l)),stroke:g(l),class:e.normalizeClass(["relation",{"vue-ui-relation-circle-selected":i.value.hasOwnProperty("id")&&v.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":L(l),"stroke-linecap":"round"},null,14,Ve))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,o)=>(e.openBlock(),e.createElementBlock("g",Fe,[p(l)?e.renderSlot(t.$slots,"dataLabel",e.mergeProps({key:0,ref_for:!0},{x:l.midPointBezier.x,y:l.midPointBezier.y,color:g(l),weight:l.weight,fontSize:f.value}),void 0,!0):e.createCommentVNode("",!0),p(l)&&!t.$slots.dataLabel?(e.openBlock(),e.createElementBlock("circle",{key:1,cx:l.midPointBezier.x,cy:l.midPointBezier.y,fill:g(l),r:f.value,stroke:r.value.style.backgroundColor,"stroke-width":"1"},null,8,Me)):e.createCommentVNode("",!0),p(l)&&!t.$slots.dataLabel?(e.openBlock(),e.createElementBlock("text",{key:2,x:l.midPointBezier.x,y:l.midPointBezier.y+f.value/3,fill:e.unref(s.adaptColorToBackground)(g(l)),"text-anchor":"middle","font-size":f.value},e.toDisplayString(e.unref(s.applyDataLabel)(r.value.style.weightLabels.formatter,l.weight,e.unref(s.dataLabel)({p:r.value.style.weightLabels.prefix,v:l.weight,s:r.value.style.weightLabels.suffix,r:r.value.style.weightLabels.rounding}),{...l})),9,Re)):e.createCommentVNode("",!0)]))),256))])):(e.openBlock(),e.createElementBlock("g",Te,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,o)=>(e.openBlock(),e.createElementBlock("line",{key:`relation_${o}`,stroke:g(l),"stroke-width":L(l),style:e.normalizeStyle(Q(l)),x1:l.x1,x2:l.x2,y1:l.y1,y2:l.y2,class:e.normalizeClass({"vue-ui-relation-circle-selected":i.value.hasOwnProperty("id")&&v.value.includes(l.id)}),"stroke-linecap":"round"},null,14,qe))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,o)=>(e.openBlock(),e.createElementBlock("g",je,[p(l)?e.renderSlot(t.$slots,"dataLabel",e.mergeProps({key:0,ref_for:!0},{x:l.midPointLine.x,y:l.midPointLine.y,color:g(l),weight:l.weight,fontSize:f.value}),void 0,!0):e.createCommentVNode("",!0),p(l)&&!t.$slots.dataLabel&&r.value.style.weightLabels.show?(e.openBlock(),e.createElementBlock("circle",{key:1,cx:l.midPointLine.x,cy:l.midPointLine.y,fill:g(l),r:f.value,stroke:r.value.style.backgroundColor,"stroke-width":"1"},null,8,De)):e.createCommentVNode("",!0),p(l)&&!t.$slots.dataLabel&&r.value.style.weightLabels.show?(e.openBlock(),e.createElementBlock("text",{key:2,x:l.midPointLine.x,y:l.midPointLine.y+f.value/3,fill:e.unref(s.adaptColorToBackground)(g(l)),"text-anchor":"middle","font-size":f.value},e.toDisplayString(e.unref(s.applyDataLabel)(r.value.style.weightLabels.formatter,l.weight,e.unref(s.dataLabel)({p:r.value.style.weightLabels.prefix,v:l.weight,s:r.value.style.weightLabels.suffix,r:r.value.style.weightLabels.rounding}),{...l})),9,Ue)):e.createCommentVNode("",!0)]))),256))])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(l,o)=>(e.openBlock(),e.createElementBlock("text",{key:`plot_text_${o}`,"text-anchor":he(l),transform:pe(l),x:me(l),y:l.y+5,onClick:c=>Z(l),class:"vue-ui-relation-circle-legend","transform-origin":"start","font-weight":i.value.id===l.id?"900":"400",style:e.normalizeStyle(`font-family:${r.value.style.fontFamily};${ke(l)}`),"font-size":Y.value,fill:r.value.style.labels.color},e.toDisplayString(l.label)+" ("+e.toDisplayString(e.unref(s.applyDataLabel)(r.value.style.weightLabels.formatter,l.totalWeight,e.unref(s.dataLabel)({p:r.value.style.weightLabels.prefix,v:l.totalWeight,s:r.value.style.weightLabels.suffix,r:r.value.style.weightLabels.rounding}),{...l}))+") ",13,Ge))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(l,o)=>(e.openBlock(),e.createElementBlock("circle",{cx:l.x,cy:l.y,key:`plot_${o}`,style:e.normalizeStyle(ge(l)),class:"vue-ui-relation-circle-plot",fill:r.value.style.plot.useSerieColor?l.color:r.value.style.plot.color,stroke:r.value.style.backgroundColor,"stroke-width":"1",onClick:c=>Z(l),r:W.value},null,12,We))),128)),e.renderSlot(t.$slots,"svg",{svg:a.value},void 0,!0)],10,Ee)):e.createCommentVNode("",!0),t.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ye,[e.renderSlot(t.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(q)||e.unref(j)})),void 0,!0)])):e.createCommentVNode("",!0),t.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:6,ref_key:"source",ref:N,dir:"auto"},[e.renderSlot(t.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),$.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock($e.default,{key:7,config:{type:"relationCircle",style:{backgroundColor:r.value.style.backgroundColor,relationCircle:{color:"#CCCCCC"}}}},null,8,["config"]))],44,Se))}},He=Oe._export_sfc(Xe,[["__scopeId","data-v-1f567c99"]]);exports.default=He;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-Cai0fWP7.cjs"),ee=require("./useResponsive-DQmBAoBf.cjs"),Be=require("./Title-BkfQdTEX.cjs"),te=require("./usePrinter-B4ojFS2B.cjs"),$e=require("./vue-ui-skeleton-C954hFY-.cjs"),le=require("./useNestedProp-DcWhlk8h.cjs"),_e=require("./PackageVersion-BMNt7NsQ.cjs"),Pe=require("./PenAndPaper-BUwLP3Wx.cjs"),Le=require("./useUserOptionState-BgepsfED.cjs"),ze=require("./useChartAccessibility-Cm7nkzTG.cjs"),Oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Se=["id"],Ee=["xmlns","viewBox"],Ae=["width","height"],Ne=["cx","cy","r","stroke","stroke-width"],Ie={key:1},Ve=["stroke","d","stroke-width"],Fe={style:{"pointer-events":"none"}},Me=["cx","cy","fill","r","stroke"],Re=["x","y","fill","font-size"],Te={key:2},qe=["stroke","stroke-width","x1","x2","y1","y2"],je={style:{"pointer-events":"none"}},De=["cx","cy","fill","r","stroke"],Ue=["x","y","fill","font-size"],Ge=["text-anchor","transform","x","y","onClick","font-weight","font-size","fill"],We=["cx","cy","fill","stroke","onClick","r"],Ye={key:5,class:"vue-data-ui-watermark"},Xe={__name:"vue-ui-relation-circle",props:{dataset:{type:Array,default(){return[]}},config:{type:Object,default(){return{}}}},setup(re,{expose:ne}){e.useCssVars(t=>({cc1109c8:ce.value,fd19c20a:ue.value,"0d0b359d":de.value}));const{vue_ui_relation_circle:oe}=s.useConfig(),y=re,$=e.computed(()=>!!y.dataset&&Object.keys(y.dataset).length),w=e.ref(s.createUid()),E=e.ref(0),b=e.ref(null),A=e.ref(null),N=e.ref(null),I=e.ref(null),V=e.ref(0),r=e.computed({get:()=>T(),set:t=>t}),{userOptionsVisible:_,setUserOptionsVisibility:F,keepUserOptionState:M}=Le.useUserOptionState({config:r.value}),{svgRef:R}=ze.useChartAccessibility({config:r.value.style.title});function T(){const t=le.useNestedProp({userConfig:y.config,defaultConfig:oe});return t.theme?{...le.useNestedProp({userConfig:s.themes.vue_ui_relation_circle[t.theme]||y.config,defaultConfig:t}),customPalette:s.themePalettes[t.theme]||s.palette}:t}e.watch(()=>y.config,t=>{r.value=T(),_.value=!r.value.userOptions.showOnChartHover,X(),V.value+=1},{deep:!0});const{isPrinting:q,isImaging:j,generatePdf:D,generateImage:U}=te.usePrinter({elementId:`relation_circle_${w.value}`,fileName:r.value.style.title.text||"vue-ui-relation-circle",options:r.value.userOptions.print}),se=e.computed(()=>r.value.userOptions.show&&!r.value.style.title.text),G=e.computed(()=>s.convertCustomPalette(r.value.customPalette)),h=e.ref([]),d=e.ref([]),i=e.ref({}),v=e.ref([]),ae=e.ref(0),P=e.computed(()=>y.dataset.slice(0,r.value.style.limit)),k=e.ref(r.value.style.size),f=e.ref(r.value.style.weightLabels.size),W=e.ref(r.value.style.plot.radius),Y=e.ref(r.value.style.labels.fontSize),a=e.ref({height:r.value.style.size,width:r.value.style.size}),m=e.computed({get(){return k.value*r.value.style.circle.radiusProportion},set(t){return t}}),ie=e.computed(()=>r.value.style.links.curved),ue=e.computed(()=>`${r.value.style.animation.speedMs}ms`),ce=e.computed(()=>m.value*2),de=e.computed(()=>m.value*4),x=e.ref(null);e.onMounted(()=>{X(),document.getElementById(`relation_circle_${w.value}`).addEventListener("click",H)});function X(){if(s.objectIsEmpty(y.dataset)?s.error({componentName:"VueUiRelationCircle",type:"dataset"}):y.dataset.forEach((t,n)=>{s.getMissingDatasetAttributes({datasetObject:t,requiredAttributes:["id","label","relations","weights"]}).forEach(l=>{s.error({componentName:"VueUiRelationCircle",type:"datasetSerieAttribute",property:l,index:n})})}),r.value.responsive){const t=ee.throttle(()=>{const{width:n,height:l}=ee.useResponsive({chart:b.value,title:r.value.style.title.text?A.value:null,source:N.value,noTitle:I.value});requestAnimationFrame(()=>{k.value=Math.min(n,l),a.value.width=n,a.value.height=l,m.value=k.value*r.value.style.circle.radiusProportion,h.value=[],d.value=[],J(),K(),f.value=s.translateSize({relator:k.value,adjuster:r.value.style.size,source:r.value.style.weightLabels.size,threshold:6,fallback:6}),W.value=s.translateSize({relator:k.value,adjuster:r.value.style.size,source:r.value.style.plot.radius,threshold:1,fallback:1}),Y.value=s.translateSize({relator:k.value,adjuster:r.value.style.size,source:r.value.style.labels.fontSize,threshold:6,fallback:6})})});x.value=new ResizeObserver(t),x.value.observe(b.value.parentNode)}else h.value=[],d.value=[],J(),K()}e.onBeforeUnmount(()=>{document.getElementById(`relation_circle_${w.value}`).removeEventListener("click",H),x.value&&x.value.disconnect()});function H(t){const n=t.target;n&&Array.from(n.classList).includes("vue-ui-user-options")||n&&Array.from(n.classList).includes("vue-ui-user-options-summary")||n&&Array.from(n.classList).includes("vue-data-ui-button")||n&&Array.from(n.classList).includes("vue-ui-relation-circle-legend")||(i.value={},v.value=[])}function J(){const t=6.28319/P.value.length,n=360/P.value.length;let l=0,o=0;P.value.forEach((c,u)=>{const O=c.weights.reduce((xe,Ce)=>xe+Ce,0),S=m.value*Math.cos(l)+a.value.width/2,be=m.value*Math.sin(l)+a.value.height/2+r.value.style.circle.offsetY;h.value.push({x:S,y:be,...c,color:c.color?c.color:G.value[u]?G.value[u]:s.palette[u],regAngle:o,totalWeight:O}),l+=t,o+=n})}function ve(t,n){const l=(t.x+n.x)/2,o=(t.y+n.y)/2;return{x:l,y:o}}function K(){d.value=[],h.value.forEach(t=>{h.value.filter(l=>l.relations.includes(t.id)).forEach((l,o)=>{const c=l.relations.indexOf(t.id);d.value.push({weight:l.weights[c]?l.weights[c]:0,relationId:`${t.id}_${l.id}`,x1:t.x,y1:t.y,x2:l.x,y2:l.y,colorSource:t.color,colorTarget:l.color,midPointLine:ve({x:t.x,y:t.y},{x:l.x,y:l.y}),midPointBezier:fe({x1:t.x,x2:l.x,y1:t.y,y2:l.y}),...t})})})}function fe(t){const n={x:t.x1,y:t.y1},l={x:t.x2,y:t.y2},o={x:t.x1,y:t.y1},c={x:a.value.width/2,y:a.value.height/2+r.value.style.circle.offsetY},u=.5,O=Math.pow(1-u,3)*n.x+3*Math.pow(1-u,2)*u*o.x+3*(1-u)*Math.pow(u,2)*c.x+Math.pow(u,3)*l.x,S=Math.pow(1-u,3)*n.y+3*Math.pow(1-u,2)*u*o.y+3*(1-u)*Math.pow(u,2)*c.y+Math.pow(u,3)*l.y;return{x:O,y:S}}const ye=e.computed(()=>Math.max(...d.value.map(t=>t.weight)));function ge(t){return Object.hasOwn(i.value,"x")?v.value.includes(t.id)?"opacity:1":"opacity:0.1":"opacity:1"}function g(t){return t.colorSource}function Q(t){return Object.hasOwn(i.value,"x")?v.value.includes(t.id)&&t.relationId===`${t.id}_${i.value.id}`||t.relationId===`${i.value.id}_${t.id}`?`opacity:1;stroke-width:${L(t)}`:"opacity: 0":"opacity: 1"}function p(t){return Object.hasOwn(i.value,"x")?!!(v.value.includes(t.id)&&t.relationId===`${t.id}_${i.value.id}`||t.relationId===`${i.value.id}_${t.id}`):!1}function he(t){return t.regAngle>90&&t.regAngle<270?"end":"start"}function me(t){return t.regAngle>90&&t.regAngle<270?t.x-5:t.x+5}function ke(t){return Object.hasOwn(i.value,"x")?i.value.id===t.id||v.value.includes(t.id)?"opacity:1":"opacity:0.2":"opacity:1"}function pe(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){ae.value=360-t.regAngle,i.value.id&&t.id===i.value.id?(i.value={},v.value=[]):(i.value=t,v.value=[...t.relations])}function L(t){const n=t.weight/ye.value*r.value.style.links.maxWidth;return Math.max(.3,n)}const C=e.ref(!1);function we(t){C.value=t,E.value+=1}const B=e.ref(!1);function z(){B.value=!B.value}return ne({generatePdf:D,generateImage:U,toggleAnnotator:z}),(t,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"relationCircleChart",ref:b,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_${w.value}`,onMouseenter:n[0]||(n[0]=()=>e.unref(F)(!0)),onMouseleave:n[1]||(n[1]=()=>e.unref(F)(!1))},[r.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Pe._sfc_main,{key:0,svgRef:e.unref(R),backgroundColor:r.value.style.backgroundColor,color:r.value.style.color,active:B.value,onClose:z},null,8,["svgRef","backgroundColor","color","active"])):e.createCommentVNode("",!0),se.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:I,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),r.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:A,style:"width:100%;background:transparent"},[(e.openBlock(),e.createBlock(Be._sfc_main,{key:`title_${V.value}`,config:{title:{cy:"relation-div-title",...r.value.style.title},subtitle:{cy:"relation-div-subtitle",...r.value.style.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),r.value.userOptions.show&&$.value&&(e.unref(M)||e.unref(_))?(e.openBlock(),e.createBlock(te.UserOptions,{ref:"details",key:`user_options_${E.value}`,backgroundColor:r.value.style.backgroundColor,color:r.value.style.color,isPrinting:e.unref(q),isImaging:e.unref(j),uid:w.value,hasPdf:r.value.userOptions.buttons.pdf,hasImg:r.value.userOptions.buttons.img,hasFullscreen:r.value.userOptions.buttons.img,hasXls:!1,isFullscreen:C.value,titles:{...r.value.userOptions.buttonTitles},chartElement:b.value,position:r.value.userOptions.position,hasAnnotator:r.value.userOptions.buttons.annotator,isAnnotation:B.value,onToggleFullscreen:we,onGeneratePdf:e.unref(D),onGenerateImage:e.unref(U),onToggleAnnotator:z,style:e.normalizeStyle({visibility:e.unref(M)?e.unref(_)?"visible":"hidden":"visible"})},e.createSlots({_:2},[t.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:l,color:o})=>[e.renderSlot(t.$slots,"menuIcon",e.normalizeProps(e.guardReactiveProps({isOpen:l,color:o})),void 0,!0)]),key:"0"}:void 0,t.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,t.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,t.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:o})=>[e.renderSlot(t.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:o})),void 0,!0)]),key:"3"}:void 0,t.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:o})=>[e.renderSlot(t.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:o})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),$.value?(e.openBlock(),e.createElementBlock("svg",{key:4,ref_key:"svgRef",ref:R,xmlns:e.unref(s.XMLNS),class:e.normalizeClass([{"vue-data-ui-fullscreen--on":C.value,"vue-data-ui-fulscreen--off":!C.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:"user-select:none; background:transparent"},[e.createVNode(_e._sfc_main),t.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:a.value.width<=0?10:a.value.width,height:a.value.height<=0?10:a.value.height,style:{pointerEvents:"none"}},[e.renderSlot(t.$slots,"chart-background",{},void 0,!0)],8,Ae)):e.createCommentVNode("",!0),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:m.value<=0?1e-4:m.value,stroke:r.value.style.circle.stroke,"stroke-width":r.value.style.circle.strokeWidth,fill:"transparent",class:"main-circle"},null,8,Ne),ie.value?(e.openBlock(),e.createElementBlock("g",Ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,o)=>(e.openBlock(),e.createElementBlock("path",{key:`relation_${o}`,style:e.normalizeStyle(Q(l)),stroke:g(l),class:e.normalizeClass(["relation",{"vue-ui-relation-circle-selected":i.value.hasOwnProperty("id")&&v.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":L(l),"stroke-linecap":"round"},null,14,Ve))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,o)=>(e.openBlock(),e.createElementBlock("g",Fe,[p(l)?e.renderSlot(t.$slots,"dataLabel",e.mergeProps({key:0,ref_for:!0},{x:l.midPointBezier.x,y:l.midPointBezier.y,color:g(l),weight:l.weight,fontSize:f.value}),void 0,!0):e.createCommentVNode("",!0),p(l)&&!t.$slots.dataLabel?(e.openBlock(),e.createElementBlock("circle",{key:1,cx:l.midPointBezier.x,cy:l.midPointBezier.y,fill:g(l),r:f.value,stroke:r.value.style.backgroundColor,"stroke-width":"1"},null,8,Me)):e.createCommentVNode("",!0),p(l)&&!t.$slots.dataLabel?(e.openBlock(),e.createElementBlock("text",{key:2,x:l.midPointBezier.x,y:l.midPointBezier.y+f.value/3,fill:e.unref(s.adaptColorToBackground)(g(l)),"text-anchor":"middle","font-size":f.value},e.toDisplayString(e.unref(s.applyDataLabel)(r.value.style.weightLabels.formatter,l.weight,e.unref(s.dataLabel)({p:r.value.style.weightLabels.prefix,v:l.weight,s:r.value.style.weightLabels.suffix,r:r.value.style.weightLabels.rounding}),{...l})),9,Re)):e.createCommentVNode("",!0)]))),256))])):(e.openBlock(),e.createElementBlock("g",Te,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,o)=>(e.openBlock(),e.createElementBlock("line",{key:`relation_${o}`,stroke:g(l),"stroke-width":L(l),style:e.normalizeStyle(Q(l)),x1:l.x1,x2:l.x2,y1:l.y1,y2:l.y2,class:e.normalizeClass({"vue-ui-relation-circle-selected":i.value.hasOwnProperty("id")&&v.value.includes(l.id)}),"stroke-linecap":"round"},null,14,qe))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,o)=>(e.openBlock(),e.createElementBlock("g",je,[p(l)?e.renderSlot(t.$slots,"dataLabel",e.mergeProps({key:0,ref_for:!0},{x:l.midPointLine.x,y:l.midPointLine.y,color:g(l),weight:l.weight,fontSize:f.value}),void 0,!0):e.createCommentVNode("",!0),p(l)&&!t.$slots.dataLabel&&r.value.style.weightLabels.show?(e.openBlock(),e.createElementBlock("circle",{key:1,cx:l.midPointLine.x,cy:l.midPointLine.y,fill:g(l),r:f.value,stroke:r.value.style.backgroundColor,"stroke-width":"1"},null,8,De)):e.createCommentVNode("",!0),p(l)&&!t.$slots.dataLabel&&r.value.style.weightLabels.show?(e.openBlock(),e.createElementBlock("text",{key:2,x:l.midPointLine.x,y:l.midPointLine.y+f.value/3,fill:e.unref(s.adaptColorToBackground)(g(l)),"text-anchor":"middle","font-size":f.value},e.toDisplayString(e.unref(s.applyDataLabel)(r.value.style.weightLabels.formatter,l.weight,e.unref(s.dataLabel)({p:r.value.style.weightLabels.prefix,v:l.weight,s:r.value.style.weightLabels.suffix,r:r.value.style.weightLabels.rounding}),{...l})),9,Ue)):e.createCommentVNode("",!0)]))),256))])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(l,o)=>(e.openBlock(),e.createElementBlock("text",{key:`plot_text_${o}`,"text-anchor":he(l),transform:pe(l),x:me(l),y:l.y+5,onClick:c=>Z(l),class:"vue-ui-relation-circle-legend","transform-origin":"start","font-weight":i.value.id===l.id?"900":"400",style:e.normalizeStyle(`font-family:${r.value.style.fontFamily};${ke(l)}`),"font-size":Y.value,fill:r.value.style.labels.color},e.toDisplayString(l.label)+" ("+e.toDisplayString(e.unref(s.applyDataLabel)(r.value.style.weightLabels.formatter,l.totalWeight,e.unref(s.dataLabel)({p:r.value.style.weightLabels.prefix,v:l.totalWeight,s:r.value.style.weightLabels.suffix,r:r.value.style.weightLabels.rounding}),{...l}))+") ",13,Ge))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(l,o)=>(e.openBlock(),e.createElementBlock("circle",{cx:l.x,cy:l.y,key:`plot_${o}`,style:e.normalizeStyle(ge(l)),class:"vue-ui-relation-circle-plot",fill:r.value.style.plot.useSerieColor?l.color:r.value.style.plot.color,stroke:r.value.style.backgroundColor,"stroke-width":"1",onClick:c=>Z(l),r:W.value},null,12,We))),128)),e.renderSlot(t.$slots,"svg",{svg:a.value},void 0,!0)],10,Ee)):e.createCommentVNode("",!0),t.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ye,[e.renderSlot(t.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(q)||e.unref(j)})),void 0,!0)])):e.createCommentVNode("",!0),t.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:6,ref_key:"source",ref:N,dir:"auto"},[e.renderSlot(t.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),$.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock($e.default,{key:7,config:{type:"relationCircle",style:{backgroundColor:r.value.style.backgroundColor,relationCircle:{color:"#CCCCCC"}}}},null,8,["config"]))],44,Se))}},He=Oe._export_sfc(Xe,[["__scopeId","data-v-1f567c99"]]);exports.default=He;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { useCssVars as Ve, computed as y, ref as o, watch as We, onMounted as De, onBeforeUnmount as Xe, createElementBlock as a, openBlock as i, unref as r, normalizeStyle as C, createBlock as F, createCommentVNode as v, createSlots as Ye, withCtx as z, renderSlot as h, normalizeProps as B, guardReactiveProps as R, normalizeClass as D, createVNode as qe, createElementVNode as He, Fragment as P, renderList as L, mergeProps as me, toDisplayString as E } from "vue";
|
|
2
|
-
import { u as Je, c as Ke, t as Qe, p as ke, a as Ze, b as et, o as tt, e as pe, g as st, X as lt, G as we, i as X, f as Y, F as q } from "./index-
|
|
2
|
+
import { u as Je, c as Ke, t as Qe, p as ke, a as Ze, b as et, o as tt, e as pe, g as st, X as lt, G as we, i as X, f as Y, F as q } from "./index-hMo72hAq.js";
|
|
3
3
|
import { t as it, u as at } from "./useResponsive-Cw4oZ8sQ.js";
|
|
4
|
-
import { _ as nt } from "./Title-
|
|
5
|
-
import { u as rt, U as ut } from "./usePrinter-
|
|
6
|
-
import ot from "./vue-ui-skeleton-
|
|
7
|
-
import { u as xe } from "./useNestedProp-
|
|
8
|
-
import { _ as ct } from "./PackageVersion-
|
|
9
|
-
import { _ as dt } from "./PenAndPaper-
|
|
4
|
+
import { _ as nt } from "./Title-DrVDm1wy.js";
|
|
5
|
+
import { u as rt, U as ut } from "./usePrinter-D2z-bUtX.js";
|
|
6
|
+
import ot from "./vue-ui-skeleton-C3t9bL6f.js";
|
|
7
|
+
import { u as xe } from "./useNestedProp-DhEaBTgF.js";
|
|
8
|
+
import { _ as ct } from "./PackageVersion-0Lu6RIig.js";
|
|
9
|
+
import { _ as dt } from "./PenAndPaper-D4Uu-GqW.js";
|
|
10
10
|
import { u as vt } from "./useUserOptionState-BIvW1Kz7.js";
|
|
11
11
|
import { u as ft } from "./useChartAccessibility-BWojgys7.js";
|
|
12
12
|
import { _ as yt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { useCssVars as Ct, ref as h, reactive as At, computed as k, onUnmounted as _t, createBlock as P, openBlock as r, Teleport as St, createElementBlock as u, createCommentVNode as y, withModifiers as
|
|
2
|
-
import { X as tt, u as Lt, c as Ae, o as Tt, e as _e, g as qe, b as Ot, d as Pt, p as ve, al as Je, a8 as Et,
|
|
1
|
+
import { useCssVars as Ct, ref as h, reactive as At, computed as k, onUnmounted as _t, createBlock as P, openBlock as r, Teleport as St, createElementBlock as u, createCommentVNode as y, withModifiers as U, normalizeStyle as O, createElementVNode as c, unref as g, renderSlot as x, createVNode as Ze, nextTick as et, onMounted as Mt, onBeforeUnmount as zt, watch as Ue, normalizeClass as ce, createSlots as Ve, withCtx as $, normalizeProps as de, guardReactiveProps as he, Fragment as b, renderList as T, mergeProps as Ge, toDisplayString as J, createTextVNode as je } from "vue";
|
|
2
|
+
import { X as tt, u as Lt, c as Ae, o as Tt, e as _e, g as qe, b as Ot, d as Pt, p as ve, al as Je, a8 as Et, S as Ke, T as Dt, U as Nt, G as It, i as fe, f as ge, t as Xt, a as Ft, q as Ht, r as Rt, am as Bt } from "./index-hMo72hAq.js";
|
|
3
3
|
import { u as Wt } from "./useUserOptionState-BIvW1Kz7.js";
|
|
4
4
|
import { u as Yt } from "./useChartAccessibility-BWojgys7.js";
|
|
5
|
-
import { u as
|
|
5
|
+
import { u as Ut, U as Vt } from "./usePrinter-D2z-bUtX.js";
|
|
6
6
|
import { t as Gt, u as jt } from "./useResponsive-Cw4oZ8sQ.js";
|
|
7
|
-
import { u as Qe } from "./useNestedProp-
|
|
8
|
-
import qt from "./vue-ui-accordion-
|
|
9
|
-
import Jt from "./BaseIcon-
|
|
7
|
+
import { u as Qe } from "./useNestedProp-DhEaBTgF.js";
|
|
8
|
+
import qt from "./vue-ui-accordion-CHMdpjnX.js";
|
|
9
|
+
import Jt from "./BaseIcon-COlnFbOq.js";
|
|
10
10
|
import { _ as at } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
11
|
-
import { D as Kt } from "./DataTable-
|
|
12
|
-
import { L as Qt } from "./Legend-
|
|
13
|
-
import { _ as Zt } from "./PenAndPaper-
|
|
14
|
-
import { _ as ea } from "./Shape-
|
|
15
|
-
import ta from "./vue-ui-skeleton-
|
|
16
|
-
import { _ as aa } from "./Title-
|
|
17
|
-
import la from "./vue-ui-xy-
|
|
11
|
+
import { D as Kt } from "./DataTable-CXbN2mJi.js";
|
|
12
|
+
import { L as Qt } from "./Legend-BU9C5fBQ.js";
|
|
13
|
+
import { _ as Zt } from "./PenAndPaper-D4Uu-GqW.js";
|
|
14
|
+
import { _ as ea } from "./Shape-BavMx2aa.js";
|
|
15
|
+
import ta from "./vue-ui-skeleton-C3t9bL6f.js";
|
|
16
|
+
import { _ as aa } from "./Title-DrVDm1wy.js";
|
|
17
|
+
import la from "./vue-ui-xy-CMw6P4C0.js";
|
|
18
18
|
const oa = ["xmlns"], sa = { class: "modal-title" }, na = { class: "modal-body" }, ra = {
|
|
19
19
|
__name: "BaseDraggableDialog",
|
|
20
20
|
props: {
|
|
@@ -28,7 +28,7 @@ const oa = ["xmlns"], sa = { class: "modal-title" }, na = { class: "modal-body"
|
|
|
28
28
|
Ct((i) => ({
|
|
29
29
|
b93256ca: X.color
|
|
30
30
|
}));
|
|
31
|
-
const me = X, C = pe, z = h(!1),
|
|
31
|
+
const me = X, C = pe, z = h(!1), V = h(!1), o = At({
|
|
32
32
|
left: window.innerWidth / 2 - 200,
|
|
33
33
|
top: window.innerHeight / 2 - 120,
|
|
34
34
|
width: 400,
|
|
@@ -44,7 +44,7 @@ const oa = ["xmlns"], sa = { class: "modal-title" }, na = { class: "modal-body"
|
|
|
44
44
|
});
|
|
45
45
|
function ne() {
|
|
46
46
|
z.value = !0, et(() => {
|
|
47
|
-
|
|
47
|
+
V.value || (o.left = Math.max(0, window.innerWidth / 2 - o.width / 2), o.top = Math.max(0, window.innerHeight / 2 - o.height / 2), V.value = !0);
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
50
|
function K() {
|
|
@@ -72,7 +72,7 @@ const oa = ["xmlns"], sa = { class: "modal-title" }, na = { class: "modal-body"
|
|
|
72
72
|
var p;
|
|
73
73
|
(p = i.preventDefault) == null || p.call(i), o.dragging = !0;
|
|
74
74
|
const v = E(i);
|
|
75
|
-
o.dragOffsetX = v.x - o.left, o.dragOffsetY = v.y - o.top, document.addEventListener("mousemove", F), document.addEventListener("mouseup",
|
|
75
|
+
o.dragOffsetX = v.x - o.left, o.dragOffsetY = v.y - o.top, document.addEventListener("mousemove", F), document.addEventListener("mouseup", H), document.addEventListener("touchmove", F, { passive: !1 }), document.addEventListener("touchend", H);
|
|
76
76
|
}
|
|
77
77
|
function F(i) {
|
|
78
78
|
var e;
|
|
@@ -82,8 +82,8 @@ const oa = ["xmlns"], sa = { class: "modal-title" }, na = { class: "modal-body"
|
|
|
82
82
|
let p = v.x - o.dragOffsetX, L = v.y - o.dragOffsetY;
|
|
83
83
|
p = Math.max(0, Math.min(p, window.innerWidth - o.width)), L = Math.max(0, Math.min(L, window.innerHeight - o.height)), o.left = p, o.top = L;
|
|
84
84
|
}
|
|
85
|
-
function
|
|
86
|
-
o.dragging = !1, document.removeEventListener("mousemove", F), document.removeEventListener("mouseup",
|
|
85
|
+
function H() {
|
|
86
|
+
o.dragging = !1, document.removeEventListener("mousemove", F), document.removeEventListener("mouseup", H), document.removeEventListener("touchmove", F), document.removeEventListener("touchend", H);
|
|
87
87
|
}
|
|
88
88
|
function Z(i) {
|
|
89
89
|
var p;
|
|
@@ -106,9 +106,9 @@ const oa = ["xmlns"], sa = { class: "modal-title" }, na = { class: "modal-body"
|
|
|
106
106
|
var p;
|
|
107
107
|
(p = i.preventDefault) == null || p.call(i), o.resizing = !0;
|
|
108
108
|
const v = E(i);
|
|
109
|
-
o.pointerStartX = v.x, o.pointerStartY = v.y, o.resizeStartW = o.width, o.resizeStartH = o.height, o.resizeStartLeft = o.left, o.resizeStartTop = o.top, document.addEventListener("mousemove",
|
|
109
|
+
o.pointerStartX = v.x, o.pointerStartY = v.y, o.resizeStartW = o.width, o.resizeStartH = o.height, o.resizeStartLeft = o.left, o.resizeStartTop = o.top, document.addEventListener("mousemove", R), document.addEventListener("mouseup", f), document.addEventListener("touchmove", R, { passive: !1 }), document.addEventListener("touchend", f);
|
|
110
110
|
}
|
|
111
|
-
function
|
|
111
|
+
function R(i) {
|
|
112
112
|
var te;
|
|
113
113
|
if (!o.resizing) return;
|
|
114
114
|
(te = i.preventDefault) == null || te.call(i);
|
|
@@ -121,16 +121,16 @@ const oa = ["xmlns"], sa = { class: "modal-title" }, na = { class: "modal-body"
|
|
|
121
121
|
o.left = L, o.width = e, o.height = ee;
|
|
122
122
|
}
|
|
123
123
|
function f() {
|
|
124
|
-
o.resizing = !1, document.removeEventListener("mousemove",
|
|
124
|
+
o.resizing = !1, document.removeEventListener("mousemove", R), document.removeEventListener("mouseup", f), document.removeEventListener("touchmove", R), document.removeEventListener("touchend", f);
|
|
125
125
|
}
|
|
126
126
|
return _t(() => {
|
|
127
|
-
|
|
127
|
+
H(), N(), f();
|
|
128
128
|
}), (i, v) => (r(), P(St, { to: "body" }, [
|
|
129
129
|
z.value ? (r(), u("div", {
|
|
130
130
|
key: 0,
|
|
131
131
|
class: "modal vue-ui-draggable-dialog",
|
|
132
132
|
style: O(G.value),
|
|
133
|
-
onClick: v[0] || (v[0] =
|
|
133
|
+
onClick: v[0] || (v[0] = U(() => {
|
|
134
134
|
}, ["stop"]))
|
|
135
135
|
}, [
|
|
136
136
|
c("div", {
|
|
@@ -142,8 +142,8 @@ const oa = ["xmlns"], sa = { class: "modal-title" }, na = { class: "modal-body"
|
|
|
142
142
|
}, [
|
|
143
143
|
c("span", {
|
|
144
144
|
class: "drag-handle",
|
|
145
|
-
onMousedown:
|
|
146
|
-
onTouchstart:
|
|
145
|
+
onMousedown: U(Q, ["stop", "prevent"]),
|
|
146
|
+
onTouchstart: U(Q, ["stop", "prevent"])
|
|
147
147
|
}, [
|
|
148
148
|
(r(), u("svg", {
|
|
149
149
|
xmlns: g(tt),
|
|
@@ -182,13 +182,13 @@ const oa = ["xmlns"], sa = { class: "modal-title" }, na = { class: "modal-body"
|
|
|
182
182
|
]),
|
|
183
183
|
c("div", {
|
|
184
184
|
class: "resize-handle",
|
|
185
|
-
onMousedown:
|
|
186
|
-
onTouchstart:
|
|
185
|
+
onMousedown: U(Z, ["stop", "prevent"]),
|
|
186
|
+
onTouchstart: U(Z, ["stop", "prevent"])
|
|
187
187
|
}, null, 32),
|
|
188
188
|
c("div", {
|
|
189
189
|
class: "resize-handle resize-handle-left",
|
|
190
|
-
onMousedown:
|
|
191
|
-
onTouchstart:
|
|
190
|
+
onMousedown: U(re, ["stop", "prevent"]),
|
|
191
|
+
onTouchstart: U(re, ["stop", "prevent"])
|
|
192
192
|
}, null, 32)
|
|
193
193
|
], 4)) : y("", !0)
|
|
194
194
|
]));
|
|
@@ -221,7 +221,7 @@ const oa = ["xmlns"], sa = { class: "modal-title" }, na = { class: "modal-body"
|
|
|
221
221
|
set(a) {
|
|
222
222
|
return a;
|
|
223
223
|
}
|
|
224
|
-
}),
|
|
224
|
+
}), V = pe, o = h(null), ne = h(null), K = h(null), G = h(null), E = h(null), Q = h(null), F = h(0), H = h(0), Z = h(0), w = h(Ae()), N = h(0), re = h(0), R = h(512), f = h(null), i = h(null), v = h(null), p = h(0);
|
|
225
225
|
function L() {
|
|
226
226
|
const a = Qe({
|
|
227
227
|
userConfig: C.config,
|
|
@@ -291,28 +291,28 @@ const oa = ["xmlns"], sa = { class: "modal-title" }, na = { class: "modal-body"
|
|
|
291
291
|
padding: e.value.style.chart.padding
|
|
292
292
|
});
|
|
293
293
|
requestAnimationFrame(() => {
|
|
294
|
-
|
|
294
|
+
R.value = n, _.value = t / C.dataset.length, p.value = t;
|
|
295
295
|
});
|
|
296
296
|
});
|
|
297
297
|
G.value = new ResizeObserver(a), G.value.observe(o.value.parentNode);
|
|
298
298
|
}
|
|
299
299
|
}
|
|
300
|
-
const { isPrinting: Me, isImaging: ze, generatePdf: Le, generateImage: Te } =
|
|
300
|
+
const { isPrinting: Me, isImaging: ze, generatePdf: Le, generateImage: Te } = Ut({
|
|
301
301
|
elementId: `vue-ui-ridgeline_${w.value}`,
|
|
302
302
|
fileName: e.value.style.chart.title.text || "vue-ui-ridgeline",
|
|
303
303
|
options: e.value.userOptions.print
|
|
304
304
|
}), lt = k(() => e.value.userOptions.show && !e.value.style.chart.title.text), ot = k(() => Ot(e.value.customPalette)), ae = h({
|
|
305
305
|
showTable: e.value.table.show
|
|
306
306
|
});
|
|
307
|
-
|
|
307
|
+
Ue(() => C.config, (a) => {
|
|
308
308
|
e.value = L(), ee.value = !e.value.userOptions.showOnChartHover, be(), F.value += 1, Z.value += 1, _.value = Math.min(
|
|
309
309
|
e.value.style.chart.areas.height,
|
|
310
310
|
e.value.style.chart.areas.rowHeight
|
|
311
311
|
), ae.value.showTable = e.value.table.show;
|
|
312
|
-
}, { deep: !0 }),
|
|
312
|
+
}, { deep: !0 }), Ue(() => C.dataset, be, { deep: !0 });
|
|
313
313
|
const ke = k(() => e.value.style.chart.areas.height / e.value.style.chart.areas.rowHeight);
|
|
314
314
|
function Oe(a) {
|
|
315
|
-
I.value.includes(a) ? I.value = I.value.filter((n) => n !== a) : I.value.push(a),
|
|
315
|
+
I.value.includes(a) ? I.value = I.value.filter((n) => n !== a) : I.value.push(a), V("selectLegend", q.value);
|
|
316
316
|
}
|
|
317
317
|
const D = k(() => z.value ? C.dataset.map((a, n) => ({
|
|
318
318
|
...a,
|
|
@@ -336,7 +336,7 @@ const oa = ["xmlns"], sa = { class: "modal-title" }, na = { class: "modal-body"
|
|
|
336
336
|
})), m = k(() => {
|
|
337
337
|
const a = e.value.style.chart.padding;
|
|
338
338
|
return {
|
|
339
|
-
width:
|
|
339
|
+
width: R.value,
|
|
340
340
|
height: Pe.value,
|
|
341
341
|
padding: a
|
|
342
342
|
};
|
|
@@ -355,7 +355,7 @@ const oa = ["xmlns"], sa = { class: "modal-title" }, na = { class: "modal-body"
|
|
|
355
355
|
return l;
|
|
356
356
|
});
|
|
357
357
|
function st(a) {
|
|
358
|
-
|
|
358
|
+
V("selectX", D.value.map((n) => n.datapoints.map((t) => ({
|
|
359
359
|
dp: t,
|
|
360
360
|
selected: t.values[a.index]
|
|
361
361
|
}))));
|
|
@@ -373,12 +373,12 @@ const oa = ["xmlns"], sa = { class: "modal-title" }, na = { class: "modal-body"
|
|
|
373
373
|
}
|
|
374
374
|
const q = k(() => {
|
|
375
375
|
_.value;
|
|
376
|
-
const a = Math.max(...D.value.map((A) => A.labelLen)), n = Math.max(...D.value.flatMap((A) => A.datapoints.map((B) => B.values.length))), t = Math.max(...D.value.flatMap((A) => A.datapoints.flatMap((B) => B.values))), s = Math.min(...D.value.flatMap((A) => A.datapoints.flatMap((B) => B.values))), l = m.value.padding.left + a + 16 + e.value.style.chart.yAxis.labels.offsetX, d = (S.value.width - l) / n, M = Math.abs(Math.min(s, 0)),
|
|
377
|
-
function
|
|
378
|
-
return isNaN(A /
|
|
376
|
+
const a = Math.max(...D.value.map((A) => A.labelLen)), n = Math.max(...D.value.flatMap((A) => A.datapoints.map((B) => B.values.length))), t = Math.max(...D.value.flatMap((A) => A.datapoints.flatMap((B) => B.values))), s = Math.min(...D.value.flatMap((A) => A.datapoints.flatMap((B) => B.values))), l = m.value.padding.left + a + 16 + e.value.style.chart.yAxis.labels.offsetX, d = (S.value.width - l) / n, M = Math.abs(Math.min(s, 0)), He = t + M;
|
|
377
|
+
function Re(A) {
|
|
378
|
+
return isNaN(A / He) ? 0 : A / He;
|
|
379
379
|
}
|
|
380
380
|
return D.value.map((A, B) => {
|
|
381
|
-
const Be = S.value.top + _.value * B, W = S.value.top + Be + _.value * ke.value * (1 -
|
|
381
|
+
const Be = S.value.top + _.value * B, W = S.value.top + Be + _.value * ke.value * (1 - Re(M));
|
|
382
382
|
return {
|
|
383
383
|
...A,
|
|
384
384
|
label: {
|
|
@@ -387,7 +387,7 @@ const oa = ["xmlns"], sa = { class: "modal-title" }, na = { class: "modal-body"
|
|
|
387
387
|
},
|
|
388
388
|
datapoints: A.datapoints.map((oe) => {
|
|
389
389
|
const Y = oe.values.map((se, xt) => {
|
|
390
|
-
const bt = isNaN(se) || [void 0, null, "NaN", NaN, 1 / 0, -1 / 0].includes(se) ? 0 : se || 0, kt = l + d * xt, wt = S.value.top + Be + _.value * ke.value * (1 -
|
|
390
|
+
const bt = isNaN(se) || [void 0, null, "NaN", NaN, 1 / 0, -1 / 0].includes(se) ? 0 : se || 0, kt = l + d * xt, wt = S.value.top + Be + _.value * ke.value * (1 - Re(bt + M)), $t = se === Math.max(...oe.values);
|
|
391
391
|
return {
|
|
392
392
|
x: kt,
|
|
393
393
|
y: wt,
|
|
@@ -443,7 +443,7 @@ const oa = ["xmlns"], sa = { class: "modal-title" }, na = { class: "modal-body"
|
|
|
443
443
|
}
|
|
444
444
|
const De = h({}), Ne = h([]);
|
|
445
445
|
function dt(a) {
|
|
446
|
-
|
|
446
|
+
V("selectDatapoint", a), e.value.style.chart.dialog.show && (Ne.value = a.datapoints.map((n) => ({
|
|
447
447
|
name: n.name,
|
|
448
448
|
color: n.color,
|
|
449
449
|
type: "line",
|
|
@@ -533,8 +533,8 @@ const oa = ["xmlns"], sa = { class: "modal-title" }, na = { class: "modal-body"
|
|
|
533
533
|
], n = [
|
|
534
534
|
[e.value.style.chart.title.text],
|
|
535
535
|
[e.value.style.chart.title.subtitle.text]
|
|
536
|
-
].concat(a), t =
|
|
537
|
-
|
|
536
|
+
].concat(a), t = Ht(n);
|
|
537
|
+
Rt({
|
|
538
538
|
csvContent: t,
|
|
539
539
|
title: e.value.style.chart.title.text || "vue-ui-ridgeline"
|
|
540
540
|
});
|
|
@@ -601,7 +601,7 @@ const oa = ["xmlns"], sa = { class: "modal-title" }, na = { class: "modal-body"
|
|
|
601
601
|
}
|
|
602
602
|
}, null, 8, ["config"]))
|
|
603
603
|
], 512)) : y("", !0),
|
|
604
|
-
e.value.userOptions.show && z.value && (g(Se) || g(ee)) ? (r(), P(
|
|
604
|
+
e.value.userOptions.show && z.value && (g(Se) || g(ee)) ? (r(), P(Vt, {
|
|
605
605
|
ref: "details",
|
|
606
606
|
key: `user_option_${N.value}`,
|
|
607
607
|
backgroundColor: e.value.style.chart.backgroundColor,
|
|
@@ -632,7 +632,7 @@ const oa = ["xmlns"], sa = { class: "modal-title" }, na = { class: "modal-body"
|
|
|
632
632
|
onGenerateImage: g(Te),
|
|
633
633
|
onToggleTable: Ie,
|
|
634
634
|
onToggleAnnotator: Ce
|
|
635
|
-
},
|
|
635
|
+
}, Ve({ _: 2 }, [
|
|
636
636
|
a.$slots.menuIcon ? {
|
|
637
637
|
name: "menuIcon",
|
|
638
638
|
fn: $(({ isOpen: t, color: s }) => [
|
|
@@ -993,7 +993,7 @@ const oa = ["xmlns"], sa = { class: "modal-title" }, na = { class: "modal-body"
|
|
|
993
993
|
legendSet: we.value,
|
|
994
994
|
config: ut.value,
|
|
995
995
|
onClickMarker: n[1] || (n[1] = ({ legend: t }) => Oe(t.id))
|
|
996
|
-
},
|
|
996
|
+
}, Ve({
|
|
997
997
|
item: $(({ legend: t }) => [
|
|
998
998
|
c("div", {
|
|
999
999
|
style: O(`opacity:${I.value.includes(t.id) ? 0.5 : 1}`),
|
|
@@ -1044,7 +1044,7 @@ const oa = ["xmlns"], sa = { class: "modal-title" }, na = { class: "modal-body"
|
|
|
1044
1044
|
}, {
|
|
1045
1045
|
content: $(() => [
|
|
1046
1046
|
(r(), P(Kt, {
|
|
1047
|
-
key: `table_${
|
|
1047
|
+
key: `table_${H.value}`,
|
|
1048
1048
|
colNames: ue.value.colNames,
|
|
1049
1049
|
head: ue.value.head,
|
|
1050
1050
|
body: ue.value.body,
|