vue-data-ui 2.9.7-beta.0 → 2.9.7-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Arrow-IRx8mAUZ.js → Arrow-CqzHZi8Q.js} +1 -1
- package/dist/{Arrow-BU7SuiI0.cjs → Arrow-Dmv3DG1O.cjs} +1 -1
- package/dist/{BaseIcon-NVebWEmm.js → BaseIcon-Co2GD8iT.js} +1 -1
- package/dist/{BaseIcon-CN6BxTf_.cjs → BaseIcon-u4GDoMqC.cjs} +1 -1
- package/dist/{ColorPicker-D6INbuzz.js → ColorPicker-BCkyeJDN.js} +3 -3
- package/dist/{ColorPicker-DzF9vdB7.cjs → ColorPicker-TxdEJSJA.cjs} +1 -1
- package/dist/{DataTable-LLs37Na_.js → DataTable-B3skHSzt.js} +2 -2
- package/dist/{DataTable-Bc-sIk3H.cjs → DataTable-Pc2DuENx.cjs} +1 -1
- package/dist/{Legend-DbGQCXU-.cjs → Legend-D7ABxVCH.cjs} +1 -1
- package/dist/{Legend-Vkc-EKNB.js → Legend-DTJsfZrl.js} +2 -2
- package/dist/{PackageVersion-smHUcsQE.js → PackageVersion-BgDb-mVy.js} +3 -3
- package/dist/PackageVersion-cu45Cd7Q.cjs +1 -0
- package/dist/{PenAndPaper-30BhAniw.cjs → PenAndPaper-DsGKn0if.cjs} +1 -1
- package/dist/{PenAndPaper-k0VaawVj.js → PenAndPaper-DvnLOqKv.js} +3 -3
- package/dist/{Shape-Bfm8x-8P.js → Shape-C3dD_oLo.js} +1 -1
- package/dist/{Shape-PzPPg5iH.cjs → Shape-aAU_ZjZn.cjs} +1 -1
- package/dist/{Slicer-DhTMXF53.js → Slicer-CX9XuFH6.js} +2 -2
- package/dist/{Slicer-BU0fj2AI.cjs → Slicer-CvgJkIO1.cjs} +1 -1
- package/dist/{Title-58EtyYdb.cjs → Title-D7CSzIey.cjs} +1 -1
- package/dist/{Title-IOaA-ppU.js → Title-DHJyUsEV.js} +1 -1
- package/dist/{Tooltip-D8cBDDkn.js → Tooltip-BiDlRju4.js} +1 -1
- package/dist/{Tooltip-e9KUqiQA.cjs → Tooltip-gOeHT7nf.cjs} +1 -1
- package/dist/{dom-to-png-DWnOZNsr.js → dom-to-png-BTRzNtXu.js} +1 -1
- package/dist/{dom-to-png-CorDkTqE.cjs → dom-to-png-DAQ_l__k.cjs} +1 -1
- package/dist/{img-D3Du_oTb.cjs → img-BaTvkV_a.cjs} +1 -1
- package/dist/{img-DTb9GqRw.js → img-CzBF7u0N.js} +1 -1
- package/dist/{index-DwNTTJ28.js → index-DJL8Ofhe.js} +437 -421
- package/dist/index-DLbKJzFv.cjs +9 -0
- package/dist/{pdf-BcORych6.cjs → pdf-BlmUC6sI.cjs} +1 -1
- package/dist/{pdf-EYBy6RJJ.js → pdf-DhJ5pt15.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/types/vue-data-ui.d.cts +1 -0
- package/dist/types/vue-data-ui.d.ts +1 -0
- package/dist/{useNestedProp-BVy9-3EJ.cjs → useNestedProp-Dk1b2iP1.cjs} +1 -1
- package/dist/{useNestedProp-DLKXTEny.js → useNestedProp-nW23xHng.js} +1 -1
- package/dist/{usePrinter-CDE1F-XN.js → usePrinter-BB_LyyCt.js} +3 -3
- package/dist/{usePrinter-vjB2nrFW.cjs → usePrinter-ND-BQoMz.cjs} +1 -1
- package/dist/{vue-data-ui-Dxn5phSx.js → vue-data-ui-CgQH4LgG.js} +62 -62
- package/dist/{vue-data-ui-NKaL_RZ1.cjs → vue-data-ui-c3RnvmYN.cjs} +1 -1
- package/dist/vue-data-ui.cjs +1 -1
- package/dist/vue-data-ui.js +1 -1
- package/dist/{vue-ui-3d-bar-C6p9aV9v.cjs → vue-ui-3d-bar-CE8WiQxp.cjs} +1 -1
- package/dist/{vue-ui-3d-bar-CHHe_J_D.js → vue-ui-3d-bar-HpDKnl32.js} +9 -9
- package/dist/{vue-ui-accordion-BqCwiS7D.js → vue-ui-accordion-CFo12sAN.js} +3 -3
- package/dist/{vue-ui-accordion-CELgYjnV.cjs → vue-ui-accordion-CqH39_fY.cjs} +1 -1
- package/dist/{vue-ui-age-pyramid-S8hYFKDI.cjs → vue-ui-age-pyramid-BC9-B9yv.cjs} +1 -1
- package/dist/{vue-ui-age-pyramid-CeahoaHi.js → vue-ui-age-pyramid-CN-sq5YS.js} +10 -10
- package/dist/{vue-ui-annotator-BoOPk1NW.cjs → vue-ui-annotator-CthlwI9C.cjs} +1 -1
- package/dist/{vue-ui-annotator-Dt280Dbw.js → vue-ui-annotator-D0LfKtI0.js} +2 -2
- package/dist/{vue-ui-bullet-DoyResGB.js → vue-ui-bullet-CIs7dVYD.js} +8 -8
- package/dist/{vue-ui-bullet-C_ouoJoz.cjs → vue-ui-bullet-qFLSoZ7R.cjs} +1 -1
- package/dist/{vue-ui-candlestick-Ckb5JZAY.js → vue-ui-candlestick-CZXoNI5-.js} +11 -11
- package/dist/{vue-ui-candlestick-BSrwISIN.cjs → vue-ui-candlestick-D3itWQyS.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-pyTSfa3R.js → vue-ui-carousel-table-BJks-t0F.js} +4 -4
- package/dist/{vue-ui-carousel-table-BnfnugZ8.cjs → vue-ui-carousel-table-DR6mLDXS.cjs} +1 -1
- package/dist/{vue-ui-chestnut-DEmzGhAV.js → vue-ui-chestnut-DtwKoZVx.js} +8 -8
- package/dist/{vue-ui-chestnut-D2DRAw3Z.cjs → vue-ui-chestnut-vbMTupca.cjs} +1 -1
- package/dist/{vue-ui-circle-pack-D58AOk8y.cjs → vue-ui-circle-pack-CjQ2Y9gC.cjs} +1 -1
- package/dist/{vue-ui-circle-pack-W44HsVVY.js → vue-ui-circle-pack-bUeFMf5j.js} +9 -9
- package/dist/{vue-ui-cursor-Dnkh_phA.js → vue-ui-cursor-C0L8cauU.js} +2 -2
- package/dist/{vue-ui-cursor-D1ZEe_2B.cjs → vue-ui-cursor-CdGDHOul.cjs} +1 -1
- package/dist/{vue-ui-dashboard-mDnIJx3M.js → vue-ui-dashboard-8vtjWsF-.js} +62 -62
- package/dist/{vue-ui-dashboard-BbcppsFn.cjs → vue-ui-dashboard-IUEnZPy6.cjs} +1 -1
- package/dist/{vue-ui-digits-C_za0nmt.cjs → vue-ui-digits-C8DYjCtf.cjs} +1 -1
- package/dist/{vue-ui-digits-Dr3tklAr.js → vue-ui-digits-DJbK1Zc6.js} +2 -2
- package/dist/{vue-ui-donut-CxCNCSyO.cjs → vue-ui-donut-AYQgS2Mc.cjs} +1 -1
- package/dist/{vue-ui-donut-CRBp5BFP.js → vue-ui-donut-BYzTJfDn.js} +12 -12
- package/dist/{vue-ui-donut-evolution-abrnOe55.js → vue-ui-donut-evolution-BrGPzJc1.js} +11 -11
- package/dist/{vue-ui-donut-evolution-D4s8zLwf.cjs → vue-ui-donut-evolution-OPRjDSk0.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-BDinWM7R.cjs → vue-ui-dumbbell-BGE-Vtn-.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-Bj_SUn-j.js → vue-ui-dumbbell-Df1Urqjs.js} +10 -10
- package/dist/{vue-ui-flow-DCQVOrgy.cjs → vue-ui-flow-CiB4nD91.cjs} +1 -1
- package/dist/{vue-ui-flow-CtAP5n05.js → vue-ui-flow-MlzqqBrd.js} +9 -9
- package/dist/{vue-ui-funnel-0TWVP6z9.cjs → vue-ui-funnel-Bhklhpio.cjs} +1 -1
- package/dist/{vue-ui-funnel-DymsYFW0.js → vue-ui-funnel-DTdKm16w.js} +9 -9
- package/dist/{vue-ui-galaxy-Dn-E22Sq.js → vue-ui-galaxy-DOUHqcDm.js} +11 -11
- package/dist/{vue-ui-galaxy-DoJcvc2z.cjs → vue-ui-galaxy-P9p_cDXv.cjs} +1 -1
- package/dist/{vue-ui-gauge-DqbsP-05.js → vue-ui-gauge-BbI8A7r2.js} +7 -7
- package/dist/{vue-ui-gauge-BPOh-LHr.cjs → vue-ui-gauge-Df-gHwfR.cjs} +1 -1
- package/dist/{vue-ui-gizmo-CW9LAAdu.cjs → vue-ui-gizmo-B114Z8rm.cjs} +1 -1
- package/dist/{vue-ui-gizmo-BohTVUAE.js → vue-ui-gizmo-CMG7lxqw.js} +3 -3
- package/dist/{vue-ui-heatmap-CYCOMJEp.cjs → vue-ui-heatmap-C6ImAtcX.cjs} +1 -1
- package/dist/{vue-ui-heatmap-1FWBcMxC.js → vue-ui-heatmap-gEpHCMS4.js} +10 -10
- package/dist/{vue-ui-history-plot-BUIqHRPg.cjs → vue-ui-history-plot-C4OvU51J.cjs} +1 -1
- package/dist/{vue-ui-history-plot-CSIf1_96.js → vue-ui-history-plot-DK23xnI5.js} +11 -11
- package/dist/{vue-ui-kpi-Cf6eEcYm.cjs → vue-ui-kpi-CIl0Doue.cjs} +1 -1
- package/dist/{vue-ui-kpi-BrhY5fFX.js → vue-ui-kpi-rNIvGzIt.js} +3 -3
- package/dist/{vue-ui-mini-loader-CgkVj3jx.js → vue-ui-mini-loader-BbgEf7vG.js} +2 -2
- package/dist/{vue-ui-mini-loader-CURulq-0.cjs → vue-ui-mini-loader-Dvs2ojcn.cjs} +1 -1
- package/dist/{vue-ui-molecule-DBlY5wdo.cjs → vue-ui-molecule-BhC-Mwbx.cjs} +1 -1
- package/dist/{vue-ui-molecule-Bd-W2FcU.js → vue-ui-molecule-CesW7xLf.js} +11 -11
- package/dist/{vue-ui-mood-radar-Bzl98p3C.js → vue-ui-mood-radar-CAzWMx5r.js} +11 -11
- package/dist/{vue-ui-mood-radar-D9yvKEMp.cjs → vue-ui-mood-radar-DrE2J_Yc.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts-BZ5JA8Q0.cjs → vue-ui-nested-donuts-Bz9iokWt.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts-DyTI4ydr.js → vue-ui-nested-donuts-uxgCIhIq.js} +11 -11
- package/dist/{vue-ui-onion-DLm1PYJW.cjs → vue-ui-onion-B7RD5guS.cjs} +1 -1
- package/dist/{vue-ui-onion-ueQgXseI.js → vue-ui-onion-LcWmxpSV.js} +11 -11
- package/dist/{vue-ui-parallel-coordinate-plot-C2IpU_Zn.cjs → vue-ui-parallel-coordinate-plot-BDco3R-T.cjs} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-CE7Apuxp.js → vue-ui-parallel-coordinate-plot-BhAk5SsH.js} +12 -12
- package/dist/{vue-ui-quadrant-R1yAxzva.cjs → vue-ui-quadrant-BShHcqi4.cjs} +1 -1
- package/dist/{vue-ui-quadrant-CjLaANbC.js → vue-ui-quadrant-DnOiPnEZ.js} +12 -12
- package/dist/{vue-ui-quick-chart-BdqHueUa.cjs → vue-ui-quick-chart-1Rb8Gdxh.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-CVDLl6ro.js → vue-ui-quick-chart-BiuwgTza.js} +9 -9
- package/dist/{vue-ui-radar-CoJY69Qe.js → vue-ui-radar-B44Cnogk.js} +12 -12
- package/dist/{vue-ui-radar-B6u_29cN.cjs → vue-ui-radar-Cu9lFbgi.cjs} +1 -1
- package/dist/{vue-ui-rating-inneqZuS.cjs → vue-ui-rating-BNLwAuiQ.cjs} +1 -1
- package/dist/{vue-ui-rating-tqvCl4qR.js → vue-ui-rating-HcMLaCbL.js} +2 -2
- package/dist/{vue-ui-relation-circle-D_eh1BEp.cjs → vue-ui-relation-circle-Cd_cW1qY.cjs} +1 -1
- package/dist/{vue-ui-relation-circle-B_2RZE3S.js → vue-ui-relation-circle-D3hnErJq.js} +7 -7
- package/dist/vue-ui-ridgeline-CgqC0n4D.cjs +1 -0
- package/dist/{vue-ui-ridgeline-BZqkRymO.js → vue-ui-ridgeline-D5JbWdEM.js} +383 -347
- package/dist/{vue-ui-rings-5cvD-A8P.js → vue-ui-rings-D-aQntRc.js} +12 -12
- package/dist/{vue-ui-rings-CDBPSu7C.cjs → vue-ui-rings-DPxshbGw.cjs} +1 -1
- package/dist/{vue-ui-scatter-DSd4R2Yi.cjs → vue-ui-scatter-CuCMFwJg.cjs} +1 -1
- package/dist/{vue-ui-scatter-D6gIKljC.js → vue-ui-scatter-br228rFX.js} +12 -12
- package/dist/{vue-ui-skeleton-ovmMp5bh.cjs → vue-ui-skeleton-CMaSSD6o.cjs} +1 -1
- package/dist/{vue-ui-skeleton-kS_CJIiv.js → vue-ui-skeleton-D7wiUDgm.js} +3 -3
- package/dist/{vue-ui-smiley-DzoxVoms.js → vue-ui-smiley-DVo_0MHj.js} +2 -2
- package/dist/{vue-ui-smiley-DJnJpvqE.cjs → vue-ui-smiley-kyFpW_kA.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-oIWCpuK4.js → vue-ui-spark-trend-D_ModK3j.js} +5 -5
- package/dist/{vue-ui-spark-trend-CFS3QbYY.cjs → vue-ui-spark-trend-aTK-J8aC.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-zp12sOeT.js → vue-ui-sparkbar-D7Vsnq63.js} +4 -4
- package/dist/{vue-ui-sparkbar-CcF0AVSW.cjs → vue-ui-sparkbar-DiDgX0gr.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-DTflH_xZ.cjs → vue-ui-sparkgauge-DJm_Nvcx.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-Ch5sucF4.js → vue-ui-sparkgauge-DRA3dpfC.js} +4 -4
- package/dist/{vue-ui-sparkhistogram-BkTOZLzM.js → vue-ui-sparkhistogram-B7U0t5tO.js} +5 -5
- package/dist/{vue-ui-sparkhistogram-DZt0HNIE.cjs → vue-ui-sparkhistogram-ClG0n9e6.cjs} +1 -1
- package/dist/{vue-ui-sparkline-CBSJXHQs.cjs → vue-ui-sparkline-D_e4klXq.cjs} +1 -1
- package/dist/{vue-ui-sparkline-C_xiHNZV.js → vue-ui-sparkline-Dcqe9RMU.js} +4 -4
- package/dist/{vue-ui-sparkstackbar-CflXoafD.cjs → vue-ui-sparkstackbar-ClZHR3KP.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-C_OFfnx-.js → vue-ui-sparkstackbar-DhVYMKpF.js} +5 -5
- package/dist/{vue-ui-stackbar-Bxk0RKI0.cjs → vue-ui-stackbar-DVW990H1.cjs} +1 -1
- package/dist/{vue-ui-stackbar-qXKMKlND.js → vue-ui-stackbar-DXyeVGTw.js} +13 -13
- package/dist/{vue-ui-strip-plot-CXQN3ICY.cjs → vue-ui-strip-plot-BlT2QZb4.cjs} +1 -1
- package/dist/{vue-ui-strip-plot-C0JI5Ypz.js → vue-ui-strip-plot-CHPFuwaa.js} +11 -11
- package/dist/{vue-ui-table-DyFNHVoi.js → vue-ui-table-BU_RX8eF.js} +3 -3
- package/dist/{vue-ui-table-Cl3Li8f9.cjs → vue-ui-table-DY1LtXlo.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-BcCULm0Y.js → vue-ui-table-heatmap--MfqVTuk.js} +4 -4
- package/dist/{vue-ui-table-heatmap-DGLCYPo5.cjs → vue-ui-table-heatmap-BQ6f7H8R.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline-B-dNVmMr.js → vue-ui-table-sparkline-AnQprRCq.js} +5 -5
- package/dist/{vue-ui-table-sparkline-BgkRYmur.cjs → vue-ui-table-sparkline-B80CgEgL.cjs} +1 -1
- package/dist/{vue-ui-thermometer-BCH7KJhP.cjs → vue-ui-thermometer-B6JxCWyh.cjs} +1 -1
- package/dist/{vue-ui-thermometer-Cuw5r53c.js → vue-ui-thermometer-DEcbD5Vl.js} +7 -7
- package/dist/{vue-ui-timer-CyopDf_K.cjs → vue-ui-timer-CW8OvzpT.cjs} +1 -1
- package/dist/{vue-ui-timer-DdGJsPoJ.js → vue-ui-timer-sF5kCLeW.js} +5 -5
- package/dist/{vue-ui-tiremarks-BPxnwI8b.js → vue-ui-tiremarks-CjrIF2Mk.js} +7 -7
- package/dist/{vue-ui-tiremarks-C8AqJweQ.cjs → vue-ui-tiremarks-dm0DjTho.cjs} +1 -1
- package/dist/{vue-ui-treemap-CeuVNdos.js → vue-ui-treemap-Bxg0U82X.js} +12 -12
- package/dist/{vue-ui-treemap-BFu-MBkV.cjs → vue-ui-treemap-gHiNxWQX.cjs} +1 -1
- package/dist/{vue-ui-vertical-bar-CqE10O2F.cjs → vue-ui-vertical-bar-BY4Hs3yT.cjs} +1 -1
- package/dist/{vue-ui-vertical-bar-Ba6oWXzE.js → vue-ui-vertical-bar-Bj0TK9XT.js} +12 -12
- package/dist/{vue-ui-waffle-lMRTNFla.js → vue-ui-waffle-DPDYdYlN.js} +12 -12
- package/dist/{vue-ui-waffle-Dj664Zvg.cjs → vue-ui-waffle-GD5dIHI0.cjs} +1 -1
- package/dist/{vue-ui-wheel-aaqRzfsy.js → vue-ui-wheel-BpzWH2Ar.js} +7 -7
- package/dist/{vue-ui-wheel-BWMzvmcA.cjs → vue-ui-wheel-CMTdv2q8.cjs} +1 -1
- package/dist/{vue-ui-word-cloud-Z7WvU8XI.cjs → vue-ui-word-cloud-DzFQGIIN.cjs} +1 -1
- package/dist/{vue-ui-word-cloud-D2UL2Oye.js → vue-ui-word-cloud-ajv3G3Ci.js} +10 -10
- package/dist/{vue-ui-world-B61PIrw8.js → vue-ui-world-CQ0SuEaE.js} +11 -11
- package/dist/{vue-ui-world-JoZxd7Uu.cjs → vue-ui-world-Cwsb-iTP.cjs} +1 -1
- package/dist/{vue-ui-xy-F8eArZNJ.js → vue-ui-xy-N35O_x2x.js} +16 -16
- package/dist/{vue-ui-xy-canvas-BlQyx-BL.js → vue-ui-xy-canvas-C9PGQ5GZ.js} +12 -12
- package/dist/{vue-ui-xy-canvas-Qb5pkWBq.cjs → vue-ui-xy-canvas-CRTd0LAN.cjs} +1 -1
- package/dist/{vue-ui-xy-Bil87p79.cjs → vue-ui-xy-eSIDt2oX.cjs} +2 -2
- package/package.json +1 -1
- package/dist/PackageVersion-nHr3qHGs.cjs +0 -1
- package/dist/index-BqL3-yPQ.cjs +0 -9
- package/dist/vue-ui-ridgeline-BN4YoLPn.cjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-BqL3-yPQ.cjs"),F=require("./useNestedProp-BVy9-3EJ.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-DLbKJzFv.cjs"),F=require("./useNestedProp-Dk1b2iP1.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,6 +1,6 @@
|
|
|
1
1
|
import { ref as $, useSlots as J, onMounted as R, computed as x, watch as Q, createElementBlock as o, openBlock as a, normalizeStyle as s, createCommentVNode as p, createElementVNode as r, toDisplayString as f, unref as n, Fragment as B, renderList as Z, renderSlot as j, mergeProps as O, withKeys as ee } from "vue";
|
|
2
|
-
import { u as te, c as le, o as oe, e as ae, i as b, f as _, X as z, w as X, W as I } from "./index-
|
|
3
|
-
import { u as ie } from "./useNestedProp-
|
|
2
|
+
import { u as te, c as le, o as oe, e as ae, i as b, f as _, X as z, w as X, W as I } from "./index-DJL8Ofhe.js";
|
|
3
|
+
import { u as ie } from "./useNestedProp-nW23xHng.js";
|
|
4
4
|
import { _ as se } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
5
|
const ne = {
|
|
6
6
|
key: 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-BqL3-yPQ.cjs"),ee=require("./useResponsive-DQmBAoBf.cjs"),Be=require("./Title-58EtyYdb.cjs"),te=require("./usePrinter-vjB2nrFW.cjs"),$e=require("./vue-ui-skeleton-ovmMp5bh.cjs"),le=require("./useNestedProp-BVy9-3EJ.cjs"),_e=require("./PackageVersion-nHr3qHGs.cjs"),Pe=require("./PenAndPaper-30BhAniw.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-DLbKJzFv.cjs"),ee=require("./useResponsive-DQmBAoBf.cjs"),Be=require("./Title-D7CSzIey.cjs"),te=require("./usePrinter-ND-BQoMz.cjs"),$e=require("./vue-ui-skeleton-CMaSSD6o.cjs"),le=require("./useNestedProp-Dk1b2iP1.cjs"),_e=require("./PackageVersion-cu45Cd7Q.cjs"),Pe=require("./PenAndPaper-DsGKn0if.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-DJL8Ofhe.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-DHJyUsEV.js";
|
|
5
|
+
import { u as rt, U as ut } from "./usePrinter-BB_LyyCt.js";
|
|
6
|
+
import ot from "./vue-ui-skeleton-D7wiUDgm.js";
|
|
7
|
+
import { u as xe } from "./useNestedProp-nW23xHng.js";
|
|
8
|
+
import { _ as ct } from "./PackageVersion-BgDb-mVy.js";
|
|
9
|
+
import { _ as dt } from "./PenAndPaper-DvnLOqKv.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";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-DLbKJzFv.cjs"),We=require("./useUserOptionState-BgepsfED.cjs"),Ue=require("./useChartAccessibility-Cm7nkzTG.cjs"),be=require("./usePrinter-ND-BQoMz.cjs"),we=require("./useResponsive-DQmBAoBf.cjs"),Ce=require("./useNestedProp-Dk1b2iP1.cjs"),Ye=require("./vue-ui-accordion-CqH39_fY.cjs"),je=require("./BaseIcon-u4GDoMqC.cjs"),Be=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Ge=require("./DataTable-Pc2DuENx.cjs"),Je=require("./Legend-D7ABxVCH.cjs"),Ke=require("./PenAndPaper-DsGKn0if.cjs"),Qe=require("./Shape-aAU_ZjZn.cjs"),Ze=require("./vue-ui-skeleton-CMaSSD6o.cjs"),et=require("./Title-D7CSzIey.cjs"),tt=require("./vue-ui-xy-eSIDt2oX.cjs"),lt=["xmlns"],ot={class:"modal-title"},at={class:"modal-body"},rt={__name:"BaseDraggableDialog",props:{backgroundColor:{type:String},color:{type:String},headerBg:{type:String},headerColor:{type:String}},emits:["close"],setup(S,{expose:Q,emit:Z}){e.useCssVars(i=>({19616867:S.color}));const ee=S,p=Z,b=e.ref(!1),M=e.ref(!1),a=e.reactive({left:window.innerWidth/2-200,top:window.innerHeight/2-120,width:400,height:400,dragging:!1,resizing:!1,dragOffsetX:0,dragOffsetY:0,pointerStartX:0,pointerStartY:0,resizeStartW:0,resizeStartH:0});function U(){b.value=!0,e.nextTick(()=>{M.value||(a.left=Math.max(0,window.innerWidth/2-a.width/2),a.top=Math.max(0,window.innerHeight/2-a.height/2),M.value=!0)})}function P(){b.value=!1,p("close")}Q({open:U,close:P});const _=e.computed(()=>({position:"fixed",left:`${a.left}px`,top:`${a.top}px`,width:`${a.width}px`,height:`${a.height}px`,padding:0,border:"none",background:ee.backgroundColor,boxShadow:"0 4px 24px rgba(0,0,0,0.15)",zIndex:9999,overflow:"visible",borderRadius:"2px"}));function w(i){return i.touches&&i.touches.length?{x:i.touches[0].clientX,y:i.touches[0].clientY}:{x:i.clientX,y:i.clientY}}function O(i){var v;(v=i.preventDefault)==null||v.call(i),a.dragging=!0;const d=w(i);a.dragOffsetX=d.x-a.left,a.dragOffsetY=d.y-a.top,document.addEventListener("mousemove",$),document.addEventListener("mouseup",A),document.addEventListener("touchmove",$,{passive:!1}),document.addEventListener("touchend",A)}function $(i){var m;if(!a.dragging)return;(m=i.preventDefault)==null||m.call(i);const d=w(i);let v=d.x-a.dragOffsetX,t=d.y-a.dragOffsetY;v=Math.max(0,Math.min(v,window.innerWidth-a.width)),t=Math.max(0,Math.min(t,window.innerHeight-a.height)),a.left=v,a.top=t}function A(){a.dragging=!1,document.removeEventListener("mousemove",$),document.removeEventListener("mouseup",A),document.removeEventListener("touchmove",$),document.removeEventListener("touchend",A)}function D(i){var v;(v=i.preventDefault)==null||v.call(i),a.resizing=!0;const d=w(i);a.pointerStartX=d.x,a.pointerStartY=d.y,a.resizeStartW=a.width,a.resizeStartH=a.height,document.addEventListener("mousemove",g),document.addEventListener("mouseup",B),document.addEventListener("touchmove",g,{passive:!1}),document.addEventListener("touchend",B)}function g(i){var m;if(!a.resizing)return;(m=i.preventDefault)==null||m.call(i);const d=w(i);let v=d.x-a.pointerStartX,t=d.y-a.pointerStartY;a.width=Math.max(240,a.resizeStartW+v),a.height=Math.max(400,a.resizeStartH+t)}function B(){a.resizing=!1,document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",B),document.removeEventListener("touchmove",g),document.removeEventListener("touchend",B)}function Y(i){var v;(v=i.preventDefault)==null||v.call(i),a.resizing=!0;const d=w(i);a.pointerStartX=d.x,a.pointerStartY=d.y,a.resizeStartW=a.width,a.resizeStartH=a.height,a.resizeStartLeft=a.left,a.resizeStartTop=a.top,document.addEventListener("mousemove",N),document.addEventListener("mouseup",h),document.addEventListener("touchmove",N,{passive:!1}),document.addEventListener("touchend",h)}function N(i){var X;if(!a.resizing)return;(X=i.preventDefault)==null||X.call(i);const d=w(i);let v=d.x-a.pointerStartX,t=Math.min(Math.max(0,a.resizeStartLeft+v),a.resizeStartLeft+a.resizeStartW-240),m=a.resizeStartW-(t-a.resizeStartLeft),F=d.y-a.pointerStartY,j=Math.max(400,a.resizeStartH+F);a.left=t,a.width=m,a.height=j}function h(){a.resizing=!1,document.removeEventListener("mousemove",N),document.removeEventListener("mouseup",h),document.removeEventListener("touchmove",N),document.removeEventListener("touchend",h)}return e.onUnmounted(()=>{A(),B(),h()}),(i,d)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[b.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"modal vue-ui-draggable-dialog",style:e.normalizeStyle(_.value),onClick:d[0]||(d[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"modal-header",style:e.normalizeStyle({backgroundColor:S.headerBg,color:S.headerColor})},[e.createElementVNode("span",{class:"drag-handle",onMousedown:e.withModifiers(O,["stop","prevent"]),onTouchstart:e.withModifiers(O,["stop","prevent"])},[(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(u.XMLNS),width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round"},d[1]||(d[1]=[e.createElementVNode("path",{d:"M5 9m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1),e.createElementVNode("path",{d:"M5 15m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1),e.createElementVNode("path",{d:"M12 9m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1),e.createElementVNode("path",{d:"M12 15m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1),e.createElementVNode("path",{d:"M19 9m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1),e.createElementVNode("path",{d:"M19 15m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1)]),8,lt))],32),e.createElementVNode("span",ot,[e.renderSlot(i.$slots,"title",{},void 0,!0)]),e.createElementVNode("button",{class:"close",onClick:P},[e.createVNode(je.default,{name:"close",stroke:S.headerColor},null,8,["stroke"])])],4),e.createElementVNode("div",at,[e.renderSlot(i.$slots,"default",{},void 0,!0)]),e.createElementVNode("div",{class:"resize-handle",onMousedown:e.withModifiers(D,["stop","prevent"]),onTouchstart:e.withModifiers(D,["stop","prevent"])},null,32),e.createElementVNode("div",{class:"resize-handle resize-handle-left",onMousedown:e.withModifiers(Y,["stop","prevent"]),onTouchstart:e.withModifiers(Y,["stop","prevent"])},null,32)],4)):e.createCommentVNode("",!0)]))}},nt=Be._export_sfc(rt,[["__scopeId","data-v-f854cee8"]]),st=["id"],it=["xmlns","viewBox"],ut=["id"],ct=["stop-color"],dt=["stop-color"],ht=["stop-color"],vt=["stop-color"],mt=["id"],ft=["stop-color"],pt=["stop-color"],gt=["stop-color"],yt=["stop-color"],kt={key:0},xt=["fill","d"],bt=["fill","stroke","stroke-width","d"],wt=["stroke","stroke-dasharray","stroke-width","d"],Ct=["x1","y1","x2","y2","stroke","stroke-width","stroke-dasharray"],Bt=["cx","cy","stroke","stroke-width","r","fill"],Et=["x","y","font-size","font-weight","fill","text-decoration","onMouseenter","onClick"],St={key:1},$t=["font-size","fill","font-weight","transform","text-anchor"],At=["x","y","width","height","onMouseenter","onClick"],Nt=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],zt=["cx","cy","stroke","stroke-width","r","fill"],Lt=["x","y","text-anchor","font-size","fill"],Mt={key:5,class:"vue-data-ui-watermark"},_t=["onClick"],Vt=["innerHTML"],Tt={__name:"vue-ui-ridgeline",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint","selectX"],setup(S,{expose:Q,emit:Z}){const{vue_ui_ridgeline:ee}=u.useConfig(),p=S,b=e.computed({get(){return!!p.dataset&&p.dataset.length},set(o){return o}}),M=Z,a=e.ref(null),U=e.ref(null),P=e.ref(null),_=e.ref(null),w=e.ref(null),O=e.ref(null),$=e.ref(0),A=e.ref(0),D=e.ref(0),g=e.ref(u.createUid()),B=e.ref(0),Y=e.ref(0),N=e.ref(512),h=e.ref(null),i=e.ref(null),d=e.ref(null);function v(){const o=Ce.useNestedProp({userConfig:p.config,defaultConfig:ee});return o.theme?{...Ce.useNestedProp({userConfig:u.themes.vue_ui_ridgeline[o.theme]||p.config,defaultConfig:o}),customPalette:u.themePalettes[o.theme]||u.palette}:o}const t=e.computed({get:()=>v(),set:o=>o}),m=e.ref(Math.min(t.value.style.chart.areas.height,t.value.style.chart.areas.rowHeight)),{userOptionsVisible:F,setUserOptionsVisibility:j,keepUserOptionState:X}=We.useUserOptionState({config:t.value}),{svgRef:te}=Ue.useChartAccessibility({config:t.value.style.chart.title});e.onMounted(le),e.onBeforeUnmount(()=>{_.value&&_.value.disconnect()});function le(){if(u.objectIsEmpty(p.dataset)?u.error({componentName:"VueUiRidgeline",type:"dataset"}):p.dataset.forEach((o,s)=>{u.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name","datapoints"]}).forEach(l=>{b.value=!1,u.error({componentName:"VueUiRidgeline",type:"datasetSerieAttribute",property:l,index:s})}),o.datapoints.length&&o.datapoints.forEach((l,n)=>{u.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(r=>{b.value=!1,u.error({componentName:"VueUiRidgeline",type:"datasetSerieAttribute",property:`datapoint.${r}`,index:`${s}-${n}`})})})}),Y.value=p.dataset.length,m.value=Math.min(t.value.style.chart.areas.height,t.value.style.chart.areas.rowHeight),t.value.responsive){const o=we.throttle(()=>{const{width:s,height:l}=we.useResponsive({chart:a.value,title:t.value.style.chart.title.text?U.value:null,legend:t.value.style.chart.legend.show?P.value:null,source:w.value,noTitle:O.value});requestAnimationFrame(()=>{N.value=s,m.value=l/p.dataset.length})});_.value=new ResizeObserver(o),_.value.observe(a.value.parentNode)}}const{isPrinting:ne,isImaging:se,generatePdf:ie,generateImage:ue}=be.usePrinter({elementId:`vue-ui-ridgeline_${g.value}`,fileName:t.value.style.chart.title.text||"vue-ui-ridgeline",options:t.value.userOptions.print}),Ee=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),Se=e.computed(()=>u.convertCustomPalette(t.value.customPalette)),I=e.ref({showTable:t.value.table.show});e.watch(()=>p.config,o=>{t.value=v(),F.value=!t.value.userOptions.showOnChartHover,le(),$.value+=1,D.value+=1,m.value=Math.min(t.value.style.chart.areas.height,t.value.style.chart.areas.rowHeight),I.value.showTable=t.value.table.show},{deep:!0}),e.watch(()=>p.dataset,le,{deep:!0});const oe=e.computed(()=>t.value.style.chart.areas.height/t.value.style.chart.areas.rowHeight);function ce(o){E.value.includes(o)?E.value=E.value.filter(s=>s!==o):E.value.push(o),M("selectLegend",T.value)}const C=e.computed(()=>b.value?p.dataset.map((o,s)=>({...o,labelLen:Ne(o.name,t.value.style.chart.yAxis.labels.fontSize),uid:u.createUid(),datapoints:o.datapoints.map((l,n)=>{const r=l.color?u.convertColorToHex(l.color):Se.value[n]||u.palette[n]||u.palette[n%u.palette.length],c=u.slugify(l.name);return{...l,color:r,id:c}})})):[]),de=e.computed(()=>t.value.style.chart.padding.top+m.value*p.dataset.length+m.value*oe.value),k=e.computed(()=>({fullHeight:f.value.padding.top+f.value.padding.bottom+f.value.height,top:f.value.padding.top,left:f.value.padding.left,right:f.value.width-f.value.padding.right,bottom:f.value.padding.top+f.value.height,width:f.value.width-(f.value.padding.left+f.value.padding.right)})),f=e.computed(()=>{const o=t.value.style.chart.padding;return{width:N.value,height:de.value,padding:o}}),V=e.computed(()=>{const o=Math.max(...C.value.map(c=>c.labelLen)),s=Math.max(...C.value.flatMap(c=>c.datapoints.map(x=>x.values.length))),l=f.value.padding.left+o+16+t.value.style.chart.yAxis.labels.offsetX,n=(k.value.width-l)/s,r=[];for(let c=0;c<s;c+=1)r.push({selectorX:l+n*c,x:l+n*c-n/2,y:k.value.top,label:t.value.style.chart.xAxis.labels.values[c]||"",index:c,width:n,height:de.value});return r});function $e(o){M("selectX",C.value.map(s=>s.datapoints.map(l=>({dp:l,selected:l.values[o.index]}))))}function Ae(o,s){return o.length*s/2+s}function he(o,s,l){const n=Ae(s,l);return o+n>k.value.right}function Ne(o,s,l="sans-serif"){const r=document.createElement("canvas").getContext("2d"),c=typeof s=="number"?`${s}px`:s;return r.font=`${c} ${l}`,r.measureText(o).width}const T=e.computed(()=>{m.value;const o=Math.max(...C.value.map(y=>y.labelLen)),s=Math.max(...C.value.flatMap(y=>y.datapoints.map(z=>z.values.length))),l=Math.max(...C.value.flatMap(y=>y.datapoints.flatMap(z=>z.values))),n=Math.min(...C.value.flatMap(y=>y.datapoints.flatMap(z=>z.values))),r=f.value.padding.left+o+16+t.value.style.chart.yAxis.labels.offsetX,c=(k.value.width-r)/s,x=Math.abs(Math.min(n,0)),ye=l+x;function ke(y){return isNaN(y/ye)?0:y/ye}return C.value.map((y,z)=>{const xe=k.value.top+m.value*z,L=k.value.top+xe+m.value*oe.value*(1-ke(x));return{...y,label:{x:r-t.value.style.chart.yAxis.labels.fontSize,y:L},datapoints:y.datapoints.map(R=>{const q=R.values.map((W,Xe)=>{const Ie=isNaN(W)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(W)?0:W||0,He=r+c*Xe,Re=k.value.top+xe+m.value*oe.value*(1-ke(Ie+x)),qe=W===Math.max(...R.values);return{x:He,y:Re,value:W,isMaxPoint:qe,zero:L}}),Oe=`${u.createSmoothAreaSegments(q,L,!1,!1)}`,De=`M ${r},${L} ${u.createStraightPath(q)} ${q.at(-1).x},${L}`,Fe=`M ${r},${L} ${q.at(-1).x},${L}`;return{...R,uid:u.createUid(),plots:q,smoothPath:Oe,straightPath:De,zeroPath:Fe}}).filter(R=>!E.value.includes(R.id))}})}),E=e.ref([]);function ze(o){const s=new Map;return o.forEach(l=>{l.datapoints.forEach((n,r)=>{const c=u.slugify(n.name);s.has(c)||s.set(c,{id:c,name:n.name,color:n.color,shape:"circle",segregate:()=>ce(c),isSegregated:E.value.includes(c),opacity:E.value.includes(c)?.5:1})})}),Array.from(s.values())}const G=e.computed(()=>ze(C.value)),Le=e.computed(()=>({cy:"donut-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),H=e.ref(!1);function Me(o){H.value=o,B.value+=1}const ve=e.ref({}),me=e.ref([]);function _e(o){M("selectDatapoint",o),t.value.style.chart.dialog.show&&(me.value=o.datapoints.map(s=>({name:s.name,color:s.color,type:"line",useArea:!0,smooth:t.value.style.chart.areas.smooth,series:s.values})),i.value=o,ve.value=u.deepEmptyObjectToNull({...t.value.style.chart.dialog.xyChart,responsive:!0,chart:{...t.value.style.chart.dialog.xyChart.chart,grid:{...t.value.style.chart.dialog.xyChart.chart.grid,labels:{...t.value.style.chart.dialog.xyChart.chart.grid.labels,xAxisLabels:{...t.value.style.chart.dialog.xyChart.chart.grid.labels.xAxisLabels,values:t.value.style.chart.xAxis.labels.values}}},tooltip:{...t.value.style.chart.dialog.xyChart.chart.tooltip,showTimeLabel:t.value.style.chart.xAxis.labels.values.length>0}}}),d.value&&d.value.open())}const ae=e.ref(null);function Ve(o){ae.value=o}function Te(){ae.value=null}const J=e.ref(!1);function re(){J.value=!J.value}function fe(){I.value.showTable=!I.value.showTable}const pe=e.computed(()=>({body:T.value.flatMap(l=>l.datapoints.flatMap(n=>({...n,rowName:`${l.name}: ${n.name}`}))).map(l=>[{name:l.rowName,color:l.color},...l.values])})),K=e.computed(()=>{const o=[t.value.table.columnNames.series,...t.value.style.chart.xAxis.labels.values],s={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,...t.value.style.chart.xAxis.labels.values],head:o,body:pe.value.body,config:s}});function ge(){e.nextTick(()=>{const o=[[t.value.table.columnNames.series,...t.value.style.chart.xAxis.labels.values.map(n=>[n])],...pe.value.body.map((n,r)=>[n[0].name,...n.slice(1)])],s=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text]].concat(o),l=u.createCsvContent(s);u.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-ridgeline"})})}function Pe(){return T.value}return Q({getData:Pe,generateImage:ue,generatePdf:ie,generateCsv:ge,toggleAnnotator:re,toggleTable:fe}),(o,s)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"ridgelineChart",ref:a,class:e.normalizeClass(`vue-ui-ridgeline ${H.value?"vue-data-ui-wrapper-fullscreen":""}`),id:`vue-ui-ridgeline_${g.value}`,style:e.normalizeStyle({fontFamily:t.value.style.fontFamily,width:"100%",textAlign:"center",background:t.value.style.chart.backgroundColor,height:t.value.responsive?"100%":void 0}),onMouseenter:s[4]||(s[4]=()=>e.unref(j)(!0)),onMouseleave:s[5]||(s[5]=()=>e.unref(j)(!1))},[t.value.userOptions.buttons.annotator&&e.unref(te)?(e.openBlock(),e.createBlock(Ke._sfc_main,{key:0,color:t.value.style.chart.color,backgroundColor:t.value.style.chart.backgroundColor,active:J.value,svgRef:e.unref(te),onClose:re},null,8,["color","backgroundColor","active","svgRef"])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"userConfig",{},void 0,!0),Ee.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:O,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:U,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(et._sfc_main,{key:`title_${$.value}`,config:{title:{cy:"ridgeline-div-title",...t.value.style.chart.title},subtitle:{cy:"ridgeline-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&b.value&&(e.unref(X)||e.unref(F))?(e.openBlock(),e.createBlock(be.UserOptions,{ref:"details",key:`user_option_${B.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(ne),isImaging:e.unref(se),uid:g.value,hasTooltip:!1,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasLabel:!1,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:H.value,chartElement:a.value,position:t.value.userOptions.position,isTooltip:!1,titles:{...t.value.userOptions.buttonTitles},hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:J.value,style:e.normalizeStyle({visibility:e.unref(X)?e.unref(F)?"visible":"hidden":"visible"}),onToggleFullscreen:Me,onGeneratePdf:e.unref(ie),onGenerateCsv:ge,onGenerateImage:e.unref(ue),onToggleTable:fe,onToggleAnnotator:re},e.createSlots({_:2},[o.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:l,color:n})=>[e.renderSlot(o.$slots,"menuIcon",e.normalizeProps(e.guardReactiveProps({isOpen:l,color:n})),void 0,!0)]),key:"0"}:void 0,o.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTooltip",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"4"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"5"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:n})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:n})),void 0,!0)]),key:"6"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:n})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:n})),void 0,!0)]),key:"7"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","chartElement","position","titles","hasAnnotator","isAnnotation","style","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("svg",{key:4,ref_key:"svgRef",ref:te,xmlns:e.unref(u.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":H.value,"vue-data-ui-fulscreen--off":!H.value}),viewBox:`0 0 ${f.value.width<=0?10:f.value.width} ${k.value.fullHeight<=0?10:k.value.fullHeight}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color};${t.value.responsive?"height: 100%; width: 100%;":""}`)},[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(G.value,(l,n)=>(e.openBlock(),e.createElementBlock("linearGradient",{id:`gradient-${l.id}-${g.value}`,x1:"50%",y1:"0%",x2:"50%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":l.color,"stop-opacity":"1"},null,8,ct),e.createElementVNode("stop",{offset:"30%","stop-color":l.color,"stop-opacity":"0.7"},null,8,dt),e.createElementVNode("stop",{offset:"70%","stop-color":l.color,"stop-opacity":"0.3"},null,8,ht),e.createElementVNode("stop",{offset:"100%","stop-color":l.color,"stop-opacity":"0.1"},null,8,vt)],8,ut))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(l,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.datapoints,(r,c)=>(e.openBlock(),e.createElementBlock("linearGradient",{key:`grad${r.id}`,id:`gradient-single-${g.value}-${r.uid}`,x1:"50%",y1:"0%",x2:"50%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":r.color,"stop-opacity":"1"},null,8,ft),e.createElementVNode("stop",{offset:"30%","stop-color":r.color,"stop-opacity":"0.7"},null,8,pt),e.createElementVNode("stop",{offset:"70%","stop-color":r.color,"stop-opacity":"0.3"},null,8,gt),e.createElementVNode("stop",{offset:"100%","stop-color":r.color,"stop-opacity":"0.1"},null,8,yt)],8,mt))),128))],64))),256))]),o.$slots.pattern?(e.openBlock(),e.createElementBlock("g",kt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(G.value,(l,n)=>(e.openBlock(),e.createElementBlock("defs",null,[e.renderSlot(o.$slots,"pattern",e.mergeProps({ref_for:!0},{variable:l,patternId:`pattern_${g.value}_${n}`}),void 0,!0)]))),256))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(l,n)=>(e.openBlock(),e.createElementBlock("g",{key:`ds-${n}`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.datapoints,(r,c)=>(e.openBlock(),e.createElementBlock("g",{key:r.id},[e.createElementVNode("path",{fill:t.value.style.chart.backgroundColor,stroke:"none","stroke-linecap":"round",d:t.value.style.chart.areas.smooth?r.smoothPath:r.straightPath,style:e.normalizeStyle({opacity:t.value.style.chart.areas.opacity})},null,12,xt),e.createElementVNode("path",{fill:t.value.style.chart.areas.useCommonColor?`url(#gradient-${r.id}-${g.value})`:`url(#gradient-single-${g.value}-${r.uid})`,stroke:t.value.style.chart.areas.stroke.useSerieColor?r.color:t.value.style.chart.areas.stroke.color,"stroke-width":t.value.style.chart.areas.strokeWidth,d:t.value.style.chart.areas.smooth?r.smoothPath:r.straightPath,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,bt),e.createElementVNode("path",{stroke:t.value.style.chart.zeroLine.useSerieColor?r.color:t.value.style.chart.zeroLine.stroke,"stroke-dasharray":t.value.style.chart.zeroLine.strokeDasharray,"stroke-width":t.value.style.chart.zeroLine.strokeWidth,d:r.zeroPath,"stroke-linecap":"round"},null,8,wt),t.value.style.chart.areas.maxPoint.show&&r.plots.length>1?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(r.plots,x=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[x.isMaxPoint?(e.openBlock(),e.createElementBlock("line",{key:0,x1:x.x,y1:x.y,x2:x.x,y2:x.zero,stroke:t.value.style.chart.areas.maxPoint.adaptStrokeToBackground?e.unref(u.adaptColorToBackground)(r.color):t.value.style.chart.areas.maxPoint.stroke,"stroke-width":t.value.style.chart.areas.maxPoint.strokeWidth,"stroke-linecap":"round","stroke-dasharray":t.value.style.chart.areas.maxPoint.strokeDasharray},null,8,Ct)):e.createCommentVNode("",!0)],64))),256)):e.createCommentVNode("",!0),r.plots.length===1?(e.openBlock(),e.createElementBlock("circle",{key:1,cx:r.plots[0].x,cy:r.plots[0].y,stroke:t.value.style.chart.selector.dot.stroke,"stroke-width":t.value.style.chart.selector.dot.strokeWidth,r:t.value.style.chart.selector.dot.radius,fill:t.value.style.chart.selector.dot.useDatapointColor?r.color:t.value.style.chart.selector.dot.fill,style:{pointerEvents:"none"}},null,8,Bt)):e.createCommentVNode("",!0)]))),128)),e.createElementVNode("text",{x:l.label.x,y:l.label.y,"text-anchor":"end","font-size":t.value.style.chart.yAxis.labels.fontSize,"font-weight":t.value.style.chart.yAxis.labels.bold?"bold":"normal",fill:t.value.style.chart.yAxis.labels.color,style:e.normalizeStyle({cursor:t.value.style.chart.dialog.show?"pointer":"default"}),"text-decoration":t.value.style.chart.dialog.show&&(ae.value===n||i.value&&l.uid===i.value.uid)?"underline":"",onMouseenter:r=>Ve(n),onMouseleave:Te,onClick:r=>_e(l)},e.toDisplayString(l.name),45,Et)]))),128)),t.value.style.chart.xAxis.labels.values.length?(e.openBlock(),e.createElementBlock("g",St,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.value,(l,n)=>e.renderSlot(o.$slots,"time-label",e.mergeProps({ref_for:!0},{show:l&&!t.value.style.chart.xAxis.labels.showOnlyFirstAndLast&&!t.value.style.chart.xAxis.labels.showOnlyAtModulo||l&&t.value.style.chart.xAxis.labels.showOnlyFirstAndLast&&(n===0||n===V.value.length-1)||l&&h.value&&h.value.index===n||l&&!t.value.style.chart.xAxis.labels.showOnlyFirstAndLast&&t.value.style.chart.xAxis.labels.showOnlyAtModulo&&n%Math.floor(V.value.length/t.value.style.chart.xAxis.labels.modulo)===0,fontSize:t.value.style.chart.xAxis.labels.fontSize,content:l.label,textAnchor:t.value.style.chart.xAxis.labels.rotation>0?"start":t.value.style.chart.xAxis.labels.rotation<0?"end":"middle",fill:t.value.style.chart.xAxis.labels.color,transform:`translate(${l.selectorX}, ${k.value.top+l.height+t.value.style.chart.xAxis.labels.offsetY}), rotate(${t.value.style.chart.xAxis.labels.rotation})`,x:l.selectorX,y:k.value.top+l.height+t.value.style.chart.xAxis.labels.offsetY}),()=>[l&&!t.value.style.chart.xAxis.labels.showOnlyFirstAndLast&&!t.value.style.chart.xAxis.labels.showOnlyAtModulo||l&&t.value.style.chart.xAxis.labels.showOnlyFirstAndLast&&(n===0||n===V.value.length-1)||l&&h.value&&h.value.index===n||l&&!t.value.style.chart.xAxis.labels.showOnlyFirstAndLast&&t.value.style.chart.xAxis.labels.showOnlyAtModulo&&n%Math.floor(V.value.length/t.value.style.chart.xAxis.labels.modulo)===0?(e.openBlock(),e.createElementBlock("text",{key:0,"font-size":t.value.style.chart.xAxis.labels.fontSize,fill:t.value.style.chart.xAxis.labels.color,"font-weight":t.value.style.chart.xAxis.labels.bold?"bold":"normal",transform:`translate(${l.selectorX}, ${k.value.top+l.height+t.value.style.chart.xAxis.labels.offsetY}), rotate(${t.value.style.chart.xAxis.labels.rotation})`,"text-anchor":t.value.style.chart.xAxis.labels.rotation>0?"start":t.value.style.chart.xAxis.labels.rotation<0?"end":"middle",style:e.normalizeStyle({opacity:h.value?h.value.index===n?1:.2:1})},e.toDisplayString(l.label),13,$t)):e.createCommentVNode("",!0)],!0)),256))])):e.createCommentVNode("",!0),e.createElementVNode("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.value,(l,n)=>(e.openBlock(),e.createElementBlock("rect",{x:l.x,y:l.y,width:l.width<0?.1:l.width,height:l.height<0?.1:l.height,fill:"transparent",onMouseenter:r=>h.value=l,onMouseleave:s[0]||(s[0]=r=>h.value=null),onClick:()=>$e(l)},null,40,At))),256)),t.value.style.chart.selector.show&&h.value?(e.openBlock(),e.createElementBlock("line",{key:0,x1:h.value.selectorX,x2:h.value.selectorX,y1:h.value.y,y2:h.value.y+h.value.height-m.value/2,stroke:t.value.style.chart.selector.stroke,"stroke-width":t.value.style.chart.selector.strokeWidth,"stroke-dasharray":t.value.style.chart.selector.strokeDasharray,"stroke-linecap":"round",style:{pointerEvents:"none"}},null,8,Nt)):e.createCommentVNode("",!0),h.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(T.value,l=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.datapoints,n=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.plots,(r,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[h.value&&h.value.index===c?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:r.x,cy:r.y,stroke:t.value.style.chart.selector.dot.stroke,"stroke-width":t.value.style.chart.selector.dot.strokeWidth,r:t.value.style.chart.selector.dot.radius,fill:t.value.style.chart.selector.dot.useDatapointColor?n.color:t.value.style.chart.selector.dot.fill,style:{pointerEvents:"none"}},null,8,zt)):e.createCommentVNode("",!0),h.value&&h.value.index===c?(e.openBlock(),e.createElementBlock("text",{key:1,x:he(r.x,e.unref(u.applyDataLabel)(t.value.style.chart.selector.labels.formatter,r.value,e.unref(u.dataLabel)({p:t.value.style.chart.xAxis.labels.prefix,v:r.value,s:t.value.style.chart.xAxis.labels.suffix,r:t.value.style.chart.selector.labels.rounding})),t.value.style.chart.selector.labels.fontSize)?r.x-t.value.style.chart.selector.labels.fontSize/2:r.x+t.value.style.chart.selector.labels.fontSize/2,y:r.y+t.value.style.chart.selector.labels.fontSize/3,"text-anchor":he(r.x,e.unref(u.applyDataLabel)(t.value.style.chart.selector.labels.formatter,r.value,e.unref(u.dataLabel)({p:t.value.style.chart.xAxis.labels.prefix,v:r.value,s:t.value.style.chart.xAxis.labels.suffix,r:t.value.style.chart.selector.labels.rounding})),t.value.style.chart.selector.labels.fontSize)?"end":"start","font-size":t.value.style.chart.selector.labels.fontSize,fill:t.value.style.chart.selector.labels.color,style:{pointerEvents:"none"}},e.toDisplayString(e.unref(u.applyDataLabel)(t.value.style.chart.selector.labels.formatter,r.value,e.unref(u.dataLabel)({p:t.value.style.chart.xAxis.labels.prefix,v:r.value,s:t.value.style.chart.xAxis.labels.suffix,r:t.value.style.chart.selector.labels.rounding}))),9,Lt)):e.createCommentVNode("",!0)],64))),256))],64))),256))],64))),256)):e.createCommentVNode("",!0)]),e.renderSlot(o.$slots,"svg",{svg:f.value},void 0,!0)],14,it)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Mt,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(ne)||e.unref(se)})),void 0,!0)])):e.createCommentVNode("",!0),b.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ze.default,{key:6,config:{type:"ridgeline",style:{backgroundColor:t.value.style.chart.backgroundColor,ridgeline:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:P},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(Je.Legend,{key:`legend_${D.value}`,legendSet:G.value,config:Le.value,onClickMarker:s[1]||(s[1]=({legend:l})=>ce(l.id))},e.createSlots({item:e.withCtx(({legend:l})=>[e.createElementVNode("div",{style:e.normalizeStyle(`opacity:${E.value.includes(l.id)?.5:1}`),onClick:n=>l.segregate()},e.toDisplayString(l.name),13,_t)]),_:2},[o.$slots.pattern?{name:"legend-pattern",fn:e.withCtx(({legend:l,index:n})=>[e.createVNode(Qe._sfc_main,{shape:l.shape,radius:30,stroke:"none",plot:{x:30,y:30},fill:`url(#pattern_${g.value}_${n})`},null,8,["shape","fill"])]),key:"0"}:void 0]),1032,["legendSet","config"])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"legend",{legend:G.value},void 0,!0)],512),o.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:w,dir:"auto"},[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createBlock(Ye.default,{key:8,hideDetails:"",config:{open:I.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(Ge.DataTable,{key:`table_${A.value}`,colNames:K.value.colNames,head:K.value.head,body:K.value.body,config:K.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` :${t.value.style.chart.title.subtitle.text}`:""}`,onClose:s[2]||(s[2]=l=>I.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l},null,8,Vt)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l.name?l.name:e.unref(u.applyDataLabel)(t.value.style.chart.selector.labels.formatter,l,e.unref(u.dataLabel)({p:t.value.style.chart.xAxis.labels.prefix,v:l,s:t.value.style.chart.xAxis.labels.suffix,r:t.value.table.td.roundingValue}))),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0),t.value.style.chart.dialog.show?(e.openBlock(),e.createBlock(nt,{key:9,ref_key:"dialog",ref:d,onClose:s[3]||(s[3]=l=>i.value=null),backgroundColor:t.value.style.chart.dialog.backgroundColor,color:t.value.style.chart.dialog.color,headerBg:t.value.style.chart.dialog.header.backgroundColor,headerColor:t.value.style.chart.dialog.header.color},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.value.name),1)]),default:e.withCtx(()=>[i.value?(e.openBlock(),e.createBlock(tt.default,{key:0,config:ve.value,dataset:me.value},null,8,["config","dataset"])):e.createCommentVNode("",!0)]),_:1},8,["backgroundColor","color","headerBg","headerColor"])):e.createCommentVNode("",!0)],46,st))}},Pt=Be._export_sfc(Tt,[["__scopeId","data-v-d234d120"]]);exports.default=Pt;
|