import{j as m}from"./cm-1.0.63-CSIRHMXC.js";import{N as b}from"./react-number-format.es-1.0.63-B-GknBUR.js";import{e as g}from"./notistack-1.0.63-B49ULGrj.js";import{l as C,cQ as j,C as k}from"./lib-1.0.63-DJZPtMem.js";import{f as w}from"./tab-1.0.63-Dmjvx_Wl.js";import{T as y}from"./TextField-1.0.63-C35Mfi1Q.js";import"./redux-1.0.63-Df-eBzJn.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"./iconBase-1.0.63-CFvHhC4t.js";import"./createSvgIcon-1.0.63-DWL3J-DK.js";const X=({value:o,columnState:i,columnMetaData:s,setValue:n,saveChanges:I,cancel:N,setButtons:x,locale:p,language:e})=>{C.debug(o,i,s);const h=parseInt(s.numeric_scale),f={};(i==null?void 0:i.inlineNumericMin)!==void 0&&(f.min=i.inlineNumericMin),(i==null?void 0:i.inlineNumericMax)!==void 0&&(f.max=i.inlineNumericMax);const a=j((e==null?void 0:e.code)??k.defaultLanguage.code);return m.jsx("div",{onClick:r=>{r.stopPropagation()},onKeyDown:r=>{r.stopPropagation()},children:m.jsx(b,{customInput:y,className:"pp-inline-editing",value:o??"",thousandSeparator:i.localize?a.thousandSeperator:void 0,decimalSeparator:i.localize?a.decimalSeperator:void 0,decimalScale:h,required:s.is_nullable==="NO",slotProps:{htmlInput:f},variant:"outlined",prefix:(i==null?void 0:i.prefix)??"",suffix:(i==null?void 0:i.suffix)??"",placeholder:((i==null?void 0:i.prefix)??"")+"9.999,99"+((i==null?void 0:i.suffix)??""),onValueChange:({value:r})=>{r===""&&s.is_nullable!=="NO"?n(null):n(r)},onKeyDown:r=>{if(r.key==="Enter"){let d=!0;r.target.value!==""&&(r.target.min&&parseInt(r.target.value)<parseInt(r.target.min)&&(g((p==null?void 0:p.minAllowed)+" "+r.target.min,{variant:"error"}),d=!1),r.target.max&&parseInt(r.target.value)>parseInt(r.target.max)&&(g((p==null?void 0:p.maxAllowed)+" "+r.target.max,{variant:"error"}),d=!1)),d&&I()}else r.key==="Escape"&&N()},onFocus:()=>{x(!0)},onBlur:()=>{setTimeout(()=>{x(!1)},200)},sx:w(i)})})};export{X as default};
