You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
667 B

var a=(u,i,n)=>new Promise((f,m)=>{var r=t=>{try{c(n.next(t))}catch(e){m(e)}},s=t=>{try{c(n.throw(t))}catch(e){m(e)}},c=t=>t.done?f(t.value):Promise.resolve(t.value).then(r,s);c((n=n.apply(u,i)).next())});import{G as h,u as o,J as l}from"./index-f4658ae7.js";function w(m){return a(this,arguments,function*({getSchema:u,getProps:i,formElRef:n,isInitedDefault:f}){h(()=>a(this,null,function*(){if(o(f)||!o(i).autoFocusFirstItem)return;yield l();const r=o(u),s=o(n),c=s==null?void 0:s.$el;if(!s||!c||!r||r.length===0||!r[0].component.includes("Input"))return;const e=c.querySelector(".ant-row:first-child input");e&&(e==null||e.focus())}))})}export{w as useAutoFocus};