Build 589089stable
Module 573725
1,451 characters · in 942496d8357851bf.jsDependencies
Source Raw
function(e,l,n){n.d(l,{p:()=>h});var t=n(477900),u=n(582128),a=n(503698),s=n.n(a),r=n(259678),o=n(504345),i=n(511274),c=n(375708),d=n(498740);function h(e){let l,{className:n,inputClassName:a,disabled:h=!1,editable:f,inputRef:g,prefixElement:p,focusProps:m,name:b="",type:v="text",placeholder:x="",maxLength:C=999,value:F,defaultValue:I,minLength:k,error:T,defaultDirty:j=!1,...y}=e,[L,S]=u.useState(j),V=(l=u.useContext(o.cK),u.useEffect(()=>{l.setHasValue?.(null!=I&&""!==I||null!=F&&""!==F),l.setIsFocused?.(!1)},[]),u.useEffect(()=>{null!=F&&""!==F&&l.setHasValue?.(!0)},[l,F]),l),H=u.useMemo(()=>null===T||""===T?null:null!=T?T:L?null!=k&&(F?.length??0)<k?c.intl.formatToPlainString(c.t["62rk1K"],{minLength:k}):null!=C&&(F?.length??0)>C?c.intl.formatToPlainString(c.t.ICT5S6,{maxLength:C}):null:null,[T,L,k,C,F?.length]),N=null!=T&&""!==T||null!=H;return(0,t.jsxs)("div",{className:s()(d.I6,n),children:[null!=p&&p,(0,t.jsx)(r.vN,{...m,children:(0,t.jsx)("input",{name:b,className:s()(d.hF,a,{[d.z3]:N,[d.r9]:h,[d.LL]:f}),disabled:h,readOnly:!1===f||void 0,type:v,placeholder:x,maxLength:C,minLength:k,value:F,defaultValue:I,...y,"aria-labelledby":y["aria-labelledby"]??V.titleId,onChange:function(e){y.onChange?.(e.currentTarget.value,b),S(!0),V.setHasValue?.(""!==e.currentTarget.value)},onBlur:function(e){y.onBlur?.(e,b),V.setIsFocused?.(!1)},onFocus:function(e){y.onFocus?.(e,b),V.setIsFocused?.(!0)},ref:g})}),(0,t.jsx)(i.U,{error:H})]})}}