import{W as n}from"./WidgetChart-CQnj_aQq.js";import{b as s,k as d,y as m}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 h={__name:"WidgetTop5FamillesStock",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(a){const r=a,o=m(()=>{const t=Array.isArray(r.data)?r.data:[];return{labels:t.map(e=>e.famille||"Sans famille"),datasets:[{label:"Valeur stock",data:t.map(e=>e.maValeur||0),backgroundColor:"#06b6d4",borderWidth:0}]}}),i={indexAxis:"y",plugins:{legend:{display:!1}},scales:{x:{beginAtZero:!0,ticks:{font:{size:10}}},y:{ticks:{font:{size:10}}}}};return(t,e)=>(s(),d(n,{title:"Top 5 familles en stock",icon:"pi pi-tag",type:"bar","chart-data":o.value,options:i,loading:a.loading,error:a.error,editing:a.editing,onRefresh:e[0]||(e[0]=l=>t.$emit("refresh")),onRemove:e[1]||(e[1]=l=>t.$emit("remove"))},null,8,["chart-data","loading","error","editing"]))}};export{h as default};
