import{j as o}from"./tanstack-1.0.74-aU0azVkW.js";import{l as c,n as x}from"./lib-1.0.74-B5IEqfHg.js";import{u as g}from"./useAutoUpdate-1.0.74-DFgwgwEr.js";import{S as f}from"./Select-1.0.74-DHOnlEEH.js";import{M as a}from"./MenuItem-1.0.74-D9LDbFUb.js";import{E as d}from"./EnumTypeEnum-1.0.74-Ws4BsaYD.js";import{R as E}from"./RadioGroup-1.0.74-DWBtoS7u.js";import{F as R}from"./FormControlLabel-1.0.74-CdAG1Jo8.js";import{R as j}from"./Radio-1.0.74-fPSETwpC.js";import"./redux-1.0.74-D8bIc6ki.js";import"./vendor-1.0.74-CN03Eozo.js";import"./utils-1.0.74-7xWhx9mc.js";import"./CircularProgress-1.0.74-QfwfRJ7i.js";import"./Menu-1.0.74-CdjCBJ4R.js";import"./ThemeProvider-1.0.74-4uzbYYLM.js";import"./Typography-1.0.74-B4mhsevh.js";import"./useEnhancedEffect-1.0.74-B56M26dS.js";import"./index-1.0.74-DxwH6OqZ.js";import"./ButtonBase-1.0.74-W6tAH7AI.js";import"./Portal-1.0.74-BrUPeMX9.js";import"./iconBase-1.0.74-Cs0vntJu.js";import"./isHostComponent-1.0.74-DVu5iVWx.js";import"./Modal-1.0.74-BfLid1bk.js";import"./createSvgIcon-1.0.74-Cw_ZFbxi.js";import"./SwitchBase-1.0.74-pUYMwK3f.js";const I=({value:n,columnMetaData:e,setValue:r,saveChanges:p,enumValues:s})=>{c.debug(n,e);const m=g(n,p),u=null;return o.jsx("div",{onClick:i=>{i.stopPropagation()},children:o.jsx(f,{MenuProps:{id:"pp-select-menu"},className:"pp-inline-editing",value:n??"",variant:"outlined",onChange:i=>{r(i.target.value===""?null:i.target.value)},sx:{width:"100%","&.MuiInputBase-root.Mui-focused .MuiOutlinedInput-notchedOutline":{borderWidth:"1px !important"}},children:(()=>{const i=s.map(function(t){return o.jsx(a,{value:t,onClick:()=>{m(!0)},children:t},t)});return e.is_nullable==="YES"?[o.jsx(a,{"data-id":"pp-empty-enum-item",value:u,onClick:()=>{m(!0)},children:" "},"pp-empty-enum-item")].concat(i):i})()})})},h=({value:n,tableState:e,columnState:r,columnMetaData:p,setValue:s,saveChanges:m,enumValues:u})=>{c.debug(n,e,r,p);const i=g(n,m);return o.jsx("div",{onClick:t=>{t.stopPropagation()},children:o.jsx(E,{className:"pp-inline-editing",sx:{flexDirection:r.inlineEditingEnum===d.RADIO_HORIZONTAL?"row":"column",justifyContent:r.alignment,...r.alignment===x.RIGHT&&{marginRight:"-16px"}},value:n,onChange:t=>{s(t.target.value)},children:u.map(function(l){return o.jsx(R,{control:o.jsx(j,{onClick:()=>{i(!0)}}),value:l,label:l},l)})})})},J=({value:n,tableState:e,columnState:r,columnMetaData:p,setValue:s,saveChanges:m,cancel:u,setButtons:i})=>{c.debug(n,e,r,p);const t=p.column_type.replace("enum(","").replace(")","").replaceAll("'","").split(",");switch(r.inlineEditingEnum){case d.RADIO_HORIZONTAL:case d.RADIO_VERTICAL:return o.jsx(h,{value:n,tableState:e,columnState:r,columnMetaData:p,setValue:s,saveChanges:m,cancel:u,setButtons:i,enumValues:t});default:return o.jsx(I,{value:n,tableState:e,columnState:r,columnMetaData:p,setValue:s,saveChanges:m,cancel:u,setButtons:i,enumValues:t})}};export{J as default};
