import{j as a}from"./cm-1.0.63-CSIRHMXC.js";import{r as N}from"./redux-1.0.63-Df-eBzJn.js";import{P as h}from"./react-number-format.es-1.0.63-B-GknBUR.js";import{f as j}from"./tab-1.0.63-Dmjvx_Wl.js";import{l as y}from"./lib-1.0.63-DJZPtMem.js";import{T as C}from"./TextField-1.0.63-C35Mfi1Q.js";import"./vendor-1.0.63-CN03Eozo.js";import"./loglevel-1.0.63-BZ7XahX3.js";import"./lodash-1.0.63-hMxolcpJ.js";import"./moment-1.0.63-C5S46NFB.js";import"./Typography-1.0.63-mecuj_Wl.js";import"./ButtonBase-1.0.63-CF10PFMS.js";import"./useEnhancedEffect-1.0.63-DnR0ZFqV.js";import"./Select-1.0.63-BMejr8a7.js";import"./Menu-1.0.63-DLh4HkF0.js";import"./ThemeProvider-1.0.63-Cq0KMgkh.js";import"./index-1.0.63-oIDff4nA.js";import"./Modal-1.0.63-fMXTbfks.js";import"./notistack-1.0.63-B49ULGrj.js";import"./iconBase-1.0.63-CFvHhC4t.js";import"./createSvgIcon-1.0.63-DWL3J-DK.js";const J=({value:t,columnState:o,columnMetaData:s,setValue:p,saveChanges:u,cancel:d,setButtons:m,rowIndex:x,updateInlineEditingErrors:i})=>{y.debug(t,o,s);const[c,n]=N.useState(!1),f=r=>{let e=r.substring(3,4),g=r.substring(6,7);const l=x+"_"+o.columnName;return Number(e)>5||Number(g)>5?(n(!0),i&&i(l,!0),!0):(n(!1),i&&i(l,!1),!1)},b=()=>{const r=j(o);return r["& .MuiInputBase-root.Mui-focused.Mui-error fieldset"]={borderWidth:"2px !important"},r};return a.jsx("div",{onClick:r=>{r.stopPropagation()},onKeyDown:r=>{r.stopPropagation()},children:a.jsx(h,{error:c,customInput:C,className:"pp-inline-editing",value:t??"",required:s.is_nullable==="NO",variant:"outlined",prefix:(o==null?void 0:o.prefix)??"",format:"##:##:##",placeholder:"00:00:00",onChange:r=>{const e=r.target.value;e===""&&s.is_nullable!=="NO"?p(null):p(e),f(e)},onKeyDown:r=>{r.key==="Enter"?f(t)||u():r.key==="Escape"&&d()},onFocus:()=>{m(!0)},onBlur:()=>{setTimeout(()=>{m(!1)},200)},sx:b()})})};export{J as default};
