import{j as e}from"./tanstack-1.0.74-aU0azVkW.js";import{N as K}from"./react-number-format.es-1.0.74-V5uzMUOI.js";import{l as T,dg as L,d6 as U,C as $,di as B,dh as H}from"./lib-1.0.74-B5IEqfHg.js";import{y as P,aR as q,ac as G,ad as J}from"./index-1.0.74-DxwH6OqZ.js";import{T as Q}from"./TextField-1.0.74-BW9Byijb.js";import{I as W}from"./InputAdornment-1.0.74-DzikPcDx.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"./ButtonBase-1.0.74-W6tAH7AI.js";import"./Typography-1.0.74-B4mhsevh.js";import"./useEnhancedEffect-1.0.74-B56M26dS.js";import"./ThemeProvider-1.0.74-4uzbYYLM.js";import"./Portal-1.0.74-BrUPeMX9.js";import"./iconBase-1.0.74-Cs0vntJu.js";import"./Select-1.0.74-DHOnlEEH.js";import"./Menu-1.0.74-CdjCBJ4R.js";import"./isHostComponent-1.0.74-DVu5iVWx.js";import"./Modal-1.0.74-BfLid1bk.js";import"./createSvgIcon-1.0.74-Cw_ZFbxi.js";const fr=({appId:w,columnName:f,columnValue:h,columnMetaData:p,storeColumn:r,columnValidation:d,onColumnChange:b,metaData:s,storeForm:y,formMode:I,locale:g,language:c,columnEvents:i})=>{T.debug(w,f,h,p,r,d,s,y,I,g,c);const z=parseInt(p.numeric_precision),j=parseInt(p.numeric_scale),_=p.column_type.includes("unsigned"),F=L(s,p,r,I,y),A={readOnly:F},a=U((c==null?void 0:c.code)??$.defaultLanguage.code),N=d!=null&&d.error?d==null?void 0:d.text:g.enterNumber+(_?" unsigned":"")+" ("+z.toString()+","+j.toString()+")",O=r.localize?((r==null?void 0:r.prefix)??"")+(p!=null&&p.numeric_scale&&p.numeric_scale>0?`9${a.thousandSeparator}999${a.decimalSeparator}99`:`9${a.thousandSeparator}999`)+((r==null?void 0:r.suffix)??""):"",k=()=>{const S=(parseFloat(h)||0)+Number((r==null?void 0:r.numericStep)??1);((r==null?void 0:r.numericMax)===void 0||r.numericMax>=S)&&b(f,S)},R=()=>{const S=(parseFloat(h)||0)-Number((r==null?void 0:r.numericStep)??1);((r==null?void 0:r.numericMin)===void 0||r.numericMin<=S)&&b(f,S)};return e.jsx(K,{customInput:Q,error:d==null?void 0:d.error,label:p.formLabel,thousandSeparator:r.localize?a.thousandSeparator:void 0,decimalSeparator:r.localize?a.decimalSeparator:void 0,decimalScale:j,value:h??"",required:p.is_nullable==="NO",slotProps:{htmlInput:A,input:{...!F&&r.numericStepIcon!=="none"&&{endAdornment:e.jsx(W,{position:"end",style:{marginLeft:0},children:e.jsx("div",{style:{display:"flex",flexDirection:"column",marginRight:r.numericStepIcon==="plusmin"?"-4px":"-8px",cursor:"default",gap:r.numericStepIcon==="plusmin"?"4px":0},children:r.numericStepIcon==="plusmin"?e.jsxs(e.Fragment,{children:[e.jsx(P,{size:12,color:"#555",onClick:k,style:{border:"1px solid #ddd",borderRadius:"3px"}}),e.jsx(q,{size:12,color:"#555",onClick:R,style:{border:"1px solid #ddd",borderRadius:"3px"}})]}):e.jsxs(e.Fragment,{children:[e.jsx(G,{size:20,color:"#999",onClick:k}),e.jsx(J,{size:20,color:"#999",onClick:R})]})})})}}},className:r.classNames,helperText:H(r,N),variant:B(),onValueChange:({value:x})=>{x===""&&p.is_nullable!=="NO"?b(f,null):b(f,x)},onInvalid:x=>{x.preventDefault()},prefix:(r==null?void 0:r.prefix)??"",suffix:(r==null?void 0:r.suffix)??"",sx:{"& input":{textAlign:r.alignment}},placeholder:O,onBlurCapture:i==null?void 0:i.onBlur,onChangeCapture:i==null?void 0:i.onChange,onClickCapture:i==null?void 0:i.onClick,onDoubleClickCapture:i==null?void 0:i.onDoubleClick,onFocusCapture:i==null?void 0:i.onFocus,onKeyDownCapture:i==null?void 0:i.onKeyDown,onKeyUpCapture:i==null?void 0:i.onKeyUp})};export{fr as default};
