import{y as k}from"./primevue-CfIk0_DY.js";import{_ as V}from"./index-BxIwIJfy.js";import{b as l,c as t,k as f,l as d,d as a,q as o,t as s,a7 as F,F as p,C as m,p as v,y}from"./vue-core-Di3IuVqe.js";const C={class:"filter-bar"},B={key:0,class:"filter-period-value"},$={key:1,class:"filter-period-placeholder"},g=["onClick"],A={key:2,class:"filter-divider"},_=["onClick"],M={key:0,class:"filter-chip-count"},S={__name:"FilterBar",props:{modelValue:{type:String,default:""},periodFilters:{type:Array,default:()=>[{value:"Aujourd'hui",label:"Aujourd'hui",icon:"pi pi-calendar"},{value:"Cette semaine",label:"Cette semaine",icon:"pi pi-calendar-times"},{value:"Mois en-cours",label:"Mois en-cours",icon:"pi pi-calendar-plus"},{value:"Mois précédent",label:"Mois précédent",icon:"pi pi-calendar-minus"},{value:"",label:"Cette année",icon:"pi pi-calendar-clock"}]},statusFilters:{type:Array,default:()=>[]},periodAsSelect:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(i){const c=i,u=y(()=>c.periodFilters.find(n=>n.value===c.modelValue)),b=y(()=>u.value?c.modelValue:null);return(n,r)=>(l(),t("div",C,[i.periodAsSelect?(l(),f(F(k),{key:0,modelValue:b.value,options:i.periodFilters,optionLabel:"label",optionValue:"value",placeholder:"Période",size:"small",class:"filter-period-select","onUpdate:modelValue":r[0]||(r[0]=e=>n.$emit("update:modelValue",e??""))},{value:d(e=>[u.value?(l(),t("span",B,[a("i",{class:o(u.value.icon)},null,2),a("span",null,s(u.value.label),1)])):(l(),t("span",$,[r[1]||(r[1]=a("i",{class:"pi pi-calendar"},null,-1)),a("span",null,s(e.placeholder),1)]))]),option:d(e=>[a("i",{class:o(e.option.icon),style:{"margin-right":"8px",opacity:"0.75"}},null,2),a("span",null,s(e.option.label),1)]),_:1},8,["modelValue","options"])):(l(!0),t(p,{key:1},m(i.periodFilters,e=>(l(),t("button",{key:`p-${e.value}`,type:"button",class:o(["filter-chip",{"filter-chip-active":i.modelValue===e.value}]),onClick:h=>n.$emit("update:modelValue",e.value)},[a("i",{class:o(e.icon)},null,2),a("span",null,s(e.label),1)],10,g))),128)),i.statusFilters.length?(l(),t("span",A)):v("",!0),(l(!0),t(p,null,m(i.statusFilters,e=>(l(),t("button",{key:`s-${e.value}`,type:"button",class:o(["filter-chip",{"filter-chip-active":i.modelValue===e.value,"filter-chip-empty":e.count===0}]),onClick:h=>n.$emit("update:modelValue",e.value)},[a("i",{class:o(e.icon)},null,2),a("span",null,s(e.label),1),e.count!==void 0&&e.count!==null?(l(),t("span",M,s(e.count),1)):v("",!0)],10,_))),128))]))}},L=V(S,[["__scopeId","data-v-b8ea7588"]]);export{L as F};
