Files
xin-procurement/public/assets/Input-CJ-n8Xgl.js
T
2026-08-15 00:58:18 +08:00

1 line
2.4 KiB
JavaScript

import{i as e}from"./rolldown-runtime-BgaNhQyE.js";import{Dr as t,Q as n,St as r,Vn as i,Z as a,at as o,lr as ee,p as te,u as ne,xt as s,yt as c,zn as l}from"./jsx-runtime-CRBytmvs.js";import{f as u,m as d,p as f}from"./tooltip-SaeG1Uv7.js";import{a as p,o as m}from"./style-BmYds38x.js";import{r as re,t as ie}from"./es-DGcDZmXr.js";var h=e(t());function g(e,t){let n=(0,h.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,h.useEffect)(()=>(t&&r(),()=>n.current.forEach(e=>{e&&clearTimeout(e)})),[t]),r}function ae(e){return!!(e.prefix||e.suffix||e.allowClear||e.showCount)}var _=(0,h.forwardRef)((e,t)=>{let{prefixCls:_,bordered:oe=!0,status:se,size:ce,disabled:le,onBlur:ue,onFocus:v,suffix:y,allowClear:b,addonAfter:x,addonBefore:S,className:C,style:w,styles:T,rootClassName:E,onChange:D,classNames:O,variant:k,...A}=e,{getPrefixCls:j,direction:M,allowClear:N,autoComplete:P,className:F,style:I,classNames:L,styles:R}=l(`input`),z=j(`input`,_),B=(0,h.useRef)(null),V=c(z),[H,U]=m(z,E);p(z,V);let{compactSize:de,compactItemClassnames:fe}=a(z,M),W=n(e=>ce??de??e),pe=h.useContext(o),G=le??pe,me={...e,size:W,disabled:G},he=r(I),ge=r(w),[K,q]=s([L,O],[R,he,T,ge],{props:me}),{status:_e,hasFeedback:J,feedbackIcon:ve}=(0,h.useContext)(te),Y=u(_e,se);(0,h.useRef)(ae(e)||!!J);let X=g(B,!0),Z=e=>{X(),ue?.(e)},ye=e=>{X(),v?.(e)},be=e=>{X(),D?.(e)},xe=(J||y)&&h.createElement(h.Fragment,null,y,J&&ve),Se=re({allowClear:b,contextAllowClear:N,componentName:`Input`}),[Q,$]=ne(`input`,k,oe);return h.createElement(ie,{ref:ee(t,B),prefixCls:z,autoComplete:P,...A,disabled:G,onBlur:Z,onFocus:ye,style:q.root,styles:q,suffix:xe,allowClear:Se,className:i(C,E,U,V,fe,F,K.root),onChange:be,addonBefore:S&&h.createElement(d,{form:!0,space:!0},S),addonAfter:x&&h.createElement(d,{form:!0,space:!0},x),classNames:{...K,input:i({[`${z}-sm`]:W===`small`,[`${z}-lg`]:W===`large`,[`${z}-rtl`]:M===`rtl`},K.input,H),variant:i({[`${z}-${Q}`]:$},f(z,Y)),affixWrapper:i({[`${z}-affix-wrapper-sm`]:W===`small`,[`${z}-affix-wrapper-lg`]:W===`large`,[`${z}-affix-wrapper-rtl`]:M===`rtl`},H),wrapper:i({[`${z}-group-rtl`]:M===`rtl`},H),groupWrapper:i({[`${z}-group-wrapper-sm`]:W===`small`,[`${z}-group-wrapper-lg`]:W===`large`,[`${z}-group-wrapper-rtl`]:M===`rtl`,[`${z}-group-wrapper-${Q}`]:$},f(`${z}-group-wrapper`,Y,J),H)}})});export{g as n,_ as t};