vue-data-ui 2.4.44 → 2.4.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Arrow-DabU4Tq7.js → Arrow-DExBMFtJ.js} +1 -1
- package/dist/{Arrow-D7FfpPjv.cjs → Arrow-dxEccWUa.cjs} +1 -1
- package/dist/{BaseIcon-vmPfwVXS.cjs → BaseIcon-DUokibJ1.cjs} +1 -1
- package/dist/{BaseIcon-DgOZGFA6.js → BaseIcon-DpLJi6ci.js} +1 -1
- package/dist/{DataTable-ByILXTgq.js → DataTable-NGi-FgLM.js} +2 -2
- package/dist/{DataTable-WzoXT7XP.cjs → DataTable-aoauqoko.cjs} +1 -1
- package/dist/{Legend-eRHr8IFu.cjs → Legend-DHE2CFkm.cjs} +1 -1
- package/dist/{Legend-CJAbBncx.js → Legend-DRozxv9L.js} +1 -1
- package/dist/{PackageVersion-DylCZJMA.cjs → PackageVersion-1JWV5loe.cjs} +1 -1
- package/dist/{PackageVersion-2fR7Awu1.js → PackageVersion-CTMY4zeY.js} +1 -1
- package/dist/{PenAndPaper-2aIJsXNH.cjs → PenAndPaper-C6mnwE-L.cjs} +1 -1
- package/dist/{PenAndPaper-wVL9QD9U.js → PenAndPaper-DJ_d10S-.js} +3 -3
- package/dist/{Shape-JMJZs7By.js → Shape-C-sY_hlc.js} +1 -1
- package/dist/{Shape-nGoGILeB.cjs → Shape-rA2az7tR.cjs} +1 -1
- package/dist/{Slicer-BLuFaL8r.cjs → Slicer-CJsmloDN.cjs} +1 -1
- package/dist/{Slicer-Ce0VzdTY.js → Slicer-D4SO7odF.js} +2 -2
- package/dist/{Title-Dj5wajqV.js → Title-Coit3NcT.js} +1 -1
- package/dist/{Title-CtfsoH8U.cjs → Title-DkbnpMvf.cjs} +1 -1
- package/dist/{Tooltip-6D9aABEX.cjs → Tooltip-B8L4NDsX.cjs} +1 -1
- package/dist/{Tooltip-Zrcwpy3T.js → Tooltip-BBgfUr4a.js} +1 -1
- package/dist/{index-D3_dyp9t.js → index-Cm2_6s9o.js} +119 -109
- package/dist/index-DuDeHJyK.cjs +9 -0
- package/dist/style.css +1 -1
- package/dist/types/vue-data-ui.d.cts +10 -0
- package/dist/types/vue-data-ui.d.ts +10 -0
- package/dist/{useNestedProp-qwG6HgrL.js → useNestedProp-BYPZJNhi.js} +1 -1
- package/dist/{useNestedProp-C8Y0yWDq.cjs → useNestedProp-zkJOoemW.cjs} +1 -1
- package/dist/{usePrinter-41NUZdgl.js → usePrinter-Cx8U1e30.js} +1 -1
- package/dist/{usePrinter-Cw4E_LYe.cjs → usePrinter-ardO_DNo.cjs} +1 -1
- package/dist/{vue-data-ui-DPujYnT2.cjs → vue-data-ui-B8Lvjc4V.cjs} +1 -1
- package/dist/{vue-data-ui-CKlgRX2w.js → vue-data-ui-Blpxr4_M.js} +60 -60
- package/dist/vue-data-ui.cjs +1 -1
- package/dist/vue-data-ui.js +1 -1
- package/dist/{vue-ui-3d-bar-CURLeBAg.cjs → vue-ui-3d-bar-CqmOoIA2.cjs} +1 -1
- package/dist/{vue-ui-3d-bar-DFqYSjKF.js → vue-ui-3d-bar-DvitE1K_.js} +9 -9
- package/dist/{vue-ui-accordion-DbKFz7vP.js → vue-ui-accordion-CxrNF8BI.js} +3 -3
- package/dist/{vue-ui-accordion-zOz2K8wY.cjs → vue-ui-accordion-JS5d0ZPi.cjs} +1 -1
- package/dist/{vue-ui-age-pyramid-BzwQxubx.cjs → vue-ui-age-pyramid-CRP36JDm.cjs} +1 -1
- package/dist/{vue-ui-age-pyramid-DVjZHG-c.js → vue-ui-age-pyramid-Ti2L5N92.js} +10 -10
- package/dist/{vue-ui-annotator-CU8bDkP0.cjs → vue-ui-annotator-DtL3BbOJ.cjs} +1 -1
- package/dist/{vue-ui-annotator-ZDqHg-kV.js → vue-ui-annotator-HNK_5tWo.js} +1 -1
- package/dist/{vue-ui-bullet-BaQJ3acV.js → vue-ui-bullet-D3WmBrm4.js} +8 -8
- package/dist/{vue-ui-bullet-Dt0Ki37L.cjs → vue-ui-bullet-DEUwbTdx.cjs} +1 -1
- package/dist/{vue-ui-candlestick-C5Pzu7U1.js → vue-ui-candlestick-B5okP_Jf.js} +11 -11
- package/dist/{vue-ui-candlestick-CMubhqre.cjs → vue-ui-candlestick-C5bTH9oE.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-CPE1nggj.js → vue-ui-carousel-table-BgKL0rnF.js} +4 -4
- package/dist/{vue-ui-carousel-table-CL6njZH4.cjs → vue-ui-carousel-table-Bt2xx2b5.cjs} +1 -1
- package/dist/{vue-ui-chestnut-DHF2jlte.cjs → vue-ui-chestnut-D5XfSvCG.cjs} +1 -1
- package/dist/{vue-ui-chestnut-B7zSDFfA.js → vue-ui-chestnut-DDsFxoUr.js} +8 -8
- package/dist/{vue-ui-cursor-GKguDqwJ.js → vue-ui-cursor-B2NOd5i-.js} +2 -2
- package/dist/{vue-ui-cursor-PG2njvGA.cjs → vue-ui-cursor-CSBJgZLu.cjs} +1 -1
- package/dist/{vue-ui-dashboard-D2w_aK31.cjs → vue-ui-dashboard-C6MJN9kG.cjs} +1 -1
- package/dist/{vue-ui-dashboard-u_haUFHY.js → vue-ui-dashboard-u-Gt08KE.js} +2 -2
- package/dist/{vue-ui-digits-DQetGFnZ.cjs → vue-ui-digits-B4fzfTox.cjs} +1 -1
- package/dist/{vue-ui-digits-DjMZxTuZ.js → vue-ui-digits-DCXyjW_e.js} +2 -2
- package/dist/{vue-ui-donut-CmRH-JB2.js → vue-ui-donut-BvASz63R.js} +11 -11
- package/dist/{vue-ui-donut-DQcISN6U.cjs → vue-ui-donut-CaJSY2gj.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-YntzBUIL.js → vue-ui-donut-evolution-DcPk33e8.js} +11 -11
- package/dist/{vue-ui-donut-evolution-XrPuyr-U.cjs → vue-ui-donut-evolution-DrnLlHPS.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-CCwYiUwP.cjs → vue-ui-dumbbell-8v-xIlsx.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-DmgUkc9m.js → vue-ui-dumbbell-D918XYc8.js} +10 -10
- package/dist/{vue-ui-flow-Ca2cA45D.cjs → vue-ui-flow-BBmnTxVE.cjs} +1 -1
- package/dist/{vue-ui-flow-CZkXzt4D.js → vue-ui-flow-DQ5q2b1Y.js} +9 -9
- package/dist/{vue-ui-funnel-CJAT8_1R.cjs → vue-ui-funnel-CmERxe4h.cjs} +1 -1
- package/dist/{vue-ui-funnel-z2OgL3Q1.js → vue-ui-funnel-v5WCHaw6.js} +8 -8
- package/dist/{vue-ui-galaxy-bgA3s7VZ.cjs → vue-ui-galaxy-8xWYo-xy.cjs} +1 -1
- package/dist/{vue-ui-galaxy-CGhDJ3tA.js → vue-ui-galaxy-COSx0c89.js} +11 -11
- package/dist/vue-ui-gauge-CWnGYcFD.js +610 -0
- package/dist/vue-ui-gauge-CYth7Lci.cjs +1 -0
- package/dist/{vue-ui-gizmo-Bq56LDKo.js → vue-ui-gizmo-ByuFn-0N.js} +3 -3
- package/dist/{vue-ui-gizmo-DBIefin8.cjs → vue-ui-gizmo-DUO_TpvK.cjs} +1 -1
- package/dist/{vue-ui-heatmap-C0NUwPN7.cjs → vue-ui-heatmap-DiON-CAI.cjs} +1 -1
- package/dist/{vue-ui-heatmap-Dbrlismo.js → vue-ui-heatmap-UoKourVZ.js} +10 -10
- package/dist/{vue-ui-history-plot-Cd0Qgkox.cjs → vue-ui-history-plot-CjVySabp.cjs} +1 -1
- package/dist/{vue-ui-history-plot-CMAu0w0K.js → vue-ui-history-plot-CkxvdQeV.js} +11 -11
- package/dist/{vue-ui-kpi-CkRUVNcg.js → vue-ui-kpi-BRwkUBxs.js} +3 -3
- package/dist/{vue-ui-kpi-C1a3ONse.cjs → vue-ui-kpi-DYHGPjrp.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-BVvBbruK.js → vue-ui-mini-loader-Cbl4ydLu.js} +2 -2
- package/dist/{vue-ui-mini-loader-DZ1q-GO6.cjs → vue-ui-mini-loader-oviO8Ueo.cjs} +1 -1
- package/dist/{vue-ui-molecule-C-tmrnHA.cjs → vue-ui-molecule-CX1M509E.cjs} +1 -1
- package/dist/{vue-ui-molecule-DlXNe42L.js → vue-ui-molecule-DM_mX72q.js} +11 -11
- package/dist/{vue-ui-mood-radar-DzHvFqno.js → vue-ui-mood-radar-Bzsba8qo.js} +11 -11
- package/dist/{vue-ui-mood-radar-DYXE1dDD.cjs → vue-ui-mood-radar-fuqAjpvg.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts-DDpYr89I.js → vue-ui-nested-donuts-BG84mskb.js} +11 -11
- package/dist/{vue-ui-nested-donuts-BpcKwKFO.cjs → vue-ui-nested-donuts-DfHtC4XP.cjs} +1 -1
- package/dist/{vue-ui-onion-B9CAGc1E.js → vue-ui-onion-DpFx1Oy9.js} +11 -11
- package/dist/{vue-ui-onion-_WXwSygI.cjs → vue-ui-onion-gt77JCbM.cjs} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-CdvYxx2S.js → vue-ui-parallel-coordinate-plot-CQG_anr7.js} +12 -12
- package/dist/{vue-ui-parallel-coordinate-plot-DL5vZwuT.cjs → vue-ui-parallel-coordinate-plot-xJTddxji.cjs} +1 -1
- package/dist/{vue-ui-quadrant-CILC-e-o.js → vue-ui-quadrant-Cddob9c3.js} +12 -12
- package/dist/{vue-ui-quadrant-ivKVYVXn.cjs → vue-ui-quadrant-D0YgwhwW.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-DW3XlvkG.cjs → vue-ui-quick-chart-CLzNpIFU.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-NIE0zUjt.js → vue-ui-quick-chart-DTEubspa.js} +9 -9
- package/dist/{vue-ui-radar-BonXp2ML.js → vue-ui-radar--uexaa6p.js} +12 -12
- package/dist/{vue-ui-radar-D9WtkmKW.cjs → vue-ui-radar-BTh9qZ2p.cjs} +1 -1
- package/dist/{vue-ui-rating-DblWs0Ay.js → vue-ui-rating-BQuZA9UU.js} +2 -2
- package/dist/{vue-ui-rating-3akEkZ0G.cjs → vue-ui-rating-Dyjk2dub.cjs} +1 -1
- package/dist/{vue-ui-relation-circle-BaPqJcbF.js → vue-ui-relation-circle-C8NYrTHA.js} +7 -7
- package/dist/{vue-ui-relation-circle-Bv5QA1FA.cjs → vue-ui-relation-circle-FtGlV4Ne.cjs} +1 -1
- package/dist/{vue-ui-rings-KRi0yCa1.cjs → vue-ui-rings-ClJRYeFC.cjs} +1 -1
- package/dist/{vue-ui-rings-DHa-dc3s.js → vue-ui-rings-FEIPR_dS.js} +11 -11
- package/dist/{vue-ui-scatter-CKnKyeDJ.js → vue-ui-scatter-CzbgC6ep.js} +12 -12
- package/dist/{vue-ui-scatter-C-0G6tO_.cjs → vue-ui-scatter-vYxSs8Gf.cjs} +1 -1
- package/dist/{vue-ui-screenshot-BIvS3Dva.cjs → vue-ui-screenshot-CVQCw0B1.cjs} +1 -1
- package/dist/{vue-ui-screenshot-BnQlv1n0.js → vue-ui-screenshot-IaxgY5qE.js} +1 -1
- package/dist/{vue-ui-skeleton-CaV7JuCg.js → vue-ui-skeleton-BUS6A44x.js} +3 -3
- package/dist/{vue-ui-skeleton-urNi7er0.cjs → vue-ui-skeleton-DleyAXe1.cjs} +1 -1
- package/dist/{vue-ui-smiley-BkKHZRcE.js → vue-ui-smiley-5CVa-rQU.js} +2 -2
- package/dist/{vue-ui-smiley-BDJWFNUb.cjs → vue-ui-smiley-BTTXNPGY.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-Jrg-tgH_.cjs → vue-ui-spark-trend-CZAgof3m.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-C6B6URVX.js → vue-ui-spark-trend-D9ww-Cv5.js} +5 -5
- package/dist/{vue-ui-sparkbar-CcPXRX01.cjs → vue-ui-sparkbar-BFsdfuNO.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-D7A9EKVi.js → vue-ui-sparkbar-DKeLvkHa.js} +4 -4
- package/dist/{vue-ui-sparkgauge-ZQOdaaF1.cjs → vue-ui-sparkgauge-B_bIpe_O.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-C1kcwrm9.js → vue-ui-sparkgauge-DLpPuJdG.js} +4 -4
- package/dist/{vue-ui-sparkhistogram-DkMaK9FC.js → vue-ui-sparkhistogram-BA8QV7Cu.js} +5 -5
- package/dist/{vue-ui-sparkhistogram-CZQzNQHQ.cjs → vue-ui-sparkhistogram-RoW45LV8.cjs} +1 -1
- package/dist/{vue-ui-sparkline-DuJlR_56.cjs → vue-ui-sparkline-BggHSfaz.cjs} +1 -1
- package/dist/{vue-ui-sparkline-JNv27Q7M.js → vue-ui-sparkline-BwOtPPij.js} +4 -4
- package/dist/{vue-ui-sparkstackbar-4YKk6S2y.js → vue-ui-sparkstackbar-DCS6RRgN.js} +5 -5
- package/dist/{vue-ui-sparkstackbar-BStYMSiJ.cjs → vue-ui-sparkstackbar-Uv_p8v9c.cjs} +1 -1
- package/dist/{vue-ui-stackbar-BKhScZJ4.cjs → vue-ui-stackbar-BqKNaGrf.cjs} +1 -1
- package/dist/{vue-ui-stackbar-BrBToOgd.js → vue-ui-stackbar-zcfxba5s.js} +12 -12
- package/dist/{vue-ui-strip-plot-BSbIVJLB.cjs → vue-ui-strip-plot-J5SSJPyl.cjs} +1 -1
- package/dist/{vue-ui-strip-plot-BB9AjuXc.js → vue-ui-strip-plot-NykStkP9.js} +11 -11
- package/dist/{vue-ui-table-CTwEo09l.cjs → vue-ui-table-DWPKVbYC.cjs} +1 -1
- package/dist/{vue-ui-table-BkfBNufP.js → vue-ui-table-DhRjI7oG.js} +1 -1
- package/dist/{vue-ui-table-heatmap-t6NXIulS.js → vue-ui-table-heatmap-CT5nGoW-.js} +4 -4
- package/dist/{vue-ui-table-heatmap-BRa-idSR.cjs → vue-ui-table-heatmap-GvLTOGcB.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline-CtVdHOeS.js → vue-ui-table-sparkline-Ba_Ucvgb.js} +5 -5
- package/dist/{vue-ui-table-sparkline-LRvAe8DG.cjs → vue-ui-table-sparkline-CBFEknMF.cjs} +1 -1
- package/dist/{vue-ui-thermometer-Dqy_A9Ka.js → vue-ui-thermometer-C11VSZfb.js} +7 -7
- package/dist/{vue-ui-thermometer-Bkj9olK0.cjs → vue-ui-thermometer-sqA0TGTi.cjs} +1 -1
- package/dist/{vue-ui-timer-C2WYUfS1.cjs → vue-ui-timer-CcBNysNG.cjs} +1 -1
- package/dist/{vue-ui-timer-BkWR-FS3.js → vue-ui-timer-lwjayVn0.js} +5 -5
- package/dist/{vue-ui-tiremarks-BXumbUyZ.cjs → vue-ui-tiremarks-FBnh0R_Z.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-Dl881FpL.js → vue-ui-tiremarks-Jz80HKpg.js} +7 -7
- package/dist/{vue-ui-treemap-CvNWsOoE.cjs → vue-ui-treemap-7YFJ-Pb9.cjs} +1 -1
- package/dist/{vue-ui-treemap-Vl47y-4n.js → vue-ui-treemap-B_qVGTnP.js} +11 -11
- package/dist/{vue-ui-vertical-bar-BzkqxE45.js → vue-ui-vertical-bar-5MwcqOTN.js} +11 -11
- package/dist/{vue-ui-vertical-bar-D1EoKlII.cjs → vue-ui-vertical-bar-DGuvFK2h.cjs} +1 -1
- package/dist/{vue-ui-waffle-Bd4Wn4LE.js → vue-ui-waffle-B0JbRRUv.js} +11 -11
- package/dist/{vue-ui-waffle-C6cN0uw8.cjs → vue-ui-waffle-C0F8eexl.cjs} +1 -1
- package/dist/{vue-ui-wheel-OGoTipOg.cjs → vue-ui-wheel-DP9XwVGM.cjs} +1 -1
- package/dist/{vue-ui-wheel-D1SsLAru.js → vue-ui-wheel-pQBqSI5z.js} +7 -7
- package/dist/{vue-ui-word-cloud-Da4dHp_U.cjs → vue-ui-word-cloud-CmKH64gk.cjs} +1 -1
- package/dist/{vue-ui-word-cloud-C6vq-XKZ.js → vue-ui-word-cloud-D39_9P7v.js} +10 -10
- package/dist/{vue-ui-xy-DXLSyett.cjs → vue-ui-xy-2m8k1EUB.cjs} +1 -1
- package/dist/{vue-ui-xy-Bbih4XkZ.js → vue-ui-xy-DRYbR_nu.js} +14 -14
- package/dist/{vue-ui-xy-canvas-GffgFKCU.cjs → vue-ui-xy-canvas-CywB2tWN.cjs} +1 -1
- package/dist/{vue-ui-xy-canvas-Dtv9a_jF.js → vue-ui-xy-canvas-DZib_307.js} +11 -11
- package/package.json +1 -1
- package/dist/index-ZAR4YEAn.cjs +0 -9
- package/dist/vue-ui-gauge-F-bvIFfG.cjs +0 -1
- package/dist/vue-ui-gauge-NtnSEvX5.js +0 -557
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-ZAR4YEAn.cjs"),L=require("./useNestedProp-C8Y0yWDq.cjs"),Q=require("./vue-ui-sparkline-DuJlR_56.cjs"),Y=require("./BaseIcon-vmPfwVXS.cjs"),B=require("./usePrinter-Cw4E_LYe.cjs"),Z=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),j=["id"],ee={style:{"z-index":"1","padding-right":"24px"}},te=["onClick"],le=["data-cell"],ae=["data-cell","onPointerenter"],oe=["data-cell"],ne=["data-cell"],re=["data-cell"],ue=["data-cell"],se={key:0,ref:"source",dir:"auto"},ie={__name:"vue-ui-table-sparkline",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(T,{expose:M}){const d=T;e.useCssVars(l=>({"1f14fe1a":l.tdo}));const{vue_ui_table_sparkline:G}=s.useConfig(),h=e.ref(s.createUid()),z=e.ref(0),b=e.ref(0),k=e.ref(null),t=e.computed({get:()=>I(),set:l=>l});function I(){const l=L.useNestedProp({userConfig:d.config,defaultConfig:G});return l.theme?{...L.useNestedProp({userConfig:s.themes.vue_ui_table_sparkline[l.theme]||d.config,defaultConfig:l}),customPalette:s.themePalettes[l.theme]||s.palette}:l}e.watch(()=>d.config,l=>{t.value=I(),$(),b.value+=1},{deep:!0}),e.watch(()=>d.dataset,l=>{m.value=v.value,b.value+=1},{deep:!0});const{isPrinting:N,isImaging:A,generatePdf:E,generateImage:V}=B.usePrinter({elementId:`table_${h.value}`,fileName:t.value.title.text||"vue-ui-table-sparkline"}),q=e.computed(()=>s.convertCustomPalette(t.value.customPalette)),g=e.ref(null),_=e.ref(!1),R=e.computed(()=>t.value.responsiveBreakpoint);e.onMounted(()=>{$()});const x=e.ref(t.value.colNames);function $(){s.objectIsEmpty(d.dataset)&&s.error({componentName:"VueUiTableSparkline",type:"dataset"});const l=new ResizeObserver(n=>{n.forEach(a=>{_.value=a.contentRect.width<R.value})});g.value&&l.observe(g.value),x.value=[];for(let n=0;n<F.value;n+=1)x.value.push(t.value.colNames[n]||`col ${n}`)}const D=e.computed(()=>(d.dataset.forEach((l,n)=>{s.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(a=>{s.error({componentName:"VueUiTableSparkline",type:"datasetSerieAttribute",property:a,index:n})})}),d.dataset.map((l,n)=>{const a=(l.values||[]).map(u=>isNaN(u)?0:u??0),r=a.reduce((u,o)=>u+o,0);return{...l,values:l.values||[],color:s.convertColorToHex(l.color)||q.value[n]||s.palette[n]||s.palette[n%s.palette.length],sum:r,average:r/a.length,median:s.calcMedian(a),sparklineDataset:a.map((u,o)=>({period:t.value.colNames[o]||`col ${o}`,value:u||0}))}})));function U(l){const a=(l[0].values||[]).map((u,o)=>l.map(i=>i.values[o]||[])).map(u=>u.map((o,i)=>[o,i]).sort((o,i)=>i[0]-o[0]).map(o=>o[1]));return l.map((u,o)=>({...u,values:u.values||[],orders:a[o]}))}const v=e.computed(()=>U(D.value)),m=e.ref(v.value),H=e.computed(()=>Math.max(...m.value.map(l=>(l.values||[]).length))),y=e.ref(void 0),C=e.ref(!1),S=e.ref(void 0),w=e.ref(-1);function P(){C.value=!1,S.value=void 0,w.value=-1,m.value=v.value}function X(l){C.value=!0,S.value=l;const n=v.value.map(o=>o.values[l]||[]),a=y.value===l?1:-1;w.value=a,l===y.value?y.value=void 0:y.value=l;const u=n.map((o,i)=>[i,o]).sort((o,i)=>a*(i[1]-o[1])).map(o=>o[0]).map(o=>v.value[o]);m.value=u,b.value+=1}const F=e.computed(()=>Math.max(...d.dataset.map(l=>(l.values||[]).length))),p=e.computed(()=>{let l=x.value;if(!l.length)for(let a=0;a<F.value;a+=1)l.push(`col ${a+1}`);t.value.showTotal&&(l=[...l,t.value.translations.total]);let n;return t.value.showAverage&&t.value.showMedian?n=[...l,t.value.translations.average,t.value.translations.median]:t.value.showAverage&&!t.value.showMedian?n=[...l,t.value.translations.average]:!t.value.showAverage&&t.value.showMedian?n=[...l,t.value.translations.median]:n=l,t.value.showSparklines?[...n,t.value.translations.chart]:n}),c=e.ref(void 0),f=e.ref(void 0);function J({dataIndex:l,serieIndex:n}){c.value=l,f.value=n,k.value[l]&&!_.value&&k.value[l].scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})}const O=e.ref(!1);function K(l){O.value=l,z.value+=1}function W(){e.nextTick(()=>{const l=[t.value.translations.serie].concat(p.value),n=D.value.map((u,o)=>[[u.name],u.values,[u.sum],[u.average],[u.median]]),a=[l].concat(n),r=s.createCsvContent(a);s.downloadCsv({csvContent:r,title:t.value.title.text||"vue-ui-table-sparkline"})})}return M({generatePdf:E,generateImage:V,generateCsv:W,restoreOrder:P}),(l,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tableContainer",ref:g,class:e.normalizeClass({"vue-ui-responsive":_.value}),style:{overflow:"hidden"},id:`table_${h.value}`},[e.createElementVNode("div",{style:{overflow:"auto"},onPointerleave:n[0]||(n[0]=a=>{f.value=void 0,c.value=void 0})},[e.createElementVNode("table",{class:"vue-ui-data-table",style:e.normalizeStyle({fontFamily:t.value.fontFamily,position:"relative"})},[t.value.title.text?(e.openBlock(),e.createElementBlock("caption",{key:0,style:e.normalizeStyle({backgroundColor:t.value.title.backgroundColor})},[e.createElementVNode("div",{style:e.normalizeStyle({fontSize:`${t.value.title.fontSize}px`,fontWeight:t.value.title.bold?"bold":"normal",color:t.value.title.color,textAlign:t.value.title.textAlign})},e.toDisplayString(t.value.title.text),5),t.value.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle({fontSize:`${t.value.title.subtitle.fontSize}px`,fontWeight:t.value.title.subtitle.bold?"bold":"normal",color:t.value.title.subtitle.color,textAlign:t.value.title.textAlign})},e.toDisplayString(t.value.title.subtitle.text),5)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),e.createElementVNode("thead",ee,[e.withDirectives((e.openBlock(),e.createElementBlock("tr",{role:"row",class:"vue-ui-data-table__thead-row",style:e.normalizeStyle({backgroundColor:t.value.thead.backgroundColor,color:t.value.thead.color})},[e.createElementVNode("th",{role:"cell",style:e.normalizeStyle({backgroundColor:t.value.thead.backgroundColor,border:t.value.thead.outline,textAlign:t.value.thead.textAlign,fontWeight:t.value.thead.bold?"bold":"normal"}),class:"sticky-col-first"},e.toDisplayString(t.value.translations.serie),5),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,(a,r)=>(e.openBlock(),e.createElementBlock("th",{role:"cell",style:e.normalizeStyle({background:t.value.thead.backgroundColor,border:t.value.thead.outline,textAlign:t.value.thead.textAlign,fontWeight:t.value.thead.bold?"bold":"normal",minWidth:r===p.value.length-1?`${t.value.sparkline.dimensions.width}px`:"48px",cursor:v.value[0].values[r]!==void 0?"pointer":"default",paddingRight:r===p.value.length-1&&t.value.userOptions.show?"36px":""}),onClick:()=>X(r),class:e.normalizeClass({"sticky-col":r===p.value.length-1&&t.value.showSparklines})},[e.createElementVNode("div",{style:e.normalizeStyle({display:"flex",flexDirection:"row",alignItems:"center",gap:"6px",justifyContent:t.value.thead.textAlign})},[e.createElementVNode("span",null,e.toDisplayString(a),1),C.value&&r===S.value&&v.value[0].values[r]!==void 0?(e.openBlock(),e.createBlock(Y.default,{key:0,size:18,name:w.value===1?"sort":"sortReverse",stroke:t.value.thead.color},null,8,["name","stroke"])):e.createCommentVNode("",!0)],4),t.value.userOptions.show&&r===p.value.length-1?(e.openBlock(),e.createBlock(B.UserOptions,{ref_for:!0,ref:"details",key:`user_option_${z.value}`,backgroundColor:t.value.thead.backgroundColor,color:t.value.thead.color,isPrinting:e.unref(N),isImaging:e.unref(A),uid:h.value,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:O.value,titles:{...t.value.userOptions.buttonTitles},chartElement:g.value,position:t.value.userOptions.position,onToggleFullscreen:K,onGeneratePdf:e.unref(E),onGenerateImage:e.unref(V),onGenerateCsv:W},e.createSlots({_:2},[l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:u,isFullscreen:o})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:u,isFullscreen:o})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0)],14,te))),256))],4)),[[e.unref(B.vClickOutside),P]])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(a,r)=>(e.openBlock(),e.createElementBlock("tr",{role:"row",style:e.normalizeStyle({backgroundColor:t.value.tbody.backgroundColor,color:t.value.tbody.color}),class:e.normalizeClass({"vue-ui-data-table__tbody__row":!0,"vue-ui-data-table__tbody__row-even":r%2===0,"vue-ui-data-table__tbody__row-odd":r%2!==0})},[e.createElementVNode("td",{role:"cell",style:e.normalizeStyle({backgroundColor:t.value.tbody.backgroundColor,border:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),"data-cell":t.value.translations.serie,class:"vue-ui-data-table__tbody__td sticky-col-first"},[e.createElementVNode("div",{dir:"auto",style:e.normalizeStyle({display:"flex",flexDirection:"row",alignItems:"center",gap:"6px",justifyContent:t.value.tbody.textAlign})},[t.value.tbody.showColorMarker?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle({color:a.color})},"⬤",4)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(a.name??"-"),1)],4)],12,le),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.value,(u,o)=>(e.openBlock(),e.createElementBlock("td",{dir:"auto",role:"cell",ref_for:!0,ref_key:"TD",ref:k,style:e.normalizeStyle({border:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign,background:c.value!==void 0&&o===c.value?t.value.tbody.selectedColor.useSerieColor?`${a.color.length>7?a.color.slice(0,-2):a.color}33`:t.value.tbody.selectedColor.fallback:"",borderRadius:c.value!==void 0&&f.value!==void 0&&o===c.value&&f.value===r?"3px":""}),"data-cell":p.value[o],class:"vue-ui-data-table__tbody__td",onPointerenter:i=>{f.value=r,c.value=o}},e.toDisplayString([null,void 0].includes(a.values[o])?"-":e.unref(s.applyDataLabel)(t.value.formatter,Number(a.values[o]),e.unref(s.dataLabel)({p:t.value.prefix,v:Number(a.values[o]),s:t.value.suffix,r:t.value.roundingValues}),{datapoint:a,seriesIndex:r,datapointIndex:o})),45,ae))),256)),t.value.showTotal?(e.openBlock(),e.createElementBlock("td",{key:0,dir:"auto",role:"cell",style:e.normalizeStyle({border:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),"data-cell":t.value.translations.total,class:"vue-ui-data-table__tbody__td"},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.formatter,a.sum,e.unref(s.dataLabel)({p:t.value.prefix,v:a.sum,s:t.value.suffix,r:t.value.roundingTotal}),{datapoint:a.sum,seriesIndex:r})),13,oe)):e.createCommentVNode("",!0),t.value.showAverage?(e.openBlock(),e.createElementBlock("td",{key:1,dir:"auto",role:"cell",style:e.normalizeStyle({border:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),"data-cell":t.value.translations.average,class:"vue-ui-data-table__tbody__td"},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.formatter,a.average,e.unref(s.dataLabel)({p:t.value.prefix,v:a.average,s:t.value.suffix,r:t.value.roundingAverage}),{datapoint:a.average,seriesIndex:r})),13,ne)):e.createCommentVNode("",!0),t.value.showMedian?(e.openBlock(),e.createElementBlock("td",{key:2,dir:"auto",role:"cell",style:e.normalizeStyle({border:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),"data-cell":t.value.translations.median,class:"vue-ui-data-table__tbody__td"},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.formatter,a.median,e.unref(s.dataLabel)({p:t.value.prefix,v:a.median,s:t.value.suffix,r:t.value.roundingMedian}),{datapoint:a.median,seriesIndex:r})),13,re)):e.createCommentVNode("",!0),t.value.showSparklines?(e.openBlock(),e.createElementBlock("td",{key:3,role:"cell","data-cell":t.value.translations.chart,style:e.normalizeStyle({border:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign,backgroundColor:t.value.tbody.backgroundColor,padding:"0"}),class:"vue-ui-data-table__tbody__td sticky-col"},[(e.openBlock(),e.createBlock(Q.default,{key:`sparkline_${r}_${b.value}`,onHoverIndex:({index:u})=>J({dataIndex:u,serieIndex:r}),"height-ratio":t.value.sparkline.dimensions.heightRatio,"forced-padding":30,dataset:a.sparklineDataset,showInfo:!1,selectedIndex:c.value,config:{type:t.value.sparkline.type,style:{backgroundColor:"transparent",animation:{show:t.value.sparkline.animation.show&&!e.unref(N)&&!e.unref(A),animationFrames:t.value.sparkline.animation.animationFrames},line:{color:a.color,smooth:t.value.sparkline.smooth,strokeWidth:t.value.sparkline.strokeWidth},bar:{color:a.color},area:{color:a.color,opacity:t.value.sparkline.showArea?16:0,useGradient:t.value.sparkline.useGradient},verticalIndicator:{color:a.color},plot:{radius:9,stroke:t.value.tbody.backgroundColor,strokeWidth:3}}}},null,8,["onHoverIndex","height-ratio","dataset","selectedIndex","config"]))],12,ue)):e.createCommentVNode("",!0)],6))),256))])],4)],32),l.$slots.source?(e.openBlock(),e.createElementBlock("div",se,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],10,j))}},de=Z._export_sfc(ie,[["__scopeId","data-v-df1c4c1d"]]);exports.default=de;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-DuDeHJyK.cjs"),L=require("./useNestedProp-zkJOoemW.cjs"),Q=require("./vue-ui-sparkline-BggHSfaz.cjs"),Y=require("./BaseIcon-DUokibJ1.cjs"),B=require("./usePrinter-ardO_DNo.cjs"),Z=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),j=["id"],ee={style:{"z-index":"1","padding-right":"24px"}},te=["onClick"],le=["data-cell"],ae=["data-cell","onPointerenter"],oe=["data-cell"],ne=["data-cell"],re=["data-cell"],ue=["data-cell"],se={key:0,ref:"source",dir:"auto"},ie={__name:"vue-ui-table-sparkline",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(T,{expose:M}){const d=T;e.useCssVars(l=>({"1f14fe1a":l.tdo}));const{vue_ui_table_sparkline:G}=s.useConfig(),h=e.ref(s.createUid()),z=e.ref(0),b=e.ref(0),k=e.ref(null),t=e.computed({get:()=>I(),set:l=>l});function I(){const l=L.useNestedProp({userConfig:d.config,defaultConfig:G});return l.theme?{...L.useNestedProp({userConfig:s.themes.vue_ui_table_sparkline[l.theme]||d.config,defaultConfig:l}),customPalette:s.themePalettes[l.theme]||s.palette}:l}e.watch(()=>d.config,l=>{t.value=I(),$(),b.value+=1},{deep:!0}),e.watch(()=>d.dataset,l=>{m.value=v.value,b.value+=1},{deep:!0});const{isPrinting:N,isImaging:A,generatePdf:E,generateImage:V}=B.usePrinter({elementId:`table_${h.value}`,fileName:t.value.title.text||"vue-ui-table-sparkline"}),q=e.computed(()=>s.convertCustomPalette(t.value.customPalette)),g=e.ref(null),_=e.ref(!1),R=e.computed(()=>t.value.responsiveBreakpoint);e.onMounted(()=>{$()});const x=e.ref(t.value.colNames);function $(){s.objectIsEmpty(d.dataset)&&s.error({componentName:"VueUiTableSparkline",type:"dataset"});const l=new ResizeObserver(n=>{n.forEach(a=>{_.value=a.contentRect.width<R.value})});g.value&&l.observe(g.value),x.value=[];for(let n=0;n<F.value;n+=1)x.value.push(t.value.colNames[n]||`col ${n}`)}const D=e.computed(()=>(d.dataset.forEach((l,n)=>{s.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(a=>{s.error({componentName:"VueUiTableSparkline",type:"datasetSerieAttribute",property:a,index:n})})}),d.dataset.map((l,n)=>{const a=(l.values||[]).map(u=>isNaN(u)?0:u??0),r=a.reduce((u,o)=>u+o,0);return{...l,values:l.values||[],color:s.convertColorToHex(l.color)||q.value[n]||s.palette[n]||s.palette[n%s.palette.length],sum:r,average:r/a.length,median:s.calcMedian(a),sparklineDataset:a.map((u,o)=>({period:t.value.colNames[o]||`col ${o}`,value:u||0}))}})));function U(l){const a=(l[0].values||[]).map((u,o)=>l.map(i=>i.values[o]||[])).map(u=>u.map((o,i)=>[o,i]).sort((o,i)=>i[0]-o[0]).map(o=>o[1]));return l.map((u,o)=>({...u,values:u.values||[],orders:a[o]}))}const v=e.computed(()=>U(D.value)),m=e.ref(v.value),H=e.computed(()=>Math.max(...m.value.map(l=>(l.values||[]).length))),y=e.ref(void 0),C=e.ref(!1),S=e.ref(void 0),w=e.ref(-1);function P(){C.value=!1,S.value=void 0,w.value=-1,m.value=v.value}function X(l){C.value=!0,S.value=l;const n=v.value.map(o=>o.values[l]||[]),a=y.value===l?1:-1;w.value=a,l===y.value?y.value=void 0:y.value=l;const u=n.map((o,i)=>[i,o]).sort((o,i)=>a*(i[1]-o[1])).map(o=>o[0]).map(o=>v.value[o]);m.value=u,b.value+=1}const F=e.computed(()=>Math.max(...d.dataset.map(l=>(l.values||[]).length))),p=e.computed(()=>{let l=x.value;if(!l.length)for(let a=0;a<F.value;a+=1)l.push(`col ${a+1}`);t.value.showTotal&&(l=[...l,t.value.translations.total]);let n;return t.value.showAverage&&t.value.showMedian?n=[...l,t.value.translations.average,t.value.translations.median]:t.value.showAverage&&!t.value.showMedian?n=[...l,t.value.translations.average]:!t.value.showAverage&&t.value.showMedian?n=[...l,t.value.translations.median]:n=l,t.value.showSparklines?[...n,t.value.translations.chart]:n}),c=e.ref(void 0),f=e.ref(void 0);function J({dataIndex:l,serieIndex:n}){c.value=l,f.value=n,k.value[l]&&!_.value&&k.value[l].scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})}const O=e.ref(!1);function K(l){O.value=l,z.value+=1}function W(){e.nextTick(()=>{const l=[t.value.translations.serie].concat(p.value),n=D.value.map((u,o)=>[[u.name],u.values,[u.sum],[u.average],[u.median]]),a=[l].concat(n),r=s.createCsvContent(a);s.downloadCsv({csvContent:r,title:t.value.title.text||"vue-ui-table-sparkline"})})}return M({generatePdf:E,generateImage:V,generateCsv:W,restoreOrder:P}),(l,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tableContainer",ref:g,class:e.normalizeClass({"vue-ui-responsive":_.value}),style:{overflow:"hidden"},id:`table_${h.value}`},[e.createElementVNode("div",{style:{overflow:"auto"},onPointerleave:n[0]||(n[0]=a=>{f.value=void 0,c.value=void 0})},[e.createElementVNode("table",{class:"vue-ui-data-table",style:e.normalizeStyle({fontFamily:t.value.fontFamily,position:"relative"})},[t.value.title.text?(e.openBlock(),e.createElementBlock("caption",{key:0,style:e.normalizeStyle({backgroundColor:t.value.title.backgroundColor})},[e.createElementVNode("div",{style:e.normalizeStyle({fontSize:`${t.value.title.fontSize}px`,fontWeight:t.value.title.bold?"bold":"normal",color:t.value.title.color,textAlign:t.value.title.textAlign})},e.toDisplayString(t.value.title.text),5),t.value.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle({fontSize:`${t.value.title.subtitle.fontSize}px`,fontWeight:t.value.title.subtitle.bold?"bold":"normal",color:t.value.title.subtitle.color,textAlign:t.value.title.textAlign})},e.toDisplayString(t.value.title.subtitle.text),5)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),e.createElementVNode("thead",ee,[e.withDirectives((e.openBlock(),e.createElementBlock("tr",{role:"row",class:"vue-ui-data-table__thead-row",style:e.normalizeStyle({backgroundColor:t.value.thead.backgroundColor,color:t.value.thead.color})},[e.createElementVNode("th",{role:"cell",style:e.normalizeStyle({backgroundColor:t.value.thead.backgroundColor,border:t.value.thead.outline,textAlign:t.value.thead.textAlign,fontWeight:t.value.thead.bold?"bold":"normal"}),class:"sticky-col-first"},e.toDisplayString(t.value.translations.serie),5),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,(a,r)=>(e.openBlock(),e.createElementBlock("th",{role:"cell",style:e.normalizeStyle({background:t.value.thead.backgroundColor,border:t.value.thead.outline,textAlign:t.value.thead.textAlign,fontWeight:t.value.thead.bold?"bold":"normal",minWidth:r===p.value.length-1?`${t.value.sparkline.dimensions.width}px`:"48px",cursor:v.value[0].values[r]!==void 0?"pointer":"default",paddingRight:r===p.value.length-1&&t.value.userOptions.show?"36px":""}),onClick:()=>X(r),class:e.normalizeClass({"sticky-col":r===p.value.length-1&&t.value.showSparklines})},[e.createElementVNode("div",{style:e.normalizeStyle({display:"flex",flexDirection:"row",alignItems:"center",gap:"6px",justifyContent:t.value.thead.textAlign})},[e.createElementVNode("span",null,e.toDisplayString(a),1),C.value&&r===S.value&&v.value[0].values[r]!==void 0?(e.openBlock(),e.createBlock(Y.default,{key:0,size:18,name:w.value===1?"sort":"sortReverse",stroke:t.value.thead.color},null,8,["name","stroke"])):e.createCommentVNode("",!0)],4),t.value.userOptions.show&&r===p.value.length-1?(e.openBlock(),e.createBlock(B.UserOptions,{ref_for:!0,ref:"details",key:`user_option_${z.value}`,backgroundColor:t.value.thead.backgroundColor,color:t.value.thead.color,isPrinting:e.unref(N),isImaging:e.unref(A),uid:h.value,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:O.value,titles:{...t.value.userOptions.buttonTitles},chartElement:g.value,position:t.value.userOptions.position,onToggleFullscreen:K,onGeneratePdf:e.unref(E),onGenerateImage:e.unref(V),onGenerateCsv:W},e.createSlots({_:2},[l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:u,isFullscreen:o})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:u,isFullscreen:o})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0)],14,te))),256))],4)),[[e.unref(B.vClickOutside),P]])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(a,r)=>(e.openBlock(),e.createElementBlock("tr",{role:"row",style:e.normalizeStyle({backgroundColor:t.value.tbody.backgroundColor,color:t.value.tbody.color}),class:e.normalizeClass({"vue-ui-data-table__tbody__row":!0,"vue-ui-data-table__tbody__row-even":r%2===0,"vue-ui-data-table__tbody__row-odd":r%2!==0})},[e.createElementVNode("td",{role:"cell",style:e.normalizeStyle({backgroundColor:t.value.tbody.backgroundColor,border:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),"data-cell":t.value.translations.serie,class:"vue-ui-data-table__tbody__td sticky-col-first"},[e.createElementVNode("div",{dir:"auto",style:e.normalizeStyle({display:"flex",flexDirection:"row",alignItems:"center",gap:"6px",justifyContent:t.value.tbody.textAlign})},[t.value.tbody.showColorMarker?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle({color:a.color})},"⬤",4)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(a.name??"-"),1)],4)],12,le),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.value,(u,o)=>(e.openBlock(),e.createElementBlock("td",{dir:"auto",role:"cell",ref_for:!0,ref_key:"TD",ref:k,style:e.normalizeStyle({border:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign,background:c.value!==void 0&&o===c.value?t.value.tbody.selectedColor.useSerieColor?`${a.color.length>7?a.color.slice(0,-2):a.color}33`:t.value.tbody.selectedColor.fallback:"",borderRadius:c.value!==void 0&&f.value!==void 0&&o===c.value&&f.value===r?"3px":""}),"data-cell":p.value[o],class:"vue-ui-data-table__tbody__td",onPointerenter:i=>{f.value=r,c.value=o}},e.toDisplayString([null,void 0].includes(a.values[o])?"-":e.unref(s.applyDataLabel)(t.value.formatter,Number(a.values[o]),e.unref(s.dataLabel)({p:t.value.prefix,v:Number(a.values[o]),s:t.value.suffix,r:t.value.roundingValues}),{datapoint:a,seriesIndex:r,datapointIndex:o})),45,ae))),256)),t.value.showTotal?(e.openBlock(),e.createElementBlock("td",{key:0,dir:"auto",role:"cell",style:e.normalizeStyle({border:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),"data-cell":t.value.translations.total,class:"vue-ui-data-table__tbody__td"},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.formatter,a.sum,e.unref(s.dataLabel)({p:t.value.prefix,v:a.sum,s:t.value.suffix,r:t.value.roundingTotal}),{datapoint:a.sum,seriesIndex:r})),13,oe)):e.createCommentVNode("",!0),t.value.showAverage?(e.openBlock(),e.createElementBlock("td",{key:1,dir:"auto",role:"cell",style:e.normalizeStyle({border:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),"data-cell":t.value.translations.average,class:"vue-ui-data-table__tbody__td"},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.formatter,a.average,e.unref(s.dataLabel)({p:t.value.prefix,v:a.average,s:t.value.suffix,r:t.value.roundingAverage}),{datapoint:a.average,seriesIndex:r})),13,ne)):e.createCommentVNode("",!0),t.value.showMedian?(e.openBlock(),e.createElementBlock("td",{key:2,dir:"auto",role:"cell",style:e.normalizeStyle({border:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),"data-cell":t.value.translations.median,class:"vue-ui-data-table__tbody__td"},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.formatter,a.median,e.unref(s.dataLabel)({p:t.value.prefix,v:a.median,s:t.value.suffix,r:t.value.roundingMedian}),{datapoint:a.median,seriesIndex:r})),13,re)):e.createCommentVNode("",!0),t.value.showSparklines?(e.openBlock(),e.createElementBlock("td",{key:3,role:"cell","data-cell":t.value.translations.chart,style:e.normalizeStyle({border:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign,backgroundColor:t.value.tbody.backgroundColor,padding:"0"}),class:"vue-ui-data-table__tbody__td sticky-col"},[(e.openBlock(),e.createBlock(Q.default,{key:`sparkline_${r}_${b.value}`,onHoverIndex:({index:u})=>J({dataIndex:u,serieIndex:r}),"height-ratio":t.value.sparkline.dimensions.heightRatio,"forced-padding":30,dataset:a.sparklineDataset,showInfo:!1,selectedIndex:c.value,config:{type:t.value.sparkline.type,style:{backgroundColor:"transparent",animation:{show:t.value.sparkline.animation.show&&!e.unref(N)&&!e.unref(A),animationFrames:t.value.sparkline.animation.animationFrames},line:{color:a.color,smooth:t.value.sparkline.smooth,strokeWidth:t.value.sparkline.strokeWidth},bar:{color:a.color},area:{color:a.color,opacity:t.value.sparkline.showArea?16:0,useGradient:t.value.sparkline.useGradient},verticalIndicator:{color:a.color},plot:{radius:9,stroke:t.value.tbody.backgroundColor,strokeWidth:3}}}},null,8,["onHoverIndex","height-ratio","dataset","selectedIndex","config"]))],12,ue)):e.createCommentVNode("",!0)],6))),256))])],4)],32),l.$slots.source?(e.openBlock(),e.createElementBlock("div",se,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],10,j))}},de=Z._export_sfc(ie,[["__scopeId","data-v-df1c4c1d"]]);exports.default=de;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useCssVars as ye, computed as h, onMounted as fe, ref as g, watch as ge, openBlock as l, createElementBlock as u, normalizeClass as P, normalizeStyle as me, createBlock as F, createCommentVNode as i, unref as v, createSlots as pe, withCtx as I, renderSlot as m, normalizeProps as G, guardReactiveProps as V, createVNode as ke, createElementVNode as d, Fragment as O, renderList as K, toDisplayString as be } from "vue";
|
|
2
|
-
import { u as _e, o as xe, e as Q, g as we, c as Ce, t as $e, a as Pe, p as _, b as Fe, v as f, d as A, X as Ie, s as Oe, i as Ae, f as Ye } from "./index-
|
|
3
|
-
import { _ as Ne } from "./Title-
|
|
4
|
-
import { u as Me, U as Te } from "./usePrinter-
|
|
5
|
-
import Se from "./vue-ui-skeleton-
|
|
6
|
-
import { u as Z } from "./useNestedProp-
|
|
7
|
-
import { _ as Ue } from "./PackageVersion-
|
|
8
|
-
import { P as qe } from "./PenAndPaper-
|
|
2
|
+
import { u as _e, o as xe, e as Q, g as we, c as Ce, t as $e, a as Pe, p as _, b as Fe, v as f, d as A, X as Ie, s as Oe, i as Ae, f as Ye } from "./index-Cm2_6s9o.js";
|
|
3
|
+
import { _ as Ne } from "./Title-Coit3NcT.js";
|
|
4
|
+
import { u as Me, U as Te } from "./usePrinter-Cx8U1e30.js";
|
|
5
|
+
import Se from "./vue-ui-skeleton-BUS6A44x.js";
|
|
6
|
+
import { u as Z } from "./useNestedProp-BYPZJNhi.js";
|
|
7
|
+
import { _ as Ue } from "./PackageVersion-CTMY4zeY.js";
|
|
8
|
+
import { P as qe } from "./PenAndPaper-DJ_d10S-.js";
|
|
9
9
|
import { _ as Le } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
10
10
|
const Ge = ["id"], Ve = {
|
|
11
11
|
key: 1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-ZAR4YEAn.cjs"),Q=require("./Title-CtfsoH8U.cjs"),A=require("./usePrinter-Cw4E_LYe.cjs"),Z=require("./vue-ui-skeleton-urNi7er0.cjs"),T=require("./useNestedProp-C8Y0yWDq.cjs"),ee=require("./PackageVersion-DylCZJMA.cjs"),te=require("./PenAndPaper-2aIJsXNH.cjs"),oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),le=["id"],re={key:1,ref:"noTitle",class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},ae={key:2,style:"width:100%"},se=["xmlns","viewBox"],ne={id:"vueUiPill",clipPathUnits:"objectBoundingBox"},ue=["fill"],ce=["id"],ie=["stop-color"],de=["stop-color"],he=["stop-color"],ve={"clip-path":"url(#vueUiPill)"},me=["x","y","height","width"],pe=["x","y","height","width","fill"],ye=["x1","x2","y1","y2","stroke-width","stroke"],fe=["x1","x2","y1","y2","stroke-width","stroke"],ke=["x1","x2","y1","y2","stroke-width","stroke"],ge=["x1","x2","y1","y2","stroke-width","stroke"],xe=["x1","x2","y1","y2","stroke-width","stroke"],be=["x1","x2","y1","y2","stroke-width","stroke"],_e=["x1","x2","y1","y2","stroke-width","stroke"],Ce=["x1","x2","y1","y2","stroke-width","stroke"],we=["x","y","height","width"],Ne=["y","x","fill","font-size","font-weight"],Be={key:5,class:"vue-data-ui-watermark"},Pe={key:6,ref:"source",dir:"auto"},Ve={__name:"vue-ui-thermometer",props:{dataset:{type:Object,default(){return{}}},config:{type:Object,default(){return{}}}},setup(m,{expose:Y}){const s=m;e.useCssVars(l=>({"000db494":H.value,"2865ccd0":W.value,10843485:G.value}));const{vue_ui_thermometer:M}=r.useConfig(),k=e.computed(()=>!!s.dataset&&Object.keys(s.dataset).length);e.onMounted(()=>{B()});function B(){r.objectIsEmpty(s.dataset)?r.error({componentName:"VueUiThermometer",type:"dataset"}):r.getMissingDatasetAttributes({datasetObject:s.dataset,requiredAttributes:["value","from","to"]}).forEach(l=>{r.error({componentName:"VueUiThermometer",type:"datasetAttribute",property:l})})}const d=e.ref(r.createUid()),g=e.ref(null),P=e.ref(0),V=e.ref(0),t=e.computed({get:()=>E(),set:l=>l});function E(){const l=T.useNestedProp({userConfig:s.config,defaultConfig:M});return l.theme?{...T.useNestedProp({userConfig:r.themes.vue_ui_thermometer[l.theme]||s.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}e.watch(()=>s.config,l=>{t.value=E(),B(),V.value+=1},{deep:!0});const{isPrinting:$,isImaging:F,generatePdf:I,generateImage:q}=A.usePrinter({elementId:`thermometer__${d.value}`,fileName:t.value.style.title.text||"vue-ui-thermometer"}),z=e.computed(()=>t.value.userOptions.show&&!t.value.style.title.text),p=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),L=e.computed(()=>t.value.style.chart.thermometer.width),i=e.computed(()=>s.dataset.steps||10),c=e.ref({top:t.value.style.chart.padding.top,left:t.value.style.chart.padding.left,right:t.value.style.chart.padding.right,bottom:t.value.style.chart.padding.bottom});function y(l,u,o){const n=[],w=S(l),N=S(u);for(let v=0;v<o;v++){const R=x(w.red,N.red,v,o),X=x(w.green,N.green,v,o),J=x(w.blue,N.blue,v,o),K=`#${b(R)}${b(X)}${b(J)}`;n.push(K)}return n}function S(l){const u=l.slice(1);return{red:parseInt(u.slice(0,2),16),green:parseInt(u.slice(2,4),16),blue:parseInt(u.slice(4,6),16)}}function x(l,u,o,n){return Math.round(l+(u-l)*o/n)}function b(l){return l.toString(16).padStart(2,"0")}const a=e.computed(()=>{const l=L.value+c.value.left+c.value.right,u=t.value.style.chart.height;return{width:l,left:c.value.left,right:l-c.value.right,top:c.value.top,bottom:u-c.value.bottom,height:u}}),U=e.computed(()=>a.value),_=e.computed(()=>{const l=r.checkNaN(s.dataset.from)<0?Math.abs(r.checkNaN(s.dataset.from)):r.checkNaN(s.dataset.from),u=r.checkNaN(s.dataset.to)<0?Math.abs(r.checkNaN(s.dataset.to)):r.checkNaN(s.dataset.to);let o=0;return r.checkNaN(s.dataset.to)>0?o=l+u:l>u?o=l-u:o=u-l,(1-(Math.abs(r.checkNaN(s.dataset.from))+r.checkNaN(s.dataset.value))/o)*(a.value.height-c.value.top-c.value.bottom)}),G=e.computed(()=>`${_.value}px`),W=e.computed(()=>`${a.value.height-t.value.style.chart.padding.bottom-c.value.top}px`),H=e.computed(()=>`${t.value.style.chart.animation.speedMs}ms`),j=e.computed(()=>{if(s.dataset.colors){if(!s.dataset.colors.from)return y(p.value[0]||r.palette[0],r.convertColorToHex(s.dataset.colors.to),i.value||10);if(!s.dataset.colors.to)return y(r.convertColorToHex(s.dataset.colors.from),p.value[1]||r.palette[1],i.value||10)}else return y(p.value[1]||r.palette[1],p.value[0]||r.palette[0],i.value||10);return y(r.convertColorToHex(s.dataset.colors.from),r.convertColorToHex(s.dataset.colors.to),i.value||10)}),O=e.computed(()=>{const l=[];let u=0;const o=a.value.height-c.value.top-c.value.bottom;for(let n=0;n<o-1;n+=o/i.value)l.push({x:a.value.left,y:a.value.top+n,qYLess:a.value.top+n+o/i.value/4,halfY:a.value.top+n+o/i.value/2,qYMore:a.value.top+n+o/i.value/4*3,color:j.value[u],height:o/i.value}),u+=1;return l}),h=e.ref(!1);function D(l){h.value=l,P.value+=1}const f=e.ref(!1);function C(){f.value=!f.value}return Y({generatePdf:I,generateImage:q,toggleAnnotator:C}),(l,u)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"thermoChart",ref:g,class:e.normalizeClass(`vue-ui-thermometer ${h.value?"vue-data-ui-wrapper-fullscreen":""}`),style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color};font-family:${t.value.style.fontFamily}`),id:`thermometer__${d.value}`},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(te.PenAndPaper,{key:0,parent:g.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:f.value,onClose:C},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),z.value?(e.openBlock(),e.createElementBlock("div",re,null,512)):e.createCommentVNode("",!0),t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",ae,[(e.openBlock(),e.createBlock(Q._sfc_main,{key:`title_${V.value}`,config:{title:{cy:"thermometer-div-title",...t.value.style.title},subtitle:{cy:"thermometer-div-subtitle",...t.value.style.title.subtitle}}},null,8,["config"]))])):e.createCommentVNode("",!0),t.value.userOptions.show&&k.value?(e.openBlock(),e.createBlock(A.UserOptions,{ref:"details",key:`user_options_${P.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(F),isPrinting:e.unref($),uid:d.value,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,hasXls:!1,isFullscreen:h.value,titles:{...t.value.userOptions.buttonTitles},chartElement:g.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:f.value,onToggleFullscreen:D,onGeneratePdf:e.unref(I),onGenerateImage:e.unref(q),onToggleAnnotator:C},e.createSlots({_:2},[l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:n})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:n})),void 0,!0)]),key:"2"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:n})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:n})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":h.value,"vue-data-ui-fulscreen--off":!h.value}),width:"100%",viewBox:`0 0 ${a.value.width} ${a.value.height}`,style:"background:transparent"},[e.createVNode(ee._sfc_main),e.createElementVNode("defs",null,[e.createElementVNode("clipPath",ne,[e.createElementVNode("rect",{x:"0",y:"0",width:"1",height:"1",rx:"0.5",ry:"0.07",fill:t.value.style.chart.backgroundColor},null,8,ue)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.value,(o,n)=>(e.openBlock(),e.createElementBlock("linearGradient",{id:`vueUiThermometerGradient_${n}_${d.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":o.color},null,8,ie),e.createElementVNode("stop",{offset:"50%","stop-color":e.unref(r.setOpacity)(o.color,100-t.value.style.chart.graduations.gradient.intensity)},null,8,de),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,he)],8,ce))),256))]),e.createElementVNode("g",ve,[e.createElementVNode("rect",{x:a.value.left,y:a.value.top,height:a.value.height-c.value.top-c.value.bottom,width:a.value.width-c.value.left-c.value.right,fill:"#FFFFFF"},null,8,me),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.value,(o,n)=>(e.openBlock(),e.createElementBlock("g",{key:`graduation_${n}`},[e.createElementVNode("rect",{x:o.x,y:o.y,height:o.height,width:a.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right,fill:t.value.style.chart.graduations.gradient.show?`url(#vueUiThermometerGradient_${n}_${d.value})`:o.color,"shape-rendering":"crispEdges"},null,8,pe),t.value.style.chart.graduations.show&&["both","left"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:0,x1:o.x,x2:o.x+10,y1:o.y,y2:o.y,"stroke-width":t.value.style.chart.graduations.strokeWidth,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,ye)):e.createCommentVNode("",!0),t.value.style.chart.graduations.showIntermediate?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.value.style.chart.graduations.show&&["both","left"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:0,x1:o.x,x2:o.x+5,y1:o.halfY,y2:o.halfY,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,fe)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","left"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:1,x1:o.x,x2:o.x+2.5,y1:o.qYLess,y2:o.qYLess,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,ke)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","left"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:o.x,x2:o.x+2.5,y1:o.qYMore,y2:o.qYMore,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,ge)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","right"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:a.value.right,x2:a.value.right-10,y1:o.y,y2:o.y,"stroke-width":t.value.style.chart.graduations.strokeWidth,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,xe)):e.createCommentVNode("",!0),t.value.style.chart.graduations.showIntermediate?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[t.value.style.chart.graduations.show&&["both","right"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:0,x1:a.value.right,x2:a.value.right-5,y1:o.halfY,y2:o.halfY,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,be)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","right"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:1,x1:a.value.right,x2:a.value.right-2.5,y1:o.qYLess,y2:o.qYLess,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,_e)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","right"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:a.value.right,x2:a.value.right-2.5,y1:o.qYMore,y2:o.qYMore,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,Ce)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)]))),128)),e.createElementVNode("rect",{class:e.normalizeClass({"vue-ui-thermometer-temperature":t.value.style.chart.animation.use}),x:a.value.left,y:a.value.top,height:_.value,width:a.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right,fill:"#FFFFFF66"},null,10,we)]),e.createElementVNode("text",{class:e.normalizeClass({"vue-ui-thermometer-temperature-value":t.value.style.chart.animation.use}),y:_.value+a.value.top+t.value.style.chart.label.fontSize/3,x:a.value.left-10,"text-anchor":"end",fill:t.value.style.chart.label.color,"font-size":t.value.style.chart.label.fontSize,"font-weight":t.value.style.chart.label.bold?"bold":"normal"},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.label.formatter,m.dataset.value,e.unref(r.dataLabel)({p:t.value.style.chart.label.prefix,v:m.dataset.value,s:t.value.style.chart.label.suffix,r:t.value.style.chart.label.rounding}),{datapoint:m.dataset})),11,Ne),e.renderSlot(l.$slots,"svg",{svg:U.value},void 0,!0)],10,se)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Be,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref($)||e.unref(F)})),void 0,!0)])):e.createCommentVNode("",!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",Pe,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),k.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Z.default,{key:7,config:{type:"thermometer",style:{backgroundColor:t.value.style.chart.backgroundColor,thermometer:{color:"#CCCCCC"}}}},null,8,["config"]))],14,le))}},Ee=oe._export_sfc(Ve,[["__scopeId","data-v-8a73571f"]]);exports.default=Ee;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-DuDeHJyK.cjs"),Q=require("./Title-DkbnpMvf.cjs"),A=require("./usePrinter-ardO_DNo.cjs"),Z=require("./vue-ui-skeleton-DleyAXe1.cjs"),T=require("./useNestedProp-zkJOoemW.cjs"),ee=require("./PackageVersion-1JWV5loe.cjs"),te=require("./PenAndPaper-C6mnwE-L.cjs"),oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),le=["id"],re={key:1,ref:"noTitle",class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},ae={key:2,style:"width:100%"},se=["xmlns","viewBox"],ne={id:"vueUiPill",clipPathUnits:"objectBoundingBox"},ue=["fill"],ce=["id"],ie=["stop-color"],de=["stop-color"],he=["stop-color"],ve={"clip-path":"url(#vueUiPill)"},me=["x","y","height","width"],pe=["x","y","height","width","fill"],ye=["x1","x2","y1","y2","stroke-width","stroke"],fe=["x1","x2","y1","y2","stroke-width","stroke"],ke=["x1","x2","y1","y2","stroke-width","stroke"],ge=["x1","x2","y1","y2","stroke-width","stroke"],xe=["x1","x2","y1","y2","stroke-width","stroke"],be=["x1","x2","y1","y2","stroke-width","stroke"],_e=["x1","x2","y1","y2","stroke-width","stroke"],Ce=["x1","x2","y1","y2","stroke-width","stroke"],we=["x","y","height","width"],Ne=["y","x","fill","font-size","font-weight"],Be={key:5,class:"vue-data-ui-watermark"},Pe={key:6,ref:"source",dir:"auto"},Ve={__name:"vue-ui-thermometer",props:{dataset:{type:Object,default(){return{}}},config:{type:Object,default(){return{}}}},setup(m,{expose:Y}){const s=m;e.useCssVars(l=>({"000db494":H.value,"2865ccd0":W.value,10843485:G.value}));const{vue_ui_thermometer:M}=r.useConfig(),k=e.computed(()=>!!s.dataset&&Object.keys(s.dataset).length);e.onMounted(()=>{B()});function B(){r.objectIsEmpty(s.dataset)?r.error({componentName:"VueUiThermometer",type:"dataset"}):r.getMissingDatasetAttributes({datasetObject:s.dataset,requiredAttributes:["value","from","to"]}).forEach(l=>{r.error({componentName:"VueUiThermometer",type:"datasetAttribute",property:l})})}const d=e.ref(r.createUid()),g=e.ref(null),P=e.ref(0),V=e.ref(0),t=e.computed({get:()=>E(),set:l=>l});function E(){const l=T.useNestedProp({userConfig:s.config,defaultConfig:M});return l.theme?{...T.useNestedProp({userConfig:r.themes.vue_ui_thermometer[l.theme]||s.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}e.watch(()=>s.config,l=>{t.value=E(),B(),V.value+=1},{deep:!0});const{isPrinting:$,isImaging:F,generatePdf:I,generateImage:q}=A.usePrinter({elementId:`thermometer__${d.value}`,fileName:t.value.style.title.text||"vue-ui-thermometer"}),z=e.computed(()=>t.value.userOptions.show&&!t.value.style.title.text),p=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),L=e.computed(()=>t.value.style.chart.thermometer.width),i=e.computed(()=>s.dataset.steps||10),c=e.ref({top:t.value.style.chart.padding.top,left:t.value.style.chart.padding.left,right:t.value.style.chart.padding.right,bottom:t.value.style.chart.padding.bottom});function y(l,u,o){const n=[],w=S(l),N=S(u);for(let v=0;v<o;v++){const R=x(w.red,N.red,v,o),X=x(w.green,N.green,v,o),J=x(w.blue,N.blue,v,o),K=`#${b(R)}${b(X)}${b(J)}`;n.push(K)}return n}function S(l){const u=l.slice(1);return{red:parseInt(u.slice(0,2),16),green:parseInt(u.slice(2,4),16),blue:parseInt(u.slice(4,6),16)}}function x(l,u,o,n){return Math.round(l+(u-l)*o/n)}function b(l){return l.toString(16).padStart(2,"0")}const a=e.computed(()=>{const l=L.value+c.value.left+c.value.right,u=t.value.style.chart.height;return{width:l,left:c.value.left,right:l-c.value.right,top:c.value.top,bottom:u-c.value.bottom,height:u}}),U=e.computed(()=>a.value),_=e.computed(()=>{const l=r.checkNaN(s.dataset.from)<0?Math.abs(r.checkNaN(s.dataset.from)):r.checkNaN(s.dataset.from),u=r.checkNaN(s.dataset.to)<0?Math.abs(r.checkNaN(s.dataset.to)):r.checkNaN(s.dataset.to);let o=0;return r.checkNaN(s.dataset.to)>0?o=l+u:l>u?o=l-u:o=u-l,(1-(Math.abs(r.checkNaN(s.dataset.from))+r.checkNaN(s.dataset.value))/o)*(a.value.height-c.value.top-c.value.bottom)}),G=e.computed(()=>`${_.value}px`),W=e.computed(()=>`${a.value.height-t.value.style.chart.padding.bottom-c.value.top}px`),H=e.computed(()=>`${t.value.style.chart.animation.speedMs}ms`),j=e.computed(()=>{if(s.dataset.colors){if(!s.dataset.colors.from)return y(p.value[0]||r.palette[0],r.convertColorToHex(s.dataset.colors.to),i.value||10);if(!s.dataset.colors.to)return y(r.convertColorToHex(s.dataset.colors.from),p.value[1]||r.palette[1],i.value||10)}else return y(p.value[1]||r.palette[1],p.value[0]||r.palette[0],i.value||10);return y(r.convertColorToHex(s.dataset.colors.from),r.convertColorToHex(s.dataset.colors.to),i.value||10)}),O=e.computed(()=>{const l=[];let u=0;const o=a.value.height-c.value.top-c.value.bottom;for(let n=0;n<o-1;n+=o/i.value)l.push({x:a.value.left,y:a.value.top+n,qYLess:a.value.top+n+o/i.value/4,halfY:a.value.top+n+o/i.value/2,qYMore:a.value.top+n+o/i.value/4*3,color:j.value[u],height:o/i.value}),u+=1;return l}),h=e.ref(!1);function D(l){h.value=l,P.value+=1}const f=e.ref(!1);function C(){f.value=!f.value}return Y({generatePdf:I,generateImage:q,toggleAnnotator:C}),(l,u)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"thermoChart",ref:g,class:e.normalizeClass(`vue-ui-thermometer ${h.value?"vue-data-ui-wrapper-fullscreen":""}`),style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color};font-family:${t.value.style.fontFamily}`),id:`thermometer__${d.value}`},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(te.PenAndPaper,{key:0,parent:g.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:f.value,onClose:C},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),z.value?(e.openBlock(),e.createElementBlock("div",re,null,512)):e.createCommentVNode("",!0),t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",ae,[(e.openBlock(),e.createBlock(Q._sfc_main,{key:`title_${V.value}`,config:{title:{cy:"thermometer-div-title",...t.value.style.title},subtitle:{cy:"thermometer-div-subtitle",...t.value.style.title.subtitle}}},null,8,["config"]))])):e.createCommentVNode("",!0),t.value.userOptions.show&&k.value?(e.openBlock(),e.createBlock(A.UserOptions,{ref:"details",key:`user_options_${P.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(F),isPrinting:e.unref($),uid:d.value,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,hasXls:!1,isFullscreen:h.value,titles:{...t.value.userOptions.buttonTitles},chartElement:g.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:f.value,onToggleFullscreen:D,onGeneratePdf:e.unref(I),onGenerateImage:e.unref(q),onToggleAnnotator:C},e.createSlots({_:2},[l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:n})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:n})),void 0,!0)]),key:"2"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:n})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:n})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":h.value,"vue-data-ui-fulscreen--off":!h.value}),width:"100%",viewBox:`0 0 ${a.value.width} ${a.value.height}`,style:"background:transparent"},[e.createVNode(ee._sfc_main),e.createElementVNode("defs",null,[e.createElementVNode("clipPath",ne,[e.createElementVNode("rect",{x:"0",y:"0",width:"1",height:"1",rx:"0.5",ry:"0.07",fill:t.value.style.chart.backgroundColor},null,8,ue)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.value,(o,n)=>(e.openBlock(),e.createElementBlock("linearGradient",{id:`vueUiThermometerGradient_${n}_${d.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":o.color},null,8,ie),e.createElementVNode("stop",{offset:"50%","stop-color":e.unref(r.setOpacity)(o.color,100-t.value.style.chart.graduations.gradient.intensity)},null,8,de),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,he)],8,ce))),256))]),e.createElementVNode("g",ve,[e.createElementVNode("rect",{x:a.value.left,y:a.value.top,height:a.value.height-c.value.top-c.value.bottom,width:a.value.width-c.value.left-c.value.right,fill:"#FFFFFF"},null,8,me),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.value,(o,n)=>(e.openBlock(),e.createElementBlock("g",{key:`graduation_${n}`},[e.createElementVNode("rect",{x:o.x,y:o.y,height:o.height,width:a.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right,fill:t.value.style.chart.graduations.gradient.show?`url(#vueUiThermometerGradient_${n}_${d.value})`:o.color,"shape-rendering":"crispEdges"},null,8,pe),t.value.style.chart.graduations.show&&["both","left"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:0,x1:o.x,x2:o.x+10,y1:o.y,y2:o.y,"stroke-width":t.value.style.chart.graduations.strokeWidth,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,ye)):e.createCommentVNode("",!0),t.value.style.chart.graduations.showIntermediate?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.value.style.chart.graduations.show&&["both","left"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:0,x1:o.x,x2:o.x+5,y1:o.halfY,y2:o.halfY,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,fe)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","left"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:1,x1:o.x,x2:o.x+2.5,y1:o.qYLess,y2:o.qYLess,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,ke)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","left"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:o.x,x2:o.x+2.5,y1:o.qYMore,y2:o.qYMore,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,ge)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","right"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:a.value.right,x2:a.value.right-10,y1:o.y,y2:o.y,"stroke-width":t.value.style.chart.graduations.strokeWidth,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,xe)):e.createCommentVNode("",!0),t.value.style.chart.graduations.showIntermediate?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[t.value.style.chart.graduations.show&&["both","right"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:0,x1:a.value.right,x2:a.value.right-5,y1:o.halfY,y2:o.halfY,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,be)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","right"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:1,x1:a.value.right,x2:a.value.right-2.5,y1:o.qYLess,y2:o.qYLess,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,_e)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","right"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:a.value.right,x2:a.value.right-2.5,y1:o.qYMore,y2:o.qYMore,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,Ce)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)]))),128)),e.createElementVNode("rect",{class:e.normalizeClass({"vue-ui-thermometer-temperature":t.value.style.chart.animation.use}),x:a.value.left,y:a.value.top,height:_.value,width:a.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right,fill:"#FFFFFF66"},null,10,we)]),e.createElementVNode("text",{class:e.normalizeClass({"vue-ui-thermometer-temperature-value":t.value.style.chart.animation.use}),y:_.value+a.value.top+t.value.style.chart.label.fontSize/3,x:a.value.left-10,"text-anchor":"end",fill:t.value.style.chart.label.color,"font-size":t.value.style.chart.label.fontSize,"font-weight":t.value.style.chart.label.bold?"bold":"normal"},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.label.formatter,m.dataset.value,e.unref(r.dataLabel)({p:t.value.style.chart.label.prefix,v:m.dataset.value,s:t.value.style.chart.label.suffix,r:t.value.style.chart.label.rounding}),{datapoint:m.dataset})),11,Ne),e.renderSlot(l.$slots,"svg",{svg:U.value},void 0,!0)],10,se)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Be,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref($)||e.unref(F)})),void 0,!0)])):e.createCommentVNode("",!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",Pe,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),k.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Z.default,{key:7,config:{type:"thermometer",style:{backgroundColor:t.value.style.chart.backgroundColor,thermometer:{color:"#CCCCCC"}}}},null,8,["config"]))],14,le))}},Ee=oe._export_sfc(Ve,[["__scopeId","data-v-8a73571f"]]);exports.default=Ee;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),L=require("./useNestedProp-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),L=require("./useNestedProp-zkJOoemW.cjs"),g=require("./index-DuDeHJyK.cjs"),$=require("./useResponsive-BJ7DTGpm.cjs"),B=require("./BaseIcon-DUokibJ1.cjs"),j=require("./Title-DkbnpMvf.cjs"),q=require("./PackageVersion-1JWV5loe.cjs"),O=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");class U{constructor(T,v,y,E=!0,b=!0){this.interval=v,this.elapsed=0,this.isPaused=!1;const S=`
|
|
2
2
|
let interval;
|
|
3
3
|
let elapsed = 0;
|
|
4
4
|
let paused = false;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ref as n, onMounted as Q, onBeforeUnmount as Y, computed as z, watch as Z, openBlock as l, createElementBlock as r, normalizeStyle as f, createBlock as ee, createCommentVNode as v, unref as te, createVNode as M, createElementVNode as C, mergeProps as V, renderSlot as O, normalizeProps as U, guardReactiveProps as E, toDisplayString as ae } from "vue";
|
|
2
|
-
import { u as se } from "./useNestedProp-
|
|
3
|
-
import { u as le, c as oe, X as re, F as W } from "./index-
|
|
2
|
+
import { u as se } from "./useNestedProp-BYPZJNhi.js";
|
|
3
|
+
import { u as le, c as oe, X as re, F as W } from "./index-Cm2_6s9o.js";
|
|
4
4
|
import { t as ue, u as ie } from "./useResponsive-CoxXLe23.js";
|
|
5
|
-
import P from "./BaseIcon-
|
|
6
|
-
import { _ as ne } from "./Title-
|
|
7
|
-
import { _ as ce } from "./PackageVersion-
|
|
5
|
+
import P from "./BaseIcon-DpLJi6ci.js";
|
|
6
|
+
import { _ as ne } from "./Title-Coit3NcT.js";
|
|
7
|
+
import { _ as ce } from "./PackageVersion-CTMY4zeY.js";
|
|
8
8
|
import { _ as de } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
9
9
|
class he {
|
|
10
10
|
constructor(A, k, T, H = !0, x = !0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),V=require("./useNestedProp-C8Y0yWDq.cjs"),c=require("./index-ZAR4YEAn.cjs"),X=require("./Title-CtfsoH8U.cjs"),L=require("./usePrinter-Cw4E_LYe.cjs"),Y=require("./vue-ui-skeleton-urNi7er0.cjs"),J=require("./PackageVersion-DylCZJMA.cjs"),K=require("./PenAndPaper-2aIJsXNH.cjs"),Q=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),W=["id"],Z={key:2,style:"width:100%;background:transparent;padding-bottom:12px"},ee=["xmlns","viewBox"],te={key:0},ae=["d","stroke-width","stroke"],oe={key:1},le=["x1","y1","x2","y2","stroke-width","stroke"],re=["x","y","font-size","fill","font-weight","text-anchor"],ne={key:5,class:"vue-data-ui-watermark"},se={key:6,ref:"source",dir:"auto"},ue={__name:"vue-ui-tiremarks",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(M,{expose:G}){const v=M,{vue_ui_tiremarks:j}=c.useConfig(),P=e.computed(()=>!!v.dataset&&Object.keys(v.dataset).length),$=e.ref(c.createUid()),B=e.ref(null),U=e.ref(null),A=e.ref(0),N=e.ref(0),t=e.computed({get:()=>S(),set:a=>a});function S(){const a=V.useNestedProp({userConfig:v.config,defaultConfig:j});return a.theme?{...V.useNestedProp({userConfig:c.themes.vue_ui_tiremarks[a.theme]||v.config,defaultConfig:a})}:a}e.watch(()=>v.config,a=>{t.value=S(),T(),N.value+=1},{deep:!0});const{isPrinting:z,isImaging:I,generatePdf:O,generateImage:F}=L.usePrinter({elementId:$.value,fileName:t.value.style.chart.title.text||"vue-ui-tiremarks"}),H=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),n=e.ref(t.value.style.chart.animation.use?0:c.checkNaN(v.dataset.percentage));e.watch(()=>v.dataset,a=>{t.value.style.chart.animation.use?E(a.percentage):n.value=a.percentage||0},{deep:!0}),e.onMounted(()=>{T()});function E(a){let u=t.value.style.chart.animation.speed;const o=Math.abs(a-n.value)/(u*120);function r(){n.value<a?n.value=Math.min(n.value+o,a):n.value>a&&(n.value=Math.max(n.value-o,a)),n.value!==a&&requestAnimationFrame(r)}r()}function T(){c.objectIsEmpty(v.dataset)&&c.error({componentName:"VueUiTiremarks",type:"dataset"}),E(v.dataset.percentage||0)}const f=e.computed(()=>t.value.style.chart.layout.display==="vertical"),s=e.computed(()=>{const a={top:48,left:64,right:64,bottom:48};return f.value?{top:t.value.style.chart.percentage.verticalPosition==="top"?a.top:3,left:3,right:3,bottom:t.value.style.chart.percentage.verticalPosition==="bottom"?a.bottom:3}:{top:0,bottom:0,left:t.value.style.chart.percentage.horizontalPosition==="left"?a.left:3,right:t.value.style.chart.percentage.horizontalPosition==="right"?a.right:10}}),b=e.computed(()=>Object.values(s.value).reduce((a,u)=>a+u,0)),l=e.computed(()=>({height:f.value?312:56,width:f.value?56:312})),D=e.ref(100);e.computed(()=>v.dataset.percentage/D.value);const i=e.computed(()=>f.value?{mark:(l.value.height-b.value)/100*.5,space:(l.value.height-b.value)/100*.5}:{mark:(l.value.width-b.value)/100*.5,space:(l.value.width-b.value)/100*.5}),q=e.computed(()=>{const a=[];for(let o=0;o<100;o+=1){const r=t.value.style.chart.layout.ticks.gradient.show?c.shiftHue(t.value.style.chart.layout.activeColor,o/100*(t.value.style.chart.layout.ticks.gradient.shiftHueIntensity/100)):t.value.style.chart.layout.activeColor;if(f.value){const y=t.value.style.chart.layout.crescendo?(100-o)*(l.value.width-s.value.left-s.value.right)/100/3:0,d=s.value.left+4+y,h=l.value.width-s.value.right-4-y,p=l.value.height-s.value.bottom-o*i.value.mark-o*i.value.space-i.value.mark,m=l.value.height-s.value.bottom-o*i.value.mark-o*i.value.space-i.value.mark,k=(h-d)/t.value.style.chart.layout.curveAngleX,C=t.value.style.chart.layout.curveAngleY*((1+o)/100);a.push({x1:d,x2:h,y1:p,y2:m,curve:`M ${d} ${p} C ${d+k} ${p-C}, ${h-k} ${m-C}, ${h} ${m}`,color:r})}else{const y=t.value.style.chart.layout.crescendo?(100-o)*(l.value.height-s.value.top-s.value.bottom)/100/3:0,d=s.value.left+o*i.value.mark+o*i.value.space-i.value.mark,h=d,p=s.value.top+4+y,m=l.value.height-s.value.bottom-4-y,k=t.value.style.chart.layout.curveAngleY*((1+o)/100),C=(m-p)/t.value.style.chart.layout.curveAngleX;a.push({x1:d,x2:h,y1:p,y2:m,curve:`M ${d} ${p} C ${d+k} ${p+C}, ${h+k} ${m-C}, ${h} ${m}`,color:r})}}return a}),g=e.computed(()=>{let a,u,o;const r=t.value.style.chart.percentage.fontSize/3;return f.value?t.value.style.chart.percentage.verticalPosition==="top"?(a=l.value.width/2,u=s.value.top/2,o="middle"):t.value.style.chart.percentage.verticalPosition==="bottom"&&(a=l.value.width/2,u=l.value.height-s.value.bottom/2+r,o="middle"):t.value.style.chart.percentage.horizontalPosition==="left"?(a=4,u=l.value.height/2+r,o="start"):t.value.style.chart.percentage.horizontalPosition==="right"&&(a=l.value.width-s.value.right+8,u=l.value.height/2+r,o="start"),{x:a,y:u,textAnchor:o,bold:t.value.style.chart.percentage.bold,fontSize:t.value.style.chart.percentage.fontSize,fill:t.value.style.chart.percentage.color}}),_=e.ref(!1);function R(a){_.value=a,A.value+=1}const w=e.ref(!1);function x(){w.value=!w.value}return G({generatePdf:O,generateImage:F,toggleAnnotator:x}),(a,u)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tiremarksChart",ref:B,class:e.normalizeClass(`vue-ui-tiremarks ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor}`),id:$.value},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(K.PenAndPaper,{key:0,parent:B.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:w.value,onClose:x},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),H.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:U,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",Z,[(e.openBlock(),e.createBlock(X._sfc_main,{key:`title_${N.value}`,config:{title:{cy:"wheel-title",...t.value.style.chart.title},subtitle:{cy:"wheel-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))])):e.createCommentVNode("",!0),t.value.userOptions.show&&P.value?(e.openBlock(),e.createBlock(L.UserOptions,{ref:"details",key:`user_options_${A.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(z),isImaging:e.unref(I),uid:$.value,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,hasXls:!1,isFullscreen:_.value,titles:{...t.value.userOptions.buttonTitles},chartElement:B.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:w.value,onToggleFullscreen:R,onGeneratePdf:e.unref(O),onGenerateImage:e.unref(F),onToggleAnnotator:x},e.createSlots({_:2},[a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:r})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:r})),void 0,!0)]),key:"2"}:void 0,a.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:r})=>[e.renderSlot(a.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:r})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),P.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(c.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":_.value,"vue-data-ui-fulscreen--off":!_.value}),viewBox:`0 0 ${l.value.width} ${l.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(J._sfc_main),t.value.style.chart.layout.curved?(e.openBlock(),e.createElementBlock("g",te,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(q.value,(o,r)=>(e.openBlock(),e.createElementBlock("path",{d:o.curve,"stroke-width":i.value.mark,stroke:n.value>=r?o.color:t.value.style.chart.layout.inactiveColor,"stroke-linecap":"round",fill:"none",class:e.normalizeClass({"vue-ui-tick-animated":t.value.style.chart.animation.use&&r<=n.value})},null,10,ae))),256))])):(e.openBlock(),e.createElementBlock("g",oe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(q.value,(o,r)=>(e.openBlock(),e.createElementBlock("line",{x1:o.x1,y1:o.y1,x2:o.x2,y2:o.y2,"stroke-width":i.value.mark,stroke:n.value>=r?o.color:t.value.style.chart.layout.inactiveColor,"stroke-linecap":"round"},null,8,le))),256))])),t.value.style.chart.percentage.show?(e.openBlock(),e.createElementBlock("text",{key:2,x:g.value.x,y:g.value.y,"font-size":g.value.fontSize,fill:t.value.style.chart.layout.ticks.gradient.show&&t.value.style.chart.percentage.useGradientColor?e.unref(c.shiftHue)(t.value.style.chart.layout.activeColor,n.value/100*(t.value.style.chart.layout.ticks.gradient.shiftHueIntensity/100)):t.value.style.chart.percentage.color,"font-weight":g.value.bold?"bold":"normal","text-anchor":g.value.textAnchor},e.toDisplayString(e.unref(c.applyDataLabel)(t.value.style.chart.percentage.formatter,n.value,e.unref(c.dataLabel)({v:n.value,s:"%",r:t.value.style.chart.percentage.rounding}))),9,re)):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"svg",{svg:l.value},void 0,!0)],14,ee)):e.createCommentVNode("",!0),a.$slots.watermark?(e.openBlock(),e.createElementBlock("div",ne,[e.renderSlot(a.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(z)||e.unref(I)})),void 0,!0)])):e.createCommentVNode("",!0),a.$slots.source?(e.openBlock(),e.createElementBlock("div",se,[e.renderSlot(a.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),P.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Y.default,{key:7,config:{type:"tiremarks",style:{backgroundColor:t.value.style.chart.backgroundColor,tiremarks:{color:"#CCCCCC"}}}},null,8,["config"]))],14,W))}},ie=Q._export_sfc(ue,[["__scopeId","data-v-93332410"]]);exports.default=ie;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),V=require("./useNestedProp-zkJOoemW.cjs"),c=require("./index-DuDeHJyK.cjs"),X=require("./Title-DkbnpMvf.cjs"),L=require("./usePrinter-ardO_DNo.cjs"),Y=require("./vue-ui-skeleton-DleyAXe1.cjs"),J=require("./PackageVersion-1JWV5loe.cjs"),K=require("./PenAndPaper-C6mnwE-L.cjs"),Q=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),W=["id"],Z={key:2,style:"width:100%;background:transparent;padding-bottom:12px"},ee=["xmlns","viewBox"],te={key:0},ae=["d","stroke-width","stroke"],oe={key:1},le=["x1","y1","x2","y2","stroke-width","stroke"],re=["x","y","font-size","fill","font-weight","text-anchor"],ne={key:5,class:"vue-data-ui-watermark"},se={key:6,ref:"source",dir:"auto"},ue={__name:"vue-ui-tiremarks",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(M,{expose:G}){const v=M,{vue_ui_tiremarks:j}=c.useConfig(),P=e.computed(()=>!!v.dataset&&Object.keys(v.dataset).length),$=e.ref(c.createUid()),B=e.ref(null),U=e.ref(null),A=e.ref(0),N=e.ref(0),t=e.computed({get:()=>S(),set:a=>a});function S(){const a=V.useNestedProp({userConfig:v.config,defaultConfig:j});return a.theme?{...V.useNestedProp({userConfig:c.themes.vue_ui_tiremarks[a.theme]||v.config,defaultConfig:a})}:a}e.watch(()=>v.config,a=>{t.value=S(),T(),N.value+=1},{deep:!0});const{isPrinting:z,isImaging:I,generatePdf:O,generateImage:F}=L.usePrinter({elementId:$.value,fileName:t.value.style.chart.title.text||"vue-ui-tiremarks"}),H=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),n=e.ref(t.value.style.chart.animation.use?0:c.checkNaN(v.dataset.percentage));e.watch(()=>v.dataset,a=>{t.value.style.chart.animation.use?E(a.percentage):n.value=a.percentage||0},{deep:!0}),e.onMounted(()=>{T()});function E(a){let u=t.value.style.chart.animation.speed;const o=Math.abs(a-n.value)/(u*120);function r(){n.value<a?n.value=Math.min(n.value+o,a):n.value>a&&(n.value=Math.max(n.value-o,a)),n.value!==a&&requestAnimationFrame(r)}r()}function T(){c.objectIsEmpty(v.dataset)&&c.error({componentName:"VueUiTiremarks",type:"dataset"}),E(v.dataset.percentage||0)}const f=e.computed(()=>t.value.style.chart.layout.display==="vertical"),s=e.computed(()=>{const a={top:48,left:64,right:64,bottom:48};return f.value?{top:t.value.style.chart.percentage.verticalPosition==="top"?a.top:3,left:3,right:3,bottom:t.value.style.chart.percentage.verticalPosition==="bottom"?a.bottom:3}:{top:0,bottom:0,left:t.value.style.chart.percentage.horizontalPosition==="left"?a.left:3,right:t.value.style.chart.percentage.horizontalPosition==="right"?a.right:10}}),b=e.computed(()=>Object.values(s.value).reduce((a,u)=>a+u,0)),l=e.computed(()=>({height:f.value?312:56,width:f.value?56:312})),D=e.ref(100);e.computed(()=>v.dataset.percentage/D.value);const i=e.computed(()=>f.value?{mark:(l.value.height-b.value)/100*.5,space:(l.value.height-b.value)/100*.5}:{mark:(l.value.width-b.value)/100*.5,space:(l.value.width-b.value)/100*.5}),q=e.computed(()=>{const a=[];for(let o=0;o<100;o+=1){const r=t.value.style.chart.layout.ticks.gradient.show?c.shiftHue(t.value.style.chart.layout.activeColor,o/100*(t.value.style.chart.layout.ticks.gradient.shiftHueIntensity/100)):t.value.style.chart.layout.activeColor;if(f.value){const y=t.value.style.chart.layout.crescendo?(100-o)*(l.value.width-s.value.left-s.value.right)/100/3:0,d=s.value.left+4+y,h=l.value.width-s.value.right-4-y,p=l.value.height-s.value.bottom-o*i.value.mark-o*i.value.space-i.value.mark,m=l.value.height-s.value.bottom-o*i.value.mark-o*i.value.space-i.value.mark,k=(h-d)/t.value.style.chart.layout.curveAngleX,C=t.value.style.chart.layout.curveAngleY*((1+o)/100);a.push({x1:d,x2:h,y1:p,y2:m,curve:`M ${d} ${p} C ${d+k} ${p-C}, ${h-k} ${m-C}, ${h} ${m}`,color:r})}else{const y=t.value.style.chart.layout.crescendo?(100-o)*(l.value.height-s.value.top-s.value.bottom)/100/3:0,d=s.value.left+o*i.value.mark+o*i.value.space-i.value.mark,h=d,p=s.value.top+4+y,m=l.value.height-s.value.bottom-4-y,k=t.value.style.chart.layout.curveAngleY*((1+o)/100),C=(m-p)/t.value.style.chart.layout.curveAngleX;a.push({x1:d,x2:h,y1:p,y2:m,curve:`M ${d} ${p} C ${d+k} ${p+C}, ${h+k} ${m-C}, ${h} ${m}`,color:r})}}return a}),g=e.computed(()=>{let a,u,o;const r=t.value.style.chart.percentage.fontSize/3;return f.value?t.value.style.chart.percentage.verticalPosition==="top"?(a=l.value.width/2,u=s.value.top/2,o="middle"):t.value.style.chart.percentage.verticalPosition==="bottom"&&(a=l.value.width/2,u=l.value.height-s.value.bottom/2+r,o="middle"):t.value.style.chart.percentage.horizontalPosition==="left"?(a=4,u=l.value.height/2+r,o="start"):t.value.style.chart.percentage.horizontalPosition==="right"&&(a=l.value.width-s.value.right+8,u=l.value.height/2+r,o="start"),{x:a,y:u,textAnchor:o,bold:t.value.style.chart.percentage.bold,fontSize:t.value.style.chart.percentage.fontSize,fill:t.value.style.chart.percentage.color}}),_=e.ref(!1);function R(a){_.value=a,A.value+=1}const w=e.ref(!1);function x(){w.value=!w.value}return G({generatePdf:O,generateImage:F,toggleAnnotator:x}),(a,u)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tiremarksChart",ref:B,class:e.normalizeClass(`vue-ui-tiremarks ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor}`),id:$.value},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(K.PenAndPaper,{key:0,parent:B.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:w.value,onClose:x},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),H.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:U,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",Z,[(e.openBlock(),e.createBlock(X._sfc_main,{key:`title_${N.value}`,config:{title:{cy:"wheel-title",...t.value.style.chart.title},subtitle:{cy:"wheel-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))])):e.createCommentVNode("",!0),t.value.userOptions.show&&P.value?(e.openBlock(),e.createBlock(L.UserOptions,{ref:"details",key:`user_options_${A.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(z),isImaging:e.unref(I),uid:$.value,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,hasXls:!1,isFullscreen:_.value,titles:{...t.value.userOptions.buttonTitles},chartElement:B.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:w.value,onToggleFullscreen:R,onGeneratePdf:e.unref(O),onGenerateImage:e.unref(F),onToggleAnnotator:x},e.createSlots({_:2},[a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:r})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:r})),void 0,!0)]),key:"2"}:void 0,a.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:r})=>[e.renderSlot(a.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:r})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),P.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(c.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":_.value,"vue-data-ui-fulscreen--off":!_.value}),viewBox:`0 0 ${l.value.width} ${l.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(J._sfc_main),t.value.style.chart.layout.curved?(e.openBlock(),e.createElementBlock("g",te,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(q.value,(o,r)=>(e.openBlock(),e.createElementBlock("path",{d:o.curve,"stroke-width":i.value.mark,stroke:n.value>=r?o.color:t.value.style.chart.layout.inactiveColor,"stroke-linecap":"round",fill:"none",class:e.normalizeClass({"vue-ui-tick-animated":t.value.style.chart.animation.use&&r<=n.value})},null,10,ae))),256))])):(e.openBlock(),e.createElementBlock("g",oe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(q.value,(o,r)=>(e.openBlock(),e.createElementBlock("line",{x1:o.x1,y1:o.y1,x2:o.x2,y2:o.y2,"stroke-width":i.value.mark,stroke:n.value>=r?o.color:t.value.style.chart.layout.inactiveColor,"stroke-linecap":"round"},null,8,le))),256))])),t.value.style.chart.percentage.show?(e.openBlock(),e.createElementBlock("text",{key:2,x:g.value.x,y:g.value.y,"font-size":g.value.fontSize,fill:t.value.style.chart.layout.ticks.gradient.show&&t.value.style.chart.percentage.useGradientColor?e.unref(c.shiftHue)(t.value.style.chart.layout.activeColor,n.value/100*(t.value.style.chart.layout.ticks.gradient.shiftHueIntensity/100)):t.value.style.chart.percentage.color,"font-weight":g.value.bold?"bold":"normal","text-anchor":g.value.textAnchor},e.toDisplayString(e.unref(c.applyDataLabel)(t.value.style.chart.percentage.formatter,n.value,e.unref(c.dataLabel)({v:n.value,s:"%",r:t.value.style.chart.percentage.rounding}))),9,re)):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"svg",{svg:l.value},void 0,!0)],14,ee)):e.createCommentVNode("",!0),a.$slots.watermark?(e.openBlock(),e.createElementBlock("div",ne,[e.renderSlot(a.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(z)||e.unref(I)})),void 0,!0)])):e.createCommentVNode("",!0),a.$slots.source?(e.openBlock(),e.createElementBlock("div",se,[e.renderSlot(a.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),P.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Y.default,{key:7,config:{type:"tiremarks",style:{backgroundColor:t.value.style.chart.backgroundColor,tiremarks:{color:"#CCCCCC"}}}},null,8,["config"]))],14,W))}},ie=Q._export_sfc(ue,[["__scopeId","data-v-93332410"]]);exports.default=ie;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { computed as v, ref as p, watch as J, onMounted as ne, openBlock as r, createElementBlock as u, normalizeClass as G, normalizeStyle as K, createBlock as O, createCommentVNode as g, unref as d, createSlots as ue, withCtx as F, renderSlot as _, normalizeProps as L, guardReactiveProps as M, createVNode as ie, Fragment as Q, renderList as V, toDisplayString as ce } from "vue";
|
|
2
|
-
import { u as W } from "./useNestedProp-
|
|
3
|
-
import { u as ve, c as he, t as de, v as fe, o as pe, e as ge, w as Z, X as me, i as ye, f as ke } from "./index-
|
|
4
|
-
import { _ as _e } from "./Title-
|
|
5
|
-
import { u as be, U as Ce } from "./usePrinter-
|
|
6
|
-
import $e from "./vue-ui-skeleton-
|
|
7
|
-
import { _ as we } from "./PackageVersion-
|
|
8
|
-
import { P as xe } from "./PenAndPaper-
|
|
2
|
+
import { u as W } from "./useNestedProp-BYPZJNhi.js";
|
|
3
|
+
import { u as ve, c as he, t as de, v as fe, o as pe, e as ge, w as Z, X as me, i as ye, f as ke } from "./index-Cm2_6s9o.js";
|
|
4
|
+
import { _ as _e } from "./Title-Coit3NcT.js";
|
|
5
|
+
import { u as be, U as Ce } from "./usePrinter-Cx8U1e30.js";
|
|
6
|
+
import $e from "./vue-ui-skeleton-BUS6A44x.js";
|
|
7
|
+
import { _ as we } from "./PackageVersion-CTMY4zeY.js";
|
|
8
|
+
import { P as xe } from "./PenAndPaper-DJ_d10S-.js";
|
|
9
9
|
import { _ as Pe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
10
10
|
const Ae = ["id"], Ie = {
|
|
11
11
|
key: 2,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-ZAR4YEAn.cjs"),Pe=require("./Title-CtfsoH8U.cjs"),pe=require("./usePrinter-Cw4E_LYe.cjs"),ze=require("./Tooltip-6D9aABEX.cjs"),Oe=require("./Legend-eRHr8IFu.cjs"),Ve=require("./vue-ui-skeleton-urNi7er0.cjs"),Ee=require("./DataTable-WzoXT7XP.cjs"),Le=require("./vue-ui-accordion-zOz2K8wY.cjs"),fe=require("./useResponsive-BJ7DTGpm.cjs"),ge=require("./useNestedProp-C8Y0yWDq.cjs"),Re=require("./PackageVersion-DylCZJMA.cjs"),Ae=require("./PenAndPaper-2aIJsXNH.cjs"),Fe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");function me(n,d){const s=n.length;if(s===0)throw new Error(`Max aspect ratio cannot be computed: ${n} is an empty array`);{let u=1/0,c=-1/0,v=0;for(let f=0;f<s;f+=1){const p=n[f].normalizedValue;p<u&&(u=p),p>c&&(c=p),v+=p}return Math.max(d**2*c/v**2,v**2/(d**2*u))}}function ye(n){const{xOffset:d,yOffset:s,width:u,height:c}=n;return{x0:d,y0:s,x1:d+u,y1:s+c}}function Ie(n,d,s){if(n.length===0)return!0;{const u=n.concat(d),c=me(n,s),v=me(u,s);return c>=v}}function De(n){const d=[],s=n.length;for(let u=0;u<s;u+=1){const c=n[u],v=c.length;for(let h=0;h<v;h+=1)d.push(c[h])}return d}function qe(n,d){const s={...d,children:n};return ke(s)}function He(n){return(n.x1-n.x0)*(n.y1-n.y0)}function be(n,d){const{width:s,height:u,xOffset:c,yOffset:v}=X(d),h=n.length,f=n.map(g=>g.normalizedValue||0).reduce((g,k)=>g+k,0),p=f/u,C=f/s;let b=c,w=v;const m=[];if(s>=u){for(let g=0;g<h;g+=1){const k=n[g],x=w+k.normalizedValue/p,B={x0:b,y0:w,x1:b+p,y1:x},T=Object.assign({},k,B);w=x,m.push(T)}return m}else{for(let g=0;g<h;g+=1){const k=n[g],x=b+k.normalizedValue/C,B={x0:b,y0:w,x1:x,y1:w+C},T=Object.assign({},k,B);b=x,m.push(T)}return m}}function Me(n){const d=X(n),s=d.width,u=d.height;return Math.min(s,u)}function We(n,d){const s=n.length,u=n.map(p=>p.value??0).reduce((p,C)=>p+C,0),c=d/u,v=[];let h,f;for(let p=0;p<s;p+=1)f=n[p],h=Object.assign({},f,{normalizedValue:f.value*(c||0)}),v.push(h);return v}function X(n){const{x0:d,y0:s,x1:u,y1:c}=n;return{xOffset:d,yOffset:s,width:u-d,height:c-s}}function Ue(n,d,s,u){let c=n,v=d,h=s,f=u;for(;;){const p=c.length;if(p===0){const m=be(v,h);return f.concat(m)}const C=Me(h),b=c[0],w=c.slice(1,p);if(Ie(v,b,C)){const m=v.concat(b);c=w,v=m,h=h,f=f}else{const m=v.length;let g=0;for(let T=0;T<m;T+=1)g+=v[T].normalizedValue;const k=Ge(h,g),x=be(v,h),B=f.concat(x);c=c,v=[],h=k,f=B}}}function ke(n){if(typeof n.children>"u"||!n.children.length)return[n];{const d=We(n.children,He(n)),s=Ue(d,[],n,[]),u=s.length,c=[];for(let h=0;h<u;h+=1)c.push(ke(s[h]));return De(c)}}function Ge(n,d){const{width:s,height:u,xOffset:c,yOffset:v}=X(n);if(s>=u){const h=d/u,f=s-h,p={xOffset:c+h,yOffset:v,width:f,height:u};return ye(p)}else{const h=d/s,f=u-h,p={xOffset:c,yOffset:v+h,width:s,height:f};return ye(p)}}const je=n=>(e.pushScopeId("data-v-69853ca9"),n=n(),e.popScopeId(),n),Xe=["id"],Ye=["xmlns","viewBox"],Ze={key:0},Je=["id"],Ke=["stop-color"],Qe=["stop-color"],et=["x","y","height","width","fill","rx","stroke","stroke-width","onClick","onMouseenter"],tt=["x","y","height","width"],ot={style:{width:"100%",height:"100%"},class:"vue-ui-treemap-cell"},lt=je(()=>e.createElementVNode("br",null,null,-1)),at={key:5,class:"vue-data-ui-watermark"},nt=["onClick"],rt={key:0},ut={key:1},st=["innerHTML"],it={__name:"vue-ui-treemap",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(n,{expose:d,emit:s}){const u=n,{vue_ui_treemap:c}=r.useConfig(),v=e.computed(()=>!!u.dataset&&u.dataset.length),h=e.computed(()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),f=e.ref(r.createUid()),p=e.ref(!1),C=e.ref(""),b=e.ref(!1),w=e.ref(0),m=e.ref([]),g=e.ref(null),k=e.ref(null),x=e.ref(null),B=e.ref(null),T=e.ref(null),Y=e.ref(0),Z=e.ref(0),J=e.ref(0),t=e.computed({get:()=>K(),set:o=>o});function K(){const o=ge.useNestedProp({userConfig:u.config,defaultConfig:c});return o.theme?{...ge.useNestedProp({userConfig:r.themes.vue_ui_treemap[o.theme]||u.config,defaultConfig:o}),customPalette:r.themePalettes[o.theme]||r.palette}:o}e.watch(()=>u.config,o=>{t.value=K(),Y.value+=1,Z.value+=1,J.value+=1},{deep:!0});const{isPrinting:Q,isImaging:ee,generatePdf:te,generateImage:oe}=pe.usePrinter({elementId:`treemap_${f.value}`,fileName:t.value.style.chart.title.text||"vue-ui-treemap"}),Ce=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),I=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),_=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),P=e.ref({height:t.value.style.chart.height,width:t.value.style.chart.width}),O=e.computed(()=>({bottom:P.value.height-t.value.style.chart.padding.bottom,height:P.value.height-t.value.style.chart.padding.top-t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:P.value.width-t.value.style.chart.padding.right,top:t.value.style.chart.padding.top,vbHeight:P.value.height,vbWidth:P.value.width,width:P.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right}));function le(o){o.forEach((a,l)=>{a.id=r.createUid(),a.color=r.convertColorToHex(a.color)||I.value[l]||r.palette[l]||r.palette[l%r.palette.length],a.children&&(a.children.forEach(i=>{i.parentId=a.id,i.color=a.color}),le(a.children))})}const V=e.ref(u.dataset),D=e.ref(null);e.onMounted(()=>{we()});function we(){if(r.objectIsEmpty(u.dataset)&&r.error({componentName:"VueUiTreemap",type:"dataset"}),le(V.value),t.value.responsive){const o=fe.throttle(()=>{const{width:a,height:l}=fe.useResponsive({chart:g.value,title:t.value.style.chart.title.text?k.value:null,legend:t.value.style.chart.legend.show?x.value:null,source:B.value,noTitle:T.value});P.value.width=a,P.value.height=l});D.value=new ResizeObserver(o),D.value.observe(g.value.parentNode)}}e.onBeforeUnmount(()=>{D.value&&D.value.disconnect()});const W=e.ref(V.value),A=e.computed(()=>W.value.map((o,a)=>({...o,color:r.convertColorToHex(o.color)||I.value[a]||r.palette[a]||r.palette[a%r.palette.length]})).filter(o=>!m.value.includes(o.id))),L=e.computed(()=>V.value.filter(o=>!m.value.includes(o.id)).map(o=>o.value||0).reduce((o,a)=>o+a,0)),ae=e.computed({get(){let o=[...A.value];return t.value.style.chart.layout.sorted&&(o=[...A.value].sort((a,l)=>l.value-a.value)),o.map(a=>({...a}))},set(o){return o}});function ne(o,a){return o.value/a}function xe(o,a,l){const i=t.value.style.chart.layout.rects.colorRatio-ne(a,l);return r.lightenHexColor(o,i<0?0:i)}function re(o,a,l,i){return o.map((y,z)=>{const M=xe(r.convertColorToHex(a)||I.value[z]||r.palette[z]||r.palette[z%r.palette.length],y,i),_e=ne(y,i);return{...y,color:M,proportion:_e,parentName:l,children:y.children?re(y.children,M,y.name,i):void 0}})}const F=e.computed(()=>qe(ae.value.map((o,a)=>{const l=o.children?o.children.reduce((i,y)=>i+y.value,0):o.value;return{value:o.value,id:o.id,children:o.children?re(o.children.sort((i,y)=>y.value-i.value),o.color,o.name,l):void 0,color:o.color,name:o.name}}),{x0:O.value.left*2,y0:O.value.top,x1:O.value.width,y1:O.value.height}));function ue({y0:o,y1:a}){return a-o<=0?1e-4:a-o}function se({x0:o,x1:a}){return a-o<=0?1e-4:a-o}function E(o){const a=t.value.style.chart.layout.labels.fontSize*(o.proportion*2>1?1:o.proportion*2);return a<t.value.style.chart.layout.labels.minFontSize?t.value.style.chart.layout.labels.minFontSize:a}function Te(o){b.value=o,w.value+=1}const R=e.computed(()=>({startX:0,startY:0,width:O.value.vbWidth,height:O.value.vbHeight})),$=e.ref(!1);function U(o,a=V.value){for(const l of a){if(l.id===o)return l;if(l.children){const i=U(o,l.children);if(i)return i}}return null}function $e(o){if($.value)s("selectDatapoint",void 0),W.value=V.value;else{if(s("selectDatapoint",o),!U(o.parentId))return;W.value=[U(o.parentId)]}$.value=!$.value}const S=e.ref(null),ie=e.computed(()=>V.value.map((o,a)=>({...o,color:r.convertColorToHex(o.color)||I.value[a]||r.palette[a]||r.palette[a%r.palette.length],shape:"square"})).sort((o,a)=>a.value-o.value).map((o,a)=>({...o,proportion:o.value/V.value.map(l=>l.value).reduce((l,i)=>l+i,0),opacity:m.value.includes(o.id)?.5:1}))),Se=e.computed(()=>({cy:"treemap-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""}));function ce(o){$.value=!1,S.value=null,m.value.includes(o.id)?m.value=m.value.filter(a=>a!==o.id):m.value.length<u.dataset.length-1&&m.value.push(o.id),s("selectLegend",ae.value)}const G=e.ref(null);function Ne({datapoint:o,seriesIndex:a}){S.value=o,G.value={datapoint:o,seriesIndex:a,config:t.value,series:A.value};const l=t.value.style.chart.tooltip.customFormat;if(r.isFunction(l)&&r.functionReturnsString(()=>l({seriesIndex:a,datapoint:o,series:A.value,config:t.value})))C.value=l({seriesIndex:a,datapoint:o,series:A.value,config:t.value});else{let i="";i+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${o.name}</div>`,i+=`<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="${o.color}"/></svg>`,i+=`<b>${r.applyDataLabel(t.value.style.chart.layout.labels.formatter,o.value,r.dataLabel({p:t.value.style.chart.layout.labels.prefix,v:o.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:o,seriesIndex:a})}</b>`,C.value=`<div>${i}</div>`}p.value=!0}const N=e.computed(()=>{const o=F.value.map(l=>({name:l.name,color:l.color})),a=F.value.map(l=>l.value);return{head:o,body:a}});function de(){e.nextTick(()=>{const o=N.value.head.map((i,y)=>[[i.name],[N.value.body[y]],[isNaN(N.value.body[y]/L.value)?"-":N.value.body[y]/L.value*100]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(o),l=r.createCsvContent(a);r.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-treemap"})})}const q=e.computed(()=>{const o=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],a=N.value.head.map((y,z)=>{const M=r.applyDataLabel(t.value.style.chart.layout.labels.formatter,N.value.body[z],r.dataLabel({p:t.value.style.chart.layout.labels.prefix,v:N.value.body[z],s:t.value.style.chart.layout.labels.suffix,r:t.value.table.td.roundingValue}));return[{color:y.color,name:y.name,shape:"square"},M,isNaN(N.value.body[z]/L.value)?"-":r.dataLabel({v:N.value.body[z]/L.value*100,s:"%",r:t.value.table.td.roundingPercentage})]}),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:o,body:a,config:l}});function Be(){return F.value}function ve(){_.value.showTable=!_.value.showTable}function he(){_.value.showTooltip=!_.value.showTooltip}const H=e.ref(!1);function j(){H.value=!H.value}return d({getData:Be,generateCsv:de,generateImage:oe,generatePdf:te,toggleTable:ve,toggleTooltip:he,toggleAnnotator:j}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"treemapChart",ref:g,class:e.normalizeClass(`vue-ui-treemap ${b.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; ${t.value.responsive?"height: 100%;":""} text-align:center;background:${t.value.style.chart.backgroundColor}`),id:`treemap_${f.value}`},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Ae.PenAndPaper,{key:0,parent:g.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:H.value,onClose:j},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),Ce.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:T,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:k,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:6px`)},[(e.openBlock(),e.createBlock(Pe._sfc_main,{key:`title_${Y.value}`,config:{title:{cy:"treemap-div-title",...t.value.style.chart.title},subtitle:{cy:"treemap-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&v.value?(e.openBlock(),e.createBlock(pe.UserOptions,{ref:"details",key:`user_option_${w.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(Q),isImaging:e.unref(ee),uid:f.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:b.value,isTooltip:_.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:g.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:H.value,onToggleFullscreen:Te,onGeneratePdf:e.unref(te),onGenerateCsv:de,onGenerateImage:e.unref(oe),onToggleTable:ve,onToggleTooltip:he,onToggleAnnotator:j},e.createSlots({_:2},[o.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:i})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:i})),void 0,!0)]),key:"5"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:i})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:i})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),v.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":b.value,"vue-data-ui-fulscreen--off":!b.value,"vue-data-ui-zoom-plus":!$.value,"vue-data-ui-zoom-minus":$.value}),viewBox:`${R.value.startX} ${R.value.startY} ${R.value.width<=0?10:R.value.width} ${R.value.height<=0?10:R.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: hidden; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Re._sfc_main),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(l,i)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.chart.layout.rects.gradient.show?(e.openBlock(),e.createElementBlock("defs",Ze,[e.createElementVNode("radialGradient",{id:`tgrad_${l.id}`,gradientTransform:"translate(-1, -1.000001) scale(2, 2)"},[e.createElementVNode("stop",{offset:"18%","stop-color":l.color},null,8,Ke),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.lightenHexColor)(l.color,t.value.style.chart.layout.rects.gradient.intensity/100)},null,8,Qe)],8,Je)])):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(l,i)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:l.x0,y:l.y0,height:ue(l),width:se(l),fill:h.value?l.color:t.value.style.chart.layout.rects.gradient.show?`url(#tgrad_${l.id})`:l.color,rx:t.value.style.chart.layout.rects.borderRadius,stroke:S.value&&S.value.id===l.id?t.value.style.chart.layout.rects.selected.stroke:t.value.style.chart.layout.rects.stroke,"stroke-width":S.value&&S.value.id===l.id?t.value.style.chart.layout.rects.selected.strokeWidth:t.value.style.chart.layout.rects.strokeWidth,onClick:y=>$e(l),onMouseenter:()=>Ne({datapoint:l,seriesIndex:i}),onMouseleave:a[0]||(a[0]=y=>{S.value=null,p.value=!1}),style:e.normalizeStyle(`opacity:${S.value?S.value.id===l.id?1:t.value.style.chart.layout.rects.selected.unselectedOpacity:1}`),class:"vue-ui-treemap-rect"},null,44,et),(e.openBlock(),e.createElementBlock("foreignObject",{x:l.x0,y:l.y0,height:ue(l),width:se(l),class:"vue-ui-treemap-cell-foreignObject"},[e.createElementVNode("div",ot,[t.value.style.chart.layout.labels.showDefaultLabels&&(l.proportion>t.value.style.chart.layout.labels.hideUnderProportion||$.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vue-ui-treemap-cell-default",style:e.normalizeStyle(`width:calc(100% - ${E(l)/1.5}px);text-align:left;line-height:${E(l)<14?14:E(l)}px;padding:${E(l)/3}px; color:${e.unref(r.adaptColorToBackground)(l.color)}`)},[e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${E(l)}px;`)},e.toDisplayString(l.name),5),lt,e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${E(l)}px;`)},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.formatter,l.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.prefix,v:l.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.layout.labels.rounding}),{datapoint:l})),5)],4)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"rect",e.normalizeProps(e.guardReactiveProps({rect:l,shouldShow:l.proportion>t.value.style.chart.layout.labels.hideUnderProportion||$.value,fontSize:E(l),isZoom:$.value,textColor:e.unref(r.adaptColorToBackground)(l.color)})),void 0,!0)])],8,tt))]))),256)),e.renderSlot(o.$slots,"svg",e.normalizeProps(e.guardReactiveProps({svg:O.value,isZoom:$.value,rect:S.value,config:t.value})),void 0,!0)],14,Ye)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",at,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(Q)||e.unref(ee)})),void 0,!0)])):e.createCommentVNode("",!0),v.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ve.default,{key:6,config:{type:"treemap",style:{backgroundColor:t.value.style.chart.backgroundColor,treemap:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:x},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(Oe.Legend,{key:`legend_${J.value}`,legendSet:ie.value,config:Se.value,id:`treemap_legend_${f.value}`,onClickMarker:a[1]||(a[1]=({legend:l})=>ce(l))},{item:e.withCtx(({legend:l,index:i})=>[e.createElementVNode("div",{onClick:y=>ce(l),style:e.normalizeStyle(`opacity:${m.value.includes(l.id)?.5:1}`)},[e.createTextVNode(e.toDisplayString(l.name)+": "+e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.formatter,l.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.prefix,v:l.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:l}))+" ",1),m.value.includes(l.id)?(e.openBlock(),e.createElementBlock("span",ut," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",rt," ("+e.toDisplayString(isNaN(l.value/L.value)?"-":(l.value/L.value*100).toFixed(t.value.style.chart.legend.roundingPercentage))+"%) ",1))],12,nt)]),_:1},8,["legendSet","config","id"])):e.renderSlot(o.$slots,"legend",{key:1,legend:ie.value},void 0,!0)],512),o.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:B,dir:"auto"},[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(ze._sfc_main,{show:_.value.showTooltip&&p.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,fontSize:t.value.style.chart.tooltip.fontSize,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:g.value,content:C.value,isFullscreen:b.value,isCustom:e.unref(r.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...G.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...G.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),v.value?(e.openBlock(),e.createBlock(Le.default,{key:8,hideDetails:"",config:{open:_.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(Ee.DataTable,{key:`table_${Z.value}`,colNames:q.value.colNames,head:q.value.head,body:q.value.body,config:q.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:a[2]||(a[2]=l=>_.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,st)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l.name||l),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,Xe))}},ct=Fe._export_sfc(it,[["__scopeId","data-v-69853ca9"]]);exports.default=ct;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-DuDeHJyK.cjs"),Pe=require("./Title-DkbnpMvf.cjs"),pe=require("./usePrinter-ardO_DNo.cjs"),ze=require("./Tooltip-B8L4NDsX.cjs"),Oe=require("./Legend-DHE2CFkm.cjs"),Ve=require("./vue-ui-skeleton-DleyAXe1.cjs"),Ee=require("./DataTable-aoauqoko.cjs"),Le=require("./vue-ui-accordion-JS5d0ZPi.cjs"),fe=require("./useResponsive-BJ7DTGpm.cjs"),ge=require("./useNestedProp-zkJOoemW.cjs"),Re=require("./PackageVersion-1JWV5loe.cjs"),Ae=require("./PenAndPaper-C6mnwE-L.cjs"),Fe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");function me(n,d){const s=n.length;if(s===0)throw new Error(`Max aspect ratio cannot be computed: ${n} is an empty array`);{let u=1/0,c=-1/0,v=0;for(let f=0;f<s;f+=1){const p=n[f].normalizedValue;p<u&&(u=p),p>c&&(c=p),v+=p}return Math.max(d**2*c/v**2,v**2/(d**2*u))}}function ye(n){const{xOffset:d,yOffset:s,width:u,height:c}=n;return{x0:d,y0:s,x1:d+u,y1:s+c}}function Ie(n,d,s){if(n.length===0)return!0;{const u=n.concat(d),c=me(n,s),v=me(u,s);return c>=v}}function De(n){const d=[],s=n.length;for(let u=0;u<s;u+=1){const c=n[u],v=c.length;for(let h=0;h<v;h+=1)d.push(c[h])}return d}function qe(n,d){const s={...d,children:n};return ke(s)}function He(n){return(n.x1-n.x0)*(n.y1-n.y0)}function be(n,d){const{width:s,height:u,xOffset:c,yOffset:v}=X(d),h=n.length,f=n.map(g=>g.normalizedValue||0).reduce((g,k)=>g+k,0),p=f/u,C=f/s;let b=c,w=v;const m=[];if(s>=u){for(let g=0;g<h;g+=1){const k=n[g],x=w+k.normalizedValue/p,B={x0:b,y0:w,x1:b+p,y1:x},T=Object.assign({},k,B);w=x,m.push(T)}return m}else{for(let g=0;g<h;g+=1){const k=n[g],x=b+k.normalizedValue/C,B={x0:b,y0:w,x1:x,y1:w+C},T=Object.assign({},k,B);b=x,m.push(T)}return m}}function Me(n){const d=X(n),s=d.width,u=d.height;return Math.min(s,u)}function We(n,d){const s=n.length,u=n.map(p=>p.value??0).reduce((p,C)=>p+C,0),c=d/u,v=[];let h,f;for(let p=0;p<s;p+=1)f=n[p],h=Object.assign({},f,{normalizedValue:f.value*(c||0)}),v.push(h);return v}function X(n){const{x0:d,y0:s,x1:u,y1:c}=n;return{xOffset:d,yOffset:s,width:u-d,height:c-s}}function Ue(n,d,s,u){let c=n,v=d,h=s,f=u;for(;;){const p=c.length;if(p===0){const m=be(v,h);return f.concat(m)}const C=Me(h),b=c[0],w=c.slice(1,p);if(Ie(v,b,C)){const m=v.concat(b);c=w,v=m,h=h,f=f}else{const m=v.length;let g=0;for(let T=0;T<m;T+=1)g+=v[T].normalizedValue;const k=Ge(h,g),x=be(v,h),B=f.concat(x);c=c,v=[],h=k,f=B}}}function ke(n){if(typeof n.children>"u"||!n.children.length)return[n];{const d=We(n.children,He(n)),s=Ue(d,[],n,[]),u=s.length,c=[];for(let h=0;h<u;h+=1)c.push(ke(s[h]));return De(c)}}function Ge(n,d){const{width:s,height:u,xOffset:c,yOffset:v}=X(n);if(s>=u){const h=d/u,f=s-h,p={xOffset:c+h,yOffset:v,width:f,height:u};return ye(p)}else{const h=d/s,f=u-h,p={xOffset:c,yOffset:v+h,width:s,height:f};return ye(p)}}const je=n=>(e.pushScopeId("data-v-69853ca9"),n=n(),e.popScopeId(),n),Xe=["id"],Ye=["xmlns","viewBox"],Ze={key:0},Je=["id"],Ke=["stop-color"],Qe=["stop-color"],et=["x","y","height","width","fill","rx","stroke","stroke-width","onClick","onMouseenter"],tt=["x","y","height","width"],ot={style:{width:"100%",height:"100%"},class:"vue-ui-treemap-cell"},lt=je(()=>e.createElementVNode("br",null,null,-1)),at={key:5,class:"vue-data-ui-watermark"},nt=["onClick"],rt={key:0},ut={key:1},st=["innerHTML"],it={__name:"vue-ui-treemap",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(n,{expose:d,emit:s}){const u=n,{vue_ui_treemap:c}=r.useConfig(),v=e.computed(()=>!!u.dataset&&u.dataset.length),h=e.computed(()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),f=e.ref(r.createUid()),p=e.ref(!1),C=e.ref(""),b=e.ref(!1),w=e.ref(0),m=e.ref([]),g=e.ref(null),k=e.ref(null),x=e.ref(null),B=e.ref(null),T=e.ref(null),Y=e.ref(0),Z=e.ref(0),J=e.ref(0),t=e.computed({get:()=>K(),set:o=>o});function K(){const o=ge.useNestedProp({userConfig:u.config,defaultConfig:c});return o.theme?{...ge.useNestedProp({userConfig:r.themes.vue_ui_treemap[o.theme]||u.config,defaultConfig:o}),customPalette:r.themePalettes[o.theme]||r.palette}:o}e.watch(()=>u.config,o=>{t.value=K(),Y.value+=1,Z.value+=1,J.value+=1},{deep:!0});const{isPrinting:Q,isImaging:ee,generatePdf:te,generateImage:oe}=pe.usePrinter({elementId:`treemap_${f.value}`,fileName:t.value.style.chart.title.text||"vue-ui-treemap"}),Ce=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),I=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),_=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),P=e.ref({height:t.value.style.chart.height,width:t.value.style.chart.width}),O=e.computed(()=>({bottom:P.value.height-t.value.style.chart.padding.bottom,height:P.value.height-t.value.style.chart.padding.top-t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:P.value.width-t.value.style.chart.padding.right,top:t.value.style.chart.padding.top,vbHeight:P.value.height,vbWidth:P.value.width,width:P.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right}));function le(o){o.forEach((a,l)=>{a.id=r.createUid(),a.color=r.convertColorToHex(a.color)||I.value[l]||r.palette[l]||r.palette[l%r.palette.length],a.children&&(a.children.forEach(i=>{i.parentId=a.id,i.color=a.color}),le(a.children))})}const V=e.ref(u.dataset),D=e.ref(null);e.onMounted(()=>{we()});function we(){if(r.objectIsEmpty(u.dataset)&&r.error({componentName:"VueUiTreemap",type:"dataset"}),le(V.value),t.value.responsive){const o=fe.throttle(()=>{const{width:a,height:l}=fe.useResponsive({chart:g.value,title:t.value.style.chart.title.text?k.value:null,legend:t.value.style.chart.legend.show?x.value:null,source:B.value,noTitle:T.value});P.value.width=a,P.value.height=l});D.value=new ResizeObserver(o),D.value.observe(g.value.parentNode)}}e.onBeforeUnmount(()=>{D.value&&D.value.disconnect()});const W=e.ref(V.value),A=e.computed(()=>W.value.map((o,a)=>({...o,color:r.convertColorToHex(o.color)||I.value[a]||r.palette[a]||r.palette[a%r.palette.length]})).filter(o=>!m.value.includes(o.id))),L=e.computed(()=>V.value.filter(o=>!m.value.includes(o.id)).map(o=>o.value||0).reduce((o,a)=>o+a,0)),ae=e.computed({get(){let o=[...A.value];return t.value.style.chart.layout.sorted&&(o=[...A.value].sort((a,l)=>l.value-a.value)),o.map(a=>({...a}))},set(o){return o}});function ne(o,a){return o.value/a}function xe(o,a,l){const i=t.value.style.chart.layout.rects.colorRatio-ne(a,l);return r.lightenHexColor(o,i<0?0:i)}function re(o,a,l,i){return o.map((y,z)=>{const M=xe(r.convertColorToHex(a)||I.value[z]||r.palette[z]||r.palette[z%r.palette.length],y,i),_e=ne(y,i);return{...y,color:M,proportion:_e,parentName:l,children:y.children?re(y.children,M,y.name,i):void 0}})}const F=e.computed(()=>qe(ae.value.map((o,a)=>{const l=o.children?o.children.reduce((i,y)=>i+y.value,0):o.value;return{value:o.value,id:o.id,children:o.children?re(o.children.sort((i,y)=>y.value-i.value),o.color,o.name,l):void 0,color:o.color,name:o.name}}),{x0:O.value.left*2,y0:O.value.top,x1:O.value.width,y1:O.value.height}));function ue({y0:o,y1:a}){return a-o<=0?1e-4:a-o}function se({x0:o,x1:a}){return a-o<=0?1e-4:a-o}function E(o){const a=t.value.style.chart.layout.labels.fontSize*(o.proportion*2>1?1:o.proportion*2);return a<t.value.style.chart.layout.labels.minFontSize?t.value.style.chart.layout.labels.minFontSize:a}function Te(o){b.value=o,w.value+=1}const R=e.computed(()=>({startX:0,startY:0,width:O.value.vbWidth,height:O.value.vbHeight})),$=e.ref(!1);function U(o,a=V.value){for(const l of a){if(l.id===o)return l;if(l.children){const i=U(o,l.children);if(i)return i}}return null}function $e(o){if($.value)s("selectDatapoint",void 0),W.value=V.value;else{if(s("selectDatapoint",o),!U(o.parentId))return;W.value=[U(o.parentId)]}$.value=!$.value}const S=e.ref(null),ie=e.computed(()=>V.value.map((o,a)=>({...o,color:r.convertColorToHex(o.color)||I.value[a]||r.palette[a]||r.palette[a%r.palette.length],shape:"square"})).sort((o,a)=>a.value-o.value).map((o,a)=>({...o,proportion:o.value/V.value.map(l=>l.value).reduce((l,i)=>l+i,0),opacity:m.value.includes(o.id)?.5:1}))),Se=e.computed(()=>({cy:"treemap-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""}));function ce(o){$.value=!1,S.value=null,m.value.includes(o.id)?m.value=m.value.filter(a=>a!==o.id):m.value.length<u.dataset.length-1&&m.value.push(o.id),s("selectLegend",ae.value)}const G=e.ref(null);function Ne({datapoint:o,seriesIndex:a}){S.value=o,G.value={datapoint:o,seriesIndex:a,config:t.value,series:A.value};const l=t.value.style.chart.tooltip.customFormat;if(r.isFunction(l)&&r.functionReturnsString(()=>l({seriesIndex:a,datapoint:o,series:A.value,config:t.value})))C.value=l({seriesIndex:a,datapoint:o,series:A.value,config:t.value});else{let i="";i+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${o.name}</div>`,i+=`<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="${o.color}"/></svg>`,i+=`<b>${r.applyDataLabel(t.value.style.chart.layout.labels.formatter,o.value,r.dataLabel({p:t.value.style.chart.layout.labels.prefix,v:o.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:o,seriesIndex:a})}</b>`,C.value=`<div>${i}</div>`}p.value=!0}const N=e.computed(()=>{const o=F.value.map(l=>({name:l.name,color:l.color})),a=F.value.map(l=>l.value);return{head:o,body:a}});function de(){e.nextTick(()=>{const o=N.value.head.map((i,y)=>[[i.name],[N.value.body[y]],[isNaN(N.value.body[y]/L.value)?"-":N.value.body[y]/L.value*100]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(o),l=r.createCsvContent(a);r.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-treemap"})})}const q=e.computed(()=>{const o=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],a=N.value.head.map((y,z)=>{const M=r.applyDataLabel(t.value.style.chart.layout.labels.formatter,N.value.body[z],r.dataLabel({p:t.value.style.chart.layout.labels.prefix,v:N.value.body[z],s:t.value.style.chart.layout.labels.suffix,r:t.value.table.td.roundingValue}));return[{color:y.color,name:y.name,shape:"square"},M,isNaN(N.value.body[z]/L.value)?"-":r.dataLabel({v:N.value.body[z]/L.value*100,s:"%",r:t.value.table.td.roundingPercentage})]}),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:o,body:a,config:l}});function Be(){return F.value}function ve(){_.value.showTable=!_.value.showTable}function he(){_.value.showTooltip=!_.value.showTooltip}const H=e.ref(!1);function j(){H.value=!H.value}return d({getData:Be,generateCsv:de,generateImage:oe,generatePdf:te,toggleTable:ve,toggleTooltip:he,toggleAnnotator:j}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"treemapChart",ref:g,class:e.normalizeClass(`vue-ui-treemap ${b.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; ${t.value.responsive?"height: 100%;":""} text-align:center;background:${t.value.style.chart.backgroundColor}`),id:`treemap_${f.value}`},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Ae.PenAndPaper,{key:0,parent:g.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:H.value,onClose:j},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),Ce.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:T,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:k,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:6px`)},[(e.openBlock(),e.createBlock(Pe._sfc_main,{key:`title_${Y.value}`,config:{title:{cy:"treemap-div-title",...t.value.style.chart.title},subtitle:{cy:"treemap-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&v.value?(e.openBlock(),e.createBlock(pe.UserOptions,{ref:"details",key:`user_option_${w.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(Q),isImaging:e.unref(ee),uid:f.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:b.value,isTooltip:_.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:g.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:H.value,onToggleFullscreen:Te,onGeneratePdf:e.unref(te),onGenerateCsv:de,onGenerateImage:e.unref(oe),onToggleTable:ve,onToggleTooltip:he,onToggleAnnotator:j},e.createSlots({_:2},[o.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:i})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:i})),void 0,!0)]),key:"5"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:i})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:i})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),v.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":b.value,"vue-data-ui-fulscreen--off":!b.value,"vue-data-ui-zoom-plus":!$.value,"vue-data-ui-zoom-minus":$.value}),viewBox:`${R.value.startX} ${R.value.startY} ${R.value.width<=0?10:R.value.width} ${R.value.height<=0?10:R.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: hidden; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Re._sfc_main),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(l,i)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.chart.layout.rects.gradient.show?(e.openBlock(),e.createElementBlock("defs",Ze,[e.createElementVNode("radialGradient",{id:`tgrad_${l.id}`,gradientTransform:"translate(-1, -1.000001) scale(2, 2)"},[e.createElementVNode("stop",{offset:"18%","stop-color":l.color},null,8,Ke),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.lightenHexColor)(l.color,t.value.style.chart.layout.rects.gradient.intensity/100)},null,8,Qe)],8,Je)])):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(l,i)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:l.x0,y:l.y0,height:ue(l),width:se(l),fill:h.value?l.color:t.value.style.chart.layout.rects.gradient.show?`url(#tgrad_${l.id})`:l.color,rx:t.value.style.chart.layout.rects.borderRadius,stroke:S.value&&S.value.id===l.id?t.value.style.chart.layout.rects.selected.stroke:t.value.style.chart.layout.rects.stroke,"stroke-width":S.value&&S.value.id===l.id?t.value.style.chart.layout.rects.selected.strokeWidth:t.value.style.chart.layout.rects.strokeWidth,onClick:y=>$e(l),onMouseenter:()=>Ne({datapoint:l,seriesIndex:i}),onMouseleave:a[0]||(a[0]=y=>{S.value=null,p.value=!1}),style:e.normalizeStyle(`opacity:${S.value?S.value.id===l.id?1:t.value.style.chart.layout.rects.selected.unselectedOpacity:1}`),class:"vue-ui-treemap-rect"},null,44,et),(e.openBlock(),e.createElementBlock("foreignObject",{x:l.x0,y:l.y0,height:ue(l),width:se(l),class:"vue-ui-treemap-cell-foreignObject"},[e.createElementVNode("div",ot,[t.value.style.chart.layout.labels.showDefaultLabels&&(l.proportion>t.value.style.chart.layout.labels.hideUnderProportion||$.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vue-ui-treemap-cell-default",style:e.normalizeStyle(`width:calc(100% - ${E(l)/1.5}px);text-align:left;line-height:${E(l)<14?14:E(l)}px;padding:${E(l)/3}px; color:${e.unref(r.adaptColorToBackground)(l.color)}`)},[e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${E(l)}px;`)},e.toDisplayString(l.name),5),lt,e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${E(l)}px;`)},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.formatter,l.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.prefix,v:l.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.layout.labels.rounding}),{datapoint:l})),5)],4)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"rect",e.normalizeProps(e.guardReactiveProps({rect:l,shouldShow:l.proportion>t.value.style.chart.layout.labels.hideUnderProportion||$.value,fontSize:E(l),isZoom:$.value,textColor:e.unref(r.adaptColorToBackground)(l.color)})),void 0,!0)])],8,tt))]))),256)),e.renderSlot(o.$slots,"svg",e.normalizeProps(e.guardReactiveProps({svg:O.value,isZoom:$.value,rect:S.value,config:t.value})),void 0,!0)],14,Ye)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",at,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(Q)||e.unref(ee)})),void 0,!0)])):e.createCommentVNode("",!0),v.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ve.default,{key:6,config:{type:"treemap",style:{backgroundColor:t.value.style.chart.backgroundColor,treemap:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:x},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(Oe.Legend,{key:`legend_${J.value}`,legendSet:ie.value,config:Se.value,id:`treemap_legend_${f.value}`,onClickMarker:a[1]||(a[1]=({legend:l})=>ce(l))},{item:e.withCtx(({legend:l,index:i})=>[e.createElementVNode("div",{onClick:y=>ce(l),style:e.normalizeStyle(`opacity:${m.value.includes(l.id)?.5:1}`)},[e.createTextVNode(e.toDisplayString(l.name)+": "+e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.formatter,l.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.prefix,v:l.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:l}))+" ",1),m.value.includes(l.id)?(e.openBlock(),e.createElementBlock("span",ut," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",rt," ("+e.toDisplayString(isNaN(l.value/L.value)?"-":(l.value/L.value*100).toFixed(t.value.style.chart.legend.roundingPercentage))+"%) ",1))],12,nt)]),_:1},8,["legendSet","config","id"])):e.renderSlot(o.$slots,"legend",{key:1,legend:ie.value},void 0,!0)],512),o.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:B,dir:"auto"},[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(ze._sfc_main,{show:_.value.showTooltip&&p.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,fontSize:t.value.style.chart.tooltip.fontSize,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:g.value,content:C.value,isFullscreen:b.value,isCustom:e.unref(r.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...G.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...G.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),v.value?(e.openBlock(),e.createBlock(Le.default,{key:8,hideDetails:"",config:{open:_.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(Ee.DataTable,{key:`table_${Z.value}`,colNames:q.value.colNames,head:q.value.head,body:q.value.body,config:q.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:a[2]||(a[2]=l=>_.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,st)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l.name||l),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,Xe))}},ct=Fe._export_sfc(it,[["__scopeId","data-v-69853ca9"]]);exports.default=ct;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { computed as w, ref as f, watch as Qe, onMounted as et, onBeforeUnmount as tt, openBlock as g, createElementBlock as k, normalizeClass as ze, normalizeStyle as B, createBlock as G, createCommentVNode as O, unref as C, createSlots as ot, withCtx as x, renderSlot as $, normalizeProps as U, guardReactiveProps as X, createVNode as Pe, Fragment as Ae, renderList as Fe, createElementVNode as S, toDisplayString as Y, createTextVNode as Ie, nextTick as lt, pushScopeId as at, popScopeId as nt } from "vue";
|
|
2
|
-
import { u as st, c as Le, t as rt, a as ut, p as T, b as it, o as ct, e as dt, d as ae, i as ne, f as K, X as vt, l as Re, G as De, x as Me, y as ht, q as ft, r as pt } from "./index-
|
|
3
|
-
import { _ as gt } from "./Title-
|
|
4
|
-
import { u as yt, U as mt } from "./usePrinter-
|
|
5
|
-
import { _ as bt } from "./Tooltip-
|
|
6
|
-
import { L as wt } from "./Legend-
|
|
7
|
-
import kt from "./vue-ui-skeleton-
|
|
8
|
-
import { D as Ct } from "./DataTable-
|
|
9
|
-
import $t from "./vue-ui-accordion-
|
|
2
|
+
import { u as st, c as Le, t as rt, a as ut, p as T, b as it, o as ct, e as dt, d as ae, i as ne, f as K, X as vt, l as Re, G as De, x as Me, y as ht, q as ft, r as pt } from "./index-Cm2_6s9o.js";
|
|
3
|
+
import { _ as gt } from "./Title-Coit3NcT.js";
|
|
4
|
+
import { u as yt, U as mt } from "./usePrinter-Cx8U1e30.js";
|
|
5
|
+
import { _ as bt } from "./Tooltip-BBgfUr4a.js";
|
|
6
|
+
import { L as wt } from "./Legend-DRozxv9L.js";
|
|
7
|
+
import kt from "./vue-ui-skeleton-BUS6A44x.js";
|
|
8
|
+
import { D as Ct } from "./DataTable-NGi-FgLM.js";
|
|
9
|
+
import $t from "./vue-ui-accordion-CxrNF8BI.js";
|
|
10
10
|
import { t as xt, u as Tt } from "./useResponsive-CoxXLe23.js";
|
|
11
|
-
import { u as Ve } from "./useNestedProp-
|
|
12
|
-
import { _ as _t } from "./PackageVersion-
|
|
13
|
-
import { P as Ot } from "./PenAndPaper-
|
|
11
|
+
import { u as Ve } from "./useNestedProp-BYPZJNhi.js";
|
|
12
|
+
import { _ as _t } from "./PackageVersion-CTMY4zeY.js";
|
|
13
|
+
import { P as Ot } from "./PenAndPaper-DJ_d10S-.js";
|
|
14
14
|
import { _ as St } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
15
15
|
function Be(a, i) {
|
|
16
16
|
const s = a.length;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { useCssVars as Ze, computed as b, ref as r, watch as Me, onMounted as et, onBeforeUnmount as tt, openBlock as u, createElementBlock as i, normalizeClass as X, normalizeStyle as c, createBlock as M, createCommentVNode as g, unref as h, createSlots as at, withCtx as k, renderSlot as _, normalizeProps as U, guardReactiveProps as H, createElementVNode as n, toDisplayString as d, createVNode as re, Fragment as W, renderList as j, withKeys as lt, createTextVNode as ot } from "vue";
|
|
2
|
-
import { u as nt, c as ut, t as st, a as rt, p as O, b as it, o as Oe, e as Z, v as S, d as ie, i as ee, f as I, X as dt, s as de, w as ct, x as vt, y as ht, q as pt, r as gt } from "./index-
|
|
2
|
+
import { u as nt, c as ut, t as st, a as rt, p as O, b as it, o as Oe, e as Z, v as S, d as ie, i as ee, f as I, X as dt, s as de, w as ct, x as vt, y as ht, q as pt, r as gt } from "./index-Cm2_6s9o.js";
|
|
3
3
|
import { t as yt, u as ft } from "./useResponsive-CoxXLe23.js";
|
|
4
|
-
import { _ as bt } from "./Title-
|
|
5
|
-
import { u as mt, U as _t } from "./usePrinter-
|
|
6
|
-
import { _ as kt } from "./Tooltip-
|
|
7
|
-
import { L as Ie } from "./Legend-
|
|
8
|
-
import xt from "./vue-ui-skeleton-
|
|
9
|
-
import $t from "./BaseIcon-
|
|
10
|
-
import Ct from "./vue-ui-accordion-
|
|
11
|
-
import { u as Ae } from "./useNestedProp-
|
|
12
|
-
import { _ as wt } from "./PackageVersion-
|
|
13
|
-
import { P as Tt } from "./PenAndPaper-
|
|
4
|
+
import { _ as bt } from "./Title-Coit3NcT.js";
|
|
5
|
+
import { u as mt, U as _t } from "./usePrinter-Cx8U1e30.js";
|
|
6
|
+
import { _ as kt } from "./Tooltip-BBgfUr4a.js";
|
|
7
|
+
import { L as Ie } from "./Legend-DRozxv9L.js";
|
|
8
|
+
import xt from "./vue-ui-skeleton-BUS6A44x.js";
|
|
9
|
+
import $t from "./BaseIcon-DpLJi6ci.js";
|
|
10
|
+
import Ct from "./vue-ui-accordion-CxrNF8BI.js";
|
|
11
|
+
import { u as Ae } from "./useNestedProp-BYPZJNhi.js";
|
|
12
|
+
import { _ as wt } from "./PackageVersion-CTMY4zeY.js";
|
|
13
|
+
import { P as Tt } from "./PenAndPaper-DJ_d10S-.js";
|
|
14
14
|
import { _ as Lt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
15
15
|
const Nt = ["id"], Pt = ["onClick"], St = ["xmlns", "viewBox"], Vt = ["id"], Ft = ["stop-color"], zt = ["stop-color"], Mt = ["x", "y", "width", "height", "fill", "rx"], Ot = ["x", "y", "width", "height", "fill", "rx", "stroke", "stroke-width"], It = ["x2", "y1", "y2", "stroke", "stroke-width"], At = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Bt = ["x", "y", "text-anchor", "font-size", "fill", "font-weight"], Dt = ["x", "y", "font-size", "fill", "font-weight"], Rt = ["x", "y", "font-size", "fill", "font-weight"], Xt = ["x", "y", "font-size", "fill", "font-weight"], Et = ["y", "width", "height", "fill", "onMouseenter"], Gt = {
|
|
16
16
|
key: 6,
|