import{W as d}from"./WidgetChart-CQnj_aQq.js";import{b as p,k as m,y as u}from"./vue-core-Di3IuVqe.js";import"./WidgetCard-CLnTgmXL.js";import"./primevue-CfIk0_DY.js";import"./index-BxIwIJfy.js";import"./cjs-helpers-psZwOBky.js";import"./vue-cal-DKMVGERa.js";import"./moment-BeHQNF8T.js";const A={__name:"WidgetParcEvolutionMensuelle",props:{data:{type:[Array,Object,null],default:null},loading:{type:Boolean,default:!1},error:{type:String,default:""},editing:{type:Boolean,default:!1}},emits:["refresh","remove"],setup(r){const a=r,i=["Janv","Févr","Mars","Avr","Mai","Juin","Juil","Août","Sept","Oct","Nov","Déc"],n=u(()=>{const o=Array.isArray(a.data)?a.data:[],t={};for(const e of o)t[Number(e.mois)]=e.montant||0;return{labels:i,datasets:[{label:"Coût",data:i.map((e,l)=>t[l+1]||0),backgroundColor:"#f59e0b",borderWidth:0}]}}),s={plugins:{legend:{display:!1}},scales:{x:{grid:{display:!1},ticks:{font:{size:10}}},y:{beginAtZero:!0,ticks:{font:{size:10}}}}};return(o,t)=>(p(),m(d,{title:"Évolution mensuelle des coûts parc",icon:"pi pi-chart-bar",type:"bar","chart-data":n.value,options:s,loading:r.loading,error:r.error,editing:r.editing,onRefresh:t[0]||(t[0]=e=>o.$emit("refresh")),onRemove:t[1]||(t[1]=e=>o.$emit("remove"))},null,8,["chart-data","loading","error","editing"]))}};export{A as default};
