vue-data-ui 2.4.83 → 2.4.85
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-DdtSSnUZ.cjs → Arrow-Ajt3NMEa.cjs} +1 -1
- package/dist/{Arrow-Bl2aigOV.js → Arrow-Qayb_B0s.js} +1 -1
- package/dist/{BaseIcon-DG_iYn4X.js → BaseIcon-B8U62FEj.js} +1 -1
- package/dist/{BaseIcon-D92qdnv7.cjs → BaseIcon-BVrsMbvi.cjs} +1 -1
- package/dist/{DataTable-DyvnYg-x.cjs → DataTable-1PQD-SFb.cjs} +1 -1
- package/dist/{DataTable-CaiuB_-j.js → DataTable-C0tCPQ9i.js} +2 -2
- package/dist/{Legend-D2J3bvDm.cjs → Legend-BJ2Wbqut.cjs} +1 -1
- package/dist/{Legend-Br9uWuyZ.js → Legend-BTpe6qQB.js} +2 -2
- package/dist/{PackageVersion-Bxz2crF7.cjs → PackageVersion-BjfedMsH.cjs} +1 -1
- package/dist/{PackageVersion-tmgQTzP2.js → PackageVersion-CENy3Lm2.js} +1 -1
- package/dist/{PenAndPaper-CJ3Rnk2Q.js → PenAndPaper-Dr7ndoP_.js} +3 -3
- package/dist/{PenAndPaper-BFCXiNMF.cjs → PenAndPaper-nqRtAh6J.cjs} +1 -1
- package/dist/{Shape-qjsquBuY.cjs → Shape-Boa32JEn.cjs} +1 -1
- package/dist/{Shape-6QlwV5xV.js → Shape-zFv85Gc2.js} +1 -1
- package/dist/{Slicer-B9BStSWS.js → Slicer-BUYuk07t.js} +109 -124
- package/dist/Slicer-D6QLMg5N.cjs +1 -0
- package/dist/{Title-Bhq6SOYu.js → Title-CaET2xuF.js} +1 -1
- package/dist/{Title-BqNuK5vc.cjs → Title-DJUxOiaO.cjs} +1 -1
- package/dist/{Tooltip-CeBpQ6yn.js → Tooltip-Bkc4233T.js} +1 -1
- package/dist/{Tooltip-Kn7RnF0L.cjs → Tooltip-C5QuW94e.cjs} +1 -1
- package/dist/{index-BqR_a-C7.js → index-B7nCQFK0.js} +2 -1
- package/dist/index-COIn1phv.cjs +9 -0
- package/dist/style.css +1 -1
- package/dist/types/vue-data-ui.d.cts +1 -0
- package/dist/types/vue-data-ui.d.ts +1 -0
- package/dist/{useNestedProp-DqofSFeh.js → useNestedProp-C9rlBRTT.js} +1 -1
- package/dist/{useNestedProp-D_XfpfnF.cjs → useNestedProp-CbMuGGl3.cjs} +1 -1
- package/dist/{usePrinter-BPjMJmKg.js → usePrinter-CQMn1b4E.js} +1 -1
- package/dist/{usePrinter-Bfrr3DDK.cjs → usePrinter-CXXfgFFN.cjs} +1 -1
- package/dist/{vue-data-ui-DsBOcTDd.js → vue-data-ui-BnsKGbqb.js} +60 -60
- package/dist/{vue-data-ui-oW2xn5YG.cjs → vue-data-ui-Bu_VIHgr.cjs} +1 -1
- package/dist/vue-data-ui.cjs +1 -1
- package/dist/vue-data-ui.js +1 -1
- package/dist/{vue-ui-3d-bar-DL4o7lJD.cjs → vue-ui-3d-bar-D39F2dKF.cjs} +1 -1
- package/dist/{vue-ui-3d-bar-D5BCQifA.js → vue-ui-3d-bar-V5FBS9MA.js} +9 -9
- package/dist/{vue-ui-accordion-Cz3VCEN0.js → vue-ui-accordion-B8ptB5BQ.js} +3 -3
- package/dist/{vue-ui-accordion-Sqna6-tk.cjs → vue-ui-accordion-CGlnNTr8.cjs} +1 -1
- package/dist/vue-ui-age-pyramid-BdseHKUc.cjs +1 -0
- package/dist/{vue-ui-age-pyramid-Cl9eaBGr.js → vue-ui-age-pyramid-Bjp1R8Ku.js} +14 -12
- package/dist/{vue-ui-annotator-Ctx3YK1X.cjs → vue-ui-annotator-BoWZZRPg.cjs} +1 -1
- package/dist/{vue-ui-annotator-DQKvjXgI.js → vue-ui-annotator-V9m5fTGG.js} +1 -1
- package/dist/{vue-ui-bullet-CsMr2xzr.js → vue-ui-bullet-Bqvb5PV-.js} +8 -8
- package/dist/{vue-ui-bullet-CWJzycj2.cjs → vue-ui-bullet-DLIxlhFF.cjs} +1 -1
- package/dist/{vue-ui-candlestick-DKjfum_x.cjs → vue-ui-candlestick-D4BD8LyJ.cjs} +2 -2
- package/dist/{vue-ui-candlestick-BZ12fWHz.js → vue-ui-candlestick-DHCtmsh3.js} +72 -70
- package/dist/{vue-ui-carousel-table-CDR1Vv5V.js → vue-ui-carousel-table-Cn2RJkSb.js} +4 -4
- package/dist/{vue-ui-carousel-table-C6L5d_Fz.cjs → vue-ui-carousel-table-VIuoh2QI.cjs} +1 -1
- package/dist/{vue-ui-chestnut-CAnxXvl6.js → vue-ui-chestnut-C5qUO1uK.js} +8 -8
- package/dist/{vue-ui-chestnut-DFgQWktZ.cjs → vue-ui-chestnut-ClG9HZoC.cjs} +1 -1
- package/dist/{vue-ui-cursor-BHKTewso.cjs → vue-ui-cursor-Bo8et-dD.cjs} +1 -1
- package/dist/{vue-ui-cursor-CEG5U4Hg.js → vue-ui-cursor-eJau3iyr.js} +2 -2
- package/dist/{vue-ui-dashboard-CAZvucxS.js → vue-ui-dashboard-DnaH9bCw.js} +2 -2
- package/dist/{vue-ui-dashboard-cCxI_-fr.cjs → vue-ui-dashboard-WJqGQ8iR.cjs} +1 -1
- package/dist/{vue-ui-digits-xPdav4hy.js → vue-ui-digits-Cqjts2eq.js} +2 -2
- package/dist/{vue-ui-digits-Dl0z8lL5.cjs → vue-ui-digits-qIckO4-r.cjs} +1 -1
- package/dist/vue-ui-donut-BP7yj2DU.cjs +1 -0
- package/dist/{vue-ui-donut-evolution-BgXDvYij.cjs → vue-ui-donut-evolution-Cz8uFJp8.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-DtfH9oY2.js → vue-ui-donut-evolution-EzYvP11F.js} +11 -11
- package/dist/{vue-ui-donut-BX4NBJNA.js → vue-ui-donut-pprcnbIw.js} +17 -15
- package/dist/vue-ui-dumbbell-CYqHCr2S.cjs +9 -0
- package/dist/{vue-ui-dumbbell-DgTOdhga.js → vue-ui-dumbbell-DaxcxmnU.js} +48 -46
- package/dist/{vue-ui-flow-DIbRLuAg.js → vue-ui-flow-DbRgaKBu.js} +9 -9
- package/dist/{vue-ui-flow-Bt0sz3lA.cjs → vue-ui-flow-HeRCplGL.cjs} +1 -1
- package/dist/{vue-ui-funnel-CedEHtHD.js → vue-ui-funnel-B2del8KB.js} +37 -35
- package/dist/vue-ui-funnel-DxniWNkD.cjs +1 -0
- package/dist/{vue-ui-galaxy-aqDlVOGG.cjs → vue-ui-galaxy-BDA64dud.cjs} +1 -1
- package/dist/{vue-ui-galaxy-BcBicruu.js → vue-ui-galaxy-pUYeASJf.js} +11 -11
- package/dist/vue-ui-gauge-BOXoAgWk.cjs +1 -0
- package/dist/{vue-ui-gauge-B8ybUmVP.js → vue-ui-gauge-DpsXpEaW.js} +28 -26
- package/dist/{vue-ui-gizmo-J759kkHO.js → vue-ui-gizmo-BpYrhkon.js} +3 -3
- package/dist/{vue-ui-gizmo-DAzVCVgd.cjs → vue-ui-gizmo-Bq9uAmqd.cjs} +1 -1
- package/dist/{vue-ui-heatmap-5PChWU--.cjs → vue-ui-heatmap-CbKgGLtN.cjs} +1 -1
- package/dist/{vue-ui-heatmap-zXe_ZfjW.js → vue-ui-heatmap-Cz6_9Veh.js} +10 -10
- package/dist/vue-ui-history-plot-BoMdvItE.cjs +1 -0
- package/dist/{vue-ui-history-plot-DpCqc_J5.js → vue-ui-history-plot-DAotUjSF.js} +56 -54
- package/dist/{vue-ui-kpi-B0YGZB0U.js → vue-ui-kpi-Ch2p7m-i.js} +3 -3
- package/dist/{vue-ui-kpi-C-7Ihvt0.cjs → vue-ui-kpi-D6mp6EQ2.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-Cn4Q6TSw.cjs → vue-ui-mini-loader-CO-KGVlC.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-7sjb3XBu.js → vue-ui-mini-loader-E13lmwfO.js} +2 -2
- package/dist/{vue-ui-molecule-DZpXgYuN.js → vue-ui-molecule-C69K6EPO.js} +11 -11
- package/dist/{vue-ui-molecule-BDumH6dl.cjs → vue-ui-molecule-CeoDnPXB.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-pnwFktum.cjs → vue-ui-mood-radar-BwOqQUuT.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-CKqyK1Hp.js → vue-ui-mood-radar-DDtky572.js} +11 -11
- package/dist/{vue-ui-nested-donuts-DbxWMbwd.js → vue-ui-nested-donuts-AYPYIRrE.js} +16 -14
- package/dist/{vue-ui-nested-donuts-CHpsvVxD.cjs → vue-ui-nested-donuts-DMCd6DqT.cjs} +2 -2
- package/dist/{vue-ui-onion-F9rcTxc5.cjs → vue-ui-onion-BedLvfFe.cjs} +2 -2
- package/dist/{vue-ui-onion-q54wqIiz.js → vue-ui-onion-Bsa88sKK.js} +31 -29
- package/dist/{vue-ui-parallel-coordinate-plot-Cwnja7PH.cjs → vue-ui-parallel-coordinate-plot-CSOMIABF.cjs} +2 -2
- package/dist/{vue-ui-parallel-coordinate-plot-myA1ugJ6.js → vue-ui-parallel-coordinate-plot-KCEb4iRs.js} +62 -60
- package/dist/vue-ui-quadrant-BXQVOvpY.cjs +1 -0
- package/dist/{vue-ui-quadrant-OoCEzm12.js → vue-ui-quadrant-Bd_88Eht.js} +16 -14
- package/dist/{vue-ui-quick-chart-5lnK5fYa.js → vue-ui-quick-chart-CXAYKYHa.js} +55 -53
- package/dist/{vue-ui-quick-chart-CazRj-4z.cjs → vue-ui-quick-chart-dLItYwM_.cjs} +2 -2
- package/dist/vue-ui-radar-BuNtocmn.cjs +1 -0
- package/dist/{vue-ui-radar-BDKh_0GC.js → vue-ui-radar-De397oTB.js} +100 -98
- package/dist/{vue-ui-rating-BOzhaiSc.cjs → vue-ui-rating-BjiMVoyX.cjs} +1 -1
- package/dist/{vue-ui-rating-Dt3vyE2H.js → vue-ui-rating-wK3_ZWE5.js} +2 -2
- package/dist/vue-ui-relation-circle-BEGyr1h-.cjs +1 -0
- package/dist/{vue-ui-relation-circle-BOMeOf10.js → vue-ui-relation-circle-BxlK8MVs.js} +56 -54
- package/dist/{vue-ui-rings-3O2lFlg1.js → vue-ui-rings-BXrtMSML.js} +39 -37
- package/dist/{vue-ui-rings-DIA0oj1w.cjs → vue-ui-rings-BcNMBXxq.cjs} +2 -2
- package/dist/{vue-ui-scatter-SRz39O4w.js → vue-ui-scatter-BWZfLJ9P.js} +52 -50
- package/dist/vue-ui-scatter-DTy3yPVu.cjs +1 -0
- package/dist/{vue-ui-screenshot-OBhZYkuN.cjs → vue-ui-screenshot-BJgOwFMW.cjs} +1 -1
- package/dist/{vue-ui-screenshot-DeseMlsh.js → vue-ui-screenshot-hw4PC9Uu.js} +1 -1
- package/dist/{vue-ui-skeleton-6_VzxeeY.cjs → vue-ui-skeleton-BIqMxXV7.cjs} +1 -1
- package/dist/{vue-ui-skeleton-DbI8wJH-.js → vue-ui-skeleton-D66ZIUln.js} +3 -3
- package/dist/{vue-ui-smiley-BqRjGeM4.js → vue-ui-smiley-DWPYdcDB.js} +2 -2
- package/dist/{vue-ui-smiley-CQYCG8iR.cjs → vue-ui-smiley-Duy5Xo-j.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-YKlzV5ph.js → vue-ui-spark-trend-Ce4IaqPz.js} +5 -5
- package/dist/{vue-ui-spark-trend-C1MfKChb.cjs → vue-ui-spark-trend-DP5foaNi.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-BGc7K3E7.cjs → vue-ui-sparkbar-Bbns4V16.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-BEY67Uh8.js → vue-ui-sparkbar-Fa-Kc9Fr.js} +4 -4
- package/dist/{vue-ui-sparkgauge-DBJ6JcY4.cjs → vue-ui-sparkgauge-BrLrvNLH.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-COy9kS3g.js → vue-ui-sparkgauge-DUWcJ7cM.js} +4 -4
- package/dist/{vue-ui-sparkhistogram-Kof1NLnh.cjs → vue-ui-sparkhistogram-B0rhs_UN.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-TOZ7cGZE.js → vue-ui-sparkhistogram-PgC-c-5a.js} +5 -5
- package/dist/{vue-ui-sparkline-Corg_lTS.js → vue-ui-sparkline-BqNlrKjb.js} +37 -35
- package/dist/vue-ui-sparkline-c5Awoj8J.cjs +1 -0
- package/dist/{vue-ui-sparkstackbar-2Vwz74c6.cjs → vue-ui-sparkstackbar-BmYIcpVZ.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-D-W-02aO.js → vue-ui-sparkstackbar-DyJIUulr.js} +5 -5
- package/dist/{vue-ui-stackbar-DRLdPZii.js → vue-ui-stackbar-BebRtOYL.js} +55 -53
- package/dist/{vue-ui-stackbar-DZvxTz3J.cjs → vue-ui-stackbar-DJ9NH_l1.cjs} +2 -2
- package/dist/{vue-ui-strip-plot-tQk3HsSn.js → vue-ui-strip-plot-BGHj1BHd.js} +77 -75
- package/dist/vue-ui-strip-plot-f7vejZht.cjs +1 -0
- package/dist/{vue-ui-table-G09LTync.cjs → vue-ui-table-BFdGppRF.cjs} +1 -1
- package/dist/{vue-ui-table-CNsJsvNH.js → vue-ui-table-ClPMKcMn.js} +1 -1
- package/dist/{vue-ui-table-heatmap-Dl4lMTS6.cjs → vue-ui-table-heatmap-B7wTjM-H.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-CTs7AxUi.js → vue-ui-table-heatmap-DVQtPt-M.js} +4 -4
- package/dist/{vue-ui-table-sparkline-Dy5shfoJ.cjs → vue-ui-table-sparkline-DaKODjfM.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline-ZtfktJZh.js → vue-ui-table-sparkline-DjxKXWQm.js} +5 -5
- package/dist/{vue-ui-thermometer-CaFnSru6.js → vue-ui-thermometer-CV_9k37V.js} +7 -7
- package/dist/{vue-ui-thermometer-039Cyhc2.cjs → vue-ui-thermometer-DE9r0emf.cjs} +1 -1
- package/dist/{vue-ui-timer-ChuLD5VW.js → vue-ui-timer-2w5Ayq7G.js} +35 -33
- package/dist/vue-ui-timer-Ct-KYWSX.cjs +64 -0
- package/dist/{vue-ui-tiremarks-nDFTQjHJ.js → vue-ui-tiremarks-BJnh0GBj.js} +7 -7
- package/dist/{vue-ui-tiremarks-BiLfVwpF.cjs → vue-ui-tiremarks-Cf04zARl.cjs} +1 -1
- package/dist/{vue-ui-treemap-Dv9HNV59.js → vue-ui-treemap-BD546LBi.js} +37 -35
- package/dist/vue-ui-treemap-D0vi4bv4.cjs +1 -0
- package/dist/{vue-ui-vertical-bar-W7AgfJa9.cjs → vue-ui-vertical-bar-D3QKHHnS.cjs} +2 -2
- package/dist/{vue-ui-vertical-bar-M3IDlqbG.js → vue-ui-vertical-bar-E5CTb1Bd.js} +53 -51
- package/dist/{vue-ui-waffle-CJYfXE-I.js → vue-ui-waffle-BAJIMbZK.js} +50 -48
- package/dist/vue-ui-waffle-BL0e3Yeq.cjs +1 -0
- package/dist/{vue-ui-wheel-BaMfH-RC.js → vue-ui-wheel-CPPLUSFq.js} +22 -20
- package/dist/vue-ui-wheel-Dy_B7BTG.cjs +1 -0
- package/dist/vue-ui-word-cloud-BPoAoeWZ.cjs +1 -0
- package/dist/{vue-ui-word-cloud-qympaTse.js → vue-ui-word-cloud-BVZcDY7m.js} +47 -45
- package/dist/vue-ui-xy-D4hRtHAi.cjs +3 -0
- package/dist/{vue-ui-xy-canvas-Dn_4rMul.cjs → vue-ui-xy-canvas-BSZTrqci.cjs} +2 -2
- package/dist/{vue-ui-xy-canvas-qk5Vd9ng.js → vue-ui-xy-canvas-DFUfTZwz.js} +36 -34
- package/dist/{vue-ui-xy-BB_4gujH.js → vue-ui-xy-tB-6IP2y.js} +833 -839
- package/package.json +1 -1
- package/dist/Slicer-BZ-tooWv.cjs +0 -1
- package/dist/index-D4M1RdVn.cjs +0 -9
- package/dist/vue-ui-age-pyramid-BP3AgRGA.cjs +0 -1
- package/dist/vue-ui-donut--6AZz6OL.cjs +0 -1
- package/dist/vue-ui-dumbbell-6eYMBh5-.cjs +0 -9
- package/dist/vue-ui-funnel-CnyUx_rr.cjs +0 -1
- package/dist/vue-ui-gauge-Cg5wvQOF.cjs +0 -1
- package/dist/vue-ui-history-plot-N8Okj-iE.cjs +0 -1
- package/dist/vue-ui-quadrant-BSaMyYkS.cjs +0 -1
- package/dist/vue-ui-radar-BBKYxxex.cjs +0 -1
- package/dist/vue-ui-relation-circle-COKOM6l_.cjs +0 -1
- package/dist/vue-ui-scatter-oA9YA_np.cjs +0 -1
- package/dist/vue-ui-sparkline-De42544c.cjs +0 -1
- package/dist/vue-ui-strip-plot-CY7AKOJ8.cjs +0 -1
- package/dist/vue-ui-timer-BIAfoC2X.cjs +0 -64
- package/dist/vue-ui-treemap-8aBLlF51.cjs +0 -1
- package/dist/vue-ui-waffle-DefdpuXf.cjs +0 -1
- package/dist/vue-ui-wheel-DicUDLkK.cjs +0 -1
- package/dist/vue-ui-word-cloud-B5n21JbB.cjs +0 -1
- package/dist/vue-ui-xy-Du5PZnkC.cjs +0 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-D4M1RdVn.cjs"),Y=require("./useNestedProp-D_XfpfnF.cjs"),ce=require("./vue-ui-sparkline-De42544c.cjs"),x=require("./BaseIcon-D92qdnv7.cjs"),D=require("./usePrinter-Bfrr3DDK.cjs"),ve=require("./useUserOptionState-BgepsfED.cjs"),pe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),me=["id"],fe={style:{"z-index":"1","padding-right":"24px"}},ye={key:0,style:{display:"flex",flexDirection:"row",alignItems:"center"}},ge={key:0,style:{display:"flex",flexDirection:"row",alignItems:"center"}},be=["onClick"],ke=["onClick"],he=["data-cell"],Se=["data-cell","onPointerenter"],Ce=["data-cell"],_e=["data-cell"],xe=["data-cell"],we=["data-cell"],Ne={key:1,ref:"source",dir:"auto"},ze={__name:"vue-ui-table-sparkline",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(Z,{expose:ee}){const y=Z;e.useCssVars(l=>({eeaf54cc:l.tdo}));const{vue_ui_table_sparkline:te}=u.useConfig(),w=e.ref(u.createUid()),$=e.ref(0),N=e.ref(0),z=e.ref(null),le=e.useSlots();e.onMounted(()=>{le["chart-background"]&&console.warn("VueUiTableSparkline does not support the #chart-background slot.")});const t=e.computed({get:()=>T(),set:l=>l}),{userOptionsVisible:V,setUserOptionsVisibility:P,keepUserOptionState:F}=ve.useUserOptionState({config:t.value});function T(){const l=Y.useNestedProp({userConfig:y.config,defaultConfig:te});return l.theme?{...Y.useNestedProp({userConfig:u.themes.vue_ui_table_sparkline[l.theme]||y.config,defaultConfig:l}),customPalette:u.themePalettes[l.theme]||u.palette}:l}e.watch(()=>y.config,l=>{t.value=T(),V.value=!t.value.showOnChartHover,q(),N.value+=1},{deep:!0}),e.watch(()=>y.dataset,l=>{c.value=h.value,N.value+=1},{deep:!0});const{isPrinting:M,isImaging:W,generatePdf:L,generateImage:U}=D.usePrinter({elementId:`table_${w.value}`,fileName:t.value.title.text||"vue-ui-table-sparkline"}),ae=e.computed(()=>u.convertCustomPalette(t.value.customPalette)),C=e.ref(null),B=e.ref(!1),oe=e.computed(()=>t.value.responsiveBreakpoint);e.onMounted(()=>{q()});const E=e.ref(t.value.colNames);function q(){u.objectIsEmpty(y.dataset)&&u.error({componentName:"VueUiTableSparkline",type:"dataset"});const l=new ResizeObserver(o=>{o.forEach(a=>{B.value=a.contentRect.width<oe.value})});C.value&&l.observe(C.value),E.value=[];for(let o=0;o<H.value;o+=1)E.value.push(t.value.colNames[o]||`col ${o}`)}const G=e.computed(()=>(y.dataset.forEach((l,o)=>{u.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(a=>{u.error({componentName:"VueUiTableSparkline",type:"datasetSerieAttribute",property:a,index:o})})}),y.dataset.map((l,o)=>{const a=(l.values||[]).map(d=>isNaN(d)?0:d??0),n=a.reduce((d,i)=>d+i,0),s=n/a.length,r=u.calcMedian(a);return{...l,values:l.values||[],color:u.convertColorToHex(l.color)||ae.value[o]||u.palette[o]||u.palette[o%u.palette.length],sum:n,average:s,median:r,sparklineDataset:a.map((d,i)=>({period:t.value.colNames[i]||`col ${i}`,value:d||0}))}})));function ne(l){const a=(l[0].values||[]).map((s,r)=>l.map(d=>d.values[r]||[])).map(s=>s.map((r,d)=>[r,d]).sort((r,d)=>d[0]-r[0]).map(r=>r[1]));return l.map((s,r)=>({...s,values:s.values||[],orders:a[r]}))}const h=e.computed(()=>ne(G.value)),c=e.ref(h.value),re=e.computed(()=>Math.max(...c.value.map(l=>(l.values||[]).length))),I=e.ref(void 0),A=e.ref(!1),v=e.ref(void 0),R=e.ref(1);function k(){A.value=!1,v.value=void 0,p.value=void 0,R.value=1,S.value.forEach(l=>l.state=1),g.value={name:1,sum:1,average:1,median:1},c.value=h.value}function _(l,o,a){if(["name","sum","average","median"].includes(l.type)){ue(l.type,o,a);return}if(!J(o))return;if(b.value=o,p.value=void 0,![null,void 0].includes(v.value)&&o!==v.value&&(v.value=void 0,k()),S.value[o].state===a&&v.value===o){v.value=void 0,k();return}A.value=!0,v.value=o;const n=h.value.map(i=>i.values[o]||[]),s=a;S.value[o].state=s,R.value=s,o===I.value?I.value=void 0:I.value=o;const d=n.map((i,m)=>[m,i]).sort((i,m)=>s*(m[1]-i[1])).map(i=>i[0]).map(i=>h.value[i]);c.value=d,N.value+=1}const H=e.computed(()=>Math.max(...y.dataset.map(l=>(l.values||[]).length))),f=e.computed(()=>{let l=E.value.map(a=>({type:"reg",value:a}));if(!l.length)for(let a=0;a<H.value;a+=1)l.push({type:"reg",value:`col ${a+1}`});t.value.showTotal&&(l=[...l,{type:"sum",value:t.value.translations.total}]);let o;return t.value.showAverage&&t.value.showMedian?o=[...l,{type:"average",value:t.value.translations.average},{type:"median",value:t.value.translations.median}]:t.value.showAverage&&!t.value.showMedian?o=[...l,{type:"average",value:t.value.translations.average}]:!t.value.showAverage&&t.value.showMedian?o=[...l,{type:"median",value:t.value.translations.median}]:o=l,t.value.showSparklines?[...o,{type:"chart",value:t.value.translations.chart}]:o}),g=e.ref({name:1,sum:1,average:1,median:1}),p=e.ref(void 0);function ue(l,o,a){if(!c.value||c.value.length===0||!K(l))return;if(p.value!==l&&(p.value=void 0),![null,void 0].includes(v.value)&&o!==v.value&&k(),v.value=void 0,g.value[l]===a&&p.value){p.value=void 0,k();return}p.value=l,A.value=!0,g.value[l]=a,[null,void 0].includes(o)||(S.value[o].state=g.value[l]);const n=g.value[l],s=[...c.value].sort((r,d)=>{const i=r[l]??(typeof r[l]=="number"?0:""),m=d[l]??(typeof d[l]=="number"?0:"");return typeof i=="string"&&typeof m=="string"?n===-1?i.localeCompare(m):m.localeCompare(i):typeof i=="number"&&typeof m=="number"?n===-1?i-m:m-i:0});c.value=s}const b=e.ref(void 0),O=e.ref(void 0);function se({dataIndex:l,serieIndex:o}){b.value=l,O.value=o,z.value[l]&&!B.value&&z.value[l].scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})}const X=e.ref(!1);function ie(l){X.value=l,$.value+=1}function j(){e.nextTick(()=>{const l=[t.value.translations.serie].concat(f.value),o=G.value.map((s,r)=>[[s.name],s.values,[s.sum],[s.average],[s.median]]),a=[l].concat(o),n=u.createCsvContent(a);u.downloadCsv({csvContent:n,title:t.value.title.text||"vue-ui-table-sparkline"})})}function J(l){return t.value.sortedDataColumnIndices.includes(l)}function K(l){return l.type==="name"||l==="name"?t.value.sortedSeriesName:l.type==="sum"||l==="sum"?t.value.sortedSum:l.type==="average"||l==="average"?t.value.sortedAverage:l.type==="median"||l==="median"?t.value.sortedMedian:!1}function Q(l,o,a){return["sum","average","median"].includes(o.type)?p.value===o.type&&g.value[o.type]===a?1:.3:l===v.value&&S.value[l].state===a?1:.3}function de(){t.value.resetSortOnClickOutside&&k()}const S=e.computed({get:()=>f.value.map(l=>({state:1})),set:l=>l});return ee({generatePdf:L,generateImage:U,generateCsv:j,restoreOrder:k}),(l,o)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tableContainer",ref:C,class:e.normalizeClass({"vue-ui-responsive":B.value}),style:{overflow:"hidden"},id:`table_${w.value}`,onMouseenter:o[3]||(o[3]=()=>e.unref(P)(!0)),onMouseleave:o[4]||(o[4]=()=>e.unref(P)(!1))},[t.value.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vue-ui-table-sparkline-caption",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("div",{style:{overflow:"auto"},onPointerleave:o[2]||(o[2]=a=>{O.value=void 0,b.value=void 0})},[e.createElementVNode("table",{class:"vue-ui-data-table",style:e.normalizeStyle({fontFamily:t.value.fontFamily,position:"relative"})},[e.createElementVNode("thead",fe,[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.createElementVNode("div",{style:e.normalizeStyle({display:"flex",flexDirection:"row",alignItems:"center",gap:"3px",justifyContent:t.value.thead.textAlign})},[e.createElementVNode("span",null,e.toDisplayString(t.value.translations.serie),1),c.value.length>1&&t.value.sortedSeriesName?(e.openBlock(),e.createElementBlock("div",ye,[e.createElementVNode("button",{class:"vue-ui-table-sparkline-sorting-button vue-ui-table-sparkline-sorting-button-down",onClick:o[0]||(o[0]=a=>_({type:"name"},null,-1))},[e.createVNode(x.default,{size:12,name:"arrowBottom",stroke:t.value.thead.color,style:e.normalizeStyle({opacity:p.value==="name"&&g.value.name===-1?1:.3})},null,8,["stroke","style"])]),e.createElementVNode("button",{class:"vue-ui-table-sparkline-sorting-button vue-ui-table-sparkline-sorting-button-up",onClick:o[1]||(o[1]=a=>_({type:"name"},null,1))},[e.createVNode(x.default,{size:12,name:"arrowTop",stroke:t.value.thead.color,style:e.normalizeStyle({opacity:p.value==="name"&&g.value.name===1?1:.3})},null,8,["stroke","style"])])])):e.createCommentVNode("",!0)],4)],4),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(a,n)=>(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:n===f.value.length-1?`${t.value.sparkline.dimensions.width}px`:"48px",paddingRight:n===f.value.length-1&&t.value.userOptions.show?"36px":""}),class:e.normalizeClass({"sticky-col":n===f.value.length-1&&t.value.showSparklines})},[e.createElementVNode("div",{style:e.normalizeStyle({display:"flex",flexDirection:"row",alignItems:"center",gap:"3px",justifyContent:t.value.thead.textAlign})},[e.createElementVNode("span",null,e.toDisplayString(a.value),1),c.value.length>1&&(J(n)||K(a))?(e.openBlock(),e.createElementBlock("div",ge,[e.createElementVNode("button",{class:"vue-ui-table-sparkline-sorting-button vue-ui-table-sparkline-sorting-button-down",onClick:()=>_(a,n,-1)},[e.createVNode(x.default,{size:12,name:"arrowBottom",stroke:t.value.thead.color,style:e.normalizeStyle({opacity:Q(n,a,-1)})},null,8,["stroke","style"])],8,be),e.createElementVNode("button",{class:"vue-ui-table-sparkline-sorting-button vue-ui-table-sparkline-sorting-button-up",onClick:()=>_(a,n,1)},[e.createVNode(x.default,{size:12,name:"arrowTop",stroke:t.value.thead.color,style:e.normalizeStyle({opacity:Q(n,a,1)})},null,8,["stroke","style"])],8,ke)])):e.createCommentVNode("",!0)],4),t.value.userOptions.show&&n===f.value.length-1&&(e.unref(F)||e.unref(V))?(e.openBlock(),e.createBlock(D.UserOptions,{ref_for:!0,ref:"details",key:`user_option_${$.value}`,backgroundColor:t.value.thead.backgroundColor,color:t.value.thead.color,isPrinting:e.unref(M),isImaging:e.unref(W),uid:w.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:X.value,titles:{...t.value.userOptions.buttonTitles},chartElement:C.value,position:t.value.userOptions.position,onToggleFullscreen:ie,onGeneratePdf:e.unref(L),onGenerateImage:e.unref(U),onGenerateCsv:j,style:e.normalizeStyle({visibility:e.unref(F)?e.unref(V)?"visible":"hidden":"visible"})},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:s,isFullscreen:r})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:s,isFullscreen:r})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0)],6))),256))],4)),[[e.unref(D.vClickOutside),de]])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(a,n)=>(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":n%2===0,"vue-ui-data-table__tbody__row-odd":n%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,he),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(re.value,(s,r)=>(e.openBlock(),e.createElementBlock("td",{dir:"auto",role:"cell",ref_for:!0,ref_key:"TD",ref:z,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:b.value!==void 0&&r===b.value?t.value.tbody.selectedColor.useSerieColor?`${a.color.length>7?a.color.slice(0,-2):a.color}33`:t.value.tbody.selectedColor.fallback:""}),"data-cell":f.value[r]?f.value[r].value:"",class:"vue-ui-data-table__tbody__td",onPointerenter:d=>{O.value=n,b.value=r}},e.toDisplayString([null,void 0].includes(a.values[r])?"-":e.unref(u.applyDataLabel)(t.value.formatter,Number(a.values[r]),e.unref(u.dataLabel)({p:t.value.prefix,v:Number(a.values[r]),s:t.value.suffix,r:t.value.roundingValues}),{datapoint:a,seriesIndex:n,datapointIndex:r})),45,Se))),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(u.applyDataLabel)(t.value.formatter,a.sum,e.unref(u.dataLabel)({p:t.value.prefix,v:a.sum,s:t.value.suffix,r:t.value.roundingTotal}),{datapoint:a.sum,seriesIndex:n})),13,Ce)):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(u.applyDataLabel)(t.value.formatter,a.average,e.unref(u.dataLabel)({p:t.value.prefix,v:a.average,s:t.value.suffix,r:t.value.roundingAverage}),{datapoint:a.average,seriesIndex:n})),13,_e)):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(u.applyDataLabel)(t.value.formatter,a.median,e.unref(u.dataLabel)({p:t.value.prefix,v:a.median,s:t.value.suffix,r:t.value.roundingMedian}),{datapoint:a.median,seriesIndex:n})),13,xe)):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.createVNode(ce.default,{onHoverIndex:({index:s})=>se({dataIndex:s,serieIndex:n}),"height-ratio":t.value.sparkline.dimensions.heightRatio,"forced-padding":30,dataset:a.sparklineDataset,showInfo:!1,selectedIndex:b.value,config:{type:t.value.sparkline.type,style:{backgroundColor:"transparent",animation:{show:t.value.sparkline.animation.show&&!e.unref(M)&&!e.unref(W),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,we)):e.createCommentVNode("",!0)],6))),256))])],4)],32),l.$slots.source?(e.openBlock(),e.createElementBlock("div",Ne,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],42,me))}},Ve=pe._export_sfc(ze,[["__scopeId","data-v-4ee38c49"]]);exports.default=Ve;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-COIn1phv.cjs"),Y=require("./useNestedProp-CbMuGGl3.cjs"),ce=require("./vue-ui-sparkline-c5Awoj8J.cjs"),x=require("./BaseIcon-BVrsMbvi.cjs"),D=require("./usePrinter-CXXfgFFN.cjs"),ve=require("./useUserOptionState-BgepsfED.cjs"),pe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),me=["id"],fe={style:{"z-index":"1","padding-right":"24px"}},ye={key:0,style:{display:"flex",flexDirection:"row",alignItems:"center"}},ge={key:0,style:{display:"flex",flexDirection:"row",alignItems:"center"}},be=["onClick"],ke=["onClick"],he=["data-cell"],Se=["data-cell","onPointerenter"],Ce=["data-cell"],_e=["data-cell"],xe=["data-cell"],we=["data-cell"],Ne={key:1,ref:"source",dir:"auto"},ze={__name:"vue-ui-table-sparkline",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(Z,{expose:ee}){const y=Z;e.useCssVars(l=>({eeaf54cc:l.tdo}));const{vue_ui_table_sparkline:te}=u.useConfig(),w=e.ref(u.createUid()),$=e.ref(0),N=e.ref(0),z=e.ref(null),le=e.useSlots();e.onMounted(()=>{le["chart-background"]&&console.warn("VueUiTableSparkline does not support the #chart-background slot.")});const t=e.computed({get:()=>T(),set:l=>l}),{userOptionsVisible:V,setUserOptionsVisibility:P,keepUserOptionState:F}=ve.useUserOptionState({config:t.value});function T(){const l=Y.useNestedProp({userConfig:y.config,defaultConfig:te});return l.theme?{...Y.useNestedProp({userConfig:u.themes.vue_ui_table_sparkline[l.theme]||y.config,defaultConfig:l}),customPalette:u.themePalettes[l.theme]||u.palette}:l}e.watch(()=>y.config,l=>{t.value=T(),V.value=!t.value.showOnChartHover,q(),N.value+=1},{deep:!0}),e.watch(()=>y.dataset,l=>{c.value=h.value,N.value+=1},{deep:!0});const{isPrinting:M,isImaging:W,generatePdf:L,generateImage:U}=D.usePrinter({elementId:`table_${w.value}`,fileName:t.value.title.text||"vue-ui-table-sparkline"}),ae=e.computed(()=>u.convertCustomPalette(t.value.customPalette)),C=e.ref(null),B=e.ref(!1),oe=e.computed(()=>t.value.responsiveBreakpoint);e.onMounted(()=>{q()});const E=e.ref(t.value.colNames);function q(){u.objectIsEmpty(y.dataset)&&u.error({componentName:"VueUiTableSparkline",type:"dataset"});const l=new ResizeObserver(o=>{o.forEach(a=>{B.value=a.contentRect.width<oe.value})});C.value&&l.observe(C.value),E.value=[];for(let o=0;o<H.value;o+=1)E.value.push(t.value.colNames[o]||`col ${o}`)}const G=e.computed(()=>(y.dataset.forEach((l,o)=>{u.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(a=>{u.error({componentName:"VueUiTableSparkline",type:"datasetSerieAttribute",property:a,index:o})})}),y.dataset.map((l,o)=>{const a=(l.values||[]).map(d=>isNaN(d)?0:d??0),n=a.reduce((d,i)=>d+i,0),s=n/a.length,r=u.calcMedian(a);return{...l,values:l.values||[],color:u.convertColorToHex(l.color)||ae.value[o]||u.palette[o]||u.palette[o%u.palette.length],sum:n,average:s,median:r,sparklineDataset:a.map((d,i)=>({period:t.value.colNames[i]||`col ${i}`,value:d||0}))}})));function ne(l){const a=(l[0].values||[]).map((s,r)=>l.map(d=>d.values[r]||[])).map(s=>s.map((r,d)=>[r,d]).sort((r,d)=>d[0]-r[0]).map(r=>r[1]));return l.map((s,r)=>({...s,values:s.values||[],orders:a[r]}))}const h=e.computed(()=>ne(G.value)),c=e.ref(h.value),re=e.computed(()=>Math.max(...c.value.map(l=>(l.values||[]).length))),I=e.ref(void 0),A=e.ref(!1),v=e.ref(void 0),R=e.ref(1);function k(){A.value=!1,v.value=void 0,p.value=void 0,R.value=1,S.value.forEach(l=>l.state=1),g.value={name:1,sum:1,average:1,median:1},c.value=h.value}function _(l,o,a){if(["name","sum","average","median"].includes(l.type)){ue(l.type,o,a);return}if(!J(o))return;if(b.value=o,p.value=void 0,![null,void 0].includes(v.value)&&o!==v.value&&(v.value=void 0,k()),S.value[o].state===a&&v.value===o){v.value=void 0,k();return}A.value=!0,v.value=o;const n=h.value.map(i=>i.values[o]||[]),s=a;S.value[o].state=s,R.value=s,o===I.value?I.value=void 0:I.value=o;const d=n.map((i,m)=>[m,i]).sort((i,m)=>s*(m[1]-i[1])).map(i=>i[0]).map(i=>h.value[i]);c.value=d,N.value+=1}const H=e.computed(()=>Math.max(...y.dataset.map(l=>(l.values||[]).length))),f=e.computed(()=>{let l=E.value.map(a=>({type:"reg",value:a}));if(!l.length)for(let a=0;a<H.value;a+=1)l.push({type:"reg",value:`col ${a+1}`});t.value.showTotal&&(l=[...l,{type:"sum",value:t.value.translations.total}]);let o;return t.value.showAverage&&t.value.showMedian?o=[...l,{type:"average",value:t.value.translations.average},{type:"median",value:t.value.translations.median}]:t.value.showAverage&&!t.value.showMedian?o=[...l,{type:"average",value:t.value.translations.average}]:!t.value.showAverage&&t.value.showMedian?o=[...l,{type:"median",value:t.value.translations.median}]:o=l,t.value.showSparklines?[...o,{type:"chart",value:t.value.translations.chart}]:o}),g=e.ref({name:1,sum:1,average:1,median:1}),p=e.ref(void 0);function ue(l,o,a){if(!c.value||c.value.length===0||!K(l))return;if(p.value!==l&&(p.value=void 0),![null,void 0].includes(v.value)&&o!==v.value&&k(),v.value=void 0,g.value[l]===a&&p.value){p.value=void 0,k();return}p.value=l,A.value=!0,g.value[l]=a,[null,void 0].includes(o)||(S.value[o].state=g.value[l]);const n=g.value[l],s=[...c.value].sort((r,d)=>{const i=r[l]??(typeof r[l]=="number"?0:""),m=d[l]??(typeof d[l]=="number"?0:"");return typeof i=="string"&&typeof m=="string"?n===-1?i.localeCompare(m):m.localeCompare(i):typeof i=="number"&&typeof m=="number"?n===-1?i-m:m-i:0});c.value=s}const b=e.ref(void 0),O=e.ref(void 0);function se({dataIndex:l,serieIndex:o}){b.value=l,O.value=o,z.value[l]&&!B.value&&z.value[l].scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})}const X=e.ref(!1);function ie(l){X.value=l,$.value+=1}function j(){e.nextTick(()=>{const l=[t.value.translations.serie].concat(f.value),o=G.value.map((s,r)=>[[s.name],s.values,[s.sum],[s.average],[s.median]]),a=[l].concat(o),n=u.createCsvContent(a);u.downloadCsv({csvContent:n,title:t.value.title.text||"vue-ui-table-sparkline"})})}function J(l){return t.value.sortedDataColumnIndices.includes(l)}function K(l){return l.type==="name"||l==="name"?t.value.sortedSeriesName:l.type==="sum"||l==="sum"?t.value.sortedSum:l.type==="average"||l==="average"?t.value.sortedAverage:l.type==="median"||l==="median"?t.value.sortedMedian:!1}function Q(l,o,a){return["sum","average","median"].includes(o.type)?p.value===o.type&&g.value[o.type]===a?1:.3:l===v.value&&S.value[l].state===a?1:.3}function de(){t.value.resetSortOnClickOutside&&k()}const S=e.computed({get:()=>f.value.map(l=>({state:1})),set:l=>l});return ee({generatePdf:L,generateImage:U,generateCsv:j,restoreOrder:k}),(l,o)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tableContainer",ref:C,class:e.normalizeClass({"vue-ui-responsive":B.value}),style:{overflow:"hidden"},id:`table_${w.value}`,onMouseenter:o[3]||(o[3]=()=>e.unref(P)(!0)),onMouseleave:o[4]||(o[4]=()=>e.unref(P)(!1))},[t.value.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vue-ui-table-sparkline-caption",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("div",{style:{overflow:"auto"},onPointerleave:o[2]||(o[2]=a=>{O.value=void 0,b.value=void 0})},[e.createElementVNode("table",{class:"vue-ui-data-table",style:e.normalizeStyle({fontFamily:t.value.fontFamily,position:"relative"})},[e.createElementVNode("thead",fe,[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.createElementVNode("div",{style:e.normalizeStyle({display:"flex",flexDirection:"row",alignItems:"center",gap:"3px",justifyContent:t.value.thead.textAlign})},[e.createElementVNode("span",null,e.toDisplayString(t.value.translations.serie),1),c.value.length>1&&t.value.sortedSeriesName?(e.openBlock(),e.createElementBlock("div",ye,[e.createElementVNode("button",{class:"vue-ui-table-sparkline-sorting-button vue-ui-table-sparkline-sorting-button-down",onClick:o[0]||(o[0]=a=>_({type:"name"},null,-1))},[e.createVNode(x.default,{size:12,name:"arrowBottom",stroke:t.value.thead.color,style:e.normalizeStyle({opacity:p.value==="name"&&g.value.name===-1?1:.3})},null,8,["stroke","style"])]),e.createElementVNode("button",{class:"vue-ui-table-sparkline-sorting-button vue-ui-table-sparkline-sorting-button-up",onClick:o[1]||(o[1]=a=>_({type:"name"},null,1))},[e.createVNode(x.default,{size:12,name:"arrowTop",stroke:t.value.thead.color,style:e.normalizeStyle({opacity:p.value==="name"&&g.value.name===1?1:.3})},null,8,["stroke","style"])])])):e.createCommentVNode("",!0)],4)],4),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(a,n)=>(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:n===f.value.length-1?`${t.value.sparkline.dimensions.width}px`:"48px",paddingRight:n===f.value.length-1&&t.value.userOptions.show?"36px":""}),class:e.normalizeClass({"sticky-col":n===f.value.length-1&&t.value.showSparklines})},[e.createElementVNode("div",{style:e.normalizeStyle({display:"flex",flexDirection:"row",alignItems:"center",gap:"3px",justifyContent:t.value.thead.textAlign})},[e.createElementVNode("span",null,e.toDisplayString(a.value),1),c.value.length>1&&(J(n)||K(a))?(e.openBlock(),e.createElementBlock("div",ge,[e.createElementVNode("button",{class:"vue-ui-table-sparkline-sorting-button vue-ui-table-sparkline-sorting-button-down",onClick:()=>_(a,n,-1)},[e.createVNode(x.default,{size:12,name:"arrowBottom",stroke:t.value.thead.color,style:e.normalizeStyle({opacity:Q(n,a,-1)})},null,8,["stroke","style"])],8,be),e.createElementVNode("button",{class:"vue-ui-table-sparkline-sorting-button vue-ui-table-sparkline-sorting-button-up",onClick:()=>_(a,n,1)},[e.createVNode(x.default,{size:12,name:"arrowTop",stroke:t.value.thead.color,style:e.normalizeStyle({opacity:Q(n,a,1)})},null,8,["stroke","style"])],8,ke)])):e.createCommentVNode("",!0)],4),t.value.userOptions.show&&n===f.value.length-1&&(e.unref(F)||e.unref(V))?(e.openBlock(),e.createBlock(D.UserOptions,{ref_for:!0,ref:"details",key:`user_option_${$.value}`,backgroundColor:t.value.thead.backgroundColor,color:t.value.thead.color,isPrinting:e.unref(M),isImaging:e.unref(W),uid:w.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:X.value,titles:{...t.value.userOptions.buttonTitles},chartElement:C.value,position:t.value.userOptions.position,onToggleFullscreen:ie,onGeneratePdf:e.unref(L),onGenerateImage:e.unref(U),onGenerateCsv:j,style:e.normalizeStyle({visibility:e.unref(F)?e.unref(V)?"visible":"hidden":"visible"})},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:s,isFullscreen:r})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:s,isFullscreen:r})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0)],6))),256))],4)),[[e.unref(D.vClickOutside),de]])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(a,n)=>(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":n%2===0,"vue-ui-data-table__tbody__row-odd":n%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,he),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(re.value,(s,r)=>(e.openBlock(),e.createElementBlock("td",{dir:"auto",role:"cell",ref_for:!0,ref_key:"TD",ref:z,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:b.value!==void 0&&r===b.value?t.value.tbody.selectedColor.useSerieColor?`${a.color.length>7?a.color.slice(0,-2):a.color}33`:t.value.tbody.selectedColor.fallback:""}),"data-cell":f.value[r]?f.value[r].value:"",class:"vue-ui-data-table__tbody__td",onPointerenter:d=>{O.value=n,b.value=r}},e.toDisplayString([null,void 0].includes(a.values[r])?"-":e.unref(u.applyDataLabel)(t.value.formatter,Number(a.values[r]),e.unref(u.dataLabel)({p:t.value.prefix,v:Number(a.values[r]),s:t.value.suffix,r:t.value.roundingValues}),{datapoint:a,seriesIndex:n,datapointIndex:r})),45,Se))),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(u.applyDataLabel)(t.value.formatter,a.sum,e.unref(u.dataLabel)({p:t.value.prefix,v:a.sum,s:t.value.suffix,r:t.value.roundingTotal}),{datapoint:a.sum,seriesIndex:n})),13,Ce)):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(u.applyDataLabel)(t.value.formatter,a.average,e.unref(u.dataLabel)({p:t.value.prefix,v:a.average,s:t.value.suffix,r:t.value.roundingAverage}),{datapoint:a.average,seriesIndex:n})),13,_e)):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(u.applyDataLabel)(t.value.formatter,a.median,e.unref(u.dataLabel)({p:t.value.prefix,v:a.median,s:t.value.suffix,r:t.value.roundingMedian}),{datapoint:a.median,seriesIndex:n})),13,xe)):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.createVNode(ce.default,{onHoverIndex:({index:s})=>se({dataIndex:s,serieIndex:n}),"height-ratio":t.value.sparkline.dimensions.heightRatio,"forced-padding":30,dataset:a.sparklineDataset,showInfo:!1,selectedIndex:b.value,config:{type:t.value.sparkline.type,style:{backgroundColor:"transparent",animation:{show:t.value.sparkline.animation.show&&!e.unref(M)&&!e.unref(W),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,we)):e.createCommentVNode("",!0)],6))),256))])],4)],32),l.$slots.source?(e.openBlock(),e.createElementBlock("div",Ne,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],42,me))}},Ve=pe._export_sfc(ze,[["__scopeId","data-v-4ee38c49"]]);exports.default=Ve;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useCssVars as $e, ref as p, useSlots as ze, onMounted as pe, computed as _, watch as fe, openBlock as d, createElementBlock as c, normalizeClass as X, unref as i, normalizeStyle as s, createElementVNode as f, toDisplayString as C, createCommentVNode as b, withDirectives as Pe, createVNode as $, Fragment as J, renderList as K, createBlock as De, createSlots as Ne, withCtx as N, renderSlot as z, normalizeProps as Fe, guardReactiveProps as Ve, nextTick as Te } from "vue";
|
|
2
|
-
import { u as We, c as Me, t as Ee, a as Ue, p as F, b as Be, o as Ge, e as me, g as Le, a0 as Re, d as He, i as V, f as T, q as qe, r as Xe } from "./index-
|
|
3
|
-
import { u as ge } from "./useNestedProp-
|
|
4
|
-
import Je from "./vue-ui-sparkline-
|
|
5
|
-
import W from "./BaseIcon-
|
|
6
|
-
import { u as Ke, U as Qe, v as Ye } from "./usePrinter-
|
|
2
|
+
import { u as We, c as Me, t as Ee, a as Ue, p as F, b as Be, o as Ge, e as me, g as Le, a0 as Re, d as He, i as V, f as T, q as qe, r as Xe } from "./index-B7nCQFK0.js";
|
|
3
|
+
import { u as ge } from "./useNestedProp-C9rlBRTT.js";
|
|
4
|
+
import Je from "./vue-ui-sparkline-BqNlrKjb.js";
|
|
5
|
+
import W from "./BaseIcon-B8U62FEj.js";
|
|
6
|
+
import { u as Ke, U as Qe, v as Ye } from "./usePrinter-CQMn1b4E.js";
|
|
7
7
|
import { u as Ze } from "./useUserOptionState-BIvW1Kz7.js";
|
|
8
8
|
import { _ as je } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
9
9
|
const et = ["id"], tt = { style: { "z-index": "1", "padding-right": "24px" } }, at = {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useCssVars as me, computed as d, onMounted as ke, ref as p, watch as be, openBlock as a, createElementBlock as n, normalizeClass as P, normalizeStyle as ee, unref as h, createBlock as F, createCommentVNode as i, createSlots as xe, withCtx as O, renderSlot as g, normalizeProps as E, guardReactiveProps as G, createVNode as _e, createElementVNode as v, Fragment as I, renderList as te, toDisplayString as we } from "vue";
|
|
2
|
-
import { u as Ce, o as $e, e as se, g as Pe, c as Fe, t as Oe, a as Ie, p as x, b as Ae, v as f, d as A, X as Me, s as Ue, i as Ye, f as Ne } from "./index-
|
|
3
|
-
import { _ as Se } from "./Title-
|
|
4
|
-
import { u as Te, U as qe } from "./usePrinter-
|
|
5
|
-
import Le from "./vue-ui-skeleton-
|
|
6
|
-
import { u as oe } from "./useNestedProp-
|
|
7
|
-
import { _ as Ve } from "./PackageVersion-
|
|
8
|
-
import { P as Ee } from "./PenAndPaper-
|
|
2
|
+
import { u as Ce, o as $e, e as se, g as Pe, c as Fe, t as Oe, a as Ie, p as x, b as Ae, v as f, d as A, X as Me, s as Ue, i as Ye, f as Ne } from "./index-B7nCQFK0.js";
|
|
3
|
+
import { _ as Se } from "./Title-CaET2xuF.js";
|
|
4
|
+
import { u as Te, U as qe } from "./usePrinter-CQMn1b4E.js";
|
|
5
|
+
import Le from "./vue-ui-skeleton-D66ZIUln.js";
|
|
6
|
+
import { u as oe } from "./useNestedProp-C9rlBRTT.js";
|
|
7
|
+
import { _ as Ve } from "./PackageVersion-CENy3Lm2.js";
|
|
8
|
+
import { P as Ee } from "./PenAndPaper-Dr7ndoP_.js";
|
|
9
9
|
import { u as Ge } from "./useUserOptionState-BIvW1Kz7.js";
|
|
10
10
|
import { _ as We } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
11
11
|
const je = ["id"], ze = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-D4M1RdVn.cjs"),te=require("./Title-BqNuK5vc.cjs"),U=require("./usePrinter-Bfrr3DDK.cjs"),oe=require("./vue-ui-skeleton-6_VzxeeY.cjs"),Y=require("./useNestedProp-D_XfpfnF.cjs"),le=require("./PackageVersion-Bxz2crF7.cjs"),re=require("./PenAndPaper-BFCXiNMF.cjs"),ae=require("./useUserOptionState-BgepsfED.cjs"),se=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ne=["id"],ue={key:1,ref:"noTitle",class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},ie={key:2,style:"width:100%"},ce=["xmlns","viewBox"],de=["width","height"],he={id:"vueUiPill",clipPathUnits:"objectBoundingBox"},ve=["fill"],me=["id"],pe=["stop-color"],ye=["stop-color"],fe=["stop-color"],ge={"clip-path":"url(#vueUiPill)"},ke=["x","y","height","width"],be=["x","y","height","width","fill"],xe=["x1","x2","y1","y2","stroke-width","stroke"],Ce=["x1","x2","y1","y2","stroke-width","stroke"],we=["x1","x2","y1","y2","stroke-width","stroke"],_e=["x1","x2","y1","y2","stroke-width","stroke"],Ne=["x1","x2","y1","y2","stroke-width","stroke"],Be=["x1","x2","y1","y2","stroke-width","stroke"],Ve=["x1","x2","y1","y2","stroke-width","stroke"],Ee=["x1","x2","y1","y2","stroke-width","stroke"],Pe=["x","y","height","width"],$e=["y","x","fill","font-size","font-weight"],Fe={key:5,class:"vue-data-ui-watermark"},Oe={key:6,ref:"source",dir:"auto"},Se={__name:"vue-ui-thermometer",props:{dataset:{type:Object,default(){return{}}},config:{type:Object,default(){return{}}}},setup(m,{expose:z}){const s=m;e.useCssVars(l=>({"7f5072bd":R.value,"575f6d71":D.value,"041baa9e":j.value}));const{vue_ui_thermometer:L}=a.useConfig(),g=e.computed(()=>!!s.dataset&&Object.keys(s.dataset).length);e.onMounted(()=>{V()});function V(){a.objectIsEmpty(s.dataset)?a.error({componentName:"VueUiThermometer",type:"dataset"}):a.getMissingDatasetAttributes({datasetObject:s.dataset,requiredAttributes:["value","from","to"]}).forEach(l=>{a.error({componentName:"VueUiThermometer",type:"datasetAttribute",property:l})})}const d=e.ref(a.createUid()),k=e.ref(null),E=e.ref(0),P=e.ref(0),t=e.computed({get:()=>O(),set:l=>l}),{userOptionsVisible:b,setUserOptionsVisibility:$,keepUserOptionState:F}=ae.useUserOptionState({config:t.value});function O(){const l=Y.useNestedProp({userConfig:s.config,defaultConfig:L});return l.theme?{...Y.useNestedProp({userConfig:a.themes.vue_ui_thermometer[l.theme]||s.config,defaultConfig:l}),customPalette:a.themePalettes[l.theme]||a.palette}:l}e.watch(()=>s.config,l=>{t.value=O(),b.value=!t.value.showOnChartHover,V(),P.value+=1},{deep:!0});const{isPrinting:S,isImaging:I,generatePdf:q,generateImage:A}=U.usePrinter({elementId:`thermometer__${d.value}`,fileName:t.value.style.title.text||"vue-ui-thermometer"}),G=e.computed(()=>t.value.userOptions.show&&!t.value.style.title.text),p=e.computed(()=>a.convertCustomPalette(t.value.customPalette)),H=e.computed(()=>t.value.style.chart.thermometer.width),c=e.computed(()=>s.dataset.steps||10),i=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,n,o){const u=[],N=T(l),B=T(n);for(let v=0;v<o;v++){const K=x(N.red,B.red,v,o),Q=x(N.green,B.green,v,o),Z=x(N.blue,B.blue,v,o),ee=`#${C(K)}${C(Q)}${C(Z)}`;u.push(ee)}return u}function T(l){const n=l.slice(1);return{red:parseInt(n.slice(0,2),16),green:parseInt(n.slice(2,4),16),blue:parseInt(n.slice(4,6),16)}}function x(l,n,o,u){return Math.round(l+(n-l)*o/u)}function C(l){return l.toString(16).padStart(2,"0")}const r=e.computed(()=>{const l=H.value+i.value.left+i.value.right,n=t.value.style.chart.height;return{width:l,left:i.value.left,right:l-i.value.right,top:i.value.top,bottom:n-i.value.bottom,height:n}}),W=e.computed(()=>r.value),w=e.computed(()=>{const l=a.checkNaN(s.dataset.from)<0?Math.abs(a.checkNaN(s.dataset.from)):a.checkNaN(s.dataset.from),n=a.checkNaN(s.dataset.to)<0?Math.abs(a.checkNaN(s.dataset.to)):a.checkNaN(s.dataset.to);let o=0;return a.checkNaN(s.dataset.to)>0?o=l+n:l>n?o=l-n:o=n-l,(1-(Math.abs(a.checkNaN(s.dataset.from))+a.checkNaN(s.dataset.value))/o)*(r.value.height-i.value.top-i.value.bottom)}),j=e.computed(()=>`${w.value}px`),D=e.computed(()=>`${r.value.height-t.value.style.chart.padding.bottom-i.value.top}px`),R=e.computed(()=>`${t.value.style.chart.animation.speedMs}ms`),X=e.computed(()=>{if(s.dataset.colors){if(!s.dataset.colors.from)return y(p.value[0]||a.palette[0],a.convertColorToHex(s.dataset.colors.to),c.value||10);if(!s.dataset.colors.to)return y(a.convertColorToHex(s.dataset.colors.from),p.value[1]||a.palette[1],c.value||10)}else return y(p.value[1]||a.palette[1],p.value[0]||a.palette[0],c.value||10);return y(a.convertColorToHex(s.dataset.colors.from),a.convertColorToHex(s.dataset.colors.to),c.value||10)}),M=e.computed(()=>{const l=[];let n=0;const o=r.value.height-i.value.top-i.value.bottom;for(let u=0;u<o-1;u+=o/c.value)l.push({x:r.value.left,y:r.value.top+u,qYLess:r.value.top+u+o/c.value/4,halfY:r.value.top+u+o/c.value/2,qYMore:r.value.top+u+o/c.value/4*3,color:X.value[n],height:o/c.value}),n+=1;return l}),h=e.ref(!1);function J(l){h.value=l,E.value+=1}const f=e.ref(!1);function _(){f.value=!f.value}return z({generatePdf:q,generateImage:A,toggleAnnotator:_}),(l,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"thermoChart",ref:k,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}`,onMouseenter:n[0]||(n[0]=()=>e.unref($)(!0)),onMouseleave:n[1]||(n[1]=()=>e.unref($)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(re.PenAndPaper,{key:0,parent:k.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:f.value,onClose:_},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),G.value?(e.openBlock(),e.createElementBlock("div",ue,null,512)):e.createCommentVNode("",!0),t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",ie,[(e.openBlock(),e.createBlock(te._sfc_main,{key:`title_${P.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&&g.value&&(e.unref(F)||e.unref(b))?(e.openBlock(),e.createBlock(U.UserOptions,{ref:"details",key:`user_options_${E.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(I),isPrinting:e.unref(S),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:k.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:f.value,onToggleFullscreen:J,onGeneratePdf:e.unref(q),onGenerateImage:e.unref(A),onToggleAnnotator:_,style:e.normalizeStyle({visibility:e.unref(F)?e.unref(b)?"visible":"hidden":"visible"})},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:u})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:u})),void 0,!0)]),key:"2"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:u})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:u})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),g.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(a.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":h.value,"vue-data-ui-fulscreen--off":!h.value}),width:"100%",viewBox:`0 0 ${r.value.width} ${r.value.height}`,style:"background:transparent"},[e.createVNode(le._sfc_main),l.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:r.value.width,height:r.value.height,style:{pointerEvents:"none"}},[e.renderSlot(l.$slots,"chart-background",{},void 0,!0)],8,de)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[e.createElementVNode("clipPath",he,[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,ve)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.value,(o,u)=>(e.openBlock(),e.createElementBlock("linearGradient",{id:`vueUiThermometerGradient_${u}_${d.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":o.color},null,8,pe),e.createElementVNode("stop",{offset:"50%","stop-color":e.unref(a.setOpacity)(o.color,100-t.value.style.chart.graduations.gradient.intensity)},null,8,ye),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,fe)],8,me))),256))]),e.createElementVNode("g",ge,[e.createElementVNode("rect",{x:r.value.left,y:r.value.top,height:r.value.height-i.value.top-i.value.bottom,width:r.value.width-i.value.left-i.value.right,fill:"#FFFFFF"},null,8,ke),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.value,(o,u)=>(e.openBlock(),e.createElementBlock("g",{key:`graduation_${u}`},[e.createElementVNode("rect",{x:o.x,y:o.y,height:o.height,width:r.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right,fill:t.value.style.chart.graduations.gradient.show?`url(#vueUiThermometerGradient_${u}_${d.value})`:o.color,"shape-rendering":"crispEdges"},null,8,be),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,xe)):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,Ce)):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,we)):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,_e)):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:r.value.right,x2:r.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,Ne)):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:r.value.right,x2:r.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:r.value.right,x2:r.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,Ve)):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:r.value.right,x2:r.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,Ee)):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:r.value.left,y:r.value.top,height:w.value,width:r.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right,fill:"#FFFFFF66"},null,10,Pe)]),e.createElementVNode("text",{class:e.normalizeClass({"vue-ui-thermometer-temperature-value":t.value.style.chart.animation.use}),y:w.value+r.value.top+t.value.style.chart.label.fontSize/3,x:r.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(a.applyDataLabel)(t.value.style.chart.label.formatter,m.dataset.value,e.unref(a.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,$e),e.renderSlot(l.$slots,"svg",{svg:W.value},void 0,!0)],10,ce)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Fe,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(S)||e.unref(I)})),void 0,!0)])):e.createCommentVNode("",!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",Oe,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),g.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(oe.default,{key:7,config:{type:"thermometer",style:{backgroundColor:t.value.style.chart.backgroundColor,thermometer:{color:"#CCCCCC"}}}},null,8,["config"]))],46,ne))}},Ie=se._export_sfc(Se,[["__scopeId","data-v-f7910f15"]]);exports.default=Ie;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-COIn1phv.cjs"),te=require("./Title-DJUxOiaO.cjs"),U=require("./usePrinter-CXXfgFFN.cjs"),oe=require("./vue-ui-skeleton-BIqMxXV7.cjs"),Y=require("./useNestedProp-CbMuGGl3.cjs"),le=require("./PackageVersion-BjfedMsH.cjs"),re=require("./PenAndPaper-nqRtAh6J.cjs"),ae=require("./useUserOptionState-BgepsfED.cjs"),se=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ne=["id"],ue={key:1,ref:"noTitle",class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},ie={key:2,style:"width:100%"},ce=["xmlns","viewBox"],de=["width","height"],he={id:"vueUiPill",clipPathUnits:"objectBoundingBox"},ve=["fill"],me=["id"],pe=["stop-color"],ye=["stop-color"],fe=["stop-color"],ge={"clip-path":"url(#vueUiPill)"},ke=["x","y","height","width"],be=["x","y","height","width","fill"],xe=["x1","x2","y1","y2","stroke-width","stroke"],Ce=["x1","x2","y1","y2","stroke-width","stroke"],we=["x1","x2","y1","y2","stroke-width","stroke"],_e=["x1","x2","y1","y2","stroke-width","stroke"],Ne=["x1","x2","y1","y2","stroke-width","stroke"],Be=["x1","x2","y1","y2","stroke-width","stroke"],Ve=["x1","x2","y1","y2","stroke-width","stroke"],Ee=["x1","x2","y1","y2","stroke-width","stroke"],Pe=["x","y","height","width"],$e=["y","x","fill","font-size","font-weight"],Fe={key:5,class:"vue-data-ui-watermark"},Oe={key:6,ref:"source",dir:"auto"},Se={__name:"vue-ui-thermometer",props:{dataset:{type:Object,default(){return{}}},config:{type:Object,default(){return{}}}},setup(m,{expose:z}){const s=m;e.useCssVars(l=>({"7f5072bd":R.value,"575f6d71":D.value,"041baa9e":j.value}));const{vue_ui_thermometer:L}=a.useConfig(),g=e.computed(()=>!!s.dataset&&Object.keys(s.dataset).length);e.onMounted(()=>{V()});function V(){a.objectIsEmpty(s.dataset)?a.error({componentName:"VueUiThermometer",type:"dataset"}):a.getMissingDatasetAttributes({datasetObject:s.dataset,requiredAttributes:["value","from","to"]}).forEach(l=>{a.error({componentName:"VueUiThermometer",type:"datasetAttribute",property:l})})}const d=e.ref(a.createUid()),k=e.ref(null),E=e.ref(0),P=e.ref(0),t=e.computed({get:()=>O(),set:l=>l}),{userOptionsVisible:b,setUserOptionsVisibility:$,keepUserOptionState:F}=ae.useUserOptionState({config:t.value});function O(){const l=Y.useNestedProp({userConfig:s.config,defaultConfig:L});return l.theme?{...Y.useNestedProp({userConfig:a.themes.vue_ui_thermometer[l.theme]||s.config,defaultConfig:l}),customPalette:a.themePalettes[l.theme]||a.palette}:l}e.watch(()=>s.config,l=>{t.value=O(),b.value=!t.value.showOnChartHover,V(),P.value+=1},{deep:!0});const{isPrinting:S,isImaging:I,generatePdf:q,generateImage:A}=U.usePrinter({elementId:`thermometer__${d.value}`,fileName:t.value.style.title.text||"vue-ui-thermometer"}),G=e.computed(()=>t.value.userOptions.show&&!t.value.style.title.text),p=e.computed(()=>a.convertCustomPalette(t.value.customPalette)),H=e.computed(()=>t.value.style.chart.thermometer.width),c=e.computed(()=>s.dataset.steps||10),i=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,n,o){const u=[],N=T(l),B=T(n);for(let v=0;v<o;v++){const K=x(N.red,B.red,v,o),Q=x(N.green,B.green,v,o),Z=x(N.blue,B.blue,v,o),ee=`#${C(K)}${C(Q)}${C(Z)}`;u.push(ee)}return u}function T(l){const n=l.slice(1);return{red:parseInt(n.slice(0,2),16),green:parseInt(n.slice(2,4),16),blue:parseInt(n.slice(4,6),16)}}function x(l,n,o,u){return Math.round(l+(n-l)*o/u)}function C(l){return l.toString(16).padStart(2,"0")}const r=e.computed(()=>{const l=H.value+i.value.left+i.value.right,n=t.value.style.chart.height;return{width:l,left:i.value.left,right:l-i.value.right,top:i.value.top,bottom:n-i.value.bottom,height:n}}),W=e.computed(()=>r.value),w=e.computed(()=>{const l=a.checkNaN(s.dataset.from)<0?Math.abs(a.checkNaN(s.dataset.from)):a.checkNaN(s.dataset.from),n=a.checkNaN(s.dataset.to)<0?Math.abs(a.checkNaN(s.dataset.to)):a.checkNaN(s.dataset.to);let o=0;return a.checkNaN(s.dataset.to)>0?o=l+n:l>n?o=l-n:o=n-l,(1-(Math.abs(a.checkNaN(s.dataset.from))+a.checkNaN(s.dataset.value))/o)*(r.value.height-i.value.top-i.value.bottom)}),j=e.computed(()=>`${w.value}px`),D=e.computed(()=>`${r.value.height-t.value.style.chart.padding.bottom-i.value.top}px`),R=e.computed(()=>`${t.value.style.chart.animation.speedMs}ms`),X=e.computed(()=>{if(s.dataset.colors){if(!s.dataset.colors.from)return y(p.value[0]||a.palette[0],a.convertColorToHex(s.dataset.colors.to),c.value||10);if(!s.dataset.colors.to)return y(a.convertColorToHex(s.dataset.colors.from),p.value[1]||a.palette[1],c.value||10)}else return y(p.value[1]||a.palette[1],p.value[0]||a.palette[0],c.value||10);return y(a.convertColorToHex(s.dataset.colors.from),a.convertColorToHex(s.dataset.colors.to),c.value||10)}),M=e.computed(()=>{const l=[];let n=0;const o=r.value.height-i.value.top-i.value.bottom;for(let u=0;u<o-1;u+=o/c.value)l.push({x:r.value.left,y:r.value.top+u,qYLess:r.value.top+u+o/c.value/4,halfY:r.value.top+u+o/c.value/2,qYMore:r.value.top+u+o/c.value/4*3,color:X.value[n],height:o/c.value}),n+=1;return l}),h=e.ref(!1);function J(l){h.value=l,E.value+=1}const f=e.ref(!1);function _(){f.value=!f.value}return z({generatePdf:q,generateImage:A,toggleAnnotator:_}),(l,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"thermoChart",ref:k,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}`,onMouseenter:n[0]||(n[0]=()=>e.unref($)(!0)),onMouseleave:n[1]||(n[1]=()=>e.unref($)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(re.PenAndPaper,{key:0,parent:k.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:f.value,onClose:_},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),G.value?(e.openBlock(),e.createElementBlock("div",ue,null,512)):e.createCommentVNode("",!0),t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",ie,[(e.openBlock(),e.createBlock(te._sfc_main,{key:`title_${P.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&&g.value&&(e.unref(F)||e.unref(b))?(e.openBlock(),e.createBlock(U.UserOptions,{ref:"details",key:`user_options_${E.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(I),isPrinting:e.unref(S),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:k.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:f.value,onToggleFullscreen:J,onGeneratePdf:e.unref(q),onGenerateImage:e.unref(A),onToggleAnnotator:_,style:e.normalizeStyle({visibility:e.unref(F)?e.unref(b)?"visible":"hidden":"visible"})},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:u})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:u})),void 0,!0)]),key:"2"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:u})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:u})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),g.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(a.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":h.value,"vue-data-ui-fulscreen--off":!h.value}),width:"100%",viewBox:`0 0 ${r.value.width} ${r.value.height}`,style:"background:transparent"},[e.createVNode(le._sfc_main),l.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:r.value.width,height:r.value.height,style:{pointerEvents:"none"}},[e.renderSlot(l.$slots,"chart-background",{},void 0,!0)],8,de)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[e.createElementVNode("clipPath",he,[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,ve)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.value,(o,u)=>(e.openBlock(),e.createElementBlock("linearGradient",{id:`vueUiThermometerGradient_${u}_${d.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":o.color},null,8,pe),e.createElementVNode("stop",{offset:"50%","stop-color":e.unref(a.setOpacity)(o.color,100-t.value.style.chart.graduations.gradient.intensity)},null,8,ye),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,fe)],8,me))),256))]),e.createElementVNode("g",ge,[e.createElementVNode("rect",{x:r.value.left,y:r.value.top,height:r.value.height-i.value.top-i.value.bottom,width:r.value.width-i.value.left-i.value.right,fill:"#FFFFFF"},null,8,ke),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.value,(o,u)=>(e.openBlock(),e.createElementBlock("g",{key:`graduation_${u}`},[e.createElementVNode("rect",{x:o.x,y:o.y,height:o.height,width:r.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right,fill:t.value.style.chart.graduations.gradient.show?`url(#vueUiThermometerGradient_${u}_${d.value})`:o.color,"shape-rendering":"crispEdges"},null,8,be),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,xe)):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,Ce)):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,we)):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,_e)):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:r.value.right,x2:r.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,Ne)):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:r.value.right,x2:r.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:r.value.right,x2:r.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,Ve)):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:r.value.right,x2:r.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,Ee)):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:r.value.left,y:r.value.top,height:w.value,width:r.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right,fill:"#FFFFFF66"},null,10,Pe)]),e.createElementVNode("text",{class:e.normalizeClass({"vue-ui-thermometer-temperature-value":t.value.style.chart.animation.use}),y:w.value+r.value.top+t.value.style.chart.label.fontSize/3,x:r.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(a.applyDataLabel)(t.value.style.chart.label.formatter,m.dataset.value,e.unref(a.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,$e),e.renderSlot(l.$slots,"svg",{svg:W.value},void 0,!0)],10,ce)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Fe,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(S)||e.unref(I)})),void 0,!0)])):e.createCommentVNode("",!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",Oe,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),g.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(oe.default,{key:7,config:{type:"thermometer",style:{backgroundColor:t.value.style.chart.backgroundColor,thermometer:{color:"#CCCCCC"}}}},null,8,["config"]))],46,ne))}},Ie=se._export_sfc(Se,[["__scopeId","data-v-f7910f15"]]);exports.default=Ie;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ref as n, onMounted as Q, onBeforeUnmount as Y, computed as
|
|
2
|
-
import { u as se } from "./useNestedProp-
|
|
3
|
-
import { u as le, c as oe, X as re, F as W } from "./index-
|
|
1
|
+
import { ref as n, onMounted as Q, onBeforeUnmount as Y, computed as A, watch as Z, openBlock as l, createElementBlock as o, normalizeStyle as f, createBlock as ee, createCommentVNode as v, unref as te, createVNode as M, renderSlot as z, createElementVNode as C, mergeProps as V, normalizeProps as E, guardReactiveProps as U, toDisplayString as ae } from "vue";
|
|
2
|
+
import { u as se } from "./useNestedProp-C9rlBRTT.js";
|
|
3
|
+
import { u as le, c as oe, X as re, F as W } from "./index-B7nCQFK0.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-B8U62FEj.js";
|
|
6
|
+
import { _ as ne } from "./Title-CaET2xuF.js";
|
|
7
|
+
import { _ as ce } from "./PackageVersion-CENy3Lm2.js";
|
|
8
8
|
import { _ as de } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
9
9
|
class he {
|
|
10
10
|
constructor(H, k, T, L = !0, $ = !0) {
|
|
@@ -142,24 +142,26 @@ const ve = ["xmlns", "viewBox"], pe = ["width", "height"], fe = { key: 1 }, we =
|
|
|
142
142
|
title: e.value.style.title.text ? S.value : null,
|
|
143
143
|
legend: R.value
|
|
144
144
|
});
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
145
|
+
requestAnimationFrame(() => {
|
|
146
|
+
t.value.width = r, t.value.height = h, t.value.tracker.core = W({
|
|
147
|
+
relator: Math.min(r, h),
|
|
148
|
+
adjuster: e.value.style.width,
|
|
149
|
+
source: 6 * e.value.stopwatch.tracker.radiusRatio,
|
|
150
|
+
threshold: 1,
|
|
151
|
+
fallback: 1
|
|
152
|
+
}), t.value.tracker.aura = W({
|
|
153
|
+
relator: Math.min(r, h),
|
|
154
|
+
adjuster: e.value.style.width,
|
|
155
|
+
source: 12 * e.value.stopwatch.tracker.aura.radiusRatio,
|
|
156
|
+
threshold: 1,
|
|
157
|
+
fallback: 1
|
|
158
|
+
}), t.value.label = W({
|
|
159
|
+
relator: Math.min(r, h),
|
|
160
|
+
adjuster: e.value.style.width,
|
|
161
|
+
source: e.value.stopwatch.label.fontSize,
|
|
162
|
+
threshold: 10,
|
|
163
|
+
fallback: 10
|
|
164
|
+
});
|
|
163
165
|
});
|
|
164
166
|
});
|
|
165
167
|
m.value = new ResizeObserver(a), m.value.observe($.value.parentNode);
|
|
@@ -168,7 +170,7 @@ const ve = ["xmlns", "viewBox"], pe = ["width", "height"], fe = { key: 1 }, we =
|
|
|
168
170
|
Y(() => {
|
|
169
171
|
m.value && m.value.disconnect();
|
|
170
172
|
});
|
|
171
|
-
const e =
|
|
173
|
+
const e = A({
|
|
172
174
|
get: () => w(),
|
|
173
175
|
set: (a) => a
|
|
174
176
|
});
|
|
@@ -181,7 +183,7 @@ const ve = ["xmlns", "viewBox"], pe = ["width", "height"], fe = { key: 1 }, we =
|
|
|
181
183
|
Z(() => T.config, (a) => {
|
|
182
184
|
e.value = w(), c(), x.value += 1;
|
|
183
185
|
}, { deep: !0 });
|
|
184
|
-
const y =
|
|
186
|
+
const y = A(() => {
|
|
185
187
|
if (e.value.stopwatch.showHours && e.value.stopwatch.showHundredth)
|
|
186
188
|
return "00:00:00.00";
|
|
187
189
|
if (e.value.stopwatch.showHours && !e.value.stopwatch.showHundredth)
|
|
@@ -226,7 +228,7 @@ const ve = ["xmlns", "viewBox"], pe = ["width", "height"], fe = { key: 1 }, we =
|
|
|
226
228
|
function X({ timestamp: a, elapsed: r, formatted: h }) {
|
|
227
229
|
d.value = { timestamp: a, elapsed: r, formatted: h };
|
|
228
230
|
}
|
|
229
|
-
const g =
|
|
231
|
+
const g = A(() => Math.min(t.value.width, t.value.height) / 2.5 * e.value.stopwatch.track.radiusRatio);
|
|
230
232
|
function q(a, r) {
|
|
231
233
|
const I = 360 / (r * 1e3);
|
|
232
234
|
return a * I % 360;
|
|
@@ -235,7 +237,7 @@ const ve = ["xmlns", "viewBox"], pe = ["width", "height"], fe = { key: 1 }, we =
|
|
|
235
237
|
let r = a * (Math.PI / 180), h = t.value.width / 2 + g.value * Math.cos(r), I = t.value.height / 2 + g.value * Math.sin(r);
|
|
236
238
|
return { cx: h, cy: I };
|
|
237
239
|
}
|
|
238
|
-
const _ =
|
|
240
|
+
const _ = A(() => {
|
|
239
241
|
const a = q(d.value.elapsed, e.value.stopwatch.cycleSeconds), { cx: r, cy: h } = J(a - 90), I = a > 180 ? 1 : 0;
|
|
240
242
|
return {
|
|
241
243
|
cx: r || t.value.width / 2,
|
|
@@ -304,7 +306,7 @@ const ve = ["xmlns", "viewBox"], pe = ["width", "height"], fe = { key: 1 }, we =
|
|
|
304
306
|
pointerEvents: "none"
|
|
305
307
|
}
|
|
306
308
|
}, [
|
|
307
|
-
|
|
309
|
+
z(a.$slots, "chart-background", {}, void 0, !0)
|
|
308
310
|
], 8, pe)) : v("", !0),
|
|
309
311
|
e.value.stopwatch.tracker.gradient.show ? (l(), o("defs", fe, [
|
|
310
312
|
C("radialGradient", {
|
|
@@ -361,7 +363,7 @@ const ve = ["xmlns", "viewBox"], pe = ["width", "height"], fe = { key: 1 }, we =
|
|
|
361
363
|
width: "0.1",
|
|
362
364
|
style: { overflow: "visible" }
|
|
363
365
|
}, [
|
|
364
|
-
|
|
366
|
+
z(a.$slots, "time", E(U({ ...d.value })), void 0, !0)
|
|
365
367
|
], 8, Me)) : (l(), o("text", {
|
|
366
368
|
key: 5,
|
|
367
369
|
x: t.value.width / 2,
|
|
@@ -455,7 +457,7 @@ const ve = ["xmlns", "viewBox"], pe = ["width", "height"], fe = { key: 1 }, we =
|
|
|
455
457
|
}, null, 8, ["stroke"])
|
|
456
458
|
], 12, Se)) : v("", !0)
|
|
457
459
|
])),
|
|
458
|
-
|
|
460
|
+
z(a.$slots, "controls", E(U({
|
|
459
461
|
start: N,
|
|
460
462
|
pause: B,
|
|
461
463
|
reset: j,
|
|
@@ -466,7 +468,7 @@ const ve = ["xmlns", "viewBox"], pe = ["width", "height"], fe = { key: 1 }, we =
|
|
|
466
468
|
isPaused: p.value,
|
|
467
469
|
...d.value
|
|
468
470
|
})), void 0, !0),
|
|
469
|
-
|
|
471
|
+
z(a.$slots, "laps", E(U({
|
|
470
472
|
laps: b.value,
|
|
471
473
|
lap: F,
|
|
472
474
|
isRunning: s.value,
|
|
@@ -476,7 +478,7 @@ const ve = ["xmlns", "viewBox"], pe = ["width", "height"], fe = { key: 1 }, we =
|
|
|
476
478
|
], 4)
|
|
477
479
|
], 4));
|
|
478
480
|
}
|
|
479
|
-
}, Be = /* @__PURE__ */ de(Re, [["__scopeId", "data-v-
|
|
481
|
+
}, Be = /* @__PURE__ */ de(Re, [["__scopeId", "data-v-be90052b"]]);
|
|
480
482
|
export {
|
|
481
483
|
Be as default
|
|
482
484
|
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),L=require("./useNestedProp-CbMuGGl3.cjs"),g=require("./index-COIn1phv.cjs"),R=require("./useResponsive-BJ7DTGpm.cjs"),B=require("./BaseIcon-BVrsMbvi.cjs"),j=require("./Title-DJUxOiaO.cjs"),q=require("./PackageVersion-BjfedMsH.cjs"),O=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");class U{constructor(P,p,y,T=!0,b=!0){this.interval=p,this.elapsed=0,this.isPaused=!1;const S=`
|
|
2
|
+
let interval;
|
|
3
|
+
let elapsed = 0;
|
|
4
|
+
let paused = false;
|
|
5
|
+
let startTime;
|
|
6
|
+
let tickInterval;
|
|
7
|
+
|
|
8
|
+
onmessage = function(e) {
|
|
9
|
+
const { action, data } = e.data;
|
|
10
|
+
|
|
11
|
+
switch(action) {
|
|
12
|
+
case 'start':
|
|
13
|
+
startTime = Date.now();
|
|
14
|
+
tickInterval = data.interval;
|
|
15
|
+
elapsed = 0;
|
|
16
|
+
paused = false;
|
|
17
|
+
interval = setInterval(() => {
|
|
18
|
+
elapsed += tickInterval;
|
|
19
|
+
postMessage({ elapsed, timestamp: Date.now() });
|
|
20
|
+
}, tickInterval);
|
|
21
|
+
break;
|
|
22
|
+
|
|
23
|
+
case 'pause':
|
|
24
|
+
paused = true;
|
|
25
|
+
clearInterval(interval);
|
|
26
|
+
elapsed = Date.now() - startTime;
|
|
27
|
+
break;
|
|
28
|
+
|
|
29
|
+
case 'resume':
|
|
30
|
+
if (paused) {
|
|
31
|
+
startTime = Date.now() - elapsed;
|
|
32
|
+
interval = setInterval(() => {
|
|
33
|
+
elapsed += tickInterval;
|
|
34
|
+
postMessage({ elapsed, timestamp: Date.now() });
|
|
35
|
+
}, tickInterval);
|
|
36
|
+
}
|
|
37
|
+
paused = false;
|
|
38
|
+
break;
|
|
39
|
+
|
|
40
|
+
case 'stop':
|
|
41
|
+
clearInterval(interval);
|
|
42
|
+
elapsed = 0;
|
|
43
|
+
postMessage({ elapsed });
|
|
44
|
+
break;
|
|
45
|
+
|
|
46
|
+
case 'reset':
|
|
47
|
+
elapsed = 0;
|
|
48
|
+
clearInterval(interval);
|
|
49
|
+
postMessage({ elapsed });
|
|
50
|
+
break;
|
|
51
|
+
|
|
52
|
+
case 'lap':
|
|
53
|
+
postMessage({
|
|
54
|
+
elapsed,
|
|
55
|
+
timestamp: Date.now(),
|
|
56
|
+
action: 'lap'
|
|
57
|
+
});
|
|
58
|
+
break;
|
|
59
|
+
|
|
60
|
+
default:
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
`,M=new Blob([S],{type:"application/javascript"}),k=URL.createObjectURL(M),n=new Worker(k);function _(u){let t=Math.floor(u/1e3),h=Math.floor(u%1e3/10),f=Math.floor(t/3600),a=Math.floor(t%3600/60),i=t%60,r="";return b&&(r+=String(f).padStart(2,"0")+":"),r+=String(a).padStart(2,"0")+":",r+=String(i).padStart(2,"0"),T&&(r+="."+String(h).padStart(2,"0")),r}this.start=()=>{this.isPaused=!1,n.postMessage({action:"start",data:{interval:this.interval}})},this.pause=()=>{this.isPaused?this.resume():(this.isPaused=!0,n.postMessage({action:"pause"}))},this.resume=()=>{this.isPaused&&(n.postMessage({action:"resume"}),this.isPaused=!1)},this.stop=()=>{n.postMessage({action:"stop"}),this.isPaused=!1},this.reset=()=>{n.postMessage({action:"reset"}),this.elapsed=0,this.isPaused=!1},this.restart=()=>{this.stop(),this.start()},this.lap=()=>new Promise(u=>{n.postMessage({action:"lap"});const t=h=>{const{elapsed:f,timestamp:a,action:i}=h.data;if(i==="lap"){const r=_(f);u({timestamp:a||0,elapsed:f,formatted:r})}};n.addEventListener("message",t,{once:!0})}),n.onmessage=u=>{const{elapsed:t,timestamp:h}=u.data;this.elapsed=t,P({timestamp:h||0,elapsed:this.elapsed,formatted:_(this.elapsed)})},n.onerror=u=>{y&&y(u)}}}const W=["xmlns","viewBox"],G=["width","height"],X={key:1},J=["id"],K=["stop-color"],Q=["stop-color"],Y=["cx","cy","r","fill","stroke","stroke-width"],Z=["d","stroke","stroke-width"],ee=["r","fill","stroke","stroke-width"],te=["r","fill","stroke","stroke-width"],ae=["x","y"],le=["x","y","font-size","fill","font-weight"],se={key:0,class:"vue-ui-timer-controls"},oe=["title"],re=["title"],ne=["title"],ue=["title"],ie=["title"],ce={__name:"vue-ui-timer",props:{config:{type:Object,default(){return{}}}},emits:["start","pause","reset","restart","lap"],setup($,{expose:P,emit:p}){const y=$,{vue_ui_timer:T}=g.useConfig(),b=e.ref(null),S=e.ref(null),M=e.ref(null),k=e.ref(null),n=e.ref(g.createUid()),_=e.ref(0);e.onMounted(()=>{u()});function u(){if(t.value.responsive){const l=R.throttle(()=>{const{width:o,height:c}=R.useResponsive({chart:b.value,title:t.value.style.title.text?S.value:null,legend:M.value});requestAnimationFrame(()=>{a.value.width=o,a.value.height=c,a.value.tracker.core=g.translateSize({relator:Math.min(o,c),adjuster:t.value.style.width,source:6*t.value.stopwatch.tracker.radiusRatio,threshold:1,fallback:1}),a.value.tracker.aura=g.translateSize({relator:Math.min(o,c),adjuster:t.value.style.width,source:12*t.value.stopwatch.tracker.aura.radiusRatio,threshold:1,fallback:1}),a.value.label=g.translateSize({relator:Math.min(o,c),adjuster:t.value.style.width,source:t.value.stopwatch.label.fontSize,threshold:10,fallback:10})})});k.value=new ResizeObserver(l),k.value.observe(b.value.parentNode)}}e.onBeforeUnmount(()=>{k.value&&k.value.disconnect()});const t=e.computed({get:()=>h(),set:l=>l});function h(){return L.useNestedProp({userConfig:y.config,defaultConfig:T})}e.watch(()=>y.config,l=>{t.value=h(),u(),_.value+=1},{deep:!0});const f=e.computed(()=>{if(t.value.stopwatch.showHours&&t.value.stopwatch.showHundredth)return"00:00:00.00";if(t.value.stopwatch.showHours&&!t.value.stopwatch.showHundredth)return"00:00:00";if(!t.value.stopwatch.showHours&&t.value.stopwatch.showHundredth)return"00:00.00";if(!t.value.stopwatch.showHours&&!t.value.stopwatch.showHundredth)return"00:00"}),a=e.ref({height:t.value.style.height,width:t.value.style.width,tracker:{core:6*t.value.stopwatch.tracker.radiusRatio,aura:12*t.value.stopwatch.tracker.aura.radiusRatio},label:t.value.stopwatch.label.fontSize}),i=e.ref(0),r=new U(l=>D(l),10,"",t.value.stopwatch.showHundredth,t.value.stopwatch.showHours),N=e.ref(!0),s=e.ref(!1),d=e.ref(!1);function V(){p("start"),N.value&&r.start(),N.value=!1,s.value=!0}function x(){s.value&&(p("reset"),r.stop(),m.value=[],N.value=!0,s.value=!1)}function z(){d.value=!d.value,p("pause",i.value),r.pause()}function I(){s.value&&(d.value=!1,p("restart"),m.value=[],r.restart())}const m=e.ref([]);async function E(){if(!s.value||d.value)return;const l=await r.lap();l&&(m.value.push(l),p("lap",m.value))}function D({timestamp:l,elapsed:o,formatted:c}){i.value={timestamp:l,elapsed:o,formatted:c}}const v=e.computed(()=>Math.min(a.value.width,a.value.height)/2.5*t.value.stopwatch.track.radiusRatio);function F(l,o){const C=360/(o*1e3);return l*C%360}function A(l){let o=l*(Math.PI/180),c=a.value.width/2+v.value*Math.cos(o),C=a.value.height/2+v.value*Math.sin(o);return{cx:c,cy:C}}const w=e.computed(()=>{const l=F(i.value.elapsed,t.value.stopwatch.cycleSeconds),{cx:o,cy:c}=A(l-90),C=l>180?1:0;return{cx:o||a.value.width/2,cy:c||a.value.height/2-v.value,largeArcFlag:C,sweepFlag:1}});return P({start:V,pause:z,reset:x,restart:I,lap:E}),(l,o)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"timerChart",ref:b,class:"vue-ui-timer",style:e.normalizeStyle({fontFamily:t.value.style.fontFamily,width:"100%",height:t.value.responsive?"100%":"auto",textAlign:"center"})},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:S,style:e.normalizeStyle({width:"100%",background:t.value.style.backgroundColor})},[(e.openBlock(),e.createBlock(j._sfc_main,{key:`title_${_.value}`,config:{title:{cy:"title",...t.value.style.title},subtitle:{cy:"subtitle",...t.value.style.title.subtitle}}},null,8,["config"]))],4)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(g.XMLNS),viewBox:`0 0 ${a.value.width<=0?10:a.value.width} ${a.value.height<=0?10:a.value.height}`,style:e.normalizeStyle({maxWidth:"100%",overflow:"visible",background:t.value.style.backgroundColor})},[e.createVNode(q._sfc_main),l.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:a.value.width<=0?10:a.value.width,height:a.value.height<=0?10:a.value.height,style:{pointerEvents:"none"}},[e.renderSlot(l.$slots,"chart-background",{},void 0,!0)],8,G)):e.createCommentVNode("",!0),t.value.stopwatch.tracker.gradient.show?(e.openBlock(),e.createElementBlock("defs",X,[e.createElementVNode("radialGradient",{id:`tracker_gradient_${n.value}`,cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.stopwatch.tracker.gradient.color},null,8,K),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.stopwatch.tracker.fill},null,8,Q)],8,J)])):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:a.value.width/2,cy:a.value.height/2,r:v.value,fill:t.value.stopwatch.track.fill,stroke:t.value.stopwatch.track.stroke,"stroke-width":t.value.stopwatch.track.strokeWidth},null,8,Y),t.value.stopwatch.cycleTrack.show?(e.openBlock(),e.createElementBlock("path",{key:2,d:`M ${a.value.width/2},${a.value.height/2-v.value} A ${v.value},${v.value} 0 ${w.value.largeArcFlag},${w.value.sweepFlag} ${w.value.cx},${w.value.cy}`,stroke:t.value.stopwatch.cycleTrack.stroke,"stroke-width":t.value.stopwatch.cycleTrack.strokeWidth,"stroke-linecap":"round",fill:"none"},null,8,Z)):e.createCommentVNode("",!0),e.createElementVNode("circle",e.mergeProps(w.value,{r:a.value.tracker.core,fill:t.value.stopwatch.tracker.gradient.show?`url(#tracker_gradient_${n.value})`:t.value.stopwatch.tracker.fill,stroke:t.value.stopwatch.tracker.stroke,"stroke-width":t.value.stopwatch.tracker.strokeWidth}),null,16,ee),t.value.stopwatch.tracker.aura.show?(e.openBlock(),e.createElementBlock("circle",e.mergeProps({key:3},w.value,{r:a.value.tracker.aura,fill:`${t.value.stopwatch.tracker.aura.fill}20`,stroke:t.value.stopwatch.tracker.aura.stroke,"stroke-width":t.value.stopwatch.tracker.aura.strokeWidth}),null,16,te)):e.createCommentVNode("",!0),l.$slots.time?(e.openBlock(),e.createElementBlock("foreignObject",{key:4,x:a.value.width/2,y:a.value.height/2,height:"0.1",width:"0.1",style:{overflow:"visible"}},[e.renderSlot(l.$slots,"time",e.normalizeProps(e.guardReactiveProps({...i.value})),void 0,!0)],8,ae)):(e.openBlock(),e.createElementBlock("text",{key:5,x:a.value.width/2,y:a.value.height/2+a.value.label/4,"font-size":a.value.label,"text-anchor":"middle",fill:t.value.stopwatch.label.color,"font-weight":t.value.stopwatch.label.bold?"bold":"normal",style:{"font-variant-numeric":"tabular-nums !important"}},e.toDisplayString(i.value.formatted||f.value),9,le))],12,W)),e.createElementVNode("div",{ref_key:"chartLegend",ref:M,style:e.normalizeStyle({width:"100%",backgroundColor:t.value.stopwatch.legend.backgroundColor})},[l.$slots.controls?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",se,[t.value.stopwatch.legend.buttons.start?(e.openBlock(),e.createElementBlock("button",{key:0,title:t.value.stopwatch.legend.buttonTitles.start,onClick:V,class:"vue-ui-timer-button",style:e.normalizeStyle({opacity:s.value?.2:1,cursor:s.value?"default":"pointer"})},[e.createVNode(B.default,{name:"play",stroke:t.value.stopwatch.legend.buttons.iconColor},null,8,["stroke"])],12,oe)):e.createCommentVNode("",!0),t.value.stopwatch.legend.buttons.pause?(e.openBlock(),e.createElementBlock("button",{key:1,title:d.value?t.value.stopwatch.legend.buttonTitles.resume:t.value.stopwatch.legend.buttonTitles.pause,onClick:z,class:"vue-ui-timer-button",style:e.normalizeStyle({opacity:s.value?1:.2,cursor:s.value?"pointer":"default"})},[e.createVNode(B.default,{name:"pause",stroke:t.value.stopwatch.legend.buttons.iconColor},null,8,["stroke"])],12,re)):e.createCommentVNode("",!0),t.value.stopwatch.legend.buttons.reset?(e.openBlock(),e.createElementBlock("button",{key:2,title:t.value.stopwatch.legend.buttonTitles.reset,onClick:x,class:"vue-ui-timer-button",style:e.normalizeStyle({opacity:s.value?1:.2,cursor:s.value?"pointer":"default"})},[e.createVNode(B.default,{name:"stop",stroke:t.value.stopwatch.legend.buttons.iconColor},null,8,["stroke"])],12,ne)):e.createCommentVNode("",!0),t.value.stopwatch.legend.buttons.restart?(e.openBlock(),e.createElementBlock("button",{key:3,title:t.value.stopwatch.legend.buttonTitles.restart,onClick:I,class:"vue-ui-timer-button",style:e.normalizeStyle({opacity:s.value?1:.2,cursor:s.value?"pointer":"default"})},[e.createVNode(B.default,{name:"restart",stroke:t.value.stopwatch.legend.buttons.iconColor},null,8,["stroke"])],12,ue)):e.createCommentVNode("",!0),t.value.stopwatch.legend.buttons.lap?(e.openBlock(),e.createElementBlock("button",{key:4,title:t.value.stopwatch.legend.buttonTitles.lap,onClick:E,class:"vue-ui-timer-button",style:e.normalizeStyle({opacity:s.value&&!d.value?1:.2,cursor:s.value&&!d.value?"pointer":"default"})},[e.createVNode(B.default,{name:"lap",stroke:t.value.stopwatch.legend.buttons.iconColor},null,8,["stroke"])],12,ie)):e.createCommentVNode("",!0)])),e.renderSlot(l.$slots,"controls",e.normalizeProps(e.guardReactiveProps({start:V,pause:z,reset:x,restart:I,lap:E,laps:m.value,isRunning:s.value,isPaused:d.value,...i.value})),void 0,!0),e.renderSlot(l.$slots,"laps",e.normalizeProps(e.guardReactiveProps({laps:m.value,lap:E,isRunning:s.value,isPaused:d.value,...i.value})),void 0,!0)],4)],4))}},de=O._export_sfc(ce,[["__scopeId","data-v-be90052b"]]);exports.default=de;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { computed as h, ref as k, watch as W, onMounted as ie, openBlock as s, createElementBlock as c, normalizeClass as U, normalizeStyle as G, unref as n, createBlock as I, createCommentVNode as d, createSlots as ce, withCtx as F, renderSlot as b, normalizeProps as L, guardReactiveProps as j, createVNode as ve, Fragment as Z, renderList as ee, toDisplayString as he } from "vue";
|
|
2
|
-
import { u as te } from "./useNestedProp-
|
|
3
|
-
import { u as de, c as fe, t as pe, v as ye, o as ge, e as me, w as ae, X as ke, i as be, f as _e } from "./index-
|
|
4
|
-
import { _ as Ce } from "./Title-
|
|
5
|
-
import { u as $e, U as we } from "./usePrinter-
|
|
6
|
-
import xe from "./vue-ui-skeleton-
|
|
7
|
-
import { _ as Pe } from "./PackageVersion-
|
|
8
|
-
import { P as Oe } from "./PenAndPaper-
|
|
2
|
+
import { u as te } from "./useNestedProp-C9rlBRTT.js";
|
|
3
|
+
import { u as de, c as fe, t as pe, v as ye, o as ge, e as me, w as ae, X as ke, i as be, f as _e } from "./index-B7nCQFK0.js";
|
|
4
|
+
import { _ as Ce } from "./Title-CaET2xuF.js";
|
|
5
|
+
import { u as $e, U as we } from "./usePrinter-CQMn1b4E.js";
|
|
6
|
+
import xe from "./vue-ui-skeleton-D66ZIUln.js";
|
|
7
|
+
import { _ as Pe } from "./PackageVersion-CENy3Lm2.js";
|
|
8
|
+
import { P as Oe } from "./PenAndPaper-Dr7ndoP_.js";
|
|
9
9
|
import { u as Ae } from "./useUserOptionState-BIvW1Kz7.js";
|
|
10
10
|
import { _ as Ie } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
11
11
|
const Fe = ["id"], ze = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),L=require("./useNestedProp-D_XfpfnF.cjs"),c=require("./index-D4M1RdVn.cjs"),J=require("./Title-BqNuK5vc.cjs"),j=require("./usePrinter-Bfrr3DDK.cjs"),K=require("./vue-ui-skeleton-6_VzxeeY.cjs"),Q=require("./PackageVersion-Bxz2crF7.cjs"),W=require("./PenAndPaper-BFCXiNMF.cjs"),Z=require("./useUserOptionState-BgepsfED.cjs"),ee=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),te=["id"],oe={key:2,style:"width:100%;background:transparent;padding-bottom:12px"},ae=["xmlns","viewBox"],le=["width","height"],re={key:1},ne=["d","stroke-width","stroke"],se={key:2},ue=["x1","y1","x2","y2","stroke-width","stroke"],ie=["x","y","font-size","fill","font-weight","text-anchor"],ce={key:5,class:"vue-data-ui-watermark"},ve={key:6,ref:"source",dir:"auto"},de={__name:"vue-ui-tiremarks",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(G,{expose:H}){const v=G,{vue_ui_tiremarks:D}=c.useConfig(),$=e.computed(()=>!!v.dataset&&Object.keys(v.dataset).length),B=e.ref(c.createUid()),P=e.ref(null),R=e.ref(null),O=e.ref(0),A=e.ref(0),t=e.computed({get:()=>E(),set:o=>o}),{userOptionsVisible:x,setUserOptionsVisibility:N,keepUserOptionState:z}=Z.useUserOptionState({config:t.value});function E(){const o=L.useNestedProp({userConfig:v.config,defaultConfig:D});return o.theme?{...L.useNestedProp({userConfig:c.themes.vue_ui_tiremarks[o.theme]||v.config,defaultConfig:o})}:o}e.watch(()=>v.config,o=>{t.value=E(),x.value=!t.value.showOnChartHover,M(),A.value+=1},{deep:!0});const{isPrinting:I,isImaging:F,generatePdf:V,generateImage:q}=j.usePrinter({elementId:B.value,fileName:t.value.style.chart.title.text||"vue-ui-tiremarks"}),X=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),s=e.ref(t.value.style.chart.animation.use?0:c.checkNaN(v.dataset.percentage));e.watch(()=>v.dataset,o=>{t.value.style.chart.animation.use?T(o.percentage):s.value=o.percentage||0},{deep:!0}),e.onMounted(()=>{M()});function T(o){let n=t.value.style.chart.animation.speed;const a=Math.abs(o-s.value)/(n*120);function r(){s.value<o?s.value=Math.min(s.value+a,o):s.value>o&&(s.value=Math.max(s.value-a,o)),s.value!==o&&requestAnimationFrame(r)}r()}function M(){c.objectIsEmpty(v.dataset)&&c.error({componentName:"VueUiTiremarks",type:"dataset"}),T(v.dataset.percentage||0)}const f=e.computed(()=>t.value.style.chart.layout.display==="vertical"),u=e.computed(()=>{const o={top:48,left:64,right:64,bottom:48};return f.value?{top:t.value.style.chart.percentage.verticalPosition==="top"?o.top:3,left:3,right:3,bottom:t.value.style.chart.percentage.verticalPosition==="bottom"?o.bottom:3}:{top:0,bottom:0,left:t.value.style.chart.percentage.horizontalPosition==="left"?o.left:3,right:t.value.style.chart.percentage.horizontalPosition==="right"?o.right:10}}),C=e.computed(()=>Object.values(u.value).reduce((o,n)=>o+n,0)),l=e.computed(()=>({height:f.value?312:56,width:f.value?56:312})),i=e.computed(()=>f.value?{mark:(l.value.height-C.value)/100*.5,space:(l.value.height-C.value)/100*.5}:{mark:(l.value.width-C.value)/100*.5,space:(l.value.width-C.value)/100*.5}),U=e.computed(()=>{const o=[];for(let a=0;a<100;a+=1){const r=t.value.style.chart.layout.ticks.gradient.show?c.shiftHue(t.value.style.chart.layout.activeColor,a/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-a)*(l.value.width-u.value.left-u.value.right)/100/3:0,d=u.value.left+4+y,h=l.value.width-u.value.right-4-y,p=l.value.height-u.value.bottom-a*i.value.mark-a*i.value.space-i.value.mark,m=l.value.height-u.value.bottom-a*i.value.mark-a*i.value.space-i.value.mark,k=(h-d)/t.value.style.chart.layout.curveAngleX,b=t.value.style.chart.layout.curveAngleY*((1+a)/100);o.push({x1:d,x2:h,y1:p,y2:m,curve:`M ${d} ${p} C ${d+k} ${p-b}, ${h-k} ${m-b}, ${h} ${m}`,color:r})}else{const y=t.value.style.chart.layout.crescendo?(100-a)*(l.value.height-u.value.top-u.value.bottom)/100/3:0,d=u.value.left+a*i.value.mark+a*i.value.space-i.value.mark,h=d,p=u.value.top+4+y,m=l.value.height-u.value.bottom-4-y,k=t.value.style.chart.layout.curveAngleY*((1+a)/100),b=(m-p)/t.value.style.chart.layout.curveAngleX;o.push({x1:d,x2:h,y1:p,y2:m,curve:`M ${d} ${p} C ${d+k} ${p+b}, ${h+k} ${m-b}, ${h} ${m}`,color:r})}}return o}),g=e.computed(()=>{let o,n,a;const r=t.value.style.chart.percentage.fontSize/3;return f.value?t.value.style.chart.percentage.verticalPosition==="top"?(o=l.value.width/2,n=u.value.top/2,a="middle"):t.value.style.chart.percentage.verticalPosition==="bottom"&&(o=l.value.width/2,n=l.value.height-u.value.bottom/2+r,a="middle"):t.value.style.chart.percentage.horizontalPosition==="left"?(o=4,n=l.value.height/2+r,a="start"):t.value.style.chart.percentage.horizontalPosition==="right"&&(o=l.value.width-u.value.right+8,n=l.value.height/2+r,a="start"),{x:o,y:n,textAnchor:a,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 Y(o){_.value=o,O.value+=1}const w=e.ref(!1);function S(){w.value=!w.value}return H({generatePdf:V,generateImage:q,toggleAnnotator:S}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tiremarksChart",ref:P,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:B.value,onMouseenter:n[0]||(n[0]=()=>e.unref(N)(!0)),onMouseleave:n[1]||(n[1]=()=>e.unref(N)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(W.PenAndPaper,{key:0,parent:P.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:w.value,onClose:S},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),X.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:R,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",oe,[(e.openBlock(),e.createBlock(J._sfc_main,{key:`title_${A.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&&$.value&&(e.unref(z)||e.unref(x))?(e.openBlock(),e.createBlock(j.UserOptions,{ref:"details",key:`user_options_${O.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(I),isImaging:e.unref(F),uid:B.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:P.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:w.value,onToggleFullscreen:Y,onGeneratePdf:e.unref(V),onGenerateImage:e.unref(q),onToggleAnnotator:S,style:e.normalizeStyle({visibility:e.unref(z)?e.unref(x)?"visible":"hidden":"visible"})},e.createSlots({_:2},[o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:r})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:r})),void 0,!0)]),key:"2"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:a,isAnnotator:r})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:a,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","style"])):e.createCommentVNode("",!0),$.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(Q._sfc_main),o.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:l.value.width,height:l.value.height,style:{pointerEvents:"none"}},[e.renderSlot(o.$slots,"chart-background",{},void 0,!0)],8,le)):e.createCommentVNode("",!0),t.value.style.chart.layout.curved?(e.openBlock(),e.createElementBlock("g",re,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value,(a,r)=>(e.openBlock(),e.createElementBlock("path",{d:a.curve,"stroke-width":i.value.mark,stroke:s.value>=r?a.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<=s.value})},null,10,ne))),256))])):(e.openBlock(),e.createElementBlock("g",se,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value,(a,r)=>(e.openBlock(),e.createElementBlock("line",{x1:a.x1,y1:a.y1,x2:a.x2,y2:a.y2,"stroke-width":i.value.mark,stroke:s.value>=r?a.color:t.value.style.chart.layout.inactiveColor,"stroke-linecap":"round"},null,8,ue))),256))])),t.value.style.chart.percentage.show?(e.openBlock(),e.createElementBlock("text",{key:3,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,s.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,s.value,e.unref(c.dataLabel)({v:s.value,s:"%",r:t.value.style.chart.percentage.rounding}))),9,ie)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"svg",{svg:l.value},void 0,!0)],14,ae)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",ce,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(I)||e.unref(F)})),void 0,!0)])):e.createCommentVNode("",!0),o.$slots.source?(e.openBlock(),e.createElementBlock("div",ve,[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),$.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(K.default,{key:7,config:{type:"tiremarks",style:{backgroundColor:t.value.style.chart.backgroundColor,tiremarks:{color:"#CCCCCC"}}}},null,8,["config"]))],46,te))}},he=ee._export_sfc(de,[["__scopeId","data-v-60aa805a"]]);exports.default=he;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),L=require("./useNestedProp-CbMuGGl3.cjs"),c=require("./index-COIn1phv.cjs"),J=require("./Title-DJUxOiaO.cjs"),j=require("./usePrinter-CXXfgFFN.cjs"),K=require("./vue-ui-skeleton-BIqMxXV7.cjs"),Q=require("./PackageVersion-BjfedMsH.cjs"),W=require("./PenAndPaper-nqRtAh6J.cjs"),Z=require("./useUserOptionState-BgepsfED.cjs"),ee=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),te=["id"],oe={key:2,style:"width:100%;background:transparent;padding-bottom:12px"},ae=["xmlns","viewBox"],le=["width","height"],re={key:1},ne=["d","stroke-width","stroke"],se={key:2},ue=["x1","y1","x2","y2","stroke-width","stroke"],ie=["x","y","font-size","fill","font-weight","text-anchor"],ce={key:5,class:"vue-data-ui-watermark"},ve={key:6,ref:"source",dir:"auto"},de={__name:"vue-ui-tiremarks",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(G,{expose:H}){const v=G,{vue_ui_tiremarks:D}=c.useConfig(),$=e.computed(()=>!!v.dataset&&Object.keys(v.dataset).length),B=e.ref(c.createUid()),P=e.ref(null),R=e.ref(null),O=e.ref(0),A=e.ref(0),t=e.computed({get:()=>E(),set:o=>o}),{userOptionsVisible:x,setUserOptionsVisibility:N,keepUserOptionState:z}=Z.useUserOptionState({config:t.value});function E(){const o=L.useNestedProp({userConfig:v.config,defaultConfig:D});return o.theme?{...L.useNestedProp({userConfig:c.themes.vue_ui_tiremarks[o.theme]||v.config,defaultConfig:o})}:o}e.watch(()=>v.config,o=>{t.value=E(),x.value=!t.value.showOnChartHover,M(),A.value+=1},{deep:!0});const{isPrinting:I,isImaging:F,generatePdf:V,generateImage:q}=j.usePrinter({elementId:B.value,fileName:t.value.style.chart.title.text||"vue-ui-tiremarks"}),X=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),s=e.ref(t.value.style.chart.animation.use?0:c.checkNaN(v.dataset.percentage));e.watch(()=>v.dataset,o=>{t.value.style.chart.animation.use?T(o.percentage):s.value=o.percentage||0},{deep:!0}),e.onMounted(()=>{M()});function T(o){let n=t.value.style.chart.animation.speed;const a=Math.abs(o-s.value)/(n*120);function r(){s.value<o?s.value=Math.min(s.value+a,o):s.value>o&&(s.value=Math.max(s.value-a,o)),s.value!==o&&requestAnimationFrame(r)}r()}function M(){c.objectIsEmpty(v.dataset)&&c.error({componentName:"VueUiTiremarks",type:"dataset"}),T(v.dataset.percentage||0)}const f=e.computed(()=>t.value.style.chart.layout.display==="vertical"),u=e.computed(()=>{const o={top:48,left:64,right:64,bottom:48};return f.value?{top:t.value.style.chart.percentage.verticalPosition==="top"?o.top:3,left:3,right:3,bottom:t.value.style.chart.percentage.verticalPosition==="bottom"?o.bottom:3}:{top:0,bottom:0,left:t.value.style.chart.percentage.horizontalPosition==="left"?o.left:3,right:t.value.style.chart.percentage.horizontalPosition==="right"?o.right:10}}),C=e.computed(()=>Object.values(u.value).reduce((o,n)=>o+n,0)),l=e.computed(()=>({height:f.value?312:56,width:f.value?56:312})),i=e.computed(()=>f.value?{mark:(l.value.height-C.value)/100*.5,space:(l.value.height-C.value)/100*.5}:{mark:(l.value.width-C.value)/100*.5,space:(l.value.width-C.value)/100*.5}),U=e.computed(()=>{const o=[];for(let a=0;a<100;a+=1){const r=t.value.style.chart.layout.ticks.gradient.show?c.shiftHue(t.value.style.chart.layout.activeColor,a/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-a)*(l.value.width-u.value.left-u.value.right)/100/3:0,d=u.value.left+4+y,h=l.value.width-u.value.right-4-y,p=l.value.height-u.value.bottom-a*i.value.mark-a*i.value.space-i.value.mark,m=l.value.height-u.value.bottom-a*i.value.mark-a*i.value.space-i.value.mark,k=(h-d)/t.value.style.chart.layout.curveAngleX,b=t.value.style.chart.layout.curveAngleY*((1+a)/100);o.push({x1:d,x2:h,y1:p,y2:m,curve:`M ${d} ${p} C ${d+k} ${p-b}, ${h-k} ${m-b}, ${h} ${m}`,color:r})}else{const y=t.value.style.chart.layout.crescendo?(100-a)*(l.value.height-u.value.top-u.value.bottom)/100/3:0,d=u.value.left+a*i.value.mark+a*i.value.space-i.value.mark,h=d,p=u.value.top+4+y,m=l.value.height-u.value.bottom-4-y,k=t.value.style.chart.layout.curveAngleY*((1+a)/100),b=(m-p)/t.value.style.chart.layout.curveAngleX;o.push({x1:d,x2:h,y1:p,y2:m,curve:`M ${d} ${p} C ${d+k} ${p+b}, ${h+k} ${m-b}, ${h} ${m}`,color:r})}}return o}),g=e.computed(()=>{let o,n,a;const r=t.value.style.chart.percentage.fontSize/3;return f.value?t.value.style.chart.percentage.verticalPosition==="top"?(o=l.value.width/2,n=u.value.top/2,a="middle"):t.value.style.chart.percentage.verticalPosition==="bottom"&&(o=l.value.width/2,n=l.value.height-u.value.bottom/2+r,a="middle"):t.value.style.chart.percentage.horizontalPosition==="left"?(o=4,n=l.value.height/2+r,a="start"):t.value.style.chart.percentage.horizontalPosition==="right"&&(o=l.value.width-u.value.right+8,n=l.value.height/2+r,a="start"),{x:o,y:n,textAnchor:a,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 Y(o){_.value=o,O.value+=1}const w=e.ref(!1);function S(){w.value=!w.value}return H({generatePdf:V,generateImage:q,toggleAnnotator:S}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tiremarksChart",ref:P,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:B.value,onMouseenter:n[0]||(n[0]=()=>e.unref(N)(!0)),onMouseleave:n[1]||(n[1]=()=>e.unref(N)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(W.PenAndPaper,{key:0,parent:P.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:w.value,onClose:S},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),X.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:R,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",oe,[(e.openBlock(),e.createBlock(J._sfc_main,{key:`title_${A.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&&$.value&&(e.unref(z)||e.unref(x))?(e.openBlock(),e.createBlock(j.UserOptions,{ref:"details",key:`user_options_${O.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(I),isImaging:e.unref(F),uid:B.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:P.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:w.value,onToggleFullscreen:Y,onGeneratePdf:e.unref(V),onGenerateImage:e.unref(q),onToggleAnnotator:S,style:e.normalizeStyle({visibility:e.unref(z)?e.unref(x)?"visible":"hidden":"visible"})},e.createSlots({_:2},[o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:r})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:r})),void 0,!0)]),key:"2"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:a,isAnnotator:r})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:a,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","style"])):e.createCommentVNode("",!0),$.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(Q._sfc_main),o.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:l.value.width,height:l.value.height,style:{pointerEvents:"none"}},[e.renderSlot(o.$slots,"chart-background",{},void 0,!0)],8,le)):e.createCommentVNode("",!0),t.value.style.chart.layout.curved?(e.openBlock(),e.createElementBlock("g",re,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value,(a,r)=>(e.openBlock(),e.createElementBlock("path",{d:a.curve,"stroke-width":i.value.mark,stroke:s.value>=r?a.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<=s.value})},null,10,ne))),256))])):(e.openBlock(),e.createElementBlock("g",se,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value,(a,r)=>(e.openBlock(),e.createElementBlock("line",{x1:a.x1,y1:a.y1,x2:a.x2,y2:a.y2,"stroke-width":i.value.mark,stroke:s.value>=r?a.color:t.value.style.chart.layout.inactiveColor,"stroke-linecap":"round"},null,8,ue))),256))])),t.value.style.chart.percentage.show?(e.openBlock(),e.createElementBlock("text",{key:3,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,s.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,s.value,e.unref(c.dataLabel)({v:s.value,s:"%",r:t.value.style.chart.percentage.rounding}))),9,ie)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"svg",{svg:l.value},void 0,!0)],14,ae)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",ce,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(I)||e.unref(F)})),void 0,!0)])):e.createCommentVNode("",!0),o.$slots.source?(e.openBlock(),e.createElementBlock("div",ve,[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),$.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(K.default,{key:7,config:{type:"tiremarks",style:{backgroundColor:t.value.style.chart.backgroundColor,tiremarks:{color:"#CCCCCC"}}}},null,8,["config"]))],46,te))}},he=ee._export_sfc(de,[["__scopeId","data-v-60aa805a"]]);exports.default=he;
|