import{y}from"./vue-core-Di3IuVqe.js";function C(a,s){const{modeModificationRef:d,fieldName:f,formatValue:h,canEditRow:u,onValueChanged:c,valueListMaxWidth:g=200,valueListMaxHeight:m=280,cellHeight:v=32,align:l="center"}=s,p=l==="left"?"flex-start":l==="right"?"flex-end":"center",i=y(()=>{const e=new Map;for(const t of a.value||[])e.set(t.value,t.text);return e}),r=h||(e=>{if(e==null)return"";const t=i.value.get(e);return t!=null?String(t):String(e)}),n=e=>!d.value||!e?!1:u?u(e):!0;return{columnPartialDef:{editable:e=>n(e.data),cellEditor:"agRichSelectCellEditor",cellEditorParams:()=>({values:a.value?.map(e=>e.value)||[],filterList:!0,searchType:"matchAny",highlightMatch:!0,cellHeight:v,valueListMaxHeight:m,valueListMaxWidth:g,formatValue:r}),valueSetter:e=>{const t=e.newValue,o=e.oldValue;if(t===o)return!1;const x=f||e.colDef.field;if(e.data[x]=t??"",c)try{c(e)}catch{}return!0},valueFormatter:e=>e.node?.rowPinned?"":r(e.value),cellRenderer:e=>{if(e.node?.rowPinned)return"";const t=r(e.value),o=n(e.data)?'<i class="pi pi-chevron-down code-cell-chevron"></i>':"";return`<div class="code-cell"><span class="code-cell-text" style="text-align:${l}">${t}</span>${o}</div>`},cellStyle:e=>{const t={padding:"4px 8px",display:"flex",alignItems:"center",justifyContent:p};return n(e.data)?{...t,cursor:"pointer"}:t},suppressMenu:!0},formatMap:i}}export{C as u};
