import{j as f}from"./cm-1.0.63-CSIRHMXC.js";import{l as t,o as K,cL as O,cK as k,cS as F,cJ as S,bz as _}from"./lib-1.0.63-DJZPtMem.js";import{T as j}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 V=({columnName:i,columnValue:b,columnInitialValue:L,columnMetaData:x,storeColumn:p,columnValidation:e,onColumnChange:w,metaData:N,storeForm:a,formMode:g,locale:T,columnEvents:r})=>{t.debug(i,b,L,x,p,e,N,a,g,T);const y=K(b),R=Number(p.maxLength)<1||Number(p.maxLength)>x.character_maximum_length||isNaN(Number(p.maxLength))?x.character_maximum_length:Number(p.maxLength),C=e!=null&&e.error?e==null?void 0:e.text:T.enterMultiLineText+" ("+R+")";return f.jsx(j,{error:e==null?void 0:e.error,id:i,label:x.formLabel,value:y,required:x.is_nullable==="NO",multiline:!0,minRows:p.minRows,maxRows:p.maxRows,slotProps:{htmlInput:{maxLength:R,readOnly:S(N,x,p,g)}},className:F(p),helperText:k(p,C),variant:O(),onChange:h=>{let U=h.target.value;h.target.value===""&&(g===_.INSERT||g===_.UPDATE&&a.preserveSpacesOnUpdate===!1||a.preserveSpacesOnUpdate===!0&&L!=="")&&(U=null),w(i,U)},onInvalid:h=>{h.preventDefault()},sx:{"& textarea":{textAlign:p.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{V as default};
