vue-data-ui 3.28.11 → 3.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BaseScanner-m6QR9rwD.js +1 -0
- package/dist/{PackageVersion-ksOit8fp.js → PackageVersion-B9qiUJPH.js} +1 -1
- package/dist/SlicerPreview-Ks9FNVzh.js +1 -0
- package/dist/Tooltip-B432XpvC.js +1 -0
- package/dist/{XyAnalysisOptions-CUtj1x2f.js → XyAnalysisOptions-DKCLKOkA.js} +1 -1
- package/dist/components/vue-ui-3d-bar.js +1 -1
- package/dist/components/vue-ui-accordion.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-label.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/package-GInOA5jS.js +1 -0
- package/dist/{render-common-CPA2hfDW.js → render-common-DF3B4DW7.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/types/vue-data-ui.d.ts +56 -9
- package/dist/useAnimationFrame-D8gcRfnW.js +1 -0
- package/dist/useConfig-9oDGTWWG.js +1 -0
- package/dist/useLoading-BwiplGDB.js +1 -0
- package/dist/{useObjectBindings-D789Dz63.js → useObjectBindings-DlxSTJOa.js} +1 -1
- package/dist/usePanZoom-CTGk8aJt.js +1 -0
- package/dist/utils.js +1 -1
- package/dist/vue-data-ui-Bx6exT7_.js +1 -0
- package/dist/vue-data-ui.js +1 -1
- package/dist/vue-ui-3d-bar-DkehT0SI.js +10 -0
- package/dist/{vue-ui-accordion-DxGxf-Rm.js → vue-ui-accordion-CnAwFOgA.js} +1 -1
- package/dist/vue-ui-age-pyramid-DXEyySR3.js +1 -0
- package/dist/vue-ui-annotator-DqrdF7bH.js +259 -0
- package/dist/vue-ui-bullet-BNgmEm8g.js +11 -0
- package/dist/vue-ui-bump-nFpAoRy7.js +8 -0
- package/dist/vue-ui-candlestick-DvBj3KWq.js +22 -0
- package/dist/vue-ui-carousel-table-ChEpsK7w.js +1 -0
- package/dist/vue-ui-chestnut-C-_fkI6E.js +1 -0
- package/dist/vue-ui-chord-WqXXM4Qs.js +9 -0
- package/dist/vue-ui-circle-pack-Bti7Wq1h.js +13 -0
- package/dist/vue-ui-cursor-C_zzn7Ua.js +1 -0
- package/dist/vue-ui-dag-BevQ37Gp.js +7 -0
- package/dist/vue-ui-dashboard-ruhBa6cl.js +1 -0
- package/dist/vue-ui-digits-B9ksORds.js +1 -0
- package/dist/{vue-ui-donut-iyVVIGoJ.js → vue-ui-donut-DhrhMru7.js} +1 -1
- package/dist/vue-ui-donut-SbqIxWeM.js +23 -0
- package/dist/vue-ui-donut-evolution-BkuALrYS.js +2 -0
- package/dist/vue-ui-dumbbell-SOI5CdGX.js +9 -0
- package/dist/vue-ui-flow-DqVrfXJo.js +3 -0
- package/dist/vue-ui-funnel-Byx_0z_B.js +1 -0
- package/dist/vue-ui-galaxy-BYbvOTrG.js +1 -0
- package/dist/vue-ui-gauge-3_cwmDni.js +1 -0
- package/dist/vue-ui-geo-HaNxzfYO.js +1 -0
- package/dist/vue-ui-gizmo-C38WKy7L.js +1 -0
- package/dist/{vue-ui-graph-C4kfE4G8.js → vue-ui-graph-Dp5FNReE.js} +2 -2
- package/dist/vue-ui-heatmap-DM0tteNh.js +1 -0
- package/dist/{vue-ui-hill-3GVfKQmi.js → vue-ui-hill-Dr6Du4gm.js} +1 -1
- package/dist/vue-ui-history-plot-C7iVkeuY.js +2 -0
- package/dist/vue-ui-horizontal-bar-BP2tt9hA.js +4 -0
- package/dist/vue-ui-kpi-8BL_aylw.js +1 -0
- package/dist/{vue-ui-label-CBrMoFDG.js → vue-ui-label-D9tcQ8rR.js} +1 -1
- package/dist/{vue-ui-mini-loader-PsWZLMLF.js → vue-ui-mini-loader-D5-HI4Wi.js} +1 -1
- package/dist/vue-ui-molecule-Bg1GqvBM.js +1 -0
- package/dist/vue-ui-mood-radar-DIiMInOP.js +1 -0
- package/dist/vue-ui-nested-donuts-BCyX7Z7n.js +19 -0
- package/dist/vue-ui-onion-EkxCuuTI.js +5 -0
- package/dist/vue-ui-parallel-coordinate-plot-CE80aawg.js +9 -0
- package/dist/vue-ui-quadrant-DJIuGrF9.js +2 -0
- package/dist/vue-ui-quick-chart-BBsBw9K3.js +9 -0
- package/dist/vue-ui-radar-BMYyMdOg.js +1 -0
- package/dist/{vue-ui-rating-D0QvpD3V.js → vue-ui-rating--jhcSeor.js} +1 -1
- package/dist/vue-ui-relation-circle-BLeJaQJH.js +1 -0
- package/dist/vue-ui-ridgeline-w92zZqP2.js +2 -0
- package/dist/vue-ui-rings-DUEitXix.js +1 -0
- package/dist/vue-ui-scatter-D1XzJLsA.js +9 -0
- package/dist/{vue-ui-skeleton-BLyh-ESb.js → vue-ui-skeleton-Bpwe9ox7.js} +2 -2
- package/dist/{vue-ui-smiley-C00q-teB.js → vue-ui-smiley-AEw3JB0L.js} +1 -1
- package/dist/vue-ui-spark-trend-B3TKtyLN.js +1 -0
- package/dist/vue-ui-sparkbar-CjLLQ0Ja.js +1 -0
- package/dist/vue-ui-sparkgauge-9g7UUVWq.js +1 -0
- package/dist/vue-ui-sparkhistogram-B_rUkfjQ.js +1 -0
- package/dist/vue-ui-sparkline-BJj8LCeA.js +1 -0
- package/dist/vue-ui-sparkstackbar-B5rGYUUe.js +1 -0
- package/dist/vue-ui-stackbar-k0mVr3qM.js +29 -0
- package/dist/vue-ui-stackline-D1sDzsaB.js +17 -0
- package/dist/vue-ui-strip-plot-bZisAUWl.js +2 -0
- package/dist/vue-ui-table-YFjpQD5z.js +14 -0
- package/dist/vue-ui-table-heatmap-Bl_rGqXv.js +1 -0
- package/dist/{vue-ui-table-sparkline-itq8yRCe.js → vue-ui-table-sparkline-D-FHk6aF.js} +1 -1
- package/dist/vue-ui-thermometer-1gRm4qfW.js +1 -0
- package/dist/vue-ui-timer-Urv_5Bq7.js +65 -0
- package/dist/vue-ui-tiremarks-CUCnVEGx.js +1 -0
- package/dist/vue-ui-treemap-NgjoCq7g.js +1 -0
- package/dist/vue-ui-waffle-Cy9bR4eg.js +1 -0
- package/dist/vue-ui-wheel-DdwADpJ9.js +1 -0
- package/dist/vue-ui-word-cloud-I1lrCi6H.js +4 -0
- package/dist/vue-ui-world-CFZoRY_U.js +19 -0
- package/dist/vue-ui-xy-BjZ7rM8l.js +27 -0
- package/dist/vue-ui-xy-BqivEt9H.js +31 -0
- package/dist/{vue-ui-xy-canvas-CRSisgSA.js → vue-ui-xy-canvas-DGniRsGt.js} +2 -2
- package/dist/xyScaleTicks-DMX-D9Wd.js +1 -0
- package/dist/xyScales-Cb-Z9Qso.js +1 -0
- package/package.json +3 -3
- package/dist/BaseScanner-8NdoBs7B.js +0 -1
- package/dist/SlicerPreview-0m9E7Zh_.js +0 -1
- package/dist/Tooltip-C1q0Qoh7.js +0 -1
- package/dist/package-vXTjpYqq.js +0 -1
- package/dist/useConfig-_JwRfIqE.js +0 -1
- package/dist/usePanZoom-CE6Ofyy8.js +0 -1
- package/dist/vue-data-ui-0NKIVNqt.js +0 -1
- package/dist/vue-ui-3d-bar-Cs-_W1Av.js +0 -19
- package/dist/vue-ui-age-pyramid-cWWVFoCj.js +0 -1
- package/dist/vue-ui-annotator-D31LD4-s.js +0 -331
- package/dist/vue-ui-bullet-CMQzoLKs.js +0 -34
- package/dist/vue-ui-bump-SSu5eVbF.js +0 -8
- package/dist/vue-ui-candlestick-Cm9jS3n7.js +0 -22
- package/dist/vue-ui-carousel-table-D-F54W90.js +0 -1
- package/dist/vue-ui-chestnut-DNe1s8TT.js +0 -1
- package/dist/vue-ui-chord-DGzpBpuI.js +0 -21
- package/dist/vue-ui-circle-pack--iJQtXys.js +0 -13
- package/dist/vue-ui-cursor-B7DJRSGD.js +0 -1
- package/dist/vue-ui-dag-tsM65e_V.js +0 -9
- package/dist/vue-ui-dashboard-CC7IhQZu.js +0 -1
- package/dist/vue-ui-digits-hv2QeC-H.js +0 -42
- package/dist/vue-ui-donut-B9WXaiPn.js +0 -47
- package/dist/vue-ui-donut-evolution-Wz_-FYab.js +0 -2
- package/dist/vue-ui-dumbbell-p3Q2LkBV.js +0 -9
- package/dist/vue-ui-flow-BCH8YU8H.js +0 -3
- package/dist/vue-ui-funnel-DdrBD9oX.js +0 -1
- package/dist/vue-ui-galaxy-DYKEOEL-.js +0 -1
- package/dist/vue-ui-gauge-CPgvR_YB.js +0 -1
- package/dist/vue-ui-geo-DhJ3Wr_5.js +0 -1
- package/dist/vue-ui-gizmo-BTy4Vr1e.js +0 -1
- package/dist/vue-ui-heatmap-lti43RhW.js +0 -1
- package/dist/vue-ui-history-plot-DMTPygZA.js +0 -2
- package/dist/vue-ui-horizontal-bar-DwWo0CvX.js +0 -4
- package/dist/vue-ui-kpi-BTMK37Ix.js +0 -1
- package/dist/vue-ui-molecule-rbDnRA7c.js +0 -1
- package/dist/vue-ui-mood-radar-8s1jnO3P.js +0 -1
- package/dist/vue-ui-nested-donuts-8bY4HvC-.js +0 -19
- package/dist/vue-ui-onion-CgLNDFrZ.js +0 -5
- package/dist/vue-ui-parallel-coordinate-plot-ms14eLus.js +0 -9
- package/dist/vue-ui-quadrant-6GgQZ8fW.js +0 -2
- package/dist/vue-ui-quick-chart-CzRbFXIS.js +0 -16
- package/dist/vue-ui-radar-BxsD2JBj.js +0 -1
- package/dist/vue-ui-relation-circle-BFPAlaWQ.js +0 -1
- package/dist/vue-ui-ridgeline-G2m7eFWe.js +0 -2
- package/dist/vue-ui-rings-l_BLWL48.js +0 -1
- package/dist/vue-ui-scatter-C4hXe3DM.js +0 -9
- package/dist/vue-ui-spark-trend-D0hz9kNt.js +0 -1
- package/dist/vue-ui-sparkbar-Dweyr8h-.js +0 -1
- package/dist/vue-ui-sparkgauge-DQfCXKFj.js +0 -1
- package/dist/vue-ui-sparkhistogram-DOfAu86W.js +0 -1
- package/dist/vue-ui-sparkline-DuX09S8A.js +0 -1
- package/dist/vue-ui-sparkstackbar-vXOpiyrI.js +0 -1
- package/dist/vue-ui-stackbar-DsrwNY0p.js +0 -29
- package/dist/vue-ui-stackline-e7EYZet7.js +0 -39
- package/dist/vue-ui-strip-plot-2DxzeUXU.js +0 -2
- package/dist/vue-ui-table-B344jLaG.js +0 -14
- package/dist/vue-ui-table-heatmap-BwoRcqFD.js +0 -1
- package/dist/vue-ui-thermometer-BSRjS7l3.js +0 -1
- package/dist/vue-ui-timer-DM-urc2D.js +0 -64
- package/dist/vue-ui-tiremarks-CbIOAO3F.js +0 -1
- package/dist/vue-ui-treemap-Cgal4H5O.js +0 -1
- package/dist/vue-ui-waffle-BZFI7JLd.js +0 -1
- package/dist/vue-ui-wheel-DdKm_Vd8.js +0 -1
- package/dist/vue-ui-word-cloud-D40vUb5e.js +0 -4
- package/dist/vue-ui-world-BseI3A0C.js +0 -19
- package/dist/vue-ui-xy-Bl-DUFcf.js +0 -27
- package/dist/vue-ui-xy-DNVd3FPA.js +0 -31
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{$ as t,C as n,D as r,Ft as i,Ht as a,Jt as o,X as ee,d as te,in as s,nt as ne,r as re}from"./lib-rPeBMZrn.js";import{t as ie}from"./useConfig-_JwRfIqE.js";import{n as ae,t as oe}from"./useHints-C-TwxM0Y.js";import{t as se}from"./vue-ui-xy-Bl-DUFcf.js";import{t as ce}from"./vue-ui-donut-B9WXaiPn.js";import{t as le}from"./BaseIcon-CoY0vuL3.js";import{t as c}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as l,computed as u,createBlock as ue,createCommentVNode as d,createElementBlock as f,createElementVNode as p,createTextVNode as m,createVNode as de,defineAsyncComponent as fe,mergeProps as pe,nextTick as me,normalizeClass as h,normalizeStyle as g,onMounted as he,openBlock as _,ref as v,renderList as y,toDisplayString as b,unref as x,useCssVars as ge,vModelSelect as _e,vModelText as ve,watch as ye,withCtx as be,withDirectives as S,withKeys as xe,withModifiers as Se}from"vue";var Ce=/* @__PURE__ */ e({default:()=>tn}),we=[`innerHTML`],Te=[`data-is-open`],Ee={class:`vue-ui-table-export-hub-options`},De={class:`label`},Oe=[`id`,`onClick`],ke=[`innerHTML`],Ae={class:`vue-ui-table-dialog-field`},je={class:`label vue-ui-table-dialog-input-label`,style:{width:`100%`}},Me={style:{width:`fit-content`}},Ne={class:`vue-ui-table`},Pe={key:0},Fe={key:0},Ie={key:1},Le={key:0,style:{display:`flex`,"align-items":`center`,"justify-content":`flex-end`}},Re=[`innerHTML`],ze={key:0,style:{"margin-left":`3px`}},Be={key:0},Ve={class:`th-filter`},He={key:0,class:`th-date`},Ue={class:`date-wrapper--inputs`},We={class:`date-fieldset`},Ge=[`for`],Ke=[`id`,`onUpdate:modelValue`,`onInput`],qe={class:`date-fieldset`},Je=[`for`],Ye=[`id`,`onUpdate:modelValue`,`onInput`],Xe={class:`date-wrapper--button`},Ze=[`onClick`],Qe=[`innerHTML`],$e=[`innerHTML`],et=[`innerHTML`],tt=[`onClick`,`disabled`],nt=[`placeholder`,`onUpdate:modelValue`,`name`],rt=[`onClick`],it=[`innerHTML`],at=[`innerHTML`],ot=[`innerHTML`],st=[`onClick`,`innerHTML`],ct=[`innerHTML`],lt={key:5,class:`th-range-filter`},ut=[`for`],dt=[`id`,`max`,`min`,`onUpdate:modelValue`],ft=[`id`,`max`,`min`,`onUpdate:modelValue`],pt=[`for`],mt=[`onClick`,`disabled`],ht=[`id`],gt=[`onClick`],_t=[`onClick`,`onKeyup`],vt=[`innerHTML`,`onClick`,`onKeyup`],yt=[`data-row`],bt=[`data-row`],xt=[`data-row`,`onClick`,`onKeyup`,`id`],St=[`innerHTML`],Ct={key:1},wt={key:2},Tt={key:5},Et=[`innerHTML`],Dt={key:0},Ot={style:{"margin-left":`12px`}},kt={class:`format-num`},At={key:0,class:`format-num`},jt={key:1,class:`format-num`},Mt={key:2},Nt={key:1,class:`vue-ui-table-paginator format-num`},Pt={key:2,class:`vue-ui-table-size-warning`},Ft=[`innerHTML`],It={key:4,class:`vue-ui-table-pagination format-num`},Lt=[`innerHTML`],Rt={for:`pageScroller`,style:{"font-size":`14px`}},zt=[`max`,`value`],Bt={key:1},Vt=[`innerHTML`],Ht={class:`vue-ui-table-chart-modal-options`},Ut=[`innerHTML`],Wt=[`innerHTML`],Gt=[`innerHTML`],Kt={style:{width:`100%`,height:`fit-content`}},qt={class:`vue-ui-table-fieldset`},Jt={class:`vue-ui-table-fieldset-wrapper`},Yt=[`name`,`id`,`checked`,`onInput`],Xt=[`for`],Zt=[`disabled`],Qt=[`innerHTML`],$t={style:{width:`100%`,"margin-bottom":`12px`}},en={key:2,style:{width:`100%`,"margin-bottom":`32px`}},tn=/*#__PURE__*/ c({__name:`vue-ui-table`,props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:[`page-change`],setup(e,{expose:c,emit:Ce}){ge(e=>({v31587cb6:jn.value,v00ec2749:Mn.value,v13133185:In.value,v70a13611:Nn.value,v4ef2a4f1:Ln.value,v7d133a62:Rn.value,v2a62de87:Pn.value,v5793af2e:Fn.value,v1d62a88a:zn.value}));let tn=fe(()=>import(`./BaseDraggableDialog-DVstuNhT.js`).then(e=>e.n)),C=e,nn=Ce,{vue_ui_table:rn}=ie(),an=ee();v(null);let on=v(null),sn=v(null),w=v({height:316,type:`bar`,width:512}),T=v({ASC:1,BAR:`bar`,DATE:`date`,DESC:-1,DONUT:`donut`,LINE:`line`,NUMERIC:`numeric`,PERCENTAGE:`percentage`,TEXT:`text`}),cn=v(100),ln=v(100);v(0),v(0),v(400),v(200);let un=v({CELL:`smart-td-selected`,FIRST_TD:`smart-td-selected-first`,LAST_TD:`smart-td-selected-last`,ROW:`smart-td-selected-neighbor`}),dn=v(void 0),fn=v(void 0),E=v({col:void 0,rows:[]}),D=v(0),O=v(20),pn=v(!1),mn=v(!1),k=v({}),A=v({}),hn=v({}),j=v({}),M=v({}),N=v({}),P=v({}),F=v({}),I=v({}),gn=v(C.config.rowsPerPage?C.config.rowsPerPage:25),_n=v([.../* @__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)),vn=v(void 0),L=v(void 0),yn=v(void 0),R=v(!1),bn=v(0),xn=v(``),Sn=v(``),z=v(!1),B=v(JSON.parse(JSON.stringify(C.dataset.body)).map((e,t)=>({...e,absoluteIndex:t}))),Cn=v(JSON.parse(JSON.stringify(C.dataset.body)).map((e,t)=>({...e,absoluteIndex:t}))),V=v(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}))),wn=u(()=>`background:${G.value.backgroundColor};color:${G.value.color};outline:${G.value.outline}`);function Tn(e){return{disabled:e,style:`cursor:${X.value?`pointer`:`default`};background:${kn.value.buttons.backgroundColor};color:${kn.value.buttons.color};opacity:${e?kn.value.buttons.opacityDisabled:1}`}}function En(e,n){return t({p:n.prefix,v:Number(e),s:n.suffix,r:n.decimals})}let Dn=u(()=>on.value?on.value.getBoundingClientRect().height+3:3),H=u(()=>{if(!Object.keys(C.config||{}).length)return rn;let e=s({defaultConfig:rn,userConfig:C.config});return n(e)}),U=u(()=>H.value.style.exportMenu),W=u(()=>H.value.style.title),G=u(()=>H.value.style.th),K=u(()=>H.value.style.inputs),On=u(()=>H.value.style.dropdowns),q=u(()=>H.value.style.closeButtons),J=u(()=>H.value.style.rows),kn=u(()=>H.value.style.pagination),Y=u(()=>H.value.style.chart),An=u(()=>H.value.style);ae({config:()=>H.value,dataset:()=>C.dataset,component:`VueUiTable`,rules:[oe.noHint]});let X=u(()=>H.value.useCursorPointer),jn=u(()=>G.value.buttons.cancel.inactive.backgroundColor),Mn=u(()=>G.value.buttons.cancel.inactive.color),Nn=u(()=>G.value.buttons.cancel.active.backgroundColor),Pn=u(()=>G.value.buttons.filter.active.backgroundColor),Fn=u(()=>G.value.buttons.filter.active.color),In=u(()=>i(Nn.value,.33)),Ln=u(()=>o(Nn.value,33)),Rn=u(()=>i(Pn.value,.33)),zn=u(()=>o(Pn,33)),Bn=u(()=>[...V.value].filter(e=>e.type===T.value.DATE)),Vn=u(()=>[``,...Bn.value.map(e=>e.name)]),Hn=u(()=>{let e=Bn.value.find(e=>e.name===xn.value);return e?e.index:null}),Z=u(()=>{let e=[];if(B.value.length)for(let t=0;t<B.value.length;t+=gn.value)e.push(B.value.slice(t,t+gn.value));return e}),Un=u(()=>Z.value[D.value]),Wn=u(()=>Hn.value==null?[]:Un.value.map(e=>e.td[Hn.value])),Gn=u(()=>Object.keys(M.value).map(e=>({index:e,name:C.dataset.header[e].name,options:M.value[e]}))),Kn=u(()=>H.value.useChart&&E.value.rows.length>1),qn=u(()=>C.dataset.header.map(e=>e.type).includes(T.value.NUMERIC)),Q=u(()=>({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>`})),Jn=u(()=>B.value.map(e=>e.td)),Yn=u(()=>C.dataset.header[E.value.col]),Xn=u(()=>{let e=E.value.rows.map(e=>e.value).reduce((e,t)=>e+t,0),t=e/E.value.rows.length,n=e=>Number(e.toFixed(Yn.value.decimals)).toLocaleString();return{sumPercentage:n(e*100),sumRegular:n(e),averagePercentage:n(t*100),averageRegular:n(t)}}),Zn=v({width:1e3,height:500});function Qn({width:e,height:t}){Zn.value={width:e,height:t}}let $n=u(()=>{if(!Kn.value)return[];let e=Yn.value,t={pdf:!1,csv:!1,table:!1,annotator:!1},n=Zn.value.height,r=Zn.value.width,a=r/E.value.rows.length,o=Math.max(...E.value.rows.map(e=>e.value)),ee=Math.min(...E.value.rows.map(e=>e.value)),s=e.isPercentage&&e.percentageTo,ne=w.value.type===T.value.DONUT&&L.value&&L.value.name,ie=e.name+(s?` / ${C.dataset.header[N.value[E.value.col].referenceIndex].name}`:``)+(ne?` ${H.value.translations.by} ${L.value.name}`:``),ae=e.prefix,oe=e.suffix,se=e=>[{name:ie,series:E.value.rows.map(e=>e.value),type:e,useProgression:!0,...e===`line`?{smooth:Y.value.layout.line.smooth,color:Y.value.layout.line.stroke,useArea:Y.value.layout.line.useArea}:{color:Y.value.layout.bar.fill}}],ce=se(`line`),le=se(`bar`),c=Y.value.modal.backgroundColor,l=re(c),u=e.decimals,ue={useCssAnimation:!1,chart:{width:r,height:n-250,backgroundColor:c,color:l,labels:{fontSize:18,prefix:ae,suffix:oe},grid:{stroke:i(l,.5),labels:{color:l,xAxisLabels:{color:l,show:Wn.value.length,values:Wn.value,datetimeFormatter:Y.value.layout.datetimeFormatter,showOnlyAtModulo:Y.value.layout.timeLabels.showOnlyAtModulo,modulo:Y.value.layout.timeLabels.modulo}}},highlighter:{color:l},legend:{color:l,show:!1},title:{text:ie,color:l,textAlign:`center`,fontSize:18},tooltip:{showTimeLabel:Wn.value.length,backgroundOpacity:30,color:l,backgroundColor:c,showPercentage:!1,roundingValue:u},userOptions:{buttons:{...t}},zoom:{show:Y.value.layout.zoom.show,autoFit:Y.value.layout.zoom.autoFit,focusOnDrag:!0,minimap:{show:!0}}},line:{labels:{show:!0,color:l,rounding:u},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:l,rounding:u}}},d=ee>=0?0:Math.abs(ee),f=o+d,p=e.isPercentage,m=E.value.rows.map((t,r)=>({x:a*r+a/2,y:(1-(t.value+d)/f)*n,value:p?t.value*100:t.value,suffix:p?`%`:e.suffix?e.suffix:``,prefix:e.prefix?e.prefix:``,index:t.index,absoluteValue:p?Math.abs(t.value)*100:Math.abs(t.value)}));return{donutConfig:{useCssAnimation:!1,userOptions:{position:`left`,buttons:{...t}},style:{chart:{backgroundColor:c,color:l,layout:{curvedMarkers:!0,donut:{strokeWidth:64},labels:{dataLabels:{suffix:p?`%`:``,prefix:ae},value:{rounding:u},percentage:{color:l,rounding:u},name:{color:l},hollow:{average:{color:l,text:H.value.translations.average,value:{color:l}},total:{color:l,offsetY:-12,text:H.value.translations.total,value:{color:l,offsetY:-12}}}}},legend:{backgroundColor:c,color:l,roundingValue:u,roundingPercentage:u},padding:{left:12,right:12},title:{text:ie,color:l,fontSize:18},tooltip:{backgroundOpacity:30,color:l,backgroundColor:c,roundingValue:u,roundingValue:u}}}},xyConfig:ue,xyDatasetLine:ce,xyDatasetBar:le,progression:m.length>=2&&te(m)}});function er(){let e=L.value.options.map((e,t)=>({name:e,color:a[t]||a[t%a.length],values:[Un.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:Un.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);dn.value=e,me(()=>{w.value.type=T.value.DONUT,z.value=!1})}function tr(e,t){return!A.value[e]&&(t.isSort||t.isSearch||t.isMultiselect||t.rangeFilter)&&![T.value.DATE].includes(t.type)}function nr(e=`all`){let t=C.dataset.header.map(e=>e.name),n=e===`all`?B.value.map(e=>e.td):Un.value.map(e=>e.td),i=[t].concat(n),a=r(i);ne({csvContent:a,title:Sn.value})}function rr(){let e=document.getElementsByClassName(`th-dropdown`);e.length&&Array.from(e).forEach(e=>{e.dataset.isOpen=!1})}function ir(e,t){let n;clearTimeout(n),n=setTimeout(e,t)}function ar(){let e=document.getElementsByClassName(`tr_${an}`);Array.from(e).forEach(e=>{Array.from(e.getElementsByTagName(`td`)).forEach(e=>{e.dataset.row===`even`?(e.style.background=J.value.even.backgroundColor,e.style.color=J.value.even.color):(e.style.background=J.value.odd.backgroundColor,e.style.color=J.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,dn.value=void 0,vn.value=void 0,w.value.type=T.value.BAR,E.value={col:void 0,rows:[]},cn.value=100,ln.value=100}function or(e,t){B.value=e.filter(e=>e.td[t]>=P.value[t].min&&e[t]<=P.value[t].max)}function sr(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 cr(){ar(),Object.keys(P.value).forEach(e=>{or(B.value,e)}),Object.keys(I.value).forEach(e=>{sr(B.value,e)}),fn.value!==void 0&&sr(B.value,fn.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 lr(){B.value=Cn.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}),cr()}function ur(e){return fr(e)/B.value.length}function dr(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 fr(e){return Jn.value.map(t=>t[e]).map(e=>isNaN(Number(e))?0:e).reduce((e,t)=>e+t,0)}function pr(e){return e.includes(NaN)}function mr(e,t){return!M.value[t]||M.value[t].includes(e)}function hr(e){return!isNaN(Number(String(e).replaceAll(`%`,``)))}function gr(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 _r(){return{totalPages:Z.value.length,itemsPerPage:gn.value,currentPage:D.value,currentPageData:Un.value.map(e=>e.td)}}c({getCurrentPageData:_r});function vr(){nn(`page-change`,_r())}let yr=v(null);function br(e){if(ar(),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}vr(),yr.value&&yr.value.scrollTo({top:0,left:0,behavior:`smooth`})}function xr(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}_${an}`),o=document.getElementById(`cell_${r}_${i-1}_${an}`),ee=document.getElementById(`cell_${r+1}_${i}_${an}`),te=document.getElementById(`cell_${r-1}_${i}_${an}`),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 Sr(e){let t=0;for(let n=0;n<e.length;n+=1)t+=e.charCodeAt(n);return t}async function Cr(){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]:dr(n)}),Object.assign(hn.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]:pr(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]=Sr(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),Cn.value[n][r]=e[r]})}),e(!0)})}function wr(e,t){return new Promise((n,r)=>{e().then(e=>{try{n(t(e))}catch(e){r(e)}}).catch(e=>{r(e)})})}async function Tr(e){k.value[e]={from:dr(e).from,to:dr(e).to},hn.value[e]=!1,await me(),lr()}function Er(e,t,n){let r=n.currentTarget;clearTimeout(sn.value),r.classList.add(`clicked`),sn.value=setTimeout(()=>{r.classList.remove(`clicked`)},200),fn.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),lr()}function Dr({td:e,rowIndex:t,colIndex:n,headerType:r,event:i}){if(r!==T.value.NUMERIC||isNaN(Number(e))){ar();return}E.value.col!==n&&ar();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(un.value.CELL),Array.from(a.children).forEach((e,t)=>{e.dataset.row===`even`?(e.style.background=J.value.even.backgroundColor,e.style.color=J.value.even.olor):(e.style.background=J.value.odd.backgroundColor,e.style.color=J.value.odd.color)}),i.currentTarget.dataset.row===`even`?(i.currentTarget.style.background=J.value.even.backgroundColor,i.currentTarget.style.color=J.value.even.color):(i.currentTarget.style.background=J.value.odd.backgroundColor,i.currentTarget.style.color=J.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=J.value.even.selectedNeighbors.backgroundColor,e.style.color=J.value.even.selectedNeighbors.color):(e.style.background=J.value.odd.selectedNeighbors.backgroundColor,e.style.color=J.value.odd.selectedNeighbors.color)}),i.currentTarget.dataset.row===`odd`?(i.currentTarget.style.background=J.value.odd.selectedCell.backgroundColor,i.currentTarget.style.color=J.value.odd.selectedCell.color):(i.currentTarget.style.background=J.value.even.selectedCell.backgroundColor,i.currentTarget.style.color=J.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&&er()}function Or(e){E.value.col===e?(vn.value=void 0,ar()):(Un.value.forEach((t,n)=>{Dr({td:t.td[e],rowIndex:n,colIndex:e,headerType:T.value.NUMERIC,event:{currentTarget:document.getElementById(`cell_${n}_${e}_${an}`)}})}),vn.value=e)}async function kr(e,t){M.value[t].includes(e)?M.value[t]=M.value[t].filter(t=>t!==e):M.value[t].push(e),await me(),lr()}function Ar(e){hn.value[e]=dr(e).from!==k.value[e].from||dr(e).to!==k.value[e].to}function jr(e,t){fn.value=e;let n=t.currentTarget;clearTimeout(sn.value),n.classList.add(`clicked`),sn.value=setTimeout(()=>{n.classList.remove(`clicked`)},200),I.value[e]===1?I.value[e]=T.value.DESC:I.value[e]=T.value.ASC,cr()}function Mr(e,t,n){let r=n.currentTarget;clearTimeout(sn.value),r.classList.add(`clicked`),sn.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 Nr(e){ar(),!e||!e.target.value?D.value=0:D.value=Number(e.target.value),vr()}let Pr=v(null);he(()=>{if(C.dataset.header.length===0)throw Error(`vue-ui-table error: missing header data.
|
|
2
|
-
Provide an array of objects of type:
|
|
3
|
-
{
|
|
4
|
-
name: string;
|
|
5
|
-
type: string; ('text' | 'numeric' | 'date')
|
|
6
|
-
average: boolean;
|
|
7
|
-
decimals: number | undefined;
|
|
8
|
-
sum: boolean;
|
|
9
|
-
isSort:boolean;
|
|
10
|
-
isSearch: boolean;
|
|
11
|
-
isMultiselect: boolean;
|
|
12
|
-
isPercentage: boolean;
|
|
13
|
-
percentageTo: string; (or '')
|
|
14
|
-
}`);if(C.dataset.body.length===0)throw Error(`vue-ui-table error: missing body data`);mn.value=!0,wr(Cr,async()=>{await me(),mn.value=!1}),document.addEventListener(`keydown`,e=>{let t=document.activeElement;(t&&Array.from(t.classList).includes(`td-focusable`)&&e.key.includes(`Arrow`)||e.code===`Space`)&&e.preventDefault()}),Sn.value=U.value.filename,xn.value=Bn.value[0]?.name??``}),ye(()=>C.dataset,e=>{mn.value=!0,B.value=JSON.parse(JSON.stringify(e.body)).map((e,t)=>({...e,absoluteIndex:t})),Cn.value=JSON.parse(JSON.stringify(e.body)).map((e,t)=>({...e,absoluteIndex:t})),V.value=JSON.parse(JSON.stringify(e.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})),E.value={col:void 0,rows:[]},vn.value=void 0,gn.value=C.config.rowsPerPage?C.config.rowsPerPage:25,N.value={},k.value={},hn.value={},A.value={},j.value={},P.value={},M.value={},F.value={},I.value={},R.value=!1,dn.value=void 0,L.value=void 0,yn.value=void 0,z.value=!1,E.value.col=void 0,E.value.rows=[],wr(Cr,async()=>{Nr(),await me(),mn.value=!1})},{immediate:!0,deep:!0});let Fr=v(null);return ye(pn,e=>{e&&Fr.value&&Fr.value.focus()}),ye(R,e=>{e?Pr.value&&Pr.value.open():Pr.value&&Pr.value.close()}),(n,r)=>(_(),f(`div`,{class:`vue-data-ui-component vue-ui-table-main`,style:g(`font-family: ${H.value.fontFamily}`)},[U.value.show?(_(),f(`div`,{key:0,class:`vue-ui-table-export-hub`,style:g({top:Dn.value+`px`})},[p(`button`,{onClick:r[0]||=e=>pn.value=!pn.value,innerHTML:Q.value.export,style:g(`background:${U.value.backgroundColor};color:${U.value.color};cursor:${X.value?`pointer`:`default`}`)},null,12,we),p(`div`,{class:`vue-ui-table-export-hub-dropdown`,"data-is-open":pn.value||`false`,style:g(`background:${U.value.backgroundColor};color:${U.value.color}`)},[r[22]||=p(`b`,{class:`vue-ui-table-export-hub-title`},` Export `,-1),p(`button`,{class:`close-dropdown`,onClick:r[1]||=e=>pn.value=!1,style:g(`background:${q.value.backgroundColor};color:${q.value.color};border-radius:${q.value.borderRadius}`)},` ✖ `,4),p(`div`,Ee,[(_(),f(l,null,y([`All`,`Page`],e=>p(`div`,{key:e,class:`vue-ui-table-export-hub-option-wrapper`},[p(`div`,De,[m(b(H.value.translations[`export${e}Label`])+` `,1),e===`All`?(_(),f(l,{key:0},[m(` (`+b(B.value.length)+`)`,1)],64)):d(``,!0)]),p(`button`,{id:`export${e}`,onClick:t=>nr(e.toLowerCase()),style:g(`background:${U.value.buttons.backgroundColor};color:${U.value.buttons.color};cursor:${X.value?`pointer`:`default`}`)},[p(`div`,{innerHTML:Q.value.fileDownload},null,8,ke),p(`span`,null,b(H.value.translations[`export${e}Button`]),1)],12,Oe)])),64)),p(`div`,Ae,[p(`label`,je,[p(`span`,Me,b(H.value.translations.filename),1),S(p(`input`,{name:`filename`,ref_key:`filenameInputRef`,ref:Fr,onKeydown:r[2]||=xe(Se(()=>{},[`stop`]),[`space`]),pattern:`.*`,class:`vue-ui-table-dialog-input`,type:`text`,"onUpdate:modelValue":r[3]||=e=>Sn.value=e},null,544),[[ve,Sn.value]])]),Sn.value?(_(),f(`button`,{key:0,class:`vue-ui-table-dialog-field-button`,onClick:r[4]||=e=>Sn.value=``,style:g({cursor:X.value?`pointer`:`default`})},[de(le,{name:`close`,stroke:U.value.color,size:18},null,8,[`stroke`])],4)):d(``,!0)])])],12,Te)],4)):d(``,!0),p(`div`,{class:`vue-ui-table__wrapper`,style:g(`max-height:${H.value.maxHeight}px`),ref_key:`tableWrapper`,ref:yr},[p(`table`,Ne,[W.value.text?(_(),f(`caption`,{key:0,class:`vue-ui-table__caption`,ref_key:`tableCaption`,ref:on,style:g({textAlign:W.value.textAlign,paddingLeft:W.value.paddingLeft+`px`,paddingRight:W.value.paddingRight+`px`,backgroundColor:W.value.backgroundColor,boxShadow:`${W.value.backgroundColor} -1px 0px 0px 0px`})},[p(`span`,{style:g({fontSize:W.value.fontSize+`px`,fontWeight:W.value.bold?`bold`:`normal`,color:W.value.color})},b(W.value.text),5),W.value.subtitle.text?(_(),f(l,{key:0},[r[23]||=p(`br`,null,null,-1),p(`span`,{style:g({fontSize:W.value.subtitle.fontSize,fontWeight:W.value.subtitle.bold?`bold`:`normal`,color:W.value.subtitle.color})},b(W.value.subtitle.text),5)],64)):d(``,!0)],4)):d(``,!0),p(`thead`,{id:`tableHead`,class:`vue-ui-table__head`,style:g({background:G.value.backgroundColor,boxShadow:`-1px 0 0 ${G.value.backgroundColor}`,top:Dn.value-3+`px`})},[p(`tr`,null,[r[24]||=p(`th`,{class:`invisible-cell`},null,-1),(_(!0),f(l,null,y(V.value,(e,t)=>(_(),f(`th`,{key:`thead_${t}`,style:g(`overflow: visible;${wn.value}`),class:h({"th-has-nan":A.value[t]})},[qn.value&&([T.value.TEXT,T.value.DATE].includes(e.type)||e.isPercentage)?(_(),f(`span`,Pe,[m(b(e.name)+` `,1),e.isPercentage?(_(),f(`span`,Fe,` / `+b(e.percentageTo),1)):d(``,!0)])):(_(),f(`span`,Ie,b(e.name),1))],6))),128))]),qn.value?(_(),f(l,{key:0},[p(`tr`,null,[r[25]||=p(`th`,{class:`invisible-cell`},null,-1),(_(!0),f(l,null,y(V.value,(e,n)=>(_(),f(`th`,{key:`thead_${n}`,class:h({"th-numeric":!0,"th-has-nan":A.value[n]}),style:g(wn.value)},[e.sum&&!A.value[n]?(_(),f(`span`,Le,[p(`span`,{innerHTML:Q.value.sum,style:{"margin-bottom":`-4px`,"margin-right":`3px`}},null,8,Re),m(` `+b(En(fr(n),e))+` `,1),N.value[n]&&e.percentageTo&&!e.isPercentage?(_(),f(`span`,ze,` (`+b(isNaN(fr(n)/fr(N.value[n].referenceIndex))?`-`:x(t)({v:fr(n)/fr(N.value[n].referenceIndex)*100,s:`%`,r:e.decimals}))+`) `,1)):d(``,!0)])):d(``,!0)],6))),128))]),p(`tr`,null,[r[26]||=p(`th`,{class:`invisible-cell`},null,-1),(_(!0),f(l,null,y(V.value,(e,t)=>(_(),f(`th`,{key:`thead_${t}`,class:h({"th-numeric":!0,"th-has-nan":A.value[t]}),style:g(wn.value)},[e.average&&!A.value[t]?(_(),f(`span`,Be,` ~ `+b(isNaN(ur(t))?``:En(ur(t),e)),1)):d(``,!0)],6))),128))]),p(`tr`,null,[r[29]||=p(`th`,{class:`invisible-cell`},null,-1),(_(!0),f(l,null,y(V.value,(e,t)=>(_(),f(`th`,{key:`thead_${t}`,class:h({"th-has-nan":A.value[t]}),style:g(wn.value)},[p(`div`,Ve,[e.type===T.value.DATE&&k.value[t]?(_(),f(`div`,He,[p(`div`,Ue,[p(`div`,We,[p(`label`,{for:`from_${t}`},b(H.value.translations.from),9,Ge),S(p(`input`,{id:`from_${t}`,type:`date`,"onUpdate:modelValue":e=>k.value[t].from=e,onInput:e=>{lr(),Ar(t)},style:g(`background:${K.value.backgroundColor};color:${K.value.color};border:${K.value.border}`)},null,44,Ke),[[ve,k.value[t].from]])]),p(`div`,qe,[p(`label`,{for:`to_${t}`},b(H.value.translations.to),9,Je),S(p(`input`,{id:`to_${t}`,type:`date`,"onUpdate:modelValue":e=>k.value[t].to=e,onInput:e=>{lr(),Ar(t)},style:g(`background:${K.value.backgroundColor};color:${K.value.color};border:${K.value.border}`)},null,44,Ye),[[ve,k.value[t].to]])])]),p(`div`,Xe,[e.isSort?(_(),f(`button`,{key:0,onClick:e=>jr(t,e),class:h({"th-button-active":[T.value.DESC,T.value.ASC].includes(I.value[t])}),style:g(`cursor:${X.value?`pointer`:`default`}; background:${[T.value.DESC,T.value.ASC].includes(I.value[t])?``:G.value.buttons.filter.inactive.backgroundColor};color:${[T.value.DESC,T.value.ASC].includes(I.value[t])?``:G.value.buttons.filter.inactive.color}`)},[I.value[t]===T.value.ASC?(_(),f(`span`,{key:0,innerHTML:[T.value.DATE].includes(e.type)?Q.value.sort09:Q.value.sortAZ},null,8,Qe)):I.value[t]===T.value.DESC?(_(),f(`span`,{key:1,innerHTML:[T.value.DATE].includes(e.type)?Q.value.sort90:Q.value.sortZA},null,8,$e)):(_(),f(`span`,{key:2,innerHTML:Q.value.arrowSort},null,8,et))],14,Ze)):d(``,!0),p(`button`,{onClick:n=>{Tr(t),Er(t,e,n)},disabled:!hn.value[t]&&gr(t,e),class:`th-reset`,style:g({cursor:X.value?`pointer`:`default`})},` ✖ `,12,tt)])])):d(``,!0),e.isSearch?S((_(),f(`input`,{key:1,placeholder:H.value.translations.inputPlaceholder,"onUpdate:modelValue":e=>F.value[t]=e,onInput:r[5]||=e=>ir(lr,400),name:`search_${t}`,style:g(`background:${K.value.backgroundColor};color:${K.value.color};border:${K.value.border}`)},null,44,nt)),[[ve,F.value[t]]]):d(``,!0),!A.value[t]&&e.isSort&&e.type!==T.value.DATE?(_(),f(`button`,{key:2,onClick:e=>jr(t,e),class:h({"th-button-active":[T.value.DESC,T.value.ASC].includes(I.value[t])}),style:g(`cursor:${X.value?`pointer`:`default`};background:${[T.value.DESC,T.value.ASC].includes(I.value[t])?``:G.value.buttons.filter.inactive.backgroundColor};color:${[T.value.DESC,T.value.ASC].includes(I.value[t])?``:G.value.buttons.filter.inactive.color}`)},[I.value[t]===T.value.ASC?(_(),f(`span`,{key:0,innerHTML:[T.value.NUMERIC].includes(e.type)?Q.value.sort09:Q.value.sortZA},null,8,it)):I.value[t]===T.value.DESC?(_(),f(`span`,{key:1,innerHTML:[T.value.NUMERIC].includes(e.type)?Q.value.sort90:Q.value.sortAZ},null,8,at)):(_(),f(`span`,{key:2,innerHTML:Q.value.arrowSort},null,8,ot))],14,rt)):d(``,!0),e.isMultiselect?(_(),f(`button`,{key:3,onClick:n=>Mr(t,e,n),innerHTML:Q.value.filter,class:h({"th-button-active":M.value[t]&&M.value[t].length!==$(t).length}),style:g(`cursor:${X.value?`pointer`:`default`};background:${M.value[t]&&M.value[t].length!==$(t).length?``:G.value.buttons.filter.inactive.backgroundColor};color:${M.value[t]&&M.value[t].length!==$(t).length?``:G.value.buttons.filter.inactive.color}`)},null,14,st)):d(``,!0),E.value.col===t&&Kn.value?(_(),f(`button`,{key:4,onClick:r[6]||=e=>R.value=!R.value,innerHTML:Q.value.chart,class:h({"th-button-active":R.value}),style:g(`cursor:${X.value?`pointer`:`default`};background:${R.value?``:G.value.buttons.filter.inactive.backgroundColor};color:${R.value?``:G.value.buttons.filter.inactive.color}`)},null,14,ct)):d(``,!0),e.rangeFilter&&P.value[t]&&!A.value[t]?(_(),f(`div`,lt,[p(`label`,{for:`rangeMin${t}`},[...r[27]||=[p(`span`,{style:{color:`grey`}},`ᒥ`,-1),m(` min `,-1),p(`span`,{style:{color:`grey`}},`ᒣ`,-1)]],8,ut),S(p(`input`,{type:`number`,id:`rangeMin${t}`,max:j.value[t].max,min:j.value[t].min,"onUpdate:modelValue":e=>P.value[t].min=e,onInput:r[7]||=e=>ir(lr,400),style:g(`background:${K.value.backgroundColor};color:${K.value.color};border:${K.value.border}`)},null,44,dt),[[ve,P.value[t].min,void 0,{number:!0}]]),S(p(`input`,{type:`number`,id:`rangeMax${t}`,max:j.value[t].max,min:j.value[t].min,"onUpdate:modelValue":e=>P.value[t].max=e,onInput:r[8]||=e=>ir(lr,400),style:g(`background:${K.value.backgroundColor};color:${K.value.color};border:${K.value.border}`)},null,44,ft),[[ve,P.value[t].max,void 0,{number:!0}]]),p(`label`,{for:`rangeMax${t}`},[...r[28]||=[p(`span`,{style:{color:`grey`}},`ᒪ`,-1),m(` max `,-1),p(`span`,{style:{color:`grey`}},`ᒧ`,-1)]],8,pt)])):d(``,!0),tr(t,e)?(_(),f(`button`,{key:6,onClick:n=>Er(t,e,n),disabled:gr(t,e),class:`th-reset`,style:g({cursor:X.value?`pointer`:`default`})},` ✖ `,12,mt)):d(``,!0),e.isMultiselect?(_(),f(`div`,{key:7,class:`th-dropdown`,"data-is-open":`false`,id:`th_dropdown_${t}`,style:g(`background:${On.value.backgroundColor};color:${On.value.color}`)},[p(`button`,{class:`close-dropdown`,onClick:n=>Mr(t,e,n),style:g(`cursor:${X.value?`pointer`:`default`};background:${q.value.backgroundColor};color:${q.value.color}`)},` ✖ `,12,gt),(_(!0),f(l,null,y($(t),(e,n)=>(_(),f(`span`,{class:`th-option`,key:`th_option_${t}_${n}`,onClick:n=>kr(e,t),onKeyup:[xe(n=>kr(e,t),[`enter`]),xe(n=>kr(e,t),[`space`])],style:g(`opacity:${mr(e,t)?1:.5}`),tabindex:`0`},[mr(e,t)?(_(),f(`span`,{key:0,style:g(`color:${On.value.icons.selected.color};margin-right:5px`),class:`th-icon-green`},b(On.value.icons.selected.unicode),5)):(_(),f(`span`,{key:1,style:g(`color:${On.value.icons.unselected.color};margin-right:5px`),class:`th-icon-red`},b(On.value.icons.unselected.unicode),5)),p(`span`,null,b(e),1)],44,_t))),128))],12,ht)):d(``,!0)])],6))),128))])],64)):d(``,!0),p(`tr`,null,[r[30]||=p(`th`,{class:`invisible-cell`},null,-1),(_(!0),f(l,null,y(V.value,(e,t)=>(_(),f(`th`,{key:`col_selector_${t}`,class:h({"vue-ui-table-col-selector":!A.value[t],"th-has-nan":A.value[t]}),style:g(`background:${t===vn.value&&!A.value[t]?G.value.selected.backgroundColor:G.value.backgroundColor};color:${t===vn.value&&!A.value[t]?G.value.selected.color:G.value.color};outline:${G.value.outline}`)},[A.value[t]?d(``,!0):(_(),f(`div`,{key:0,innerHTML:V.value[t].type===T.value.NUMERIC?Q.value.chevronDown:``,class:h({"col-selector":V.value[t].type===T.value.NUMERIC}),tabindex:`0`,style:g({cursor:X.value?`pointer`:`default`}),onClick:Se(e=>Or(t),[`stop`]),onKeyup:xe(e=>Or(t),[`enter`])},null,46,vt))],6))),128))])],4),p(`tbody`,{onClick:rr,onKeydown:r[9]||=e=>xr(e)},[(_(!0),f(l,null,y(Un.value,(n,r)=>(_(),f(`tr`,{key:`tbody_${r}`,"data-row":r%2==0?`odd`:`even`,class:h(`tr_${x(an)}`),style:g(`${r%2==0?`background:${J.value.odd.backgroundColor};color:${J.value.odd.color}`:`background:${J.value.even.backgroundColor};color:${J.value.even.color}`}`)},[p(`td`,{class:`vue-ui-table-td-iteration`,"data-row":r%2==0?`odd`:`even`,style:g({outline:J.value.outline})},b(n.absoluteIndex+1),13,bt),(_(!0),f(l,null,y(n.td,(i,a)=>(_(),f(`td`,{"data-row":r%2==0?`odd`:`even`,key:`td_${r}_${a}`,style:g(hr(i)||e.dataset.header[a].type===T.value.DATE?`text-align:right;font-variant-numeric: tabular-nums;outline:${J.value.outline}`:`outline:${J.value.outline}`),onClick:t=>Dr({td:i,rowIndex:r,colIndex:a,headerType:e.dataset.header[a].type,event:t}),onKeyup:[xe(t=>Dr({td:i,rowIndex:r,colIndex:a,headerType:e.dataset.header[a].type,event:t}),[`enter`]),xe(t=>Dr({td:i,rowIndex:r,colIndex:a,headerType:e.dataset.header[a].type,event:t}),[`space`])],class:h({"td-numeric":e.dataset.header[a].type===T.value.NUMERIC,"td-focusable":!0,"td-has-nan":A.value[a]}),id:`cell_${r}_${a}_${x(an)}`,tabindex:`0`},[n.meta&&n.meta.markerIndices.includes(a)&&n.meta.unicodeIcon?(_(),f(`span`,{key:0,style:g(`color:${n.meta.color};margin-right:3px`),innerHTML:n.meta.unicodeIcon},null,12,St)):d(``,!0),e.dataset.header[a].type===T.value.DATE?(_(),f(`span`,Ct,b(e.dataset.header[a].prefix)+` `+b(new Date(i).toLocaleString().slice(0,10))+` `+b(e.dataset.header[a].suffix),1)):e.dataset.header[a].isPercentage?(_(),f(`span`,wt,b(x(t)({v:Number(i*100),s:`%`,r:e.dataset.header[a].decimals})),1)):N.value[a]&&e.dataset.header[a].percentageTo&&!e.dataset.header[a].isPercentage?(_(),f(`span`,{key:3,class:h({"td-nan":isNaN(Number(i))})},b(isNaN(Number(i))?`${i} is not ${T.value.NUMERIC}`:x(t)({p:e.dataset.header[a].prefix,v:Number(i),s:e.dataset.header[a].suffix,r:e.dataset.header[a].decimals}))+` (`+b(isNaN(Number(i))?``:x(t)({v:Number(i/fr(N.value[a].referenceIndex)*100),s:`%`,r:e.dataset.header[a].decimals}))+`) `,3)):e.dataset.header[a].type===T.value.NUMERIC?(_(),f(`span`,{key:4,class:h({"td-nan":isNaN(Number(i))})},b(isNaN(Number(i))?`${i} is not ${T.value.NUMERIC}`:x(t)({p:e.dataset.header[a].prefix,v:Number(i.toFixed(e.dataset.header[a].decimals)),s:e.dataset.header[a].suffix,r:e.dataset.header[a].decimals})),3)):(_(),f(`span`,Tt,b(e.dataset.header[a].prefix)+` `+b(i)+` `+b(e.dataset.header[a].suffix),1))],46,xt))),128))],14,yt))),128))],32)])],4),p(`div`,{class:h({"td-selector-info":!0,"td-selector-info--active":E.value.col!==void 0&&E.value.rows.length}),style:g(`background:${An.value.infoBar.backgroundColor};color:${An.value.infoBar.color}`)},[E.value.col!==void 0&&E.value.rows.length?(_(),f(l,{key:0},[p(`div`,{innerHTML:Q.value.table,class:`td-selector-icon`},null,8,Et),p(`span`,null,[p(`b`,null,[m(b(Yn.value.name)+` `,1),Yn.value.isPercentage?(_(),f(`span`,Dt,` / `+b(e.dataset.header[N.value[E.value.col].referenceIndex].name),1)):d(``,!0)]),p(`span`,Ot,[m(b(H.value.translations.nb)+` : `,1),p(`b`,kt,b(E.value.rows.length),1)]),(_(),f(l,null,y([`sum`,`average`],e=>p(`span`,{key:e,style:{"margin-left":`12px`}},[m(b(H.value.translations[e])+` : `,1),Yn.value.isPercentage?(_(),f(`b`,At,b(Xn.value[`${e}Percentage`]),1)):(_(),f(`b`,jt,b(Yn.value.prefix)+` `+b(Xn.value[`${e}Regular`])+` `+b(Yn.value.suffix),1)),Yn.value.isPercentage?(_(),f(`b`,Mt,`%`)):d(``,!0)])),64))]),p(`button`,{onClick:ar,class:`td-selector-info-reset`,style:g(`cursor:${X.value?`pointer`:`default`};background:${q.value.backgroundColor};color:${q.value.color};border-radius:${q.value.borderRadius}`)},` ✖ `,4)],64)):d(``,!0)],6),B.value.length>10?(_(),f(`div`,Nt,[m(b(H.value.translations.totalRows)+` : `+b(e.dataset.body.length)+` | `+b(H.value.translations.paginatorLabel)+` : `,1),B.value.length>10?S((_(),f(`select`,{key:0,id:`paginatorSelector`,"onUpdate:modelValue":r[10]||=e=>gn.value=e,onChange:r[11]||=e=>{ar(),vr()},style:g(`background:${K.value.backgroundColor};color:${K.value.color};border:${K.value.border}`)},[(_(!0),f(l,null,y(_n.value,(t,n)=>(_(),f(l,null,[B.value.length>t||e.dataset.body.length===t?(_(),f(`option`,{key:`paginator_option_${n}`},b(t),1)):d(``,!0)],64))),256))],36)),[[_e,gn.value,void 0,{number:!0}]]):d(``,!0)])):d(``,!0),gn.value>=250?(_(),f(`div`,Pt,[p(`span`,{innerHTML:Q.value.warning},null,8,Ft),m(b(H.value.translations.sizeWarning),1)])):d(``,!0),Z.value.length>1&&Z.value.length<=10?(_(),f(`div`,{key:3,class:`vue-ui-table-navigation-indicator`,style:g(`background:${kn.value.navigationIndicator.backgroundColor};width:calc(${D.value/(Z.value.length-1)*100}%)`)},null,4)):d(``,!0),Z.value.length>1?(_(),f(`div`,It,[p(`button`,pe({class:`vue-ui-table-navigation`,onClick:r[12]||=Se(e=>br(`previous`),[`stop`]),innerHTML:Q.value.chevronLeft},Tn(D.value===0)),null,16,Lt),Z.value.length>3?(_(),f(l,{key:0},[p(`button`,pe({class:`vue-ui-table-navigation`,onClick:r[13]||=Se(e=>br(1),[`stop`])},Tn(D.value===0)),` 1 `,16),Z.value.length>10?(_(),f(`div`,{key:0,class:`vue-ui-table-page-scroller-wrapper`,style:g({cursor:X.value?`pointer`:`default`})},[p(`label`,Rt,b(H.value.translations.page)+` `+b(D.value+1)+` / `+b(Z.value.length),1),p(`input`,{class:`vue-ui-table-page-scroller`,id:`pageScroller`,type:`range`,step:`1`,min:0,max:Z.value.length-1,onInput:r[14]||=e=>Nr(e),value:D.value,style:g(`background:${K.value.backgroundColor};color:${K.value.color};border:${K.value.border};accent-color:${K.value.accentColor}`)},null,44,zt)],4)):(_(),f(`span`,Bt,b(H.value.translations.page)+` `+b(D.value+1)+` / `+b(Z.value.length),1)),p(`button`,pe({class:`vue-ui-table-navigation`,onClick:r[15]||=Se(e=>br(Z.value.length),[`stop`])},Tn(D.value===Z.value.length-1)),b(Z.value.length),17)],64)):(_(),f(l,{key:1},[m(b(H.value.translations.page)+` `+b(D.value+1)+` / `+b(Z.value.length),1)],64)),p(`button`,pe({class:`vue-ui-table-navigation`,onClick:r[16]||=Se(e=>br(`next`),[`stop`]),innerHTML:Q.value.chevronRight},Tn(D.value===Z.value.length-1)),null,16,Vt)])):d(``,!0),de(x(tn),{ref_key:`chartModal`,ref:Pr,backgroundColor:Y.value.modal.backgroundColor,headerColor:Y.value.modal.color,color:Y.value.modal.color,forcedHeight:500,isCursorPointer:X.value,withPadding:``,withFullWidth:``,noLayerUpdate:``,onClose:r[21]||=e=>R.value=!1,onSize:Qn},{before:be(()=>[p(`div`,Ht,[Gn.value.length?(_(),f(`button`,{key:0,onClick:r[17]||=e=>z.value=!0,innerHTML:Q.value.donut,class:h({"is-active-chart":w.value.type===T.value.DONUT||z.value}),style:g(`cursor:${X.value?`pointer`:`default`};background:${w.value.type===T.value.DONUT||z.value?Y.value.modal.buttons.selected.backgroundColor:Y.value.modal.buttons.unselected.backgroundColor};color:${w.value.type===T.value.DONUT||z.value?Y.value.modal.buttons.selected.color:Y.value.modal.buttons.unselected.color}`)},null,14,Ut)):d(``,!0),p(`button`,{onClick:r[18]||=e=>{w.value.type=T.value.LINE,z.value=!1},innerHTML:Q.value.chart,class:h({"is-active-chart":w.value.type===T.value.LINE&&!z.value}),style:g(`cursor:${X.value?`pointer`:`default`};background:${w.value.type===T.value.LINE&&!z.value?Y.value.modal.buttons.selected.backgroundColor:Y.value.modal.buttons.unselected.backgroundColor};color:${w.value.type===T.value.LINE&&!z.value?Y.value.modal.buttons.selected.color:Y.value.modal.buttons.unselected.color}`)},null,14,Wt),p(`button`,{onClick:r[19]||=e=>{w.value.type=T.value.BAR,z.value=!1},innerHTML:Q.value.bar,class:h({"is-active-chart":w.value.type===T.value.BAR&&!z.value}),style:g(`cursor:${X.value?`pointer`:`default`};background:${w.value.type===T.value.BAR&&!z.value?Y.value.modal.buttons.selected.backgroundColor:Y.value.modal.buttons.unselected.backgroundColor};color:${w.value.type===T.value.BAR&&!z.value?Y.value.modal.buttons.selected.color:Y.value.modal.buttons.unselected.color}`)},null,14,Gt)])]),content:be(()=>[p(`div`,Kt,[z.value&&Gn.value.length?(_(),f(`div`,{key:0,style:g(`background:${Y.value.modal.backgroundColor};color:${Y.value.modal.color}`)},[p(`fieldset`,qt,[p(`legend`,null,b(H.value.translations.chooseCategoryColumn),1),p(`div`,Jt,[(_(!0),f(l,null,y(Gn.value,(e,t)=>(_(),f(`div`,{key:`donut_radio_${t}`,class:`vue-ui-table-fieldset-option`},[p(`input`,{type:`radio`,name:e.name,id:e.name,checked:L.value&&e.name===L.value.name,onInput:e=>L.value=Gn.value[t],style:g(`background:${K.value.backgroundColor};color:${K.value.color};border:${K.value.border};accent-color:${K.value.accentColor}`)},null,44,Yt),p(`label`,{for:e.name},b(e.name),9,Xt)]))),128))]),p(`button`,{class:`vue-ui-table-generate-donut`,disabled:!L.value,onClick:er,style:g(`cursor:${X.value?`pointer`:`default`};background:${Y.value.modal.buttons.selected.backgroundColor};color:${Y.value.modal.buttons.selected.color}`)},[p(`div`,{style:{"margin-bottom":`-3px`},innerHTML:Q.value.donut},null,8,Qt),m(` `+b(H.value.translations.makeDonut),1)],12,Zt)])],4)):d(``,!0),[T.value.BAR,T.value.LINE].includes(w.value.type)&&!z.value?(_(),f(l,{key:1},[Vn.value.length>1?(_(),f(`label`,{key:0,style:g({color:Y.value.modal.color})},[m(b(H.value.translations.xAxisLabels)+` `,1),S(p(`select`,{"onUpdate:modelValue":r[20]||=e=>xn.value=e},[(_(!0),f(l,null,y(Vn.value,e=>(_(),f(`option`,null,b(e),1))),256))],512),[[_e,xn.value]])],4)):d(``,!0),p(`div`,$t,[w.value.type===T.value.LINE?(_(),ue(se,{key:`chart_line_${bn.value}`,dataset:$n.value.xyDatasetLine,config:$n.value.xyConfig},null,8,[`dataset`,`config`])):d(``,!0),w.value.type===T.value.BAR?(_(),ue(se,{key:`chart_bar_${bn.value}`,dataset:$n.value.xyDatasetBar,config:$n.value.xyConfig},null,8,[`dataset`,`config`])):d(``,!0)]),E.value.rows.length>=2?(_(),f(`div`,{key:1,class:`chart-trend`,style:g(`color:${Y.value.modal.color}`)},[r[31]||=p(`span`,null,`---`,-1),m(` Trend: `+b(x(t)({v:$n.value.progression.trend*100,s:`%`,r:1})),1)],4)):d(``,!0)],64)):d(``,!0),[T.value.DONUT].includes(w.value.type)&&!z.value?(_(),f(`div`,en,[de(ce,{dataset:dn.value,config:$n.value.donutConfig},null,8,[`dataset`,`config`])])):d(``,!0)])]),_:1},8,[`backgroundColor`,`headerColor`,`color`,`isCursorPointer`])],4))}},[[`__scopeId`,`data-v-f857989b`]]);export{Ce as n,tn as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./userOptionsSlots-CWtXN5Q6.js";import{t as i}from"./resolveChartConfig-0IvbmIE_.js";import{D as ee,Tt as te,X as a,at as ne,m as o,nt as re,r as ie,zt as ae}from"./lib-rPeBMZrn.js";import{n as oe,t as se}from"./useHints-C-TwxM0Y.js";import{t as ce}from"./useConfig-_JwRfIqE.js";import{t as le}from"./usePrinter-DVf3YcG5.js";import{t as ue}from"./useUserOptionState-CXlFnwPv.js";import{t as de}from"./vue_ui_table_heatmap-DVMDsaVJ.js";import{t as fe}from"./Shape-CRe8woTu.js";import{t as s}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as c,computed as l,createBlock as pe,createCommentVNode as u,createElementBlock as d,createElementVNode as f,createSlots as me,createVNode as he,defineAsyncComponent as ge,guardReactiveProps as p,mergeProps as m,nextTick as _e,normalizeClass as h,normalizeProps as ve,normalizeStyle as g,onMounted as _,openBlock as v,ref as y,renderList as b,renderSlot as x,unref as S,useCssVars as ye,useSlots as be,watch as C,withCtx as w}from"vue";var T=/* @__PURE__ */ e({default:()=>P}),E=[`id`],D={role:`cell`},O={role:`row`},k=[`data-cell`],A={key:0,style:{display:`flex`,"flex-direction":`row`,gap:`2px`,"align-items":`center`}},j=[`height`,`width`],M={key:0,role:`cell`,"data-cell":`sum`},N={key:1,role:`cell`,"data-cell":`average`},xe={key:2,role:`cell`,"data-cell":`median`},Se={key:1,ref:`source`,dir:`auto`},P=/*#__PURE__*/ s({__name:`vue-ui-table-heatmap`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(e,{expose:s}){ye(e=>({v5e150227:Ae.value,v2e941582:ke.value}));let T=ge(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),{vue_ui_table_heatmap:P}=ce(),F=e,I=y(a()),L=y(!1),R=y(null),z=y(!1),B=y(0),Ce=be(),V=l({get:()=>K(),set:e=>e}),H=l(()=>V.value.debug);_(()=>{Ce[`chart-background`]&&H.value&&console.warn(`VueUiTableHeatmap does not support the #chart-background slot.`)}),oe({config:()=>V.value,dataset:()=>F.dataset,component:`VueUiTableHeatmap`,rules:[se.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:U,setUserOptionsVisibility:W,keepUserOptionState:G}=ue({config:V.value});function K(){return i(F.config,P,de)}C(()=>F.config,e=>{V.value=K(),U.value=!V.value.userOptions.showOnChartHover,Y()},{deep:!0});let{isPrinting:we,isImaging:Te,generatePdf:q,generateImage:J}=le({elementId:`table_heatmap_${I.value}`,fileName:`vue-ui-table-heatmap`,options:V.value.userOptions.print}),Ee=l(()=>V.value.table.responsiveBreakpoint),De=l(()=>!!F.dataset&&F.dataset.length);_(()=>{Y()});function Y(){ae(F.dataset)&&ne({componentName:`VueUiTableHeatmap`,type:`dataset`,debug:H.value});let e=new ResizeObserver(e=>{e.forEach(e=>{L.value=e.contentRect.width<Ee.value})});R.value&&e.observe(R.value)}let X=l(()=>F.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:o(t),displayValues:[e.name,...e.values],id:a()}})),Z=l(()=>{let e=X.value.flatMap(e=>e.values);return{min:Math.min(...e),max:Math.max(...e)}});function Oe(e,t){let n=V.value.style.heatmapColors.useIndividualScale;return te(V.value.style.heatmapColors.min,V.value.style.heatmapColors.max,n?t.min:Z.value.min,n?t.max:Z.value.max,e)}let Q=l(()=>X.value.map(e=>({...e,colors:e.displayValues.map(t=>isNaN(t)?V.value.style.backgroundColor:Oe(t,e.serieExtremes))}))),ke=l(()=>V.value.style.backgroundColor),Ae=l(()=>`${V.value.table.borderWidth}px`);function $(e=null){_e(()=>{let t=Q.value.map(e=>[[e.name],e.displayValues,[e.sum],[e.average],[e.median]]),n=[[[``],V.value.table.head.values,[`sum`],[`average`],[`median`]]].concat(t),r=ee(n);e?e(r):re({csvContent:r,title:`vue-ui-table-heatmap`})})}function je(e){z.value=e,B.value+=1}return s({generatePdf:q,generateCsv:$,generateImage:J}),(e,i)=>(v(),d(`div`,{ref_key:`tableContainer`,ref:R,style:g(`width:100%; overflow-x:auto; container-type: inline-size;padding-top:${V.value.userOptions.show?`36px`:``}; ${z.value?`vue-data-ui-wrapper-fullscreen`:``}; position:relative;`),class:h({"vue-data-ui-component":!0,"vue-ui-responsive":L.value}),id:`table_heatmap_${I.value}`,onMouseenter:i[0]||=()=>S(W)(!0),onMouseleave:i[1]||=()=>S(W)(!1)},[V.value.userOptions.show&&De.value&&(S(G)||S(U))?(v(),pe(S(T),m({ref:`details`,key:`user_option_${B.value}`,backgroundColor:V.value.style.backgroundColor,color:V.value.style.color,isPrinting:S(we),isImaging:S(Te),uid:I.value,isFullscreen:z.value,chartElement:R.value},S(n)(V.value.userOptions,`pdf csv img fullscreen`),{onToggleFullscreen:je,onGeneratePdf:S(q),onGenerateCsv:$,onGenerateImage:S(J),style:{visibility:S(G)?S(U)?`visible`:`hidden`:`visible`}}),me({_:2},[b(S(t)(e.$slots,`menuIcon optionPdf optionCsv optionImg optionFullscreen custom-menu-before custom-menu-after`),t=>({name:t,fn:w(n=>[x(e.$slots,t,ve(p(S(r)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`isFullscreen`,`chartElement`,`onGeneratePdf`,`onGenerateImage`,`style`])):u(``,!0),f(`table`,{class:h({"vue-ui-table-heatmap":!0}),style:g(`width:100%;font-family:${V.value.style.fontFamily};background:${V.value.style.backgroundColor};`)},[f(`caption`,null,[x(e.$slots,`caption`,{},void 0,!0)]),f(`thead`,null,[f(`tr`,{role:`row`,style:g(`background:${V.value.table.head.backgroundColor};color:${V.value.table.head.color}`)},[(v(!0),d(c,null,b(V.value.table.head.values,(t,n)=>(v(),d(`th`,D,[x(e.$slots,`head`,m({ref_for:!0},{value:t,rowIndex:n,type:typeof t,isResponsive:L.value}),void 0,!0)]))),256))],4)]),f(`tbody`,null,[(v(!0),d(c,null,b(Q.value,(t,n)=>(v(),d(`tr`,O,[(v(!0),d(c,null,b(t.displayValues,(r,i)=>(v(),d(`td`,{role:`cell`,"data-cell":V.value.table.head.values[i]},[t.color&&i===0?(v(),d(`div`,A,[t.color?(v(),d(`svg`,{key:0,height:V.value.style.shapeSize,width:V.value.style.shapeSize,viewBox:`0 0 20 20`,style:{background:`none`,overflow:`visible`}},[he(fe,{plot:{x:10,y:10},color:t.color,radius:9,shape:t.shape||`circle`},null,8,[`color`,`shape`])],8,j)):u(``,!0),x(e.$slots,`rowTitle`,m({ref_for:!0},{value:r,rowIndex:n,colIndex:i,type:typeof r,isResponsive:L.value}),void 0,!0)])):(v(),d(c,{key:1},[i===0?x(e.$slots,`rowTitle`,m({ref_for:!0},{value:r,rowIndex:n,colIndex:i,type:typeof r,isResponsive:L.value}),void 0,!0,0):u(``,!0),i>0?x(e.$slots,`cell`,m({ref_for:!0},{value:r,rowIndex:n,colIndex:i,type:typeof r,isResponsive:L.value,color:t.colors[i],textColor:S(ie)(t.colors[i])}),void 0,!0,1):u(``,!0)],64))],8,k))),256)),V.value.table.showSum?(v(),d(`td`,M,[x(e.$slots,`sum`,m({ref_for:!0},{value:t.sum,rowIndex:n,isResponsive:L.value}),void 0,!0)])):u(``,!0),V.value.table.showAverage?(v(),d(`td`,N,[x(e.$slots,`average`,m({ref_for:!0},{value:t.average,rowIndex:n,isResponsive:L.value}),void 0,!0)])):u(``,!0),V.value.table.showMedian?(v(),d(`td`,xe,[x(e.$slots,`median`,m({ref_for:!0},{value:t.median,rowIndex:n,isResponsive:L.value}),void 0,!0)])):u(``,!0)]))),256))])],4),e.$slots.source?(v(),d(`div`,Se,[x(e.$slots,`source`,{},void 0,!0)],512)):u(``,!0)],46,E))}},[[`__scopeId`,`data-v-3a6455f7`]]);export{T as n,P as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./userOptionsSlots-CWtXN5Q6.js";import{n as i,r as a,t as ee}from"./annotationSlots-OLiW25XN.js";import{n as o}from"./resolveChartConfig-0IvbmIE_.js";import{$ as te,Ht as s,Jt as ne,S as c,X as re,at as ie,b as l,i as ae,in as oe,t as se,w as ce,yt as le,zt as ue}from"./lib-rPeBMZrn.js";import{c as de}from"./canvas-lib-22VpOI4_.js";import{n as fe,t as pe}from"./useHints-C-TwxM0Y.js";import{t as me}from"./useConfig-_JwRfIqE.js";import{n as he,t as ge}from"./BaseScanner-8NdoBs7B.js";import{t as _e}from"./usePrinter-DVf3YcG5.js";import{t as ve}from"./useResponsive-CENUxfEL.js";import{t as ye}from"./useChartExport-BZts4KFb.js";import{t as be}from"./useUserOptionState-CXlFnwPv.js";import{t as xe}from"./useChartAccessibility-DOMuYJfm.js";import{t as Se}from"./usePrefersMotion-XLHwega2.js";import{t as Ce}from"./useAutoSizeLabelsInsideViewbox-AIRF0PlD.js";import{t as we}from"./vue_ui_thermometer-BAFdvXZW.js";import{n as Te}from"./Title-BliHuXfT.js";import{t as Ee}from"./img-D4RQwASc.js";import{t as De}from"./DefGrad-DKMq1REY.js";import{t as Oe}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as u,computed as d,createBlock as f,createCommentVNode as p,createElementBlock as m,createElementVNode as h,createSlots as ke,createVNode as Ae,defineAsyncComponent as g,guardReactiveProps as _,mergeProps as je,normalizeClass as v,normalizeProps as Me,normalizeStyle as Ne,onMounted as Pe,openBlock as y,ref as b,renderList as x,renderSlot as S,toDisplayString as C,toRefs as Fe,unref as w,useCssVars as Ie,watch as Le,withCtx as Re}from"vue";var ze=/* @__PURE__ */ e({default:()=>T}),Be=[`id`],Ve={key:1,ref:`noTitle`,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},He=[`xmlns`,`viewBox`,`aria-labelledby`,`aria-describedby`],Ue=[`id`],We=[`id`],Ge=[`width`,`height`],Ke=[`id`],qe=[`x`,`y`,`width`,`height`,`rx`,`ry`],Je=[`clip-path`],Ye=[`x`,`y`,`height`,`width`],Xe=[`x`,`y`,`height`,`width`,`fill`],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=[`x1`,`x2`,`y1`,`y2`,`stroke-width`,`stroke`],it=[`x1`,`x2`,`y1`,`y2`,`stroke-width`,`stroke`],at=[`x`,`y`,`height`,`width`],ot=[`aria-label`],st=[`x`,`y`,`height`],ct=[`y`,`x`,`fill`,`font-size`,`font-weight`],lt={key:4,class:`vue-data-ui-watermark`},T=/*#__PURE__*/ Oe({__name:`vue-ui-thermometer`,props:{dataset:{type:Object,default(){return{}}},config:{type:Object,default(){return{}}}},emits:[`copyAlt`],setup(e,{expose:Oe,emit:ze}){Ie(e=>({v34c0b983:Pt.value,v4ff7ff6b:Nt.value,v43c47318:Mt.value}));let T=g(()=>import(`./PackageVersion-ksOit8fp.js`).then(e=>e.t)),ut=g(()=>import(`./PenAndPaper-BV5ODysA.js`).then(e=>e.t)),dt=g(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),{vue_ui_thermometer:ft}=me(),pt=Se(),E=e,mt=ze,D=b(re()),O=b(null),ht=b(0),gt=b(0),_t=b(null),vt=b(null),k=b(null),A=b(null),yt=d(()=>!!E.dataset&&Object.keys(E.dataset).length);Pe(()=>{wt()});let j=b(V()),M=d(()=>j.value.userOptions),N=d(()=>j.value.style.chart.graduations),P=d(()=>j.value.style.chart);fe({config:()=>j.value,dataset:()=>E.dataset,component:`VueUiThermometer`,rules:[pe.noHint]});let bt=b(P.value.thermometer.width),F=b(P.value.height),I=b(P.value.width),xt=d(()=>j.value.userOptions.useCursorPointer),St=d(()=>oe({defaultConfig:{userOptions:{show:!1},style:{chart:{animation:{use:!1},backgroundColor:`#99999930`,graduations:{stroke:`#6A6A6A`}}}},userConfig:j.value.skeletonConfig??{}})),{loading:L,FINAL_DATASET:R}=he({...Fe(E),FINAL_CONFIG:j,prepareConfig:V,skeletonDataset:E.config?.skeletonDataset??{value:0,from:-100,to:100,steps:20,colors:{from:`#A1A1A1`,to:`#CACACA`}},skeletonConfig:oe({defaultConfig:j.value,userConfig:St.value})}),Ct=d(()=>j.value.debug);function wt(){if(ue(E.dataset)?ie({componentName:`VueUiThermometer`,type:`dataset`,debug:Ct.value}):le({datasetObject:E.dataset,requiredAttributes:[`value`,`from`,`to`]}).forEach(e=>{ie({componentName:`VueUiThermometer`,type:`datasetAttribute`,property:e,debug:Ct.value})}),j.value.responsive){let e=de(()=>{let{width:e,height:t}=ve({chart:O.value,title:j.value.style.title.text?_t.value:null,source:vt.value});requestAnimationFrame(()=>{F.value=Math.max(.1,t-12),I.value=e,Bt()})});k.value&&(A.value&&k.value.unobserve(A.value),k.value.disconnect()),k.value=new ResizeObserver(e),A.value=O.value,k.value.observe(A.value)}Bt()}let{userOptionsVisible:z,setUserOptionsVisibility:Tt,keepUserOptionState:Et}=be({config:j.value}),{svgRef:B}=xe({config:j.value.style.title});function V(){return o(E.config,ft,we)}Le(()=>E.config,e=>{j.value=V(),z.value=!j.value.userOptions.showOnChartHover,bt.value=P.value.thermometer.width,F.value=P.value.height,I.value=P.value.width,wt(),gt.value+=1},{deep:!0});let{isPrinting:H,isImaging:U,generatePdf:Dt,generateImage:Ot}=_e({elementId:`thermometer__${D.value}`,fileName:j.value.style.title.text||`vue-ui-thermometer`,options:j.value.userOptions.print}),kt=d(()=>j.value.userOptions.show&&!j.value.style.title.text),W=d(()=>ce(j.value.customPalette)),G=d(()=>R.value.steps||10);function K(e,t,n){let r=[],i=At(e),a=At(t);for(let e=0;e<n;e+=1){let t=q(i.red,a.red,e,n),ee=q(i.green,a.green,e,n),o=q(i.blue,a.blue,e,n),te=`#${J(t)}${J(ee)}${J(o)}`;r.push(te)}return r}function At(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 q(e,t,n,r){return Math.round(e+(t-e)*n/r)}function J(e){return e.toString(16).padStart(2,`0`)}let Y=d(()=>{let e=Math.max(.1,I.value),t=Math.max(.1,F.value),n=P.value.padding;return{width:e,left:e/2-P.value.thermometer.width/2,right:e/2+P.value.thermometer.width/2,top:n.top,bottom:t-n.bottom-n.top,height:t,thermoHeight:t-n.top-n.bottom,thermoWidth:P.value.thermometer.width}}),jt=d(()=>Y.value),X=d(()=>{let e=l(R.value.from)<0?Math.abs(l(R.value.from)):l(R.value.from),t=l(R.value.to)<0?Math.abs(l(R.value.to)):l(R.value.to),n=0;return n=l(R.value.to)>0?e+t:e>t?e-t:t-e,(1-(Math.abs(l(R.value.from))+l(R.value.value))/n)*Y.value.thermoHeight}),Mt=d(()=>`${X.value}px`),Nt=d(()=>`${Y.value.thermoHeight}px`),Pt=d(()=>pt.value?`0ms`:`${P.value.animation.speedMs}ms`),Ft=d(()=>{if(R.value.colors){if(!R.value.colors.from)return K(W.value[0]||s[0],c(R.value.colors.to),G.value||10);if(!R.value.colors.to)return K(c(R.value.colors.from),W.value[1]||s[1],G.value||10)}else return K(W.value[1]||s[1],W.value[0]||s[0],G.value||10);return K(c(R.value.colors.from),c(R.value.colors.to),G.value||10)}),It=d(()=>{let e=[],t=0,n=Y.value.thermoHeight;for(let r=0;r<n-1;r+=n/G.value)e.push({x:Y.value.left,y:Y.value.top+r,qYLess:Y.value.top+r+n/G.value/4,halfY:Y.value.top+r+n/G.value/2,qYMore:Y.value.top+r+n/G.value/4*3,color:Ft.value[t],height:Math.max(.1,n/G.value)}),t+=1;return e}),Z=b(!1);function Lt(e){Z.value=e,ht.value+=1}let Q=b(!1);function Rt(){Q.value=!Q.value}async function zt({scale:e=2}={}){if(!O.value)return;let{width:t,height:n}=O.value.getBoundingClientRect(),r=t/n,{imageUri:i,base64:a}=await Ee({domElement:O.value,base64:!0,img:!0,scale:e});return{imageUri:i,base64:a,title:j.value.style.title.text,width:t,height:n,aspectRatio:r}}let $=d({get:()=>P.value.label.fontSize,set:e=>e}),{autoSizeLabels:Bt}=Ce({svgRef:B,fontSize:P.value.label.fontSize,minFontSize:P.value.label.minFontSize,sizeRef:$,labelClass:`.vue-ui-thermometer-label`}),Vt=d(()=>P.value.backgroundColor),Ht=d(()=>j.value.style.title),{isCallbackImaging:Ut,isCallbackSvg:Wt,generateSvg:Gt,onGenerateImage:Kt}=ye({svg:B,title:Ht,legend:null,legendItems:null,backgroundColor:Vt,getSvgCallback:()=>j.value.userOptions.callbacks.svg,generateImage:Ot});async function qt(){mt(`copyAlt`,{config:j.value,dataset:R.value}),j.value.userOptions.callbacks.altCopy?await Promise.resolve(j.value.userOptions.callbacks.altCopy({config:j.value,dataset:R.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}let Jt=d(()=>`${D.value}-title`),Yt=d(()=>`${D.value}-desc`),Xt=d(()=>ae(P.value.label.formatter,R.value.value,te({p:P.value.label.prefix,v:R.value.value,s:P.value.label.suffix,r:P.value.label.rounding}),{datapoint:R.value})),Zt=d(()=>j.value.style.title.text||``),Qt=d(()=>{if(L.value)return`...`;let e=l(R.value.from),t=l(R.value.to);return`Thermometer value: ${Xt.value}. Range: ${e} to ${t}.`});return Oe({getImage:zt,generatePdf:Dt,generateImage:Ot,generateSvg:Gt,toggleAnnotator:Rt,toggleFullscreen:Lt,copyAlt:qt}),(e,o)=>(y(),m(`div`,{ref_key:`thermoChart`,ref:O,class:v(`vue-data-ui-component vue-ui-thermometer ${Z.value?`vue-data-ui-wrapper-fullscreen`:``}`),style:Ne(`width:100%;background:${P.value.backgroundColor};color:${P.value.color};font-family:${j.value.style.fontFamily}`),id:`thermometer__${D.value}`,onMouseenter:o[0]||=()=>w(Tt)(!0),onMouseleave:o[1]||=()=>w(Tt)(!1)},[M.value.buttons.annotator?(y(),f(w(ut),je({key:0},w(a)(M.value.annotator),{svgRef:w(B),backgroundColor:P.value.backgroundColor,color:P.value.color,active:Q.value,isCursorPointer:xt.value,palette:M.value.annotatorPalette,onClose:Rt}),ke({_:2},[x(w(ee),t=>({name:t,fn:Re(n=>[S(e.$slots,t,Me(_(w(i)(t,n))),void 0,!0)])}))]),1040,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):p(``,!0),kt.value?(y(),m(`div`,Ve,null,512)):p(``,!0),j.value.style.title.text?(y(),m(`div`,{key:2,ref_key:`chartTitle`,ref:_t,style:`width:100%`},[(y(),f(Te,{key:`title_${gt.value}`,config:{title:{cy:`thermometer-div-title`,...j.value.style.title},subtitle:{cy:`thermometer-div-subtitle`,...j.value.style.title.subtitle}}},null,8,[`config`]))],512)):p(``,!0),M.value.show&&yt.value&&(w(Et)||w(z))?(y(),f(w(dt),je({ref:`details`,key:`user_options_${ht.value}`,backgroundColor:P.value.backgroundColor,color:P.value.color,isImaging:w(U),isPrinting:w(H),uid:D.value,hasXls:!1,isFullscreen:Z.value,chartElement:O.value},w(n)(M.value,`pdf img svg fullscreen altCopy annotator`),{isAnnotation:Q.value,isCursorPointer:xt.value,onToggleFullscreen:Lt,onGeneratePdf:w(Dt),onGenerateImage:w(Kt),onGenerateSvg:w(Gt),onToggleAnnotator:Rt,onCopyAlt:qt,style:{visibility:w(Et)?w(z)?`visible`:`hidden`:`visible`}}),ke({_:2},[x(w(t)(e.$slots,`menuIcon optionPdf optionImg optionSvg optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:Re(n=>[S(e.$slots,t,Me(_(w(r)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isImaging`,`isPrinting`,`uid`,`isFullscreen`,`chartElement`,`isAnnotation`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):p(``,!0),(y(),m(`svg`,{ref_key:`svgRef`,ref:B,xmlns:w(se),class:v({"vue-data-ui-fullscreen--on":Z.value,"vue-data-ui-fulscreen--off":!Z.value}),width:`100%`,viewBox:`0 0 ${Y.value.width} ${Y.value.height}`,style:`background:transparent`,"aria-labelledby":Jt.value,"aria-describedby":Yt.value},[h(`title`,{id:Jt.value},C(Zt.value),9,Ue),h(`desc`,{id:Yt.value},C(Qt.value),9,We),Ae(w(T)),S(e.$slots,`svg-underlayer`,{svg:{...jt.value,isPrintingImg:w(H)||w(U)||w(Ut),isPrintingSvg:w(Wt)}},void 0,!0),e.$slots[`chart-background`]?(y(),m(`foreignObject`,{key:0,x:0,y:0,width:Y.value.width,height:Y.value.height,style:{pointerEvents:`none`}},[S(e.$slots,`chart-background`,{},void 0,!0)],8,Ge)):p(``,!0),h(`defs`,null,[h(`clipPath`,{id:`vueUiPill-${D.value}`,clipPathUnits:`userSpaceOnUse`},[h(`rect`,{x:Y.value.left,y:Y.value.top,width:Y.value.thermoWidth,height:Y.value.thermoHeight,rx:Y.value.thermoWidth/2,ry:Y.value.thermoWidth/2},null,8,qe)],8,Ke),(y(!0),m(u,null,x(It.value,(e,t)=>(y(),f(De,{t:`linear`,id:`vueUiThermometerGradient_${t}_${D.value}`,key:`t_${t}_${D.value}`,x1:`0%`,y1:`0%`,x2:`100%`,y2:`0%`,stops:[[`0%`,e.color,1],[`50%`,w(ne)(e.color,100-N.value.gradient.intensity),1],[`100%`,e.color,1]]},null,8,[`id`,`stops`]))),128))]),h(`g`,{"clip-path":`url(#vueUiPill-${D.value})`},[h(`rect`,{x:Y.value.left,y:Y.value.top,height:Y.value.thermoHeight,width:Y.value.thermoWidth,fill:`#FFFFFF`},null,8,Ye),(y(!0),m(u,null,x(It.value,(e,t)=>(y(),m(`g`,{key:`graduation_${t}`},[h(`rect`,{x:e.x,y:e.y,height:e.height,width:Y.value.thermoWidth,fill:N.value.gradient.show?`url(#vueUiThermometerGradient_${t}_${D.value})`:e.color,"shape-rendering":`crispEdges`},null,8,Xe),N.value.show&&[`both`,`left`].includes(N.value.sides)?(y(),m(`line`,{key:0,x1:e.x,x2:e.x+10,y1:e.y,y2:e.y,"stroke-width":N.value.strokeWidth,stroke:N.value.stroke,"stroke-linecap":`round`},null,8,Ze)):p(``,!0),N.value.showIntermediate?(y(),m(u,{key:1},[N.value.show&&[`both`,`left`].includes(N.value.sides)?(y(),m(`line`,{key:0,x1:e.x,x2:e.x+5,y1:e.halfY,y2:e.halfY,"stroke-width":N.value.strokeWidth/2,stroke:N.value.stroke,"stroke-linecap":`round`},null,8,Qe)):p(``,!0),N.value.show&&[`both`,`left`].includes(N.value.sides)?(y(),m(`line`,{key:1,x1:e.x,x2:e.x+2.5,y1:e.qYLess,y2:e.qYLess,"stroke-width":N.value.strokeWidth/2,stroke:N.value.stroke,"stroke-linecap":`round`},null,8,$e)):p(``,!0),N.value.show&&[`both`,`left`].includes(N.value.sides)?(y(),m(`line`,{key:2,x1:e.x,x2:e.x+2.5,y1:e.qYMore,y2:e.qYMore,"stroke-width":N.value.strokeWidth/2,stroke:N.value.stroke,"stroke-linecap":`round`},null,8,et)):p(``,!0)],64)):p(``,!0),N.value.show&&[`both`,`right`].includes(N.value.sides)?(y(),m(`line`,{key:2,x1:Y.value.right,x2:Y.value.right-10,y1:e.y,y2:e.y,"stroke-width":N.value.strokeWidth,stroke:N.value.stroke,"stroke-linecap":`round`},null,8,tt)):p(``,!0),N.value.showIntermediate?(y(),m(u,{key:3},[N.value.show&&[`both`,`right`].includes(N.value.sides)?(y(),m(`line`,{key:0,x1:Y.value.right,x2:Y.value.right-5,y1:e.halfY,y2:e.halfY,"stroke-width":N.value.strokeWidth/2,stroke:N.value.stroke,"stroke-linecap":`round`},null,8,nt)):p(``,!0),N.value.show&&[`both`,`right`].includes(N.value.sides)?(y(),m(`line`,{key:1,x1:Y.value.right,x2:Y.value.right-2.5,y1:e.qYLess,y2:e.qYLess,"stroke-width":N.value.strokeWidth/2,stroke:N.value.stroke,"stroke-linecap":`round`},null,8,rt)):p(``,!0),N.value.show&&[`both`,`right`].includes(N.value.sides)?(y(),m(`line`,{key:2,x1:Y.value.right,x2:Y.value.right-2.5,y1:e.qYMore,y2:e.qYMore,"stroke-width":N.value.strokeWidth/2,stroke:N.value.stroke,"stroke-linecap":`round`},null,8,it)):p(``,!0)],64)):p(``,!0)]))),128)),h(`rect`,{class:v({"vue-ui-thermometer-temperature":P.value.animation.use}),x:Y.value.left,y:Y.value.top,height:X.value,width:Y.value.thermoWidth,fill:`#FFFFFF66`},null,10,at)],8,Je),P.value.label.show?(y(),m(`g`,{key:1,role:`status`,"aria-live":`polite`,"aria-label":w(L)?`Loading data`:Xt.value},[w(L)?(y(),m(`rect`,{key:0,x:Y.value.left-60,y:X.value+Y.value.top-$.value/2,width:50,height:$.value,fill:`#6A6A6A40`,rx:`3`},null,8,st)):(y(),m(`text`,{key:1,"aria-hidden":`true`,class:v({"vue-ui-thermometer-temperature-value":P.value.animation.use,"vue-ui-thermometer-label":!0}),y:X.value+Y.value.top+$.value/3,x:Y.value.left-10,"text-anchor":`end`,fill:P.value.label.color,"font-size":$.value,"font-weight":P.value.label.bold?`bold`:`normal`},C(Xt.value),11,ct))],8,ot)):p(``,!0),S(e.$slots,`svg`,{svg:{...jt.value,isPrintingImg:w(H)||w(U)||w(Ut),isPrintingSvg:w(Wt)}},void 0,!0)],10,He)),e.$slots.watermark?(y(),m(`div`,lt,[S(e.$slots,`watermark`,Me(_({isPrinting:w(H)||w(U)||w(Ut)||w(Wt)})),void 0,!0)])):p(``,!0),e.$slots.source?(y(),m(`div`,{key:5,ref_key:`source`,ref:vt,dir:`auto`},[S(e.$slots,`source`,{},void 0,!0)],512)):p(``,!0),S(e.$slots,`skeleton`,{},()=>[w(L)?(y(),f(ge,{key:0})):p(``,!0)],!0)],46,Be))}},[[`__scopeId`,`data-v-8ccdee96`]]);export{ze as n,T as t};
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useNestedProp-DnGoh-XS.js";import{X as n,rn as r,t as i}from"./lib-rPeBMZrn.js";import{c as a}from"./canvas-lib-22VpOI4_.js";import{t as o}from"./useResponsive-CENUxfEL.js";import{n as s,t as c}from"./useHints-C-TwxM0Y.js";import{t as ee}from"./useConfig-_JwRfIqE.js";import{t as te}from"./useChartAccessibility-DOMuYJfm.js";import{n as ne}from"./Title-BliHuXfT.js";import{t as l}from"./BaseIcon-CoY0vuL3.js";import{t as re}from"./DefGrad-DKMq1REY.js";import{t as ie}from"./_plugin-vue_export-helper-BDNMzG2s.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
|
-
let interval;
|
|
3
|
-
let elapsed = 0;
|
|
4
|
-
let paused = false;
|
|
5
|
-
let startTime;
|
|
6
|
-
let tickInterval;
|
|
7
|
-
|
|
8
|
-
onmessage = function(e) {
|
|
9
|
-
const { action, data } = e.data;
|
|
10
|
-
|
|
11
|
-
switch(action) {
|
|
12
|
-
case 'start':
|
|
13
|
-
startTime = Date.now();
|
|
14
|
-
tickInterval = data.interval;
|
|
15
|
-
elapsed = 0;
|
|
16
|
-
paused = false;
|
|
17
|
-
interval = setInterval(() => {
|
|
18
|
-
elapsed += tickInterval;
|
|
19
|
-
postMessage({ elapsed, timestamp: Date.now() });
|
|
20
|
-
}, tickInterval);
|
|
21
|
-
break;
|
|
22
|
-
|
|
23
|
-
case 'pause':
|
|
24
|
-
paused = true;
|
|
25
|
-
clearInterval(interval);
|
|
26
|
-
elapsed = Date.now() - startTime;
|
|
27
|
-
break;
|
|
28
|
-
|
|
29
|
-
case 'resume':
|
|
30
|
-
if (paused) {
|
|
31
|
-
startTime = Date.now() - elapsed;
|
|
32
|
-
interval = setInterval(() => {
|
|
33
|
-
elapsed += tickInterval;
|
|
34
|
-
postMessage({ elapsed, timestamp: Date.now() });
|
|
35
|
-
}, tickInterval);
|
|
36
|
-
}
|
|
37
|
-
paused = false;
|
|
38
|
-
break;
|
|
39
|
-
|
|
40
|
-
case 'stop':
|
|
41
|
-
clearInterval(interval);
|
|
42
|
-
elapsed = 0;
|
|
43
|
-
postMessage({ elapsed });
|
|
44
|
-
break;
|
|
45
|
-
|
|
46
|
-
case 'reset':
|
|
47
|
-
elapsed = 0;
|
|
48
|
-
clearInterval(interval);
|
|
49
|
-
postMessage({ elapsed });
|
|
50
|
-
break;
|
|
51
|
-
|
|
52
|
-
case 'lap':
|
|
53
|
-
postMessage({
|
|
54
|
-
elapsed,
|
|
55
|
-
timestamp: Date.now(),
|
|
56
|
-
action: 'lap'
|
|
57
|
-
});
|
|
58
|
-
break;
|
|
59
|
-
|
|
60
|
-
default:
|
|
61
|
-
break;
|
|
62
|
-
}
|
|
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__*/ ie({__name:`vue-ui-timer`,props:{config:{type:Object,default(){return{}}}},emits:[`start`,`pause`,`reset`,`restart`,`lap`],setup(e,{expose:ie,emit:S}){let C=oe(()=>import(`./PackageVersion-ksOit8fp.js`).then(e=>e.t)),{vue_ui_timer:Ae}=ee(),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=a(()=>{let{width:e,height:t}=o({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);s({config:()=>P.value,dataset:()=>[],component:`VueUiTimer`,rules:[c.noHint]});let R=u(()=>P.value.useCursorPointer),{svgRef:je}=te({config:P.value.style.title});function z(){return t({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 ie({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(ne,{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 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./userOptionsSlots-CWtXN5Q6.js";import{n as i,r as a,t as o}from"./annotationSlots-OLiW25XN.js";import{t as s}from"./chartImage-DPGnEuYM.js";import{t as c}from"./resolveChartConfig-0IvbmIE_.js";import{$ as l,X as ee,Yt as te,at as ne,b as re,i as ie,in as ae,t as oe,zt as se}from"./lib-rPeBMZrn.js";import{c as ce}from"./canvas-lib-22VpOI4_.js";import{n as le,t as ue}from"./useHints-C-TwxM0Y.js";import{t as de}from"./useConfig-_JwRfIqE.js";import{n as fe,t as pe}from"./BaseScanner-8NdoBs7B.js";import{t as me}from"./usePrinter-DVf3YcG5.js";import{t as he}from"./useResponsive-CENUxfEL.js";import{t as ge}from"./useChartExport-BZts4KFb.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-LwElhY5p.js";import{n as xe}from"./Title-BliHuXfT.js";import{t as Se}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as Ce,computed as u,createBlock as d,createCommentVNode as f,createElementBlock as p,createElementVNode as we,createSlots as Te,createVNode as Ee,defineAsyncComponent as m,guardReactiveProps as h,mergeProps as De,normalizeClass as g,normalizeProps as Oe,normalizeStyle as ke,onMounted as Ae,openBlock as _,ref as v,renderList as y,renderSlot as b,toDisplayString as x,toRefs as je,unref as S,watch as Me,withCtx as Ne}from"vue";var Pe=/* @__PURE__ */ e({default:()=>C}),Fe=[`id`],Ie=[`xmlns`,`viewBox`,`aria-labelledby`,`aria-describedby`],Le=[`id`],Re=[`id`],ze=[`width`,`height`],Be={key:1},Ve=[`d`,`stroke-width`,`stroke`],He={key:2},Ue=[`x1`,`y1`,`x2`,`y2`,`stroke-width`,`stroke`],We=[`aria-label`],Ge=[`x`,`y`,`height`],Ke=[`x`,`y`,`font-size`,`fill`,`font-weight`,`text-anchor`],qe={key:4,class:`vue-data-ui-watermark`},C=/*#__PURE__*/ Se({__name:`vue-ui-tiremarks`,props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:[`copyAlt`],setup(e,{expose:Se,emit:Pe}){let C=m(()=>import(`./PenAndPaper-BV5ODysA.js`).then(e=>e.t)),Je=m(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),Ye=m(()=>import(`./PackageVersion-ksOit8fp.js`).then(e=>e.t)),{vue_ui_tiremarks:Xe}=de(),w=ye(),T=e,Ze=Pe,Qe=u(()=>!!T.dataset&&Object.keys(T.dataset).length),E=v(ee()),D=v(null),$e=v(null),et=v(null),tt=v(null),nt=v(0),rt=v(0),O=v(null),k=v(null),A=v(R()),j=u(()=>A.value.userOptions),M=u(()=>A.value.style.chart.layout),N=u(()=>A.value.style.chart);le({config:()=>A.value,dataset:()=>T.dataset,component:`VueUiTiremarks`,rules:[ue.noHint]});let it=u(()=>A.value.userOptions.useCursorPointer),at=u(()=>ae({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}=fe({...je(T),FINAL_CONFIG:A,prepareConfig:R,skeletonDataset:T.config?.skeletonDataset??{percentage:50},skeletonConfig:ae({defaultConfig:A.value,userConfig:at.value})}),{userOptionsVisible:I,setUserOptionsVisibility:ot,keepUserOptionState:st}=_e({config:A.value}),{svgRef:L}=ve({config:N.value.title});function R(){return c(T.config,Xe,be)}Me(()=>T.config,e=>{A.value=R(),I.value=!A.value.userOptions.showOnChartHover,G.value=N.value.width,K.value=N.value.height,pt(),rt.value+=1},{deep:!0});let{isPrinting:z,isImaging:B,generatePdf:ct,generateImage:lt}=me({elementId:E.value,fileName:N.value.title.text||`vue-ui-tiremarks`,options:A.value.userOptions.print}),ut=u(()=>A.value.userOptions.show&&!N.value.title.text),V=v(N.value.animation.use&&!w.value?0:re(F.value.percentage));Me(()=>F.value,e=>{N.value.animation.use&&!w.value?dt(e.percentage):V.value=e.percentage||0},{deep:!0}),Ae(()=>{pt()});function dt(e){let t=N.value.animation.speed,n=Math.abs(e-V.value)/(t*120);function r(){V.value<e?V.value=Math.min(V.value+n,e):V.value>e&&(V.value=Math.max(V.value-n,e)),V.value!==e&&requestAnimationFrame(r)}r()}let ft=u(()=>A.value.debug);function pt(){if(se(T.dataset)&&ne({componentName:`VueUiTiremarks`,type:`dataset`,debug:ft.value}),A.value.responsive){let e=ce(()=>{let{width:e,height:t}=he({chart:D.value,title:N.value.title.text?et.value:null,source:tt.value});requestAnimationFrame(()=>{G.value=Math.max(.1,e),K.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)}dt(F.value.percentage||0)}let H=u(()=>M.value.display===`vertical`),U=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 H.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}}),W=u(()=>Object.values(U.value).reduce((e,t)=>e+t,0)),G=v(N.value.width),K=v(N.value.height),q=u(()=>({height:K.value,width:G.value})),mt=u(()=>({horizontal:{x:Y.value.x+(N.value.percentage.horizontalPosition===`left`?6:3),y:q.value.height/2-Y.value.fontSize/2},vertical:{x:q.value.width/2-20,y:Y.value.y-Y.value.fontSize/2}})[M.value.display]),J=u(()=>H.value?{mark:(q.value.height-W.value)/100*.5,space:(q.value.height-W.value)/100*.5}:{mark:(q.value.width-W.value)/100*.5,space:(q.value.width-W.value)/100*.5}),ht=u(()=>{let e=[];for(let t=0;t<100;t+=1){let n=M.value.ticks.gradient.show?te(M.value.activeColor,t/100*(M.value.ticks.gradient.shiftHueIntensity/100)):M.value.activeColor;if(H.value){let r=M.value.crescendo?(100-t)*(q.value.width-U.value.left-U.value.right)/100/3:0,i=U.value.left+4+r,a=q.value.width-U.value.right-4-r,o=q.value.height-U.value.bottom-t*J.value.mark-t*J.value.space-J.value.mark,s=q.value.height-U.value.bottom-t*J.value.mark-t*J.value.space-J.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)*(q.value.height-U.value.top-U.value.bottom)/100/3:0,i=U.value.left+t*J.value.mark+t*J.value.space-J.value.mark,a=i,o=U.value.top+4+r,s=q.value.height-U.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}),Y=u(()=>{let e,t,n,r=N.value.percentage.fontSize/3;return H.value?N.value.percentage.verticalPosition===`top`?(e=q.value.width/2,t=U.value.top/2,n=`middle`):N.value.percentage.verticalPosition===`bottom`&&(e=q.value.width/2,t=q.value.height-U.value.bottom/2+r,n=`middle`):N.value.percentage.horizontalPosition===`left`?(e=4,t=q.value.height/2+r,n=`start`):N.value.percentage.horizontalPosition===`right`&&(e=q.value.width-U.value.right+8,t=q.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}}),X=v(!1);function gt(e){X.value=e,nt.value+=1}let Z=v(!1);function _t(){Z.value=!Z.value}let vt=s(D,()=>N.value.title.text),yt=u(()=>N.value.backgroundColor),bt=u(()=>N.value.title),{isCallbackImaging:Q,isCallbackSvg:xt,generateSvg:St,onGenerateImage:Ct}=ge({svg:L,title:bt,legend:null,legendItems:null,backgroundColor:yt,getSvgCallback:()=>A.value.userOptions.callbacks.svg,generateImage:lt});async function wt(){Ze(`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 Tt=u(()=>`${E.value}-title`),Et=u(()=>`${E.value}-desc`),$=u(()=>ie(N.value.percentage.formatter,V.value,l({v:V.value,s:`%`,r:N.value.percentage.rounding}))),Dt=u(()=>N.value.title.text||``),Ot=u(()=>P.value?`Loading data`:`Value: ${$.value}`);return Se({getImage:vt,generatePdf:ct,generateImage:lt,generateSvg:St,toggleAnnotator:_t,toggleFullscreen:gt,copyAlt:wt}),(e,s)=>(_(),p(`div`,{ref_key:`tiremarksChart`,ref:D,class:g(`vue-data-ui-component vue-ui-tiremarks ${A.value.useCssAnimation?``:`vue-ui-dna`}`),style:ke(`font-family:${A.value.style.fontFamily};width:100%; text-align:center;background:${N.value.backgroundColor}`),id:E.value,onMouseenter:s[0]||=()=>S(ot)(!0),onMouseleave:s[1]||=()=>S(ot)(!1)},[j.value.buttons.annotator?(_(),d(S(C),De({key:0},S(a)(j.value.annotator),{svgRef:S(L),backgroundColor:N.value.backgroundColor,color:N.value.color,active:Z.value,isCursorPointer:it.value,palette:j.value.annotatorPalette,onClose:_t}),Te({_:2},[y(S(o),t=>({name:t,fn:Ne(n=>[b(e.$slots,t,Oe(h(S(i)(t,n))),void 0,!0)])}))]),1040,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):f(``,!0),ut.value?(_(),p(`div`,{key:1,ref_key:`noTitle`,ref:$e,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:et,style:`width:100%;background:transparent;padding-bottom:12px`},[(_(),d(xe,{key:`title_${rt.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&&Qe.value&&(S(st)||S(I))?(_(),d(S(Je),De({ref:`details`,key:`user_options_${nt.value}`,backgroundColor:N.value.backgroundColor,color:N.value.color,isPrinting:S(z),isImaging:S(B),uid:E.value,hasXls:!1,isFullscreen:X.value,chartElement:D.value},S(n)(j.value,`pdf img svg fullscreen altCopy annotator`),{isAnnotation:Z.value,isCursorPointer:it.value,onToggleFullscreen:gt,onGeneratePdf:S(ct),onGenerateImage:S(Ct),onGenerateSvg:S(St),onToggleAnnotator:_t,onCopyAlt:wt,style:{visibility:S(st)?S(I)?`visible`:`hidden`:`visible`}}),Te({_:2},[y(S(t)(e.$slots,`menuIcon optionPdf optionImg optionSvg optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:Ne(n=>[b(e.$slots,t,Oe(h(S(r)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`isFullscreen`,`chartElement`,`isAnnotation`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):f(``,!0),(_(),p(`svg`,{ref_key:`svgRef`,ref:L,xmlns:S(oe),class:g({"vue-data-ui-fullscreen--on":X.value,"vue-data-ui-fulscreen--off":!X.value}),viewBox:`0 0 ${G.value} ${K.value}`,style:ke(`max-width:100%; overflow: visible; background:transparent;color:${N.value.color}`),role:`img`,"aria-labelledby":Tt.value,"aria-describedby":Et.value},[we(`title`,{id:Tt.value},x(Dt.value),9,Le),we(`desc`,{id:Et.value},x(Ot.value),9,Re),Ee(S(Ye)),b(e.$slots,`svg-underlayer`,{svg:{...q.value,isPrintingImg:S(z)||S(B)||S(Q),isPrintingSvg:S(xt)}},void 0,!0),e.$slots[`chart-background`]?(_(),p(`foreignObject`,{key:0,x:0,y:0,width:q.value.width,height:q.value.height,style:{pointerEvents:`none`}},[b(e.$slots,`chart-background`,{},void 0,!0)],8,ze)):f(``,!0),M.value.curved?(_(),p(`g`,Be,[(_(!0),p(Ce,null,y(ht.value,(e,t)=>(_(),p(`path`,{d:e.curve,"stroke-width":J.value.mark,stroke:V.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<=V.value})},null,10,Ve))),256))])):(_(),p(`g`,He,[(_(!0),p(Ce,null,y(ht.value,(e,t)=>(_(),p(`line`,{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,"stroke-width":J.value.mark,stroke:V.value>=t?e.color:M.value.inactiveColor,"stroke-linecap":`round`},null,8,Ue))),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:mt.value.x,y:mt.value.y,width:40,height:Y.value.fontSize,fill:`#6A6A6A80`,rx:3},null,8,Ge)):(_(),p(`text`,{key:1,"aria-hidden":`true`,x:Y.value.x,y:Y.value.y,"font-size":Y.value.fontSize,fill:M.value.ticks.gradient.show&&N.value.percentage.useGradientColor?S(te)(M.value.activeColor,V.value/100*(M.value.ticks.gradient.shiftHueIntensity/100)):N.value.percentage.color,"font-weight":Y.value.bold?`bold`:`normal`,"text-anchor":Y.value.textAnchor},x($.value),9,Ke))],8,We)):f(``,!0),b(e.$slots,`svg`,{svg:{...q.value,isPrintingImg:S(z)||S(B)||S(Q),isPrintingSvg:S(xt)}},void 0,!0)],14,Ie)),e.$slots.watermark?(_(),p(`div`,qe,[b(e.$slots,`watermark`,Oe(h({isPrinting:S(z)||S(B)||S(Q)||S(xt)})),void 0,!0)])):f(``,!0),e.$slots.source?(_(),p(`div`,{key:5,ref_key:`source`,ref:tt,dir:`auto`},[b(e.$slots,`source`,{},void 0,!0)],512)):f(``,!0),b(e.$slots,`skeleton`,{},()=>[S(P)?(_(),d(pe,{key:0})):f(``,!0)],!0)],46,Fe))}},[[`__scopeId`,`data-v-688efa59`]]);export{Pe as n,C as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./userOptionsSlots-CWtXN5Q6.js";import{n as i,r as a,t as o}from"./annotationSlots-OLiW25XN.js";import{n as s}from"./annotationViewport-X8fvs7pz.js";import{n as c,t as l}from"./tableIntegration-CNoJ1CIY.js";import{t as u}from"./chartImage-DPGnEuYM.js";import{n as d}from"./resolveChartConfig-0IvbmIE_.js";import{$ as f,D as ee,Dt as te,Ft as ne,Ht as p,S as re,X as ie,Zt as ae,at as oe,et as se,i as ce,in as le,nt as ue,pt as de,r as fe,t as pe,w as me,zt as he}from"./lib-rPeBMZrn.js";import{c as ge}from"./canvas-lib-22VpOI4_.js";import{n as _e,t as ve}from"./useHints-C-TwxM0Y.js";import{t as ye}from"./useConfig-_JwRfIqE.js";import{n as be,t as xe}from"./BaseScanner-8NdoBs7B.js";import{t as Se}from"./usePrinter-DVf3YcG5.js";import{t as Ce}from"./useResponsive-CENUxfEL.js";import{t as we}from"./useChartExport-BZts4KFb.js";import{t as Te}from"./useTransitions-ChGGrtrv.js";import{t as Ee}from"./useUserOptionState-CXlFnwPv.js";import{t as De}from"./useChartAccessibility-DOMuYJfm.js";import{t as Oe}from"./usePanZoom-CE6Ofyy8.js";import{n as ke}from"./Title-BliHuXfT.js";import{t as Ae}from"./vue_ui_treemap-JB0DfAmd.js";import{t as je}from"./Legend-W9YVYVX-.js";import{t as Me}from"./BaseIcon-CoY0vuL3.js";import{t as Ne}from"./A11yDataTable-DWNlWXzs.js";import{t as Pe}from"./BaseLegendToggle-VzX69MCo.js";import{t as Fe}from"./DefGrad-DKMq1REY.js";import{t as Ie}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as Le,Teleport as Re,computed as m,createBlock as h,createCommentVNode as g,createElementBlock as _,createElementVNode as v,createSlots as ze,createTextVNode as Be,createVNode as Ve,defineAsyncComponent as He,guardReactiveProps as y,mergeProps as Ue,nextTick as We,normalizeClass as Ge,normalizeProps as b,normalizeStyle as Ke,onBeforeUnmount as qe,onMounted as Je,openBlock as x,ref as S,renderList as Ye,renderSlot as C,resolveDynamicComponent as Xe,shallowRef as w,toDisplayString as Ze,toRefs as Qe,unref as T,useCssVars as $e,useSlots as et,watch as E,withCtx as D,withKeys as tt,withModifiers as nt}from"vue";function rt(e,t){let n=e.length;if(n===0)throw Error(`Max aspect ratio cannot be computed: ${e} is an empty array`);{let r=1/0,i=-1/0,a=0;for(let t=0;t<n;t+=1){let n=e[t].normalizedValue;n<r&&(r=n),n>i&&(i=n),a+=n}return Math.max(t**2*i/a**2,a**2/(t**2*r))}}function it(e){let{xOffset:t,yOffset:n,width:r,height:i}=e;return{x0:t,y0:n,x1:t+r,y1:n+i}}function at(e,t,n){if(e.length===0)return!0;{let r=e.concat(t);return rt(e,n)>=rt(r,n)}}function ot(e){let t=[],n=e.length;for(let r=0;r<n;r+=1){let n=e[r],i=n.length;for(let e=0;e<i;e+=1)t.push(n[e])}return t}function st(e,t){return pt({...t,children:e})}function ct(e){return(e.x1-e.x0)*(e.y1-e.y0)}function lt(e,t){let{width:n,height:r,xOffset:i,yOffset:a}=ft(t),o=e.length,s=e.map(e=>e.normalizedValue||0).reduce((e,t)=>e+t,0),c=s/r,l=s/n,u=i,d=a,f=[];if(n>=r){for(let t=0;t<o;t+=1){let n=e[t],r=d+n.normalizedValue/c,i={x0:u,y0:d,x1:u+c,y1:r},a=Object.assign({},n,i);d=r,f.push(a)}return f}for(let t=0;t<o;t+=1){let n=e[t],r=u+n.normalizedValue/l,i={x0:u,y0:d,x1:r,y1:d+l},a=Object.assign({},n,i);u=r,f.push(a)}return f}function ut(e){let t=ft(e),n=t.width,r=t.height;return Math.min(n,r)}function dt(e,t){let n=e.length,r=t/e.map(e=>e.value??0).reduce((e,t)=>e+t,0),i=[],a,o;for(let t=0;t<n;t+=1)o=e[t],a=Object.assign({},o,{normalizedValue:o.value*(r||0)}),i.push(a);return i}function ft(e){let{x0:t,y0:n,x1:r,y1:i}=e;return{xOffset:t,yOffset:n,width:r-t,height:i-n}}function O(e,t,n,r){let i=e,a=t,o=n,s=r;for(;;){let e=i.length;if(e===0){let e=lt(a,o);return s.concat(e)}let t=ut(o),n=i[0],r=i.slice(1,e);if(at(a,n,t)){let e=a.concat(n);i=r,a=e,o=o,s=s}else{let e=a.length,t=0;for(let n=0;n<e;n+=1)t+=a[n].normalizedValue;let n=mt(o,t),r=lt(a,o),c=s.concat(r);i=i,a=[],o=n,s=c}}}function pt(e){if(e.children===void 0||!e.children.length)return[e];{let t=O(dt(e.children,ct(e)),[],e,[]),n=t.length,r=[];for(let e=0;e<n;e+=1)r.push(pt(t[e]));return ot(r)}}function mt(e,t){let{width:n,height:r,xOffset:i,yOffset:a}=ft(e);if(n>=r){let e=t/r,o=n-e;return it({xOffset:i+e,yOffset:a,width:o,height:r})}{let e=t/n,o=r-e;return it({xOffset:i,yOffset:a+e,width:n,height:o})}}var ht=/* @__PURE__ */ e({default:()=>Wt}),gt=[`id`],_t=[`id`],vt=[`id`],yt=[`tabindex`,`onClick`,`onKeydown`,`data-last-crumb`,`onMouseenter`,`onFocus`],bt={class:`vue-ui-treemap-crumb-unit`},xt={class:`vue-ui-treemap-crumb-unit-label`},St={key:0,style:{width:`24px`,display:`flex`,"align-items":`center`}},Ct={key:0,class:`vue-ui-treemap-crumb-unit-arrow`},wt={style:{position:`relative`}},Tt=[`xmlns`,`aria-describedby`,`viewBox`],Et={key:0},Dt=[`x`,`y`,`height`,`width`,`fill`,`rx`,`stroke`,`stroke-width`,`onClick`,`onMouseenter`,`onMouseleave`],Ot=[`id`],kt=[`x`,`y`,`width`,`height`],At=[`clip-path`],jt=[`transform`],Mt=[`transform`],Nt=[`x`,`y`,`fill`,`font-size`,`font-family`,`font-weight`],Pt={key:0},Ft=[`x`,`y`,`height`,`width`],It={style:{width:`100%`,height:`100%`,overflow:`hidden`},class:`vue-ui-treemap-cell`},Lt={key:0,"data-dom-to-png-ignore":``,class:`reset-wrapper`},Rt={key:1,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},zt={key:6,class:`vue-data-ui-watermark`},Bt=[`id`],Vt=[`onClick`],Ht={style:{display:`flex`,"align-items":`center`}},Ut=4,Wt=/*#__PURE__*/ Ie({__name:`vue-ui-treemap`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectLegend`,`selectDatapoint`,`copyAlt`],setup(e,{expose:Ie,emit:rt}){$e(e=>({e8095b48:Ai.value}));let it=He(()=>import(`./DataTable-KeuZB1JM.js`)),at=He(()=>import(`./PenAndPaper-BV5ODysA.js`).then(e=>e.t)),ot=He(()=>import(`./vue-ui-accordion-DxGxf-Rm.js`).then(e=>e.n)),ct=He(()=>import(`./Tooltip-C1q0Qoh7.js`)),lt=He(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),ut=He(()=>import(`./PackageVersion-ksOit8fp.js`).then(e=>e.t)),dt=He(()=>import(`./BaseDraggableDialog-DVstuNhT.js`).then(e=>e.n)),{vue_ui_treemap:ft}=ye(),O=e,pt=rt,mt=et(),ht=m(()=>!!O.dataset&&O.dataset.length),Wt=m(()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),k=S(ie()),Gt=S(!1),Kt=S(``),qt=S(!1),Jt=S(0),A=S([]),Yt=w(null),Xt=w(null),Zt=w(null),Qt=w(null),$t=w(null),en=S(0),tn=S(0),nn=S(0),j=S([]),rn=S(null),an=S(!1),on=S(null),sn=S(null),cn=S(null),ln=S(/* @__PURE__ */ new Map),M=S(null),un=S({x:0,y:0}),dn=S(`pointer`),fn=S(!1),N=S(Sn()),P=m(()=>N.value.userOptions),F=m(()=>N.value.style.chart.tooltip),I=m(()=>N.value.style.chart.legend),L=m(()=>N.value.style.chart.layout.labels),R=m(()=>N.value.style.chart.layout),z=m(()=>N.value.style.chart);_e({config:()=>N.value,dataset:()=>O.dataset,component:`VueUiTreemap`,rules:[ve.emptyArray,{test:e=>e.length===1&&e[0]?.children&&e[0].children.length<6&&e[0].children.length>0||e.flatMap(e=>e?.children?.length??0).reduce((e,t)=>e+t,0)<6,message:[`👀 The number of data points is < 6. Consider:`,``,`▶️ Using another type of chart instead to better show proportions: VueUiDonut, VueUiWaffle`]},{test:e=>e.length===1&&e[0]?.children&&e[0].children.length===0,message:[`👀 There is a series defined in the dataset but it has no children items.`,``,`▶️ Add children items to your series.`]}]});let{transitionEnabled:pn}=Te({config:()=>N.value.transitions,dataset:()=>O.dataset}),B=m(()=>N.value.userOptions.useCursorPointer),mn=m(()=>le({defaultConfig:{userOptions:{show:!1},style:{chart:{backgroundColor:`#999999`,layout:{labels:{showDefaultLabels:!1},rects:{stroke:`#6A6A6A`}},legend:{backgroundColor:`transparent`}}}},userConfig:N.value.skeletonConfig??{}})),{loading:hn,FINAL_DATASET:gn,manualLoading:_n}=be({...Qe(O),FINAL_CONFIG:N,prepareConfig:Sn,skeletonDataset:O.config?.skeletonDataset??[{name:`_`,value:53,color:`#CACACA90`,children:[{name:`_`,value:21},{name:`_`,value:13},{name:`_`,value:8},{name:`_`,value:5},{name:`_`,value:3},{name:`_`,value:2},{name:`_`,value:1}]}],skeletonConfig:le({defaultConfig:N.value,userConfig:mn.value})}),{userOptionsVisible:vn,setUserOptionsVisibility:yn,keepUserOptionState:bn}=Ee({config:N.value}),{svgRef:xn}=De({config:z.value.title});function Sn(){return d(O.config,ft,Ae)}let Cn=ae(O.config);E(()=>O.config,(e,t)=>{let n=ae(e),r=n!==Cn;Cn=n;let i=Sn();r?(hn.value||(N.value=i),vn.value=!N.value.userOptions.showOnChartHover,en.value+=1,tn.value+=1,nn.value+=1,V.value.showTable=N.value.table.show,V.value.showTooltip=F.value.show,V.value.showZoom=z.value.zoom?.show??!1):(N.value.style.chart.tooltip=i.style.chart.tooltip,V.value.showTooltip=N.value.style.chart.tooltip.show)},{deep:!0});let{isPrinting:wn,isImaging:Tn,generatePdf:En,generateImage:Dn}=Se({elementId:`treemap_${k.value}`,fileName:z.value.title.text||`vue-ui-treemap`,options:N.value.userOptions.print}),On=m(()=>N.value.userOptions.show&&!z.value.title.text),kn=m(()=>me(N.value.customPalette)),V=S({showTable:N.value.table.show,showTooltip:F.value.show,showZoom:z.value.zoom?.show??!1});E(N,()=>{V.value={showTable:N.value.table.show,showTooltip:F.value.show,showZoom:z.value.zoom?.show??!1}},{immediate:!0});let An=S({height:z.value.height,width:z.value.width});function jn(e){let t=Yt.value,n=An.value.height;return!t||!n?e:e*(n/t.getBoundingClientRect().height)}function Mn(){if(!rn.value||X.value.length<=1)return 0;let e=rn.value,t=getComputedStyle(e);return jn(e.offsetHeight+parseFloat(t.marginTop||`0`)+parseFloat(t.marginBottom||`0`)+parseFloat(t.paddingTop||`0`)+parseFloat(t.paddingBottom||`0`))}let H=m(()=>{let e=z.value.padding,t=An.value.width,n=An.value.height,r=Mn(),i=e.left,a=t-e.right,o=e.top,s=n-e.bottom-r;return{left:i,top:o,right:a,bottom:s,width:a-i,height:Math.max(0,s-o),vbWidth:t,vbHeight:n-r,offsetY:r}}),U=S(se(gn.value)),W=S(U.value),Nn=w(/* @__PURE__ */ new Map);E([U,()=>N.value],()=>{cn.value=null,ln.value=/* @__PURE__ */ new Map},{deep:!0}),E(()=>A.value,()=>{cn.value=null,ln.value=/* @__PURE__ */ new Map,Ln(),nn.value+=1,tn.value+=1},{deep:!0}),E([()=>An.value.width,()=>An.value.height],()=>{ln.value=/* @__PURE__ */ new Map});function Pn(e){Array.isArray(e)&&e.forEach((e,t)=>{e.id||=ie(),e.sourceColor===void 0&&(e.sourceColor=re(e.color)||null);let n=e.sourceColor||Nn.value.get(e.id)||kn.value[t]||p[t]||p[t%p.length];n=re(n),Nn.value.set(e.id,n),e.color=n,Fn(e,n)})}function Fn(e,t){Array.isArray(e.children)&&e.children.forEach(n=>{n.id||=ie(),n.parentId=e.id,n.sourceColor===void 0&&(n.sourceColor=re(n.color)||null);let r=n.sourceColor||t;n.color=r,Fn(n,r)})}function In(e){let t=Y(e);for(;t?.parentId;)t=Y(t.parentId);return t?.id??null}function Ln(){let e=U.value.filter(e=>!A.value.includes(e.id));if(!j.value.length){W.value=e;return}let t=j.value[j.value.length-1],n=Y(t);if(!n){j.value=[],W.value=e;return}let r=In(n.id);r&&A.value.includes(r)?(j.value=[],W.value=e):W.value=[n]}E(()=>gn.value,()=>{U.value=se(gn.value),Pn(U.value),Ln(),nn.value+=1,tn.value+=1},{deep:!0,immediate:!0,flush:`post`});let Rn=w(null),zn=w(null);Je(()=>{an.value=!0,Vn()});let Bn=m(()=>N.value.debug);Je(()=>{mt[`chart-background`]&&Bn.value&&console.warn(`VueUiTreemap does not support the #chart-background slot.`)});function Vn(){if(he(O.dataset)&&oe({componentName:`VueUiTreemap`,type:`dataset`,debug:Bn.value}),Pn(U.value),he(O.dataset)||(_n.value=N.value.loading),N.value.responsive){let e=ge(()=>{let{width:e,height:t}=Ce({chart:Yt.value,title:z.value.title.text?Xt.value:null,legend:I.value.show?Zt.value:null,source:Qt.value,noTitle:$t.value});requestAnimationFrame(()=>{An.value.width=e,An.value.height=t-12})});Rn.value&&(zn.value&&Rn.value.unobserve(zn.value),Rn.value.disconnect()),Rn.value=new ResizeObserver(e),zn.value=Yt.value.parentNode,Rn.value.observe(zn.value)}}qe(()=>{Rn.value&&(zn.value&&Rn.value.unobserve(zn.value),Rn.value.disconnect())});let Hn=m(()=>W.value.map((e,t)=>({...e,color:re(e.color)||kn.value[t]||p[t]||p[t%p.length]})).filter(e=>!A.value.includes(e.id))),Un=m(()=>U.value.filter(e=>!A.value.includes(e.id)).map(e=>e.value||0).reduce((e,t)=>e+t,0)),Wn=m({get(){let e=[...Hn.value];return R.value.sorted&&(e=[...Hn.value].sort((e,t)=>t.value-e.value)),e.map(e=>({...e}))},set(e){return e}});function Gn(e,t){return e.value/t}function Kn(e,t,n){let r=R.value.rects.colorRatio-Gn(t,n);return ne(e,r<0?0:r)}function qn(e){return Array.isArray(e.children)&&e.children.length>0}function Jn(e){return[...e].sort((e,t)=>{let n=qn(e),r=qn(t);if(n!==r)return n-r;let i=Number(e.value)||0;return(Number(t.value)||0)-i})}function Yn(e,t,n,r,i){return Jn(e).map((e,a)=>{let o=e.sourceColor||re(e.color)||re(t)||kn.value[a]||p[a]||p[a%p.length],s=e.sourceColor?e.sourceColor:Kn(o,e,r),c=Gn(e,r),l=i??e.parentId??e.id,u=Array.isArray(e.children)&&e.children.length&&e.children.reduce((e,t)=>e+(Number(t.value)||0),0)||1;return{...e,color:s,proportion:c,parentName:n,rootId:l,children:Array.isArray(e.children)&&e.children.length?Yn(e.children,o,e.name,u,l):void 0}})}function Xn(e){let t=lr(e),n=Zn(e),r=t*.55,i=t*.55,a=t*1.05,o=t*1.05,s=t*.35,c=n?a+o+s:t*.45,l=e.x0+r,u=e.x1-r,d=e.y0+c,f=e.y1-i;return u<=l||f<=d?null:{x0:l,y0:d,x1:u,y1:f}}function Zn(e){return L.value.hideUnderProportion===0||Qn(e)}function Qn(e){let t=Number(L.value.hideUnderProportion);return!Number.isFinite(t)||t<=0||e.proportion>t}function $n(e,t,n=0,r=null){if(!Array.isArray(e)||!e.length)return[];let i=e.map(e=>{let{children:t,...n}=e;return{...n}}),a=new Map(e.map(e=>[e.id,Array.isArray(e.children)?e.children:[]])),o=new Map(e.map(e=>[e.id,e])),s=st(i,t),c=[];for(let e of s){let t=a.get(e.id)||[],i=o.get(e.id),s={...e,depth:n,parentId:r??e.parentId??null,color:i?.color??e.color??null,children:t,isVisibleNode:!0,showLabel:Zn(e)};if(c.push(s),t.length){let r=Xn(s);r&&c.push(...$n(t,r,n+1,e.id))}}return c}let er=m(()=>{let e=W.value.length?W.value:Wn.value,t=e.map(e=>Number(e.value)||0).reduce((e,t)=>e+t,0)||1;return $n(e.map((e,n)=>{let r=e.children?e.children.reduce((e,t)=>e+(Number(t.value)||0),0):e.value,{children:i,...a}=e,o=e.sourceColor||re(e.color)||Nn.value.get(e.id)||kn.value[n]||p[n]||p[n%p.length],s=e.sourceColor?e.sourceColor:Kn(o,e,t);return{...a,id:e.id||ie(),parentId:e.parentId??null,name:e.name,value:e.value,color:s,proportion:(Number(e.value)||0)/t,children:Array.isArray(e.children)&&e.children.length?Yn(e.children,o,e.name,r||1):void 0}}),{x0:H.value.left,y0:H.value.top,x1:H.value.left+H.value.width,y1:H.value.top+H.value.height})}),G=m(()=>er.value);function tr(e){return(Z.value&&Z.value.id===e.id?R.value.rects.selected.strokeWidth:R.value.rects.strokeWidth)*Gr.value}function K({y0:e,y1:t}){return t-e<=0?1e-4:Math.round((t-e)*1e4)/1e4}function q({x0:e,x1:t}){return t-e<=0?1e-4:Math.round((t-e)*1e4)/1e4}function nr(){let e=L.value,t=Number(e.minFontSize),n=Number(e.fontSize),r=Math.max(0,Math.min(Number.isFinite(t)?t:0,Number.isFinite(n)?n:0));return{lowerBound:r,upperBound:Math.max(r,Number.isFinite(n)?n:r)}}function rr(e){let t=Math.min(4,Math.max(e*.25,.5));return{paddingX:t,paddingTop:t}}function ir(e,t){let{paddingX:n,paddingTop:r}=rr(t),i=t*1.1;return{x:e.x0+n,y:e.y0+r,width:Math.max(q(e)-n*2,0),height:Math.max(K(e)-r*2,0),lineHeight:i}}function ar(e,t){return ce(L.value.formatter,e.value,f({p:L.value.prefix,v:e.value,s:L.value.suffix,r:F.value.roundingValue}),{datapoint:e,seriesIndex:t})}function or(e,t){let n=ar(e,t);return Array.isArray(e.children)&&e.children.length?[`${e.name} (${n})`]:[`${e.name}`,n].filter(e=>`${e}`.length)}function sr(e,t,n){let r=or(e,n),i=ir(e,t);return!r.length||i.width<=0||i.height<=0||r.length*i.lineHeight>i.height?!1:r.every((e,n)=>Si(e,t,n===0?500:400)<=i.width)}function cr(e,t,n,r){let i=or(e,t),a=Math.max(1,...i.map(e=>String(e).length)),o=Math.min(18,Math.max(10,Math.ceil(a*.7))),s=Math.max(1,i.length),c=Math.max(q(e)-1,1e-4),l=Math.max(K(e)-1,1e-4),u=c/(o*.58),d=l/(s*1.35);return Math.max(n,Math.min(r,u,d))}function lr(e,t){let{lowerBound:n,upperBound:r}=nr(),i=Math.max(1e-4,Math.min(q(e),K(e))),a=Math.max(n,Math.min(r,i*.9)),o=Math.min(a,cr(e,t,n,r));if(sr(e,o,t)||!sr(e,n,t))return o;let s=n,c=o,l=n;for(let n=0;n<8;n+=1){let n=(s+c)/2;sr(e,n,t)?(l=n,s=n):c=n}let u=Math.max(n,o*.7);return l>=u?l:o}function ur(e){qt.value=e,Jt.value+=1}let J=m(()=>({x:0,y:0,width:H.value.vbWidth,height:H.value.vbHeight}));function Y(e,t=U.value){for(let n of t){if(n.id===e)return n;if(n.children){let t=Y(e,n.children);if(t)return t}}return null}function dr(e){let t=[],n=Y(e);for(;n&&n.parentId;){let e=Y(n.parentId);if(!e)break;t.unshift(e.id),n=e}return t}let fr=m(()=>j.value.length>0);function pr(){W.value=U.value.slice(),j.value=[],pt(`selectDatapoint`,void 0)}function mr(){return j.value[j.value.length-1]??null}function hr(e,t,n){j.value=[...dr(e.id),e.id],W.value=[e],N.value.events.datapointClick&&N.value.events.datapointClick({datapoint:t??e,seriesIndex:n}),pt(`selectDatapoint`,t??e)}function gr(e,t){let n=mr();if(!n){pr();return}let r=Y(n);if(!r?.parentId){N.value.events.datapointClick&&N.value.events.datapointClick({datapoint:e,seriesIndex:t}),pr();return}let i=Y(r.parentId);i?(j.value=[...dr(i.id),i.id],W.value=[i],N.value.events.datapointClick&&N.value.events.datapointClick({datapoint:e,seriesIndex:t}),pt(`selectDatapoint`,e)):pr()}function _r(e,t){if(!e){pr();return}let n=Y(e.id);n&&(mr()===n.id?gr(e,t):hr(n,e,t))}function vr(e){return e?mr()===e.id:!1}let X=m(()=>{let e=[{id:null,label:`All`}];if(j.value.length>0){let t=Y(j.value[j.value.length-1]),n=[];for(;t;)n.unshift(t),t=t.parentId?Y(t.parentId):null;for(let t of n)e.push({id:t.id,label:t.name,node:t})}return e}),Z=w(null),yr=m(()=>U.value.map((e,t)=>({...e,color:re(e.color)||kn.value[t]||p[t]||p[t%p.length],shape:`square`})).sort((e,t)=>t.value-e.value).map((e,t)=>{let n=e.value/U.value.map(e=>e.value).reduce((e,t)=>e+t,0);return{...e,proportion:n,isSegregated:A.value.includes(e.id),segregate:()=>Cr(e),opacity:A.value.includes(e.id)?.5:1,display:`${e.name}${I.value.showPercentage||I.value.showValue?`: `:``}${I.value.showValue?ce(L.value.formatter,e.value,f({p:L.value.prefix,v:e.value,s:L.value.suffix,r:I.value.roundingValue}),{datapoint:e}):``}${I.value.showPercentage?A.value.includes(e.id)?`${I.value.showValue?` (`:``}- %${I.value.showValue?`)`:``}`:`${I.value.showValue?` (`:``}${isNaN(e.value/Un.value)?`-`:(e.value/Un.value*100).toFixed(I.value.roundingPercentage)}%${I.value.showValue?`)`:``}`:``}`}})),br=m(()=>({cy:`treemap-div-legend`,backgroundColor:I.value.backgroundColor,color:I.value.color,fontSize:I.value.fontSize,paddingBottom:12,fontWeight:I.value.bold?`bold`:``})),xr=m(()=>A.value.length===yr.value.length);function Sr(){A.value.length?A.value=[]:yr.value.forEach(e=>{A.value.push(e.id)}),pt(`selectLegend`,U.value.filter(e=>!A.value.includes(e.id)))}function Cr(e){Z.value=null,A.value.includes(e.id)?A.value=A.value.filter(t=>t!==e.id):A.value.length<O.dataset.length-1&&A.value.push(e.id),pt(`selectLegend`,U.value.filter(e=>!A.value.includes(e.id)))}function wr(e){return U.value.length?U.value.find(t=>t.name===e)||(Bn.value&&console.warn(`VueUiTreemap - Series name not found "${e}"`),null):(Bn.value&&console.warn(`VueUiTreemap - There are no series to show.`),null)}function Tr(e){let t=wr(e);t!==null&&A.value.includes(t.id)&&Cr({id:t.id})}function Er(e){let t=wr(e);t!==null&&(A.value.includes(t.id)||Cr({id:t.id}))}function Dr({datapoint:e,seriesIndex:t}){Z.value=null,Gt.value=!1,M.value=null,dn.value=`pointer`,N.value.events.datapointLeave&&N.value.events.datapointLeave({datapoint:e,seriesIndex:t})}let Or=S(null);function kr({datapoint:e,seriesIndex:t,triggerMode:n=`pointer`}){if(xr.value||n===`pointer`&&zr.value)return;N.value.events.datapointEnter&&N.value.events.datapointEnter({datapoint:e,seriesIndex:t}),M.value=t,dn.value=n,Z.value=e,Or.value={datapoint:e,seriesIndex:t,config:N.value,series:Hn.value};let r=F.value.customFormat;if(te(r)&&de(()=>r({seriesIndex:t,datapoint:e,series:Hn.value,config:N.value})))Kt.value=r({seriesIndex:t,datapoint:e,series:Hn.value,config:N.value});else{let n=``;n+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${F.value.borderColor};padding-bottom:6px;margin-bottom:3px;">${e.name}</div>`,n+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><rect x="0" y="0" height="12" width="12" stroke="none" fill="${e.color}"/></svg>`,n+=`<b>${ce(L.value.formatter,e.value,f({p:L.value.prefix,v:e.value,s:L.value.suffix,r:F.value.roundingValue}),{datapoint:e,seriesIndex:t})}</b>`,Kt.value=`<div>${n}</div>`}Gt.value=!0}let Q=m(()=>({head:G.value.map(e=>({name:e.name,color:e.color})),body:G.value.map(e=>e.value)}));function Ar(e=null){We(()=>{let t=Q.value.head.map((e,t)=>[[e.name],[Q.value.body[t]],[isNaN(Q.value.body[t]/Un.value)?`-`:Q.value.body[t]/Un.value*100]]),n=[[z.value.title.text],[z.value.title.subtitle.text],[[``],[`val`],[`%`]]].concat(t),r=ee(n);e?e(r):ue({csvContent:r,title:z.value.title.text||`vue-ui-treemap`})})}let jr=m(()=>{let e=[N.value.table.columnNames.series,N.value.table.columnNames.value,N.value.table.columnNames.percentage],t=Q.value.head.map((e,t)=>{let n=ce(L.value.formatter,Q.value.body[t],f({p:L.value.prefix,v:Q.value.body[t],s:L.value.suffix,r:N.value.table.td.roundingValue}));return[{color:e.color,name:e.name,shape:`square`},n,isNaN(Q.value.body[t]/Un.value)?`-`:f({v:Q.value.body[t]/Un.value*100,s:`%`,r:N.value.table.td.roundingPercentage})]}),n={th:{backgroundColor:N.value.table.th.backgroundColor,color:N.value.table.th.color,outline:N.value.table.th.outline},td:{backgroundColor:N.value.table.td.backgroundColor,color:N.value.table.td.color,outline:N.value.table.td.outline},breakpoint:N.value.table.responsiveBreakpoint};return{colNames:[N.value.table.columnNames.series,N.value.table.columnNames.value],head:e,body:t,config:n}});function Mr(){return G.value}function Nr(){V.value.showTable=!V.value.showTable}function Pr(){V.value.showTooltip=!V.value.showTooltip}function Fr(){V.value.showZoom=!V.value.showZoom}let Ir=S(!1);function Lr(){Ir.value=!Ir.value}let Rr=m(()=>!Ir.value&&V.value.showZoom),zr=S(null),Br=S(!1),{viewBox:$,resetZoom:Vr,isZoom:Hr,setInitialViewBox:Ur,scale:Wr}=Oe(xn,{x:J.value.x,y:J.value.y,width:Math.max(10,J.value.width),height:Math.max(10,J.value.height)},1,Rr),Gr=m(()=>1/Wr.value),Kr=m(()=>Math.min(1,L.value.fontSizeZoomFactor/Math.max(Wr.value,1e-4))),qr=m(()=>`scale(${Kr.value})`),Jr=m(()=>V.value.showZoom||Hr.value);E([()=>J.value.x,()=>J.value.y,()=>J.value.width,()=>J.value.height],()=>{We(()=>{Ur({x:J.value.x,y:J.value.y,width:Math.max(10,J.value.width),height:Math.max(10,J.value.height)})})},{immediate:!0});function Yr(e){Rr.value&&(e.button===void 0||e.button===0)&&(zr.value={x:e.clientX,y:e.clientY},Br.value=!1)}function Xr(e){if(!Rr.value||!zr.value)return;let t=e.clientX-zr.value.x,n=e.clientY-zr.value.y;Math.hypot(t,n)>Ut&&(Br.value=!0)}function Zr(){zr.value=null,Br.value&&window.setTimeout(()=>{Br.value=!1},0)}function Qr(e,t){Br.value||_r(e,t)}let $r=S(null);function ei(e){$r.value=e}function ti(){$r.value=null}let ni=u(Yt,()=>z.value.title.text),ri=m(()=>l({config:N,style:z,mutableConfig:V,dialog:dt,accordion:ot,isFullscreen:qt,parent:Yt,maxWidth:800,isCursorPointer:B}));E(()=>V.value.showTable,e=>c(e,N,on));function ii(){V.value.showTable=!1,sn.value&&sn.value.setTableIconState(!1)}let ai=m(()=>yr.value.map(e=>({...e,name:e.display}))),oi=m(()=>z.value.backgroundColor),si=m(()=>z.value.title),{isCallbackImaging:ci,isCallbackSvg:li,generateSvg:ui,onGenerateImage:di}=we({svg:xn,title:si,legend:I,legendItems:ai,backgroundColor:oi,getSvgCallback:()=>N.value.userOptions.callbacks.svg,generateImage:Dn});function fi(e,t){let n=lr(e,t),{paddingX:r,paddingTop:i}=rr(n);return{fontSize:n,paddingX:r,paddingTop:i,lineHeight:n*1.1}}function pi(e){return fe(e.color??z.value.backgroundColor)}function mi({availableHeight:e,lineHeight:t,lineIndex:n}){if(n===0)return 1/0;let r=e/(n+1);return r<1e-4?-1/0:t<=0?1/0:r/t}function hi(){return Number(L.value.hideUnderProportion)===0}function gi(e){let t=Kr.value;return e.alwaysShowAllLines?`scale(${Math.min(t,e.allLinesScaleCap)})`:qr.value}function _i({rect:e,seriesIndex:t}){if(!e||!L.value.showDefaultLabels||!Zn(e))return null;let{fontSize:n,paddingX:r,paddingTop:i,lineHeight:a}=fi(e,t),o=pi(e),s=or(e,t).map(e=>String(e??``)),c=ir(e,n);if(!s.some(Boolean)||c.width<=0||c.height<=0)return null;let l=hi(),u=l?Math.max(1e-4,Math.min(1,c.height/Math.max(s.length*a,1e-4))):1,d=`treemap_clip_${k.value}_${e.id}`,f=e.x0,ee=e.y0,te=Math.max(q(e),0),ne=Math.max(K(e),0);return{key:vi(e),clipId:d,clipX:f,clipY:ee,clipWidth:te,clipHeight:ne,translate:`translate(${e.x0}, ${e.y0})`,alwaysShowAllLines:l,allLinesScaleCap:u,lines:s.map((t,s)=>({key:`${e.id}_${s}`,text:t,x:r,y:i+a*s,maxZoomFactor:mi({availableHeight:c.height,lineHeight:a,lineIndex:s}),fill:o,fontSize:n,fontFamily:N.value.style.fontFamily,fontWeight:s===0?500:400}))}}function vi(e){return`${e.id}`}let yi=m(()=>mt.rect||hn.value||!L.value.showDefaultLabels||xr.value?[]:G.value.map((e,t)=>e.showLabel?_i({rect:e,seriesIndex:t}):null).filter(Boolean)),bi;function xi(){return typeof document>`u`?null:(bi||=document.createElement(`canvas`),bi.getContext(`2d`))}function Si(e,t,n=400){let r=xi();return r?(r.font=`${n} ${t}px ${N.value.style.fontFamily}`,r.measureText(String(e)).width):e.length*t*.6}function Ci(e){let t=R.value.rects.borderRadius,n=q(e),r=K(e);return Math.min(t,Math.min(n,r)/6)}async function wi(){pt(`copyAlt`,{config:N.value,dataset:G.value}),N.value.userOptions.callbacks.altCopy?await Promise.resolve(N.value.userOptions.callbacks.altCopy({config:N.value,dataset:G.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function Ti(){M.value=null,fn.value=!0}function Ei(){M.value=null,dn.value=`pointer`,Gt.value=!1,Z.value=null,fn.value=!1}function Di(e){if(!xn.value||Ir.value||document.activeElement!==xn.value||!G.value.length||xr.value)return;let t=[`ArrowLeft`,`ArrowUp`].includes(e.key),n=[`ArrowRight`,`ArrowDown`].includes(e.key),r=e.key===`Enter`||e.key===` `,i=e.key===`Escape`;if(!t&&!n&&!r&&!i)return;if(e.preventDefault(),e.stopPropagation(),i){M.value=null,dn.value=`pointer`,Gt.value=!1,Z.value=null;return}if(r){if(M.value===null)return;let e=G.value[M.value];if(!e)return;_r(e,M.value);return}let a=M.value,o=Z.value?G.value.findIndex(e=>e.id===Z.value.id):null,s=a!==null&&a>=0&&a<G.value.length,c=o!==null&&o>=0&&o<G.value.length;s?n?(a+=1,a>=G.value.length&&(a=0)):t&&(--a,a<0&&(a=G.value.length-1)):c?(a=n?o+1:o-1,a>=G.value.length&&(a=0),a<0&&(a=G.value.length-1)):a=n?0:G.value.length-1;let l=G.value[a];l&&(Oi(a),kr({datapoint:l,seriesIndex:a,triggerMode:`keyboard`}))}function Oi(e){if(!Number.isFinite(e)||!xn.value)return;let t=G.value[e];if(!t)return;let n=t.x0+q(t)/2,r=t.y0+K(t)/2,i=xn.value.getBoundingClientRect();un.value={x:i.left+(n-$.value.x)/$.value.width*i.width,y:i.top+(r-$.value.y)/$.value.height*i.height}}let ki=m(()=>({headers:jr.value?.colNames??[],rows:jr.value?.body??[]})),Ai=m(()=>z.value.color);Ie({getData:Mr,getImage:ni,generateCsv:Ar,generateImage:Dn,generateSvg:ui,generatePdf:En,hideSeries:Er,showSeries:Tr,toggleTable:Nr,toggleTooltip:Pr,toggleZoom:Fr,toggleAnnotator:Lr,toggleFullscreen:ur,resetZoom:Vr,copyAlt:wi});let ji=m(()=>s(N.value.userOptions?.annotator?.followZoom,$.value));return(e,s)=>(x(),_(`div`,{ref_key:`treemapChart`,ref:Yt,class:Ge(`vue-data-ui-component vue-ui-treemap ${qt.value?`vue-data-ui-wrapper-fullscreen`:``} ${N.value.useCssAnimation?``:`vue-ui-dna`}`),style:Ke(`font-family:${N.value.style.fontFamily};width:100%; ${N.value.responsive?`height: 100%;`:``} text-align:center;background:${z.value.backgroundColor}`),id:`treemap_${k.value}`,onMouseenter:s[3]||=()=>T(yn)(!0),onMouseleave:s[4]||=()=>T(yn)(!1)},[v(`div`,{id:`chart-instructions-${k.value}`,class:`sr-only`},[v(`p`,null,Ze(N.value.a11y.translations.keyboardNavigation),1)],8,_t),ki.value?.rows?.length?(x(),h(Ne,{key:0,uid:k.value,head:ki.value.headers,body:ki.value.rows,notice:N.value.a11y.translations.tableAvailable,caption:N.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):g(``,!0),P.value.buttons.annotator?(x(),h(T(at),Ue({key:1},T(a)(P.value.annotator),{svgRef:T(xn),followZoom:N.value.userOptions?.annotator?.followZoom,annotationViewport:ji.value,backgroundColor:z.value.backgroundColor,color:z.value.color,active:Ir.value,isCursorPointer:B.value,palette:P.value.annotatorPalette,onClose:Lr}),ze({_:2},[Ye(T(o),t=>({name:t,fn:D(n=>[C(e.$slots,t,b(y(T(i)(t,n))),void 0,!0)])}))]),1040,[`svgRef`,`followZoom`,`annotationViewport`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):g(``,!0),On.value?(x(),_(`div`,{key:2,ref_key:`noTitle`,ref:$t,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):g(``,!0),z.value.title.text?(x(),_(`div`,{key:3,ref_key:`chartTitle`,ref:Xt,style:Ke(`width:100%;background:${z.value.backgroundColor};padding-bottom:6px`)},[(x(),h(ke,{key:`title_${en.value}`,config:{title:{cy:`treemap-div-title`,...z.value.title},subtitle:{cy:`treemap-div-subtitle`,...z.value.title.subtitle}}},null,8,[`config`]))],4)):g(``,!0),v(`div`,{id:`legend-top-${k.value}`},null,8,vt),P.value.show&&ht.value&&(T(bn)||T(vn))?(x(),h(T(lt),Ue({ref_key:`userOptionsRef`,ref:sn,key:`user_option_${Jt.value}`,backgroundColor:z.value.backgroundColor,color:z.value.color,isPrinting:T(wn),isImaging:T(Tn),uid:k.value,hasTooltip:P.value.buttons.tooltip&&F.value.show,isFullscreen:qt.value,isTooltip:V.value.showTooltip,chartElement:Yt.value},T(n)(P.value,`pdf csv img svg table fullscreen altCopy annotator zoom`),{isAnnotation:Ir.value,tableDialog:N.value.table.useDialog,isCursorPointer:B.value,isZoom:V.value.showZoom,onToggleFullscreen:ur,onGeneratePdf:T(En),onGenerateCsv:Ar,onGenerateImage:T(di),onGenerateSvg:T(ui),onToggleTable:Nr,onToggleTooltip:Pr,onToggleAnnotator:Lr,onToggleZoom:Fr,onCopyAlt:wi,style:{visibility:T(bn)?T(vn)?`visible`:`hidden`:`visible`}}),ze({_:2},[Ye(T(t)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionZoom optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:D(n=>[C(e.$slots,t,b(y(T(r)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`hasTooltip`,`isFullscreen`,`isTooltip`,`chartElement`,`isAnnotation`,`tableDialog`,`isCursorPointer`,`isZoom`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):g(``,!0),X.value.length>1?(x(),_(`nav`,{key:5,class:`vue-ui-treemap-breadcrumbs`,"data-dom-to-png-ignore":``,ref_key:`breadcrumbsNav`,ref:rn},[(x(!0),_(Le,null,Ye(X.value,(t,n)=>(x(),_(`span`,{role:`button`,tabindex:n<X.value.length-1?0:void 0,key:t.id||`root`,onClick:e=>n===X.value.length-1?()=>{}:_r(t.node),onKeydown:[tt(nt(e=>n===X.value.length-1?void 0:_r(t.node),[`prevent`]),[`enter`]),tt(nt(e=>n===X.value.length-1?void 0:_r(t.node),[`prevent`]),[`space`])],class:`vue-ui-treemap-crumb`,"data-last-crumb":n===X.value.length-1,style:Ke({color:z.value.color,cursor:B.value?`pointer`:`default`}),onMouseenter:e=>ei(n),onMouseleave:ti,onFocus:e=>ei(n),onBlur:ti},[v(`span`,bt,[v(`span`,xt,[C(e.$slots,`breadcrumb-label`,Ue({ref_for:!0},{crumb:t,isRoot:n===0,isFocus:$r.value===n}),()=>[n===0?(x(),_(`div`,St,[Ve(Me,{name:$r.value===0?`homeFilled`:`home`,stroke:z.value.color},null,8,[`name`,`stroke`])])):(x(),_(Le,{key:1},[Be(Ze(t.label),1)],64))],!0)]),n<X.value.length-1?(x(),_(`span`,Ct,[C(e.$slots,`breadcrumb-arrow`,{},()=>[s[5]||=Be(` › `,-1)],!0)])):g(``,!0)])],44,yt))),128))],512)):g(``,!0),v(`div`,wt,[(x(),_(`svg`,{ref_key:`svgRef`,ref:xn,xmlns:T(pe),"aria-describedby":`chart-instructions-${k.value}`,class:Ge({"vue-data-ui-fullscreen--on":qt.value,"vue-data-ui-fulscreen--off":!qt.value,"vue-data-ui-zoom-plus":!fr.value,"vue-data-ui-zoom-minus":fr.value,"vue-data-ui-no-transition":!T(pn),loading:T(hn)}),viewBox:`${T($).x} ${T($).y} ${T($).width<=0?10:T($).width} ${T($).height<=0?10:T($).height}`,style:Ke(`max-width:100%; overflow:${Jr.value?`hidden`:`visible`}; background:transparent;color:${z.value.color}`),tabindex:`0`,onFocus:Ti,onBlur:Ei,onKeydown:Di,onPointerdown:Yr,onPointermove:Xr,onPointerup:Zr,onPointercancel:Zr,onPointerleave:Zr},[Ve(T(ut)),C(e.$slots,`svg-underlayer`,b(y({svg:H.value,isZoom:fr.value,rect:Z.value,config:N.value,isPrintingImg:T(wn)||T(Tn)||T(ci),isPrintingSvg:T(li)})),void 0,!0),(x(!0),_(Le,null,Ye(G.value,(e,t)=>(x(),_(`g`,{key:`tgrad_${e.id}`},[R.value.rects.gradient.show?(x(),_(`defs`,Et,[Ve(Fe,{t:`radial`,id:`tgrad_${e.id}`,gradientTransform:`translate(-1, -1.000001) scale(2, 2)`,stops:[[`18%`,e.color,1],[`100%`,T(ne)(e.color,R.value.rects.gradient.intensity/100),1]]},null,8,[`id`,`stops`])])):g(``,!0)]))),128)),v(`g`,null,[(x(!0),_(Le,null,Ye(G.value,(e,t)=>(x(),_(`g`,{key:`rect_${e.id}_${e.depth}`},[v(`rect`,{x:e.x0,y:e.y0,height:K(e),width:q(e),fill:Wt.value?e.color??z.value.backgroundColor:R.value.rects.gradient.show?xr.value?z.value.backgroundColor:`url(#tgrad_${e.id})`:e.color??z.value.backgroundColor,rx:T(Wr)>1?Ci(e)*Gr.value:Ci(e),stroke:Z.value&&Z.value.id===e.id?R.value.rects.selected.stroke:R.value.rects.stroke,"stroke-width":tr(e),onClick:nt(n=>Qr(e,t),[`stop`]),onMouseenter:()=>kr({datapoint:e,seriesIndex:t,triggerMode:`pointer`}),onMouseleave:n=>Dr({datapoint:e,seriesIndex:t}),style:Ke(`opacity:${Z.value?Z.value.id===e.id?1:R.value.rects.selected.unselectedOpacity:1}`),class:Ge([`vue-ui-treemap-rect`,T(pn)?`vue-data-ui-transition`:``,vr(e)?`vue-data-ui-zoom-minus`:`vue-data-ui-zoom-plus`])},null,46,Dt)]))),128)),(x(!0),_(Le,null,Ye(yi.value,e=>(x(),_(`g`,{key:e.key,style:{"pointer-events":`none`}},[v(`defs`,null,[v(`clipPath`,{id:e.clipId,clipPathUnits:`userSpaceOnUse`},[v(`rect`,{class:Ge({"vue-data-ui-transition":T(pn)}),x:e.clipX,y:e.clipY,width:e.clipWidth,height:e.clipHeight},null,10,kt)],8,Ot)]),v(`g`,{"clip-path":`url(#${e.clipId})`},[v(`g`,{transform:e.translate},[v(`g`,{class:Ge({"vue-data-ui-transition":T(pn)}),transform:gi(e)},[(x(!0),_(Le,null,Ye(e.lines,t=>(x(),_(Le,{key:t.key},[t.text&&(e.alwaysShowAllLines||Kr.value<=t.maxZoomFactor)?(x(),_(`text`,{key:0,x:t.x,y:t.y,fill:t.fill,"font-size":t.fontSize,"font-family":t.fontFamily,"font-weight":t.fontWeight,class:Ge({"vue-data-ui-transition":T(pn)}),"text-anchor":`start`,"dominant-baseline":`text-before-edge`},Ze(t.text),11,Nt)):g(``,!0)],64))),128))],10,Mt)],8,jt)],8,At)]))),128)),e.$slots.rect?(x(),_(`g`,Pt,[(x(!0),_(Le,null,Ye(G.value,(t,n)=>(x(),_(`g`,{key:`slot_${t.id}_${t.depth}`},[(x(),_(`foreignObject`,{x:t.x0,y:t.y0,height:K(t),width:q(t),class:`vue-ui-treemap-cell-foreignObject`,style:{"pointer-events":`none`,overflow:`hidden`}},[v(`div`,It,[T(hn)?g(``,!0):C(e.$slots,`rect`,Ue({ref_for:!0},{rect:{...t,height:K(t),width:q(t),isSelected:!Z.value||Z.value.id===t.id},shouldShow:Qn(t)||fr.value,fontSize:lr(t,n),isZoom:fr.value,textColor:T(fe)(t.color)}),void 0,!0,0)])],8,Ft))]))),128))])):g(``,!0)]),C(e.$slots,`svg`,b(y({svg:H.value,isZoom:fr.value,rect:Z.value,config:N.value,isPrintingImg:T(wn)||T(Tn)||T(ci),isPrintingSvg:T(li)})),void 0,!0)],46,Tt)),T(Hr)?(x(),_(`div`,Lt,[C(e.$slots,`reset-action`,{reset:T(Vr)},()=>[v(`button`,{"data-cy-reset":``,tabindex:`0`,role:`button`,class:`vue-data-ui-refresh-button`,style:Ke({background:z.value.backgroundColor,cursor:B.value?`pointer`:`default`}),onClick:s[0]||=e=>T(Vr)(!0)},[Ve(Me,{name:`refresh`,stroke:z.value.color},null,8,[`stroke`])],4)],!0)])):g(``,!0),e.$slots.hint?(x(),_(`div`,Rt,[C(e.$slots,`hint`,b(y({hint:N.value.a11y.translations.keyboardNavigation,isVisible:fn.value})),void 0,!0)])):g(``,!0)]),e.$slots.watermark?(x(),_(`div`,zt,[C(e.$slots,`watermark`,b(y({isPrinting:T(wn)||T(Tn)||T(ci)||T(li)})),void 0,!0)])):g(``,!0),v(`div`,{id:`legend-bottom-${k.value}`},null,8,Bt),an.value&&(I.value.show||e.$slots.legend)?(x(),h(Re,{key:7,to:I.value.position===`top`?`#legend-top-${k.value}`:`#legend-bottom-${k.value}`},[v(`div`,{ref_key:`chartLegend`,ref:Zt},[C(e.$slots,`legend`,{legend:yr.value},()=>[I.value.show?(x(),h(je,{key:`legend_${nn.value}`,legendSet:yr.value,config:br.value,id:`treemap_legend_${k.value}`,isCursorPointer:B.value,onClickMarker:s[1]||=({legend:e})=>Cr(e)},{item:D(({legend:e,index:t})=>[T(hn)?g(``,!0):(x(),_(`div`,{key:0,onClick:t=>Cr(e),style:Ke(`opacity:${A.value.includes(e.id)?.5:1}`)},Ze(e.display),13,Vt))]),legendToggle:D(()=>[yr.value.length>2&&I.value.selectAllToggle.show&&!T(hn)?(x(),h(Pe,{key:0,backgroundColor:I.value.selectAllToggle.backgroundColor,color:I.value.selectAllToggle.color,fontSize:I.value.fontSize,checked:A.value.length>0,isCursorPointer:B.value,onToggle:Sr},null,8,[`backgroundColor`,`color`,`fontSize`,`checked`,`isCursorPointer`])):g(``,!0)]),_:1},8,[`legendSet`,`config`,`id`,`isCursorPointer`])):g(``,!0)],!0)],512)],8,[`to`])):g(``,!0),e.$slots.source?(x(),_(`div`,{key:8,ref_key:`source`,ref:Qt,dir:`auto`},[C(e.$slots,`source`,{},void 0,!0)],512)):g(``,!0),Ve(T(ct),{teleportTo:F.value.teleportTo,show:V.value.showTooltip&&Gt.value,backgroundColor:F.value.backgroundColor,color:F.value.color,fontSize:F.value.fontSize,borderRadius:F.value.borderRadius,borderColor:F.value.borderColor,borderWidth:F.value.borderWidth,backgroundOpacity:F.value.backgroundOpacity,position:F.value.position,offsetX:F.value.offsetX,offsetY:F.value.offsetY,parent:Yt.value,content:Kt.value,isFullscreen:qt.value,isCustom:T(te)(F.value.customFormat),smooth:F.value.smooth,backdropFilter:F.value.backdropFilter,smoothForce:F.value.smoothForce,smoothSnapThreshold:F.value.smoothSnapThreshold,isA11yMode:dn.value===`keyboard`,a11yPosition:un.value},{"tooltip-before":D(()=>[C(e.$slots,`tooltip-before`,b(y({...Or.value})),void 0,!0)]),tooltip:D(()=>[C(e.$slots,`tooltip`,b(y({...Or.value})),void 0,!0)]),"tooltip-after":D(()=>[C(e.$slots,`tooltip-after`,b(y({...Or.value})),void 0,!0)]),_:3},8,[`teleportTo`,`show`,`backgroundColor`,`color`,`fontSize`,`borderRadius`,`borderColor`,`borderWidth`,`backgroundOpacity`,`position`,`offsetX`,`offsetY`,`parent`,`content`,`isFullscreen`,`isCustom`,`smooth`,`backdropFilter`,`smoothForce`,`smoothSnapThreshold`,`isA11yMode`,`a11yPosition`]),ht.value&&P.value.buttons.table?(x(),h(Xe(ri.value.component),Ue({key:9},ri.value.props,{ref_key:`tableUnit`,ref:on,onClose:ii}),ze({content:D(()=>[(x(),h(T(it),{key:`table_${tn.value}`,colNames:jr.value.colNames,head:jr.value.head,body:jr.value.body,config:jr.value.config,title:N.value.table.useDialog?``:ri.value.title,withCloseButton:!N.value.table.useDialog,isCursorPointer:B.value,onClose:ii},{th:D(({th:e})=>[v(`div`,Ht,Ze(e),1)]),td:D(({td:e})=>[Be(Ze(e.name||e),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[N.value.table.useDialog?{name:`title`,fn:D(()=>[Be(Ze(ri.value.title),1)]),key:`0`}:void 0,N.value.table.useDialog?{name:`actions`,fn:D(()=>[v(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:s[2]||=e=>Ar(P.value.callbacks.csv),style:Ke({cursor:B.value?`pointer`:`default`})},[Ve(Me,{name:`fileCsv`,stroke:ri.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):g(``,!0),C(e.$slots,`skeleton`,{},()=>[T(hn)?(x(),h(xe,{key:0})):g(``,!0)],!0)],46,gt))}},[[`__scopeId`,`data-v-5a29df3b`]]);export{ht as n,Wt as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./userOptionsSlots-CWtXN5Q6.js";import{n as i,r as a,t as o}from"./annotationSlots-OLiW25XN.js";import{n as s,t as ee}from"./tableIntegration-CNoJ1CIY.js";import{t as c}from"./chartImage-DPGnEuYM.js";import{n as te}from"./resolveChartConfig-0IvbmIE_.js";import{$ as l,D as ne,Dt as re,Ht as ie,Jt as ae,S as oe,X as se,Yt as ce,Zt as le,at as ue,i as de,in as fe,n as pe,nt as me,pt as he,r as ge,t as _e,w as ve,yt as ye,zt as be}from"./lib-rPeBMZrn.js";import{c as xe}from"./canvas-lib-22VpOI4_.js";import{n as Se,t as Ce}from"./useHints-C-TwxM0Y.js";import{t as we}from"./useConfig-_JwRfIqE.js";import{n as Te,t as Ee}from"./BaseScanner-8NdoBs7B.js";import{t as De}from"./usePrinter-DVf3YcG5.js";import{t as Oe}from"./useResponsive-CENUxfEL.js";import{t as ke}from"./useChartExport-BZts4KFb.js";import{t as Ae}from"./useTransitions-ChGGrtrv.js";import{t as je}from"./useUserOptionState-CXlFnwPv.js";import{t as Me}from"./useChartAccessibility-DOMuYJfm.js";import{t as Ne}from"./usePrefersMotion-XLHwega2.js";import{t as Pe}from"./labelUtils-CdtU-yB_.js";import{t as Fe}from"./Shape-CRe8woTu.js";import{n as Ie}from"./Title-BliHuXfT.js";import{t as Le}from"./vue_ui_waffle-BVf3Wcda.js";import{t as Re}from"./Legend-W9YVYVX-.js";import{t as ze}from"./A11yDataTable-DWNlWXzs.js";import{t as Be}from"./BaseLegendToggle-VzX69MCo.js";import{t as Ve}from"./DefGrad-DKMq1REY.js";import{t as He}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as u,Teleport as Ue,computed as d,createBlock as f,createCommentVNode as p,createElementBlock as m,createElementVNode as h,createSlots as We,createTextVNode as Ge,createVNode as Ke,defineAsyncComponent as g,guardReactiveProps as qe,mergeProps as Je,nextTick as Ye,normalizeClass as _,normalizeProps as Xe,normalizeStyle as v,onBeforeUnmount as Ze,onMounted as Qe,openBlock as y,ref as b,renderList as x,renderSlot as S,resolveDynamicComponent as $e,shallowRef as et,toDisplayString as tt,toRefs as nt,unref as C,useSlots as rt,watch as it,withCtx as w}from"vue";var at=/* @__PURE__ */ e({default:()=>Nt}),ot=[`id`],st=[`id`],ct=[`id`],lt={style:{position:`relative`}},ut=[`xmlns`,`aria-describedby`,`viewBox`],dt=[`id`],ft=[`x`,`y`,`height`,`width`],pt=[`height`,`width`],mt={key:0},ht=[`d`,`stroke`,`stroke-width`,`filter`],gt=[`d`,`fill`,`stroke`,`stroke-width`,`filter`],_t={key:0},vt=[`d`,`fill`,`filter`],yt=[`rx`,`x`,`y`,`height`,`width`,`stroke`,`stroke-width`,`filter`],bt=[`rx`,`x`,`y`,`height`,`width`,`fill`,`stroke`,`stroke-width`,`filter`],xt={key:0},St=[`rx`,`x`,`y`,`height`,`width`,`fill`,`filter`],Ct=[`points`,`stroke`,`stroke-width`,`stroke-linejoin`],wt=[`textContent`,`x`,`y`,`font-size`,`fill`,`filter`],Tt=[`d`,`onMouseover`,`onMouseleave`,`onClick`],Et=[`x`,`y`,`height`,`width`,`onMouseover`,`onMouseleave`,`onClick`],Dt={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},Ot={key:5,class:`vue-data-ui-watermark`},kt=[`id`],At=[`onClick`],jt={key:0},Mt={key:1},Nt=/*#__PURE__*/ He({__name:`vue-ui-waffle`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectLegend`,`copyAlt`],setup(e,{expose:He,emit:at}){let Nt=g(()=>import(`./Tooltip-C1q0Qoh7.js`)),Pt=g(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),Ft=g(()=>import(`./DataTable-KeuZB1JM.js`)),It=g(()=>import(`./vue-ui-accordion-DxGxf-Rm.js`).then(e=>e.n)),Lt=g(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),Rt=g(()=>import(`./PenAndPaper-BV5ODysA.js`).then(e=>e.t)),zt=g(()=>import(`./PackageVersion-ksOit8fp.js`).then(e=>e.t)),Bt=g(()=>import(`./BaseDraggableDialog-DVstuNhT.js`).then(e=>e.n)),{vue_ui_waffle:Vt}=we(),Ht=Ne(),T=e,Ut=rt(),Wt=d({get(){return!!T.dataset&&T.dataset.length},set(e){return e}}),E=b(se()),Gt=b(!1),Kt=b(``),D=b(null),qt=b(0),Jt=b(null),Yt=b(null),Xt=b(null),Zt=b(null),Qt=b(null),$t=b(0),en=b(0),tn=b(0),nn=b(!1),rn=b(null),an=b(null),O=b(null),on=b({x:0,y:0}),sn=b(`pointer`),cn=b(!1),k=b(vn()),A=d(()=>k.value.userOptions),j=d(()=>k.value.style.chart.tooltip),M=d(()=>k.value.style.chart.legend),N=d(()=>k.value.style.chart.layout.rect),P=d(()=>k.value.style.chart.layout.grid),F=d(()=>k.value.style.chart.layout),I=d(()=>k.value.style.chart),{transitionEnabled:L}=Ae({config:()=>k.value.transitions,dataset:()=>T.dataset});Se({config:()=>k.value,dataset:()=>T.dataset,component:`VueUiWaffle`,rules:[Ce.singleSeries,Ce.emptyArray,{test:e=>e.length>6,message:[`👀 The number of series is > 6. Consider:`,``,`▶️ Grouping small values dynamically into a single "Other" series.`,``,`▶️ Using filters to let users choose a maximum number of series to display.`,``,`▶️ Using VueUiHorizontalBar instead to make the dataset breakdown easier to read.`]}]});let ln=d(()=>k.value.userOptions.useCursorPointer),un=d(()=>fe({defaultConfig:{useCustomCells:!1,userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,layout:{labels:{captions:{show:!1}},rect:{stroke:`#999999`}},legend:{backgroundColor:`transparent`,showValue:!1,showPercentage:!1}}}},userConfig:k.value.skeletonConfig??{}})),{loading:dn,FINAL_DATASET:fn,manualLoading:pn}=Te({...nt(T),FINAL_CONFIG:k,prepareConfig:vn,callback:()=>{Promise.resolve().then(async()=>{W.value=Nn()})},skeletonDataset:T.config?.skeletonDataset??[{name:``,values:[1],color:`#AAAAAA`},{name:``,values:[1],color:`#BABABA`},{name:``,values:[1],color:`#CACACA`}],skeletonConfig:fe({defaultConfig:k.value,userConfig:un.value})}),{userOptionsVisible:mn,setUserOptionsVisibility:hn,keepUserOptionState:gn}=je({config:k.value}),{svgRef:_n}=Me({config:I.value.title});function vn(){return te(T.config,Vt,Le)}let yn=le(T.config);it(()=>T.config,(e,t)=>{let n=le(e),r=n!==yn;yn=n;let i=vn();r?(dn.value||(k.value=i),mn.value=!k.value.userOptions.showOnChartHover,Sn(),$t.value+=1,en.value+=1,tn.value+=1,z.value.showTable=k.value.table.show,z.value.showTooltip=j.value.show):(k.value.style.chart.tooltip=i.style.chart.tooltip,z.value.showTooltip=k.value.style.chart.tooltip.show)},{deep:!0});let R=et(null),bn=et(null),xn=d(()=>k.value.debug);function Sn(){if(be(T.dataset)?(ue({componentName:`VueUiWaffle`,type:`dataset`,debug:xn.value}),Wt.value=!1,pn.value=!0):xn.value&&T.dataset.forEach((e,t)=>{ye({datasetObject:e,requiredAttributes:[`name`,`values`]}).forEach(e=>{ue({componentName:`VueUiWaffle`,type:`datasetSerieAttribute`,property:e,index:t})})}),be(T.dataset)||(pn.value=k.value.loading),k.value.responsive){let e=xe(()=>{let{width:e,height:t}=Oe({chart:Jt.value,title:I.value.title.text?Yt.value:null,legend:M.value.show?Xt.value:null,source:Zt.value,noTitle:Qt.value});requestAnimationFrame(()=>{B.value.width=e,B.value.height=t,V.value.width=e,V.value.height=t})});R.value&&(bn.value&&R.value.unobserve(bn.value),R.value.disconnect()),R.value=new ResizeObserver(e),bn.value=Jt.value.parentNode,R.value.observe(bn.value)}}Qe(()=>{nn.value=!0,Sn()}),Ze(()=>{R.value&&(bn.value&&R.value.unobserve(bn.value),R.value.disconnect())});let{isPrinting:Cn,isImaging:wn,generatePdf:Tn,generateImage:En}=De({elementId:`vue-ui-waffle_${E.value}`,fileName:I.value.title.text||`vue-ui-waffle`,options:k.value.userOptions.print}),Dn=d(()=>k.value.userOptions.show&&!I.value.title.text),On=d(()=>ve(k.value.customPalette)),z=b({showTable:k.value.table.show,showTooltip:j.value.show});it(k,()=>{z.value={showTable:k.value.table.show,showTooltip:j.value.show}},{immediate:!0});let B=b({height:512,width:512}),V=b({top:0,left:0,height:512,width:512}),H=d(()=>(V.value.width-P.value.size*P.value.spaceBetween)/P.value.size),U=d(()=>(V.value.height-P.value.size*P.value.spaceBetween)/P.value.size),kn=d(()=>Math.max(1e-4,V.value.width/P.value.size)),An=d(()=>Math.max(1e-4,V.value.height/P.value.size));function jn(e){let t=P.value.size*P.value.size,n=e.reduce((e,t)=>e+t,0),r=e.map(e=>e/n*t),i=r.map(Math.floor),a=r.map(e=>e%1),o=t-i.reduce((e,t)=>e+t,0);for(;o>0;){let e=a.indexOf(Math.max(...a));i[e]+=1,a[e]=0,--o}return i}let Mn=b(!1);function Nn(){return Mn.value=fn.value.flatMap(e=>e.values.reduce((e,t)=>e+t,0)).reduce((e,t)=>e+t,0)===0,fn.value.map((e,t)=>({...e,color:oe(e.color)||On.value[t]||ie[t]||ie[t%ie.length],uid:`serie_${t}`,absoluteIndex:t}))}let Pn=d(()=>Nn()),W=b(Pn.value);it(()=>T.dataset,e=>{Array.isArray(e)&&e.length>0&&(pn.value=!1)},{immediate:!0}),it(()=>T.dataset,e=>{W.value=Nn()},{deep:!0});let Fn=d(()=>jn(W.value.filter((e,t)=>!J.value.includes(e.uid)).map((e,t)=>Mn.value?1:(e.values||[]).reduce((e,t)=>e+t,0)))),In=d(()=>jn(W.value.map((e,t)=>Mn.value?1:(e.values||[]).reduce((e,t)=>e+t)))),Ln=d(()=>P.value.size**2),G=d(()=>(xn.value&&fn.value.forEach((e,t)=>{[null,void 0].includes(e.values)&&ue({componentName:`VueUiWaffle`,type:`datasetSerieAttribute`,property:`values (number[])`,index:t})}),W.value.filter((e,t)=>!J.value.includes(e.uid)).map((e,t)=>{let n=Fn.value[t];return{absoluteIndex:e.absoluteIndex,uid:e.uid,name:e.name,color:e.color,value:(e.values||[]).reduce((e,t)=>e+t,0),absoluteValues:e.values||[],squareCount:n,proportion:n/Ln.value}}))),Rn=d(()=>W.value.map((e,t)=>{let n=In.value[t];return{absoluteIndex:e.absoluteIndex,uid:e.uid,name:e.name,color:e.color,value:(e.values||[]).reduce((e,t)=>e+t,0),absoluteValues:e.values||[],squareCount:n,proportion:n/Ln.value}}));function zn(){return Rn.value.map(e=>({name:e.name,color:e.color,value:e.value,squareCount:e.squareCount,proportion:e.proportion}))}let Bn=d(()=>{let e=0;return G.value.map((t,n)=>{let r=e,i=r+t.squareCount,a=[];for(let e=Math.floor(r);e<Math.floor(i);e+=1)a.push(e);return e=i,{...t,start:r,rects:a}})}),K=d(()=>Bn.value.flatMap((e,t)=>e.rects.map((n,r)=>({isFirst:r===0,isLongEnough:n.length>2,name:e.name,color:e.color,value:e.value,serieIndex:t,absoluteStartIndex:r<3,serieId:e.uid,...e}))).map((e,t)=>({...e,isAbsoluteFirst:t%P.value.size===0}))),q=d(()=>{let e=[];for(let t=0;t<P.value.size;t+=1)for(let n=0;n<P.value.size;n+=1)e.push({isStartOfLine:n===0,position:P.value.vertical?t:n,x:(P.value.vertical?t:n)*(H.value+P.value.spaceBetween),y:(P.value.vertical?n:t)*(U.value+P.value.spaceBetween)+V.value.top});return e}),J=b([]),Vn=b(!1),Hn=b(Object.create(null)),Un=b(Object.create(null)),Y=b(0);function Wn(e,t){W.value=W.value.map(n=>n.uid===e?{...n,values:[t]}:n)}function Gn(e,t){let n=t.find(t=>t.uid===e);return n?(n.values||[]).reduce((e,t)=>e+t,0):0}function Kn(e){let t=!1;Hn.value[e]&&(cancelAnimationFrame(Hn.value[e]),delete Hn.value[e],t=!0),Un.value[e]&&(cancelAnimationFrame(Un.value[e]),delete Un.value[e],t=!0),t&&(Y.value=Math.max(0,Y.value-1),Vn.value=Y.value>0)}function qn({seriesId:e,fromValue:t,toValue:n,mode:r}){Kn(e),Y.value+=1,Vn.value=!0;let i=t;return new Promise(a=>{function o(){if(r===`increase`){if(i>=n){Wn(e,n),--Y.value,Y.value<=0&&(Vn.value=!1),delete Hn.value[e],a();return}i+=n*.025,i>n&&(i=n),Wn(e,i),Hn.value[e]=requestAnimationFrame(o)}else{if(i<=t/100){Wn(e,0),--Y.value,Y.value<=0&&(Vn.value=!1),delete Un.value[e],a();return}i/=1.15,Wn(e,i),Un.value[e]=requestAnimationFrame(o)}}o()})}function Jn(){W.value=Pn.value;let e=J.value.length>0;k.value.useAnimation?e?[...J.value].forEach(e=>{Yn(e,!0)}):X.value.map(e=>e.uid).forEach(e=>{Yn(e,!0)}):e?J.value=[]:J.value=X.value.map(e=>e.uid)}function Yn(e,t=!1){if(Mn.value&&!t)return;let n=t||J.value.length<X.value.length-1&&X.value.length>1;if(!k.value.useAnimation){J.value.includes(e)?J.value=J.value.filter(t=>t!==e):n&&J.value.push(e);return}let r=Gn(e,Pn.value),i=Gn(e,W.value);if(i!==0||r!==0){if(J.value.includes(e)){if(J.value=J.value.filter(t=>t!==e),Ht.value){Kn(e),Wn(e,r),cr(`selectLegend`,G.value.map(e=>({name:e.name,color:e.color,value:e.value,proportion:e.proportion})));return}qn({seriesId:e,fromValue:i,toValue:r,mode:`increase`}).then(()=>{cr(`selectLegend`,G.value.map(e=>({name:e.name,color:e.color,value:e.value,proportion:e.proportion})))})}else n&&(Ht.value?(Kn(e),J.value.includes(e)||J.value.push(e),Wn(e,0),cr(`selectLegend`,G.value.map(e=>({name:e.name,color:e.color,value:e.value,proportion:e.proportion})))):qn({seriesId:e,fromValue:i,toValue:0,mode:`decrease`}).then(()=>{J.value.includes(e)||J.value.push(e),Wn(e,0),cr(`selectLegend`,G.value.map(e=>({name:e.name,color:e.color,value:e.value,proportion:e.proportion})))}))}}function Xn(e){return Rn.value.length?Rn.value.find(t=>t.name===e)||(xn.value&&console.warn(`VueUiWaffle - Series name not found "${e}"`),null):(xn.value&&console.warn(`VueUiWaffle - There are no series to show.`),null)}function Zn(e){let t=Xn(e);t!==null&&J.value.includes(t.uid)&&Yn(t.uid)}function Qn(e){let t=Xn(e);t!==null&&(J.value.includes(t.uid)||Yn(t.uid))}function $n({val:e,percentage:t,showVal:n,showPercentage:r,config:i}){return Pe({config:i,val:e,percentage:t,showVal:n,showPercentage:r})}let X=d(()=>W.value.map((e,t)=>{let n=(e.values||[]).reduce((e,t)=>e+t,0),r=n/W.value.map(e=>(e.values||[]).reduce((e,t)=>e+t,0)).reduce((e,t)=>e+t,0);return{name:e.name,color:e.color||On[t]||ie[t]||ie[t%ie.length],value:n,proportion:r,uid:e.uid,shape:`square`}}).map((e,t)=>{let n=$n({val:de(F.value.labels.dataLabels.formatter,e.value,l({p:F.value.labels.dataLabels.prefix,v:e.value,s:F.value.labels.dataLabels.suffix,r:M.value.roundingValue}),{datapoint:e,index:t}),percentage:isNaN(e.value/Z.value)?`-`:l({v:e.value/Z.value*100,s:`%`,r:M.value.roundingPercentage}),showVal:M.value.showValue,showPercentage:M.value.showPercentage,config:M.value});return{...e,opacity:J.value.includes(e.uid)?.5:1,segregate:()=>Yn(e.uid),isSegregated:J.value.includes(e.uid),display:`${e.name}${M.value.showPercentage||M.value.showValue?`: `:``}${n}`}})),er=d(()=>({cy:`waffle-div-legend`,backgroundColor:M.value.backgroundColor,color:M.value.color,fontSize:M.value.fontSize,paddingBottom:12,fontWeight:M.value.bold?`bold`:``})),Z=d(()=>G.value.map(e=>e.value).reduce((e,t)=>e+t,0)),tr=b(null),nr=b(null),Q=d(()=>{let e=/* @__PURE__ */ new Map;return K.value.forEach((t,n)=>{e.has(t.serieIndex)?e.get(t.serieIndex).rectIndexes.push(n):e.set(t.serieIndex,{serieIndex:t.serieIndex,absoluteIndex:t.absoluteIndex,serieId:t.serieId,name:t.name,color:t.color,value:t.value,proportion:t.proportion,rectIndexes:[n]})}),Array.from(e.values()).sort((e,t)=>e.serieIndex-t.serieIndex)});function rr(e){return Q.value.find(t=>t.serieIndex===e)||null}function ir(e){let t=rr(e);return!t||!t.rectIndexes.length?null:t.rectIndexes[0]}function ar(e){let t=K.value[e];k.value.events.datapointClick&&k.value.events.datapointClick({datapoint:t,seriesIndex:t.serieIndex})}function or(e){let t=K.value[e];k.value.events.datapointLeave&&k.value.events.datapointLeave({datapoint:t,seriesIndex:t.serieIndex}),nr.value=null,Gt.value=!1,D.value=null,O.value=null,sn.value=`pointer`}function sr(e,t=`pointer`){if(J.value.length===T.dataset.length)return;let n=K.value[e];if(!n)return;sn.value=t,O.value=n.serieIndex,tr.value={datapoint:n,seriesIndex:n.absoluteIndex,series:W.value,config:k.value},k.value.events.datapointEnter&&nr.value!==n.serieIndex&&k.value.events.datapointEnter({datapoint:n,seriesIndex:n.serieIndex}),nr.value=n.serieIndex,Gt.value=!0,D.value=n.serieIndex;let r=j.value.customFormat;if(re(r)&&he(()=>r({seriesIndex:n.absoluteIndex,datapoint:n,series:W.value,config:k.value})))Kt.value=r({seriesIndex:n.absoluteIndex,datapoint:n,series:W.value,config:k.value});else{let e=``;e+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${j.value.borderColor};padding-bottom:6px;margin-bottom:3px;">${n.name}</div>`,e+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 60 60" height="14" width="14"><rect x="0" y="0" height="60" width="60" stroke="none" rx="1" fill="${n.color}" />${Ut.pattern?`<rect x="0" y="0" height="60" width="60" stroke="none" rx="1" stroke="none" fill="url(#pattern_${E.value}_${n.absoluteIndex})"/>`:``}</svg>`,e+=`<b>${$n({config:j.value,showVal:j.value.showValue,showPercentage:j.value.showPercentage,val:`<span>${de(F.value.labels.dataLabels.formatter,n.value,l({p:F.value.labels.dataLabels.prefix,v:n.value,s:F.value.labels.dataLabels.suffix,r:j.value.roundingValue}),{datapoint:n,seriesIndex:n.absoluteIndex,series:W.value})}</span>`,percentage:`<span>${l({v:Mn.value?1/fn.value.length*100:n.value/Z.value*100,s:`%`,r:j.value.roundingPercentage})}</span>`})}</b></div>`,Kt.value=e}}let cr=at,$=d(()=>({head:G.value.map(e=>({name:e.name,color:e.color})),body:G.value.map(e=>e.value)}));function lr(e){return k.value.useBlurOnHover&&![null,void 0].includes(D.value)&&D.value!==e?`url(#blur_${E.value})`:``}function ur(e){return[null,void 0].includes(D.value)||D.value===e?{opacity:1}:{opacity:N.value.selection.unselectedOpacity}}function dr(e){return e.length<=3?e:e.filter((t,n)=>{let r=e[(n-1+e.length)%e.length],i=e[(n+1)%e.length],a=r.x===t.x&&t.x===i.x,o=r.y===t.y&&t.y===i.y;return!a&&!o})}function fr(e){if(!e.length)return[];let t=new Set(e.map(({row:e,col:t})=>`${e}:${t}`)),n=[],r=/* @__PURE__ */ new Set,i=[[-1,0],[0,1],[1,0],[0,-1]];e.forEach(e=>{let a=`${e.row}:${e.col}`;if(r.has(a))return;let o=[],s=[e];for(r.add(a);s.length;){let e=s.shift();o.push(e),i.forEach(([n,i])=>{let a=e.row+n,o=e.col+i,ee=`${a}:${o}`;t.has(ee)&&!r.has(ee)&&(r.add(ee),s.push({row:a,col:o}))})}n.push(o)});let a=[];return n.forEach(e=>{let t=new Set(e.map(({row:e,col:t})=>`${e}:${t}`)),n=[];e.forEach(({row:e,col:r})=>{t.has(`${e-1}:${r}`)||n.push({start:{x:r,y:e},end:{x:r+1,y:e}}),t.has(`${e}:${r+1}`)||n.push({start:{x:r+1,y:e},end:{x:r+1,y:e+1}}),t.has(`${e+1}:${r}`)||n.push({start:{x:r+1,y:e+1},end:{x:r,y:e+1}}),t.has(`${e}:${r-1}`)||n.push({start:{x:r,y:e+1},end:{x:r,y:e}})});let r=/* @__PURE__ */ new Map,i=e=>`${e.start.x}:${e.start.y}>${e.end.x}:${e.end.y}`,o=e=>`${e.x}:${e.y}`,s=new Set(n.map(i));for(n.forEach(e=>{let t=o(e.start);r.has(t)||r.set(t,[]),r.get(t).push(e)});s.size;){let e=s.values().next().value,t=n.find(t=>i(t)===e),ee=t.start,c=[ee],te=t;for(;te;){s.delete(i(te));let e=te.end;if(o(e)===o(ee))break;c.push(e),te=(r.get(o(e))||[]).find(e=>s.has(i(e)))}c.length>=4&&a.push(dr(c))}}),a}function pr(e){let t=P.value.size,n=P.value.vertical,r=[];return K.value.forEach((i,a)=>{if(i.serieIndex!==e)return;let o=Math.floor(a/t),s=a%t;r.push({row:n?s:o,col:n?o:s})}),r}function mr(e){let t=kn.value,n=An.value;return fr(pr(e)).map(e=>e.map(({x:e,y:r})=>({x:e*t,y:V.value.top+r*n})))}function hr(e){return e.map(({x:e,y:t})=>`${e},${t}`).join(` `)}function gr(e){return e.map(e=>{if(!e.length)return``;let[t,...n]=e,r=n.map(({x:e,y:t})=>`L ${e} ${t}`).join(` `);return`M ${t.x} ${t.y} ${r} Z`}).filter(Boolean).join(` `)}let _r=d(()=>!N.value.selection?.wrap?.show||[null,void 0].includes(D.value)?[]:mr(D.value).map(hr)),vr=d(()=>{if(!N.value.merged)return[];let e=/* @__PURE__ */ new Map;return K.value.forEach((t,n)=>{e.has(t.serieIndex)||e.set(t.serieIndex,{serieIndex:t.serieIndex,absoluteIndex:t.absoluteIndex,color:t.color,gradientIndex:n,rectIndex:n})}),Array.from(e.values()).map(e=>({...e,d:gr(mr(e.serieIndex))})).filter(e=>e.d)});function yr(e,t){return F.value.labels.captions.show?K.value.length&&!Vn.value&&!P.value.vertical&&(K.value[e].isFirst&&t.position<P.value.size-2||K.value[e].isAbsoluteFirst&&e%P.value.size===0&&K.value[e].absoluteStartIndex):!1}function br(e,t=null){let n=de(F.value.labels.dataLabels.formatter,K.value[e].value,l({p:F.value.labels.dataLabels.prefix,v:K.value[e].value,s:F.value.labels.dataLabels.suffix,r:F.value.labels.captions.roundingValue}),{datapoint:K.value[e],position:t}),r=l({v:K.value[e].proportion*100,s:`%`,r:F.value.labels.captions.roundingPercentage}),i=(F.value.labels.captions.serieNameAbbreviation?pe({source:K.value[e].name,length:F.value.labels.captions.serieNameMaxAbbreviationSize}):K.value[e].name)+(F.value.labels.captions.showPercentage||F.value.labels.captions.showValue?`:`:``);return`${F.value.labels.captions.showSerieName?i:``} ${$n({val:n,percentage:r,showVal:F.value.labels.captions.showValue,showPercentage:F.value.labels.captions.showPercentage,config:F.value.labels.dataLabels})}`}function xr(e=null){Ye(()=>{let t=$.value.head.map((e,t)=>[[e.name],[$.value.body[t]],[isNaN($.value.body[t]/Z.value)?`-`:$.value.body[t]/Z.value*100]]),n=[[I.value.title.text],[I.value.title.subtitle.text],[[``],[`val`],[`%`]]].concat(t),r=ne(n);e?e(r):me({csvContent:r,title:I.value.title.text||`vue-ui-waffle`})})}let Sr=d(()=>({head:[`__SUM__`,de(F.value.labels.dataLabels.formatter,Z.value,l({p:F.value.labels.dataLabels.prefix,v:Z.value,s:F.value.labels.dataLabels.suffix,r:k.value.table.td.roundingValue})),`100%`],body:$.value.head.map((e,t)=>[{color:e.color,name:e.name},de(F.value.labels.dataLabels.formatter,$.value.body[t],l({p:F.value.labels.dataLabels.prefix,v:$.value.body[t],s:F.value.labels.dataLabels.suffix,r:k.value.table.td.roundingValue})),isNaN($.value.body[t]/Z.value)?`-`:l({v:$.value.body[t]/Z.value*100,s:`%`,r:k.value.table.td.roundingPercentage})]),config:{th:{backgroundColor:k.value.table.th.backgroundColor,color:k.value.table.th.color,outline:k.value.table.th.outline},td:{backgroundColor:k.value.table.td.backgroundColor,color:k.value.table.td.color,outline:k.value.table.td.outline},shape:`square`,breakpoint:k.value.table.responsiveBreakpoint},colNames:[k.value.table.columnNames.series,k.value.table.columnNames.value,k.value.table.columnNames.percentage]})),Cr=b(!1);function wr(e){Cr.value=e,qt.value+=1}function Tr(){z.value.showTable=!z.value.showTable}function Er(){z.value.showTooltip=!z.value.showTooltip}let Dr=b(!1);function Or(){Dr.value=!Dr.value}let kr=c(Jt,()=>I.value.title.text),Ar=d(()=>ee({config:k,style:I,mutableConfig:z,dialog:Bt,accordion:It,isFullscreen:Cr,parent:Jt,maxWidth:500,isCursorPointer:ln}));it(()=>z.value.showTable,e=>s(e,k,rn));function jr(){z.value.showTable=!1,an.value&&an.value.setTableIconState(!1)}let Mr=d(()=>X.value.map(e=>({...e,name:e.display}))),Nr=d(()=>I.value.backgroundColor),Pr=d(()=>I.value.title),{isCallbackImaging:Fr,isCallbackSvg:Ir,generateSvg:Lr,onGenerateImage:Rr}=ke({svg:_n,title:Pr,legend:M,legendItems:Mr,backgroundColor:Nr,getSvgCallback:()=>k.value.userOptions.callbacks.svg,generateImage:En});async function zr(){cr(`copyAlt`,{config:k.value,dataset:Rn.value}),k.value.userOptions.callbacks.altCopy?await Promise.resolve(k.value.userOptions.callbacks.altCopy({config:k.value,dataset:Rn.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function Br(){O.value=null,cn.value=!0}function Vr(){O.value=null,sn.value=`pointer`,Gt.value=!1,D.value=null,nr.value=null,cn.value=!1}function Hr(e){if(!_n.value||Dr.value||document.activeElement!==_n.value||!Q.value.length||J.value.length===T.dataset.length)return;let t=[`ArrowLeft`,`ArrowUp`].includes(e.key),n=[`ArrowRight`,`ArrowDown`].includes(e.key),r=e.key===`Enter`||e.key===` `,i=e.key===`Escape`;if(!t&&!n&&!r&&!i)return;if(e.preventDefault(),e.stopPropagation(),i){O.value=null,sn.value=`pointer`,Gt.value=!1,D.value=null,nr.value=null;return}if(r){if(O.value===null)return;let e=ir(O.value);if(e===null)return;ar(e);return}let a=Q.value.findIndex(e=>e.serieIndex===O.value),o=null;if(o=a===-1?n?Q.value[0]:Q.value[Q.value.length-1]:n?Q.value[(a+1)%Q.value.length]:Q.value[(a-1+Q.value.length)%Q.value.length],!o)return;let s=ir(o.serieIndex);s!==null&&(Ur(o.serieIndex),sr(s,`keyboard`))}function Ur(e){if(!Number.isFinite(e)||!_n.value)return;let t=rr(e);if(!t||!t.rectIndexes.length)return;let n=t.rectIndexes.map(e=>{let t=q.value[e];return t?{x:t.x+P.value.spaceBetween/2+kn.value/2,y:t.y+P.value.spaceBetween/2+An.value/2}:null}).filter(Boolean);if(!n.length)return;let r=Math.min(...n.map(e=>e.x)),i=Math.max(...n.map(e=>e.x)),a=Math.min(...n.map(e=>e.y)),o=Math.max(...n.map(e=>e.y)),s=(r+i)/2,ee=(a+o)/2,c=_n.value.getBoundingClientRect();on.value={x:c.left+s/B.value.width*c.width,y:c.top+ee/B.value.height*c.height}}let Wr=d(()=>({headers:Sr.value?.colNames??[],rows:Sr.value?.body??[]}));return He({getData:zn,getImage:kr,generatePdf:Tn,generateCsv:xr,generateImage:En,generateSvg:Lr,hideSeries:Qn,showSeries:Zn,toggleTable:Tr,toggleTooltip:Er,toggleAnnotator:Or,toggleFullscreen:wr,copyAlt:zr}),(e,s)=>(y(),m(`div`,{class:_(`vue-data-ui-component vue-ui-waffle ${Cr.value?`vue-data-ui-wrapper-fullscreen`:``}`),ref_key:`waffleChart`,ref:Jt,id:`vue-ui-waffle_${E.value}`,style:v(`font-family:${k.value.style.fontFamily};width:100%; text-align:center;background:${I.value.backgroundColor};${k.value.responsive?`height: 100%`:``}`),onMouseenter:s[2]||=()=>C(hn)(!0),onMouseleave:s[3]||=()=>C(hn)(!1)},[h(`div`,{id:`chart-instructions-${E.value}`,class:`sr-only`},[h(`p`,null,tt(k.value.a11y.translations.keyboardNavigation),1)],8,st),Wr.value?.rows?.length?(y(),f(ze,{key:0,uid:E.value,head:Wr.value.headers,body:Wr.value.rows,notice:k.value.a11y.translations.tableAvailable,caption:k.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):p(``,!0),A.value.buttons.annotator?(y(),f(C(Rt),Je({key:1},C(a)(A.value.annotator),{svgRef:C(_n),backgroundColor:I.value.backgroundColor,color:I.value.color,active:Dr.value,isCursorPointer:ln.value,palette:A.value.annotatorPalette,onClose:Or}),We({_:2},[x(C(o),t=>({name:t,fn:w(n=>[S(e.$slots,t,Xe(qe(C(i)(t,n))),void 0,!0)])}))]),1040,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):p(``,!0),Dn.value?(y(),m(`div`,{key:2,ref_key:`noTitle`,ref:Qt,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):p(``,!0),I.value.title.text?(y(),m(`div`,{key:3,ref_key:`chartTitle`,ref:Yt,style:`width:100%;background:transparent;padding-bottom:12px`},[(y(),f(Ie,{key:`title_${$t.value}`,config:{title:{cy:`waffle-title`,...I.value.title},subtitle:{cy:`waffle-subtitle`,...I.value.title.subtitle}}},null,8,[`config`]))],512)):p(``,!0),h(`div`,{id:`legend-top-${E.value}`},null,8,ct),A.value.show&&Wt.value&&(C(gn)||C(mn))?(y(),f(C(Lt),Je({ref_key:`userOptionsRef`,ref:an,key:`user_options_${qt.value}`,backgroundColor:I.value.backgroundColor,color:I.value.color,isPrinting:C(Cn),isImaging:C(wn),uid:E.value,hasTooltip:A.value.buttons.tooltip&&j.value.show,isFullscreen:Cr.value,isTooltip:z.value.showTooltip,chartElement:Jt.value},C(n)(A.value,`pdf csv img svg table fullscreen altCopy annotator`),{isAnnotation:Dr.value,tableDialog:k.value.table.useDialog,isCursorPointer:ln.value,onToggleFullscreen:wr,onGeneratePdf:C(Tn),onGenerateCsv:xr,onGenerateImage:C(Rr),onGenerateSvg:C(Lr),onToggleTable:Tr,onToggleTooltip:Er,onToggleAnnotator:Or,onCopyAlt:zr,style:{visibility:C(gn)?C(mn)?`visible`:`hidden`:`visible`}}),We({_:2},[x(C(t)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:w(n=>[S(e.$slots,t,Xe(qe(C(r)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`hasTooltip`,`isFullscreen`,`isTooltip`,`chartElement`,`isAnnotation`,`tableDialog`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):p(``,!0),h(`div`,lt,[(y(),m(`svg`,{ref_key:`svgRef`,ref:_n,xmlns:C(_e),"aria-describedby":`chart-instructions-${E.value}`,class:_({"vue-data-ui-fullscreen--on":Cr.value,"vue-data-ui-fulscreen--off":!Cr.value,"vue-data-ui-no-transition":!C(L)}),tabindex:`0`,viewBox:`0 0 ${B.value.width<=0?10:B.value.width} ${B.value.height<=0?10:B.value.height}`,style:v(`max-width:100%;overflow:visible;background:transparent;color:${I.value.color}`),onFocus:Br,onBlur:Vr,onKeydown:Hr},[Ke(C(zt)),S(e.$slots,`svg-underlayer`,{svg:{...B.value,isPrintingImg:C(Cn)||C(wn)||C(Fr),isPrintingSvg:C(Ir)}},void 0,!0),h(`defs`,null,[(y(!0),m(u,null,x(K.value,(e,t)=>(y(),f(Ve,{t:`radial`,cx:`50%`,cy:`50%`,r:`50%`,fx:`50%`,fy:`50%`,id:`gradient_${E.value}_${t}`,key:`gradient_${E.value}_${t}`,stops:[[`0%`,C(ae)(C(ce)(e.color,.05),100-N.value.gradientIntensity),1],[`100%`,e.color,1]]},null,8,[`id`,`stops`]))),128))]),h(`defs`,null,[h(`filter`,{id:`blur_${E.value}`,x:`-50%`,y:`-50%`,width:`200%`,height:`200%`},[...s[4]||=[h(`feGaussianBlur`,{in:`SourceGraphic`,stdDeviation:2},null,-1),h(`feColorMatrix`,{type:`saturate`,values:`0`},null,-1)]],8,dt)]),k.value.useCustomCells&&K.value.length&&e.$slots.cell?(y(!0),m(u,{key:0},x(q.value,(t,n)=>(y(),m(`foreignObject`,{x:t.x,y:t.y,height:U.value<=0?1e-4:U.value,width:H.value<=0?1e-4:H.value,class:`vue-ui-waffle-custom-cell-foreignObject`},[S(e.$slots,`cell`,Je({ref_for:!0},{cell:{...t,color:K.value[n].color,height:Math.max(0,U.value),width:Math.max(0,H.value),...K.value[n]},isSelected:[null,void 0].includes(D.value)?!0:K.value[n].serieIndex===D.value}),void 0,!0)],8,ft))),256)):p(``,!0),!K.value.length&&!k.value.useCustomCells?(y(),m(`rect`,{key:1,x:12,y:12,height:V.value.height-24,width:V.value.width-24,rx:3,fill:`none`,stroke:`black`},null,8,pt)):K.value.length&&!k.value.useCustomCells?(y(),m(u,{key:2},[e.$slots.pattern?(y(),m(`g`,mt,[(y(!0),m(u,null,x(Pn.value,t=>(y(),m(`defs`,null,[S(e.$slots,`pattern`,Je({ref_for:!0},{seriesIndex:t.absoluteIndex,patternId:`pattern_${E.value}_${t.absoluteIndex}`}),void 0,!0)]))),256))])):p(``,!0),N.value.merged?(y(),m(u,{key:1},[(y(!0),m(u,null,x(vr.value,e=>(y(),m(`path`,{key:`merged-underlayer-${e.serieIndex}`,d:e.d,fill:`white`,"fill-rule":`evenodd`,stroke:N.value.stroke,"stroke-width":N.value.strokeWidth,"stroke-linejoin":`round`,filter:lr(e.serieIndex),style:v(ur(e.serieIndex)),class:_({"vue-data-ui-transition":C(L)})},null,14,ht))),128)),(y(!0),m(u,null,x(vr.value,e=>(y(),m(`path`,{key:`merged-serie-${e.serieIndex}`,d:e.d,fill:N.value.useGradient&&N.value.gradientIntensity>0?`url(#gradient_${E.value}_${e.gradientIndex})`:e.color,"fill-rule":`evenodd`,stroke:N.value.stroke,"stroke-width":N.value.strokeWidth,"stroke-linejoin":`round`,filter:lr(e.serieIndex),style:v(ur(e.serieIndex)),class:_({"vue-data-ui-transition":C(L)})},null,14,gt))),128)),e.$slots.pattern?(y(),m(`g`,_t,[(y(!0),m(u,null,x(vr.value,e=>(y(),m(`path`,{key:`merged-pattern-${e.serieIndex}`,d:e.d,fill:`url(#pattern_${E.value}_${e.absoluteIndex})`,"fill-rule":`evenodd`,stroke:`none`,filter:lr(e.serieIndex),style:v(ur(e.serieIndex)),class:_({"vue-data-ui-transition":C(L)})},null,14,vt))),128))])):p(``,!0)],64)):(y(),m(u,{key:2},[(y(!0),m(u,null,x(q.value,(e,t)=>(y(),m(`rect`,{rx:N.value.rounded?N.value.rounding:0,x:e.x+P.value.spaceBetween/2,y:e.y+P.value.spaceBetween/2,height:U.value<=0?1e-4:U.value,width:H.value<=0?1e-4:H.value,fill:`white`,stroke:N.value.stroke,"stroke-width":N.value.strokeWidth,filter:lr(K.value[t].serieIndex),style:v(ur(K.value[t].serieIndex)),class:_({"vue-data-ui-transition":C(L)})},null,14,yt))),256)),(y(!0),m(u,null,x(q.value,(e,t)=>(y(),m(`rect`,{rx:N.value.rounded?N.value.rounding:0,x:e.x+P.value.spaceBetween/2,y:e.y+P.value.spaceBetween/2,height:U.value<=0?1e-4:U.value,width:H.value<=0?1e-4:H.value,fill:N.value.useGradient&&N.value.gradientIntensity>0?`url(#gradient_${E.value}_${t})`:K.value[t].color,stroke:N.value.stroke,"stroke-width":N.value.strokeWidth,filter:lr(K.value[t].serieIndex),style:v(ur(K.value[t].serieIndex)),class:_({"vue-data-ui-transition":C(L)})},null,14,bt))),256)),e.$slots.pattern?(y(),m(`g`,xt,[(y(!0),m(u,null,x(q.value,(e,t)=>(y(),m(`rect`,{rx:N.value.rounded?N.value.rounding:0,x:e.x+P.value.spaceBetween/2,y:e.y+P.value.spaceBetween/2,height:U.value<=0?1e-4:U.value,width:H.value<=0?1e-4:H.value,fill:`url(#pattern_${E.value}_${K.value[t].absoluteIndex})`,stroke:`none`,filter:lr(K.value[t].serieIndex),style:v(ur(K.value[t].serieIndex)),class:_({"vue-data-ui-transition":C(L)})},null,14,St))),256))])):p(``,!0)],64))],64)):p(``,!0),e.$slots.cellSvg?(y(!0),m(u,{key:3},x(q.value,(t,n)=>(y(),m(`g`,null,[S(e.$slots,`cellSvg`,Je({ref_for:!0},{cell:{...t,color:K.value[n].color,height:Math.max(0,U.value),width:Math.max(0,H.value),...K.value[n]},isSelected:[null,void 0].includes(D.value)?!0:K.value[n].serieIndex===D.value}),void 0,!0)]))),256)):p(``,!0),(y(!0),m(u,null,x(_r.value,(e,t)=>(y(),m(`polygon`,{key:`selected-series-wrap-${t}`,points:e,fill:`none`,stroke:N.value.selection.wrap.stroke,"stroke-width":N.value.selection.wrap.strokeWidth,"stroke-linejoin":N.value.selection.wrap.strokeLinejoin,"pointer-events":`none`},null,8,Ct))),128)),(y(!0),m(u,null,x(q.value,(e,t)=>(y(),m(u,null,[yr(t,e)?(y(),m(`text`,{key:`datalabel_${t}`,textContent:tt(br(t,e)),x:e.x+F.value.labels.captions.offsetX+P.value.spaceBetween/2+6,y:e.y+F.value.labels.captions.offsetY+P.value.spaceBetween/2+An.value/2+F.value.labels.captions.fontSize/3,"font-size":F.value.labels.captions.fontSize,fill:C(ge)(K.value[t].color),filter:lr(K.value[t].serieIndex),class:_({"vue-data-ui-transition":C(L)})},null,10,wt)):p(``,!0)],64))),256)),N.value.merged&&!k.value.useCustomCells?(y(!0),m(u,{key:4},x(vr.value,e=>(y(),m(`path`,{key:`tooltip-trap-${e.serieIndex}`,d:e.d,fill:`transparent`,"fill-rule":`evenodd`,stroke:`none`,"pointer-events":`fill`,onMouseover:t=>sr(e.rectIndex),onMouseleave:t=>or(e.rectIndex),onClick:t=>ar(e.rectIndex)},null,40,Tt))),128)):(y(!0),m(u,{key:5},x(q.value,(e,t)=>(y(),m(`rect`,{key:`tooltip-trap-${t}`,x:e.x+P.value.spaceBetween/2,y:e.y+P.value.spaceBetween/2,height:An.value,width:kn.value,fill:`transparent`,stroke:`none`,onMouseover:e=>sr(t),onMouseleave:e=>or(t),onClick:e=>ar(t)},null,40,Et))),128)),S(e.$slots,`svg`,{svg:{...B.value,isPrintingImg:C(Cn)||C(wn)||C(Fr),isPrintingSvg:C(Ir)}},void 0,!0)],46,ut)),e.$slots.hint?(y(),m(`div`,Dt,[S(e.$slots,`hint`,Xe(qe({hint:k.value.a11y.translations.keyboardNavigation,isVisible:cn.value})),void 0,!0)])):p(``,!0)]),e.$slots.watermark?(y(),m(`div`,Ot,[S(e.$slots,`watermark`,Xe(qe({isPrinting:C(Cn)||C(wn)||C(Fr)||C(Ir)})),void 0,!0)])):p(``,!0),h(`div`,{id:`legend-bottom-${E.value}`},null,8,kt),nn.value&&(M.value.show||e.$slots.legend)?(y(),f(Ue,{key:6,to:M.value.position===`top`?`#legend-top-${E.value}`:`#legend-bottom-${E.value}`},[h(`div`,{ref_key:`chartLegend`,ref:Xt},[S(e.$slots,`legend`,{legend:X.value},()=>[M.value.show?(y(),f(Re,{key:`legend_${tn.value}`,legendSet:X.value,config:er.value,isCursorPointer:ln.value,onClickMarker:s[0]||=({legend:e})=>Yn(e.uid)},We({item:w(({legend:e})=>[h(`div`,{onClick:t=>e.segregate(),style:v(`opacity:${J.value.includes(e.uid)?.5:1}`)},tt(e.display),13,At)]),legendToggle:w(()=>[X.value.length>2&&M.value.selectAllToggle.show&&!C(dn)?(y(),f(Be,{key:0,backgroundColor:M.value.selectAllToggle.backgroundColor,color:M.value.selectAllToggle.color,fontSize:M.value.fontSize,checked:J.value.length>0,isCursorPointer:ln.value,onToggle:Jn},null,8,[`backgroundColor`,`color`,`fontSize`,`checked`,`isCursorPointer`])):p(``,!0)]),_:2},[e.$slots.pattern?{name:`legend-pattern`,fn:w(({legend:e,index:t})=>[Ke(Fe,{shape:e.shape,radius:30,stroke:`none`,plot:{x:30,y:30},fill:`url(#pattern_${E.value}_${t})`},null,8,[`shape`,`fill`])]),key:`0`}:void 0]),1032,[`legendSet`,`config`,`isCursorPointer`])):p(``,!0)],!0)],512)],8,[`to`])):p(``,!0),e.$slots.source?(y(),m(`div`,{key:7,ref_key:`source`,ref:Zt,dir:`auto`},[S(e.$slots,`source`,{},void 0,!0)],512)):p(``,!0),Ke(C(Nt),{teleportTo:j.value.teleportTo,show:z.value.showTooltip&&Gt.value&&J.value.length<T.dataset.length,backgroundColor:j.value.backgroundColor,color:j.value.color,borderRadius:j.value.borderRadius,borderColor:j.value.borderColor,borderWidth:j.value.borderWidth,backgroundOpacity:j.value.backgroundOpacity,position:j.value.position,offsetX:j.value.offsetX,offsetY:j.value.offsetY,parent:Jt.value,content:Kt.value,isCustom:j.value.customFormat&&typeof j.value.customFormat==`function`,fontSize:j.value.fontSize,isFullscreen:Cr.value,smooth:j.value.smooth,backdropFilter:j.value.backdropFilter,smoothForce:j.value.smoothForce,smoothSnapThreshold:j.value.smoothSnapThreshold,isA11yMode:sn.value===`keyboard`,a11yPosition:on.value},{"tooltip-before":w(()=>[S(e.$slots,`tooltip-before`,Xe(qe({...tr.value})),void 0,!0)]),tooltip:w(()=>[S(e.$slots,`tooltip`,Xe(qe({...tr.value})),void 0,!0)]),"tooltip-after":w(()=>[S(e.$slots,`tooltip-after`,Xe(qe({...tr.value})),void 0,!0)]),_:3},8,[`teleportTo`,`show`,`backgroundColor`,`color`,`borderRadius`,`borderColor`,`borderWidth`,`backgroundOpacity`,`position`,`offsetX`,`offsetY`,`parent`,`content`,`isCustom`,`fontSize`,`isFullscreen`,`smooth`,`backdropFilter`,`smoothForce`,`smoothSnapThreshold`,`isA11yMode`,`a11yPosition`]),Wt.value&&A.value.buttons.table?(y(),f($e(Ar.value.component),Je({key:8},Ar.value.props,{ref_key:`tableUnit`,ref:rn,onClose:jr}),We({content:w(()=>[(y(),f(C(Ft),{key:`table_${en.value}`,colNames:Sr.value.colNames,head:Sr.value.head,body:Sr.value.body,config:Sr.value.config,title:k.value.table.useDialog?``:Ar.value.title,withCloseButton:!k.value.table.useDialog,isCursorPointer:ln.value,onClose:jr},{th:w(({th:e})=>[e===`__SUM__`?(y(),m(`div`,jt,[Ke(C(Pt),{name:`sigma`,stroke:Sr.value.config.th.color,size:16},null,8,[`stroke`])])):(y(),m(`div`,Mt,tt(e),1))]),td:w(({td:e})=>[Ge(tt(e.name||e),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[k.value.table.useDialog?{name:`title`,fn:w(()=>[Ge(tt(Ar.value.title),1)]),key:`0`}:void 0,k.value.table.useDialog?{name:`actions`,fn:w(()=>[h(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:s[1]||=e=>xr(A.value.callbacks.csv),style:v({cursor:ln.value?`pointer`:`default`})},[Ke(C(Pt),{name:`fileCsv`,stroke:Ar.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):p(``,!0),S(e.$slots,`skeleton`,{},()=>[C(dn)?(y(),f(Ee,{key:0})):p(``,!0)],!0)],46,ot))}},[[`__scopeId`,`data-v-002c14ec`]]);export{at as n,Nt as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./userOptionsSlots-CWtXN5Q6.js";import{n as i,r as a,t as o}from"./annotationSlots-OLiW25XN.js";import{t as s}from"./chartImage-DPGnEuYM.js";import{t as c}from"./resolveChartConfig-0IvbmIE_.js";import{$ as l,Ft as u,It as d,X as f,Yt as p,at as m,b as h,i as g,in as _,t as v,zt as y}from"./lib-rPeBMZrn.js";import{c as b}from"./canvas-lib-22VpOI4_.js";import{n as x,t as ee}from"./useHints-C-TwxM0Y.js";import{t as te}from"./useConfig-_JwRfIqE.js";import{n as S,t as ne}from"./BaseScanner-8NdoBs7B.js";import{t as re}from"./usePrinter-DVf3YcG5.js";import{t as ie}from"./useResponsive-CENUxfEL.js";import{t as ae}from"./useChartExport-BZts4KFb.js";import{t as oe}from"./useUserOptionState-CXlFnwPv.js";import{t as se}from"./useChartAccessibility-DOMuYJfm.js";import{t as ce}from"./usePrefersMotion-XLHwega2.js";import{n as le}from"./Title-BliHuXfT.js";import{t as ue}from"./vue_ui_wheel-bdYAONK7.js";import{t as de}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as C,computed as w,createBlock as T,createCommentVNode as E,createElementBlock as D,createElementVNode as fe,createSlots as pe,createVNode as me,defineAsyncComponent as he,guardReactiveProps as ge,mergeProps as _e,normalizeClass as O,normalizeProps as ve,normalizeStyle as ye,onBeforeUnmount as be,onMounted as xe,openBlock as k,ref as A,renderList as j,renderSlot as M,shallowRef as Se,toDisplayString as Ce,toRefs as we,unref as N,useCssVars as Te,watch as Ee,withCtx as De}from"vue";var Oe=/* @__PURE__ */ e({default:()=>Ye}),ke=[`id`],Ae=[`xmlns`,`viewBox`,`aria-labelledby`,`aria-describedby`],je=[`id`],Me=[`id`],Ne=[`x`,`y`,`width`,`height`],Pe=[`d`,`stroke`,`stroke-width`],Fe=[`cx`,`cy`,`r`,`stroke`,`stroke-width`],Ie={key:0},Le=[`x1`,`y1`,`x2`,`y2`,`stroke`,`stroke-width`,`stroke-linecap`],Re=[`x1`,`y1`,`x2`,`y2`,`stroke`,`stroke-width`,`stroke-linecap`],ze={key:1},Be=[`d`,`fill`,`stroke`,`stroke-width`],Ve=[`d`,`fill`,`stroke`,`stroke-width`],He=[`d`,`fill`,`stroke`,`stroke-width`],Ue=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-linecap`],We=[`d`,`fill`,`stroke`,`stroke-width`],Ge=[`aria-label`],Ke=[`x`,`y`,`height`],qe=[`x`,`y`,`font-size`,`fill`,`font-weight`,`stroke`,`stroke-width`],Je={key:4,class:`vue-data-ui-watermark`},Ye=/*#__PURE__*/ de({__name:`vue-ui-wheel`,props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:[`copyAlt`],setup(e,{expose:de,emit:Oe}){Te(e=>({b5c7a3a6:Ht.value,v8a2df25a:Ut.value,v8a2e2d34:Wt.value}));let Ye=he(()=>import(`./PenAndPaper-BV5ODysA.js`).then(e=>e.t)),Xe=he(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),Ze=he(()=>import(`./PackageVersion-ksOit8fp.js`).then(e=>e.t)),{vue_ui_wheel:Qe}=te(),P=ce(),F=e,$e=Oe,et=w(()=>!!F.dataset&&Object.keys(F.dataset).length),I=A(f()),tt=A(null),nt=A(0),L=A(null),rt=A(null),it=A(null),at=A(null),ot=A(0),R=A(mt()),z=w(()=>R.value.userOptions),B=w(()=>R.value.style.chart.layout.wheel.ticks),V=w(()=>R.value.style.chart.layout.wheel),H=w(()=>R.value.style.chart);x({config:()=>R.value,dataset:()=>F.dataset,component:`VueUiWheel`,rules:[ee.noHint]});let st=w(()=>R.value.userOptions.useCursorPointer),ct=w(()=>_({defaultConfig:{userOptions:{show:!1},style:{chart:{backgroundColor:`#99999930`,animation:{use:!1},layout:{wheel:{ticks:{activeColor:`#6A6A6A80`,inactiveColor:`#CACACA80`}},innerCircle:{stroke:`#CACACA80`}}}}},userConfig:R.value.skeletonConfig??{}})),{loading:lt,FINAL_DATASET:U}=S({...we(F),FINAL_CONFIG:R,prepareConfig:mt,skeletonDataset:F.config?.skeletonDataset??{percentage:50},skeletonConfig:_({defaultConfig:R.value,userConfig:ct.value})}),{userOptionsVisible:ut,setUserOptionsVisibility:dt,keepUserOptionState:ft}=oe({config:R.value}),{svgRef:pt}=se({config:H.value.title});function mt(){return c(F.config,Qe,ue)}Ee(()=>F.config,e=>{R.value=mt(),ut.value=!R.value.userOptions.showOnChartHover,St(),ot.value+=1},{deep:!0});let{isPrinting:ht,isImaging:gt,generatePdf:_t,generateImage:vt}=re({elementId:I.value,fileName:H.value.title.text||`vue-ui-wheel`,options:R.value.userOptions.print}),yt=w(()=>R.value.userOptions.show&&!H.value.title.text),W=A({size:360,height:360,width:360}),G=A(H.value.layout.percentage.fontSize),K=w(()=>({radius:Math.min(W.value.width,W.value.height)*.9/2*V.value.radiusRatio,centerX:W.value.width/2,centerY:W.value.height/2}));function bt(e,t=1){let n=29.85;return{x:K.value.centerX+K.value.radius*Math.cos(n+e*Math.PI/180)*t,y:K.value.centerY+K.value.radius*Math.sin(n+e*Math.PI/180)*t}}let q=A(H.value.animation.use&&!P.value?0:U.value.percentage||0);Ee(()=>U.value,e=>{H.value.animation.use&&!P.value?Pt(e.percentage):q.value=e.percentage||0},{deep:!0});let J=Se(null),Y=Se(null);xe(()=>{St()});let xt=w(()=>R.value.debug);function St(){if(y(F.dataset)&&m({componentName:`VueUiWheel`,type:`dataset`,debug:xt.value}),R.value.responsive){let e=b(()=>{let{width:e,height:t}=ie({chart:L.value,title:H.value.title.text?rt.value:null,source:it.value,noTitle:at.value});requestAnimationFrame(()=>{W.value.width=e,W.value.height=t,G.value=H.value.layout.percentage.fontSize/360*Math.min(e,t)})});J.value&&(Y.value&&J.value.unobserve(Y.value),J.value.disconnect()),J.value=new ResizeObserver(e),Y.value=L.value.parentNode,J.value.observe(Y.value)}Pt(U.value.percentage||0),H.value.animation.use&&!P.value||(q.value=U.value.percentage||0)}be(()=>{J.value&&(Y.value&&J.value.unobserve(Y.value),J.value.disconnect())});function Ct([e,t,n],r){let i=Math.cos(r),a=Math.sin(r);return[e,t*i-n*a,t*a+n*i]}function wt([e,t,n],r){let i=r/(r-n);return[e*i,t*i,n,i]}function Tt(e,t){let n=e.replace(`#`,``),r=parseInt(n.substring(0,2),16),i=parseInt(n.substring(2,4),16),a=parseInt(n.substring(4,6),16),o=1-Math.min(1,Math.max(0,B.value.shadeColorRatio3d))*t,s=Math.max(0,Math.min(255,Math.round(r*o))),c=Math.max(0,Math.min(255,Math.round(i*o))),l=Math.max(0,Math.min(255,Math.round(a*o)));return`#${s.toString(16).padStart(2,`0`)}${c.toString(16).padStart(2,`0`)}${l.toString(16).padStart(2,`0`)}`}function Et({cx:e,cy:t,radius:n,innerRatio:r=.8,count:i=120,startDeg:a=0,axDeg:o=50,f:s=520,baseStroke:c=5,activeColor:l,inactiveColor:u,getActive:d}){let f=o*Math.PI/180,m=n,h=n*r,g=[];for(let n=0;n<i;n+=1){let r=(n/i*360+a)*Math.PI/180,o=e+m*Math.cos(r),_=t+m*Math.sin(r),v=e+h*Math.cos(r),y=t+h*Math.sin(r),b=[o-e,_-t,0],x=[v-e,y-t,0],[ee,te,S]=Ct(b,f),[ne,re,ie]=Ct(x,f),[ae,oe,,se]=wt([ee,te,S],s),[ce,le,,ue]=wt([ne,re,ie],s),de=e+ae,C=t+oe,w=e+ce,T=t+le,E=(Math.max(S,ie)- -m*Math.sin(f))/(2*m*Math.sin(f)||1),D=!d||d(n),fe=B.value.gradient.show?p(l,n*Q.value/Z.value*(B.value.gradient.shiftHueIntensity/100)):l,pe=Tt(D?fe:u,E),me=Math.max(1.25,c*se*(Math.min(W.value.width,W.value.height)/360));g.push({i:n,x1:de,y1:C,x2:w,y2:T,stroke:me,color:pe,z:Math.max(S,ie)})}return g.sort((e,t)=>e.z-t.z),g}let Dt=w(()=>{if(!R.value.layout===`3d`)return null;let e=Z.value,t=B.value.gradient.show?p(B.value.activeColor,0):B.value.activeColor,n=B.value.inactiveColor,r=B.value.strokeWidth;return Et({cx:K.value.centerX,cy:K.value.centerY,radius:K.value.radius,innerRatio:B.value.sizeRatio,count:e,startDeg:-90,axDeg:V.value.tiltAngle3d,f:Math.min(W.value.width,W.value.height)*1.45,baseStroke:r,activeColor:t,inactiveColor:n,getActive:e=>q.value>e*Q.value})});function Ot({cx:e,cy:t,r:n,count:r=180,startDeg:i=-90,axDeg:a=50,f:o}){let s=a*Math.PI/180,c=[],l=0;for(let a=0;a<r;a+=1){let u=(a/r*360+i)*Math.PI/180,[d,f,p]=Ct([n*Math.cos(u),n*Math.sin(u),0],s),[m,h,,g]=wt([d,f,p],o);l+=g,c.push([e+m,t+h])}let u=`M ${c[0][0]} ${c[0][1]}`;for(let e=1;e<c.length;e+=1)u+=` L ${c[e][0]} ${c[e][1]}`;u+=` Z`;let d=l/r;return{d:u,avgScale:d,pts:c}}let X=w(()=>{if(R.value.layout!==`3d`)return null;let e=Math.min(W.value.width,W.value.height)*1.45,t=V.value.tiltAngle3d,n=K.value.radius,{pts:r,avgScale:i}=(()=>{let r=n,i=t,{d:a,avgScale:o,pts:s}=Ot({cx:K.value.centerX,cy:K.value.centerY,r,startDeg:-90,axDeg:i,f:e});return{pts:s,avgScale:o}})(),a=1/0,o=1/0,s=-1/0,c=-1/0;for(let[e,t]of r)e<a&&(a=e),t<o&&(o=t),e>s&&(s=e),t>c&&(c=t);let l=B.value.strokeWidth/360*Math.min(W.value.width,W.value.height),u=H.value.layout.innerCircle.strokeWidth||0,d=.5*Math.max(l,u*(i||1)),f=Math.max(0,Number(B.value.depth3d)||0),p=d;return{x:a-p,y:o-f-p,w:s-a+2*p,h:c-(o-f)+2*p}});function kt(e){let t=Math.min(W.value.width,W.value.height)*1.45,{d:n,avgScale:r}=Ot({cx:K.value.centerX,cy:K.value.centerY,r:e,startDeg:-90,axDeg:V.value.tiltAngle3d,f:t}),i=(H.value.layout.innerCircle.strokeWidth||1)*r;return{d:n,stroke:H.value.layout.innerCircle.stroke,strokeWidth:i}}let At=w(()=>kt(Math.max(0,K.value.radius*.8*H.value.layout.innerCircle.radiusRatio)));function jt({cx:e,cy:t,r:n,aRad:r,ax:i,f:a}){let[o,s,c]=Ct([n*Math.cos(r),n*Math.sin(r),0],i),[l,u,,d]=wt([o,s,c],a);return{x:e+l,y:t+u,z:c,s:d}}function Mt({cx:e,cy:t,radius:n,innerRatio:r=.8,count:i=120,startDeg:a=-87,axDeg:o=45,f:s=600,activeColor:c,inactiveColor:l,getActive:u,Y:d=0}){let f=o*Math.PI/180,m=n,h=n*r,g=2*Math.PI/i,_=[];for(let n=0;n<i;n+=1){let r=a*Math.PI/180+g*n,o=r+g*Math.min(1,B.value.spacingRatio3d),v=jt({cx:e,cy:t+d,r:m,aRad:r,ax:f,f:s}),y=jt({cx:e,cy:t+d,r:m,aRad:o,ax:f,f:s}),b=jt({cx:e,cy:t+d,r:h,aRad:o,ax:f,f:s}),x=jt({cx:e,cy:t+d,r:h,aRad:r,ax:f,f:s}),ee=(v.z+y.z+x.z+b.z)/4,te=Tt(!u||u(n)?B.value.gradient.show?p(B.value.activeColor,100/i*n/100*(B.value.gradient.shiftHueIntensity/100)):c:l,(()=>{let e=m*Math.sin(f)||1;return(ee- -e)/(2*e)})()),S=`M ${v.x} ${v.y} L ${y.x} ${y.y} L ${b.x} ${b.y} L ${x.x} ${x.y} Z`;_.push({i:n,d:S,fill:te,z:ee})}return _.sort((e,t)=>e.z-t.z),_}let Nt=w(()=>{if(R.value.layout!==`3d`)return null;let e=Z.value;return t=>Mt({cx:K.value.centerX,cy:K.value.centerY,radius:K.value.radius,innerRatio:B.value.sizeRatio,count:e,startDeg:-90,axDeg:V.value.tiltAngle3d,f:Math.min(W.value.width,W.value.height)*1.45,activeColor:B.value.activeColor,inactiveColor:B.value.inactiveColor,getActive:t=>q.value>100/e*t,Y:t})});function Pt(e){let t=H.value.animation.speed,n=Math.abs(e-q.value)/(t*120);function r(){q.value<e?q.value=Math.min(q.value+n,e):q.value>e&&(q.value=Math.max(q.value-n,e)),q.value!==e&&requestAnimationFrame(r)}r()}let Z=w(()=>(xt.value&&B.value.quantity<12&&console.warn(`VueUiWheel - The min number of ticks is 12`),xt.value&&B.value.quantity>200&&console.warn(`VueUiWheel - The max number of ticks is 200`),Math.max(12,Math.min(B.value.quantity,200)))),Q=w(()=>100/Z.value),Ft=w(()=>{let e=[];for(let t=0;t<Z.value;t+=1){let n=q.value>t*Q.value?B.value.activeColor:B.value.inactiveColor,{x:r,y:i}=bt(W.value.size/Z.value*t),{x:a,y:o}=bt(W.value.size/Z.value*t,B.value.sizeRatio);e.push({x1:r,y1:i,x2:a,y2:o,color:B.value.gradient.show?p(n,t*Q.value/Z.value*(B.value.gradient.shiftHueIntensity/100)):n})}return e}),It=w(()=>d({series:Ft.value.map(e=>({name:``,value:1,color:e.color}))},K.value.centerX,K.value.centerY,K.value.radius,K.value.radius,1.99999,2,1,360,105.25,K.value.radius*(1-B.value.sizeRatio))),Lt=A(!1);function Rt(e){Lt.value=e,nt.value+=1}let zt=A(!1);function Bt(){zt.value=!zt.value}let Vt=s(L,()=>H.value.title.text),Ht=w(()=>B.value.strokeWidth*2),Ut=w(()=>B.value.strokeWidth*2*.75),Wt=w(()=>B.value.strokeWidth),$=w(()=>Math.max(1,Math.min(20,B.value.depth3d))),Gt=w(()=>H.value.backgroundColor),Kt=w(()=>H.value.title),{isCallbackImaging:qt,isCallbackSvg:Jt,generateSvg:Yt,onGenerateImage:Xt}=ae({svg:pt,title:Kt,legend:null,legendItems:null,backgroundColor:Gt,stretchTitle:!0,getSvgCallback:()=>R.value.userOptions.callbacks.svg,generateImage:vt});async function Zt(){$e(`copyAlt`,{config:R.value,dataset:U.value}),R.value.userOptions.callbacks.altCopy?await Promise.resolve(R.value.userOptions.callbacks.altCopy({config:R.value,dataset:U.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}let Qt=w(()=>`${I.value}-title`),$t=w(()=>`${I.value}-desc`),en=w(()=>g(H.value.layout.percentage.formatter,h(q.value),l({v:h(q.value),s:`%`,r:H.value.layout.percentage.rounding}))),tn=w(()=>H.value.title.text||``),nn=w(()=>lt.value?`...`:`${en.value}`);return de({getImage:Vt,generatePdf:_t,generateImage:vt,generateSvg:Yt,toggleAnnotator:Bt,toggleFullscreen:Rt,copyAlt:Zt}),(e,s)=>(k(),D(`div`,{class:O([`vue-ui-wheel`,{"vue-data-ui-component":!0,"vue-ui-wheel-3d-wrap":R.value.layout===`3d`}]),ref_key:`wheelChart`,ref:L,id:I.value,style:ye(`font-family:${R.value.style.fontFamily};width:100%; text-align:center;background:${H.value.backgroundColor};${R.value.responsive?`height:100%`:``}`),onMouseenter:s[0]||=()=>N(dt)(!0),onMouseleave:s[1]||=()=>N(dt)(!1)},[z.value.buttons.annotator?(k(),T(N(Ye),_e({key:0},N(a)(z.value.annotator),{svgRef:N(pt),backgroundColor:H.value.backgroundColor,color:H.value.color,active:zt.value,isCursorPointer:st.value,palette:z.value.annotatorPalette,onClose:Bt}),pe({_:2},[j(N(o),t=>({name:t,fn:De(n=>[M(e.$slots,t,ve(ge(N(i)(t,n))),void 0,!0)])}))]),1040,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):E(``,!0),yt.value?(k(),D(`div`,{key:1,ref_key:`noTitle`,ref:at,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):E(``,!0),H.value.title.text?(k(),D(`div`,{key:2,ref_key:`chartTitle`,ref:rt,style:`width:100%;background:transparent;padding-bottom:12px`},[(k(),T(le,{key:`title_${ot.value}`,config:{title:{cy:`wheel-title`,...H.value.title},subtitle:{cy:`wheel-subtitle`,...H.value.title.subtitle}}},null,8,[`config`]))],512)):E(``,!0),z.value.show&&et.value&&(N(ft)||N(ut))?(k(),T(N(Xe),_e({ref_key:`details`,ref:tt,key:`user_options_${nt.value}`,backgroundColor:H.value.backgroundColor,color:H.value.color,isPrinting:N(ht),isImaging:N(gt),uid:I.value,hasXls:!1,isFullscreen:Lt.value},N(n)(z.value,`pdf img svg fullscreen altCopy annotator`),{isAnnotation:zt.value,chartElement:L.value,isCursorPointer:st.value,onToggleFullscreen:Rt,onGeneratePdf:N(_t),onGenerateImage:N(Xt),onGenerateSvg:N(Yt),onToggleAnnotator:Bt,onCopyAlt:Zt,style:{visibility:N(ft)?N(ut)?`visible`:`hidden`:`visible`}}),pe({_:2},[j(N(t)(e.$slots,`menuIcon optionPdf optionImg optionSvg optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:De(n=>[M(e.$slots,t,ve(ge(N(r)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`isFullscreen`,`isAnnotation`,`chartElement`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):E(``,!0),(k(),D(`svg`,{ref_key:`svgRef`,ref:pt,xmlns:N(v),class:O({"vue-data-ui-fullscreen--on":Lt.value,"vue-data-ui-fulscreen--off":!Lt.value,"vue-ui-wheel-3d-svg":R.value.layout===`3d`}),viewBox:R.value.layout===`3d`&&!R.value.responsive?`${X.value?.x-10} ${X.value?.y??0} ${X.value?.w+20??Math.max(10,W.value.width)} ${X.value?.h??Math.max(10,W.value.height)}`:`0 0 ${Math.max(10,W.value.width)} ${Math.max(10,W.value.height)}`,style:ye(`max-width:100%;overflow:visible;background:transparent;color:${H.value.color}`),role:`img`,"aria-labelledby":Qt.value,"aria-describedby":$t.value},[fe(`title`,{id:Qt.value},Ce(tn.value),9,je),fe(`desc`,{id:$t.value},Ce(nn.value),9,Me),me(N(Ze)),M(e.$slots,`svg-underlayer`,{svg:{...W.value,isPrintingImg:N(ht)||N(gt)||N(qt),isPrintingSvg:N(Jt)}},void 0,!0),e.$slots[`chart-background`]?(k(),D(`foreignObject`,{key:0,x:R.value.layout===`3d`&&!R.value.responsive?X.value?.x-10:0,y:R.value.layout===`3d`&&!R.value.responsive?X.value?.y??0:0,width:R.value.layout===`3d`&&!R.value.responsive?X.value?.w+20??Math.max(10,W.value.width):Math.max(10,W.value.width),height:R.value.layout===`3d`&&!R.value.responsive?X.value?.h??Math.max(10,W.value.height):Math.max(10,W.value.height),style:{pointerEvents:`none`}},[M(e.$slots,`chart-background`,{},void 0,!0)],8,Ne)):E(``,!0),R.value.layout===`3d`&&At.value?(k(),D(`path`,{key:1,class:`vue-ui-wheel-inner-circle`,d:At.value.d,stroke:H.value.layout.innerCircle.stroke,"stroke-width":H.value.layout.innerCircle.strokeWidth,fill:`none`},null,8,Pe)):H.value.layout.innerCircle.show?(k(),D(`circle`,{key:2,class:`vue-ui-wheel-inner-circle`,cx:K.value.centerX,cy:K.value.centerY,r:Math.max(0,K.value.radius*H.value.layout.innerCircle.radiusRatio*.8),stroke:H.value.layout.innerCircle.stroke,"stroke-width":H.value.layout.innerCircle.strokeWidth,fill:`none`},null,8,Fe)):E(``,!0),R.value.layout===`3d`?(k(),D(C,{key:3},[B.value.type===`classic`?(k(),D(`g`,Ie,[(k(!0),D(C,null,j($.value,e=>(k(),D(`g`,null,[(k(!0),D(C,null,j(Dt.value||[],t=>(k(),D(`line`,{key:t.i,x1:t.x1,y1:t.y1-e,x2:t.x2,y2:t.y2-e,stroke:N(u)(t.color,.25*e/5),"stroke-width":B.value.strokeWidth/360*Math.min(W.value.width,W.value.height),"stroke-linecap":B.value.rounded?`round`:`butt`,class:O({"vue-ui-wheel-tick":!0,"vue-ui-tick-animated":H.value.animation.use&&!N(P)&&t.i*Q.value<=q.value})},null,10,Le))),128))]))),256)),(k(!0),D(C,null,j(Dt.value||[],e=>(k(),D(`line`,{key:e.i,x1:e.x1,y1:e.y1-$.value,x2:e.x2,y2:e.y2-$.value,stroke:e.color,"stroke-width":B.value.strokeWidth/360*Math.min(W.value.width,W.value.height),"stroke-linecap":B.value.rounded?`round`:`butt`,class:O({"vue-ui-wheel-tick":!0,"vue-ui-tick-animated":H.value.animation.use&&!N(P)&&e.i*Q.value<=q.value})},null,10,Re))),128))])):(k(),D(`g`,ze,[(k(!0),D(C,null,j($.value,e=>(k(),D(`g`,null,[(k(!0),D(C,null,j(Nt.value(-e)||[],e=>(k(),D(`path`,{key:e.i,d:e.d,fill:B.value.inactiveColor,stroke:B.value.stroke,"stroke-width":B.value.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:`vue-ui-wheel-tick`},null,8,Be))),128)),(k(!0),D(C,null,j(Nt.value(-e)||[],t=>(k(),D(`path`,{key:t.i,d:t.d,fill:N(u)(t.fill,.5*e/$.value),stroke:B.value.stroke,"stroke-width":B.value.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:O({"vue-ui-wheel-tick":!0,"vue-ui-tick-animated-3d":H.value.animation.use&&!N(P)&&t.i*Q.value<=q.value})},null,10,Ve))),128))]))),256)),fe(`g`,null,[(k(!0),D(C,null,j(Nt.value(-$.value)||[],e=>(k(),D(`path`,{key:e.i,d:e.d,fill:e.fill,stroke:B.value.stroke,"stroke-width":B.value.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:O({"vue-ui-wheel-tick":!0,"vue-ui-tick-animated-3d":H.value.animation.use&&!N(P)&&e.i*Q.value<=q.value})},null,10,He))),128))])]))],64)):(k(),D(C,{key:4},[B.value.type===`classic`?(k(!0),D(C,{key:0},j(Ft.value,(e,t)=>(k(),D(`line`,{x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2,stroke:e.color,"stroke-width":B.value.strokeWidth/360*Math.min(W.value.width,W.value.height),"stroke-linecap":B.value.rounded?`round`:`butt`,class:O({"vue-ui-wheel-tick":!0,"vue-ui-tick-animated":H.value.animation.use&&!N(P)&&t*Q.value<=q.value})},null,10,Ue))),256)):(k(!0),D(C,{key:1},j(It.value,(e,t)=>(k(),D(`path`,{d:e.arcSlice,fill:e.color,class:O({"vue-ui-wheel-tick":!0,"vue-ui-tick-animated":H.value.animation.use&&!N(P)&&t*Q.value<=q.value}),stroke:B.value.stroke,"stroke-width":B.value.strokeWidth},null,10,We))),256))],64)),H.value.layout.percentage.show?(k(),D(`g`,{key:5,role:`status`,"aria-live":`polite`,"aria-label":N(lt)?`...`:en.value},[N(lt)?(k(),D(`rect`,{key:0,x:K.value.centerX-40,y:K.value.centerY-G.value/2,width:80,height:G.value,fill:`#6A6A6A80`,rx:`3`},null,8,Ke)):(k(),D(`text`,{key:1,"aria-hidden":`true`,x:K.value.centerX+H.value.layout.percentage.offsetX,y:K.value.centerY+G.value/3+H.value.layout.percentage.offsetY,"font-size":G.value,fill:B.value.gradient.show?N(p)(B.value.activeColor,q.value/100*(B.value.gradient.shiftHueIntensity/100)):B.value.activeColor,"text-anchor":`middle`,"font-weight":H.value.layout.percentage.bold?`bold`:`normal`,style:{"font-variant-numeric":`tabluar-nums`},stroke:H.value.layout.percentage.stroke,"stroke-width":H.value.layout.percentage.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,"paint-order":`stroke fill`,class:O({"vue-ui-wheel-label":R.value.layout===`3d`})},Ce(en.value),11,qe))],8,Ge)):E(``,!0),M(e.$slots,`svg`,{svg:{...W.value,isPrintingImg:N(ht)||N(gt)||N(qt),isPrintingSvg:N(Jt)}},void 0,!0)],14,Ae)),e.$slots.watermark?(k(),D(`div`,Je,[M(e.$slots,`watermark`,ve(ge({isPrinting:N(ht)||N(gt)||N(qt)||N(Jt)})),void 0,!0)])):E(``,!0),e.$slots.source?(k(),D(`div`,{key:5,ref_key:`source`,ref:it,dir:`auto`},[M(e.$slots,`source`,{},void 0,!0)],512)):E(``,!0),M(e.$slots,`skeleton`,{},()=>[N(lt)?(k(),T(ne,{key:0})):E(``,!0)],!0)],46,ke))}},[[`__scopeId`,`data-v-c61f36b5`]]);export{Oe as n,Ye as t};
|