vue-data-ui 2.4.1 → 2.4.3
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/README.md +44 -44
- package/dist/{Arrow-BIs_9yK8.js → Arrow-C7lNL7sY.js} +1 -1
- package/dist/{Arrow-DpMf3yPs.cjs → Arrow-Dz6AomGr.cjs} +1 -1
- package/dist/{BaseIcon-CXDdkPfN.js → BaseIcon-BbvG1AlW.js} +7 -4
- package/dist/BaseIcon-uALK38Ov.cjs +1 -0
- package/dist/{DataTable-BTgMVOwp.cjs → DataTable-DTzynbND.cjs} +1 -1
- package/dist/{DataTable-DL2agEJ3.js → DataTable-DYqC2pqu.js} +2 -2
- package/dist/{Legend-Dj9KiaLv.cjs → Legend-Cgw4lO2O.cjs} +1 -1
- package/dist/{Legend-DXLiSLHd.js → Legend-DNgTCgEK.js} +1 -1
- package/dist/{PackageVersion-D4D0WicU.cjs → PackageVersion-DwI-KhXH.cjs} +1 -1
- package/dist/{PackageVersion-DtnhR89q.js → PackageVersion-VkaUzgmt.js} +1 -1
- package/dist/PenAndPaper-CDFVOo7X.cjs +1 -0
- package/dist/PenAndPaper-DAZYA8Ew.js +269 -0
- package/dist/{Shape-CO_Ak9Zm.js → Shape-Bwon0l0g.js} +1 -1
- package/dist/{Shape-7EC2UKDK.cjs → Shape-D2Dpshg1.cjs} +1 -1
- package/dist/{Slicer-BZfUZr1J.js → Slicer-TfpN2Cr4.js} +3 -3
- package/dist/{Slicer-CLAVjSQP.cjs → Slicer-uSjfNJjG.cjs} +1 -1
- package/dist/{Title-C-lm3Mkl.cjs → Title-0Tp4hZ4u.cjs} +1 -1
- package/dist/{Title-DYNLqCCT.js → Title-C5pIfQAz.js} +1 -1
- package/dist/{Tooltip-t-3mVhcz.cjs → Tooltip-9Tp2Yrd1.cjs} +1 -1
- package/dist/{Tooltip-CICAYyQj.js → Tooltip-Cz24YLfw.js} +1 -1
- package/dist/{index-DDXisDKy.js → index-Bya_q1J-.js} +883 -842
- package/dist/index-eFox7weK.cjs +9 -0
- package/dist/style.css +1 -1
- package/dist/types/vue-data-ui.d.cts +22 -17
- package/dist/types/vue-data-ui.d.ts +22 -17
- package/dist/{useNestedProp-S1UXxUgm.js → useNestedProp-B33hazbH.js} +1 -1
- package/dist/{useNestedProp-CC9zGr7C.cjs → useNestedProp-BkgEhTQY.cjs} +1 -1
- package/dist/usePrinter-CSRFnDBU.cjs +1 -0
- package/dist/{usePrinter-8ofTb2MJ.js → usePrinter-CiHd1FwD.js} +230 -185
- package/dist/useResponsive-BY8tgM1n.js +188 -0
- package/dist/useResponsive-CodiGUOE.cjs +1 -0
- package/dist/vue-data-ui-BTtxyUc3.cjs +9 -0
- package/dist/vue-data-ui-Bduq4f2p.js +261 -0
- package/dist/vue-data-ui.cjs +1 -1
- package/dist/vue-data-ui.js +1 -1
- package/dist/vue-ui-3d-bar-B-P7PMHs.cjs +19 -0
- package/dist/{vue-ui-3d-bar-DcF1nyGW.js → vue-ui-3d-bar-BUEq_VdY.js} +421 -390
- package/dist/{vue-ui-accordion-D_1fE5EF.js → vue-ui-accordion-DfUfL2dI.js} +3 -3
- package/dist/{vue-ui-accordion-Cc9958th.cjs → vue-ui-accordion-TEMpM1hO.cjs} +1 -1
- package/dist/{vue-ui-age-pyramid-Oe_yHDL0.js → vue-ui-age-pyramid-CH72tAMb.js} +255 -222
- package/dist/vue-ui-age-pyramid-DsbZ1qcQ.cjs +1 -0
- package/dist/{vue-ui-annotator-Dix6_Gm6.js → vue-ui-annotator-DPeJ2its.js} +1 -1
- package/dist/{vue-ui-annotator-Dbp6cWMr.cjs → vue-ui-annotator-DU_DJKCw.cjs} +1 -1
- package/dist/vue-ui-bullet-CtP3MlUT.js +464 -0
- package/dist/vue-ui-bullet-D8ks_rKr.cjs +34 -0
- package/dist/vue-ui-candlestick-D1jdr0bv.cjs +2 -0
- package/dist/{vue-ui-candlestick-CRwzWF6j.js → vue-ui-candlestick-DDil13a0.js} +278 -245
- package/dist/{vue-ui-carousel-table-BHeEbRKY.js → vue-ui-carousel-table-BaeIxyc0.js} +76 -69
- package/dist/vue-ui-carousel-table-C7SJIOG-.cjs +1 -0
- package/dist/{vue-ui-chestnut-CRk0RCB9.js → vue-ui-chestnut-BczSJF6S.js} +322 -291
- package/dist/vue-ui-chestnut-ih5r0Bj9.cjs +6 -0
- package/dist/{vue-ui-cursor-lU1rts1B.cjs → vue-ui-cursor-C2Pj_CI_.cjs} +1 -1
- package/dist/{vue-ui-cursor-y0kdr0uA.js → vue-ui-cursor-Dg_Dmww-.js} +2 -2
- package/dist/{vue-ui-dashboard-OyihaKdu.js → vue-ui-dashboard-Bul9dqx1.js} +2 -2
- package/dist/{vue-ui-dashboard-BfC0jS-X.cjs → vue-ui-dashboard-Cg020NiT.cjs} +1 -1
- package/dist/{vue-ui-digits-IKt4qT2-.js → vue-ui-digits-B8iAa4YZ.js} +2 -2
- package/dist/{vue-ui-digits-BJfcAiq_.cjs → vue-ui-digits-Ctgd84JR.cjs} +1 -1
- package/dist/vue-ui-donut-D7KT9EAp.cjs +1 -0
- package/dist/{vue-ui-donut-DFaGk4fI.js → vue-ui-donut-DUcp-fat.js} +376 -343
- package/dist/vue-ui-donut-evolution-CHtJ8iOK.cjs +1 -0
- package/dist/{vue-ui-donut-evolution-Dd4o37RP.js → vue-ui-donut-evolution-C_YMbTwq.js} +375 -344
- package/dist/vue-ui-dumbbell-B0dikuqO.cjs +9 -0
- package/dist/{vue-ui-dumbbell-B7j1_JoQ.js → vue-ui-dumbbell-Buwngz_V.js} +294 -261
- package/dist/vue-ui-flow-Bz3c0K5P.js +515 -0
- package/dist/vue-ui-flow-D6rc8J-8.cjs +1 -0
- package/dist/{vue-ui-galaxy-CH1BDtWl.js → vue-ui-galaxy-Cjh0XGTX.js} +212 -181
- package/dist/vue-ui-galaxy-CmTt0vBf.cjs +1 -0
- package/dist/vue-ui-gauge-B1UvGkQa.js +527 -0
- package/dist/vue-ui-gauge-B_TKuyM7.cjs +1 -0
- package/dist/{vue-ui-gizmo-DVwQaEH1.cjs → vue-ui-gizmo-DFW6HnHp.cjs} +1 -1
- package/dist/{vue-ui-gizmo-CKQcbe_7.js → vue-ui-gizmo-DUQ4t-At.js} +3 -3
- package/dist/{vue-ui-heatmap-B-zWMk0Y.js → vue-ui-heatmap-C-poazUw.js} +308 -277
- package/dist/vue-ui-heatmap-C2HlnqzO.cjs +1 -0
- package/dist/{vue-ui-kpi-CghbfSdM.js → vue-ui-kpi-DXe-vxAk.js} +3 -3
- package/dist/{vue-ui-kpi-CuY3xlVq.cjs → vue-ui-kpi-Z4Oi4raz.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-C7roqZ4p.js → vue-ui-mini-loader-BVtHTqxS.js} +2 -2
- package/dist/{vue-ui-mini-loader-CH_PfeDc.cjs → vue-ui-mini-loader-MMvpm9pz.cjs} +1 -1
- package/dist/vue-ui-molecule-BaJpDZND.js +805 -0
- package/dist/vue-ui-molecule-BiYIcOKN.cjs +1 -0
- package/dist/{vue-ui-mood-radar-DSznHxLS.js → vue-ui-mood-radar-BUNDwsEI.js} +259 -228
- package/dist/vue-ui-mood-radar-C6jMyFkb.cjs +1 -0
- package/dist/vue-ui-nested-donuts-DKO2dFKo.cjs +17 -0
- package/dist/{vue-ui-nested-donuts-CiE4DdEQ.js → vue-ui-nested-donuts-mDy2hXa6.js} +371 -338
- package/dist/vue-ui-onion-DwFG3HAI.js +650 -0
- package/dist/vue-ui-onion-GWNoZRhw.cjs +5 -0
- package/dist/vue-ui-parallel-coordinate-plot-DODn4Ohf.cjs +8 -0
- package/dist/vue-ui-parallel-coordinate-plot-ImET_zeo.js +719 -0
- package/dist/{vue-ui-quadrant-Cs3A77us.js → vue-ui-quadrant-BeveRihK.js} +359 -326
- package/dist/vue-ui-quadrant-yuFAxV-5.cjs +1 -0
- package/dist/{vue-ui-quick-chart-CiiSUexi.js → vue-ui-quick-chart-DAhllTfa.js} +585 -552
- package/dist/vue-ui-quick-chart-DgFDBzjS.cjs +15 -0
- package/dist/vue-ui-radar-BJH5SE6-.cjs +1 -0
- package/dist/{vue-ui-radar-CNSpiNrM.js → vue-ui-radar-BllatzRa.js} +279 -246
- package/dist/{vue-ui-rating-GoUNDOdZ.cjs → vue-ui-rating-BoZo7caL.cjs} +1 -1
- package/dist/{vue-ui-rating-b_iYZWF8.js → vue-ui-rating-D1ykV4xO.js} +2 -2
- package/dist/vue-ui-relation-circle-CKmjOle7.cjs +1 -0
- package/dist/vue-ui-relation-circle-xv2l5Be9.js +358 -0
- package/dist/vue-ui-rings-B-ZcX6y1.js +602 -0
- package/dist/vue-ui-rings-DjH3CK23.cjs +2 -0
- package/dist/{vue-ui-scatter-CVuoW-cD.js → vue-ui-scatter-DG43ck1g.js} +440 -407
- package/dist/vue-ui-scatter-SBCXAl7q.cjs +1 -0
- package/dist/{vue-ui-screenshot-Co2o48d6.cjs → vue-ui-screenshot-C1JBP_N0.cjs} +1 -1
- package/dist/{vue-ui-screenshot-Csc0dQL9.js → vue-ui-screenshot-p3ca8cAl.js} +1 -1
- package/dist/{vue-ui-skeleton-B2sRnIXX.js → vue-ui-skeleton-BYssP0K4.js} +419 -379
- package/dist/vue-ui-skeleton-BqKzuhkB.cjs +41 -0
- package/dist/{vue-ui-smiley-Ci3uMgVh.cjs → vue-ui-smiley-BXKVpHl2.cjs} +1 -1
- package/dist/{vue-ui-smiley-D4s-AdIE.js → vue-ui-smiley-D7dDCdpq.js} +2 -2
- package/dist/vue-ui-spark-trend-9V60hM3Z.cjs +1 -0
- package/dist/{vue-ui-spark-trend-CHKQGMLs.js → vue-ui-spark-trend-GWFrO_0z.js} +86 -79
- package/dist/vue-ui-sparkbar-Bgn6AY0q.cjs +1 -0
- package/dist/{vue-ui-sparkbar-Bb1fq2GR.js → vue-ui-sparkbar-CwqlyAyv.js} +90 -83
- package/dist/vue-ui-sparkgauge-Dqntz2Zv.cjs +1 -0
- package/dist/{vue-ui-sparkgauge-DWuaAQbo.js → vue-ui-sparkgauge-F2XbiXyA.js} +57 -50
- package/dist/{vue-ui-sparkhistogram-CjeJ3ch1.js → vue-ui-sparkhistogram-DRIKK6Ym.js} +74 -67
- package/dist/vue-ui-sparkhistogram-DnY4-Sdn.cjs +1 -0
- package/dist/vue-ui-sparkline-CAEs-gtK.cjs +1 -0
- package/dist/{vue-ui-sparkline-DGJDBArr.js → vue-ui-sparkline-Cxtzdlhi.js} +134 -125
- package/dist/{vue-ui-sparkstackbar-B3ul3qUZ.js → vue-ui-sparkstackbar-0A1klq9s.js} +84 -77
- package/dist/vue-ui-sparkstackbar-D37ms1rx.cjs +1 -0
- package/dist/vue-ui-stackbar-ByOuJSdM.js +947 -0
- package/dist/vue-ui-stackbar-wun4S3C0.cjs +6 -0
- package/dist/{vue-ui-strip-plot-CIb2LSV8.js → vue-ui-strip-plot-CMD0MSqY.js} +297 -264
- package/dist/vue-ui-strip-plot-IQrypGvz.cjs +1 -0
- package/dist/{vue-ui-table-CmVi0nv2.js → vue-ui-table-B75DJ39t.js} +1 -1
- package/dist/{vue-ui-table-B_sFrAO9.cjs → vue-ui-table-aj0XZ7T5.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-CgFr38QT.js → vue-ui-table-heatmap-BO2ugWqD.js} +55 -48
- package/dist/vue-ui-table-heatmap-Ce93TyBF.cjs +1 -0
- package/dist/{vue-ui-table-sparkline-eg2Qd8ws.js → vue-ui-table-sparkline-CbjfAaj2.js} +88 -81
- package/dist/vue-ui-table-sparkline-D6KJjDnU.cjs +1 -0
- package/dist/vue-ui-thermometer-Pq4PvSIP.js +447 -0
- package/dist/vue-ui-thermometer-swmi4FmH.cjs +1 -0
- package/dist/{vue-ui-timer-DM1IStj1.cjs → vue-ui-timer-B6IB6yS6.cjs} +1 -1
- package/dist/{vue-ui-timer-COSI3Q5T.js → vue-ui-timer-Bk3BvB-B.js} +6 -6
- package/dist/vue-ui-tiremarks-CU9HJIqf.js +310 -0
- package/dist/vue-ui-tiremarks-Cn79uQH2.cjs +1 -0
- package/dist/vue-ui-treemap-BEMuKV7x.cjs +1 -0
- package/dist/vue-ui-treemap-DY-lRAhC.js +825 -0
- package/dist/vue-ui-vertical-bar-B1e2RxTv.cjs +4 -0
- package/dist/vue-ui-vertical-bar-CtnIKsM1.js +861 -0
- package/dist/vue-ui-waffle-BqP7Okgu.cjs +1 -0
- package/dist/vue-ui-waffle-reOsx-gJ.js +791 -0
- package/dist/vue-ui-wheel-BuWUGnkC.cjs +1 -0
- package/dist/vue-ui-wheel-kYxny3vn.js +291 -0
- package/dist/vue-ui-word-cloud-DbMqrHAf.js +607 -0
- package/dist/vue-ui-word-cloud-DwLY4QdB.cjs +1 -0
- package/dist/vue-ui-xy-CGWzriYn.cjs +3 -0
- package/dist/{vue-ui-xy-canvas-BYdTxzi6.js → vue-ui-xy-canvas-B0HTR7OV.js} +441 -408
- package/dist/vue-ui-xy-canvas-CgJd5FiT.cjs +9 -0
- package/dist/{vue-ui-xy-x8KEsGV-.js → vue-ui-xy-rbACig0h.js} +824 -791
- package/package.json +1 -1
- package/dist/BaseIcon-E7FmzMcY.cjs +0 -1
- package/dist/index-C7_6YjWN.cjs +0 -9
- package/dist/usePrinter-8EP4iaGm.cjs +0 -1
- package/dist/useResponsive-B3TrDDIG.cjs +0 -1
- package/dist/useResponsive-NZB-WLRF.js +0 -187
- package/dist/vue-data-ui-4Yd255Ia.cjs +0 -9
- package/dist/vue-data-ui-Cp7bO_tj.js +0 -258
- package/dist/vue-ui-3d-bar-BeR2aBgQ.cjs +0 -19
- package/dist/vue-ui-age-pyramid-R-C4P4mI.cjs +0 -1
- package/dist/vue-ui-bullet-CQKaC4wG.js +0 -409
- package/dist/vue-ui-bullet-DSZox236.cjs +0 -23
- package/dist/vue-ui-candlestick-Dilozp3V.cjs +0 -2
- package/dist/vue-ui-carousel-table-C0GDDSW9.cjs +0 -1
- package/dist/vue-ui-chestnut-DdEcEI04.cjs +0 -6
- package/dist/vue-ui-donut-DTSVlGMg.cjs +0 -1
- package/dist/vue-ui-donut-evolution-BuUafabD.cjs +0 -1
- package/dist/vue-ui-dumbbell-CVfgnyKi.cjs +0 -9
- package/dist/vue-ui-flow-C45dODaB.cjs +0 -1
- package/dist/vue-ui-flow-DkPTzNv9.js +0 -484
- package/dist/vue-ui-galaxy-DlPavMK0.cjs +0 -1
- package/dist/vue-ui-gauge-BXiy515T.js +0 -494
- package/dist/vue-ui-gauge-vMFUYHYH.cjs +0 -1
- package/dist/vue-ui-heatmap-CMQqQnxc.cjs +0 -1
- package/dist/vue-ui-molecule-BwmkMEVN.js +0 -774
- package/dist/vue-ui-molecule-nOuD0hR5.cjs +0 -1
- package/dist/vue-ui-mood-radar-Bof_C9Ae.cjs +0 -1
- package/dist/vue-ui-nested-donuts-DIb6YyWv.cjs +0 -17
- package/dist/vue-ui-onion-D9o6Rcgu.js +0 -617
- package/dist/vue-ui-onion-N3tRNc4u.cjs +0 -5
- package/dist/vue-ui-parallel-coordinate-plot-BcYrYXhG.js +0 -686
- package/dist/vue-ui-parallel-coordinate-plot-qKGk2bX6.cjs +0 -8
- package/dist/vue-ui-quadrant-Do48rGrX.cjs +0 -1
- package/dist/vue-ui-quick-chart-BxU4d-sJ.cjs +0 -15
- package/dist/vue-ui-radar-CooAvwPA.cjs +0 -1
- package/dist/vue-ui-relation-circle-nRf1pvD0.js +0 -325
- package/dist/vue-ui-relation-circle-uNgJni4x.cjs +0 -1
- package/dist/vue-ui-rings-BgRc1o4_.js +0 -569
- package/dist/vue-ui-rings-iIgQI9Ws.cjs +0 -2
- package/dist/vue-ui-scatter-CkrpmLxP.cjs +0 -1
- package/dist/vue-ui-skeleton-CGV1dEUD.cjs +0 -41
- package/dist/vue-ui-spark-trend-BfoEoJEy.cjs +0 -1
- package/dist/vue-ui-sparkbar-DB2DeXti.cjs +0 -1
- package/dist/vue-ui-sparkgauge-CJepIY2u.cjs +0 -1
- package/dist/vue-ui-sparkhistogram-B7B36LLT.cjs +0 -1
- package/dist/vue-ui-sparkline-BcqmwDAb.cjs +0 -1
- package/dist/vue-ui-sparkstackbar-DT3aKNeV.cjs +0 -1
- package/dist/vue-ui-stackbar-CRcUugkl.cjs +0 -6
- package/dist/vue-ui-stackbar-DNROvZII.js +0 -915
- package/dist/vue-ui-strip-plot-Ck9Fmt_b.cjs +0 -1
- package/dist/vue-ui-table-heatmap-Chvdf2Gi.cjs +0 -1
- package/dist/vue-ui-table-sparkline-DUUYQ5dH.cjs +0 -1
- package/dist/vue-ui-thermometer-BFfN4aat.cjs +0 -1
- package/dist/vue-ui-thermometer-BePmFiwy.js +0 -416
- package/dist/vue-ui-tiremarks-BkYXzU3R.cjs +0 -1
- package/dist/vue-ui-tiremarks-d6TmSHY7.js +0 -279
- package/dist/vue-ui-treemap-BgeZnbl3.cjs +0 -1
- package/dist/vue-ui-treemap-Qg0858o6.js +0 -792
- package/dist/vue-ui-vertical-bar-CieqHVD5.js +0 -828
- package/dist/vue-ui-vertical-bar-D3atbdvl.cjs +0 -4
- package/dist/vue-ui-waffle-CD7C9Lu4.cjs +0 -1
- package/dist/vue-ui-waffle-CjNhM-mV.js +0 -758
- package/dist/vue-ui-wheel-B8mbO6ht.js +0 -258
- package/dist/vue-ui-wheel-CYmM7J61.cjs +0 -1
- package/dist/vue-ui-word-cloud-DMXrUmX5.js +0 -574
- package/dist/vue-ui-word-cloud-Dm9yZ1zQ.cjs +0 -1
- package/dist/vue-ui-xy-DoWnidom.cjs +0 -3
- package/dist/vue-ui-xy-canvas-DHs5sb3t.cjs +0 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-C7_6YjWN.cjs"),L=require("./useNestedProp-CC9zGr7C.cjs"),D=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),M={key:0,class:"vue-ui-rating-title",style:{width:"100%"}},A=["src","height","width"],R=["xmlns","height","width"],X=["id"],j=["stop-color"],F=["stop-color"],I=["points","fill","stroke","stroke-width"],O=["src","alt","height","width","id"],Y=["xmlns","viewBox","height","id"],G=["id"],q=["stop-color"],U=["stop-color"],H=["points","fill","stroke"],K=["xmlns","height"],P=["onClick","onMouseenter","onKeyup"],T=["onMouseenter"],W={__name:"vue-ui-rating",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:["rate"],setup(k,{expose:_,emit:S}){const i=k,{vue_ui_rating:z}=a.useConfig(),d=e.ref(a.createUid()),f=e.ref(!1),s=e.ref(void 0),y=e.ref([]),t=e.computed({get:()=>g(),set:o=>o});function g(){return L.useNestedProp({userConfig:i.config,defaultConfig:z})}e.watch(()=>i.config,o=>{t.value=g(),h()},{deep:!0});const w=e.computed(()=>typeof i.dataset.rating=="object"&&!Array.isArray(i.dataset.rating)?N(i.dataset.rating):i.dataset.rating),B=e.computed(()=>typeof i.dataset.rating=="object"&&!Array.isArray(i.dataset.rating)),r=e.ref(w.value),m=e.computed(()=>t.value.type==="image"),c=e.computed(()=>t.value.readonly);function N(o){let n=0,l=0;for(const u in o){const V=parseInt(u),b=o[u];n+=V*b,l+=b}if(l===0)return 0;const v=n/l;return Math.min(t.value.to,Math.max(t.value.from,v))}e.onMounted(()=>{h()});function h(){a.objectIsEmpty(i.dataset)&&a.error({componentName:"VueUiRating",type:"dataset"}),y.value=[];for(let o=t.value.from;o<=t.value.to;o+=1)y.value.push(o)}function p(o,n=!1){return o>s.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_${d.value})`:t.value.style.star.activeColor}function x(o,n=!1){const l=r.value-o,v=n?1:100;switch(!0){case l<=0:return .001;case l>1:return 1*v;default:return l*v}}function $(o){c.value||(r.value=o,S("rate",o))}function C(){return r.value}function E(o=!0){c.value=o}return _({getData:C,toggleReadonly:E}),(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[2]||(n[2]=l=>f.value=!0),onMouseleave:n[3]||(n[3]=l=>{f.value=!1,s.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(e.unref(a.applyDataLabel)(t.value.style.rating.formatter,r.value,e.unref(a.dataLabel)({v:r.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,r.value,e.unref(a.dataLabel)({v:r.value,r:t.value.style.rating.roundingValue}),t.value)),5)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.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`)},[m.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(s.value)?t.value.style.image.inactiveOpacity:p(l,!0)}`)},null,12,A)):(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_${d.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(a.shiftHue)(t.value.style.star.activeColor,.05)}`},null,8,j),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.star.activeColor},null,8,F)],8,X)]),e.createElementVNode("polygon",{points:e.unref(a.createStar)({plot:{x:50,y:50},radius:30,apexes:t.value.style.star.apexes}),fill:isNaN(s.value)?t.value.style.star.inactiveColor:p(l),stroke:t.value.style.star.borderColor?t.value.style.star.borderColor:s.value?p(l):t.value.style.star.inactiveColor,"stroke-width":t.value.style.star.borderWidth,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,I)],8,R)),m.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,${x(v,!0)*t.value.style.itemSize}px,${t.value.style.itemSize}px,0px`)},null,12,O)):(e.openBlock(),e.createElementBlock("svg",{key:3,xmlns:e.unref(a.XMLNS),viewBox:`0 0 ${x(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(a.shiftHue)(t.value.style.star.activeColor,.05)}`},null,8,q),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:t.value.style.star.useGradient?`url(#star_gradient_over_${d.value})`:t.value.style.star.activeColor,stroke:t.value.style.star.activeColor},null,8,H)],8,Y)),(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:u=>$(l),onMouseenter:u=>s.value=l,onMouseleave:n[0]||(n[0]=u=>s.value=void 0),tabindex:"0",onKeyup:e.withKeys(u=>$(l),["enter"])},null,40,P)),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=>s.value=l,onMouseleave:n[1]||(n[1]=u=>s.value=void 0)},null,40,T)):e.createCommentVNode("",!0)],12,K)),t.value.style.tooltip.show&&B.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:${s.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,r.value,e.unref(a.dataLabel)({v:r.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,r.value,e.unref(a.dataLabel)({v:r.value,r:t.value.style.rating.roundingValue}),t.value)),5)):e.createCommentVNode("",!0)],36))}},J=D._export_sfc(W,[["__scopeId","data-v-d90e158f"]]);exports.default=J;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-eFox7weK.cjs"),L=require("./useNestedProp-BkgEhTQY.cjs"),D=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),M={key:0,class:"vue-ui-rating-title",style:{width:"100%"}},A=["src","height","width"],R=["xmlns","height","width"],X=["id"],j=["stop-color"],F=["stop-color"],I=["points","fill","stroke","stroke-width"],O=["src","alt","height","width","id"],Y=["xmlns","viewBox","height","id"],G=["id"],q=["stop-color"],U=["stop-color"],H=["points","fill","stroke"],K=["xmlns","height"],P=["onClick","onMouseenter","onKeyup"],T=["onMouseenter"],W={__name:"vue-ui-rating",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:["rate"],setup(k,{expose:_,emit:S}){const i=k,{vue_ui_rating:z}=a.useConfig(),d=e.ref(a.createUid()),f=e.ref(!1),s=e.ref(void 0),y=e.ref([]),t=e.computed({get:()=>g(),set:o=>o});function g(){return L.useNestedProp({userConfig:i.config,defaultConfig:z})}e.watch(()=>i.config,o=>{t.value=g(),h()},{deep:!0});const w=e.computed(()=>typeof i.dataset.rating=="object"&&!Array.isArray(i.dataset.rating)?N(i.dataset.rating):i.dataset.rating),B=e.computed(()=>typeof i.dataset.rating=="object"&&!Array.isArray(i.dataset.rating)),r=e.ref(w.value),m=e.computed(()=>t.value.type==="image"),c=e.computed(()=>t.value.readonly);function N(o){let n=0,l=0;for(const u in o){const V=parseInt(u),b=o[u];n+=V*b,l+=b}if(l===0)return 0;const v=n/l;return Math.min(t.value.to,Math.max(t.value.from,v))}e.onMounted(()=>{h()});function h(){a.objectIsEmpty(i.dataset)&&a.error({componentName:"VueUiRating",type:"dataset"}),y.value=[];for(let o=t.value.from;o<=t.value.to;o+=1)y.value.push(o)}function p(o,n=!1){return o>s.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_${d.value})`:t.value.style.star.activeColor}function x(o,n=!1){const l=r.value-o,v=n?1:100;switch(!0){case l<=0:return .001;case l>1:return 1*v;default:return l*v}}function $(o){c.value||(r.value=o,S("rate",o))}function C(){return r.value}function E(o=!0){c.value=o}return _({getData:C,toggleReadonly:E}),(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[2]||(n[2]=l=>f.value=!0),onMouseleave:n[3]||(n[3]=l=>{f.value=!1,s.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(e.unref(a.applyDataLabel)(t.value.style.rating.formatter,r.value,e.unref(a.dataLabel)({v:r.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,r.value,e.unref(a.dataLabel)({v:r.value,r:t.value.style.rating.roundingValue}),t.value)),5)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.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`)},[m.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(s.value)?t.value.style.image.inactiveOpacity:p(l,!0)}`)},null,12,A)):(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_${d.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(a.shiftHue)(t.value.style.star.activeColor,.05)}`},null,8,j),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.star.activeColor},null,8,F)],8,X)]),e.createElementVNode("polygon",{points:e.unref(a.createStar)({plot:{x:50,y:50},radius:30,apexes:t.value.style.star.apexes}),fill:isNaN(s.value)?t.value.style.star.inactiveColor:p(l),stroke:t.value.style.star.borderColor?t.value.style.star.borderColor:s.value?p(l):t.value.style.star.inactiveColor,"stroke-width":t.value.style.star.borderWidth,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,I)],8,R)),m.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,${x(v,!0)*t.value.style.itemSize}px,${t.value.style.itemSize}px,0px`)},null,12,O)):(e.openBlock(),e.createElementBlock("svg",{key:3,xmlns:e.unref(a.XMLNS),viewBox:`0 0 ${x(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(a.shiftHue)(t.value.style.star.activeColor,.05)}`},null,8,q),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:t.value.style.star.useGradient?`url(#star_gradient_over_${d.value})`:t.value.style.star.activeColor,stroke:t.value.style.star.activeColor},null,8,H)],8,Y)),(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:u=>$(l),onMouseenter:u=>s.value=l,onMouseleave:n[0]||(n[0]=u=>s.value=void 0),tabindex:"0",onKeyup:e.withKeys(u=>$(l),["enter"])},null,40,P)),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=>s.value=l,onMouseleave:n[1]||(n[1]=u=>s.value=void 0)},null,40,T)):e.createCommentVNode("",!0)],12,K)),t.value.style.tooltip.show&&B.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:${s.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,r.value,e.unref(a.dataLabel)({v:r.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,r.value,e.unref(a.dataLabel)({v:r.value,r:t.value.style.rating.roundingValue}),t.value)),5)):e.createCommentVNode("",!0)],36))}},J=D._export_sfc(W,[["__scopeId","data-v-d90e158f"]]);exports.default=J;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ref as h, computed as x, watch as E, onMounted as K, openBlock as a, createElementBlock as i, normalizeStyle as o, createElementVNode as r, toDisplayString as g, createCommentVNode as d, unref as s, Fragment as T, renderList as H, withKeys as P } from "vue";
|
|
2
|
-
import { u as W, c as q, o as J, e as Q, i as $, f as _, X as k, w as R, U as F } from "./index-
|
|
3
|
-
import { u as Z } from "./useNestedProp-
|
|
2
|
+
import { u as W, c as q, o as J, e as Q, i as $, f as _, X as k, w as R, U as F } from "./index-Bya_q1J-.js";
|
|
3
|
+
import { u as Z } from "./useNestedProp-B33hazbH.js";
|
|
4
4
|
import { _ as tt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
5
|
const et = {
|
|
6
6
|
key: 0,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),i=require("./index-eFox7weK.cjs"),G=require("./useResponsive-CodiGUOE.cjs"),ue=require("./Title-0Tp4hZ4u.cjs"),U=require("./usePrinter-CSRFnDBU.cjs"),ce=require("./vue-ui-skeleton-BqKzuhkB.cjs"),D=require("./useNestedProp-BkgEhTQY.cjs"),de=require("./PackageVersion-DwI-KhXH.cjs"),ve=require("./PenAndPaper-CDFVOo7X.cjs"),fe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ge=["id"],me=["xmlns","viewBox"],ye=["cx","cy","r","stroke","stroke-width"],he={key:0},ke=["stroke","d","stroke-width"],pe={key:1},Ce=["stroke","x1","x2","y1","y2"],_e=["text-anchor","transform","x","y","onClick","font-weight","font-size","fill"],$e=["cx","cy","fill","onClick","r"],xe={key:4,class:"vue-data-ui-watermark"},we={__name:"vue-ui-relation-circle",props:{dataset:{type:Array,default(){return[]}},config:{type:Object,default(){return{}}}},setup(W,{expose:X}){const u=W;e.useCssVars(t=>({"76cff64e":Q.value,"0b529da6":K.value,"15b1ac4f":Z.value}));const{vue_ui_relation_circle:Y}=i.useConfig(),C=e.computed(()=>!!u.dataset&&Object.keys(u.dataset).length),g=e.ref(i.createUid()),b=e.ref(0),m=e.ref(null),B=e.ref(null),P=e.ref(null),A=e.ref(0),n=e.computed({get:()=>O(),set:t=>t});function O(){const t=D.useNestedProp({userConfig:u.config,defaultConfig:Y});return t.theme?{...D.useNestedProp({userConfig:i.themes.vue_ui_relation_circle[t.theme]||u.config,defaultConfig:t}),customPalette:i.themePalettes[t.theme]||i.palette}:t}e.watch(()=>u.config,t=>{n.value=O(),F(),A.value+=1},{deep:!0});const{isPrinting:E,isImaging:S,generatePdf:I,generateImage:z}=U.usePrinter({elementId:`relation_circle_${g.value}`,fileName:n.value.style.title.text||"vue-ui-relation-circle"}),N=e.computed(()=>i.convertCustomPalette(n.value.customPalette)),d=e.ref([]),f=e.ref([]),a=e.ref({}),c=e.ref([]),H=e.ref(0),_=e.computed(()=>u.dataset.slice(0,n.value.style.limit)),$=e.ref(n.value.style.size),s=e.ref({height:n.value.style.size,width:n.value.style.size}),v=e.computed({get(){return $.value*n.value.style.circle.radiusProportion},set(t){return t}}),J=e.computed(()=>n.value.style.links.curved),K=e.computed(()=>`${n.value.style.animation.speedMs}ms`),Q=e.computed(()=>v.value*2),Z=e.computed(()=>v.value*4),h=e.ref(null);e.onMounted(()=>{F(),document.getElementById(`relation_circle_${g.value}`).addEventListener("click",L)});function F(){if(i.objectIsEmpty(u.dataset)?i.error({componentName:"VueUiRelationCircle",type:"dataset"}):u.dataset.forEach((t,l)=>{i.getMissingDatasetAttributes({datasetObject:t,requiredAttributes:["id","label","relations","weights"]}).forEach(r=>{i.error({componentName:"VueUiRelationCircle",type:"datasetSerieAttribute",property:r,index:l})})}),n.value.responsive){const t=G.throttle(()=>{const{width:l,height:r}=G.useResponsive({chart:m.value,title:n.value.style.title.text?B.value:null,source:P.value});$.value=Math.min(l,r),s.value.width=l,s.value.height=r,v.value=$.value*n.value.style.circle.radiusProportion,d.value=[],f.value=[],R(),T()});h.value=new ResizeObserver(t),h.value.observe(m.value.parentNode)}else d.value=[],f.value=[],R(),T()}e.onBeforeUnmount(()=>{document.getElementById(`relation_circle_${g.value}`).removeEventListener("click",L),h.value&&h.value.disconnect()});function L(t){const l=t.target;l&&Array.from(l.classList).includes("vue-ui-user-options")||l&&Array.from(l.classList).includes("vue-ui-user-options-summary")||l&&Array.from(l.classList).includes("vue-data-ui-button")||l&&Array.from(l.classList).includes("vue-ui-relation-circle-legend")||(a.value={},c.value=[])}function R(){const t=6.28319/_.value.length,l=360/_.value.length;let r=0,o=0;_.value.forEach((y,w)=>{const se=v.value*Math.cos(r)+s.value.width/2,ie=v.value*Math.sin(r)+s.value.height/2+n.value.style.circle.offsetY;d.value.push({x:se,y:ie,...y,color:y.color?y.color:N.value[w]?N.value[w]:i.palette[w],regAngle:o}),r+=t,o+=l})}function T(){d.value.forEach(t=>{d.value.filter(r=>r.relations.includes(t.id)).forEach((r,o)=>{f.value.push({weight:t.weights&&t.weights[o]?t.weights[o]:1,relationId:`${t.id}_${r.id}`,x1:t.x,y1:t.y,x2:r.x,y2:r.y,colorSource:t.color,colorTarget:r.color,...t})})})}const ee=e.computed(()=>Math.max(...f.value.map(t=>t.weight)));function te(t){return Object.hasOwn(a.value,"x")?c.value.includes(t.id)?"opacity:1":"opacity:0.1":"opacity:1"}function V(t){return Object.hasOwn(a.value,"x")?t.colorTarget:t.colorSource}function q(t){return Object.hasOwn(a.value,"x")?c.value.includes(t.id)&&t.relationId===`${t.id}_${a.value.id}`||t.relationId===`${a.value.id}_${t.id}`?`opacity:1;stroke-width:${j(t)}`:"opacity: 0":"opacity: 1"}function re(t){return t.regAngle>90&&t.regAngle<270?"end":"start"}function ne(t){return t.regAngle>90&&t.regAngle<270?t.x-5:t.x+5}function le(t){return Object.hasOwn(a.value,"x")?a.value.id===t.id||c.value.includes(t.id)?"opacity:1":"opacity:0.2":"opacity:1"}function oe(t){return t.regAngle>90&&t.regAngle<270?`rotate(${t.regAngle+180},${t.x},${t.y})`:`rotate(${t.regAngle},${t.x},${t.y})`}function M(t){H.value=360-t.regAngle,a.value.id&&t.id===a.value.id?(a.value={},c.value=[]):(a.value=t,c.value=[...t.relations])}function j(t){return t.weight/ee.value*n.value.style.links.maxWidth}const k=e.ref(!1);function ae(t){k.value=t,b.value+=1}const p=e.ref(!1);function x(){p.value=!p.value}return X({generatePdf:I,generateImage:z,toggleAnnotator:x}),(t,l)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"relationCircleChart",ref:m,class:"vue-ui-relation-circle",style:e.normalizeStyle(`width:100%;background:${n.value.style.backgroundColor};text-align:center;${n.value.responsive?"height: 100%":""}`),id:`relation_circle_${g.value}`},[n.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(ve.PenAndPaper,{key:0,parent:m.value,backgroundColor:n.value.style.backgroundColor,color:n.value.style.color,active:p.value,onClose:x},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),n.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"chartTitle",ref:B,style:"width:100%;background:transparent"},[(e.openBlock(),e.createBlock(ue._sfc_main,{key:`title_${A.value}`,config:{title:{cy:"relation-div-title",...n.value.style.title},subtitle:{cy:"relation-div-subtitle",...n.value.style.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),n.value.userOptions.show&&C.value?(e.openBlock(),e.createBlock(U.UserOptions,{ref:"details",key:`user_options_${b.value}`,backgroundColor:n.value.style.backgroundColor,color:n.value.style.color,isPrinting:e.unref(E),isImaging:e.unref(S),uid:g.value,hasPdf:n.value.userOptions.buttons.pdf,hasImg:n.value.userOptions.buttons.img,hasFullscreen:n.value.userOptions.buttons.img,hasXls:!1,isFullscreen:k.value,titles:{...n.value.userOptions.buttonTitles},chartElement:m.value,position:n.value.userOptions.position,hasAnnotator:n.value.userOptions.buttons.annotator,isAnnotation:p.value,onToggleFullscreen:ae,onGeneratePdf:e.unref(I),onGenerateImage:e.unref(z),onToggleAnnotator:x},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:r,isFullscreen:o})=>[e.renderSlot(t.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:r,isFullscreen:o})),void 0,!0)]),key:"2"}:void 0,t.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:r,isAnnotator:o})=>[e.renderSlot(t.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:r,isAnnotator:o})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),C.value?(e.openBlock(),e.createElementBlock("svg",{key:3,xmlns:e.unref(i.XMLNS),class:e.normalizeClass([{"vue-data-ui-fullscreen--on":k.value,"vue-data-ui-fulscreen--off":!k.value},"relation-circle"]),viewBox:`0 0 ${s.value.width<=0?10:s.value.width} ${s.value.height<=0?10:s.value.height}`,width:"100%",style:"user-select:none; background:transparent"},[e.createVNode(de._sfc_main),e.createElementVNode("circle",{cx:(s.value.width<=0?1e-4:s.value.width)/2,cy:(s.value.height<=0?1e-4:s.value.height)/2+n.value.style.circle.offsetY,r:v.value<=0?1e-4:v.value,stroke:n.value.style.circle.stroke,"stroke-width":n.value.style.circle.strokeWidth,fill:"transparent",class:"main-circle"},null,8,ye),J.value?(e.openBlock(),e.createElementBlock("g",he,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(r,o)=>(e.openBlock(),e.createElementBlock("path",{key:`relation_${o}`,style:e.normalizeStyle(q(r)),stroke:V(r),class:e.normalizeClass(["relation",{"vue-ui-relation-circle-selected":a.value.hasOwnProperty("id")&&c.value.includes(r.id)}]),d:`M${r.x1},${r.y1} C${r.x1},${r.y1} ${s.value.width/2},${s.value.height/2+n.value.style.circle.offsetY} ${r.x2},${r.y2}`,fill:"none","stroke-width":j(r),"stroke-linecap":"round"},null,14,ke))),128))])):(e.openBlock(),e.createElementBlock("g",pe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(r,o)=>(e.openBlock(),e.createElementBlock("line",{key:`relation_${o}`,stroke:V(r),style:e.normalizeStyle(q(r)),x1:r.x1,x2:r.x2,y1:r.y1,y2:r.y2,class:e.normalizeClass({"vue-ui-relation-circle-selected":a.value.hasOwnProperty("id")&&c.value.includes(r.id)}),"stroke-linecap":"round"},null,14,Ce))),128))])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(r,o)=>(e.openBlock(),e.createElementBlock("text",{key:`plot_text_${o}`,"text-anchor":re(r),transform:oe(r),x:ne(r),y:r.y+5,onClick:y=>M(r),class:"vue-ui-relation-circle-legend","transform-origin":"start","font-weight":a.value.id===r.id?"900":"400",style:e.normalizeStyle(`font-family:${n.value.style.fontFamily};${le(r)}`),"font-size":n.value.style.labels.fontSize,fill:n.value.style.labels.color},e.toDisplayString(r.label),13,_e))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(r,o)=>(e.openBlock(),e.createElementBlock("circle",{cx:r.x,cy:r.y,key:`plot_${o}`,style:e.normalizeStyle(te(r)),class:"vue-ui-relation-circle-plot",fill:n.value.style.plot.color,onClick:y=>M(r),r:n.value.style.plot.radius},null,12,$e))),128)),e.renderSlot(t.$slots,"svg",{svg:s.value},void 0,!0)],10,me)):e.createCommentVNode("",!0),t.$slots.watermark?(e.openBlock(),e.createElementBlock("div",xe,[e.renderSlot(t.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(E)||e.unref(S)})),void 0,!0)])):e.createCommentVNode("",!0),t.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:5,ref_key:"source",ref:P,dir:"auto"},[e.renderSlot(t.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),C.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ce.default,{key:6,config:{type:"relationCircle",style:{backgroundColor:n.value.style.backgroundColor,relationCircle:{color:"#CCCCCC"}}}},null,8,["config"]))],12,ge))}},be=fe._export_sfc(we,[["__scopeId","data-v-3dcfe3a3"]]);exports.default=be;
|
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
import { useCssVars as Ce, computed as c, ref as s, watch as be, onMounted as we, onBeforeUnmount as xe, openBlock as n, createElementBlock as u, normalizeStyle as C, createBlock as A, createCommentVNode as y, unref as h, createSlots as Ae, withCtx as O, renderSlot as m, normalizeProps as S, guardReactiveProps as T, normalizeClass as R, createVNode as Oe, createElementVNode as Pe, Fragment as P, renderList as I, toDisplayString as Ie } from "vue";
|
|
2
|
+
import { u as Fe, c as Ee, t as ze, a as Le, p as le, b as Ne, o as Se, e as ne, g as Te, X as Re } from "./index-Bya_q1J-.js";
|
|
3
|
+
import { t as Me, u as je } from "./useResponsive-BY8tgM1n.js";
|
|
4
|
+
import { _ as Be } from "./Title-C5pIfQAz.js";
|
|
5
|
+
import { u as Ge, U as Ue } from "./usePrinter-CiHd1FwD.js";
|
|
6
|
+
import De from "./vue-ui-skeleton-BYssP0K4.js";
|
|
7
|
+
import { u as re } from "./useNestedProp-B33hazbH.js";
|
|
8
|
+
import { _ as Ve } from "./PackageVersion-VkaUzgmt.js";
|
|
9
|
+
import { P as We } from "./PenAndPaper-DAZYA8Ew.js";
|
|
10
|
+
import { _ as Xe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
11
|
+
const Ye = ["id"], qe = ["xmlns", "viewBox"], He = ["cx", "cy", "r", "stroke", "stroke-width"], Je = { key: 0 }, Ke = ["stroke", "d", "stroke-width"], Qe = { key: 1 }, Ze = ["stroke", "x1", "x2", "y1", "y2"], et = ["text-anchor", "transform", "x", "y", "onClick", "font-weight", "font-size", "fill"], tt = ["cx", "cy", "fill", "onClick", "r"], lt = {
|
|
12
|
+
key: 4,
|
|
13
|
+
class: "vue-data-ui-watermark"
|
|
14
|
+
}, nt = {
|
|
15
|
+
__name: "vue-ui-relation-circle",
|
|
16
|
+
props: {
|
|
17
|
+
dataset: {
|
|
18
|
+
type: Array,
|
|
19
|
+
default() {
|
|
20
|
+
return [];
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
config: {
|
|
24
|
+
type: Object,
|
|
25
|
+
default() {
|
|
26
|
+
return {};
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
setup(ae, { expose: se }) {
|
|
31
|
+
const d = ae;
|
|
32
|
+
Ce((e) => ({
|
|
33
|
+
"76cff64e": de.value,
|
|
34
|
+
"0b529da6": ce.value,
|
|
35
|
+
"15b1ac4f": ve.value
|
|
36
|
+
}));
|
|
37
|
+
const { vue_ui_relation_circle: ie } = Fe(), F = c(() => !!d.dataset && Object.keys(d.dataset).length), k = s(Ee()), M = s(0), _ = s(null), j = s(null), B = s(null), G = s(0), l = c({
|
|
38
|
+
get: () => U(),
|
|
39
|
+
set: (e) => e
|
|
40
|
+
});
|
|
41
|
+
function U() {
|
|
42
|
+
const e = re({
|
|
43
|
+
userConfig: d.config,
|
|
44
|
+
defaultConfig: ie
|
|
45
|
+
});
|
|
46
|
+
return e.theme ? {
|
|
47
|
+
...re({
|
|
48
|
+
userConfig: ze.vue_ui_relation_circle[e.theme] || d.config,
|
|
49
|
+
defaultConfig: e
|
|
50
|
+
}),
|
|
51
|
+
customPalette: Le[e.theme] || le
|
|
52
|
+
} : e;
|
|
53
|
+
}
|
|
54
|
+
be(() => d.config, (e) => {
|
|
55
|
+
l.value = U(), q(), G.value += 1;
|
|
56
|
+
}, { deep: !0 });
|
|
57
|
+
const { isPrinting: D, isImaging: V, generatePdf: W, generateImage: X } = Ge({
|
|
58
|
+
elementId: `relation_circle_${k.value}`,
|
|
59
|
+
fileName: l.value.style.title.text || "vue-ui-relation-circle"
|
|
60
|
+
}), Y = c(() => Ne(l.value.customPalette)), f = s([]), p = s([]), i = s({}), v = s([]), oe = s(0), E = c(() => d.dataset.slice(0, l.value.style.limit)), z = s(l.value.style.size), o = s({
|
|
61
|
+
height: l.value.style.size,
|
|
62
|
+
width: l.value.style.size
|
|
63
|
+
}), g = c({
|
|
64
|
+
get() {
|
|
65
|
+
return z.value * l.value.style.circle.radiusProportion;
|
|
66
|
+
},
|
|
67
|
+
set(e) {
|
|
68
|
+
return e;
|
|
69
|
+
}
|
|
70
|
+
}), ue = c(() => l.value.style.links.curved), ce = c(() => `${l.value.style.animation.speedMs}ms`), de = c(() => g.value * 2), ve = c(() => g.value * 4), b = s(null);
|
|
71
|
+
we(() => {
|
|
72
|
+
q(), document.getElementById(`relation_circle_${k.value}`).addEventListener("click", H);
|
|
73
|
+
});
|
|
74
|
+
function q() {
|
|
75
|
+
if (Se(d.dataset) ? ne({
|
|
76
|
+
componentName: "VueUiRelationCircle",
|
|
77
|
+
type: "dataset"
|
|
78
|
+
}) : d.dataset.forEach((e, r) => {
|
|
79
|
+
Te({
|
|
80
|
+
datasetObject: e,
|
|
81
|
+
requiredAttributes: ["id", "label", "relations", "weights"]
|
|
82
|
+
}).forEach((t) => {
|
|
83
|
+
ne({
|
|
84
|
+
componentName: "VueUiRelationCircle",
|
|
85
|
+
type: "datasetSerieAttribute",
|
|
86
|
+
property: t,
|
|
87
|
+
index: r
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
}), l.value.responsive) {
|
|
91
|
+
const e = Me(() => {
|
|
92
|
+
const { width: r, height: t } = je({
|
|
93
|
+
chart: _.value,
|
|
94
|
+
title: l.value.style.title.text ? j.value : null,
|
|
95
|
+
source: B.value
|
|
96
|
+
});
|
|
97
|
+
z.value = Math.min(r, t), o.value.width = r, o.value.height = t, g.value = z.value * l.value.style.circle.radiusProportion, f.value = [], p.value = [], J(), K();
|
|
98
|
+
});
|
|
99
|
+
b.value = new ResizeObserver(e), b.value.observe(_.value.parentNode);
|
|
100
|
+
} else
|
|
101
|
+
f.value = [], p.value = [], J(), K();
|
|
102
|
+
}
|
|
103
|
+
xe(() => {
|
|
104
|
+
document.getElementById(`relation_circle_${k.value}`).removeEventListener("click", H), b.value && b.value.disconnect();
|
|
105
|
+
});
|
|
106
|
+
function H(e) {
|
|
107
|
+
const r = e.target;
|
|
108
|
+
r && Array.from(r.classList).includes("vue-ui-user-options") || r && Array.from(r.classList).includes("vue-ui-user-options-summary") || r && Array.from(r.classList).includes("vue-data-ui-button") || r && Array.from(r.classList).includes("vue-ui-relation-circle-legend") || (i.value = {}, v.value = []);
|
|
109
|
+
}
|
|
110
|
+
function J() {
|
|
111
|
+
const e = 6.28319 / E.value.length, r = 360 / E.value.length;
|
|
112
|
+
let t = 0, a = 0;
|
|
113
|
+
E.value.forEach(($, N) => {
|
|
114
|
+
const _e = g.value * Math.cos(t) + o.value.width / 2, $e = g.value * Math.sin(t) + o.value.height / 2 + l.value.style.circle.offsetY;
|
|
115
|
+
f.value.push({ x: _e, y: $e, ...$, color: $.color ? $.color : Y.value[N] ? Y.value[N] : le[N], regAngle: a }), t += e, a += r;
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
function K() {
|
|
119
|
+
f.value.forEach((e) => {
|
|
120
|
+
f.value.filter((t) => t.relations.includes(e.id)).forEach((t, a) => {
|
|
121
|
+
p.value.push({
|
|
122
|
+
weight: e.weights && e.weights[a] ? e.weights[a] : 1,
|
|
123
|
+
relationId: `${e.id}_${t.id}`,
|
|
124
|
+
x1: e.x,
|
|
125
|
+
y1: e.y,
|
|
126
|
+
x2: t.x,
|
|
127
|
+
y2: t.y,
|
|
128
|
+
colorSource: e.color,
|
|
129
|
+
colorTarget: t.color,
|
|
130
|
+
...e
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
const fe = c(() => Math.max(...p.value.map((e) => e.weight)));
|
|
136
|
+
function ge(e) {
|
|
137
|
+
return Object.hasOwn(i.value, "x") ? v.value.includes(e.id) ? "opacity:1" : "opacity:0.1" : "opacity:1";
|
|
138
|
+
}
|
|
139
|
+
function Q(e) {
|
|
140
|
+
return Object.hasOwn(i.value, "x") ? e.colorTarget : e.colorSource;
|
|
141
|
+
}
|
|
142
|
+
function Z(e) {
|
|
143
|
+
return Object.hasOwn(i.value, "x") ? v.value.includes(e.id) && e.relationId === `${e.id}_${i.value.id}` || e.relationId === `${i.value.id}_${e.id}` ? `opacity:1;stroke-width:${te(e)}` : "opacity: 0" : "opacity: 1";
|
|
144
|
+
}
|
|
145
|
+
function ye(e) {
|
|
146
|
+
return e.regAngle > 90 && e.regAngle < 270 ? "end" : "start";
|
|
147
|
+
}
|
|
148
|
+
function he(e) {
|
|
149
|
+
return e.regAngle > 90 && e.regAngle < 270 ? e.x - 5 : e.x + 5;
|
|
150
|
+
}
|
|
151
|
+
function me(e) {
|
|
152
|
+
return Object.hasOwn(i.value, "x") ? i.value.id === e.id || v.value.includes(e.id) ? "opacity:1" : "opacity:0.2" : "opacity:1";
|
|
153
|
+
}
|
|
154
|
+
function pe(e) {
|
|
155
|
+
return e.regAngle > 90 && e.regAngle < 270 ? `rotate(${e.regAngle + 180},${e.x},${e.y})` : `rotate(${e.regAngle},${e.x},${e.y})`;
|
|
156
|
+
}
|
|
157
|
+
function ee(e) {
|
|
158
|
+
oe.value = 360 - e.regAngle, i.value.id && e.id === i.value.id ? (i.value = {}, v.value = []) : (i.value = e, v.value = [...e.relations]);
|
|
159
|
+
}
|
|
160
|
+
function te(e) {
|
|
161
|
+
return e.weight / fe.value * l.value.style.links.maxWidth;
|
|
162
|
+
}
|
|
163
|
+
const w = s(!1);
|
|
164
|
+
function ke(e) {
|
|
165
|
+
w.value = e, M.value += 1;
|
|
166
|
+
}
|
|
167
|
+
const x = s(!1);
|
|
168
|
+
function L() {
|
|
169
|
+
x.value = !x.value;
|
|
170
|
+
}
|
|
171
|
+
return se({
|
|
172
|
+
generatePdf: W,
|
|
173
|
+
generateImage: X,
|
|
174
|
+
toggleAnnotator: L
|
|
175
|
+
}), (e, r) => (n(), u("div", {
|
|
176
|
+
ref_key: "relationCircleChart",
|
|
177
|
+
ref: _,
|
|
178
|
+
class: "vue-ui-relation-circle",
|
|
179
|
+
style: C(`width:100%;background:${l.value.style.backgroundColor};text-align:center;${l.value.responsive ? "height: 100%" : ""}`),
|
|
180
|
+
id: `relation_circle_${k.value}`
|
|
181
|
+
}, [
|
|
182
|
+
l.value.userOptions.buttons.annotator ? (n(), A(We, {
|
|
183
|
+
key: 0,
|
|
184
|
+
parent: _.value,
|
|
185
|
+
backgroundColor: l.value.style.backgroundColor,
|
|
186
|
+
color: l.value.style.color,
|
|
187
|
+
active: x.value,
|
|
188
|
+
onClose: L
|
|
189
|
+
}, null, 8, ["parent", "backgroundColor", "color", "active"])) : y("", !0),
|
|
190
|
+
l.value.style.title.text ? (n(), u("div", {
|
|
191
|
+
key: 1,
|
|
192
|
+
ref_key: "chartTitle",
|
|
193
|
+
ref: j,
|
|
194
|
+
style: "width:100%;background:transparent"
|
|
195
|
+
}, [
|
|
196
|
+
(n(), A(Be, {
|
|
197
|
+
key: `title_${G.value}`,
|
|
198
|
+
config: {
|
|
199
|
+
title: {
|
|
200
|
+
cy: "relation-div-title",
|
|
201
|
+
...l.value.style.title
|
|
202
|
+
},
|
|
203
|
+
subtitle: {
|
|
204
|
+
cy: "relation-div-subtitle",
|
|
205
|
+
...l.value.style.title.subtitle
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}, null, 8, ["config"]))
|
|
209
|
+
], 512)) : y("", !0),
|
|
210
|
+
l.value.userOptions.show && F.value ? (n(), A(Ue, {
|
|
211
|
+
ref: "details",
|
|
212
|
+
key: `user_options_${M.value}`,
|
|
213
|
+
backgroundColor: l.value.style.backgroundColor,
|
|
214
|
+
color: l.value.style.color,
|
|
215
|
+
isPrinting: h(D),
|
|
216
|
+
isImaging: h(V),
|
|
217
|
+
uid: k.value,
|
|
218
|
+
hasPdf: l.value.userOptions.buttons.pdf,
|
|
219
|
+
hasImg: l.value.userOptions.buttons.img,
|
|
220
|
+
hasFullscreen: l.value.userOptions.buttons.img,
|
|
221
|
+
hasXls: !1,
|
|
222
|
+
isFullscreen: w.value,
|
|
223
|
+
titles: { ...l.value.userOptions.buttonTitles },
|
|
224
|
+
chartElement: _.value,
|
|
225
|
+
position: l.value.userOptions.position,
|
|
226
|
+
hasAnnotator: l.value.userOptions.buttons.annotator,
|
|
227
|
+
isAnnotation: x.value,
|
|
228
|
+
onToggleFullscreen: ke,
|
|
229
|
+
onGeneratePdf: h(W),
|
|
230
|
+
onGenerateImage: h(X),
|
|
231
|
+
onToggleAnnotator: L
|
|
232
|
+
}, Ae({ _: 2 }, [
|
|
233
|
+
e.$slots.optionPdf ? {
|
|
234
|
+
name: "optionPdf",
|
|
235
|
+
fn: O(() => [
|
|
236
|
+
m(e.$slots, "optionPdf", {}, void 0, !0)
|
|
237
|
+
]),
|
|
238
|
+
key: "0"
|
|
239
|
+
} : void 0,
|
|
240
|
+
e.$slots.optionImg ? {
|
|
241
|
+
name: "optionImg",
|
|
242
|
+
fn: O(() => [
|
|
243
|
+
m(e.$slots, "optionImg", {}, void 0, !0)
|
|
244
|
+
]),
|
|
245
|
+
key: "1"
|
|
246
|
+
} : void 0,
|
|
247
|
+
e.$slots.optionFullscreen ? {
|
|
248
|
+
name: "optionFullscreen",
|
|
249
|
+
fn: O(({ toggleFullscreen: t, isFullscreen: a }) => [
|
|
250
|
+
m(e.$slots, "optionFullscreen", S(T({ toggleFullscreen: t, isFullscreen: a })), void 0, !0)
|
|
251
|
+
]),
|
|
252
|
+
key: "2"
|
|
253
|
+
} : void 0,
|
|
254
|
+
e.$slots.optionAnnotator ? {
|
|
255
|
+
name: "optionAnnotator",
|
|
256
|
+
fn: O(({ toggleAnnotator: t, isAnnotator: a }) => [
|
|
257
|
+
m(e.$slots, "optionAnnotator", S(T({ toggleAnnotator: t, isAnnotator: a })), void 0, !0)
|
|
258
|
+
]),
|
|
259
|
+
key: "3"
|
|
260
|
+
} : void 0
|
|
261
|
+
]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasPdf", "hasImg", "hasFullscreen", "isFullscreen", "titles", "chartElement", "position", "hasAnnotator", "isAnnotation", "onGeneratePdf", "onGenerateImage"])) : y("", !0),
|
|
262
|
+
F.value ? (n(), u("svg", {
|
|
263
|
+
key: 3,
|
|
264
|
+
xmlns: h(Re),
|
|
265
|
+
class: R([{ "vue-data-ui-fullscreen--on": w.value, "vue-data-ui-fulscreen--off": !w.value }, "relation-circle"]),
|
|
266
|
+
viewBox: `0 0 ${o.value.width <= 0 ? 10 : o.value.width} ${o.value.height <= 0 ? 10 : o.value.height}`,
|
|
267
|
+
width: "100%",
|
|
268
|
+
style: "user-select:none; background:transparent"
|
|
269
|
+
}, [
|
|
270
|
+
Oe(Ve),
|
|
271
|
+
Pe("circle", {
|
|
272
|
+
cx: (o.value.width <= 0 ? 1e-4 : o.value.width) / 2,
|
|
273
|
+
cy: (o.value.height <= 0 ? 1e-4 : o.value.height) / 2 + l.value.style.circle.offsetY,
|
|
274
|
+
r: g.value <= 0 ? 1e-4 : g.value,
|
|
275
|
+
stroke: l.value.style.circle.stroke,
|
|
276
|
+
"stroke-width": l.value.style.circle.strokeWidth,
|
|
277
|
+
fill: "transparent",
|
|
278
|
+
class: "main-circle"
|
|
279
|
+
}, null, 8, He),
|
|
280
|
+
ue.value ? (n(), u("g", Je, [
|
|
281
|
+
(n(!0), u(P, null, I(p.value, (t, a) => (n(), u("path", {
|
|
282
|
+
key: `relation_${a}`,
|
|
283
|
+
style: C(Z(t)),
|
|
284
|
+
stroke: Q(t),
|
|
285
|
+
class: R(["relation", { "vue-ui-relation-circle-selected": i.value.hasOwnProperty("id") && v.value.includes(t.id) }]),
|
|
286
|
+
d: `M${t.x1},${t.y1} C${t.x1},${t.y1} ${o.value.width / 2},${o.value.height / 2 + l.value.style.circle.offsetY} ${t.x2},${t.y2}`,
|
|
287
|
+
fill: "none",
|
|
288
|
+
"stroke-width": te(t),
|
|
289
|
+
"stroke-linecap": "round"
|
|
290
|
+
}, null, 14, Ke))), 128))
|
|
291
|
+
])) : (n(), u("g", Qe, [
|
|
292
|
+
(n(!0), u(P, null, I(p.value, (t, a) => (n(), u("line", {
|
|
293
|
+
key: `relation_${a}`,
|
|
294
|
+
stroke: Q(t),
|
|
295
|
+
style: C(Z(t)),
|
|
296
|
+
x1: t.x1,
|
|
297
|
+
x2: t.x2,
|
|
298
|
+
y1: t.y1,
|
|
299
|
+
y2: t.y2,
|
|
300
|
+
class: R({ "vue-ui-relation-circle-selected": i.value.hasOwnProperty("id") && v.value.includes(t.id) }),
|
|
301
|
+
"stroke-linecap": "round"
|
|
302
|
+
}, null, 14, Ze))), 128))
|
|
303
|
+
])),
|
|
304
|
+
(n(!0), u(P, null, I(f.value, (t, a) => (n(), u("text", {
|
|
305
|
+
key: `plot_text_${a}`,
|
|
306
|
+
"text-anchor": ye(t),
|
|
307
|
+
transform: pe(t),
|
|
308
|
+
x: he(t),
|
|
309
|
+
y: t.y + 5,
|
|
310
|
+
onClick: ($) => ee(t),
|
|
311
|
+
class: "vue-ui-relation-circle-legend",
|
|
312
|
+
"transform-origin": "start",
|
|
313
|
+
"font-weight": i.value.id === t.id ? "900" : "400",
|
|
314
|
+
style: C(`font-family:${l.value.style.fontFamily};${me(t)}`),
|
|
315
|
+
"font-size": l.value.style.labels.fontSize,
|
|
316
|
+
fill: l.value.style.labels.color
|
|
317
|
+
}, Ie(t.label), 13, et))), 128)),
|
|
318
|
+
(n(!0), u(P, null, I(f.value, (t, a) => (n(), u("circle", {
|
|
319
|
+
cx: t.x,
|
|
320
|
+
cy: t.y,
|
|
321
|
+
key: `plot_${a}`,
|
|
322
|
+
style: C(ge(t)),
|
|
323
|
+
class: "vue-ui-relation-circle-plot",
|
|
324
|
+
fill: l.value.style.plot.color,
|
|
325
|
+
onClick: ($) => ee(t),
|
|
326
|
+
r: l.value.style.plot.radius
|
|
327
|
+
}, null, 12, tt))), 128)),
|
|
328
|
+
m(e.$slots, "svg", { svg: o.value }, void 0, !0)
|
|
329
|
+
], 10, qe)) : y("", !0),
|
|
330
|
+
e.$slots.watermark ? (n(), u("div", lt, [
|
|
331
|
+
m(e.$slots, "watermark", S(T({ isPrinting: h(D) || h(V) })), void 0, !0)
|
|
332
|
+
])) : y("", !0),
|
|
333
|
+
e.$slots.source ? (n(), u("div", {
|
|
334
|
+
key: 5,
|
|
335
|
+
ref_key: "source",
|
|
336
|
+
ref: B,
|
|
337
|
+
dir: "auto"
|
|
338
|
+
}, [
|
|
339
|
+
m(e.$slots, "source", {}, void 0, !0)
|
|
340
|
+
], 512)) : y("", !0),
|
|
341
|
+
F.value ? y("", !0) : (n(), A(De, {
|
|
342
|
+
key: 6,
|
|
343
|
+
config: {
|
|
344
|
+
type: "relationCircle",
|
|
345
|
+
style: {
|
|
346
|
+
backgroundColor: l.value.style.backgroundColor,
|
|
347
|
+
relationCircle: {
|
|
348
|
+
color: "#CCCCCC"
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
}, null, 8, ["config"]))
|
|
353
|
+
], 12, Ye));
|
|
354
|
+
}
|
|
355
|
+
}, gt = /* @__PURE__ */ Xe(nt, [["__scopeId", "data-v-3dcfe3a3"]]);
|
|
356
|
+
export {
|
|
357
|
+
gt as default
|
|
358
|
+
};
|