vue-data-ui 3.28.2 → 3.28.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -1
- package/dist/{PackageVersion-BIhjLNBU.js → PackageVersion-CXT-eAuk.js} +1 -1
- package/dist/components/vue-ui-3d-bar.js +1 -1
- package/dist/components/vue-ui-age-pyramid.js +1 -1
- package/dist/components/vue-ui-annotator.js +1 -1
- package/dist/components/vue-ui-bullet.js +1 -1
- package/dist/components/vue-ui-bump.js +1 -1
- package/dist/components/vue-ui-candlestick.js +1 -1
- package/dist/components/vue-ui-carousel-table.js +1 -1
- package/dist/components/vue-ui-chestnut.js +1 -1
- package/dist/components/vue-ui-chord.js +1 -1
- package/dist/components/vue-ui-circle-pack.js +1 -1
- package/dist/components/vue-ui-cursor.js +1 -1
- package/dist/components/vue-ui-dag.js +1 -1
- package/dist/components/vue-ui-dashboard.js +1 -1
- package/dist/components/vue-ui-digits.js +1 -1
- package/dist/components/vue-ui-donut-evolution.js +1 -1
- package/dist/components/vue-ui-donut.js +1 -1
- package/dist/components/vue-ui-dumbbell.js +1 -1
- package/dist/components/vue-ui-flow.js +1 -1
- package/dist/components/vue-ui-funnel.js +1 -1
- package/dist/components/vue-ui-galaxy.js +1 -1
- package/dist/components/vue-ui-gauge.js +1 -1
- package/dist/components/vue-ui-geo.js +1 -1
- package/dist/components/vue-ui-gizmo.js +1 -1
- package/dist/components/vue-ui-graph.js +1 -1
- package/dist/components/vue-ui-heatmap.js +1 -1
- package/dist/components/vue-ui-hill.js +1 -1
- package/dist/components/vue-ui-history-plot.js +1 -1
- package/dist/components/vue-ui-horizontal-bar.js +1 -1
- package/dist/components/vue-ui-kpi.js +1 -1
- package/dist/components/vue-ui-mini-loader.js +1 -1
- package/dist/components/vue-ui-molecule.js +1 -1
- package/dist/components/vue-ui-mood-radar.js +1 -1
- package/dist/components/vue-ui-nested-donuts.js +1 -1
- package/dist/components/vue-ui-onion.js +1 -1
- package/dist/components/vue-ui-parallel-coordinate-plot.js +1 -1
- package/dist/components/vue-ui-quadrant.js +1 -1
- package/dist/components/vue-ui-quick-chart.js +1 -1
- package/dist/components/vue-ui-radar.js +1 -1
- package/dist/components/vue-ui-rating.js +1 -1
- package/dist/components/vue-ui-relation-circle.js +1 -1
- package/dist/components/vue-ui-ridgeline.js +1 -1
- package/dist/components/vue-ui-rings.js +1 -1
- package/dist/components/vue-ui-scatter.js +1 -1
- package/dist/components/vue-ui-skeleton.js +1 -1
- package/dist/components/vue-ui-smiley.js +1 -1
- package/dist/components/vue-ui-spark-trend.js +1 -1
- package/dist/components/vue-ui-sparkbar.js +1 -1
- package/dist/components/vue-ui-sparkgauge.js +1 -1
- package/dist/components/vue-ui-sparkhistogram.js +1 -1
- package/dist/components/vue-ui-sparkline.js +1 -1
- package/dist/components/vue-ui-sparkstackbar.js +1 -1
- package/dist/components/vue-ui-stackbar.js +1 -1
- package/dist/components/vue-ui-stackline.js +1 -1
- package/dist/components/vue-ui-strip-plot.js +1 -1
- package/dist/components/vue-ui-table-heatmap.js +1 -1
- package/dist/components/vue-ui-table-sparkline.js +1 -1
- package/dist/components/vue-ui-table.js +1 -1
- package/dist/components/vue-ui-thermometer.js +1 -1
- package/dist/components/vue-ui-timer.js +1 -1
- package/dist/components/vue-ui-tiremarks.js +1 -1
- package/dist/components/vue-ui-treemap.js +1 -1
- package/dist/components/vue-ui-vertical-bar.js +1 -1
- package/dist/components/vue-ui-waffle.js +1 -1
- package/dist/components/vue-ui-wheel.js +1 -1
- package/dist/components/vue-ui-word-cloud.js +1 -1
- package/dist/components/vue-ui-world.js +1 -1
- package/dist/components/vue-ui-xy-canvas.js +1 -1
- package/dist/components/vue-ui-xy.js +1 -1
- package/dist/geoProjections-CX3Pvo1N.js +1 -0
- package/dist/llms.txt +9 -34
- package/dist/package-CgIKu3rP.js +1 -0
- package/dist/pdf-CVdqBWVS.js +1 -0
- package/dist/{render-common-B-s2XJ_I.js → render-common-C70bnUVe.js} +1 -1
- package/dist/ssr/vue-ui-donut.js +1 -1
- package/dist/ssr/vue-ui-xy.js +1 -1
- package/dist/ssr.js +1 -1
- package/dist/style.css +1 -1
- package/dist/{useHints-BH9r_0Vd.js → useHints-C-TwxM0Y.js} +1 -1
- package/dist/{useObjectBindings-DiMX4HGv.js → useObjectBindings-C15PEyQD.js} +1 -1
- package/dist/{usePrinter-sVoTzet1.js → usePrinter-DVf3YcG5.js} +1 -1
- package/dist/useSvgLabelLayout-42Kats14.js +1 -0
- package/dist/utils.js +1 -1
- package/dist/vue-data-ui-CrOhFey9.js +1 -0
- package/dist/vue-data-ui.js +1 -1
- package/dist/{vue-ui-3d-bar-CkHFiFp4.js → vue-ui-3d-bar-ljsy2rX6.js} +2 -2
- package/dist/{vue-ui-age-pyramid-vpIjdLg5.js → vue-ui-age-pyramid-a6CK7z3a.js} +1 -1
- package/dist/{vue-ui-annotator-CdCDYzdK.js → vue-ui-annotator-DCJdieNC.js} +3 -3
- package/dist/{vue-ui-bullet-rgxGRR1p.js → vue-ui-bullet-DX4A2Qwo.js} +2 -2
- package/dist/{vue-ui-bump-CeDsunDi.js → vue-ui-bump-IvRdB6MD.js} +2 -2
- package/dist/{vue-ui-candlestick-KJHOS5F7.js → vue-ui-candlestick-BgyUo13S.js} +2 -2
- package/dist/{vue-ui-carousel-table-CeI5SIxH.js → vue-ui-carousel-table-D01DGfA0.js} +1 -1
- package/dist/vue-ui-chestnut-DYrMSzmQ.js +1 -0
- package/dist/{vue-ui-chord-8rk7304-.js → vue-ui-chord-CwzQ7QbP.js} +2 -2
- package/dist/{vue-ui-circle-pack-BsH09EPG.js → vue-ui-circle-pack-DQHNM9sC.js} +2 -2
- package/dist/{vue-ui-cursor-Cpov2m58.js → vue-ui-cursor-CTFfbDX8.js} +1 -1
- package/dist/{vue-ui-dag-BHFL2cUA.js → vue-ui-dag-DF29_9Gg.js} +2 -2
- package/dist/{vue-ui-dashboard-BxXdhdNJ.js → vue-ui-dashboard-D98rMHjI.js} +1 -1
- package/dist/{vue-ui-digits-xHOLjA2_.js → vue-ui-digits-AoPCgSfP.js} +1 -1
- package/dist/{vue-ui-donut-CR3klUbX.js → vue-ui-donut-BQGnUso2.js} +1 -1
- package/dist/{vue-ui-donut-Vbp5Xs2-.js → vue-ui-donut-BYUkblpv.js} +2 -2
- package/dist/{vue-ui-donut-evolution-BTmztL3Y.js → vue-ui-donut-evolution-wxHDTKlg.js} +2 -2
- package/dist/{vue-ui-dumbbell-CDcgKS2A.js → vue-ui-dumbbell-DR7rjMt0.js} +2 -2
- package/dist/{vue-ui-flow-kVocPE27.js → vue-ui-flow-DtQlRSK_.js} +2 -2
- package/dist/vue-ui-funnel-BP3chlZy.js +1 -0
- package/dist/{vue-ui-galaxy-hP-9mVlB.js → vue-ui-galaxy-B7ogrJ6f.js} +1 -1
- package/dist/{vue-ui-gauge-BRabsLkh.js → vue-ui-gauge-CrmzNkjT.js} +1 -1
- package/dist/{vue-ui-geo-Dacnp6iw.js → vue-ui-geo-BbTvWbfX.js} +1 -1
- package/dist/{vue-ui-gizmo-Dp3hpHIX.js → vue-ui-gizmo-C3wgMKwb.js} +1 -1
- package/dist/{vue-ui-graph-DHU9hUry.js → vue-ui-graph-CzUVEiO-.js} +2 -2
- package/dist/{vue-ui-heatmap-kPnmZgWi.js → vue-ui-heatmap-BxR2ccwd.js} +1 -1
- package/dist/{vue-ui-hill-Ddbup7-b.js → vue-ui-hill-BDOd7LrC.js} +1 -1
- package/dist/{vue-ui-history-plot-CwO2o-2s.js → vue-ui-history-plot-0-vs_CVn.js} +2 -2
- package/dist/{vue-ui-horizontal-bar-CvX77vE4.js → vue-ui-horizontal-bar-C5pNTRKB.js} +2 -2
- package/dist/{vue-ui-kpi-CCOOwX_Q.js → vue-ui-kpi-Dfhsk0U1.js} +1 -1
- package/dist/{vue-ui-mini-loader-7gqQI5jy.js → vue-ui-mini-loader-Bbupx66Y.js} +1 -1
- package/dist/vue-ui-molecule-DUX1NUIY.js +1 -0
- package/dist/{vue-ui-mood-radar-GJ-lhgI0.js → vue-ui-mood-radar-B1N5AwX_.js} +1 -1
- package/dist/{vue-ui-nested-donuts-CrlPwpg8.js → vue-ui-nested-donuts-CfHH-cU6.js} +2 -2
- package/dist/{vue-ui-onion-CKmyy-Y_.js → vue-ui-onion-DRN-jIvq.js} +2 -2
- package/dist/{vue-ui-parallel-coordinate-plot-C0UqWt0M.js → vue-ui-parallel-coordinate-plot-UUPjQABF.js} +2 -2
- package/dist/{vue-ui-quadrant-CTGFBNo9.js → vue-ui-quadrant-zmtzn0lM.js} +2 -2
- package/dist/{vue-ui-quick-chart-ZBOPZhxA.js → vue-ui-quick-chart-DgU_IhKY.js} +2 -2
- package/dist/{vue-ui-radar-B1z3Ux3E.js → vue-ui-radar-BGSoxRaK.js} +1 -1
- package/dist/{vue-ui-rating-CV2b0tjA.js → vue-ui-rating-ChWXrWNJ.js} +1 -1
- package/dist/{vue-ui-relation-circle-DqN5N08e.js → vue-ui-relation-circle-XUw5UMrt.js} +1 -1
- package/dist/{vue-ui-ridgeline-DcSB5Qef.js → vue-ui-ridgeline-B5RJcFyA.js} +2 -2
- package/dist/{vue-ui-rings-CJqAnf-l.js → vue-ui-rings-BJaCLH2Q.js} +1 -1
- package/dist/{vue-ui-scatter-THQAeoWs.js → vue-ui-scatter-BA0hk_Tf.js} +2 -2
- package/dist/{vue-ui-skeleton-DqmhigQ0.js → vue-ui-skeleton-DpzaXPO3.js} +1 -1
- package/dist/{vue-ui-smiley-VTdQetY0.js → vue-ui-smiley--VTlUAdp.js} +1 -1
- package/dist/{vue-ui-spark-trend-B2Nf1raK.js → vue-ui-spark-trend-DJ63XtgQ.js} +1 -1
- package/dist/{vue-ui-sparkbar-CamZ_49V.js → vue-ui-sparkbar-C5wP9R67.js} +1 -1
- package/dist/{vue-ui-sparkgauge-Ffrp_7VV.js → vue-ui-sparkgauge-DQcAOGuG.js} +1 -1
- package/dist/{vue-ui-sparkhistogram-CLfzi3PO.js → vue-ui-sparkhistogram-BBiCxX6W.js} +1 -1
- package/dist/{vue-ui-sparkline-Y-sljnbS.js → vue-ui-sparkline-B_GkB9V_.js} +1 -1
- package/dist/{vue-ui-sparkstackbar-CYZ-ADO1.js → vue-ui-sparkstackbar-DSRXhqhJ.js} +1 -1
- package/dist/{vue-ui-stackbar-CQLYm10x.js → vue-ui-stackbar-QjOQHbld.js} +2 -2
- package/dist/{vue-ui-stackline-VpvF7MRx.js → vue-ui-stackline-CoII13bc.js} +2 -2
- package/dist/{vue-ui-strip-plot-B9Ogpw7K.js → vue-ui-strip-plot-d3UoFFrf.js} +2 -2
- package/dist/{vue-ui-table-Bi9C3LzP.js → vue-ui-table-CHFjZzW7.js} +1 -1
- package/dist/{vue-ui-table-heatmap-BtziURiu.js → vue-ui-table-heatmap-DzvPQnY9.js} +1 -1
- package/dist/{vue-ui-table-sparkline-DEVAL0cR.js → vue-ui-table-sparkline-BkZ7sn4X.js} +1 -1
- package/dist/{vue-ui-thermometer-ClN4EO0I.js → vue-ui-thermometer-B--g_Lkt.js} +1 -1
- package/dist/{vue-ui-timer-nqZxt1vU.js → vue-ui-timer-DmwEWrDh.js} +2 -2
- package/dist/{vue-ui-tiremarks-BeJBsgXo.js → vue-ui-tiremarks-160Gx7-3.js} +1 -1
- package/dist/{vue-ui-treemap-FA-yXwmv.js → vue-ui-treemap-B-Yjtob0.js} +1 -1
- package/dist/{vue-ui-waffle-CO07S6HV.js → vue-ui-waffle-BhzLg5ip.js} +1 -1
- package/dist/{vue-ui-wheel-BeaSWB4x.js → vue-ui-wheel-DHb4G42X.js} +1 -1
- package/dist/{vue-ui-word-cloud-C1OWGFng.js → vue-ui-word-cloud-BcpreM7A.js} +2 -2
- package/dist/{vue-ui-world-CUS_mKgl.js → vue-ui-world-BD9acchj.js} +2 -2
- package/dist/vue-ui-xy-C-2Phexw.js +24 -0
- package/dist/{vue-ui-xy-BigPHE0Q.js → vue-ui-xy-CB3lQs2m.js} +1 -1
- package/dist/{vue-ui-xy-canvas-CeC3gcrW.js → vue-ui-xy-canvas-Do4P4ajB.js} +2 -2
- package/package.json +141 -131
- package/dist/geoProjections-Bvj-eMvq.js +0 -1
- package/dist/package-DwcKiXuI.js +0 -1
- package/dist/pdf-DAicVFxx.js +0 -1
- package/dist/useSvgLabelLayout-D1I8sQUi.js +0 -1
- package/dist/vue-data-ui-BvHCscNE.js +0 -1
- package/dist/vue-ui-chestnut-CiY-2e77.js +0 -1
- package/dist/vue-ui-funnel-CZAdPYqK.js +0 -1
- package/dist/vue-ui-molecule-BPGs9Dom.js +0 -1
- package/dist/vue-ui-xy-6B_K-quN.js +0 -24
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.js";import{$ as n,C as r,D as i,Ft as a,Ht as o,Jt as ee,X as te,d as s,in as ne,nt as re,r as ie}from"./lib-rPeBMZrn.js";import{n as ae,t as oe}from"./useHints-BH9r_0Vd.js";import{t as se}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as c}from"./BaseIcon-Cm-IJ179.js";import{t as l}from"./vue-ui-xy-6B_K-quN.js";import{t as ce}from"./vue-ui-donut-Vbp5Xs2-.js";import{Fragment as u,computed as d,createBlock as le,createCommentVNode as f,createElementBlock as p,createElementVNode as m,createTextVNode as h,createVNode as ue,defineAsyncComponent as de,nextTick as fe,normalizeClass as g,normalizeStyle as _,onMounted as pe,openBlock as v,ref as y,renderList as b,toDisplayString as x,unref as S,useCssVars as me,vModelSelect as he,vModelText as ge,watch as _e,withCtx as ve,withDirectives as ye,withKeys as be,withModifiers as xe}from"vue";var Se=/* @__PURE__ */ e({default:()=>dn}),Ce=[`innerHTML`],we=[`data-is-open`],Te={class:`vue-ui-table-export-hub-options`},Ee={class:`vue-ui-table-export-hub-option-wrapper`},De={class:`label`},Oe=[`innerHTML`],ke={class:`vue-ui-table-export-hub-option-wrapper`},Ae={class:`label`},je=[`innerHTML`],Me={class:`vue-ui-table-dialog-field`},Ne={class:`label vue-ui-table-dialog-input-label`,style:{width:`100%`}},Pe={style:{width:`fit-content`}},Fe={class:`vue-ui-table`},Ie={key:0},Le={key:0},Re={key:1},ze={key:0,style:{display:`flex`,"align-items":`center`,"justify-content":`flex-end`}},Be=[`innerHTML`],Ve={key:0,style:{"margin-left":`3px`}},He={key:0},Ue={class:`th-filter`},We={key:0,class:`th-date`},Ge={class:`date-wrapper--inputs`},Ke={class:`date-fieldset`},qe=[`for`],Je=[`id`,`onUpdate:modelValue`,`onInput`],Ye={class:`date-fieldset`},Xe=[`for`],Ze=[`id`,`onUpdate:modelValue`,`onInput`],Qe={class:`date-wrapper--button`},$e=[`onClick`],et=[`innerHTML`],tt=[`innerHTML`],nt=[`innerHTML`],rt=[`onClick`,`disabled`],it=[`placeholder`,`onUpdate:modelValue`,`name`],at=[`onClick`],ot=[`innerHTML`],st=[`innerHTML`],ct=[`innerHTML`],lt=[`onClick`,`innerHTML`],ut=[`innerHTML`],dt={key:5,class:`th-range-filter`},ft=[`for`],pt=[`id`,`max`,`min`,`onUpdate:modelValue`],mt=[`id`,`max`,`min`,`onUpdate:modelValue`],ht=[`for`],gt=[`onClick`,`disabled`],_t=[`id`],vt=[`onClick`],yt=[`onClick`,`onKeyup`],bt=[`innerHTML`,`onClick`,`onKeyup`],xt=[`data-row`],St=[`data-row`],Ct=[`data-row`,`onClick`,`onKeyup`,`id`],wt=[`innerHTML`],Tt={key:1},Et={key:2},Dt={key:5},Ot=[`innerHTML`],kt={key:0},At={style:{"margin-left":`12px`}},jt={class:`format-num`},Mt={style:{"margin-left":`12px`}},Nt={key:0,class:`format-num`},Pt={key:1,class:`format-num`},Ft={key:2},It={style:{"margin-left":`12px`}},Lt={key:0,class:`format-num`},Rt={key:1,class:`format-num`},zt={key:2},Bt={key:1,class:`vue-ui-table-paginator format-num`},Vt={key:2,class:`vue-ui-table-size-warning`},Ht=[`innerHTML`],Ut={key:4,class:`vue-ui-table-pagination format-num`},Wt=[`innerHTML`,`disabled`],Gt=[`disabled`],Kt={for:`pageScroller`,style:{"font-size":`14px`}},qt=[`max`,`value`],Jt={key:1},Yt=[`disabled`],Xt=[`innerHTML`,`disabled`],Zt={class:`vue-ui-table-chart-modal-options`},Qt=[`innerHTML`],$t=[`innerHTML`],en=[`innerHTML`],tn={style:{width:`100%`,height:`fit-content`}},nn={class:`vue-ui-table-fieldset`},rn={class:`vue-ui-table-fieldset-wrapper`},an=[`name`,`id`,`checked`,`onInput`],on=[`for`],sn=[`disabled`],cn=[`innerHTML`],ln={style:{width:`100%`,"margin-bottom":`12px`}},un={key:2,style:{width:`100%`,"margin-bottom":`32px`}},dn=/*#__PURE__*/ se({__name:`vue-ui-table`,props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:[`page-change`],setup(e,{expose:se,emit:Se}){me(e=>({v6b779b9d:Ln.value,v71f90aa0:Rn.value,v82bf5584:Hn.value,bc0e3a90:zn.value,v4bc5be6a:Un.value,v542dfbf0:Wn.value,v5935dfae:Bn.value,v23648322:Vn.value,v98d33e98:Gn.value}));let dn=de(()=>import(`./BaseDraggableDialog-DHgIPVmz.js`).then(e=>e.n)),C=e,fn=Se,{vue_ui_table:pn}=t(),mn=te();y(null);let hn=y(null),gn=y(null),w=y({height:316,type:`bar`,width:512}),T=y({ASC:1,BAR:`bar`,DATE:`date`,DESC:-1,DONUT:`donut`,LINE:`line`,NUMERIC:`numeric`,PERCENTAGE:`percentage`,TEXT:`text`}),_n=y(100),vn=y(100);y(0),y(0),y(400),y(200);let yn=y({CELL:`smart-td-selected`,FIRST_TD:`smart-td-selected-first`,LAST_TD:`smart-td-selected-last`,ROW:`smart-td-selected-neighbor`}),bn=y(void 0),xn=y(void 0),E=y({col:void 0,rows:[]}),D=y(0),O=y(20),Sn=y(!1),Cn=y(!1),k=y({}),A=y({}),wn=y({}),j=y({}),M=y({}),N=y({}),P=y({}),F=y({}),I=y({}),Tn=y(C.config.rowsPerPage?C.config.rowsPerPage:25),En=y([.../* @__PURE__ */ new Set([10,25,50,100,250,500,C.config.rowsPerPage?C.config.rowsPerPage:25,C.dataset.body.length])].sort((e,t)=>e-t)),Dn=y(void 0),L=y(void 0),On=y(void 0),R=y(!1),kn=y(0),An=y(``),jn=y(``),z=y(!1),B=y(JSON.parse(JSON.stringify(C.dataset.body)).map((e,t)=>({...e,absoluteIndex:t}))),Mn=y(JSON.parse(JSON.stringify(C.dataset.body)).map((e,t)=>({...e,absoluteIndex:t}))),V=y(JSON.parse(JSON.stringify(C.dataset.header)).map((e,t)=>({average:Object.hasOwn(e,`average`)?e.average:!1,decimals:Object.hasOwn(e,`decimals`)?e.decimals:0,isMultiselect:Object.hasOwn(e,`isMultiselect`)?e.isMultiselect:!1,isPercentage:Object.hasOwn(e,`isPercentage`)?e.isPercentage:!1,isSearch:Object.hasOwn(e,`isSearch`)?e.isSearch:!1,isSort:Object.hasOwn(e,`isSort`)?e.isSort:!1,name:e.name,percentageTo:Object.hasOwn(e,`percentageTo`)?e.percentageTo:void 0,prefix:Object.hasOwn(e,`prefix`)?e.prefix:``,rangeFilter:Object.hasOwn(e,`rangeFilter`)?e.rangeFilter:!1,suffix:Object.hasOwn(e,`suffix`)?e.suffix:``,sum:Object.hasOwn(e,`sum`)?e.sum:!1,type:e.type,index:t}))),Nn=d(()=>hn.value?hn.value.getBoundingClientRect().height+3:3),H=d(()=>{if(!Object.keys(C.config||{}).length)return pn;let e=ne({defaultConfig:pn,userConfig:C.config});return r(e)}),U=d(()=>H.value.style.exportMenu),W=d(()=>H.value.style.title),G=d(()=>H.value.style.th),K=d(()=>H.value.style.inputs),Pn=d(()=>H.value.style.dropdowns),Fn=d(()=>H.value.style.closeButtons),q=d(()=>H.value.style.rows),J=d(()=>H.value.style.pagination),Y=d(()=>H.value.style.chart),In=d(()=>H.value.style);ae({config:()=>H.value,dataset:()=>C.dataset,component:`VueUiTable`,rules:[oe.noHint]});let X=d(()=>H.value.useCursorPointer),Ln=d(()=>G.value.buttons.cancel.inactive.backgroundColor),Rn=d(()=>G.value.buttons.cancel.inactive.color),zn=d(()=>G.value.buttons.cancel.active.backgroundColor),Bn=d(()=>G.value.buttons.filter.active.backgroundColor),Vn=d(()=>G.value.buttons.filter.active.color),Hn=d(()=>a(zn.value,.33)),Un=d(()=>ee(zn.value,33)),Wn=d(()=>a(Bn.value,.33)),Gn=d(()=>ee(Bn,33)),Kn=d(()=>[...V.value].filter(e=>e.type===T.value.DATE)),qn=d(()=>[``,...Kn.value.map(e=>e.name)]),Jn=d(()=>{let e=Kn.value.find(e=>e.name===An.value);return e?e.index:null}),Z=d(()=>{let e=[];if(B.value.length)for(let t=0;t<B.value.length;t+=Tn.value)e.push(B.value.slice(t,t+Tn.value));return e}),Yn=d(()=>Z.value[D.value]),Xn=d(()=>Jn.value==null?[]:Yn.value.map(e=>e.td[Jn.value])),Zn=d(()=>Object.keys(M.value).map(e=>({index:e,name:C.dataset.header[e].name,options:M.value[e]}))),Qn=d(()=>H.value.useChart&&E.value.rows.length>1),$n=d(()=>C.dataset.header.map(e=>e.type).includes(T.value.NUMERIC)),Q=d(()=>({arrowSort:`<svg xmlns="http://www.w3.org/2000/svg" width="${O.value}" height="${O.value}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M3 9l4 -4l4 4m-4 -4v14" /><path d="M21 15l-4 4l-4 -4m4 4v-14" /></svg>`,bar:`<svg xmlns="http://www.w3.org/2000/svg" width="${O.value}" height="${O.value}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M3 12m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v6a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z" /><path d="M9 8m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v10a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z" /><path d="M15 4m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v14a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z" /><path d="M4 20l14 0" /></svg>`,chart:`<svg xmlns="http://www.w3.org/2000/svg" width="${O.value}" height="${O.value}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 19l16 0" /><path d="M4 15l4 -6l4 2l4 -5l4 4" /></svg>`,chevronDown:`<svg xmlns="http://www.w3.org/2000/svg" width="${O.value}" height="${O.value}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M6 9l6 6l6 -6" /></svg>`,chevronLeft:`<svg xmlns="http://www.w3.org/2000/svg" width="${O.value*1.6}" height="${O.value*1.6}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M15 6l-6 6l6 6" /></svg>`,chevronRight:`<svg xmlns="http://www.w3.org/2000/svg" width="${O.value*1.6}" height="${O.value*1.6}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M9 6l6 6l-6 6" /></svg>`,donut:`<svg xmlns="http://www.w3.org/2000/svg" width="${O.value*.8}" height="${O.value*.8}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 3v5m4 4h5" /><path d="M8.929 14.582l-3.429 2.918" /><path d="M12 12m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0" /><path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" /></svg>`,export:`<svg xmlns="http://www.w3.org/2000/svg" width="${O.value}" height="${O.value}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12.5 21h-7.5a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v7.5" /><path d="M3 10h18" /><path d="M10 3v18" /><path d="M16 19h6" /><path d="M19 16l3 3l-3 3" /></svg>`,fileDownload:`<svg xmlns="http://www.w3.org/2000/svg" width="${O.value}" height="${O.value}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M14 3v4a1 1 0 0 0 1 1h4" /><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z" /><path d="M12 17v-6" /><path d="M9.5 14.5l2.5 2.5l2.5 -2.5" /></svg>`,filter:`<svg xmlns="http://www.w3.org/2000/svg" width="${O.value}" height="${O.value}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z" /></svg>`,move:`<svg xmlns="http://www.w3.org/2000/svg" width="${O.value}" height="${O.value}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 9l3 3l-3 3" /><path d="M15 12h6" /><path d="M6 9l-3 3l3 3" /><path d="M3 12h6" /><path d="M9 18l3 3l3 -3" /><path d="M12 15v6" /><path d="M15 6l-3 -3l-3 3" /><path d="M12 3v6" /></svg>`,sort09:`<svg xmlns="http://www.w3.org/2000/svg" width="${O.value}" height="${O.value}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 15l3 3l3 -3" /><path d="M7 6v12" /><path d="M17 3a2 2 0 0 1 2 2v3a2 2 0 1 1 -4 0v-3a2 2 0 0 1 2 -2z" /><path d="M17 16m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" /><path d="M19 16v3a2 2 0 0 1 -2 2h-1.5" /></svg>`,sort90:`<svg xmlns="http://www.w3.org/2000/svg" width="${O.value}" height="${O.value}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 15l3 3l3 -3" /><path d="M7 6v12" /><path d="M17 14a2 2 0 0 1 2 2v3a2 2 0 1 1 -4 0v-3a2 2 0 0 1 2 -2z" /><path d="M17 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" /><path d="M19 5v3a2 2 0 0 1 -2 2h-1.5" /></svg>`,sortAZ:`<svg xmlns="http://www.w3.org/2000/svg" width="${O.value}" height="${O.value}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M15 10v-5c0 -1.38 .62 -2 2 -2s2 .62 2 2v5m0 -3h-4" /><path d="M19 21h-4l4 -7h-4" /><path d="M4 15l3 3l3 -3" /><path d="M7 6v12" /></svg>`,sortZA:`<svg xmlns="http://www.w3.org/2000/svg" width="${O.value}" height="${O.value}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M15 21v-5c0 -1.38 .62 -2 2 -2s2 .62 2 2v5m0 -3h-4" /><path d="M19 10h-4l4 -7h-4" /><path d="M4 15l3 3l3 -3" /><path d="M7 6v12" /></svg>`,sum:`<svg xmlns="http://www.w3.org/2000/svg" width="${O.value}" height="${O.value}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>`,table:`<svg xmlns="http://www.w3.org/2000/svg" width="${O.value}" height="${O.value}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" fill="white" d="M 10 2, 21 2, 21 21, 10 21Z"/><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14z" /><path d="M3 10h18" /><path d="M10 3v18" /></svg>`,warning:`<svg xmlns="http://www.w3.org/2000/svg" width="${O.value*.8}" height="${O.value*.8}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10.24 3.957l-8.422 14.06a1.989 1.989 0 0 0 1.7 2.983h16.845a1.989 1.989 0 0 0 1.7 -2.983l-8.423 -14.06a1.989 1.989 0 0 0 -3.4 0z" /><path d="M12 9v4" /><path d="M12 17h.01" /></svg>`,grip:`<svg xmlns="http://www.w3.org/2000/svg" width="${O.value}" height="${O.value}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><path d="M5 9m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" /><path d="M5 15m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" /><path d="M12 9m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" /><path d="M12 15m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" /><path d="M19 9m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" /><path d="M19 15m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" /></svg>`})),er=d(()=>B.value.map(e=>e.td)),tr=d(()=>({sumPercentage:Number((E.value.rows.map(e=>e.value).reduce((e,t)=>e+t,0)*100).toFixed(C.dataset.header[E.value.col].decimals)).toLocaleString(),sumRegular:Number(E.value.rows.map(e=>e.value).reduce((e,t)=>e+t,0).toFixed(C.dataset.header[E.value.col].decimals)).toLocaleString(),averagePercentage:Number((E.value.rows.map(e=>e.value).reduce((e,t)=>e+t,0)/E.value.rows.length*100).toFixed(C.dataset.header[E.value.col].decimals)).toLocaleString(),averageRegular:Number((E.value.rows.map(e=>e.value).reduce((e,t)=>e+t,0)/E.value.rows.length).toFixed(C.dataset.header[E.value.col].decimals)).toLocaleString()})),nr=y({width:1e3,height:500});function rr({width:e,height:t}){nr.value={width:e,height:t}}let ir=d(()=>{if(!Qn.value)return[];let e=nr.value.height,t=nr.value.width,n=t/E.value.rows.length,r=Math.max(...E.value.rows.map(e=>e.value)),i=Math.min(...E.value.rows.map(e=>e.value)),o=C.dataset.header[E.value.col].isPercentage&&C.dataset.header[E.value.col].percentageTo,ee=w.value.type===T.value.DONUT&&L.value&&L.value.name,te=C.dataset.header[E.value.col].name+(o?` / ${C.dataset.header[N.value[E.value.col].referenceIndex].name}`:``)+(ee?` ${H.value.translations.by} ${L.value.name}`:``),ne=C.dataset.header[E.value.col].prefix,re=C.dataset.header[E.value.col].suffix,ae=[{name:te,series:E.value.rows.map(e=>e.value),type:`line`,useProgression:!0,smooth:Y.value.layout.line.smooth,color:Y.value.layout.line.stroke,useArea:Y.value.layout.line.useArea}],oe=[{name:te,series:E.value.rows.map(e=>e.value),type:`bar`,useProgression:!0,color:Y.value.layout.bar.fill}],se=Y.value.modal.backgroundColor,c=ie(se),l=C.dataset.header[E.value.col].decimals,ce={useCssAnimation:!1,chart:{width:t,height:e-250,backgroundColor:se,color:c,labels:{fontSize:18,prefix:ne,suffix:re},grid:{stroke:a(c,.5),labels:{color:c,xAxisLabels:{color:c,show:Xn.value.length,values:Xn.value,datetimeFormatter:Y.value.layout.datetimeFormatter,showOnlyAtModulo:Y.value.layout.timeLabels.showOnlyAtModulo,modulo:Y.value.layout.timeLabels.modulo}}},highlighter:{color:c},legend:{color:c,show:!1},title:{text:te,color:c,textAlign:`center`,fontSize:18},tooltip:{showTimeLabel:Xn.value.length,backgroundOpacity:30,color:c,backgroundColor:se,showPercentage:!1,roundingValue:l},userOptions:{buttons:{pdf:!1,csv:!1,table:!1,annotator:!1}},zoom:{show:Y.value.layout.zoom.show,autoFit:Y.value.layout.zoom.autoFit,focusOnDrag:!0,minimap:{show:!0}}},line:{labels:{show:!0,color:c,rounding:l},dot:{useSerieColor:!1,fill:Y.value.layout.line.plot.fill,strokeWidth:Y.value.layout.line.plot.strokeWidth}},bar:{useGradient:!1,border:{useSerieColor:!1,stroke:Y.value.layout.bar.stroke,strokeWidth:Y.value.layout.bar.strokeWidth},labels:{show:!0,color:c,rounding:l}}},u=i>=0?0:Math.abs(i),d=r+u,le=C.dataset.header[E.value.col].isPercentage,f=E.value.rows.map((t,r)=>({x:n*r+n/2,y:(1-(t.value+u)/d)*e,value:le?t.value*100:t.value,suffix:le?`%`:C.dataset.header[E.value.col].suffix?C.dataset.header[E.value.col].suffix:``,prefix:C.dataset.header[E.value.col].prefix?C.dataset.header[E.value.col].prefix:``,index:t.index,absoluteValue:le?Math.abs(t.value)*100:Math.abs(t.value)}));return{donutConfig:{useCssAnimation:!1,userOptions:{position:`left`,buttons:{pdf:!1,csv:!1,table:!1,annotator:!1}},style:{chart:{backgroundColor:se,color:c,layout:{curvedMarkers:!0,donut:{strokeWidth:64},labels:{dataLabels:{suffix:le?`%`:``,prefix:ne},value:{rounding:l},percentage:{color:c,rounding:l},name:{color:c},hollow:{average:{color:c,text:H.value.translations.average,value:{color:c}},total:{color:c,offsetY:-12,text:H.value.translations.total,value:{color:c,offsetY:-12}}}}},legend:{backgroundColor:se,color:c,roundingValue:l,roundingPercentage:l},padding:{left:12,right:12},title:{text:te,color:c,fontSize:18},tooltip:{backgroundOpacity:30,color:c,backgroundColor:se,roundingValue:l,roundingValue:l}}}},xyConfig:ce,xyDatasetLine:ae,xyDatasetBar:oe,progression:f.length>=2&&s(f)}});function ar(){let e=L.value.options.map((e,t)=>({name:e,color:o[t]||o[t%o.length],values:[Yn.value.filter((t,n)=>t.td[L.value.index]===e&&E.value.rows.map(e=>e.index).includes(n)).map(e=>e.td[E.value.col]).reduce((e,t)=>Math.abs(e)+Math.abs(t),0)],absoluteValue:Yn.value.filter((t,n)=>t.td[L.value.index]===e&&E.value.rows.map(e=>e.index).includes(n)).map(e=>e.td[E.value.col]).reduce((e,t)=>e+t,0)})).sort((e,t)=>t.value-e.value);bn.value=e,fe(()=>{w.value.type=T.value.DONUT,z.value=!1})}function or(e,t){return!A.value[e]&&(t.isSort||t.isSearch||t.isMultiselect||t.rangeFilter)&&![T.value.DATE].includes(t.type)}function sr(e=`all`){let t=C.dataset.header.map(e=>e.name),n=e===`all`?B.value.map(e=>e.td):Yn.value.map(e=>e.td),r=[t].concat(n),a=i(r);re({csvContent:a,title:jn.value})}function cr(){let e=document.getElementsByClassName(`th-dropdown`);e.length&&Array.from(e).forEach(e=>{e.dataset.isOpen=!1})}function lr(e,t){let n;clearTimeout(n),n=setTimeout(e,t)}function ur(){let e=document.getElementsByClassName(`tr_${mn}`);Array.from(e).forEach(e=>{Array.from(e.getElementsByTagName(`td`)).forEach(e=>{e.dataset.row===`even`?(e.style.background=q.value.even.backgroundColor,e.style.color=q.value.even.color):(e.style.background=q.value.odd.backgroundColor,e.style.color=q.value.odd.color)})}),Array.from(e).forEach(e=>e.dataset.selected=`false`),D.value>Z.value.length-1&&(D.value=Z.value.length-1),R.value=!1,bn.value=void 0,Dn.value=void 0,w.value.type=T.value.BAR,E.value={col:void 0,rows:[]},_n.value=100,vn.value=100}function dr(e,t){B.value=e.filter(e=>e.td[t]>=P.value[t].min&&e[t]<=P.value[t].max)}function fr(e,t){if(I.value[t]===T.value.ASC&&(e=e.sort((e,n)=>e[t]-n[t])),I.value[t]===T.value.DESC)e=e.sort((e,n)=>n[t]-e[t]);else return 0}function pr(){ur(),Object.keys(P.value).forEach(e=>{dr(B.value,e)}),Object.keys(I.value).forEach(e=>{fr(B.value,e)}),xn.value!==void 0&&fr(B.value,xn.value),C.dataset.header.forEach((e,t)=>{if(e.isPercentage){let e=N.value[t].referenceIndex,n=B.value.map(t=>t.td[e]).reduce((e,t)=>e+t,0);B.value.forEach(r=>{r.td[t]=r.td[e]/n})}}),D.value>Z.value.length-1&&(D.value=Z.value.length-1),[-1].includes(D.value)&&(D.value=0)}function mr(){B.value=Mn.value.filter(e=>{for(let t in F.value)if(!e.td[t].toUpperCase().includes(F.value[t].toUpperCase()))return!1;for(let t in M.value)if(!M.value[t].some(n=>n===e.td[t]))return!1;for(let t in k.value){let n=new Date(e.td[t]),r=new Date(k.value[t].from),i=new Date(k.value[t].to);if(n<r||n>i)return!1}return!0}),pr()}function hr(e){return er.value.map(t=>t[e]).map(e=>isNaN(Number(e))?0:e).reduce((e,t)=>e+t,0)/B.value.length}function gr(e){let t=C.dataset.body.map(t=>new Date(t.td[e])),n=new Date(Math.min(...t)),r=new Date(Math.max(...t)),i=n.getFullYear(),a=r.getFullYear(),o=String(n.getMonth()+1).padStart(2,`0`),ee=String(r.getMonth()+1).padStart(2,`0`),te=String(n.getDate()).padStart(2,`0`),s=String(r.getDate()).padStart(2,`0`);return{from:`${i}-${o}-${te}`,to:`${a}-${ee}-${s}`}}function $(e){return[...new Set(C.dataset.body.map(t=>t.td[e]))]}function _r(e){return er.value.map(t=>t[e]).map(e=>isNaN(Number(e))?0:e).reduce((e,t)=>e+t,0)}function vr(e){return e.includes(NaN)}function yr(e,t){return!M.value[t]||M.value[t].includes(e)}function br(e){return!isNaN(Number(String(e).replaceAll(`%`,``)))}function xr(e,t){let n=t.isSort,r=t.isSearch,i=t.isMultiselect&&M.value[e],a=t.rangeFilter,o=e=>{if(a&&P.value[e])return Math.round(P.value[e].min)===j.value[e].min&&Math.round(P.value[e].max)===j.value[e].max};if(n&&r&&i&&a)return[``,void 0].includes(F.value[e])&&[void 0].includes(I.value[e])&&M.value[e].length===$(e).length&&o(e);if(n&&r&&i)return[``,void 0].includes(F.value[e])&&[void 0].includes(I.value[e])&&M.value[e].length===$(e).length;if(n&&r&&a)return[``,void 0].includes(F.value[e])&&[void 0].includes(I.value[e])&&o(e);if(n&&r)return[``,void 0].includes(F.value[e])&&[void 0].includes(I.value[e]);if(n&&i&&a)return[void 0].includes(I.value[e])&&M.value[e].length===$(e).length&&o(e);if(n&&i)return[void 0].includes(I.value[e])&&M.value[e].length===$(e).length;if(r&&i&&a)return[``,void 0].includes(F.value[e])&&M.value[e].length===$(e).length&&o(e);if(r&&i)return[``,void 0].includes(F.value[e])&&M.value[e].length===$(e).length;if(r&&a)return[``,void 0].includes(F.value[e])&&o(e);if(r)return[``,void 0].includes(F.value[e]);if(n&&a)return[void 0].includes(I.value[e])&&o(e);if(n)return[void 0].includes(I.value[e]);if(i&&a)return M.value[e].length===$(e).length&&o(e);if(i)return M.value[e].length===$(e).length}function Sr(){return{totalPages:Z.value.length,itemsPerPage:Tn.value,currentPage:D.value,currentPageData:Yn.value.map(e=>e.td)}}se({getCurrentPageData:Sr});function Cr(){fn(`page-change`,Sr())}let wr=y(null);function Tr(e){if(ur(),e===`next`&&D.value<Z.value.length){if(D.value+1>Z.value.length-1)return;D.value+=1}else if(e===`previous`&&D.value>=1)--D.value;else{if(e-1<0||e>Z.value.length||e===`previous`)return;D.value=e-1}Cr(),wr.value&&wr.value.scrollTo({top:0,left:0,behavior:`smooth`})}function Er(e){e.preventDefault();let t=e.keyCode;if(![38,40,37,39].includes(t))return;let n=e.target.id.match(/cell_(\d+)_(\d+)_([0-9a-fA-F-]{36})/),r=parseInt(n[1]),i=parseInt(n[2]),a=document.getElementById(`cell_${r}_${i+1}_${mn}`),o=document.getElementById(`cell_${r}_${i-1}_${mn}`),ee=document.getElementById(`cell_${r+1}_${i}_${mn}`),te=document.getElementById(`cell_${r-1}_${i}_${mn}`),s;switch(!0){case t===39:s=a;break;case t===37:s=o;break;case t===38:s=te;break;case t===40:s=ee;break;default:return}s&&(s.focus(),s.scrollIntoView({behavior:`smooth`,block:`center`}))}function Dr(e){let t=0;for(let n=0;n<e.length;n+=1)t+=e.charCodeAt(n);return t}async function Or(){return new Promise(e=>{let t=[];V.value.forEach((e,n)=>{if(e.isSearch&&Object.assign(F.value,{[n]:``}),e.isMultiselect&&Object.assign(M.value,{[n]:$(n)}),e.type===T.value.DATE&&(Object.assign(k.value,{[n]:gr(n)}),Object.assign(wn.value,{[n]:!1})),(e.isPercentage||e.percentageTo)&&Object.assign(N.value,{[n]:{reference:e.percentageTo,referenceIndex:C.dataset.header.map(e=>e.name).indexOf(e.percentageTo)}}),e.rangeFilter&&(Object.assign(P.value,{[n]:{min:Math.round(Math.min(...C.dataset.body.map(e=>e.td).map(e=>e[n]))),max:Math.round(Math.max(...C.dataset.body.map(e=>e.td).map(e=>e[n])))}}),Object.assign(j.value,{[n]:{min:Math.round(Math.min(...C.dataset.body.map(e=>e.td).map(e=>e[n]))),max:Math.round(Math.max(...C.dataset.body.map(e=>e.td).map(e=>e[n])))}})),e.isPercentage){let r=C.dataset.header.map(e=>e.name).indexOf(e.percentageTo),i=C.dataset.body.map(e=>e.td[r]).reduce((e,t)=>e+t,0);t.push([n,r,i])}e.type===T.value.NUMERIC&&!e.isPercentage&&Object.assign(A.value,{[n]:vr(C.dataset.body.map(e=>Number(e.td[n])))})}),B.value.forEach((e,n)=>{t.map(t=>{let[n,r,i]=t;e.td[n]=e.td[r]/i}),e.td.forEach((t,r)=>{C.dataset.header[r].type===T.value.TEXT&&C.dataset.header[r].isSearch&&(e[r]=Dr(t)),C.dataset.header[r].type===T.value.DATE&&(e[r]=new Date(t).getTime()),C.dataset.header[r].type===T.value.NUMERIC&&(e[r]=isNaN(Number(t))?r:t),Mn.value[n][r]=e[r]})}),e(!0)})}function kr(e,t){return new Promise((n,r)=>{e().then(e=>{try{n(t(e))}catch(e){r(e)}}).catch(e=>{r(e)})})}async function Ar(e){k.value[e]={from:gr(e).from,to:gr(e).to},wn.value[e]=!1,await fe(),mr()}function jr(e,t,n){let r=n.currentTarget;clearTimeout(gn.value),r.classList.add(`clicked`),gn.value=setTimeout(()=>{r.classList.remove(`clicked`)},200),xn.value=void 0,t.rangeFilter&&(P.value[e].min=j.value[e].min,P.value[e].max=j.value[e].max),t.isMultiselect?(M.value[e]=$(e),t.type===T.value.TEXT&&(I.value[e]=void 0),t.isSearch&&(F.value[e]=``)):t.type===T.value.NUMERIC?I.value[e]=void 0:t.type===T.value.TEXT?(I.value[e]=void 0,F.value[e]=``):t.type===T.value.DATE&&(I.value[e]=void 0),mr()}function Mr({td:e,rowIndex:t,colIndex:n,headerType:r,event:i}){if(r!==T.value.NUMERIC||isNaN(Number(e))){ur();return}E.value.col!==n&&ur();let a=i.currentTarget.parentNode;E.value.col=n,E.value.rows.map(e=>e.index).includes(t)?(a.dataset.selected=`false`,E.value.rows=E.value.rows.filter(e=>e.index!==t),i.currentTarget.classList.remove(yn.value.CELL),Array.from(a.children).forEach((e,t)=>{e.dataset.row===`even`?(e.style.background=q.value.even.backgroundColor,e.style.color=q.value.even.olor):(e.style.background=q.value.odd.backgroundColor,e.style.color=q.value.odd.color)}),i.currentTarget.dataset.row===`even`?(i.currentTarget.style.background=q.value.even.backgroundColor,i.currentTarget.style.color=q.value.even.color):(i.currentTarget.style.background=q.value.odd.backgroundColor,i.currentTarget.style.color=q.value.odd.color)):(a.dataset.selected=`true`,E.value.rows.push({index:t,value:e}),Array.from(a.children).forEach((e,t)=>{e.dataset.row===`even`?(e.style.background=q.value.even.selectedNeighbors.backgroundColor,e.style.color=q.value.even.selectedNeighbors.color):(e.style.background=q.value.odd.selectedNeighbors.backgroundColor,e.style.color=q.value.odd.selectedNeighbors.color)}),i.currentTarget.dataset.row===`odd`?(i.currentTarget.style.background=q.value.odd.selectedCell.backgroundColor,i.currentTarget.style.color=q.value.odd.selectedCell.color):(i.currentTarget.style.background=q.value.even.selectedCell.backgroundColor,i.currentTarget.style.color=q.value.even.selectedCell.color)),E.value.rows=E.value.rows.sort((e,t)=>e.index-t.index),w.value.type===T.value.DONUT&&E.value.rows.length>0&&ar()}function Nr(e){E.value.col===e?(Dn.value=void 0,ur()):(Yn.value.forEach((t,n)=>{Mr({td:t.td[e],rowIndex:n,colIndex:e,headerType:T.value.NUMERIC,event:{currentTarget:document.getElementById(`cell_${n}_${e}_${mn}`)}})}),Dn.value=e)}async function Pr(e,t){M.value[t].includes(e)?M.value[t]=M.value[t].filter(t=>t!==e):M.value[t].push(e),await fe(),mr()}function Fr(e){wn.value[e]=gr(e).from!==k.value[e].from||gr(e).to!==k.value[e].to}function Ir(e,t){xn.value=e;let n=t.currentTarget;clearTimeout(gn.value),n.classList.add(`clicked`),gn.value=setTimeout(()=>{n.classList.remove(`clicked`)},200),I.value[e]===1?I.value[e]=T.value.DESC:I.value[e]=T.value.ASC,pr()}function Lr(e,t,n){let r=n.currentTarget;clearTimeout(gn.value),r.classList.add(`clicked`),gn.value=setTimeout(()=>{r.classList.remove(`clicked`)},200);let i=document.getElementById(`th_dropdown_${e}`);i.dataset.isOpen===`false`?i.dataset.isOpen=`true`:i.dataset.isOpen=`false`}function Rr(e){ur(),!e||!e.target.value?D.value=0:D.value=Number(e.target.value),Cr()}let zr=y(null);pe(()=>{if(C.dataset.header.length===0)throw Error(`vue-ui-table error: missing header data.
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.js";import{$ as n,C as r,D as i,Ft as a,Ht as o,Jt as ee,X as te,d as s,in as ne,nt as re,r as ie}from"./lib-rPeBMZrn.js";import{n as ae,t as oe}from"./useHints-C-TwxM0Y.js";import{t as se}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as c}from"./BaseIcon-Cm-IJ179.js";import{t as l}from"./vue-ui-xy-C-2Phexw.js";import{t as ce}from"./vue-ui-donut-BYUkblpv.js";import{Fragment as u,computed as d,createBlock as le,createCommentVNode as f,createElementBlock as p,createElementVNode as m,createTextVNode as h,createVNode as ue,defineAsyncComponent as de,nextTick as fe,normalizeClass as g,normalizeStyle as _,onMounted as pe,openBlock as v,ref as y,renderList as b,toDisplayString as x,unref as S,useCssVars as me,vModelSelect as he,vModelText as ge,watch as _e,withCtx as ve,withDirectives as ye,withKeys as be,withModifiers as xe}from"vue";var Se=/* @__PURE__ */ e({default:()=>dn}),Ce=[`innerHTML`],we=[`data-is-open`],Te={class:`vue-ui-table-export-hub-options`},Ee={class:`vue-ui-table-export-hub-option-wrapper`},De={class:`label`},Oe=[`innerHTML`],ke={class:`vue-ui-table-export-hub-option-wrapper`},Ae={class:`label`},je=[`innerHTML`],Me={class:`vue-ui-table-dialog-field`},Ne={class:`label vue-ui-table-dialog-input-label`,style:{width:`100%`}},Pe={style:{width:`fit-content`}},Fe={class:`vue-ui-table`},Ie={key:0},Le={key:0},Re={key:1},ze={key:0,style:{display:`flex`,"align-items":`center`,"justify-content":`flex-end`}},Be=[`innerHTML`],Ve={key:0,style:{"margin-left":`3px`}},He={key:0},Ue={class:`th-filter`},We={key:0,class:`th-date`},Ge={class:`date-wrapper--inputs`},Ke={class:`date-fieldset`},qe=[`for`],Je=[`id`,`onUpdate:modelValue`,`onInput`],Ye={class:`date-fieldset`},Xe=[`for`],Ze=[`id`,`onUpdate:modelValue`,`onInput`],Qe={class:`date-wrapper--button`},$e=[`onClick`],et=[`innerHTML`],tt=[`innerHTML`],nt=[`innerHTML`],rt=[`onClick`,`disabled`],it=[`placeholder`,`onUpdate:modelValue`,`name`],at=[`onClick`],ot=[`innerHTML`],st=[`innerHTML`],ct=[`innerHTML`],lt=[`onClick`,`innerHTML`],ut=[`innerHTML`],dt={key:5,class:`th-range-filter`},ft=[`for`],pt=[`id`,`max`,`min`,`onUpdate:modelValue`],mt=[`id`,`max`,`min`,`onUpdate:modelValue`],ht=[`for`],gt=[`onClick`,`disabled`],_t=[`id`],vt=[`onClick`],yt=[`onClick`,`onKeyup`],bt=[`innerHTML`,`onClick`,`onKeyup`],xt=[`data-row`],St=[`data-row`],Ct=[`data-row`,`onClick`,`onKeyup`,`id`],wt=[`innerHTML`],Tt={key:1},Et={key:2},Dt={key:5},Ot=[`innerHTML`],kt={key:0},At={style:{"margin-left":`12px`}},jt={class:`format-num`},Mt={style:{"margin-left":`12px`}},Nt={key:0,class:`format-num`},Pt={key:1,class:`format-num`},Ft={key:2},It={style:{"margin-left":`12px`}},Lt={key:0,class:`format-num`},Rt={key:1,class:`format-num`},zt={key:2},Bt={key:1,class:`vue-ui-table-paginator format-num`},Vt={key:2,class:`vue-ui-table-size-warning`},Ht=[`innerHTML`],Ut={key:4,class:`vue-ui-table-pagination format-num`},Wt=[`innerHTML`,`disabled`],Gt=[`disabled`],Kt={for:`pageScroller`,style:{"font-size":`14px`}},qt=[`max`,`value`],Jt={key:1},Yt=[`disabled`],Xt=[`innerHTML`,`disabled`],Zt={class:`vue-ui-table-chart-modal-options`},Qt=[`innerHTML`],$t=[`innerHTML`],en=[`innerHTML`],tn={style:{width:`100%`,height:`fit-content`}},nn={class:`vue-ui-table-fieldset`},rn={class:`vue-ui-table-fieldset-wrapper`},an=[`name`,`id`,`checked`,`onInput`],on=[`for`],sn=[`disabled`],cn=[`innerHTML`],ln={style:{width:`100%`,"margin-bottom":`12px`}},un={key:2,style:{width:`100%`,"margin-bottom":`32px`}},dn=/*#__PURE__*/ se({__name:`vue-ui-table`,props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:[`page-change`],setup(e,{expose:se,emit:Se}){me(e=>({v6b779b9d:Ln.value,v71f90aa0:Rn.value,v82bf5584:Hn.value,bc0e3a90:zn.value,v4bc5be6a:Un.value,v542dfbf0:Wn.value,v5935dfae:Bn.value,v23648322:Vn.value,v98d33e98:Gn.value}));let dn=de(()=>import(`./BaseDraggableDialog-DHgIPVmz.js`).then(e=>e.n)),C=e,fn=Se,{vue_ui_table:pn}=t(),mn=te();y(null);let hn=y(null),gn=y(null),w=y({height:316,type:`bar`,width:512}),T=y({ASC:1,BAR:`bar`,DATE:`date`,DESC:-1,DONUT:`donut`,LINE:`line`,NUMERIC:`numeric`,PERCENTAGE:`percentage`,TEXT:`text`}),_n=y(100),vn=y(100);y(0),y(0),y(400),y(200);let yn=y({CELL:`smart-td-selected`,FIRST_TD:`smart-td-selected-first`,LAST_TD:`smart-td-selected-last`,ROW:`smart-td-selected-neighbor`}),bn=y(void 0),xn=y(void 0),E=y({col:void 0,rows:[]}),D=y(0),O=y(20),Sn=y(!1),Cn=y(!1),k=y({}),A=y({}),wn=y({}),j=y({}),M=y({}),N=y({}),P=y({}),F=y({}),I=y({}),Tn=y(C.config.rowsPerPage?C.config.rowsPerPage:25),En=y([.../* @__PURE__ */ new Set([10,25,50,100,250,500,C.config.rowsPerPage?C.config.rowsPerPage:25,C.dataset.body.length])].sort((e,t)=>e-t)),Dn=y(void 0),L=y(void 0),On=y(void 0),R=y(!1),kn=y(0),An=y(``),jn=y(``),z=y(!1),B=y(JSON.parse(JSON.stringify(C.dataset.body)).map((e,t)=>({...e,absoluteIndex:t}))),Mn=y(JSON.parse(JSON.stringify(C.dataset.body)).map((e,t)=>({...e,absoluteIndex:t}))),V=y(JSON.parse(JSON.stringify(C.dataset.header)).map((e,t)=>({average:Object.hasOwn(e,`average`)?e.average:!1,decimals:Object.hasOwn(e,`decimals`)?e.decimals:0,isMultiselect:Object.hasOwn(e,`isMultiselect`)?e.isMultiselect:!1,isPercentage:Object.hasOwn(e,`isPercentage`)?e.isPercentage:!1,isSearch:Object.hasOwn(e,`isSearch`)?e.isSearch:!1,isSort:Object.hasOwn(e,`isSort`)?e.isSort:!1,name:e.name,percentageTo:Object.hasOwn(e,`percentageTo`)?e.percentageTo:void 0,prefix:Object.hasOwn(e,`prefix`)?e.prefix:``,rangeFilter:Object.hasOwn(e,`rangeFilter`)?e.rangeFilter:!1,suffix:Object.hasOwn(e,`suffix`)?e.suffix:``,sum:Object.hasOwn(e,`sum`)?e.sum:!1,type:e.type,index:t}))),Nn=d(()=>hn.value?hn.value.getBoundingClientRect().height+3:3),H=d(()=>{if(!Object.keys(C.config||{}).length)return pn;let e=ne({defaultConfig:pn,userConfig:C.config});return r(e)}),U=d(()=>H.value.style.exportMenu),W=d(()=>H.value.style.title),G=d(()=>H.value.style.th),K=d(()=>H.value.style.inputs),Pn=d(()=>H.value.style.dropdowns),Fn=d(()=>H.value.style.closeButtons),q=d(()=>H.value.style.rows),J=d(()=>H.value.style.pagination),Y=d(()=>H.value.style.chart),In=d(()=>H.value.style);ae({config:()=>H.value,dataset:()=>C.dataset,component:`VueUiTable`,rules:[oe.noHint]});let X=d(()=>H.value.useCursorPointer),Ln=d(()=>G.value.buttons.cancel.inactive.backgroundColor),Rn=d(()=>G.value.buttons.cancel.inactive.color),zn=d(()=>G.value.buttons.cancel.active.backgroundColor),Bn=d(()=>G.value.buttons.filter.active.backgroundColor),Vn=d(()=>G.value.buttons.filter.active.color),Hn=d(()=>a(zn.value,.33)),Un=d(()=>ee(zn.value,33)),Wn=d(()=>a(Bn.value,.33)),Gn=d(()=>ee(Bn,33)),Kn=d(()=>[...V.value].filter(e=>e.type===T.value.DATE)),qn=d(()=>[``,...Kn.value.map(e=>e.name)]),Jn=d(()=>{let e=Kn.value.find(e=>e.name===An.value);return e?e.index:null}),Z=d(()=>{let e=[];if(B.value.length)for(let t=0;t<B.value.length;t+=Tn.value)e.push(B.value.slice(t,t+Tn.value));return e}),Yn=d(()=>Z.value[D.value]),Xn=d(()=>Jn.value==null?[]:Yn.value.map(e=>e.td[Jn.value])),Zn=d(()=>Object.keys(M.value).map(e=>({index:e,name:C.dataset.header[e].name,options:M.value[e]}))),Qn=d(()=>H.value.useChart&&E.value.rows.length>1),$n=d(()=>C.dataset.header.map(e=>e.type).includes(T.value.NUMERIC)),Q=d(()=>({arrowSort:`<svg xmlns="http://www.w3.org/2000/svg" width="${O.value}" height="${O.value}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M3 9l4 -4l4 4m-4 -4v14" /><path d="M21 15l-4 4l-4 -4m4 4v-14" /></svg>`,bar:`<svg xmlns="http://www.w3.org/2000/svg" width="${O.value}" height="${O.value}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M3 12m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v6a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z" /><path d="M9 8m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v10a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z" /><path d="M15 4m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v14a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z" /><path d="M4 20l14 0" /></svg>`,chart:`<svg xmlns="http://www.w3.org/2000/svg" width="${O.value}" height="${O.value}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 19l16 0" /><path d="M4 15l4 -6l4 2l4 -5l4 4" /></svg>`,chevronDown:`<svg xmlns="http://www.w3.org/2000/svg" width="${O.value}" height="${O.value}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M6 9l6 6l6 -6" /></svg>`,chevronLeft:`<svg xmlns="http://www.w3.org/2000/svg" width="${O.value*1.6}" height="${O.value*1.6}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M15 6l-6 6l6 6" /></svg>`,chevronRight:`<svg xmlns="http://www.w3.org/2000/svg" width="${O.value*1.6}" height="${O.value*1.6}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M9 6l6 6l-6 6" /></svg>`,donut:`<svg xmlns="http://www.w3.org/2000/svg" width="${O.value*.8}" height="${O.value*.8}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 3v5m4 4h5" /><path d="M8.929 14.582l-3.429 2.918" /><path d="M12 12m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0" /><path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" /></svg>`,export:`<svg xmlns="http://www.w3.org/2000/svg" width="${O.value}" height="${O.value}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12.5 21h-7.5a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v7.5" /><path d="M3 10h18" /><path d="M10 3v18" /><path d="M16 19h6" /><path d="M19 16l3 3l-3 3" /></svg>`,fileDownload:`<svg xmlns="http://www.w3.org/2000/svg" width="${O.value}" height="${O.value}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M14 3v4a1 1 0 0 0 1 1h4" /><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z" /><path d="M12 17v-6" /><path d="M9.5 14.5l2.5 2.5l2.5 -2.5" /></svg>`,filter:`<svg xmlns="http://www.w3.org/2000/svg" width="${O.value}" height="${O.value}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z" /></svg>`,move:`<svg xmlns="http://www.w3.org/2000/svg" width="${O.value}" height="${O.value}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 9l3 3l-3 3" /><path d="M15 12h6" /><path d="M6 9l-3 3l3 3" /><path d="M3 12h6" /><path d="M9 18l3 3l3 -3" /><path d="M12 15v6" /><path d="M15 6l-3 -3l-3 3" /><path d="M12 3v6" /></svg>`,sort09:`<svg xmlns="http://www.w3.org/2000/svg" width="${O.value}" height="${O.value}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 15l3 3l3 -3" /><path d="M7 6v12" /><path d="M17 3a2 2 0 0 1 2 2v3a2 2 0 1 1 -4 0v-3a2 2 0 0 1 2 -2z" /><path d="M17 16m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" /><path d="M19 16v3a2 2 0 0 1 -2 2h-1.5" /></svg>`,sort90:`<svg xmlns="http://www.w3.org/2000/svg" width="${O.value}" height="${O.value}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 15l3 3l3 -3" /><path d="M7 6v12" /><path d="M17 14a2 2 0 0 1 2 2v3a2 2 0 1 1 -4 0v-3a2 2 0 0 1 2 -2z" /><path d="M17 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" /><path d="M19 5v3a2 2 0 0 1 -2 2h-1.5" /></svg>`,sortAZ:`<svg xmlns="http://www.w3.org/2000/svg" width="${O.value}" height="${O.value}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M15 10v-5c0 -1.38 .62 -2 2 -2s2 .62 2 2v5m0 -3h-4" /><path d="M19 21h-4l4 -7h-4" /><path d="M4 15l3 3l3 -3" /><path d="M7 6v12" /></svg>`,sortZA:`<svg xmlns="http://www.w3.org/2000/svg" width="${O.value}" height="${O.value}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M15 21v-5c0 -1.38 .62 -2 2 -2s2 .62 2 2v5m0 -3h-4" /><path d="M19 10h-4l4 -7h-4" /><path d="M4 15l3 3l3 -3" /><path d="M7 6v12" /></svg>`,sum:`<svg xmlns="http://www.w3.org/2000/svg" width="${O.value}" height="${O.value}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>`,table:`<svg xmlns="http://www.w3.org/2000/svg" width="${O.value}" height="${O.value}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" fill="white" d="M 10 2, 21 2, 21 21, 10 21Z"/><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14z" /><path d="M3 10h18" /><path d="M10 3v18" /></svg>`,warning:`<svg xmlns="http://www.w3.org/2000/svg" width="${O.value*.8}" height="${O.value*.8}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10.24 3.957l-8.422 14.06a1.989 1.989 0 0 0 1.7 2.983h16.845a1.989 1.989 0 0 0 1.7 -2.983l-8.423 -14.06a1.989 1.989 0 0 0 -3.4 0z" /><path d="M12 9v4" /><path d="M12 17h.01" /></svg>`,grip:`<svg xmlns="http://www.w3.org/2000/svg" width="${O.value}" height="${O.value}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><path d="M5 9m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" /><path d="M5 15m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" /><path d="M12 9m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" /><path d="M12 15m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" /><path d="M19 9m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" /><path d="M19 15m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" /></svg>`})),er=d(()=>B.value.map(e=>e.td)),tr=d(()=>({sumPercentage:Number((E.value.rows.map(e=>e.value).reduce((e,t)=>e+t,0)*100).toFixed(C.dataset.header[E.value.col].decimals)).toLocaleString(),sumRegular:Number(E.value.rows.map(e=>e.value).reduce((e,t)=>e+t,0).toFixed(C.dataset.header[E.value.col].decimals)).toLocaleString(),averagePercentage:Number((E.value.rows.map(e=>e.value).reduce((e,t)=>e+t,0)/E.value.rows.length*100).toFixed(C.dataset.header[E.value.col].decimals)).toLocaleString(),averageRegular:Number((E.value.rows.map(e=>e.value).reduce((e,t)=>e+t,0)/E.value.rows.length).toFixed(C.dataset.header[E.value.col].decimals)).toLocaleString()})),nr=y({width:1e3,height:500});function rr({width:e,height:t}){nr.value={width:e,height:t}}let ir=d(()=>{if(!Qn.value)return[];let e=nr.value.height,t=nr.value.width,n=t/E.value.rows.length,r=Math.max(...E.value.rows.map(e=>e.value)),i=Math.min(...E.value.rows.map(e=>e.value)),o=C.dataset.header[E.value.col].isPercentage&&C.dataset.header[E.value.col].percentageTo,ee=w.value.type===T.value.DONUT&&L.value&&L.value.name,te=C.dataset.header[E.value.col].name+(o?` / ${C.dataset.header[N.value[E.value.col].referenceIndex].name}`:``)+(ee?` ${H.value.translations.by} ${L.value.name}`:``),ne=C.dataset.header[E.value.col].prefix,re=C.dataset.header[E.value.col].suffix,ae=[{name:te,series:E.value.rows.map(e=>e.value),type:`line`,useProgression:!0,smooth:Y.value.layout.line.smooth,color:Y.value.layout.line.stroke,useArea:Y.value.layout.line.useArea}],oe=[{name:te,series:E.value.rows.map(e=>e.value),type:`bar`,useProgression:!0,color:Y.value.layout.bar.fill}],se=Y.value.modal.backgroundColor,c=ie(se),l=C.dataset.header[E.value.col].decimals,ce={useCssAnimation:!1,chart:{width:t,height:e-250,backgroundColor:se,color:c,labels:{fontSize:18,prefix:ne,suffix:re},grid:{stroke:a(c,.5),labels:{color:c,xAxisLabels:{color:c,show:Xn.value.length,values:Xn.value,datetimeFormatter:Y.value.layout.datetimeFormatter,showOnlyAtModulo:Y.value.layout.timeLabels.showOnlyAtModulo,modulo:Y.value.layout.timeLabels.modulo}}},highlighter:{color:c},legend:{color:c,show:!1},title:{text:te,color:c,textAlign:`center`,fontSize:18},tooltip:{showTimeLabel:Xn.value.length,backgroundOpacity:30,color:c,backgroundColor:se,showPercentage:!1,roundingValue:l},userOptions:{buttons:{pdf:!1,csv:!1,table:!1,annotator:!1}},zoom:{show:Y.value.layout.zoom.show,autoFit:Y.value.layout.zoom.autoFit,focusOnDrag:!0,minimap:{show:!0}}},line:{labels:{show:!0,color:c,rounding:l},dot:{useSerieColor:!1,fill:Y.value.layout.line.plot.fill,strokeWidth:Y.value.layout.line.plot.strokeWidth}},bar:{useGradient:!1,border:{useSerieColor:!1,stroke:Y.value.layout.bar.stroke,strokeWidth:Y.value.layout.bar.strokeWidth},labels:{show:!0,color:c,rounding:l}}},u=i>=0?0:Math.abs(i),d=r+u,le=C.dataset.header[E.value.col].isPercentage,f=E.value.rows.map((t,r)=>({x:n*r+n/2,y:(1-(t.value+u)/d)*e,value:le?t.value*100:t.value,suffix:le?`%`:C.dataset.header[E.value.col].suffix?C.dataset.header[E.value.col].suffix:``,prefix:C.dataset.header[E.value.col].prefix?C.dataset.header[E.value.col].prefix:``,index:t.index,absoluteValue:le?Math.abs(t.value)*100:Math.abs(t.value)}));return{donutConfig:{useCssAnimation:!1,userOptions:{position:`left`,buttons:{pdf:!1,csv:!1,table:!1,annotator:!1}},style:{chart:{backgroundColor:se,color:c,layout:{curvedMarkers:!0,donut:{strokeWidth:64},labels:{dataLabels:{suffix:le?`%`:``,prefix:ne},value:{rounding:l},percentage:{color:c,rounding:l},name:{color:c},hollow:{average:{color:c,text:H.value.translations.average,value:{color:c}},total:{color:c,offsetY:-12,text:H.value.translations.total,value:{color:c,offsetY:-12}}}}},legend:{backgroundColor:se,color:c,roundingValue:l,roundingPercentage:l},padding:{left:12,right:12},title:{text:te,color:c,fontSize:18},tooltip:{backgroundOpacity:30,color:c,backgroundColor:se,roundingValue:l,roundingValue:l}}}},xyConfig:ce,xyDatasetLine:ae,xyDatasetBar:oe,progression:f.length>=2&&s(f)}});function ar(){let e=L.value.options.map((e,t)=>({name:e,color:o[t]||o[t%o.length],values:[Yn.value.filter((t,n)=>t.td[L.value.index]===e&&E.value.rows.map(e=>e.index).includes(n)).map(e=>e.td[E.value.col]).reduce((e,t)=>Math.abs(e)+Math.abs(t),0)],absoluteValue:Yn.value.filter((t,n)=>t.td[L.value.index]===e&&E.value.rows.map(e=>e.index).includes(n)).map(e=>e.td[E.value.col]).reduce((e,t)=>e+t,0)})).sort((e,t)=>t.value-e.value);bn.value=e,fe(()=>{w.value.type=T.value.DONUT,z.value=!1})}function or(e,t){return!A.value[e]&&(t.isSort||t.isSearch||t.isMultiselect||t.rangeFilter)&&![T.value.DATE].includes(t.type)}function sr(e=`all`){let t=C.dataset.header.map(e=>e.name),n=e===`all`?B.value.map(e=>e.td):Yn.value.map(e=>e.td),r=[t].concat(n),a=i(r);re({csvContent:a,title:jn.value})}function cr(){let e=document.getElementsByClassName(`th-dropdown`);e.length&&Array.from(e).forEach(e=>{e.dataset.isOpen=!1})}function lr(e,t){let n;clearTimeout(n),n=setTimeout(e,t)}function ur(){let e=document.getElementsByClassName(`tr_${mn}`);Array.from(e).forEach(e=>{Array.from(e.getElementsByTagName(`td`)).forEach(e=>{e.dataset.row===`even`?(e.style.background=q.value.even.backgroundColor,e.style.color=q.value.even.color):(e.style.background=q.value.odd.backgroundColor,e.style.color=q.value.odd.color)})}),Array.from(e).forEach(e=>e.dataset.selected=`false`),D.value>Z.value.length-1&&(D.value=Z.value.length-1),R.value=!1,bn.value=void 0,Dn.value=void 0,w.value.type=T.value.BAR,E.value={col:void 0,rows:[]},_n.value=100,vn.value=100}function dr(e,t){B.value=e.filter(e=>e.td[t]>=P.value[t].min&&e[t]<=P.value[t].max)}function fr(e,t){if(I.value[t]===T.value.ASC&&(e=e.sort((e,n)=>e[t]-n[t])),I.value[t]===T.value.DESC)e=e.sort((e,n)=>n[t]-e[t]);else return 0}function pr(){ur(),Object.keys(P.value).forEach(e=>{dr(B.value,e)}),Object.keys(I.value).forEach(e=>{fr(B.value,e)}),xn.value!==void 0&&fr(B.value,xn.value),C.dataset.header.forEach((e,t)=>{if(e.isPercentage){let e=N.value[t].referenceIndex,n=B.value.map(t=>t.td[e]).reduce((e,t)=>e+t,0);B.value.forEach(r=>{r.td[t]=r.td[e]/n})}}),D.value>Z.value.length-1&&(D.value=Z.value.length-1),[-1].includes(D.value)&&(D.value=0)}function mr(){B.value=Mn.value.filter(e=>{for(let t in F.value)if(!e.td[t].toUpperCase().includes(F.value[t].toUpperCase()))return!1;for(let t in M.value)if(!M.value[t].some(n=>n===e.td[t]))return!1;for(let t in k.value){let n=new Date(e.td[t]),r=new Date(k.value[t].from),i=new Date(k.value[t].to);if(n<r||n>i)return!1}return!0}),pr()}function hr(e){return er.value.map(t=>t[e]).map(e=>isNaN(Number(e))?0:e).reduce((e,t)=>e+t,0)/B.value.length}function gr(e){let t=C.dataset.body.map(t=>new Date(t.td[e])),n=new Date(Math.min(...t)),r=new Date(Math.max(...t)),i=n.getFullYear(),a=r.getFullYear(),o=String(n.getMonth()+1).padStart(2,`0`),ee=String(r.getMonth()+1).padStart(2,`0`),te=String(n.getDate()).padStart(2,`0`),s=String(r.getDate()).padStart(2,`0`);return{from:`${i}-${o}-${te}`,to:`${a}-${ee}-${s}`}}function $(e){return[...new Set(C.dataset.body.map(t=>t.td[e]))]}function _r(e){return er.value.map(t=>t[e]).map(e=>isNaN(Number(e))?0:e).reduce((e,t)=>e+t,0)}function vr(e){return e.includes(NaN)}function yr(e,t){return!M.value[t]||M.value[t].includes(e)}function br(e){return!isNaN(Number(String(e).replaceAll(`%`,``)))}function xr(e,t){let n=t.isSort,r=t.isSearch,i=t.isMultiselect&&M.value[e],a=t.rangeFilter,o=e=>{if(a&&P.value[e])return Math.round(P.value[e].min)===j.value[e].min&&Math.round(P.value[e].max)===j.value[e].max};if(n&&r&&i&&a)return[``,void 0].includes(F.value[e])&&[void 0].includes(I.value[e])&&M.value[e].length===$(e).length&&o(e);if(n&&r&&i)return[``,void 0].includes(F.value[e])&&[void 0].includes(I.value[e])&&M.value[e].length===$(e).length;if(n&&r&&a)return[``,void 0].includes(F.value[e])&&[void 0].includes(I.value[e])&&o(e);if(n&&r)return[``,void 0].includes(F.value[e])&&[void 0].includes(I.value[e]);if(n&&i&&a)return[void 0].includes(I.value[e])&&M.value[e].length===$(e).length&&o(e);if(n&&i)return[void 0].includes(I.value[e])&&M.value[e].length===$(e).length;if(r&&i&&a)return[``,void 0].includes(F.value[e])&&M.value[e].length===$(e).length&&o(e);if(r&&i)return[``,void 0].includes(F.value[e])&&M.value[e].length===$(e).length;if(r&&a)return[``,void 0].includes(F.value[e])&&o(e);if(r)return[``,void 0].includes(F.value[e]);if(n&&a)return[void 0].includes(I.value[e])&&o(e);if(n)return[void 0].includes(I.value[e]);if(i&&a)return M.value[e].length===$(e).length&&o(e);if(i)return M.value[e].length===$(e).length}function Sr(){return{totalPages:Z.value.length,itemsPerPage:Tn.value,currentPage:D.value,currentPageData:Yn.value.map(e=>e.td)}}se({getCurrentPageData:Sr});function Cr(){fn(`page-change`,Sr())}let wr=y(null);function Tr(e){if(ur(),e===`next`&&D.value<Z.value.length){if(D.value+1>Z.value.length-1)return;D.value+=1}else if(e===`previous`&&D.value>=1)--D.value;else{if(e-1<0||e>Z.value.length||e===`previous`)return;D.value=e-1}Cr(),wr.value&&wr.value.scrollTo({top:0,left:0,behavior:`smooth`})}function Er(e){e.preventDefault();let t=e.keyCode;if(![38,40,37,39].includes(t))return;let n=e.target.id.match(/cell_(\d+)_(\d+)_([0-9a-fA-F-]{36})/),r=parseInt(n[1]),i=parseInt(n[2]),a=document.getElementById(`cell_${r}_${i+1}_${mn}`),o=document.getElementById(`cell_${r}_${i-1}_${mn}`),ee=document.getElementById(`cell_${r+1}_${i}_${mn}`),te=document.getElementById(`cell_${r-1}_${i}_${mn}`),s;switch(!0){case t===39:s=a;break;case t===37:s=o;break;case t===38:s=te;break;case t===40:s=ee;break;default:return}s&&(s.focus(),s.scrollIntoView({behavior:`smooth`,block:`center`}))}function Dr(e){let t=0;for(let n=0;n<e.length;n+=1)t+=e.charCodeAt(n);return t}async function Or(){return new Promise(e=>{let t=[];V.value.forEach((e,n)=>{if(e.isSearch&&Object.assign(F.value,{[n]:``}),e.isMultiselect&&Object.assign(M.value,{[n]:$(n)}),e.type===T.value.DATE&&(Object.assign(k.value,{[n]:gr(n)}),Object.assign(wn.value,{[n]:!1})),(e.isPercentage||e.percentageTo)&&Object.assign(N.value,{[n]:{reference:e.percentageTo,referenceIndex:C.dataset.header.map(e=>e.name).indexOf(e.percentageTo)}}),e.rangeFilter&&(Object.assign(P.value,{[n]:{min:Math.round(Math.min(...C.dataset.body.map(e=>e.td).map(e=>e[n]))),max:Math.round(Math.max(...C.dataset.body.map(e=>e.td).map(e=>e[n])))}}),Object.assign(j.value,{[n]:{min:Math.round(Math.min(...C.dataset.body.map(e=>e.td).map(e=>e[n]))),max:Math.round(Math.max(...C.dataset.body.map(e=>e.td).map(e=>e[n])))}})),e.isPercentage){let r=C.dataset.header.map(e=>e.name).indexOf(e.percentageTo),i=C.dataset.body.map(e=>e.td[r]).reduce((e,t)=>e+t,0);t.push([n,r,i])}e.type===T.value.NUMERIC&&!e.isPercentage&&Object.assign(A.value,{[n]:vr(C.dataset.body.map(e=>Number(e.td[n])))})}),B.value.forEach((e,n)=>{t.map(t=>{let[n,r,i]=t;e.td[n]=e.td[r]/i}),e.td.forEach((t,r)=>{C.dataset.header[r].type===T.value.TEXT&&C.dataset.header[r].isSearch&&(e[r]=Dr(t)),C.dataset.header[r].type===T.value.DATE&&(e[r]=new Date(t).getTime()),C.dataset.header[r].type===T.value.NUMERIC&&(e[r]=isNaN(Number(t))?r:t),Mn.value[n][r]=e[r]})}),e(!0)})}function kr(e,t){return new Promise((n,r)=>{e().then(e=>{try{n(t(e))}catch(e){r(e)}}).catch(e=>{r(e)})})}async function Ar(e){k.value[e]={from:gr(e).from,to:gr(e).to},wn.value[e]=!1,await fe(),mr()}function jr(e,t,n){let r=n.currentTarget;clearTimeout(gn.value),r.classList.add(`clicked`),gn.value=setTimeout(()=>{r.classList.remove(`clicked`)},200),xn.value=void 0,t.rangeFilter&&(P.value[e].min=j.value[e].min,P.value[e].max=j.value[e].max),t.isMultiselect?(M.value[e]=$(e),t.type===T.value.TEXT&&(I.value[e]=void 0),t.isSearch&&(F.value[e]=``)):t.type===T.value.NUMERIC?I.value[e]=void 0:t.type===T.value.TEXT?(I.value[e]=void 0,F.value[e]=``):t.type===T.value.DATE&&(I.value[e]=void 0),mr()}function Mr({td:e,rowIndex:t,colIndex:n,headerType:r,event:i}){if(r!==T.value.NUMERIC||isNaN(Number(e))){ur();return}E.value.col!==n&&ur();let a=i.currentTarget.parentNode;E.value.col=n,E.value.rows.map(e=>e.index).includes(t)?(a.dataset.selected=`false`,E.value.rows=E.value.rows.filter(e=>e.index!==t),i.currentTarget.classList.remove(yn.value.CELL),Array.from(a.children).forEach((e,t)=>{e.dataset.row===`even`?(e.style.background=q.value.even.backgroundColor,e.style.color=q.value.even.olor):(e.style.background=q.value.odd.backgroundColor,e.style.color=q.value.odd.color)}),i.currentTarget.dataset.row===`even`?(i.currentTarget.style.background=q.value.even.backgroundColor,i.currentTarget.style.color=q.value.even.color):(i.currentTarget.style.background=q.value.odd.backgroundColor,i.currentTarget.style.color=q.value.odd.color)):(a.dataset.selected=`true`,E.value.rows.push({index:t,value:e}),Array.from(a.children).forEach((e,t)=>{e.dataset.row===`even`?(e.style.background=q.value.even.selectedNeighbors.backgroundColor,e.style.color=q.value.even.selectedNeighbors.color):(e.style.background=q.value.odd.selectedNeighbors.backgroundColor,e.style.color=q.value.odd.selectedNeighbors.color)}),i.currentTarget.dataset.row===`odd`?(i.currentTarget.style.background=q.value.odd.selectedCell.backgroundColor,i.currentTarget.style.color=q.value.odd.selectedCell.color):(i.currentTarget.style.background=q.value.even.selectedCell.backgroundColor,i.currentTarget.style.color=q.value.even.selectedCell.color)),E.value.rows=E.value.rows.sort((e,t)=>e.index-t.index),w.value.type===T.value.DONUT&&E.value.rows.length>0&&ar()}function Nr(e){E.value.col===e?(Dn.value=void 0,ur()):(Yn.value.forEach((t,n)=>{Mr({td:t.td[e],rowIndex:n,colIndex:e,headerType:T.value.NUMERIC,event:{currentTarget:document.getElementById(`cell_${n}_${e}_${mn}`)}})}),Dn.value=e)}async function Pr(e,t){M.value[t].includes(e)?M.value[t]=M.value[t].filter(t=>t!==e):M.value[t].push(e),await fe(),mr()}function Fr(e){wn.value[e]=gr(e).from!==k.value[e].from||gr(e).to!==k.value[e].to}function Ir(e,t){xn.value=e;let n=t.currentTarget;clearTimeout(gn.value),n.classList.add(`clicked`),gn.value=setTimeout(()=>{n.classList.remove(`clicked`)},200),I.value[e]===1?I.value[e]=T.value.DESC:I.value[e]=T.value.ASC,pr()}function Lr(e,t,n){let r=n.currentTarget;clearTimeout(gn.value),r.classList.add(`clicked`),gn.value=setTimeout(()=>{r.classList.remove(`clicked`)},200);let i=document.getElementById(`th_dropdown_${e}`);i.dataset.isOpen===`false`?i.dataset.isOpen=`true`:i.dataset.isOpen=`false`}function Rr(e){ur(),!e||!e.target.value?D.value=0:D.value=Number(e.target.value),Cr()}let zr=y(null);pe(()=>{if(C.dataset.header.length===0)throw Error(`vue-ui-table error: missing header data.
|
|
2
2
|
Provide an array of objects of type:
|
|
3
3
|
{
|
|
4
4
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.js";import{D as n,Tt as r,X as i,at as ee,m as a,nt as te,r as ne,zt as re}from"./lib-rPeBMZrn.js";import{n as ie,t as ae}from"./useHints-
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.js";import{D as n,Tt as r,X as i,at as ee,m as a,nt as te,r as ne,zt as re}from"./lib-rPeBMZrn.js";import{n as ie,t as ae}from"./useHints-C-TwxM0Y.js";import{t as o}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as oe}from"./resolveChartConfig-CIhClE5R.js";import{n as se,t as ce}from"./userOptionsSlots-DYuo-E5m.js";import{t as le}from"./usePrinter-DVf3YcG5.js";import{t as ue}from"./Shape-CRe8woTu.js";import{t as de}from"./useUserOptionState-CXlFnwPv.js";import{t as fe}from"./vue_ui_table_heatmap-vfeY6r97.js";import{Fragment as s,computed as c,createBlock as pe,createCommentVNode as l,createElementBlock as u,createElementVNode as d,createSlots as me,createVNode as he,defineAsyncComponent as ge,guardReactiveProps as _e,mergeProps as f,nextTick as ve,normalizeClass as p,normalizeProps as ye,normalizeStyle as m,onMounted as h,openBlock as g,ref as _,renderList as v,renderSlot as y,unref as b,useCssVars as be,useSlots as xe,watch as x,withCtx as S}from"vue";var C=/* @__PURE__ */ e({default:()=>N}),w=[`id`],T={role:`cell`},E={role:`row`},D=[`data-cell`],O={key:0,style:{display:`flex`,"flex-direction":`row`,gap:`2px`,"align-items":`center`}},k=[`height`,`width`],A={key:0,role:`cell`,"data-cell":`sum`},j={key:1,role:`cell`,"data-cell":`average`},M={key:2,role:`cell`,"data-cell":`median`},Se={key:1,ref:`source`,dir:`auto`},N=/*#__PURE__*/ o({__name:`vue-ui-table-heatmap`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(e,{expose:o}){be(e=>({v63f427d8:ke.value,v4016fab3:Oe.value}));let C=ge(()=>import(`./UserOptions-uWHV_zPB.js`).then(e=>e.n)),{vue_ui_table_heatmap:N}=t(),P=e,F=_(i()),I=_(!1),L=_(null),R=_(!1),z=_(0),Ce=xe(),B=c({get:()=>G(),set:e=>e}),V=c(()=>B.value.debug);h(()=>{Ce[`chart-background`]&&V.value&&console.warn(`VueUiTableHeatmap does not support the #chart-background slot.`)}),ie({config:()=>B.value,dataset:()=>P.dataset,component:`VueUiTableHeatmap`,rules:[ae.emptyArray,{test:e=>e.length>31,message:[`👀 The number of series is > 31. Consider:`,``,`▶️ Using filters to let users choose a maximum number of series to display.`]},{test:e=>e.some(e=>e?.values&&e?.values.length>31),message:[`👀 Some series have a number of data points > 31. Consider:`,``,`▶️ Using filters to let users choose a maximum number of data points to display.`]}]});let{userOptionsVisible:H,setUserOptionsVisibility:U,keepUserOptionState:W}=de({config:B.value});function G(){return oe(P.config,N,fe)}x(()=>P.config,e=>{B.value=G(),H.value=!B.value.userOptions.showOnChartHover,Y()},{deep:!0});let{isPrinting:we,isImaging:Te,generatePdf:K,generateImage:q}=le({elementId:`table_heatmap_${F.value}`,fileName:`vue-ui-table-heatmap`,options:B.value.userOptions.print}),J=c(()=>B.value.table.responsiveBreakpoint),Ee=c(()=>!!P.dataset&&P.dataset.length);h(()=>{Y()});function Y(){re(P.dataset)&&ee({componentName:`VueUiTableHeatmap`,type:`dataset`,debug:V.value});let e=new ResizeObserver(e=>{e.forEach(e=>{I.value=e.contentRect.width<J.value})});L.value&&e.observe(L.value)}let X=c(()=>P.dataset.map(e=>{let t=e.values.map(e=>isNaN(e)?0:e),n=t.reduce((e,t)=>e+t,0);return{...e,values:t,serieExtremes:{max:Math.max(...t),min:Math.min(...t)},sum:n,average:n/t.length,median:a(t),displayValues:[e.name,...e.values],id:i()}})),Z=c(()=>{let e=X.value.flatMap(e=>e.values);return{min:Math.min(...e),max:Math.max(...e)}});function De(e,t){let n=B.value.style.heatmapColors.useIndividualScale;return r(B.value.style.heatmapColors.min,B.value.style.heatmapColors.max,n?t.min:Z.value.min,n?t.max:Z.value.max,e)}let Q=c(()=>X.value.map(e=>({...e,colors:e.displayValues.map(t=>isNaN(t)?B.value.style.backgroundColor:De(t,e.serieExtremes))}))),Oe=c(()=>B.value.style.backgroundColor),ke=c(()=>`${B.value.table.borderWidth}px`);function $(e=null){ve(()=>{let t=Q.value.map(e=>[[e.name],e.displayValues,[e.sum],[e.average],[e.median]]),r=[[[``],B.value.table.head.values,[`sum`],[`average`],[`median`]]].concat(t),i=n(r);e?e(i):te({csvContent:i,title:`vue-ui-table-heatmap`})})}function Ae(e){R.value=e,z.value+=1}return o({generatePdf:K,generateCsv:$,generateImage:q}),(e,t)=>(g(),u(`div`,{ref_key:`tableContainer`,ref:L,style:m(`width:100%; overflow-x:auto; container-type: inline-size;padding-top:${B.value.userOptions.show?`36px`:``}; ${R.value?`vue-data-ui-wrapper-fullscreen`:``}; position:relative;`),class:p({"vue-data-ui-component":!0,"vue-ui-responsive":I.value}),id:`table_heatmap_${F.value}`,onMouseenter:t[0]||=()=>b(U)(!0),onMouseleave:t[1]||=()=>b(U)(!1)},[B.value.userOptions.show&&Ee.value&&(b(W)||b(H))?(g(),pe(b(C),{ref:`details`,key:`user_option_${z.value}`,backgroundColor:B.value.style.backgroundColor,color:B.value.style.color,isPrinting:b(we),isImaging:b(Te),uid:F.value,hasPdf:B.value.userOptions.buttons.pdf,hasXls:B.value.userOptions.buttons.csv,hasImg:B.value.userOptions.buttons.img,hasFullscreen:B.value.userOptions.buttons.fullscreen,isFullscreen:R.value,titles:{...B.value.userOptions.buttonTitles},chartElement:L.value,position:B.value.userOptions.position,callbacks:B.value.userOptions.callbacks,printScale:B.value.userOptions.print.scale,onToggleFullscreen:Ae,onGeneratePdf:b(K),onGenerateCsv:$,onGenerateImage:b(q),style:m({visibility:b(W)?b(H)?`visible`:`hidden`:`visible`})},me({_:2},[v(b(se)(e.$slots,`menuIcon optionPdf optionCsv optionImg optionFullscreen custom-menu-before custom-menu-after`),t=>({name:t,fn:S(n=>[y(e.$slots,t,ye(_e(b(ce)(t,n))),void 0,!0)])}))]),1032,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`hasPdf`,`hasXls`,`hasImg`,`hasFullscreen`,`isFullscreen`,`titles`,`chartElement`,`position`,`callbacks`,`printScale`,`onGeneratePdf`,`onGenerateImage`,`style`])):l(``,!0),d(`table`,{class:p({"vue-ui-table-heatmap":!0}),style:m(`width:100%;font-family:${B.value.style.fontFamily};background:${B.value.style.backgroundColor};`)},[d(`caption`,null,[y(e.$slots,`caption`,{},void 0,!0)]),d(`thead`,null,[d(`tr`,{role:`row`,style:m(`background:${B.value.table.head.backgroundColor};color:${B.value.table.head.color}`)},[(g(!0),u(s,null,v(B.value.table.head.values,(t,n)=>(g(),u(`th`,T,[y(e.$slots,`head`,f({ref_for:!0},{value:t,rowIndex:n,type:typeof t,isResponsive:I.value}),void 0,!0)]))),256))],4)]),d(`tbody`,null,[(g(!0),u(s,null,v(Q.value,(t,n)=>(g(),u(`tr`,E,[(g(!0),u(s,null,v(t.displayValues,(r,i)=>(g(),u(`td`,{role:`cell`,"data-cell":B.value.table.head.values[i]},[t.color&&i===0?(g(),u(`div`,O,[t.color?(g(),u(`svg`,{key:0,height:B.value.style.shapeSize,width:B.value.style.shapeSize,viewBox:`0 0 20 20`,style:{background:`none`,overflow:`visible`}},[he(ue,{plot:{x:10,y:10},color:t.color,radius:9,shape:t.shape||`circle`},null,8,[`color`,`shape`])],8,k)):l(``,!0),y(e.$slots,`rowTitle`,f({ref_for:!0},{value:r,rowIndex:n,colIndex:i,type:typeof r,isResponsive:I.value}),void 0,!0)])):(g(),u(s,{key:1},[i===0?y(e.$slots,`rowTitle`,f({ref_for:!0},{value:r,rowIndex:n,colIndex:i,type:typeof r,isResponsive:I.value}),void 0,!0,0):l(``,!0),i>0?y(e.$slots,`cell`,f({ref_for:!0},{value:r,rowIndex:n,colIndex:i,type:typeof r,isResponsive:I.value,color:t.colors[i],textColor:b(ne)(t.colors[i])}),void 0,!0,1):l(``,!0)],64))],8,D))),256)),B.value.table.showSum?(g(),u(`td`,A,[y(e.$slots,`sum`,f({ref_for:!0},{value:t.sum,rowIndex:n,isResponsive:I.value}),void 0,!0)])):l(``,!0),B.value.table.showAverage?(g(),u(`td`,j,[y(e.$slots,`average`,f({ref_for:!0},{value:t.average,rowIndex:n,isResponsive:I.value}),void 0,!0)])):l(``,!0),B.value.table.showMedian?(g(),u(`td`,M,[y(e.$slots,`median`,f({ref_for:!0},{value:t.median,rowIndex:n,isResponsive:I.value}),void 0,!0)])):l(``,!0)]))),256))])],4),e.$slots.source?(g(),u(`div`,Se,[y(e.$slots,`source`,{},void 0,!0)],512)):l(``,!0)],46,w))}},[[`__scopeId`,`data-v-89cef7a9`]]);export{C as n,N as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.js";import{$ as n,D as r,Ht as i,Jt as a,S as o,X as ee,at as s,i as te,m as ne,nt as re,w as ie,yt as ae,zt as oe}from"./lib-rPeBMZrn.js";import{n as se,t as ce}from"./useHints-BH9r_0Vd.js";import{t as le}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as ue}from"./resolveChartConfig-CIhClE5R.js";import{n as de,t as fe}from"./userOptionsSlots-DYuo-E5m.js";import{t as pe}from"./usePrinter-sVoTzet1.js";import{t as me}from"./useUserOptionState-CXlFnwPv.js";import{t as he}from"./vClickOutside-BxNzkY17.js";import{t as ge}from"./vue_ui_table_sparkline-Dlfbza49.js";import{Fragment as c,computed as l,createBlock as _e,createCommentVNode as u,createElementBlock as d,createElementVNode as f,createSlots as ve,createVNode as p,defineAsyncComponent as ye,mergeProps as be,nextTick as xe,normalizeClass as Se,normalizeStyle as m,onBeforeUnmount as Ce,onMounted as we,openBlock as h,ref as g,renderList as _,renderSlot as Te,shallowRef as Ee,toDisplayString as v,unref as y,useCssVars as De,useSlots as Oe,watch as ke,withCtx as Ae,withDirectives as je}from"vue";var Me=/* @__PURE__ */ e({default:()=>b}),Ne=[`id`],Pe={style:{"z-index":`1`,"padding-right":`24px`}},Fe={key:0,style:{display:`flex`,flexDirection:`row`,alignItems:`center`}},Ie={key:0,style:{display:`flex`,flexDirection:`row`,alignItems:`center`}},Le=[`onClick`],Re=[`onClick`],ze=[`data-cell`],Be=[`data-cell`,`onPointerenter`],Ve=[`data-cell`],He=[`data-cell`],Ue=[`data-cell`],We=[`data-cell`],Ge={key:1,ref:`source`,dir:`auto`},b=/*#__PURE__*/ le({__name:`vue-ui-table-sparkline`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`copyAlt`],setup(e,{expose:le,emit:Me}){De(e=>({v5fe3988e:e.tdo}));let b=ye(()=>import(`./vue-ui-sparkline-Y-sljnbS.js`).then(e=>e.n)),x=ye(()=>import(`./BaseIcon-Cm-IJ179.js`).then(e=>e.n)),Ke=ye(()=>import(`./UserOptions-uWHV_zPB.js`).then(e=>e.n)),{vue_ui_table_sparkline:qe}=t(),S=e,Je=Me,C=g(ee()),Ye=g(0),w=g(0),T=g(null),Xe=Oe(),Ze=g(!1),E=l({get:()=>et(),set:e=>e}),D=l(()=>E.value.userOptions),O=l(()=>E.value.sparkline),k=l(()=>E.value.thead),A=l(()=>E.value.tbody),j=l(()=>E.value.title);we(()=>{Xe[`chart-background`]&&E.value.debug&&console.warn(`VueUiTableSparkline does not support the #chart-background slot.`)}),se({config:()=>E.value,dataset:()=>S.dataset,component:`VueUiTableSparkline`,rules:[ce.emptyArray,{test:e=>e.some(e=>e?.values&&e.values.length>500),message:[`👀 One or more series have > 500 datapoints. Consider if you really need this level of detail.`,``,`▶️ Use larger time scales, or aggregated values`]},{test:e=>e.some(e=>e?.values&&e.values.length>1095),message:[`👀 One or more series have > 1095 datapoints. Above this threshold, the dataset is computed through an LTTB algorithm, to preserve the shape of the data without increasing the number of datapoints.`,``,`▶️ If you need this level of detail, you can change config.downsample.threshold and set a higher value. Note that performance will be impacted.`]}]});let M=l(()=>E.value.userOptions.useCursorPointer),{userOptionsVisible:N,setUserOptionsVisibility:Qe,keepUserOptionState:$e}=me({config:E.value});function et(){return ue(S.config,qe,ge)}ke(()=>S.config,e=>{E.value=et(),N.value=!E.value.userOptions.showOnChartHover,st(),w.value+=1},{deep:!0}),ke(()=>S.dataset,e=>{W.value=U.value,w.value+=1},{deep:!0});let{isPrinting:tt,isImaging:nt,generatePdf:rt,generateImage:it}=pe({elementId:`table_${C.value}`,fileName:j.value.text||`vue-ui-table-sparkline`,options:E.value.userOptions.print}),at=l(()=>ie(E.value.customPalette)),P=g(null),F=g(!1),ot=l(()=>E.value.responsiveBreakpoint);we(()=>{st()});let I=g(E.value.colNames),L=Ee(null);function st(){oe(S.dataset)&&s({componentName:`VueUiTableSparkline`,type:`dataset`}),L.value&&L.value.disconnect(),L.value=new ResizeObserver(e=>{e.forEach(e=>{F.value=e.contentRect.width<ot.value})}),P.value&&L.value.observe(P.value),I.value=[];for(let e=0;e<mt.value;e+=1)I.value.push(E.value.colNames[e]||`col ${e}`)}Ce(()=>{L.value&&L.value.disconnect()});function R(e){if([null,void 0].includes(e))return null;let t=Number(e);return Number.isFinite(t)?t:null}function z(e){return typeof e==`number`&&Number.isFinite(e)}function ct(e=[]){return e.map(R).filter(z)}function B(e,t,n){let r=R(e),i=R(t),a=z(r),o=z(i);return a&&o?n===-1?r-i:i-r:a?-1:+!!o}function V(e,t,r={}){let i=R(e);return i===null?`-`:te(E.value.formatter,i,n({p:E.value.prefix,v:i,s:E.value.suffix,r:t}),r)}let H=l(()=>(S.dataset.forEach((e,t)=>{ae({datasetObject:e,requiredAttributes:[`name`,`values`]}).forEach(e=>{s({componentName:`VueUiTableSparkline`,type:`datasetSerieAttribute`,property:e,index:t})})}),S.dataset.map((e,t)=>{let n=e.values||[],r=ct(n),a=r.length?r.reduce((e,t)=>e+t,0):null,ee=r.length?a/r.length:null,s=r.length?ne(r):null;return{...e,values:n,color:o(e.color)||at.value[t]||i[t]||i[t%i.length],sum:a,average:ee,median:s,sparklineDataset:n.map((e,t)=>({period:E.value.colNames[t]||`col ${t}`,value:R(e)}))}})));function lt(e){let t=(e[0]?.values||[]).map((t,n)=>e.map(e=>e?.values?.[n]??null)).map(e=>e.map((e,t)=>[e,t]).sort((e,t)=>B(e[0],t[0],1)).map(e=>e[1]));return e.map((e,n)=>({...e,values:e.values||[],orders:t[n]}))}let U=l(()=>lt(H.value)),W=g(U.value),ut=l(()=>Math.max(...W.value.map(e=>(e.values||[]).length))),dt=g(void 0),ft=g(!1),G=g(void 0),pt=g(1);function K(){ft.value=!1,G.value=void 0,X.value=void 0,pt.value=1,$.value.forEach(e=>e.state=1),Y.value={name:1,sum:1,average:1,median:1},W.value=U.value}function q(e,t,n){if([`name`,`sum`,`average`,`median`].includes(e.type)){ht(e.type,t,n);return}if(!bt(t))return;if(Z.value=t,X.value=void 0,![null,void 0].includes(G.value)&&t!==G.value&&(G.value=void 0,K()),$.value[t].state===n&&G.value===t){G.value=void 0,K();return}ft.value=!0,G.value=t;let r=U.value.map(e=>e.values?.[t]??null),i=n;$.value[t].state=i,pt.value=i,t===dt.value?dt.value=void 0:dt.value=t;let a=r.map((e,t)=>[t,e]).sort((e,t)=>B(e[1],t[1],i)).map(e=>e[0]).map(e=>U.value[e]);W.value=a,w.value+=1}let mt=l(()=>Math.max(...S.dataset.map(e=>(e.values||[]).length))),J=l(()=>{let e=I.value.map(e=>({type:`reg`,value:e}));if(!e.length)for(let t=0;t<mt.value;t+=1)e.push({type:`reg`,value:`col ${t+1}`});E.value.showTotal&&(e=[...e,{type:`sum`,value:E.value.translations.total}]);let t;return t=E.value.showAverage&&E.value.showMedian?[...e,{type:`average`,value:E.value.translations.average},{type:`median`,value:E.value.translations.median}]:E.value.showAverage&&!E.value.showMedian?[...e,{type:`average`,value:E.value.translations.average}]:!E.value.showAverage&&E.value.showMedian?[...e,{type:`median`,value:E.value.translations.median}]:e,E.value.showSparklines?[...t,{type:`chart`,value:E.value.translations.chart}]:t}),Y=g({name:1,sum:1,average:1,median:1}),X=g(void 0);function ht(e,t,n){if(!W.value||W.value.length===0||!xt(e))return;if(X.value!==e&&(X.value=void 0),![null,void 0].includes(G.value)&&t!==G.value&&K(),G.value=void 0,Y.value[e]===n&&X.value){X.value=void 0,K();return}X.value=e,ft.value=!0,Y.value[e]=n,[null,void 0].includes(t)||($.value[t].state=Y.value[e]);let r=Y.value[e],i=[...W.value].sort((t,n)=>{let i=t[e],a=n[e];return typeof i==`string`&&typeof a==`string`?r===-1?i.localeCompare(a):a.localeCompare(i):B(i,a,r)});W.value=i}let Z=g(void 0),Q=g(void 0);function gt({dataIndex:e,serieIndex:t}){Z.value=e,Q.value=t,T.value[e]&&!F.value&&T.value[e].scrollIntoView({behavior:`smooth`,block:`nearest`,inline:`center`})}let _t=g(!1);function vt(e){_t.value=e,Ye.value+=1}function yt(e=null){xe(()=>{let t=[E.value.translations.serie].concat(J.value),n=H.value.map((e,t)=>[[e.name],e.values,[e.sum],[e.average],[e.median]]),i=[t].concat(n),a=r(i);e?e(a):re({csvContent:a,title:j.value.text||`vue-ui-table-sparkline`})})}function bt(e){return E.value.sortedDataColumnIndices.includes(e)}function xt(e){return e.type===`name`||e===`name`?E.value.sortedSeriesName:e.type===`sum`||e===`sum`?E.value.sortedSum:e.type===`average`||e===`average`?E.value.sortedAverage:e.type===`median`||e===`median`?E.value.sortedMedian:!1}function St(e,t,n){return[`sum`,`average`,`median`].includes(t.type)?X.value===t.type&&Y.value[t.type]===n?1:.3:e===G.value&&$.value[e].state===n?1:.3}function Ct(){E.value.resetSortOnClickOutside&&K()}let $=l({get:()=>J.value.map(e=>({state:1})),set:e=>e});function wt(e){e?.stage===`start`?Ze.value=!0:e?.stage===`end`?Ze.value=!1:it()}async function Tt(){Je(`copyAlt`,{config:E.value,dataset:H.value}),E.value.userOptions.callbacks.altCopy?await Promise.resolve(E.value.userOptions.callbacks.altCopy({config:E.value,dataset:H.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}return le({generatePdf:rt,generateImage:it,generateCsv:yt,restoreOrder:K,copyAlt:Tt}),(e,t)=>(h(),d(`div`,{ref_key:`tableContainer`,ref:P,class:Se({"vue-data-ui-component":!0,"vue-ui-table-sparkline":!0,"vue-ui-responsive":F.value}),style:{overflow:`hidden`},id:`table_${C.value}`,onMouseenter:t[3]||=()=>y(Qe)(!0),onMouseleave:t[4]||=()=>y(Qe)(!1)},[j.value.text?(h(),d(`div`,{key:0,class:`vue-ui-table-sparkline-caption`,style:m({backgroundColor:j.value.backgroundColor})},[f(`div`,{class:`atom-title`,style:m({fontSize:`${j.value.fontSize}px`,fontWeight:j.value.bold?`bold`:`normal`,color:j.value.color,textAlign:j.value.textAlign})},v(j.value.text),5),j.value.subtitle.text?(h(),d(`div`,{key:0,class:`atom-subtitle`,style:m({fontSize:`${j.value.subtitle.fontSize}px`,fontWeight:j.value.subtitle.bold?`bold`:`normal`,color:j.value.subtitle.color,textAlign:j.value.textAlign})},v(j.value.subtitle.text),5)):u(``,!0)],4)):u(``,!0),f(`div`,{style:{overflow:`auto`},onPointerleave:t[2]||=e=>{Q.value=void 0,Z.value=void 0}},[f(`table`,{class:`vue-ui-data-table`,style:m({fontFamily:E.value.fontFamily,position:`relative`})},[f(`thead`,Pe,[je((h(),d(`tr`,{role:`row`,class:`vue-ui-data-table__thead-row`,style:m({backgroundColor:k.value.backgroundColor,color:k.value.color})},[f(`th`,{role:`cell`,style:m({backgroundColor:k.value.backgroundColor,border:k.value.outline,textAlign:k.value.textAlign,fontWeight:k.value.bold?`bold`:`normal`}),class:`sticky-col-first`},[f(`div`,{style:m({display:`flex`,flexDirection:`row`,alignItems:`center`,gap:`3px`,justifyContent:k.value.textAlign})},[f(`span`,null,v(E.value.translations.serie),1),W.value.length>1&&E.value.sortedSeriesName?(h(),d(`div`,Fe,[f(`button`,{class:`vue-ui-table-sparkline-sorting-button vue-ui-table-sparkline-sorting-button-down`,onClick:t[0]||=e=>q({type:`name`},null,-1),style:m({cursor:M.value?`pointer`:`default`})},[p(y(x),{size:12,name:`arrowBottom`,stroke:k.value.color,style:m({opacity:X.value===`name`&&Y.value.name===-1?1:.3})},null,8,[`stroke`,`style`])],4),f(`button`,{class:`vue-ui-table-sparkline-sorting-button vue-ui-table-sparkline-sorting-button-up`,onClick:t[1]||=e=>q({type:`name`},null,1),style:m({cursor:M.value?`pointer`:`default`})},[p(y(x),{size:12,name:`arrowTop`,stroke:k.value.color,style:m({opacity:X.value===`name`&&Y.value.name===1?1:.3})},null,8,[`stroke`,`style`])],4)])):u(``,!0)],4)],4),(h(!0),d(c,null,_(J.value,(t,n)=>(h(),d(`th`,{role:`cell`,style:m({background:k.value.backgroundColor,border:k.value.outline,textAlign:k.value.textAlign,fontWeight:k.value.bold?`bold`:`normal`,minWidth:n===J.value.length-1?`${O.value.dimensions.width}px`:`48px`,paddingRight:n===J.value.length-1&&D.value.show?`36px`:``}),class:Se({"sticky-col":n===J.value.length-1&&E.value.showSparklines})},[f(`div`,{style:m({display:`flex`,flexDirection:`row`,alignItems:`center`,gap:`3px`,justifyContent:k.value.textAlign})},[f(`span`,null,v(t.value),1),W.value.length>1&&(bt(n)||xt(t))?(h(),d(`div`,Ie,[f(`button`,{class:`vue-ui-table-sparkline-sorting-button vue-ui-table-sparkline-sorting-button-down`,onClick:()=>q(t,n,-1),style:m({cursor:M.value?`pointer`:`default`})},[p(y(x),{size:12,name:`arrowBottom`,stroke:k.value.color,style:m({opacity:St(n,t,-1)})},null,8,[`stroke`,`style`])],12,Le),f(`button`,{class:`vue-ui-table-sparkline-sorting-button vue-ui-table-sparkline-sorting-button-up`,onClick:()=>q(t,n,1),style:m({cursor:M.value?`pointer`:`default`})},[p(y(x),{size:12,name:`arrowTop`,stroke:k.value.color,style:m({opacity:St(n,t,1)})},null,8,[`stroke`,`style`])],12,Re)])):u(``,!0)],4),D.value.show&&n===J.value.length-1&&(y($e)||y(N))?(h(),_e(y(Ke),{ref_for:!0,ref:`details`,key:`user_option_${Ye.value}`,backgroundColor:k.value.backgroundColor,color:k.value.color,isPrinting:y(tt),isImaging:y(nt),uid:C.value,hasPdf:D.value.buttons.pdf,hasXls:D.value.buttons.csv,hasImg:D.value.buttons.img,hasFullscreen:D.value.buttons.fullscreen,hasAltCopy:D.value.buttons.altCopy,isFullscreen:_t.value,titles:{...D.value.buttonTitles},chartElement:P.value,position:D.value.position,callbacks:D.value.callbacks,printScale:D.value.print.scale,isCursorPointer:M.value,onToggleFullscreen:vt,onGeneratePdf:y(rt),onGenerateImage:wt,onGenerateCsv:yt,onCopyAlt:Tt,style:m({visibility:y($e)?y(N)?`visible`:`hidden`:`visible`})},ve({_:2},[_(y(de)(e.$slots,`menuIcon optionPdf optionCsv optionImg optionFullscreen optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:Ae(n=>[Te(e.$slots,t,be({ref_for:!0},y(fe)(t,n)),void 0,!0)])}))]),1032,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`hasPdf`,`hasXls`,`hasImg`,`hasFullscreen`,`hasAltCopy`,`isFullscreen`,`titles`,`chartElement`,`position`,`callbacks`,`printScale`,`isCursorPointer`,`onGeneratePdf`,`style`])):u(``,!0)],6))),256))],4)),[[y(he),Ct]])]),f(`tbody`,null,[(h(!0),d(c,null,_(W.value,(e,t)=>(h(),d(`tr`,{role:`row`,style:m({backgroundColor:A.value.backgroundColor,color:A.value.color}),class:Se({"vue-ui-data-table__tbody__row":!0,"vue-ui-data-table__tbody__row-even":t%2==0,"vue-ui-data-table__tbody__row-odd":t%2!=0})},[f(`td`,{role:`cell`,style:m({backgroundColor:A.value.backgroundColor,border:A.value.outline,fontSize:`${A.value.fontSize}px`,fontWeight:A.value.bold?`bold`:`normal`,textAlign:A.value.textAlign}),"data-cell":E.value.translations.serie,class:`vue-ui-data-table__tbody__td sticky-col-first`},[f(`div`,{dir:`auto`,style:m({display:`flex`,flexDirection:`row`,alignItems:`center`,gap:`6px`,justifyContent:A.value.textAlign})},[A.value.showColorMarker?(h(),d(`span`,{key:0,style:m({color:e.color})},`⬤`,4)):u(``,!0),f(`span`,null,v(e.name??`-`),1)],4)],12,ze),(h(!0),d(c,null,_(ut.value,(n,r)=>(h(),d(`td`,{dir:`auto`,role:`cell`,ref_for:!0,ref_key:`TD`,ref:T,style:m({border:A.value.outline,fontSize:`${A.value.fontSize}px`,fontWeight:A.value.bold?`bold`:`normal`,textAlign:A.value.textAlign,background:Z.value!==void 0&&r===Z.value?A.value.selectedColor.useSerieColor?y(a)(e.color,20):A.value.selectedColor.fallback:``}),"data-cell":J.value[r]?J.value[r].value:``,class:`vue-ui-data-table__tbody__td`,onPointerenter:e=>{Q.value=t,Z.value=r}},v(V(e.values[r],E.value.roundingValues,{datapoint:e,seriesIndex:t,datapointIndex:r})),45,Be))),256)),E.value.showTotal?(h(),d(`td`,{key:0,dir:`auto`,role:`cell`,style:m({border:A.value.outline,fontSize:`${A.value.fontSize}px`,fontWeight:A.value.bold?`bold`:`normal`,textAlign:A.value.textAlign}),"data-cell":E.value.translations.total,class:`vue-ui-data-table__tbody__td`},v(V(e.sum,E.value.roundingTotal,{datapoint:e.sum,seriesIndex:t})),13,Ve)):u(``,!0),E.value.showAverage?(h(),d(`td`,{key:1,dir:`auto`,role:`cell`,style:m({border:A.value.outline,fontSize:`${A.value.fontSize}px`,fontWeight:A.value.bold?`bold`:`normal`,textAlign:A.value.textAlign}),"data-cell":E.value.translations.average,class:`vue-ui-data-table__tbody__td`},v(V(e.average,E.value.roundingAverage,{datapoint:e.average,seriesIndex:t})),13,He)):u(``,!0),E.value.showMedian?(h(),d(`td`,{key:2,dir:`auto`,role:`cell`,style:m({border:A.value.outline,fontSize:`${A.value.fontSize}px`,fontWeight:A.value.bold?`bold`:`normal`,textAlign:A.value.textAlign}),"data-cell":E.value.translations.median,class:`vue-ui-data-table__tbody__td`},v(V(e.median,E.value.roundingMedian,{datapoint:e.median,seriesIndex:t})),13,Ue)):u(``,!0),E.value.showSparklines?(h(),d(`td`,{key:3,role:`cell`,"data-cell":E.value.translations.chart,style:m({border:A.value.outline,fontSize:`${A.value.fontSize}px`,fontWeight:A.value.bold?`bold`:`normal`,textAlign:A.value.textAlign,backgroundColor:A.value.backgroundColor,padding:`0`}),class:`vue-ui-data-table__tbody__td sticky-col`},[p(y(b),{onHoverIndex:({index:e})=>gt({dataIndex:e,serieIndex:t}),"height-ratio":O.value.dimensions.heightRatio,"forced-padding":30,dataset:e.sparklineDataset,showInfo:!1,selectedIndex:Z.value,config:{type:O.value.type,style:{backgroundColor:`transparent`,animation:{show:O.value.animation.show&&!y(tt)&&!y(nt),animationFrames:O.value.animation.animationFrames},padding:{right:12},line:{color:e.color,smooth:O.value.smooth,cutNullValues:O.value.cutNullValues,strokeWidth:O.value.strokeWidth},bar:{color:e.color},area:{color:e.color,opacity:O.value.showArea?16:0,useGradient:O.value.useGradient},verticalIndicator:{color:e.color},plot:{radius:9,stroke:A.value.backgroundColor,strokeWidth:3}}}},null,8,[`onHoverIndex`,`height-ratio`,`dataset`,`selectedIndex`,`config`])],12,We)):u(``,!0)],6))),256))])],4)],32),e.$slots.source?(h(),d(`div`,Ge,[Te(e.$slots,`source`,{},void 0,!0)],512)):u(``,!0)],42,Ne))}},[[`__scopeId`,`data-v-bb68c573`]]);export{Me as n,b as t};
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.js";import{$ as n,D as r,Ht as i,Jt as a,S as o,X as ee,at as s,i as te,m as ne,nt as re,w as ie,yt as ae,zt as oe}from"./lib-rPeBMZrn.js";import{n as se,t as ce}from"./useHints-C-TwxM0Y.js";import{t as le}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as ue}from"./resolveChartConfig-CIhClE5R.js";import{n as de,t as fe}from"./userOptionsSlots-DYuo-E5m.js";import{t as pe}from"./usePrinter-DVf3YcG5.js";import{t as me}from"./useUserOptionState-CXlFnwPv.js";import{t as he}from"./vClickOutside-BxNzkY17.js";import{t as ge}from"./vue_ui_table_sparkline-Dlfbza49.js";import{Fragment as c,computed as l,createBlock as _e,createCommentVNode as u,createElementBlock as d,createElementVNode as f,createSlots as ve,createVNode as p,defineAsyncComponent as ye,mergeProps as be,nextTick as xe,normalizeClass as Se,normalizeStyle as m,onBeforeUnmount as Ce,onMounted as we,openBlock as h,ref as g,renderList as _,renderSlot as Te,shallowRef as Ee,toDisplayString as v,unref as y,useCssVars as De,useSlots as Oe,watch as ke,withCtx as Ae,withDirectives as je}from"vue";var Me=/* @__PURE__ */ e({default:()=>b}),Ne=[`id`],Pe={style:{"z-index":`1`,"padding-right":`24px`}},Fe={key:0,style:{display:`flex`,flexDirection:`row`,alignItems:`center`}},Ie={key:0,style:{display:`flex`,flexDirection:`row`,alignItems:`center`}},Le=[`onClick`],Re=[`onClick`],ze=[`data-cell`],Be=[`data-cell`,`onPointerenter`],Ve=[`data-cell`],He=[`data-cell`],Ue=[`data-cell`],We=[`data-cell`],Ge={key:1,ref:`source`,dir:`auto`},b=/*#__PURE__*/ le({__name:`vue-ui-table-sparkline`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`copyAlt`],setup(e,{expose:le,emit:Me}){De(e=>({v5fe3988e:e.tdo}));let b=ye(()=>import(`./vue-ui-sparkline-B_GkB9V_.js`).then(e=>e.n)),x=ye(()=>import(`./BaseIcon-Cm-IJ179.js`).then(e=>e.n)),Ke=ye(()=>import(`./UserOptions-uWHV_zPB.js`).then(e=>e.n)),{vue_ui_table_sparkline:qe}=t(),S=e,Je=Me,C=g(ee()),Ye=g(0),w=g(0),T=g(null),Xe=Oe(),Ze=g(!1),E=l({get:()=>et(),set:e=>e}),D=l(()=>E.value.userOptions),O=l(()=>E.value.sparkline),k=l(()=>E.value.thead),A=l(()=>E.value.tbody),j=l(()=>E.value.title);we(()=>{Xe[`chart-background`]&&E.value.debug&&console.warn(`VueUiTableSparkline does not support the #chart-background slot.`)}),se({config:()=>E.value,dataset:()=>S.dataset,component:`VueUiTableSparkline`,rules:[ce.emptyArray,{test:e=>e.some(e=>e?.values&&e.values.length>500),message:[`👀 One or more series have > 500 datapoints. Consider if you really need this level of detail.`,``,`▶️ Use larger time scales, or aggregated values`]},{test:e=>e.some(e=>e?.values&&e.values.length>1095),message:[`👀 One or more series have > 1095 datapoints. Above this threshold, the dataset is computed through an LTTB algorithm, to preserve the shape of the data without increasing the number of datapoints.`,``,`▶️ If you need this level of detail, you can change config.downsample.threshold and set a higher value. Note that performance will be impacted.`]}]});let M=l(()=>E.value.userOptions.useCursorPointer),{userOptionsVisible:N,setUserOptionsVisibility:Qe,keepUserOptionState:$e}=me({config:E.value});function et(){return ue(S.config,qe,ge)}ke(()=>S.config,e=>{E.value=et(),N.value=!E.value.userOptions.showOnChartHover,st(),w.value+=1},{deep:!0}),ke(()=>S.dataset,e=>{W.value=U.value,w.value+=1},{deep:!0});let{isPrinting:tt,isImaging:nt,generatePdf:rt,generateImage:it}=pe({elementId:`table_${C.value}`,fileName:j.value.text||`vue-ui-table-sparkline`,options:E.value.userOptions.print}),at=l(()=>ie(E.value.customPalette)),P=g(null),F=g(!1),ot=l(()=>E.value.responsiveBreakpoint);we(()=>{st()});let I=g(E.value.colNames),L=Ee(null);function st(){oe(S.dataset)&&s({componentName:`VueUiTableSparkline`,type:`dataset`}),L.value&&L.value.disconnect(),L.value=new ResizeObserver(e=>{e.forEach(e=>{F.value=e.contentRect.width<ot.value})}),P.value&&L.value.observe(P.value),I.value=[];for(let e=0;e<mt.value;e+=1)I.value.push(E.value.colNames[e]||`col ${e}`)}Ce(()=>{L.value&&L.value.disconnect()});function R(e){if([null,void 0].includes(e))return null;let t=Number(e);return Number.isFinite(t)?t:null}function z(e){return typeof e==`number`&&Number.isFinite(e)}function ct(e=[]){return e.map(R).filter(z)}function B(e,t,n){let r=R(e),i=R(t),a=z(r),o=z(i);return a&&o?n===-1?r-i:i-r:a?-1:+!!o}function V(e,t,r={}){let i=R(e);return i===null?`-`:te(E.value.formatter,i,n({p:E.value.prefix,v:i,s:E.value.suffix,r:t}),r)}let H=l(()=>(S.dataset.forEach((e,t)=>{ae({datasetObject:e,requiredAttributes:[`name`,`values`]}).forEach(e=>{s({componentName:`VueUiTableSparkline`,type:`datasetSerieAttribute`,property:e,index:t})})}),S.dataset.map((e,t)=>{let n=e.values||[],r=ct(n),a=r.length?r.reduce((e,t)=>e+t,0):null,ee=r.length?a/r.length:null,s=r.length?ne(r):null;return{...e,values:n,color:o(e.color)||at.value[t]||i[t]||i[t%i.length],sum:a,average:ee,median:s,sparklineDataset:n.map((e,t)=>({period:E.value.colNames[t]||`col ${t}`,value:R(e)}))}})));function lt(e){let t=(e[0]?.values||[]).map((t,n)=>e.map(e=>e?.values?.[n]??null)).map(e=>e.map((e,t)=>[e,t]).sort((e,t)=>B(e[0],t[0],1)).map(e=>e[1]));return e.map((e,n)=>({...e,values:e.values||[],orders:t[n]}))}let U=l(()=>lt(H.value)),W=g(U.value),ut=l(()=>Math.max(...W.value.map(e=>(e.values||[]).length))),dt=g(void 0),ft=g(!1),G=g(void 0),pt=g(1);function K(){ft.value=!1,G.value=void 0,X.value=void 0,pt.value=1,$.value.forEach(e=>e.state=1),Y.value={name:1,sum:1,average:1,median:1},W.value=U.value}function q(e,t,n){if([`name`,`sum`,`average`,`median`].includes(e.type)){ht(e.type,t,n);return}if(!bt(t))return;if(Z.value=t,X.value=void 0,![null,void 0].includes(G.value)&&t!==G.value&&(G.value=void 0,K()),$.value[t].state===n&&G.value===t){G.value=void 0,K();return}ft.value=!0,G.value=t;let r=U.value.map(e=>e.values?.[t]??null),i=n;$.value[t].state=i,pt.value=i,t===dt.value?dt.value=void 0:dt.value=t;let a=r.map((e,t)=>[t,e]).sort((e,t)=>B(e[1],t[1],i)).map(e=>e[0]).map(e=>U.value[e]);W.value=a,w.value+=1}let mt=l(()=>Math.max(...S.dataset.map(e=>(e.values||[]).length))),J=l(()=>{let e=I.value.map(e=>({type:`reg`,value:e}));if(!e.length)for(let t=0;t<mt.value;t+=1)e.push({type:`reg`,value:`col ${t+1}`});E.value.showTotal&&(e=[...e,{type:`sum`,value:E.value.translations.total}]);let t;return t=E.value.showAverage&&E.value.showMedian?[...e,{type:`average`,value:E.value.translations.average},{type:`median`,value:E.value.translations.median}]:E.value.showAverage&&!E.value.showMedian?[...e,{type:`average`,value:E.value.translations.average}]:!E.value.showAverage&&E.value.showMedian?[...e,{type:`median`,value:E.value.translations.median}]:e,E.value.showSparklines?[...t,{type:`chart`,value:E.value.translations.chart}]:t}),Y=g({name:1,sum:1,average:1,median:1}),X=g(void 0);function ht(e,t,n){if(!W.value||W.value.length===0||!xt(e))return;if(X.value!==e&&(X.value=void 0),![null,void 0].includes(G.value)&&t!==G.value&&K(),G.value=void 0,Y.value[e]===n&&X.value){X.value=void 0,K();return}X.value=e,ft.value=!0,Y.value[e]=n,[null,void 0].includes(t)||($.value[t].state=Y.value[e]);let r=Y.value[e],i=[...W.value].sort((t,n)=>{let i=t[e],a=n[e];return typeof i==`string`&&typeof a==`string`?r===-1?i.localeCompare(a):a.localeCompare(i):B(i,a,r)});W.value=i}let Z=g(void 0),Q=g(void 0);function gt({dataIndex:e,serieIndex:t}){Z.value=e,Q.value=t,T.value[e]&&!F.value&&T.value[e].scrollIntoView({behavior:`smooth`,block:`nearest`,inline:`center`})}let _t=g(!1);function vt(e){_t.value=e,Ye.value+=1}function yt(e=null){xe(()=>{let t=[E.value.translations.serie].concat(J.value),n=H.value.map((e,t)=>[[e.name],e.values,[e.sum],[e.average],[e.median]]),i=[t].concat(n),a=r(i);e?e(a):re({csvContent:a,title:j.value.text||`vue-ui-table-sparkline`})})}function bt(e){return E.value.sortedDataColumnIndices.includes(e)}function xt(e){return e.type===`name`||e===`name`?E.value.sortedSeriesName:e.type===`sum`||e===`sum`?E.value.sortedSum:e.type===`average`||e===`average`?E.value.sortedAverage:e.type===`median`||e===`median`?E.value.sortedMedian:!1}function St(e,t,n){return[`sum`,`average`,`median`].includes(t.type)?X.value===t.type&&Y.value[t.type]===n?1:.3:e===G.value&&$.value[e].state===n?1:.3}function Ct(){E.value.resetSortOnClickOutside&&K()}let $=l({get:()=>J.value.map(e=>({state:1})),set:e=>e});function wt(e){e?.stage===`start`?Ze.value=!0:e?.stage===`end`?Ze.value=!1:it()}async function Tt(){Je(`copyAlt`,{config:E.value,dataset:H.value}),E.value.userOptions.callbacks.altCopy?await Promise.resolve(E.value.userOptions.callbacks.altCopy({config:E.value,dataset:H.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}return le({generatePdf:rt,generateImage:it,generateCsv:yt,restoreOrder:K,copyAlt:Tt}),(e,t)=>(h(),d(`div`,{ref_key:`tableContainer`,ref:P,class:Se({"vue-data-ui-component":!0,"vue-ui-table-sparkline":!0,"vue-ui-responsive":F.value}),style:{overflow:`hidden`},id:`table_${C.value}`,onMouseenter:t[3]||=()=>y(Qe)(!0),onMouseleave:t[4]||=()=>y(Qe)(!1)},[j.value.text?(h(),d(`div`,{key:0,class:`vue-ui-table-sparkline-caption`,style:m({backgroundColor:j.value.backgroundColor})},[f(`div`,{class:`atom-title`,style:m({fontSize:`${j.value.fontSize}px`,fontWeight:j.value.bold?`bold`:`normal`,color:j.value.color,textAlign:j.value.textAlign})},v(j.value.text),5),j.value.subtitle.text?(h(),d(`div`,{key:0,class:`atom-subtitle`,style:m({fontSize:`${j.value.subtitle.fontSize}px`,fontWeight:j.value.subtitle.bold?`bold`:`normal`,color:j.value.subtitle.color,textAlign:j.value.textAlign})},v(j.value.subtitle.text),5)):u(``,!0)],4)):u(``,!0),f(`div`,{style:{overflow:`auto`},onPointerleave:t[2]||=e=>{Q.value=void 0,Z.value=void 0}},[f(`table`,{class:`vue-ui-data-table`,style:m({fontFamily:E.value.fontFamily,position:`relative`})},[f(`thead`,Pe,[je((h(),d(`tr`,{role:`row`,class:`vue-ui-data-table__thead-row`,style:m({backgroundColor:k.value.backgroundColor,color:k.value.color})},[f(`th`,{role:`cell`,style:m({backgroundColor:k.value.backgroundColor,border:k.value.outline,textAlign:k.value.textAlign,fontWeight:k.value.bold?`bold`:`normal`}),class:`sticky-col-first`},[f(`div`,{style:m({display:`flex`,flexDirection:`row`,alignItems:`center`,gap:`3px`,justifyContent:k.value.textAlign})},[f(`span`,null,v(E.value.translations.serie),1),W.value.length>1&&E.value.sortedSeriesName?(h(),d(`div`,Fe,[f(`button`,{class:`vue-ui-table-sparkline-sorting-button vue-ui-table-sparkline-sorting-button-down`,onClick:t[0]||=e=>q({type:`name`},null,-1),style:m({cursor:M.value?`pointer`:`default`})},[p(y(x),{size:12,name:`arrowBottom`,stroke:k.value.color,style:m({opacity:X.value===`name`&&Y.value.name===-1?1:.3})},null,8,[`stroke`,`style`])],4),f(`button`,{class:`vue-ui-table-sparkline-sorting-button vue-ui-table-sparkline-sorting-button-up`,onClick:t[1]||=e=>q({type:`name`},null,1),style:m({cursor:M.value?`pointer`:`default`})},[p(y(x),{size:12,name:`arrowTop`,stroke:k.value.color,style:m({opacity:X.value===`name`&&Y.value.name===1?1:.3})},null,8,[`stroke`,`style`])],4)])):u(``,!0)],4)],4),(h(!0),d(c,null,_(J.value,(t,n)=>(h(),d(`th`,{role:`cell`,style:m({background:k.value.backgroundColor,border:k.value.outline,textAlign:k.value.textAlign,fontWeight:k.value.bold?`bold`:`normal`,minWidth:n===J.value.length-1?`${O.value.dimensions.width}px`:`48px`,paddingRight:n===J.value.length-1&&D.value.show?`36px`:``}),class:Se({"sticky-col":n===J.value.length-1&&E.value.showSparklines})},[f(`div`,{style:m({display:`flex`,flexDirection:`row`,alignItems:`center`,gap:`3px`,justifyContent:k.value.textAlign})},[f(`span`,null,v(t.value),1),W.value.length>1&&(bt(n)||xt(t))?(h(),d(`div`,Ie,[f(`button`,{class:`vue-ui-table-sparkline-sorting-button vue-ui-table-sparkline-sorting-button-down`,onClick:()=>q(t,n,-1),style:m({cursor:M.value?`pointer`:`default`})},[p(y(x),{size:12,name:`arrowBottom`,stroke:k.value.color,style:m({opacity:St(n,t,-1)})},null,8,[`stroke`,`style`])],12,Le),f(`button`,{class:`vue-ui-table-sparkline-sorting-button vue-ui-table-sparkline-sorting-button-up`,onClick:()=>q(t,n,1),style:m({cursor:M.value?`pointer`:`default`})},[p(y(x),{size:12,name:`arrowTop`,stroke:k.value.color,style:m({opacity:St(n,t,1)})},null,8,[`stroke`,`style`])],12,Re)])):u(``,!0)],4),D.value.show&&n===J.value.length-1&&(y($e)||y(N))?(h(),_e(y(Ke),{ref_for:!0,ref:`details`,key:`user_option_${Ye.value}`,backgroundColor:k.value.backgroundColor,color:k.value.color,isPrinting:y(tt),isImaging:y(nt),uid:C.value,hasPdf:D.value.buttons.pdf,hasXls:D.value.buttons.csv,hasImg:D.value.buttons.img,hasFullscreen:D.value.buttons.fullscreen,hasAltCopy:D.value.buttons.altCopy,isFullscreen:_t.value,titles:{...D.value.buttonTitles},chartElement:P.value,position:D.value.position,callbacks:D.value.callbacks,printScale:D.value.print.scale,isCursorPointer:M.value,onToggleFullscreen:vt,onGeneratePdf:y(rt),onGenerateImage:wt,onGenerateCsv:yt,onCopyAlt:Tt,style:m({visibility:y($e)?y(N)?`visible`:`hidden`:`visible`})},ve({_:2},[_(y(de)(e.$slots,`menuIcon optionPdf optionCsv optionImg optionFullscreen optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:Ae(n=>[Te(e.$slots,t,be({ref_for:!0},y(fe)(t,n)),void 0,!0)])}))]),1032,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`hasPdf`,`hasXls`,`hasImg`,`hasFullscreen`,`hasAltCopy`,`isFullscreen`,`titles`,`chartElement`,`position`,`callbacks`,`printScale`,`isCursorPointer`,`onGeneratePdf`,`style`])):u(``,!0)],6))),256))],4)),[[y(he),Ct]])]),f(`tbody`,null,[(h(!0),d(c,null,_(W.value,(e,t)=>(h(),d(`tr`,{role:`row`,style:m({backgroundColor:A.value.backgroundColor,color:A.value.color}),class:Se({"vue-ui-data-table__tbody__row":!0,"vue-ui-data-table__tbody__row-even":t%2==0,"vue-ui-data-table__tbody__row-odd":t%2!=0})},[f(`td`,{role:`cell`,style:m({backgroundColor:A.value.backgroundColor,border:A.value.outline,fontSize:`${A.value.fontSize}px`,fontWeight:A.value.bold?`bold`:`normal`,textAlign:A.value.textAlign}),"data-cell":E.value.translations.serie,class:`vue-ui-data-table__tbody__td sticky-col-first`},[f(`div`,{dir:`auto`,style:m({display:`flex`,flexDirection:`row`,alignItems:`center`,gap:`6px`,justifyContent:A.value.textAlign})},[A.value.showColorMarker?(h(),d(`span`,{key:0,style:m({color:e.color})},`⬤`,4)):u(``,!0),f(`span`,null,v(e.name??`-`),1)],4)],12,ze),(h(!0),d(c,null,_(ut.value,(n,r)=>(h(),d(`td`,{dir:`auto`,role:`cell`,ref_for:!0,ref_key:`TD`,ref:T,style:m({border:A.value.outline,fontSize:`${A.value.fontSize}px`,fontWeight:A.value.bold?`bold`:`normal`,textAlign:A.value.textAlign,background:Z.value!==void 0&&r===Z.value?A.value.selectedColor.useSerieColor?y(a)(e.color,20):A.value.selectedColor.fallback:``}),"data-cell":J.value[r]?J.value[r].value:``,class:`vue-ui-data-table__tbody__td`,onPointerenter:e=>{Q.value=t,Z.value=r}},v(V(e.values[r],E.value.roundingValues,{datapoint:e,seriesIndex:t,datapointIndex:r})),45,Be))),256)),E.value.showTotal?(h(),d(`td`,{key:0,dir:`auto`,role:`cell`,style:m({border:A.value.outline,fontSize:`${A.value.fontSize}px`,fontWeight:A.value.bold?`bold`:`normal`,textAlign:A.value.textAlign}),"data-cell":E.value.translations.total,class:`vue-ui-data-table__tbody__td`},v(V(e.sum,E.value.roundingTotal,{datapoint:e.sum,seriesIndex:t})),13,Ve)):u(``,!0),E.value.showAverage?(h(),d(`td`,{key:1,dir:`auto`,role:`cell`,style:m({border:A.value.outline,fontSize:`${A.value.fontSize}px`,fontWeight:A.value.bold?`bold`:`normal`,textAlign:A.value.textAlign}),"data-cell":E.value.translations.average,class:`vue-ui-data-table__tbody__td`},v(V(e.average,E.value.roundingAverage,{datapoint:e.average,seriesIndex:t})),13,He)):u(``,!0),E.value.showMedian?(h(),d(`td`,{key:2,dir:`auto`,role:`cell`,style:m({border:A.value.outline,fontSize:`${A.value.fontSize}px`,fontWeight:A.value.bold?`bold`:`normal`,textAlign:A.value.textAlign}),"data-cell":E.value.translations.median,class:`vue-ui-data-table__tbody__td`},v(V(e.median,E.value.roundingMedian,{datapoint:e.median,seriesIndex:t})),13,Ue)):u(``,!0),E.value.showSparklines?(h(),d(`td`,{key:3,role:`cell`,"data-cell":E.value.translations.chart,style:m({border:A.value.outline,fontSize:`${A.value.fontSize}px`,fontWeight:A.value.bold?`bold`:`normal`,textAlign:A.value.textAlign,backgroundColor:A.value.backgroundColor,padding:`0`}),class:`vue-ui-data-table__tbody__td sticky-col`},[p(y(b),{onHoverIndex:({index:e})=>gt({dataIndex:e,serieIndex:t}),"height-ratio":O.value.dimensions.heightRatio,"forced-padding":30,dataset:e.sparklineDataset,showInfo:!1,selectedIndex:Z.value,config:{type:O.value.type,style:{backgroundColor:`transparent`,animation:{show:O.value.animation.show&&!y(tt)&&!y(nt),animationFrames:O.value.animation.animationFrames},padding:{right:12},line:{color:e.color,smooth:O.value.smooth,cutNullValues:O.value.cutNullValues,strokeWidth:O.value.strokeWidth},bar:{color:e.color},area:{color:e.color,opacity:O.value.showArea?16:0,useGradient:O.value.useGradient},verticalIndicator:{color:e.color},plot:{radius:9,stroke:A.value.backgroundColor,strokeWidth:3}}}},null,8,[`onHoverIndex`,`height-ratio`,`dataset`,`selectedIndex`,`config`])],12,We)):u(``,!0)],6))),256))])],4)],32),e.$slots.source?(h(),d(`div`,Ge,[Te(e.$slots,`source`,{},void 0,!0)],512)):u(``,!0)],42,Ne))}},[[`__scopeId`,`data-v-bb68c573`]]);export{Me as n,b as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.js";import{$ as n,Ht as r,Jt as i,S as a,X as ee,at as o,b as s,i as te,in as ne,t as re,w as ie,yt as ae,zt as oe}from"./lib-rPeBMZrn.js";import{n as se,t as ce}from"./BaseScanner-8NdoBs7B.js";import{n as le,t as ue}from"./useHints-BH9r_0Vd.js";import{t as de}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as fe}from"./resolveChartConfig-CIhClE5R.js";import{t as pe}from"./img-D4RQwASc.js";import{n as me}from"./Title-BliHuXfT.js";import{t as he}from"./useChartExport-BZts4KFb.js";import{n as ge,t as _e}from"./annotationSlots-BRR85CqJ.js";import{n as ve,t as ye}from"./userOptionsSlots-DYuo-E5m.js";import{t as be}from"./usePrinter-sVoTzet1.js";import{c as xe}from"./canvas-lib-22VpOI4_.js";import{t as Se}from"./useResponsive-CENUxfEL.js";import{t as Ce}from"./DefGrad-DKMq1REY.js";import{t as we}from"./useUserOptionState-CXlFnwPv.js";import{t as Te}from"./useChartAccessibility-DOMuYJfm.js";import{t as Ee}from"./usePrefersMotion-XLHwega2.js";import{t as De}from"./useAutoSizeLabelsInsideViewbox-AIRF0PlD.js";import{t as Oe}from"./vue_ui_thermometer-CRijq6H6.js";import{Fragment as c,computed as l,createBlock as u,createCommentVNode as d,createElementBlock as f,createElementVNode as p,createSlots as ke,createVNode as Ae,defineAsyncComponent as m,guardReactiveProps as h,normalizeClass as g,normalizeProps as _,normalizeStyle as je,onMounted as Me,openBlock as v,ref as y,renderList as b,renderSlot as x,toDisplayString as S,toRefs as Ne,unref as C,useCssVars as Pe,watch as Fe,withCtx as Ie}from"vue";var Le=/* @__PURE__ */ e({default:()=>w}),Re=[`id`],ze={key:1,ref:`noTitle`,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},Be=[`xmlns`,`viewBox`,`aria-labelledby`,`aria-describedby`],Ve=[`id`],He=[`id`],Ue=[`width`,`height`],We=[`id`],Ge=[`x`,`y`,`width`,`height`,`rx`,`ry`],Ke=[`clip-path`],qe=[`x`,`y`,`height`,`width`],Je=[`x`,`y`,`height`,`width`,`fill`],Ye=[`x1`,`x2`,`y1`,`y2`,`stroke-width`,`stroke`],Xe=[`x1`,`x2`,`y1`,`y2`,`stroke-width`,`stroke`],Ze=[`x1`,`x2`,`y1`,`y2`,`stroke-width`,`stroke`],Qe=[`x1`,`x2`,`y1`,`y2`,`stroke-width`,`stroke`],$e=[`x1`,`x2`,`y1`,`y2`,`stroke-width`,`stroke`],et=[`x1`,`x2`,`y1`,`y2`,`stroke-width`,`stroke`],tt=[`x1`,`x2`,`y1`,`y2`,`stroke-width`,`stroke`],nt=[`x1`,`x2`,`y1`,`y2`,`stroke-width`,`stroke`],rt=[`x`,`y`,`height`,`width`],it=[`aria-label`],at=[`x`,`y`,`height`],ot=[`y`,`x`,`fill`,`font-size`,`font-weight`],st={key:4,class:`vue-data-ui-watermark`},w=/*#__PURE__*/ de({__name:`vue-ui-thermometer`,props:{dataset:{type:Object,default(){return{}}},config:{type:Object,default(){return{}}}},emits:[`copyAlt`],setup(e,{expose:de,emit:Le}){Pe(e=>({fff55a2e:Mt.value,v6d4692c5:jt.value,v4e7414f2:At.value}));let w=m(()=>import(`./PackageVersion-BIhjLNBU.js`).then(e=>e.t)),ct=m(()=>import(`./PenAndPaper-BGEp-TUm.js`).then(e=>e.t)),lt=m(()=>import(`./UserOptions-uWHV_zPB.js`).then(e=>e.n)),{vue_ui_thermometer:ut}=t(),dt=Ee(),T=e,ft=Le,E=y(ee()),D=y(null),pt=y(0),mt=y(0),ht=y(null),gt=y(null),O=y(null),k=y(null),_t=l(()=>!!T.dataset&&Object.keys(T.dataset).length);Me(()=>{St()});let A=y(B()),j=l(()=>A.value.userOptions),M=l(()=>A.value.style.chart.graduations),N=l(()=>A.value.style.chart);le({config:()=>A.value,dataset:()=>T.dataset,component:`VueUiThermometer`,rules:[ue.noHint]});let vt=y(N.value.thermometer.width),P=y(N.value.height),F=y(N.value.width),yt=l(()=>A.value.userOptions.useCursorPointer),bt=l(()=>ne({defaultConfig:{userOptions:{show:!1},style:{chart:{animation:{use:!1},backgroundColor:`#99999930`,graduations:{stroke:`#6A6A6A`}}}},userConfig:A.value.skeletonConfig??{}})),{loading:I,FINAL_DATASET:L}=se({...Ne(T),FINAL_CONFIG:A,prepareConfig:B,skeletonDataset:T.config?.skeletonDataset??{value:0,from:-100,to:100,steps:20,colors:{from:`#A1A1A1`,to:`#CACACA`}},skeletonConfig:ne({defaultConfig:A.value,userConfig:bt.value})}),xt=l(()=>A.value.debug);function St(){if(oe(T.dataset)?o({componentName:`VueUiThermometer`,type:`dataset`,debug:xt.value}):ae({datasetObject:T.dataset,requiredAttributes:[`value`,`from`,`to`]}).forEach(e=>{o({componentName:`VueUiThermometer`,type:`datasetAttribute`,property:e,debug:xt.value})}),A.value.responsive){let e=xe(()=>{let{width:e,height:t}=Se({chart:D.value,title:A.value.style.title.text?ht.value:null,source:gt.value});requestAnimationFrame(()=>{P.value=Math.max(.1,t-12),F.value=e,Rt()})});O.value&&(k.value&&O.value.unobserve(k.value),O.value.disconnect()),O.value=new ResizeObserver(e),k.value=D.value,O.value.observe(k.value)}Rt()}let{userOptionsVisible:R,setUserOptionsVisibility:Ct,keepUserOptionState:wt}=we({config:A.value}),{svgRef:z}=Te({config:A.value.style.title});function B(){return fe(T.config,ut,Oe)}Fe(()=>T.config,e=>{A.value=B(),R.value=!A.value.userOptions.showOnChartHover,vt.value=N.value.thermometer.width,P.value=N.value.height,F.value=N.value.width,St(),mt.value+=1},{deep:!0});let{isPrinting:V,isImaging:H,generatePdf:Tt,generateImage:Et}=be({elementId:`thermometer__${E.value}`,fileName:A.value.style.title.text||`vue-ui-thermometer`,options:A.value.userOptions.print}),Dt=l(()=>A.value.userOptions.show&&!A.value.style.title.text),U=l(()=>ie(A.value.customPalette)),W=l(()=>L.value.steps||10);function G(e,t,n){let r=[],i=Ot(e),a=Ot(t);for(let e=0;e<n;e+=1){let t=K(i.red,a.red,e,n),ee=K(i.green,a.green,e,n),o=K(i.blue,a.blue,e,n),s=`#${q(t)}${q(ee)}${q(o)}`;r.push(s)}return r}function Ot(e){let t=e.slice(1);return{red:parseInt(t.slice(0,2),16),green:parseInt(t.slice(2,4),16),blue:parseInt(t.slice(4,6),16)}}function K(e,t,n,r){return Math.round(e+(t-e)*n/r)}function q(e){return e.toString(16).padStart(2,`0`)}let J=l(()=>{let e=Math.max(.1,F.value),t=Math.max(.1,P.value),n=N.value.padding;return{width:e,left:e/2-N.value.thermometer.width/2,right:e/2+N.value.thermometer.width/2,top:n.top,bottom:t-n.bottom-n.top,height:t,thermoHeight:t-n.top-n.bottom,thermoWidth:N.value.thermometer.width}}),kt=l(()=>J.value),Y=l(()=>{let e=s(L.value.from)<0?Math.abs(s(L.value.from)):s(L.value.from),t=s(L.value.to)<0?Math.abs(s(L.value.to)):s(L.value.to),n=0;return n=s(L.value.to)>0?e+t:e>t?e-t:t-e,(1-(Math.abs(s(L.value.from))+s(L.value.value))/n)*J.value.thermoHeight}),At=l(()=>`${Y.value}px`),jt=l(()=>`${J.value.thermoHeight}px`),Mt=l(()=>dt.value?`0ms`:`${N.value.animation.speedMs}ms`),Nt=l(()=>{if(L.value.colors){if(!L.value.colors.from)return G(U.value[0]||r[0],a(L.value.colors.to),W.value||10);if(!L.value.colors.to)return G(a(L.value.colors.from),U.value[1]||r[1],W.value||10)}else return G(U.value[1]||r[1],U.value[0]||r[0],W.value||10);return G(a(L.value.colors.from),a(L.value.colors.to),W.value||10)}),Pt=l(()=>{let e=[],t=0,n=J.value.thermoHeight;for(let r=0;r<n-1;r+=n/W.value)e.push({x:J.value.left,y:J.value.top+r,qYLess:J.value.top+r+n/W.value/4,halfY:J.value.top+r+n/W.value/2,qYMore:J.value.top+r+n/W.value/4*3,color:Nt.value[t],height:Math.max(.1,n/W.value)}),t+=1;return e}),X=y(!1);function Ft(e){X.value=e,pt.value+=1}let Z=y(!1);function It(){Z.value=!Z.value}async function Lt({scale:e=2}={}){if(!D.value)return;let{width:t,height:n}=D.value.getBoundingClientRect(),r=t/n,{imageUri:i,base64:a}=await pe({domElement:D.value,base64:!0,img:!0,scale:e});return{imageUri:i,base64:a,title:A.value.style.title.text,width:t,height:n,aspectRatio:r}}let Q=l({get:()=>N.value.label.fontSize,set:e=>e}),{autoSizeLabels:Rt}=De({svgRef:z,fontSize:N.value.label.fontSize,minFontSize:N.value.label.minFontSize,sizeRef:Q,labelClass:`.vue-ui-thermometer-label`}),zt=l(()=>N.value.backgroundColor),Bt=l(()=>A.value.style.title),{isCallbackImaging:Vt,isCallbackSvg:Ht,generateSvg:Ut,onGenerateImage:Wt}=he({svg:z,title:Bt,legend:null,legendItems:null,backgroundColor:zt,getSvgCallback:()=>A.value.userOptions.callbacks.svg,generateImage:Et});async function Gt(){ft(`copyAlt`,{config:A.value,dataset:L.value}),A.value.userOptions.callbacks.altCopy?await Promise.resolve(A.value.userOptions.callbacks.altCopy({config:A.value,dataset:L.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}let Kt=l(()=>`${E.value}-title`),qt=l(()=>`${E.value}-desc`),$=l(()=>te(N.value.label.formatter,L.value.value,n({p:N.value.label.prefix,v:L.value.value,s:N.value.label.suffix,r:N.value.label.rounding}),{datapoint:L.value})),Jt=l(()=>A.value.style.title.text||``),Yt=l(()=>{if(I.value)return`...`;let e=s(L.value.from),t=s(L.value.to);return`Thermometer value: ${$.value}. Range: ${e} to ${t}.`});return de({getImage:Lt,generatePdf:Tt,generateImage:Et,generateSvg:Ut,toggleAnnotator:It,toggleFullscreen:Ft,copyAlt:Gt}),(e,t)=>(v(),f(`div`,{ref_key:`thermoChart`,ref:D,class:g(`vue-data-ui-component vue-ui-thermometer ${X.value?`vue-data-ui-wrapper-fullscreen`:``}`),style:je(`width:100%;background:${N.value.backgroundColor};color:${N.value.color};font-family:${A.value.style.fontFamily}`),id:`thermometer__${E.value}`,onMouseenter:t[0]||=()=>C(Ct)(!0),onMouseleave:t[1]||=()=>C(Ct)(!1)},[j.value.buttons.annotator?(v(),u(C(ct),{key:0,svgRef:C(z),backgroundColor:N.value.backgroundColor,color:N.value.color,active:Z.value,isCursorPointer:yt.value,palette:j.value.annotatorPalette,onClose:It},ke({_:2},[b(C(_e),t=>({name:t,fn:Ie(n=>[x(e.$slots,t,_(h(C(ge)(t,n))),void 0,!0)])}))]),1032,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):d(``,!0),Dt.value?(v(),f(`div`,ze,null,512)):d(``,!0),A.value.style.title.text?(v(),f(`div`,{key:2,ref_key:`chartTitle`,ref:ht,style:`width:100%`},[(v(),u(me,{key:`title_${mt.value}`,config:{title:{cy:`thermometer-div-title`,...A.value.style.title},subtitle:{cy:`thermometer-div-subtitle`,...A.value.style.title.subtitle}}},null,8,[`config`]))],512)):d(``,!0),j.value.show&&_t.value&&(C(wt)||C(R))?(v(),u(C(lt),{ref:`details`,key:`user_options_${pt.value}`,backgroundColor:N.value.backgroundColor,color:N.value.color,isImaging:C(H),isPrinting:C(V),uid:E.value,hasPdf:j.value.buttons.pdf,hasImg:j.value.buttons.img,hasSvg:j.value.buttons.svg,hasFullscreen:j.value.buttons.fullscreen,hasAltCopy:j.value.buttons.altCopy,hasXls:!1,isFullscreen:X.value,titles:{...j.value.buttonTitles},chartElement:D.value,position:j.value.position,hasAnnotator:j.value.buttons.annotator,isAnnotation:Z.value,callbacks:j.value.callbacks,printScale:j.value.print.scale,isCursorPointer:yt.value,onToggleFullscreen:Ft,onGeneratePdf:C(Tt),onGenerateImage:C(Wt),onGenerateSvg:C(Ut),onToggleAnnotator:It,onCopyAlt:Gt,style:je({visibility:C(wt)?C(R)?`visible`:`hidden`:`visible`})},ke({_:2},[b(C(ve)(e.$slots,`menuIcon optionPdf optionImg optionSvg optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:Ie(n=>[x(e.$slots,t,_(h(C(ye)(t,n))),void 0,!0)])}))]),1032,[`backgroundColor`,`color`,`isImaging`,`isPrinting`,`uid`,`hasPdf`,`hasImg`,`hasSvg`,`hasFullscreen`,`hasAltCopy`,`isFullscreen`,`titles`,`chartElement`,`position`,`hasAnnotator`,`isAnnotation`,`callbacks`,`printScale`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):d(``,!0),(v(),f(`svg`,{ref_key:`svgRef`,ref:z,xmlns:C(re),class:g({"vue-data-ui-fullscreen--on":X.value,"vue-data-ui-fulscreen--off":!X.value}),width:`100%`,viewBox:`0 0 ${J.value.width} ${J.value.height}`,style:`background:transparent`,"aria-labelledby":Kt.value,"aria-describedby":qt.value},[p(`title`,{id:Kt.value},S(Jt.value),9,Ve),p(`desc`,{id:qt.value},S(Yt.value),9,He),Ae(C(w)),x(e.$slots,`svg-underlayer`,{svg:{...kt.value,isPrintingImg:C(V)||C(H)||C(Vt),isPrintingSvg:C(Ht)}},void 0,!0),e.$slots[`chart-background`]?(v(),f(`foreignObject`,{key:0,x:0,y:0,width:J.value.width,height:J.value.height,style:{pointerEvents:`none`}},[x(e.$slots,`chart-background`,{},void 0,!0)],8,Ue)):d(``,!0),p(`defs`,null,[p(`clipPath`,{id:`vueUiPill-${E.value}`,clipPathUnits:`userSpaceOnUse`},[p(`rect`,{x:J.value.left,y:J.value.top,width:J.value.thermoWidth,height:J.value.thermoHeight,rx:J.value.thermoWidth/2,ry:J.value.thermoWidth/2},null,8,Ge)],8,We),(v(!0),f(c,null,b(Pt.value,(e,t)=>(v(),u(Ce,{t:`linear`,id:`vueUiThermometerGradient_${t}_${E.value}`,key:`t_${t}_${E.value}`,x1:`0%`,y1:`0%`,x2:`100%`,y2:`0%`,stops:[[`0%`,e.color,1],[`50%`,C(i)(e.color,100-M.value.gradient.intensity),1],[`100%`,e.color,1]]},null,8,[`id`,`stops`]))),128))]),p(`g`,{"clip-path":`url(#vueUiPill-${E.value})`},[p(`rect`,{x:J.value.left,y:J.value.top,height:J.value.thermoHeight,width:J.value.thermoWidth,fill:`#FFFFFF`},null,8,qe),(v(!0),f(c,null,b(Pt.value,(e,t)=>(v(),f(`g`,{key:`graduation_${t}`},[p(`rect`,{x:e.x,y:e.y,height:e.height,width:J.value.thermoWidth,fill:M.value.gradient.show?`url(#vueUiThermometerGradient_${t}_${E.value})`:e.color,"shape-rendering":`crispEdges`},null,8,Je),M.value.show&&[`both`,`left`].includes(M.value.sides)?(v(),f(`line`,{key:0,x1:e.x,x2:e.x+10,y1:e.y,y2:e.y,"stroke-width":M.value.strokeWidth,stroke:M.value.stroke,"stroke-linecap":`round`},null,8,Ye)):d(``,!0),M.value.showIntermediate?(v(),f(c,{key:1},[M.value.show&&[`both`,`left`].includes(M.value.sides)?(v(),f(`line`,{key:0,x1:e.x,x2:e.x+5,y1:e.halfY,y2:e.halfY,"stroke-width":M.value.strokeWidth/2,stroke:M.value.stroke,"stroke-linecap":`round`},null,8,Xe)):d(``,!0),M.value.show&&[`both`,`left`].includes(M.value.sides)?(v(),f(`line`,{key:1,x1:e.x,x2:e.x+2.5,y1:e.qYLess,y2:e.qYLess,"stroke-width":M.value.strokeWidth/2,stroke:M.value.stroke,"stroke-linecap":`round`},null,8,Ze)):d(``,!0),M.value.show&&[`both`,`left`].includes(M.value.sides)?(v(),f(`line`,{key:2,x1:e.x,x2:e.x+2.5,y1:e.qYMore,y2:e.qYMore,"stroke-width":M.value.strokeWidth/2,stroke:M.value.stroke,"stroke-linecap":`round`},null,8,Qe)):d(``,!0)],64)):d(``,!0),M.value.show&&[`both`,`right`].includes(M.value.sides)?(v(),f(`line`,{key:2,x1:J.value.right,x2:J.value.right-10,y1:e.y,y2:e.y,"stroke-width":M.value.strokeWidth,stroke:M.value.stroke,"stroke-linecap":`round`},null,8,$e)):d(``,!0),M.value.showIntermediate?(v(),f(c,{key:3},[M.value.show&&[`both`,`right`].includes(M.value.sides)?(v(),f(`line`,{key:0,x1:J.value.right,x2:J.value.right-5,y1:e.halfY,y2:e.halfY,"stroke-width":M.value.strokeWidth/2,stroke:M.value.stroke,"stroke-linecap":`round`},null,8,et)):d(``,!0),M.value.show&&[`both`,`right`].includes(M.value.sides)?(v(),f(`line`,{key:1,x1:J.value.right,x2:J.value.right-2.5,y1:e.qYLess,y2:e.qYLess,"stroke-width":M.value.strokeWidth/2,stroke:M.value.stroke,"stroke-linecap":`round`},null,8,tt)):d(``,!0),M.value.show&&[`both`,`right`].includes(M.value.sides)?(v(),f(`line`,{key:2,x1:J.value.right,x2:J.value.right-2.5,y1:e.qYMore,y2:e.qYMore,"stroke-width":M.value.strokeWidth/2,stroke:M.value.stroke,"stroke-linecap":`round`},null,8,nt)):d(``,!0)],64)):d(``,!0)]))),128)),p(`rect`,{class:g({"vue-ui-thermometer-temperature":N.value.animation.use}),x:J.value.left,y:J.value.top,height:Y.value,width:J.value.thermoWidth,fill:`#FFFFFF66`},null,10,rt)],8,Ke),N.value.label.show?(v(),f(`g`,{key:1,role:`status`,"aria-live":`polite`,"aria-label":C(I)?`Loading data`:$.value},[C(I)?(v(),f(`rect`,{key:0,x:J.value.left-60,y:Y.value+J.value.top-Q.value/2,width:50,height:Q.value,fill:`#6A6A6A40`,rx:`3`},null,8,at)):(v(),f(`text`,{key:1,"aria-hidden":`true`,class:g({"vue-ui-thermometer-temperature-value":N.value.animation.use,"vue-ui-thermometer-label":!0}),y:Y.value+J.value.top+Q.value/3,x:J.value.left-10,"text-anchor":`end`,fill:N.value.label.color,"font-size":Q.value,"font-weight":N.value.label.bold?`bold`:`normal`},S($.value),11,ot))],8,it)):d(``,!0),x(e.$slots,`svg`,{svg:{...kt.value,isPrintingImg:C(V)||C(H)||C(Vt),isPrintingSvg:C(Ht)}},void 0,!0)],10,Be)),e.$slots.watermark?(v(),f(`div`,st,[x(e.$slots,`watermark`,_(h({isPrinting:C(V)||C(H)||C(Vt)||C(Ht)})),void 0,!0)])):d(``,!0),e.$slots.source?(v(),f(`div`,{key:5,ref_key:`source`,ref:gt,dir:`auto`},[x(e.$slots,`source`,{},void 0,!0)],512)):d(``,!0),x(e.$slots,`skeleton`,{},()=>[C(I)?(v(),u(ce,{key:0})):d(``,!0)],!0)],46,Re))}},[[`__scopeId`,`data-v-fec98266`]]);export{Le as n,w as t};
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.js";import{$ as n,Ht as r,Jt as i,S as a,X as ee,at as o,b as s,i as te,in as ne,t as re,w as ie,yt as ae,zt as oe}from"./lib-rPeBMZrn.js";import{n as se,t as ce}from"./BaseScanner-8NdoBs7B.js";import{n as le,t as ue}from"./useHints-C-TwxM0Y.js";import{t as de}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as fe}from"./resolveChartConfig-CIhClE5R.js";import{t as pe}from"./img-D4RQwASc.js";import{n as me}from"./Title-BliHuXfT.js";import{t as he}from"./useChartExport-BZts4KFb.js";import{n as ge,t as _e}from"./annotationSlots-BRR85CqJ.js";import{n as ve,t as ye}from"./userOptionsSlots-DYuo-E5m.js";import{t as be}from"./usePrinter-DVf3YcG5.js";import{c as xe}from"./canvas-lib-22VpOI4_.js";import{t as Se}from"./useResponsive-CENUxfEL.js";import{t as Ce}from"./DefGrad-DKMq1REY.js";import{t as we}from"./useUserOptionState-CXlFnwPv.js";import{t as Te}from"./useChartAccessibility-DOMuYJfm.js";import{t as Ee}from"./usePrefersMotion-XLHwega2.js";import{t as De}from"./useAutoSizeLabelsInsideViewbox-AIRF0PlD.js";import{t as Oe}from"./vue_ui_thermometer-CRijq6H6.js";import{Fragment as c,computed as l,createBlock as u,createCommentVNode as d,createElementBlock as f,createElementVNode as p,createSlots as ke,createVNode as Ae,defineAsyncComponent as m,guardReactiveProps as h,normalizeClass as g,normalizeProps as _,normalizeStyle as je,onMounted as Me,openBlock as v,ref as y,renderList as b,renderSlot as x,toDisplayString as S,toRefs as Ne,unref as C,useCssVars as Pe,watch as Fe,withCtx as Ie}from"vue";var Le=/* @__PURE__ */ e({default:()=>w}),Re=[`id`],ze={key:1,ref:`noTitle`,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},Be=[`xmlns`,`viewBox`,`aria-labelledby`,`aria-describedby`],Ve=[`id`],He=[`id`],Ue=[`width`,`height`],We=[`id`],Ge=[`x`,`y`,`width`,`height`,`rx`,`ry`],Ke=[`clip-path`],qe=[`x`,`y`,`height`,`width`],Je=[`x`,`y`,`height`,`width`,`fill`],Ye=[`x1`,`x2`,`y1`,`y2`,`stroke-width`,`stroke`],Xe=[`x1`,`x2`,`y1`,`y2`,`stroke-width`,`stroke`],Ze=[`x1`,`x2`,`y1`,`y2`,`stroke-width`,`stroke`],Qe=[`x1`,`x2`,`y1`,`y2`,`stroke-width`,`stroke`],$e=[`x1`,`x2`,`y1`,`y2`,`stroke-width`,`stroke`],et=[`x1`,`x2`,`y1`,`y2`,`stroke-width`,`stroke`],tt=[`x1`,`x2`,`y1`,`y2`,`stroke-width`,`stroke`],nt=[`x1`,`x2`,`y1`,`y2`,`stroke-width`,`stroke`],rt=[`x`,`y`,`height`,`width`],it=[`aria-label`],at=[`x`,`y`,`height`],ot=[`y`,`x`,`fill`,`font-size`,`font-weight`],st={key:4,class:`vue-data-ui-watermark`},w=/*#__PURE__*/ de({__name:`vue-ui-thermometer`,props:{dataset:{type:Object,default(){return{}}},config:{type:Object,default(){return{}}}},emits:[`copyAlt`],setup(e,{expose:de,emit:Le}){Pe(e=>({fff55a2e:Mt.value,v6d4692c5:jt.value,v4e7414f2:At.value}));let w=m(()=>import(`./PackageVersion-CXT-eAuk.js`).then(e=>e.t)),ct=m(()=>import(`./PenAndPaper-BGEp-TUm.js`).then(e=>e.t)),lt=m(()=>import(`./UserOptions-uWHV_zPB.js`).then(e=>e.n)),{vue_ui_thermometer:ut}=t(),dt=Ee(),T=e,ft=Le,E=y(ee()),D=y(null),pt=y(0),mt=y(0),ht=y(null),gt=y(null),O=y(null),k=y(null),_t=l(()=>!!T.dataset&&Object.keys(T.dataset).length);Me(()=>{St()});let A=y(B()),j=l(()=>A.value.userOptions),M=l(()=>A.value.style.chart.graduations),N=l(()=>A.value.style.chart);le({config:()=>A.value,dataset:()=>T.dataset,component:`VueUiThermometer`,rules:[ue.noHint]});let vt=y(N.value.thermometer.width),P=y(N.value.height),F=y(N.value.width),yt=l(()=>A.value.userOptions.useCursorPointer),bt=l(()=>ne({defaultConfig:{userOptions:{show:!1},style:{chart:{animation:{use:!1},backgroundColor:`#99999930`,graduations:{stroke:`#6A6A6A`}}}},userConfig:A.value.skeletonConfig??{}})),{loading:I,FINAL_DATASET:L}=se({...Ne(T),FINAL_CONFIG:A,prepareConfig:B,skeletonDataset:T.config?.skeletonDataset??{value:0,from:-100,to:100,steps:20,colors:{from:`#A1A1A1`,to:`#CACACA`}},skeletonConfig:ne({defaultConfig:A.value,userConfig:bt.value})}),xt=l(()=>A.value.debug);function St(){if(oe(T.dataset)?o({componentName:`VueUiThermometer`,type:`dataset`,debug:xt.value}):ae({datasetObject:T.dataset,requiredAttributes:[`value`,`from`,`to`]}).forEach(e=>{o({componentName:`VueUiThermometer`,type:`datasetAttribute`,property:e,debug:xt.value})}),A.value.responsive){let e=xe(()=>{let{width:e,height:t}=Se({chart:D.value,title:A.value.style.title.text?ht.value:null,source:gt.value});requestAnimationFrame(()=>{P.value=Math.max(.1,t-12),F.value=e,Rt()})});O.value&&(k.value&&O.value.unobserve(k.value),O.value.disconnect()),O.value=new ResizeObserver(e),k.value=D.value,O.value.observe(k.value)}Rt()}let{userOptionsVisible:R,setUserOptionsVisibility:Ct,keepUserOptionState:wt}=we({config:A.value}),{svgRef:z}=Te({config:A.value.style.title});function B(){return fe(T.config,ut,Oe)}Fe(()=>T.config,e=>{A.value=B(),R.value=!A.value.userOptions.showOnChartHover,vt.value=N.value.thermometer.width,P.value=N.value.height,F.value=N.value.width,St(),mt.value+=1},{deep:!0});let{isPrinting:V,isImaging:H,generatePdf:Tt,generateImage:Et}=be({elementId:`thermometer__${E.value}`,fileName:A.value.style.title.text||`vue-ui-thermometer`,options:A.value.userOptions.print}),Dt=l(()=>A.value.userOptions.show&&!A.value.style.title.text),U=l(()=>ie(A.value.customPalette)),W=l(()=>L.value.steps||10);function G(e,t,n){let r=[],i=Ot(e),a=Ot(t);for(let e=0;e<n;e+=1){let t=K(i.red,a.red,e,n),ee=K(i.green,a.green,e,n),o=K(i.blue,a.blue,e,n),s=`#${q(t)}${q(ee)}${q(o)}`;r.push(s)}return r}function Ot(e){let t=e.slice(1);return{red:parseInt(t.slice(0,2),16),green:parseInt(t.slice(2,4),16),blue:parseInt(t.slice(4,6),16)}}function K(e,t,n,r){return Math.round(e+(t-e)*n/r)}function q(e){return e.toString(16).padStart(2,`0`)}let J=l(()=>{let e=Math.max(.1,F.value),t=Math.max(.1,P.value),n=N.value.padding;return{width:e,left:e/2-N.value.thermometer.width/2,right:e/2+N.value.thermometer.width/2,top:n.top,bottom:t-n.bottom-n.top,height:t,thermoHeight:t-n.top-n.bottom,thermoWidth:N.value.thermometer.width}}),kt=l(()=>J.value),Y=l(()=>{let e=s(L.value.from)<0?Math.abs(s(L.value.from)):s(L.value.from),t=s(L.value.to)<0?Math.abs(s(L.value.to)):s(L.value.to),n=0;return n=s(L.value.to)>0?e+t:e>t?e-t:t-e,(1-(Math.abs(s(L.value.from))+s(L.value.value))/n)*J.value.thermoHeight}),At=l(()=>`${Y.value}px`),jt=l(()=>`${J.value.thermoHeight}px`),Mt=l(()=>dt.value?`0ms`:`${N.value.animation.speedMs}ms`),Nt=l(()=>{if(L.value.colors){if(!L.value.colors.from)return G(U.value[0]||r[0],a(L.value.colors.to),W.value||10);if(!L.value.colors.to)return G(a(L.value.colors.from),U.value[1]||r[1],W.value||10)}else return G(U.value[1]||r[1],U.value[0]||r[0],W.value||10);return G(a(L.value.colors.from),a(L.value.colors.to),W.value||10)}),Pt=l(()=>{let e=[],t=0,n=J.value.thermoHeight;for(let r=0;r<n-1;r+=n/W.value)e.push({x:J.value.left,y:J.value.top+r,qYLess:J.value.top+r+n/W.value/4,halfY:J.value.top+r+n/W.value/2,qYMore:J.value.top+r+n/W.value/4*3,color:Nt.value[t],height:Math.max(.1,n/W.value)}),t+=1;return e}),X=y(!1);function Ft(e){X.value=e,pt.value+=1}let Z=y(!1);function It(){Z.value=!Z.value}async function Lt({scale:e=2}={}){if(!D.value)return;let{width:t,height:n}=D.value.getBoundingClientRect(),r=t/n,{imageUri:i,base64:a}=await pe({domElement:D.value,base64:!0,img:!0,scale:e});return{imageUri:i,base64:a,title:A.value.style.title.text,width:t,height:n,aspectRatio:r}}let Q=l({get:()=>N.value.label.fontSize,set:e=>e}),{autoSizeLabels:Rt}=De({svgRef:z,fontSize:N.value.label.fontSize,minFontSize:N.value.label.minFontSize,sizeRef:Q,labelClass:`.vue-ui-thermometer-label`}),zt=l(()=>N.value.backgroundColor),Bt=l(()=>A.value.style.title),{isCallbackImaging:Vt,isCallbackSvg:Ht,generateSvg:Ut,onGenerateImage:Wt}=he({svg:z,title:Bt,legend:null,legendItems:null,backgroundColor:zt,getSvgCallback:()=>A.value.userOptions.callbacks.svg,generateImage:Et});async function Gt(){ft(`copyAlt`,{config:A.value,dataset:L.value}),A.value.userOptions.callbacks.altCopy?await Promise.resolve(A.value.userOptions.callbacks.altCopy({config:A.value,dataset:L.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}let Kt=l(()=>`${E.value}-title`),qt=l(()=>`${E.value}-desc`),$=l(()=>te(N.value.label.formatter,L.value.value,n({p:N.value.label.prefix,v:L.value.value,s:N.value.label.suffix,r:N.value.label.rounding}),{datapoint:L.value})),Jt=l(()=>A.value.style.title.text||``),Yt=l(()=>{if(I.value)return`...`;let e=s(L.value.from),t=s(L.value.to);return`Thermometer value: ${$.value}. Range: ${e} to ${t}.`});return de({getImage:Lt,generatePdf:Tt,generateImage:Et,generateSvg:Ut,toggleAnnotator:It,toggleFullscreen:Ft,copyAlt:Gt}),(e,t)=>(v(),f(`div`,{ref_key:`thermoChart`,ref:D,class:g(`vue-data-ui-component vue-ui-thermometer ${X.value?`vue-data-ui-wrapper-fullscreen`:``}`),style:je(`width:100%;background:${N.value.backgroundColor};color:${N.value.color};font-family:${A.value.style.fontFamily}`),id:`thermometer__${E.value}`,onMouseenter:t[0]||=()=>C(Ct)(!0),onMouseleave:t[1]||=()=>C(Ct)(!1)},[j.value.buttons.annotator?(v(),u(C(ct),{key:0,svgRef:C(z),backgroundColor:N.value.backgroundColor,color:N.value.color,active:Z.value,isCursorPointer:yt.value,palette:j.value.annotatorPalette,onClose:It},ke({_:2},[b(C(_e),t=>({name:t,fn:Ie(n=>[x(e.$slots,t,_(h(C(ge)(t,n))),void 0,!0)])}))]),1032,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):d(``,!0),Dt.value?(v(),f(`div`,ze,null,512)):d(``,!0),A.value.style.title.text?(v(),f(`div`,{key:2,ref_key:`chartTitle`,ref:ht,style:`width:100%`},[(v(),u(me,{key:`title_${mt.value}`,config:{title:{cy:`thermometer-div-title`,...A.value.style.title},subtitle:{cy:`thermometer-div-subtitle`,...A.value.style.title.subtitle}}},null,8,[`config`]))],512)):d(``,!0),j.value.show&&_t.value&&(C(wt)||C(R))?(v(),u(C(lt),{ref:`details`,key:`user_options_${pt.value}`,backgroundColor:N.value.backgroundColor,color:N.value.color,isImaging:C(H),isPrinting:C(V),uid:E.value,hasPdf:j.value.buttons.pdf,hasImg:j.value.buttons.img,hasSvg:j.value.buttons.svg,hasFullscreen:j.value.buttons.fullscreen,hasAltCopy:j.value.buttons.altCopy,hasXls:!1,isFullscreen:X.value,titles:{...j.value.buttonTitles},chartElement:D.value,position:j.value.position,hasAnnotator:j.value.buttons.annotator,isAnnotation:Z.value,callbacks:j.value.callbacks,printScale:j.value.print.scale,isCursorPointer:yt.value,onToggleFullscreen:Ft,onGeneratePdf:C(Tt),onGenerateImage:C(Wt),onGenerateSvg:C(Ut),onToggleAnnotator:It,onCopyAlt:Gt,style:je({visibility:C(wt)?C(R)?`visible`:`hidden`:`visible`})},ke({_:2},[b(C(ve)(e.$slots,`menuIcon optionPdf optionImg optionSvg optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:Ie(n=>[x(e.$slots,t,_(h(C(ye)(t,n))),void 0,!0)])}))]),1032,[`backgroundColor`,`color`,`isImaging`,`isPrinting`,`uid`,`hasPdf`,`hasImg`,`hasSvg`,`hasFullscreen`,`hasAltCopy`,`isFullscreen`,`titles`,`chartElement`,`position`,`hasAnnotator`,`isAnnotation`,`callbacks`,`printScale`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):d(``,!0),(v(),f(`svg`,{ref_key:`svgRef`,ref:z,xmlns:C(re),class:g({"vue-data-ui-fullscreen--on":X.value,"vue-data-ui-fulscreen--off":!X.value}),width:`100%`,viewBox:`0 0 ${J.value.width} ${J.value.height}`,style:`background:transparent`,"aria-labelledby":Kt.value,"aria-describedby":qt.value},[p(`title`,{id:Kt.value},S(Jt.value),9,Ve),p(`desc`,{id:qt.value},S(Yt.value),9,He),Ae(C(w)),x(e.$slots,`svg-underlayer`,{svg:{...kt.value,isPrintingImg:C(V)||C(H)||C(Vt),isPrintingSvg:C(Ht)}},void 0,!0),e.$slots[`chart-background`]?(v(),f(`foreignObject`,{key:0,x:0,y:0,width:J.value.width,height:J.value.height,style:{pointerEvents:`none`}},[x(e.$slots,`chart-background`,{},void 0,!0)],8,Ue)):d(``,!0),p(`defs`,null,[p(`clipPath`,{id:`vueUiPill-${E.value}`,clipPathUnits:`userSpaceOnUse`},[p(`rect`,{x:J.value.left,y:J.value.top,width:J.value.thermoWidth,height:J.value.thermoHeight,rx:J.value.thermoWidth/2,ry:J.value.thermoWidth/2},null,8,Ge)],8,We),(v(!0),f(c,null,b(Pt.value,(e,t)=>(v(),u(Ce,{t:`linear`,id:`vueUiThermometerGradient_${t}_${E.value}`,key:`t_${t}_${E.value}`,x1:`0%`,y1:`0%`,x2:`100%`,y2:`0%`,stops:[[`0%`,e.color,1],[`50%`,C(i)(e.color,100-M.value.gradient.intensity),1],[`100%`,e.color,1]]},null,8,[`id`,`stops`]))),128))]),p(`g`,{"clip-path":`url(#vueUiPill-${E.value})`},[p(`rect`,{x:J.value.left,y:J.value.top,height:J.value.thermoHeight,width:J.value.thermoWidth,fill:`#FFFFFF`},null,8,qe),(v(!0),f(c,null,b(Pt.value,(e,t)=>(v(),f(`g`,{key:`graduation_${t}`},[p(`rect`,{x:e.x,y:e.y,height:e.height,width:J.value.thermoWidth,fill:M.value.gradient.show?`url(#vueUiThermometerGradient_${t}_${E.value})`:e.color,"shape-rendering":`crispEdges`},null,8,Je),M.value.show&&[`both`,`left`].includes(M.value.sides)?(v(),f(`line`,{key:0,x1:e.x,x2:e.x+10,y1:e.y,y2:e.y,"stroke-width":M.value.strokeWidth,stroke:M.value.stroke,"stroke-linecap":`round`},null,8,Ye)):d(``,!0),M.value.showIntermediate?(v(),f(c,{key:1},[M.value.show&&[`both`,`left`].includes(M.value.sides)?(v(),f(`line`,{key:0,x1:e.x,x2:e.x+5,y1:e.halfY,y2:e.halfY,"stroke-width":M.value.strokeWidth/2,stroke:M.value.stroke,"stroke-linecap":`round`},null,8,Xe)):d(``,!0),M.value.show&&[`both`,`left`].includes(M.value.sides)?(v(),f(`line`,{key:1,x1:e.x,x2:e.x+2.5,y1:e.qYLess,y2:e.qYLess,"stroke-width":M.value.strokeWidth/2,stroke:M.value.stroke,"stroke-linecap":`round`},null,8,Ze)):d(``,!0),M.value.show&&[`both`,`left`].includes(M.value.sides)?(v(),f(`line`,{key:2,x1:e.x,x2:e.x+2.5,y1:e.qYMore,y2:e.qYMore,"stroke-width":M.value.strokeWidth/2,stroke:M.value.stroke,"stroke-linecap":`round`},null,8,Qe)):d(``,!0)],64)):d(``,!0),M.value.show&&[`both`,`right`].includes(M.value.sides)?(v(),f(`line`,{key:2,x1:J.value.right,x2:J.value.right-10,y1:e.y,y2:e.y,"stroke-width":M.value.strokeWidth,stroke:M.value.stroke,"stroke-linecap":`round`},null,8,$e)):d(``,!0),M.value.showIntermediate?(v(),f(c,{key:3},[M.value.show&&[`both`,`right`].includes(M.value.sides)?(v(),f(`line`,{key:0,x1:J.value.right,x2:J.value.right-5,y1:e.halfY,y2:e.halfY,"stroke-width":M.value.strokeWidth/2,stroke:M.value.stroke,"stroke-linecap":`round`},null,8,et)):d(``,!0),M.value.show&&[`both`,`right`].includes(M.value.sides)?(v(),f(`line`,{key:1,x1:J.value.right,x2:J.value.right-2.5,y1:e.qYLess,y2:e.qYLess,"stroke-width":M.value.strokeWidth/2,stroke:M.value.stroke,"stroke-linecap":`round`},null,8,tt)):d(``,!0),M.value.show&&[`both`,`right`].includes(M.value.sides)?(v(),f(`line`,{key:2,x1:J.value.right,x2:J.value.right-2.5,y1:e.qYMore,y2:e.qYMore,"stroke-width":M.value.strokeWidth/2,stroke:M.value.stroke,"stroke-linecap":`round`},null,8,nt)):d(``,!0)],64)):d(``,!0)]))),128)),p(`rect`,{class:g({"vue-ui-thermometer-temperature":N.value.animation.use}),x:J.value.left,y:J.value.top,height:Y.value,width:J.value.thermoWidth,fill:`#FFFFFF66`},null,10,rt)],8,Ke),N.value.label.show?(v(),f(`g`,{key:1,role:`status`,"aria-live":`polite`,"aria-label":C(I)?`Loading data`:$.value},[C(I)?(v(),f(`rect`,{key:0,x:J.value.left-60,y:Y.value+J.value.top-Q.value/2,width:50,height:Q.value,fill:`#6A6A6A40`,rx:`3`},null,8,at)):(v(),f(`text`,{key:1,"aria-hidden":`true`,class:g({"vue-ui-thermometer-temperature-value":N.value.animation.use,"vue-ui-thermometer-label":!0}),y:Y.value+J.value.top+Q.value/3,x:J.value.left-10,"text-anchor":`end`,fill:N.value.label.color,"font-size":Q.value,"font-weight":N.value.label.bold?`bold`:`normal`},S($.value),11,ot))],8,it)):d(``,!0),x(e.$slots,`svg`,{svg:{...kt.value,isPrintingImg:C(V)||C(H)||C(Vt),isPrintingSvg:C(Ht)}},void 0,!0)],10,Be)),e.$slots.watermark?(v(),f(`div`,st,[x(e.$slots,`watermark`,_(h({isPrinting:C(V)||C(H)||C(Vt)||C(Ht)})),void 0,!0)])):d(``,!0),e.$slots.source?(v(),f(`div`,{key:5,ref_key:`source`,ref:gt,dir:`auto`},[x(e.$slots,`source`,{},void 0,!0)],512)):d(``,!0),x(e.$slots,`skeleton`,{},()=>[C(I)?(v(),u(ce,{key:0})):d(``,!0)],!0)],46,Re))}},[[`__scopeId`,`data-v-fec98266`]]);export{Le as n,w as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.js";import{X as n,rn as r,t as i}from"./lib-rPeBMZrn.js";import{n as a,t as o}from"./useHints-
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.js";import{X as n,rn as r,t as i}from"./lib-rPeBMZrn.js";import{n as a,t as o}from"./useHints-C-TwxM0Y.js";import{t as s}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as c}from"./useNestedProp-DnGoh-XS.js";import{t as l}from"./BaseIcon-Cm-IJ179.js";import{n as ee}from"./Title-BliHuXfT.js";import{c as te}from"./canvas-lib-22VpOI4_.js";import{t as ne}from"./useResponsive-CENUxfEL.js";import{t as re}from"./DefGrad-DKMq1REY.js";import{t as ie}from"./useChartAccessibility-DOMuYJfm.js";import{computed as u,createBlock as ae,createCommentVNode as d,createElementBlock as f,createElementVNode as p,createVNode as m,defineAsyncComponent as oe,guardReactiveProps as h,mergeProps as se,normalizeProps as g,normalizeStyle as _,onBeforeUnmount as ce,onMounted as le,openBlock as v,ref as y,renderSlot as b,shallowRef as ue,toDisplayString as de,unref as x,watch as fe}from"vue";var pe=class{constructor(e,t,n,r=!0,i=!0){this.interval=t,this.elapsed=0,this.isPaused=!1;let a=new Blob([`
|
|
2
2
|
let interval;
|
|
3
3
|
let elapsed = 0;
|
|
4
4
|
let paused = false;
|
|
@@ -61,4 +61,4 @@ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO
|
|
|
61
61
|
break;
|
|
62
62
|
}
|
|
63
63
|
};
|
|
64
|
-
`],{type:`application/javascript`}),o=URL.createObjectURL(a),s=new Worker(o);function c(e){let t=Math.floor(e/1e3),n=Math.floor(e%1e3/10),a=Math.floor(t/3600),o=Math.floor(t%3600/60),s=t%60,c=``;return i&&(c+=String(a).padStart(2,`0`)+`:`),c+=String(o).padStart(2,`0`)+`:`,c+=String(s).padStart(2,`0`),r&&(c+=`.`+String(n).padStart(2,`0`)),c}this.start=()=>{this.isPaused=!1,s.postMessage({action:`start`,data:{interval:this.interval}})},this.pause=()=>{this.isPaused?this.resume():(this.isPaused=!0,s.postMessage({action:`pause`}))},this.resume=()=>{this.isPaused&&=(s.postMessage({action:`resume`}),!1)},this.stop=()=>{s.postMessage({action:`stop`}),this.isPaused=!1},this.reset=()=>{s.postMessage({action:`reset`}),this.elapsed=0,this.isPaused=!1},this.restart=()=>{this.stop(),this.start()},this.lap=()=>new Promise(e=>{s.postMessage({action:`lap`}),s.addEventListener(`message`,t=>{let{elapsed:n,timestamp:r,action:i}=t.data;if(i===`lap`){let t=c(n);e({timestamp:r||0,elapsed:n,formatted:t})}},{once:!0})}),s.onmessage=t=>{let{elapsed:n,timestamp:r}=t.data;this.elapsed=n,e({timestamp:r||0,elapsed:this.elapsed,formatted:c(this.elapsed)})},s.onerror=e=>{n&&n(e)}}},S=/* @__PURE__ */ e({default:()=>C}),me=[`xmlns`,`viewBox`],he=[`width`,`height`],ge={key:1},_e=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`],ve=[`d`,`stroke`,`stroke-width`],ye=[`r`,`fill`,`stroke`,`stroke-width`],be=[`r`,`fill`,`stroke`,`stroke-width`],xe=[`x`,`y`],Se={key:5},Ce=[`x`,`y`,`font-size`,`fill`,`font-weight`],we={key:0,class:`vue-ui-timer-controls`},Te=[`title`],Ee=[`title`],De=[`title`],Oe=[`title`],ke=[`title`],C=/*#__PURE__*/ s({__name:`vue-ui-timer`,props:{config:{type:Object,default(){return{}}}},emits:[`start`,`pause`,`reset`,`restart`,`lap`],setup(e,{expose:s,emit:S}){let C=oe(()=>import(`./PackageVersion-
|
|
64
|
+
`],{type:`application/javascript`}),o=URL.createObjectURL(a),s=new Worker(o);function c(e){let t=Math.floor(e/1e3),n=Math.floor(e%1e3/10),a=Math.floor(t/3600),o=Math.floor(t%3600/60),s=t%60,c=``;return i&&(c+=String(a).padStart(2,`0`)+`:`),c+=String(o).padStart(2,`0`)+`:`,c+=String(s).padStart(2,`0`),r&&(c+=`.`+String(n).padStart(2,`0`)),c}this.start=()=>{this.isPaused=!1,s.postMessage({action:`start`,data:{interval:this.interval}})},this.pause=()=>{this.isPaused?this.resume():(this.isPaused=!0,s.postMessage({action:`pause`}))},this.resume=()=>{this.isPaused&&=(s.postMessage({action:`resume`}),!1)},this.stop=()=>{s.postMessage({action:`stop`}),this.isPaused=!1},this.reset=()=>{s.postMessage({action:`reset`}),this.elapsed=0,this.isPaused=!1},this.restart=()=>{this.stop(),this.start()},this.lap=()=>new Promise(e=>{s.postMessage({action:`lap`}),s.addEventListener(`message`,t=>{let{elapsed:n,timestamp:r,action:i}=t.data;if(i===`lap`){let t=c(n);e({timestamp:r||0,elapsed:n,formatted:t})}},{once:!0})}),s.onmessage=t=>{let{elapsed:n,timestamp:r}=t.data;this.elapsed=n,e({timestamp:r||0,elapsed:this.elapsed,formatted:c(this.elapsed)})},s.onerror=e=>{n&&n(e)}}},S=/* @__PURE__ */ e({default:()=>C}),me=[`xmlns`,`viewBox`],he=[`width`,`height`],ge={key:1},_e=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`],ve=[`d`,`stroke`,`stroke-width`],ye=[`r`,`fill`,`stroke`,`stroke-width`],be=[`r`,`fill`,`stroke`,`stroke-width`],xe=[`x`,`y`],Se={key:5},Ce=[`x`,`y`,`font-size`,`fill`,`font-weight`],we={key:0,class:`vue-ui-timer-controls`},Te=[`title`],Ee=[`title`],De=[`title`],Oe=[`title`],ke=[`title`],C=/*#__PURE__*/ s({__name:`vue-ui-timer`,props:{config:{type:Object,default(){return{}}}},emits:[`start`,`pause`,`reset`,`restart`,`lap`],setup(e,{expose:s,emit:S}){let C=oe(()=>import(`./PackageVersion-CXT-eAuk.js`).then(e=>e.t)),{vue_ui_timer:Ae}=t(),w=e,T=S,E=y(null),D=y(null),O=y(null),k=ue(null),A=ue(null),j=y(n()),M=y(0);le(()=>{N()});function N(){if(P.value.responsive){let e=te(()=>{let{width:e,height:t}=ne({chart:E.value,title:P.value.style.title.text?D.value:null,legend:O.value});requestAnimationFrame(()=>{B.value.width=e,B.value.height=t,P.value.responsiveProportionalSizing?(B.value.tracker.core=r({relator:Math.min(e,t),adjuster:P.value.style.width,source:6*I.value.radiusRatio,threshold:1,fallback:1}),B.value.tracker.aura=r({relator:Math.min(e,t),adjuster:P.value.style.width,source:12*I.value.aura.radiusRatio,threshold:1,fallback:1}),B.value.label=r({relator:Math.min(e,t),adjuster:P.value.style.width,source:F.value.label.fontSize,threshold:10,fallback:10})):B.value.label=F.value.label.fontSize})});k.value&&(A.value&&k.value.unobserve(A.value),k.value.disconnect()),k.value=new ResizeObserver(e),A.value=E.value.parentNode,k.value.observe(A.value)}}ce(()=>{k.value&&(A.value&&k.value.unobserve(A.value),k.value.disconnect())});let P=u({get:()=>z(),set:e=>e}),F=u(()=>P.value.stopwatch),I=u(()=>P.value.stopwatch.tracker),L=u(()=>P.value.stopwatch.legend);a({config:()=>P.value,dataset:()=>[],component:`VueUiTimer`,rules:[o.noHint]});let R=u(()=>P.value.useCursorPointer),{svgRef:je}=ie({config:P.value.style.title});function z(){return c({userConfig:w.config,defaultConfig:Ae})}fe(()=>w.config,e=>{P.value=z(),N(),M.value+=1},{deep:!0});let Me=u(()=>{if(F.value.showHours&&F.value.showHundredth)return`00:00:00.00`;if(F.value.showHours&&!F.value.showHundredth)return`00:00:00`;if(!F.value.showHours&&F.value.showHundredth)return`00:00.00`;if(!F.value.showHours&&!F.value.showHundredth)return`00:00`}),B=y({height:P.value.style.height,width:P.value.style.width,tracker:{core:6*I.value.radiusRatio,aura:12*I.value.aura.radiusRatio},label:F.value.label.fontSize}),V=y(0),H=new pe(e=>Ne(e),10,``,F.value.showHundredth,F.value.showHours),U=y(!0),W=y(!1),G=y(!1);function K(){T(`start`),U.value&&H.start(),U.value=!1,W.value=!0}function q(){W.value&&=(T(`reset`),H.stop(),X.value=[],U.value=!0,!1)}function J(){G.value=!G.value,T(`pause`,V.value),H.pause()}function Y(){W.value&&(G.value=!1,T(`restart`),X.value=[],H.restart())}let X=y([]);async function Z(){if(!W.value||G.value)return;let e=await H.lap();e&&(X.value.push(e),T(`lap`,X.value))}function Ne({timestamp:e,elapsed:t,formatted:n}){V.value={timestamp:e,elapsed:t,formatted:n}}let Q=u(()=>Math.min(B.value.width,B.value.height)/2.5*F.value.track.radiusRatio);function Pe(e,t){return e*(360/(t*1e3))%360}function Fe(e){let t=Math.PI/180*e;return{cx:B.value.width/2+Q.value*Math.cos(t),cy:B.value.height/2+Q.value*Math.sin(t)}}let $=u(()=>{let e=Pe(V.value.elapsed,F.value.cycleSeconds),{cx:t,cy:n}=Fe(e-90),r=+(e>180);return{cx:t||B.value.width/2,cy:n||B.value.height/2-Q.value,largeArcFlag:r,sweepFlag:1}});return s({start:K,pause:J,reset:q,restart:Y,lap:Z}),(e,t)=>(v(),f(`div`,{ref_key:`timerChart`,ref:E,class:`vue-data-ui-component vue-ui-timer`,style:_({fontFamily:P.value.style.fontFamily,width:`100%`,height:P.value.responsive?`100%`:`auto`,textAlign:`center`})},[P.value.style.title.text?(v(),f(`div`,{key:0,ref_key:`chartTitle`,ref:D,style:_({width:`100%`,background:P.value.style.backgroundColor})},[(v(),ae(ee,{key:`title_${M.value}`,config:{title:{cy:`title`,...P.value.style.title},subtitle:{cy:`subtitle`,...P.value.style.title.subtitle}}},null,8,[`config`]))],4)):d(``,!0),(v(),f(`svg`,{ref_key:`svgRef`,ref:je,xmlns:x(i),viewBox:`0 0 ${B.value.width<=0?10:B.value.width} ${B.value.height<=0?10:B.value.height}`,style:_({maxWidth:`100%`,overflow:`visible`,background:P.value.style.backgroundColor})},[m(x(C)),e.$slots[`chart-background`]?(v(),f(`foreignObject`,{key:0,x:0,y:0,width:B.value.width<=0?10:B.value.width,height:B.value.height<=0?10:B.value.height,style:{pointerEvents:`none`}},[b(e.$slots,`chart-background`,{},void 0,!0)],8,he)):d(``,!0),I.value.gradient.show?(v(),f(`defs`,ge,[m(re,{t:`radial`,id:`tracker_gradient_${j.value}`,cx:`50%`,cy:`50%`,r:`50%`,fx:`50%`,fy:`50%`,stops:[[`0%`,I.value.gradient.color,1],[`100%`,I.value.fill,1]]},null,8,[`id`,`stops`])])):d(``,!0),p(`circle`,{cx:B.value.width/2,cy:B.value.height/2,r:Q.value,fill:F.value.track.fill,stroke:F.value.track.stroke,"stroke-width":F.value.track.strokeWidth},null,8,_e),F.value.cycleTrack.show?(v(),f(`path`,{key:2,d:`M ${B.value.width/2},${B.value.height/2-Q.value} A ${Q.value},${Q.value} 0 ${$.value.largeArcFlag},${$.value.sweepFlag} ${$.value.cx},${$.value.cy}`,stroke:F.value.cycleTrack.stroke,"stroke-width":F.value.cycleTrack.strokeWidth,"stroke-linecap":`round`,fill:`none`},null,8,ve)):d(``,!0),p(`circle`,se($.value,{r:B.value.tracker.core,fill:I.value.gradient.show?`url(#tracker_gradient_${j.value})`:I.value.fill,stroke:I.value.stroke,"stroke-width":I.value.strokeWidth}),null,16,ye),I.value.aura.show?(v(),f(`circle`,se({key:3},$.value,{r:B.value.tracker.aura,fill:`${I.value.aura.fill}`,opacity:.2,stroke:I.value.aura.stroke,"stroke-width":I.value.aura.strokeWidth}),null,16,be)):d(``,!0),e.$slots.time?(v(),f(`foreignObject`,{key:4,x:B.value.width/2,y:B.value.height/2,height:`0.1`,width:`0.1`,style:{overflow:`visible`}},[b(e.$slots,`time`,g(h({...V.value,...B.value})),void 0,!0)],8,xe)):e.$slots.timeSvg?(v(),f(`g`,Se,[b(e.$slots,`timeSvg`,g(h({...V.value,...B.value})),void 0,!0)])):(v(),f(`text`,{key:6,x:B.value.width/2,y:B.value.height/2+B.value.label/4,"font-size":B.value.label,"text-anchor":`middle`,fill:F.value.label.color,"font-weight":F.value.label.bold?`bold`:`normal`,style:{"font-variant-numeric":`tabular-nums !important`}},de(V.value.formatted||Me.value),9,Ce))],12,me)),p(`div`,{ref_key:`chartLegend`,ref:O,style:_({width:`100%`,backgroundColor:L.value.backgroundColor})},[e.$slots.controls?d(``,!0):(v(),f(`div`,we,[L.value.buttons.start?(v(),f(`button`,{key:0,title:L.value.buttonTitles.start,onClick:K,class:`vue-ui-timer-button`,style:_({opacity:W.value?.2:1,cursor:W.value?`default`:R.value?`pointer`:`default`})},[m(l,{name:`play`,stroke:L.value.buttons.iconColor},null,8,[`stroke`])],12,Te)):d(``,!0),L.value.buttons.pause?(v(),f(`button`,{key:1,title:G.value?L.value.buttonTitles.resume:L.value.buttonTitles.pause,onClick:J,class:`vue-ui-timer-button`,style:_({opacity:W.value?1:.2,cursor:W.value&&R.value?`pointer`:`default`})},[m(l,{name:`pause`,stroke:L.value.buttons.iconColor},null,8,[`stroke`])],12,Ee)):d(``,!0),L.value.buttons.reset?(v(),f(`button`,{key:2,title:L.value.buttonTitles.reset,onClick:q,class:`vue-ui-timer-button`,style:_({opacity:W.value?1:.2,cursor:W.value&&R.value?`pointer`:`default`})},[m(l,{name:`stop`,stroke:L.value.buttons.iconColor},null,8,[`stroke`])],12,De)):d(``,!0),L.value.buttons.restart?(v(),f(`button`,{key:3,title:L.value.buttonTitles.restart,onClick:Y,class:`vue-ui-timer-button`,style:_({opacity:W.value?1:.2,cursor:W.value&&R.value?`pointer`:`default`})},[m(l,{name:`restart`,stroke:L.value.buttons.iconColor},null,8,[`stroke`])],12,Oe)):d(``,!0),L.value.buttons.lap?(v(),f(`button`,{key:4,title:L.value.buttonTitles.lap,onClick:Z,class:`vue-ui-timer-button`,style:_({opacity:W.value&&!G.value?1:.2,cursor:W.value&&!G.value&&R.value?`pointer`:`default`})},[m(l,{name:`lap`,stroke:L.value.buttons.iconColor},null,8,[`stroke`])],12,ke)):d(``,!0)])),b(e.$slots,`controls`,g(h({start:K,pause:J,reset:q,restart:Y,lap:Z,laps:X.value,isRunning:W.value,isPaused:G.value,...V.value})),void 0,!0),b(e.$slots,`laps`,g(h({laps:X.value,lap:Z,isRunning:W.value,isPaused:G.value,...V.value})),void 0,!0)],4)],4))}},[[`__scopeId`,`data-v-27b9f373`]]);export{S as n,C as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.js";import{$ as n,X as r,Yt as i,at as a,b as o,i as s,in as c,t as l,zt as ee}from"./lib-rPeBMZrn.js";import{n as te,t as ne}from"./BaseScanner-8NdoBs7B.js";import{n as re,t as ie}from"./useHints-BH9r_0Vd.js";import{t as ae}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as oe}from"./resolveChartConfig-CIhClE5R.js";import{t as se}from"./chartImage-DPGnEuYM.js";import{n as ce}from"./Title-BliHuXfT.js";import{t as le}from"./useChartExport-BZts4KFb.js";import{n as ue,t as de}from"./annotationSlots-BRR85CqJ.js";import{n as fe,t as pe}from"./userOptionsSlots-DYuo-E5m.js";import{t as me}from"./usePrinter-sVoTzet1.js";import{c as he}from"./canvas-lib-22VpOI4_.js";import{t as ge}from"./useResponsive-CENUxfEL.js";import{t as _e}from"./useUserOptionState-CXlFnwPv.js";import{t as ve}from"./useChartAccessibility-DOMuYJfm.js";import{t as ye}from"./usePrefersMotion-XLHwega2.js";import{t as be}from"./vue_ui_tiremarks-8HFfABNF.js";import{Fragment as xe,computed as u,createBlock as d,createCommentVNode as f,createElementBlock as p,createElementVNode as Se,createSlots as Ce,createVNode as we,defineAsyncComponent as m,guardReactiveProps as h,normalizeClass as g,normalizeProps as Te,normalizeStyle as Ee,onMounted as De,openBlock as _,ref as v,renderList as y,renderSlot as b,toDisplayString as x,toRefs as Oe,unref as S,watch as ke,withCtx as Ae}from"vue";var je=/* @__PURE__ */ e({default:()=>C}),Me=[`id`],Ne=[`xmlns`,`viewBox`,`aria-labelledby`,`aria-describedby`],Pe=[`id`],Fe=[`id`],Ie=[`width`,`height`],Le={key:1},Re=[`d`,`stroke-width`,`stroke`],ze={key:2},Be=[`x1`,`y1`,`x2`,`y2`,`stroke-width`,`stroke`],Ve=[`aria-label`],He=[`x`,`y`,`height`],Ue=[`x`,`y`,`font-size`,`fill`,`font-weight`,`text-anchor`],We={key:4,class:`vue-data-ui-watermark`},C=/*#__PURE__*/ ae({__name:`vue-ui-tiremarks`,props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:[`copyAlt`],setup(e,{expose:ae,emit:je}){let C=m(()=>import(`./PenAndPaper-BGEp-TUm.js`).then(e=>e.t)),Ge=m(()=>import(`./UserOptions-uWHV_zPB.js`).then(e=>e.n)),Ke=m(()=>import(`./PackageVersion-BIhjLNBU.js`).then(e=>e.t)),{vue_ui_tiremarks:qe}=t(),w=ye(),T=e,Je=je,Ye=u(()=>!!T.dataset&&Object.keys(T.dataset).length),E=v(r()),D=v(null),Xe=v(null),Ze=v(null),Qe=v(null),$e=v(0),et=v(0),O=v(null),k=v(null),A=v(L()),j=u(()=>A.value.userOptions),M=u(()=>A.value.style.chart.layout),N=u(()=>A.value.style.chart);re({config:()=>A.value,dataset:()=>T.dataset,component:`VueUiTiremarks`,rules:[ie.noHint]});let tt=u(()=>A.value.userOptions.useCursorPointer),nt=u(()=>c({defaultConfig:{userOptions:{show:!1},style:{chart:{backgroundColor:`#99999930`,animation:{use:!1},layout:{activeColor:`#6A6A6A80`,inactiveColor:`#CACACA80`,ticks:{gradient:{show:!1}}}}}},userConfig:A.value.skeletonConfig??{}})),{loading:P,FINAL_DATASET:F}=te({...Oe(T),FINAL_CONFIG:A,prepareConfig:L,skeletonDataset:T.config?.skeletonDataset??{percentage:50},skeletonConfig:c({defaultConfig:A.value,userConfig:nt.value})}),{userOptionsVisible:I,setUserOptionsVisibility:rt,keepUserOptionState:it}=_e({config:A.value}),{svgRef:at}=ve({config:N.value.title});function L(){return oe(T.config,qe,be)}ke(()=>T.config,e=>{A.value=L(),I.value=!A.value.userOptions.showOnChartHover,W.value=N.value.width,G.value=N.value.height,dt(),et.value+=1},{deep:!0});let{isPrinting:R,isImaging:z,generatePdf:ot,generateImage:st}=me({elementId:E.value,fileName:N.value.title.text||`vue-ui-tiremarks`,options:A.value.userOptions.print}),ct=u(()=>A.value.userOptions.show&&!N.value.title.text),B=v(N.value.animation.use&&!w.value?0:o(F.value.percentage));ke(()=>F.value,e=>{N.value.animation.use&&!w.value?lt(e.percentage):B.value=e.percentage||0},{deep:!0}),De(()=>{dt()});function lt(e){let t=N.value.animation.speed,n=Math.abs(e-B.value)/(t*120);function r(){B.value<e?B.value=Math.min(B.value+n,e):B.value>e&&(B.value=Math.max(B.value-n,e)),B.value!==e&&requestAnimationFrame(r)}r()}let ut=u(()=>A.value.debug);function dt(){if(ee(T.dataset)&&a({componentName:`VueUiTiremarks`,type:`dataset`,debug:ut.value}),A.value.responsive){let e=he(()=>{let{width:e,height:t}=ge({chart:D.value,title:N.value.title.text?Ze.value:null,source:Qe.value});requestAnimationFrame(()=>{W.value=Math.max(.1,e),G.value=Math.max(.1,t-12)})});O.value&&(k.value&&O.value.unobserve(k.value),O.value.disconnect()),O.value=new ResizeObserver(e),k.value=D.value.parentNode,O.value.observe(k.value)}lt(F.value.percentage||0)}let V=u(()=>M.value.display===`vertical`),H=u(()=>{let e=N.value.percentage.show,t={top:e?48:12,left:e?64:16,right:e?64:16,bottom:e?48:12};return V.value?{top:N.value.percentage.verticalPosition===`top`?t.top:3,left:3,right:3,bottom:N.value.percentage.verticalPosition===`bottom`?t.bottom:3}:{top:0,bottom:0,left:N.value.percentage.horizontalPosition===`left`?t.left:16,right:N.value.percentage.horizontalPosition===`right`?t.right:10}}),U=u(()=>Object.values(H.value).reduce((e,t)=>e+t,0)),W=v(N.value.width),G=v(N.value.height),K=u(()=>({height:G.value,width:W.value})),ft=u(()=>({horizontal:{x:J.value.x+(N.value.percentage.horizontalPosition===`left`?6:3),y:K.value.height/2-J.value.fontSize/2},vertical:{x:K.value.width/2-20,y:J.value.y-J.value.fontSize/2}})[M.value.display]),q=u(()=>V.value?{mark:(K.value.height-U.value)/100*.5,space:(K.value.height-U.value)/100*.5}:{mark:(K.value.width-U.value)/100*.5,space:(K.value.width-U.value)/100*.5}),pt=u(()=>{let e=[];for(let t=0;t<100;t+=1){let n=M.value.ticks.gradient.show?i(M.value.activeColor,t/100*(M.value.ticks.gradient.shiftHueIntensity/100)):M.value.activeColor;if(V.value){let r=M.value.crescendo?(100-t)*(K.value.width-H.value.left-H.value.right)/100/3:0,i=H.value.left+4+r,a=K.value.width-H.value.right-4-r,o=K.value.height-H.value.bottom-t*q.value.mark-t*q.value.space-q.value.mark,s=K.value.height-H.value.bottom-t*q.value.mark-t*q.value.space-q.value.mark,c=(a-i)/M.value.curveAngleX,l=M.value.curveAngleY*((1+t)/100);e.push({x1:i,x2:a,y1:o,y2:s,curve:`M ${i} ${o} C ${i+c} ${o-l}, ${a-c} ${s-l}, ${a} ${s}`,color:n})}else{let r=M.value.crescendo?(100-t)*(K.value.height-H.value.top-H.value.bottom)/100/3:0,i=H.value.left+t*q.value.mark+t*q.value.space-q.value.mark,a=i,o=H.value.top+4+r,s=K.value.height-H.value.bottom-4-r,c=M.value.curveAngleY*((1+t)/100),l=(s-o)/M.value.curveAngleX;e.push({x1:i,x2:a,y1:o,y2:s,curve:`M ${i} ${o} C ${i+c} ${o+l}, ${a+c} ${s-l}, ${a} ${s}`,color:n})}}return e}),J=u(()=>{let e,t,n,r=N.value.percentage.fontSize/3;return V.value?N.value.percentage.verticalPosition===`top`?(e=K.value.width/2,t=H.value.top/2,n=`middle`):N.value.percentage.verticalPosition===`bottom`&&(e=K.value.width/2,t=K.value.height-H.value.bottom/2+r,n=`middle`):N.value.percentage.horizontalPosition===`left`?(e=4,t=K.value.height/2+r,n=`start`):N.value.percentage.horizontalPosition===`right`&&(e=K.value.width-H.value.right+8,t=K.value.height/2+r,n=`start`),{x:e,y:t,textAnchor:n,bold:N.value.percentage.bold,fontSize:N.value.percentage.fontSize,fill:N.value.percentage.color}}),Y=v(!1);function mt(e){Y.value=e,$e.value+=1}let X=v(!1);function Z(){X.value=!X.value}let ht=se(D,()=>N.value.title.text),gt=u(()=>N.value.backgroundColor),_t=u(()=>N.value.title),{isCallbackImaging:vt,isCallbackSvg:Q,generateSvg:yt,onGenerateImage:bt}=le({svg:at,title:_t,legend:null,legendItems:null,backgroundColor:gt,getSvgCallback:()=>A.value.userOptions.callbacks.svg,generateImage:st});async function xt(){Je(`copyAlt`,{config:A.value,dataset:F.value}),A.value.userOptions.callbacks.altCopy?await Promise.resolve(A.value.userOptions.callbacks.altCopy({config:A.value,dataset:F.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}let St=u(()=>`${E.value}-title`),Ct=u(()=>`${E.value}-desc`),$=u(()=>s(N.value.percentage.formatter,B.value,n({v:B.value,s:`%`,r:N.value.percentage.rounding}))),wt=u(()=>N.value.title.text||``),Tt=u(()=>P.value?`Loading data`:`Value: ${$.value}`);return ae({getImage:ht,generatePdf:ot,generateImage:st,generateSvg:yt,toggleAnnotator:Z,toggleFullscreen:mt,copyAlt:xt}),(e,t)=>(_(),p(`div`,{ref_key:`tiremarksChart`,ref:D,class:g(`vue-data-ui-component vue-ui-tiremarks ${A.value.useCssAnimation?``:`vue-ui-dna`}`),style:Ee(`font-family:${A.value.style.fontFamily};width:100%; text-align:center;background:${N.value.backgroundColor}`),id:E.value,onMouseenter:t[0]||=()=>S(rt)(!0),onMouseleave:t[1]||=()=>S(rt)(!1)},[j.value.buttons.annotator?(_(),d(S(C),{key:0,svgRef:S(at),backgroundColor:N.value.backgroundColor,color:N.value.color,active:X.value,isCursorPointer:tt.value,palette:j.value.annotatorPalette,onClose:Z},Ce({_:2},[y(S(de),t=>({name:t,fn:Ae(n=>[b(e.$slots,t,Te(h(S(ue)(t,n))),void 0,!0)])}))]),1032,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):f(``,!0),ct.value?(_(),p(`div`,{key:1,ref_key:`noTitle`,ref:Xe,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):f(``,!0),N.value.title.text?(_(),p(`div`,{key:2,ref_key:`chartTitle`,ref:Ze,style:`width:100%;background:transparent;padding-bottom:12px`},[(_(),d(ce,{key:`title_${et.value}`,config:{title:{cy:`wheel-title`,...N.value.title},subtitle:{cy:`wheel-subtitle`,...N.value.title.subtitle}}},null,8,[`config`]))],512)):f(``,!0),j.value.show&&Ye.value&&(S(it)||S(I))?(_(),d(S(Ge),{ref:`details`,key:`user_options_${$e.value}`,backgroundColor:N.value.backgroundColor,color:N.value.color,isPrinting:S(R),isImaging:S(z),uid:E.value,hasPdf:j.value.buttons.pdf,hasImg:j.value.buttons.img,hasSvg:j.value.buttons.svg,hasFullscreen:j.value.buttons.fullscreen,hasAltCopy:j.value.buttons.altCopy,hasXls:!1,isFullscreen:Y.value,titles:{...j.value.buttonTitles},chartElement:D.value,position:j.value.position,hasAnnotator:j.value.buttons.annotator,isAnnotation:X.value,callbacks:j.value.callbacks,printScale:j.value.print.scale,isCursorPointer:tt.value,onToggleFullscreen:mt,onGeneratePdf:S(ot),onGenerateImage:S(bt),onGenerateSvg:S(yt),onToggleAnnotator:Z,onCopyAlt:xt,style:Ee({visibility:S(it)?S(I)?`visible`:`hidden`:`visible`})},Ce({_:2},[y(S(fe)(e.$slots,`menuIcon optionPdf optionImg optionSvg optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:Ae(n=>[b(e.$slots,t,Te(h(S(pe)(t,n))),void 0,!0)])}))]),1032,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`hasPdf`,`hasImg`,`hasSvg`,`hasFullscreen`,`hasAltCopy`,`isFullscreen`,`titles`,`chartElement`,`position`,`hasAnnotator`,`isAnnotation`,`callbacks`,`printScale`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):f(``,!0),(_(),p(`svg`,{ref_key:`svgRef`,ref:at,xmlns:S(l),class:g({"vue-data-ui-fullscreen--on":Y.value,"vue-data-ui-fulscreen--off":!Y.value}),viewBox:`0 0 ${W.value} ${G.value}`,style:Ee(`max-width:100%; overflow: visible; background:transparent;color:${N.value.color}`),role:`img`,"aria-labelledby":St.value,"aria-describedby":Ct.value},[Se(`title`,{id:St.value},x(wt.value),9,Pe),Se(`desc`,{id:Ct.value},x(Tt.value),9,Fe),we(S(Ke)),b(e.$slots,`svg-underlayer`,{svg:{...K.value,isPrintingImg:S(R)||S(z)||S(vt),isPrintingSvg:S(Q)}},void 0,!0),e.$slots[`chart-background`]?(_(),p(`foreignObject`,{key:0,x:0,y:0,width:K.value.width,height:K.value.height,style:{pointerEvents:`none`}},[b(e.$slots,`chart-background`,{},void 0,!0)],8,Ie)):f(``,!0),M.value.curved?(_(),p(`g`,Le,[(_(!0),p(xe,null,y(pt.value,(e,t)=>(_(),p(`path`,{d:e.curve,"stroke-width":q.value.mark,stroke:B.value>=t?e.color:M.value.inactiveColor,"stroke-linecap":`round`,fill:`none`,class:g({"vue-ui-tick-animated":N.value.animation.use&&!S(w)&&t<=B.value})},null,10,Re))),256))])):(_(),p(`g`,ze,[(_(!0),p(xe,null,y(pt.value,(e,t)=>(_(),p(`line`,{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,"stroke-width":q.value.mark,stroke:B.value>=t?e.color:M.value.inactiveColor,"stroke-linecap":`round`},null,8,Be))),256))])),N.value.percentage.show?(_(),p(`g`,{key:3,role:`status`,"aria-live":`polite`,"aria-label":S(P)?`...`:`${$.value}`},[S(P)?(_(),p(`rect`,{key:0,x:ft.value.x,y:ft.value.y,width:40,height:J.value.fontSize,fill:`#6A6A6A80`,rx:3},null,8,He)):(_(),p(`text`,{key:1,"aria-hidden":`true`,x:J.value.x,y:J.value.y,"font-size":J.value.fontSize,fill:M.value.ticks.gradient.show&&N.value.percentage.useGradientColor?S(i)(M.value.activeColor,B.value/100*(M.value.ticks.gradient.shiftHueIntensity/100)):N.value.percentage.color,"font-weight":J.value.bold?`bold`:`normal`,"text-anchor":J.value.textAnchor},x($.value),9,Ue))],8,Ve)):f(``,!0),b(e.$slots,`svg`,{svg:{...K.value,isPrintingImg:S(R)||S(z)||S(vt),isPrintingSvg:S(Q)}},void 0,!0)],14,Ne)),e.$slots.watermark?(_(),p(`div`,We,[b(e.$slots,`watermark`,Te(h({isPrinting:S(R)||S(z)||S(vt)||S(Q)})),void 0,!0)])):f(``,!0),e.$slots.source?(_(),p(`div`,{key:5,ref_key:`source`,ref:Qe,dir:`auto`},[b(e.$slots,`source`,{},void 0,!0)],512)):f(``,!0),b(e.$slots,`skeleton`,{},()=>[S(P)?(_(),d(ne,{key:0})):f(``,!0)],!0)],46,Me))}},[[`__scopeId`,`data-v-fa4acd55`]]);export{je as n,C as t};
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.js";import{$ as n,X as r,Yt as i,at as a,b as o,i as s,in as c,t as l,zt as ee}from"./lib-rPeBMZrn.js";import{n as te,t as ne}from"./BaseScanner-8NdoBs7B.js";import{n as re,t as ie}from"./useHints-C-TwxM0Y.js";import{t as ae}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as oe}from"./resolveChartConfig-CIhClE5R.js";import{t as se}from"./chartImage-DPGnEuYM.js";import{n as ce}from"./Title-BliHuXfT.js";import{t as le}from"./useChartExport-BZts4KFb.js";import{n as ue,t as de}from"./annotationSlots-BRR85CqJ.js";import{n as fe,t as pe}from"./userOptionsSlots-DYuo-E5m.js";import{t as me}from"./usePrinter-DVf3YcG5.js";import{c as he}from"./canvas-lib-22VpOI4_.js";import{t as ge}from"./useResponsive-CENUxfEL.js";import{t as _e}from"./useUserOptionState-CXlFnwPv.js";import{t as ve}from"./useChartAccessibility-DOMuYJfm.js";import{t as ye}from"./usePrefersMotion-XLHwega2.js";import{t as be}from"./vue_ui_tiremarks-8HFfABNF.js";import{Fragment as xe,computed as u,createBlock as d,createCommentVNode as f,createElementBlock as p,createElementVNode as Se,createSlots as Ce,createVNode as we,defineAsyncComponent as m,guardReactiveProps as h,normalizeClass as g,normalizeProps as Te,normalizeStyle as Ee,onMounted as De,openBlock as _,ref as v,renderList as y,renderSlot as b,toDisplayString as x,toRefs as Oe,unref as S,watch as ke,withCtx as Ae}from"vue";var je=/* @__PURE__ */ e({default:()=>C}),Me=[`id`],Ne=[`xmlns`,`viewBox`,`aria-labelledby`,`aria-describedby`],Pe=[`id`],Fe=[`id`],Ie=[`width`,`height`],Le={key:1},Re=[`d`,`stroke-width`,`stroke`],ze={key:2},Be=[`x1`,`y1`,`x2`,`y2`,`stroke-width`,`stroke`],Ve=[`aria-label`],He=[`x`,`y`,`height`],Ue=[`x`,`y`,`font-size`,`fill`,`font-weight`,`text-anchor`],We={key:4,class:`vue-data-ui-watermark`},C=/*#__PURE__*/ ae({__name:`vue-ui-tiremarks`,props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:[`copyAlt`],setup(e,{expose:ae,emit:je}){let C=m(()=>import(`./PenAndPaper-BGEp-TUm.js`).then(e=>e.t)),Ge=m(()=>import(`./UserOptions-uWHV_zPB.js`).then(e=>e.n)),Ke=m(()=>import(`./PackageVersion-CXT-eAuk.js`).then(e=>e.t)),{vue_ui_tiremarks:qe}=t(),w=ye(),T=e,Je=je,Ye=u(()=>!!T.dataset&&Object.keys(T.dataset).length),E=v(r()),D=v(null),Xe=v(null),Ze=v(null),Qe=v(null),$e=v(0),et=v(0),O=v(null),k=v(null),A=v(L()),j=u(()=>A.value.userOptions),M=u(()=>A.value.style.chart.layout),N=u(()=>A.value.style.chart);re({config:()=>A.value,dataset:()=>T.dataset,component:`VueUiTiremarks`,rules:[ie.noHint]});let tt=u(()=>A.value.userOptions.useCursorPointer),nt=u(()=>c({defaultConfig:{userOptions:{show:!1},style:{chart:{backgroundColor:`#99999930`,animation:{use:!1},layout:{activeColor:`#6A6A6A80`,inactiveColor:`#CACACA80`,ticks:{gradient:{show:!1}}}}}},userConfig:A.value.skeletonConfig??{}})),{loading:P,FINAL_DATASET:F}=te({...Oe(T),FINAL_CONFIG:A,prepareConfig:L,skeletonDataset:T.config?.skeletonDataset??{percentage:50},skeletonConfig:c({defaultConfig:A.value,userConfig:nt.value})}),{userOptionsVisible:I,setUserOptionsVisibility:rt,keepUserOptionState:it}=_e({config:A.value}),{svgRef:at}=ve({config:N.value.title});function L(){return oe(T.config,qe,be)}ke(()=>T.config,e=>{A.value=L(),I.value=!A.value.userOptions.showOnChartHover,W.value=N.value.width,G.value=N.value.height,dt(),et.value+=1},{deep:!0});let{isPrinting:R,isImaging:z,generatePdf:ot,generateImage:st}=me({elementId:E.value,fileName:N.value.title.text||`vue-ui-tiremarks`,options:A.value.userOptions.print}),ct=u(()=>A.value.userOptions.show&&!N.value.title.text),B=v(N.value.animation.use&&!w.value?0:o(F.value.percentage));ke(()=>F.value,e=>{N.value.animation.use&&!w.value?lt(e.percentage):B.value=e.percentage||0},{deep:!0}),De(()=>{dt()});function lt(e){let t=N.value.animation.speed,n=Math.abs(e-B.value)/(t*120);function r(){B.value<e?B.value=Math.min(B.value+n,e):B.value>e&&(B.value=Math.max(B.value-n,e)),B.value!==e&&requestAnimationFrame(r)}r()}let ut=u(()=>A.value.debug);function dt(){if(ee(T.dataset)&&a({componentName:`VueUiTiremarks`,type:`dataset`,debug:ut.value}),A.value.responsive){let e=he(()=>{let{width:e,height:t}=ge({chart:D.value,title:N.value.title.text?Ze.value:null,source:Qe.value});requestAnimationFrame(()=>{W.value=Math.max(.1,e),G.value=Math.max(.1,t-12)})});O.value&&(k.value&&O.value.unobserve(k.value),O.value.disconnect()),O.value=new ResizeObserver(e),k.value=D.value.parentNode,O.value.observe(k.value)}lt(F.value.percentage||0)}let V=u(()=>M.value.display===`vertical`),H=u(()=>{let e=N.value.percentage.show,t={top:e?48:12,left:e?64:16,right:e?64:16,bottom:e?48:12};return V.value?{top:N.value.percentage.verticalPosition===`top`?t.top:3,left:3,right:3,bottom:N.value.percentage.verticalPosition===`bottom`?t.bottom:3}:{top:0,bottom:0,left:N.value.percentage.horizontalPosition===`left`?t.left:16,right:N.value.percentage.horizontalPosition===`right`?t.right:10}}),U=u(()=>Object.values(H.value).reduce((e,t)=>e+t,0)),W=v(N.value.width),G=v(N.value.height),K=u(()=>({height:G.value,width:W.value})),ft=u(()=>({horizontal:{x:J.value.x+(N.value.percentage.horizontalPosition===`left`?6:3),y:K.value.height/2-J.value.fontSize/2},vertical:{x:K.value.width/2-20,y:J.value.y-J.value.fontSize/2}})[M.value.display]),q=u(()=>V.value?{mark:(K.value.height-U.value)/100*.5,space:(K.value.height-U.value)/100*.5}:{mark:(K.value.width-U.value)/100*.5,space:(K.value.width-U.value)/100*.5}),pt=u(()=>{let e=[];for(let t=0;t<100;t+=1){let n=M.value.ticks.gradient.show?i(M.value.activeColor,t/100*(M.value.ticks.gradient.shiftHueIntensity/100)):M.value.activeColor;if(V.value){let r=M.value.crescendo?(100-t)*(K.value.width-H.value.left-H.value.right)/100/3:0,i=H.value.left+4+r,a=K.value.width-H.value.right-4-r,o=K.value.height-H.value.bottom-t*q.value.mark-t*q.value.space-q.value.mark,s=K.value.height-H.value.bottom-t*q.value.mark-t*q.value.space-q.value.mark,c=(a-i)/M.value.curveAngleX,l=M.value.curveAngleY*((1+t)/100);e.push({x1:i,x2:a,y1:o,y2:s,curve:`M ${i} ${o} C ${i+c} ${o-l}, ${a-c} ${s-l}, ${a} ${s}`,color:n})}else{let r=M.value.crescendo?(100-t)*(K.value.height-H.value.top-H.value.bottom)/100/3:0,i=H.value.left+t*q.value.mark+t*q.value.space-q.value.mark,a=i,o=H.value.top+4+r,s=K.value.height-H.value.bottom-4-r,c=M.value.curveAngleY*((1+t)/100),l=(s-o)/M.value.curveAngleX;e.push({x1:i,x2:a,y1:o,y2:s,curve:`M ${i} ${o} C ${i+c} ${o+l}, ${a+c} ${s-l}, ${a} ${s}`,color:n})}}return e}),J=u(()=>{let e,t,n,r=N.value.percentage.fontSize/3;return V.value?N.value.percentage.verticalPosition===`top`?(e=K.value.width/2,t=H.value.top/2,n=`middle`):N.value.percentage.verticalPosition===`bottom`&&(e=K.value.width/2,t=K.value.height-H.value.bottom/2+r,n=`middle`):N.value.percentage.horizontalPosition===`left`?(e=4,t=K.value.height/2+r,n=`start`):N.value.percentage.horizontalPosition===`right`&&(e=K.value.width-H.value.right+8,t=K.value.height/2+r,n=`start`),{x:e,y:t,textAnchor:n,bold:N.value.percentage.bold,fontSize:N.value.percentage.fontSize,fill:N.value.percentage.color}}),Y=v(!1);function mt(e){Y.value=e,$e.value+=1}let X=v(!1);function Z(){X.value=!X.value}let ht=se(D,()=>N.value.title.text),gt=u(()=>N.value.backgroundColor),_t=u(()=>N.value.title),{isCallbackImaging:vt,isCallbackSvg:Q,generateSvg:yt,onGenerateImage:bt}=le({svg:at,title:_t,legend:null,legendItems:null,backgroundColor:gt,getSvgCallback:()=>A.value.userOptions.callbacks.svg,generateImage:st});async function xt(){Je(`copyAlt`,{config:A.value,dataset:F.value}),A.value.userOptions.callbacks.altCopy?await Promise.resolve(A.value.userOptions.callbacks.altCopy({config:A.value,dataset:F.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}let St=u(()=>`${E.value}-title`),Ct=u(()=>`${E.value}-desc`),$=u(()=>s(N.value.percentage.formatter,B.value,n({v:B.value,s:`%`,r:N.value.percentage.rounding}))),wt=u(()=>N.value.title.text||``),Tt=u(()=>P.value?`Loading data`:`Value: ${$.value}`);return ae({getImage:ht,generatePdf:ot,generateImage:st,generateSvg:yt,toggleAnnotator:Z,toggleFullscreen:mt,copyAlt:xt}),(e,t)=>(_(),p(`div`,{ref_key:`tiremarksChart`,ref:D,class:g(`vue-data-ui-component vue-ui-tiremarks ${A.value.useCssAnimation?``:`vue-ui-dna`}`),style:Ee(`font-family:${A.value.style.fontFamily};width:100%; text-align:center;background:${N.value.backgroundColor}`),id:E.value,onMouseenter:t[0]||=()=>S(rt)(!0),onMouseleave:t[1]||=()=>S(rt)(!1)},[j.value.buttons.annotator?(_(),d(S(C),{key:0,svgRef:S(at),backgroundColor:N.value.backgroundColor,color:N.value.color,active:X.value,isCursorPointer:tt.value,palette:j.value.annotatorPalette,onClose:Z},Ce({_:2},[y(S(de),t=>({name:t,fn:Ae(n=>[b(e.$slots,t,Te(h(S(ue)(t,n))),void 0,!0)])}))]),1032,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):f(``,!0),ct.value?(_(),p(`div`,{key:1,ref_key:`noTitle`,ref:Xe,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):f(``,!0),N.value.title.text?(_(),p(`div`,{key:2,ref_key:`chartTitle`,ref:Ze,style:`width:100%;background:transparent;padding-bottom:12px`},[(_(),d(ce,{key:`title_${et.value}`,config:{title:{cy:`wheel-title`,...N.value.title},subtitle:{cy:`wheel-subtitle`,...N.value.title.subtitle}}},null,8,[`config`]))],512)):f(``,!0),j.value.show&&Ye.value&&(S(it)||S(I))?(_(),d(S(Ge),{ref:`details`,key:`user_options_${$e.value}`,backgroundColor:N.value.backgroundColor,color:N.value.color,isPrinting:S(R),isImaging:S(z),uid:E.value,hasPdf:j.value.buttons.pdf,hasImg:j.value.buttons.img,hasSvg:j.value.buttons.svg,hasFullscreen:j.value.buttons.fullscreen,hasAltCopy:j.value.buttons.altCopy,hasXls:!1,isFullscreen:Y.value,titles:{...j.value.buttonTitles},chartElement:D.value,position:j.value.position,hasAnnotator:j.value.buttons.annotator,isAnnotation:X.value,callbacks:j.value.callbacks,printScale:j.value.print.scale,isCursorPointer:tt.value,onToggleFullscreen:mt,onGeneratePdf:S(ot),onGenerateImage:S(bt),onGenerateSvg:S(yt),onToggleAnnotator:Z,onCopyAlt:xt,style:Ee({visibility:S(it)?S(I)?`visible`:`hidden`:`visible`})},Ce({_:2},[y(S(fe)(e.$slots,`menuIcon optionPdf optionImg optionSvg optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:Ae(n=>[b(e.$slots,t,Te(h(S(pe)(t,n))),void 0,!0)])}))]),1032,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`hasPdf`,`hasImg`,`hasSvg`,`hasFullscreen`,`hasAltCopy`,`isFullscreen`,`titles`,`chartElement`,`position`,`hasAnnotator`,`isAnnotation`,`callbacks`,`printScale`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):f(``,!0),(_(),p(`svg`,{ref_key:`svgRef`,ref:at,xmlns:S(l),class:g({"vue-data-ui-fullscreen--on":Y.value,"vue-data-ui-fulscreen--off":!Y.value}),viewBox:`0 0 ${W.value} ${G.value}`,style:Ee(`max-width:100%; overflow: visible; background:transparent;color:${N.value.color}`),role:`img`,"aria-labelledby":St.value,"aria-describedby":Ct.value},[Se(`title`,{id:St.value},x(wt.value),9,Pe),Se(`desc`,{id:Ct.value},x(Tt.value),9,Fe),we(S(Ke)),b(e.$slots,`svg-underlayer`,{svg:{...K.value,isPrintingImg:S(R)||S(z)||S(vt),isPrintingSvg:S(Q)}},void 0,!0),e.$slots[`chart-background`]?(_(),p(`foreignObject`,{key:0,x:0,y:0,width:K.value.width,height:K.value.height,style:{pointerEvents:`none`}},[b(e.$slots,`chart-background`,{},void 0,!0)],8,Ie)):f(``,!0),M.value.curved?(_(),p(`g`,Le,[(_(!0),p(xe,null,y(pt.value,(e,t)=>(_(),p(`path`,{d:e.curve,"stroke-width":q.value.mark,stroke:B.value>=t?e.color:M.value.inactiveColor,"stroke-linecap":`round`,fill:`none`,class:g({"vue-ui-tick-animated":N.value.animation.use&&!S(w)&&t<=B.value})},null,10,Re))),256))])):(_(),p(`g`,ze,[(_(!0),p(xe,null,y(pt.value,(e,t)=>(_(),p(`line`,{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,"stroke-width":q.value.mark,stroke:B.value>=t?e.color:M.value.inactiveColor,"stroke-linecap":`round`},null,8,Be))),256))])),N.value.percentage.show?(_(),p(`g`,{key:3,role:`status`,"aria-live":`polite`,"aria-label":S(P)?`...`:`${$.value}`},[S(P)?(_(),p(`rect`,{key:0,x:ft.value.x,y:ft.value.y,width:40,height:J.value.fontSize,fill:`#6A6A6A80`,rx:3},null,8,He)):(_(),p(`text`,{key:1,"aria-hidden":`true`,x:J.value.x,y:J.value.y,"font-size":J.value.fontSize,fill:M.value.ticks.gradient.show&&N.value.percentage.useGradientColor?S(i)(M.value.activeColor,B.value/100*(M.value.ticks.gradient.shiftHueIntensity/100)):N.value.percentage.color,"font-weight":J.value.bold?`bold`:`normal`,"text-anchor":J.value.textAnchor},x($.value),9,Ue))],8,Ve)):f(``,!0),b(e.$slots,`svg`,{svg:{...K.value,isPrintingImg:S(R)||S(z)||S(vt),isPrintingSvg:S(Q)}},void 0,!0)],14,Ne)),e.$slots.watermark?(_(),p(`div`,We,[b(e.$slots,`watermark`,Te(h({isPrinting:S(R)||S(z)||S(vt)||S(Q)})),void 0,!0)])):f(``,!0),e.$slots.source?(_(),p(`div`,{key:5,ref_key:`source`,ref:Qe,dir:`auto`},[b(e.$slots,`source`,{},void 0,!0)],512)):f(``,!0),b(e.$slots,`skeleton`,{},()=>[S(P)?(_(),d(ne,{key:0})):f(``,!0)],!0)],46,Me))}},[[`__scopeId`,`data-v-fa4acd55`]]);export{je as n,C as t};
|