import{an as k,ap as S,o as I,c as R,b as a,a as n,z as T,av as y,j as M,h as N,q as D,r as o,e as $}from"./vendor-0kGcmQpG.js";import{u as A,S as G,s as B}from"./index-Bn9WoKhP.js";import{_ as E}from"./DataGrid-tb6QVwpZ.js";import"./useAgGridConfig-DjXMc6wb.js";const V={class:"w-full flex flex-col overflow-hidden overflow-y-auto",style:{height:"calc(100vh - 108px)"}},L={class:"w-full flex flex-row items-center gap-3 p-2"},P={style:{height:"calc(100vh - 180px)",width:"100%"}},H={__name:"TeleDeclarationCIMR",setup(j){const{showInfo:r}=A(),c=o([]),p=o(!1),d=o(),i=o(),u=o(),m=o([]),f=({event:t,ndoc:e,row:l})=>{t?.target?.closest(".ag-selection-checkbox, .ag-checkbox, input")||window.getSelection&&window.getSelection().removeAllRanges()},x=({selectedRows:t})=>{m.value=t,t.length>0&&w({data:t[0]})},h=t=>{u.value=t.api},v=$(()=>[{label:"Exporter vers Excel",icon:"pi pi-file-excel",command:()=>_()},{label:"Imprimer la liste",icon:"pi pi-print",command:()=>b()}]),w=t=>{},g=()=>{},_=()=>{if(!i.value){r("Grille non initialisée");return}if(c.value.length===0){r("Aucune donnée à exporter");return}const e=new Date().toISOString().slice(0,19).replace(/[-:]/g,"").replace("T","_");i.value.exportToExcel(`Télédéclaration CIMR_${B.state.enreg_societe.Nom}_${e}.xlsx`)},b=()=>{};return(t,e)=>{const l=T,C=y;return k((I(),R("div",V,[a("div",L,[n(l,{icon:"pi pi-refresh",label:"Afficher",text:"",onClick:e[0]||(e[0]=s=>g())}),n(C,{ref_key:"actionsMenu",ref:d,model:v.value,popup:!0},null,8,["model"]),n(l,{onClick:e[1]||(e[1]=s=>d.value.toggle(s)),text:""},{default:M(()=>[...e[3]||(e[3]=[a("i",{class:"pi pi-cog mr-2"},null,-1),N(" Actions ",-1),a("i",{class:"pi pi-chevron-down ml-2"},null,-1)])]),_:1}),n(l,{icon:"pi pi-times",label:"Fermer",text:"",onClick:e[2]||(e[2]=s=>D(G)("TeleDeclarationCIMR"))})]),a("div",P,[n(E,{ref_key:"dataGrid",ref:i,"excel-file-name":"Tele declaration CIMR","excel-sheet-name":"Tele declaration CIMR","row-data":c.value,"document-number-fields":["ndoc"],"excluded-columns":["ndoc"],"column-widths":{Id_declaration:120,date:120,mois:100,Nbpersonne:100,Sbrut:150,SbrutP:180},"enable-totals":!0,"numeric-columns":["Nbpersonne","Sbrut","SbrutP"],"date-only":["date"],onRowClicked:f,onSelectionChanged:x,onGridReady:h},null,8,["row-data"])])],512)),[[S,!p.value]])}}};export{H as default};
