1 line
2.6 KiB
JavaScript
1 line
2.6 KiB
JavaScript
import{o as e}from"./request-xrnk7ZJV.js";import{Ct as t,Hn as n,Pr as r,Q as ee,Wn as i,Z as a,at as o,mr as s,p as te,u as c,wt as l,yt as ne}from"./jsx-runtime-OfKoVykY.js";import{f as re,m as u,p as d}from"./tooltip-DI_m69zk.js";import{a as f,o as p}from"./style-CSZsuTOx.js";import{r as m,t as h}from"./es-CSpN2d0Y.js";import{a as g}from"./useBreakpoint-DER0GTnn.js";var _=e(r()),v=e=>{let t=_.useRef(e),[,n]=g();return[()=>t.current,e=>{t.current=e,n()}]};function y(e,t){let n=(0,_.useRef)([]),r=()=>{n.current.push(setTimeout(()=>{e.current?.input&&e.current?.input.getAttribute(`type`)===`password`&&e.current?.input.hasAttribute(`value`)&&e.current?.input.removeAttribute(`value`)}))};return(0,_.useEffect)(()=>(t&&r(),()=>n.current.forEach(e=>{e&&clearTimeout(e)})),[t]),r}function ie(e){return!!(e.prefix||e.suffix||e.allowClear||e.showCount)}var b=(0,_.forwardRef)((e,r)=>{let{prefixCls:g,bordered:v=!0,status:b,size:ae,disabled:oe,onBlur:se,onFocus:ce,suffix:x,allowClear:le,addonAfter:S,addonBefore:C,className:w,style:T,styles:E,rootClassName:D,onChange:O,classNames:k,variant:A,...j}=e,{getPrefixCls:M,direction:N,allowClear:P,autoComplete:F,className:I,style:L,classNames:R,styles:z}=n(`input`),B=M(`input`,g),V=(0,_.useRef)(null),H=ne(B),[U,W]=p(B,D);f(B,H);let{compactSize:ue,compactItemClassnames:de}=a(B,N),G=ee(e=>ae??ue??e),fe=_.useContext(o),K=oe??fe,pe={...e,size:G,disabled:K},me=l(L),he=l(T),[q,J]=t([R,k],[z,me,E,he],{props:pe}),{status:ge,hasFeedback:Y,feedbackIcon:_e}=(0,_.useContext)(te),X=re(ge,b),ve=ie(e)||!!Y;(0,_.useRef)(ve);let Z=y(V,!0),ye=e=>{Z(),se?.(e)},be=e=>{Z(),ce?.(e)},xe=e=>{Z(),O?.(e)},Se=(Y||x)&&_.createElement(_.Fragment,null,x,Y&&_e),Ce=m({allowClear:le,contextAllowClear:P,componentName:`Input`}),[Q,$]=c(`input`,A,v);return _.createElement(h,{ref:s(r,V),prefixCls:B,autoComplete:F,...j,disabled:K,onBlur:ye,onFocus:be,style:J.root,styles:J,suffix:Se,allowClear:Ce,className:i(w,D,W,H,de,I,q.root),onChange:xe,addonBefore:C&&_.createElement(u,{form:!0,space:!0},C),addonAfter:S&&_.createElement(u,{form:!0,space:!0},S),classNames:{...q,input:i({[`${B}-sm`]:G===`small`,[`${B}-lg`]:G===`large`,[`${B}-rtl`]:N===`rtl`},q.input,U),variant:i({[`${B}-${Q}`]:$},d(B,X)),affixWrapper:i({[`${B}-affix-wrapper-sm`]:G===`small`,[`${B}-affix-wrapper-lg`]:G===`large`,[`${B}-affix-wrapper-rtl`]:N===`rtl`},U),wrapper:i({[`${B}-group-rtl`]:N===`rtl`},U),groupWrapper:i({[`${B}-group-wrapper-sm`]:G===`small`,[`${B}-group-wrapper-lg`]:G===`large`,[`${B}-group-wrapper-rtl`]:N===`rtl`,[`${B}-group-wrapper-${Q}`]:$},d(`${B}-group-wrapper`,X,Y),U)}})});export{y as n,v as r,b as t}; |