import{j as F}from"./cm-1.0.63-CSIRHMXC.js";import{l as j,o as N,cL as R,cK as A,cJ as B,cS as I,bz as O}from"./lib-1.0.63-DJZPtMem.js";import{T as P}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"./notistack-1.0.63-B49ULGrj.js";import"./iconBase-1.0.63-CFvHhC4t.js";import"./createSvgIcon-1.0.63-DWL3J-DK.js";const E=({columnName:i,columnValue:y,columnInitialValue:T,columnMetaData:p,storeColumn:g,columnValidation:e,onColumnChange:S,metaData:b,storeForm:h,formMode:x,locale:U,columnEvents:r})=>{var f,K;j.debug(i,y,T,p,g,e,b,h,x,U);const k=N(y),_=((f=p==null?void 0:p.column_type)==null?void 0:f.toLowerCase())==="geometry"||((K=p==null?void 0:p.column_type)==null?void 0:K.toLowerCase())==="point",w=e!=null&&e.error?e==null?void 0:e.text:_?"":U.enterText+" ("+p.character_maximum_length+")";return F.jsx(P,{error:e==null?void 0:e.error,label:p.formLabel,value:k,required:p.is_nullable==="NO",className:I(g),slotProps:{input:{},htmlInput:{maxLength:p.character_maximum_length,readOnly:B(b,p,g,x)||_}},helperText:A(g,w),variant:R(),onChange:C=>{let L=C.target.value;C.target.value===""&&(x===O.INSERT||x===O.UPDATE&&h.preserveSpacesOnUpdate===!1||h.preserveSpacesOnUpdate===!0&&T!=="")&&(L=null),S(i,L)},onInvalid:C=>{C.preventDefault()},sx:{"& input":{textAlign:g.alignment}},onBlurCapture:r==null?void 0:r.onBlur,onChangeCapture:r==null?void 0:r.onChange,onClickCapture:r==null?void 0:r.onClick,onDoubleClickCapture:r==null?void 0:r.onDoubleClick,onFocusCapture:r==null?void 0:r.onFocus,onKeyDownCapture:r==null?void 0:r.onKeyDown,onKeyUpCapture:r==null?void 0:r.onKeyUp})};export{E as default};
