Some checks failed
Node CI / build (14.x, macOS-latest) (push) Has been cancelled
Node CI / build (14.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (14.x, windows-latest) (push) Has been cancelled
Node CI / build (16.x, macOS-latest) (push) Has been cancelled
Node CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (16.x, windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
coverage CI / build (push) Has been cancelled
Node pnpm CI / build (16.x, macOS-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, windows-latest) (push) Has been cancelled
9 lines
24 KiB
JavaScript
9 lines
24 KiB
JavaScript
"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[7569],{77569:function(Yt,Ae,i){i.d(Ae,{Z:function(){return Kt}});var y=i(65223),B=i(74902),o=i(67294),Be=i(93967),K=i.n(Be),Ce=i(29372),xe=i(33603),ue=i(35792);function me(e){const[t,n]=o.useState(e);return o.useEffect(()=>{const r=setTimeout(()=>{n(e)},e.length?0:10);return()=>{clearTimeout(r)}},[e]),t}var re=i(11568),$e=i(14747),Se=i(50438),Xe=i(33507),Ge=i(83262),Ie=i(83559),Ke=e=>{const{componentCls:t}=e,n=`${t}-show-help`,r=`${t}-show-help-item`;return{[n]:{transition:`opacity ${e.motionDurationFast} ${e.motionEaseInOut}`,"&-appear, &-enter":{opacity:0,"&-active":{opacity:1}},"&-leave":{opacity:1,"&-active":{opacity:0}},[r]:{overflow:"hidden",transition:`height ${e.motionDurationFast} ${e.motionEaseInOut},
|
||
opacity ${e.motionDurationFast} ${e.motionEaseInOut},
|
||
transform ${e.motionDurationFast} ${e.motionEaseInOut} !important`,[`&${r}-appear, &${r}-enter`]:{transform:"translateY(-5px)",opacity:0,"&-active":{transform:"translateY(0)",opacity:1}},[`&${r}-leave-active`]:{transform:"translateY(-5px)"}}}}};const Ue=e=>({legend:{display:"block",width:"100%",marginBottom:e.marginLG,padding:0,color:e.colorTextDescription,fontSize:e.fontSizeLG,lineHeight:"inherit",border:0,borderBottom:`${(0,re.bf)(e.lineWidth)} ${e.lineType} ${e.colorBorder}`},'input[type="search"]':{boxSizing:"border-box"},'input[type="radio"], input[type="checkbox"]':{lineHeight:"normal"},'input[type="file"]':{display:"block"},'input[type="range"]':{display:"block",width:"100%"},"select[multiple], select[size]":{height:"auto"},"input[type='file']:focus,\n input[type='radio']:focus,\n input[type='checkbox']:focus":{outline:0,boxShadow:`0 0 0 ${(0,re.bf)(e.controlOutlineWidth)} ${e.controlOutline}`},output:{display:"block",paddingTop:15,color:e.colorText,fontSize:e.fontSize,lineHeight:e.lineHeight}}),Ee=(e,t)=>{const{formItemCls:n}=e;return{[n]:{[`${n}-label > label`]:{height:t},[`${n}-control-input`]:{minHeight:t}}}},Ye=e=>{const{componentCls:t}=e;return{[e.componentCls]:Object.assign(Object.assign(Object.assign({},(0,$e.Wf)(e)),Ue(e)),{[`${t}-text`]:{display:"inline-block",paddingInlineEnd:e.paddingSM},"&-small":Object.assign({},Ee(e,e.controlHeightSM)),"&-large":Object.assign({},Ee(e,e.controlHeightLG))})}},qe=e=>{const{formItemCls:t,iconCls:n,rootPrefixCls:r,antCls:l,labelRequiredMarkColor:s,labelColor:u,labelFontSize:c,labelHeight:g,labelColonMarginInlineStart:d,labelColonMarginInlineEnd:h,itemMarginBottom:f}=e;return{[t]:Object.assign(Object.assign({},(0,$e.Wf)(e)),{marginBottom:f,verticalAlign:"top","&-with-help":{transition:"none"},[`&-hidden,
|
||
&-hidden${l}-row`]:{display:"none"},"&-has-warning":{[`${t}-split`]:{color:e.colorError}},"&-has-error":{[`${t}-split`]:{color:e.colorWarning}},[`${t}-label`]:{flexGrow:0,overflow:"hidden",whiteSpace:"nowrap",textAlign:"end",verticalAlign:"middle","&-left":{textAlign:"start"},"&-wrap":{overflow:"unset",lineHeight:e.lineHeight,whiteSpace:"unset","> label":{verticalAlign:"middle",textWrap:"balance"}},"> label":{position:"relative",display:"inline-flex",alignItems:"center",maxWidth:"100%",height:g,color:u,fontSize:c,[`> ${n}`]:{fontSize:e.fontSize,verticalAlign:"top"},[`&${t}-required`]:{"&::before":{display:"inline-block",marginInlineEnd:e.marginXXS,color:s,fontSize:e.fontSize,fontFamily:"SimSun, sans-serif",lineHeight:1,content:'"*"'},[`&${t}-required-mark-hidden, &${t}-required-mark-optional`]:{"&::before":{display:"none"}}},[`${t}-optional`]:{display:"inline-block",marginInlineStart:e.marginXXS,color:e.colorTextDescription,[`&${t}-required-mark-hidden`]:{display:"none"}},[`${t}-tooltip`]:{color:e.colorTextDescription,cursor:"help",writingMode:"horizontal-tb",marginInlineStart:e.marginXXS},"&::after":{content:'":"',position:"relative",marginBlock:0,marginInlineStart:d,marginInlineEnd:h},[`&${t}-no-colon::after`]:{content:'"\\a0"'}}},[`${t}-control`]:{"--ant-display":"flex",flexDirection:"column",flexGrow:1,[`&:first-child:not([class^="'${r}-col-'"]):not([class*="' ${r}-col-'"])`]:{width:"100%"},"&-input":{position:"relative",display:"flex",alignItems:"center",minHeight:e.controlHeight,"&-content":{flex:"auto",maxWidth:"100%",[`&:has(> ${l}-switch:only-child, > ${l}-rate:only-child)`]:{display:"flex",alignItems:"center"}}}},[t]:{"&-additional":{display:"flex",flexDirection:"column"},"&-explain, &-extra":{clear:"both",color:e.colorTextDescription,fontSize:e.fontSize,lineHeight:e.lineHeight},"&-explain-connected":{width:"100%"},"&-extra":{minHeight:e.controlHeightSM,transition:`color ${e.motionDurationMid} ${e.motionEaseOut}`},"&-explain":{"&-error":{color:e.colorError},"&-warning":{color:e.colorWarning}}},[`&-with-help ${t}-explain`]:{height:"auto",opacity:1},[`${t}-feedback-icon`]:{fontSize:e.fontSize,textAlign:"center",visibility:"visible",animationName:Se.kr,animationDuration:e.motionDurationMid,animationTimingFunction:e.motionEaseOutBack,pointerEvents:"none","&-success":{color:e.colorSuccess},"&-error":{color:e.colorError},"&-warning":{color:e.colorWarning},"&-validating":{color:e.colorPrimary}}})}},_=e=>({padding:e.verticalLabelPadding,margin:e.verticalLabelMargin,whiteSpace:"initial",textAlign:"start","> label":{margin:0,"&::after":{visibility:"hidden"}}}),Qe=e=>{const{antCls:t,formItemCls:n}=e;return{[`${n}-horizontal`]:{[`${n}-label`]:{flexGrow:0},[`${n}-control`]:{flex:"1 1 0",minWidth:0},[`${n}-label[class$='-24'], ${n}-label[class*='-24 ']`]:{[`& + ${n}-control`]:{minWidth:"unset"}},[`${t}-col-24${n}-label,
|
||
${t}-col-xl-24${n}-label`]:_(e)}}},Je=e=>{const{componentCls:t,formItemCls:n,inlineItemMarginBottom:r}=e;return{[`${t}-inline`]:{display:"flex",flexWrap:"wrap",[`${n}-inline`]:{flex:"none",marginInlineEnd:e.margin,marginBottom:r,"&-row":{flexWrap:"nowrap"},[`> ${n}-label,
|
||
> ${n}-control`]:{display:"inline-block",verticalAlign:"top"},[`> ${n}-label`]:{flex:"none"},[`${t}-text`]:{display:"inline-block"},[`${n}-has-feedback`]:{display:"inline-block"}}}}},ke=e=>{const{componentCls:t,formItemCls:n,rootPrefixCls:r}=e;return{[`${n} ${n}-label`]:_(e),[`${t}:not(${t}-inline)`]:{[n]:{flexWrap:"wrap",[`${n}-label, ${n}-control`]:{[`&:not([class*=" ${r}-col-xs"])`]:{flex:"0 0 100%",maxWidth:"100%"}}}}}},_e=e=>{const{componentCls:t,formItemCls:n,antCls:r}=e;return{[`${n}-vertical`]:{[`${n}-row`]:{flexDirection:"column"},[`${n}-label > label`]:{height:"auto"},[`${n}-control`]:{width:"100%"},[`${n}-label,
|
||
${r}-col-24${n}-label,
|
||
${r}-col-xl-24${n}-label`]:_(e)},[`@media (max-width: ${(0,re.bf)(e.screenXSMax)})`]:[ke(e),{[t]:{[`${n}:not(${n}-horizontal)`]:{[`${r}-col-xs-24${n}-label`]:_(e)}}}],[`@media (max-width: ${(0,re.bf)(e.screenSMMax)})`]:{[t]:{[`${n}:not(${n}-horizontal)`]:{[`${r}-col-sm-24${n}-label`]:_(e)}}},[`@media (max-width: ${(0,re.bf)(e.screenMDMax)})`]:{[t]:{[`${n}:not(${n}-horizontal)`]:{[`${r}-col-md-24${n}-label`]:_(e)}}},[`@media (max-width: ${(0,re.bf)(e.screenLGMax)})`]:{[t]:{[`${n}:not(${n}-horizontal)`]:{[`${r}-col-lg-24${n}-label`]:_(e)}}}}},et=e=>({labelRequiredMarkColor:e.colorError,labelColor:e.colorTextHeading,labelFontSize:e.fontSize,labelHeight:e.controlHeight,labelColonMarginInlineStart:e.marginXXS/2,labelColonMarginInlineEnd:e.marginXS,itemMarginBottom:e.marginLG,verticalLabelPadding:`0 0 ${e.paddingXS}px`,verticalLabelMargin:0,inlineItemMarginBottom:0}),Oe=(e,t)=>(0,Ge.IX)(e,{formItemCls:`${e.componentCls}-item`,rootPrefixCls:t});var fe=(0,Ie.I$)("Form",(e,{rootPrefixCls:t})=>{const n=Oe(e,t);return[Ye(n),qe(n),Ke(n),Qe(n),Je(n),_e(n),(0,Xe.Z)(n),Se.kr]},et,{order:-1e3});const Fe=[];function ge(e,t,n,r=0){return{key:typeof e=="string"?e:`${t}-${r}`,error:e,errorStatus:n}}var je=({help:e,helpStatus:t,errors:n=Fe,warnings:r=Fe,className:l,fieldId:s,onVisibleChanged:u})=>{const{prefixCls:c}=o.useContext(y.Rk),g=`${c}-item-explain`,d=(0,ue.Z)(c),[h,f,M]=fe(c,d),Z=o.useMemo(()=>(0,xe.Z)(c),[c]),N=me(n),x=me(r),v=o.useMemo(()=>e!=null?[ge(e,"help",t)]:[].concat((0,B.Z)(N.map((m,a)=>ge(m,"error","error",a))),(0,B.Z)(x.map((m,a)=>ge(m,"warning","warning",a)))),[e,t,N,x]),R=o.useMemo(()=>{const m={};return v.forEach(({key:a})=>{m[a]=(m[a]||0)+1}),v.map((a,S)=>Object.assign(Object.assign({},a),{key:m[a.key]>1?`${a.key}-fallback-${S}`:a.key}))},[v]),F={};return s&&(F.id=`${s}_help`),h(o.createElement(Ce.ZP,{motionDeadline:Z.motionDeadline,motionName:`${c}-show-help`,visible:!!R.length,onVisibleChanged:u},m=>{const{className:a,style:S}=m;return o.createElement("div",Object.assign({},F,{className:K()(g,a,M,d,l,f),style:S}),o.createElement(Ce.V4,Object.assign({keys:R},(0,xe.Z)(c),{motionName:`${c}-show-help-item`,component:!1}),L=>{const{key:$,error:j,errorStatus:b,className:E,style:O}=L;return o.createElement("div",{key:$,className:K()(E,{[`${g}-${b}`]:b}),style:O},j)}))}))},oe=i(88692),pe=i(53124),Pe=i(98866),tt=i(98675),nt=i(97647),Me=i(88942),rt=i(37920),ot=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,r=Object.getOwnPropertySymbols(e);l<r.length;l++)t.indexOf(r[l])<0&&Object.prototype.propertyIsEnumerable.call(e,r[l])&&(n[r[l]]=e[r[l]]);return n};const lt=(e,t)=>{const n=o.useContext(Pe.Z),{getPrefixCls:r,direction:l,requiredMark:s,colon:u,scrollToFirstError:c,className:g,style:d}=(0,pe.dj)("form"),{prefixCls:h,className:f,rootClassName:M,size:Z,disabled:N=n,form:x,colon:v,labelAlign:R,labelWrap:F,labelCol:m,wrapperCol:a,hideRequiredMark:S,layout:L="horizontal",scrollToFirstError:$,requiredMark:j,onFinishFailed:b,name:E,style:O,feedbackIcons:X,variant:G}=e,H=ot(e,["prefixCls","className","rootClassName","size","disabled","form","colon","labelAlign","labelWrap","labelCol","wrapperCol","hideRequiredMark","layout","scrollToFirstError","requiredMark","onFinishFailed","name","style","feedbackIcons","variant"]),T=(0,tt.Z)(Z),z=o.useContext(rt.Z),D=o.useMemo(()=>j!==void 0?j:S?!1:s!==void 0?s:!0,[S,j,s]),J=v!=null?v:u,p=r("form",h),Y=(0,ue.Z)(p),[W,ae,q]=fe(p,Y),ie=K()(p,`${p}-${L}`,{[`${p}-hide-required-mark`]:D===!1,[`${p}-rtl`]:l==="rtl",[`${p}-${T}`]:T},q,Y,ae,g,f,M),[k]=(0,Me.Z)(x),{__INTERNAL__:se}=k;se.name=E;const ee=o.useMemo(()=>({name:E,labelAlign:R,labelCol:m,labelWrap:F,wrapperCol:a,layout:L,colon:J,requiredMark:D,itemRef:se.itemRef,form:k,feedbackIcons:X}),[E,R,m,a,L,J,D,k,X]),C=o.useRef(null);o.useImperativeHandle(t,()=>{var I;return Object.assign(Object.assign({},k),{nativeElement:(I=C.current)===null||I===void 0?void 0:I.nativeElement})});const V=(I,A)=>{if(I){let Q={block:"nearest"};typeof I=="object"&&(Q=Object.assign(Object.assign({},Q),I)),k.scrollToField(A,Q)}},w=I=>{if(b==null||b(I),I.errorFields.length){const A=I.errorFields[0].name;if($!==void 0){V($,A);return}c!==void 0&&V(c,A)}};return W(o.createElement(y.pg.Provider,{value:G},o.createElement(Pe.n,{disabled:N},o.createElement(nt.Z.Provider,{value:T},o.createElement(y.RV,{validateMessages:z},o.createElement(y.q3.Provider,{value:ee},o.createElement(y.Ux,{status:!0},o.createElement(oe.ZP,Object.assign({id:E},H,{name:E,onFinishFailed:w,form:k,ref:C,style:Object.assign(Object.assign({},d),O),className:ie})))))))))};var at=o.forwardRef(lt),it=i(30470),he=i(42550),st=i(96159),ct=i(27288),mt=i(50344);function dt(e){if(typeof e=="function")return e;const t=(0,mt.Z)(e);return t.length<=1?t[0]:t}const we=()=>{const{status:e,errors:t=[],warnings:n=[]}=o.useContext(y.aM);return{status:e,errors:t,warnings:n}};we.Context=y.aM;var ut=we,Ne=i(75164);function ft(e){const[t,n]=o.useState(e),r=o.useRef(null),l=o.useRef([]),s=o.useRef(!1);o.useEffect(()=>(s.current=!1,()=>{s.current=!0,Ne.Z.cancel(r.current),r.current=null}),[]);function u(c){s.current||(r.current===null&&(l.current=[],r.current=(0,Ne.Z)(()=>{r.current=null,n(g=>{let d=g;return l.current.forEach(h=>{d=h(d)}),d})})),l.current.push(c))}return[t,u]}function gt(){const{itemRef:e}=o.useContext(y.q3),t=o.useRef({});function n(r,l){const s=l&&typeof l=="object"&&(0,he.C4)(l),u=r.join("_");return(t.current.name!==u||t.current.originRef!==s)&&(t.current.name=u,t.current.originRef=s,t.current.ref=(0,he.sQ)(e(r),s)),t.current.ref}return n}var le=i(80993),pt=i(5110),Re=i(8410),ht=i(98423),vt=i(17621),ve=i(56790),Le=i(21584);const bt=e=>{const{formItemCls:t}=e;return{"@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none)":{[`${t}-control`]:{display:"flex"}}}};var yt=(0,Ie.bk)(["Form","item-item"],(e,{rootPrefixCls:t})=>{const n=Oe(e,t);return bt(n)}),Ct=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,r=Object.getOwnPropertySymbols(e);l<r.length;l++)t.indexOf(r[l])<0&&Object.prototype.propertyIsEnumerable.call(e,r[l])&&(n[r[l]]=e[r[l]]);return n};const xt=24;var $t=e=>{const{prefixCls:t,status:n,labelCol:r,wrapperCol:l,children:s,errors:u,warnings:c,_internalItemRender:g,extra:d,help:h,fieldId:f,marginBottom:M,onErrorVisibleChanged:Z,label:N}=e,x=`${t}-item`,v=o.useContext(y.q3),R=o.useMemo(()=>{let H=Object.assign({},l||v.wrapperCol||{});return N===null&&!r&&!l&&v.labelCol&&[void 0,"xs","sm","md","lg","xl","xxl"].forEach(z=>{const D=z?[z]:[],J=(0,ve.U2)(v.labelCol,D),p=typeof J=="object"?J:{},Y=(0,ve.U2)(H,D),W=typeof Y=="object"?Y:{};"span"in p&&!("offset"in W)&&p.span<xt&&(H=(0,ve.t8)(H,[].concat(D,["offset"]),p.span))}),H},[l,v]),F=K()(`${x}-control`,R.className),m=o.useMemo(()=>{const{labelCol:H,wrapperCol:T}=v;return Ct(v,["labelCol","wrapperCol"])},[v]),a=o.useRef(null),[S,L]=o.useState(0);(0,Re.Z)(()=>{d&&a.current?L(a.current.clientHeight):L(0)},[d]);const $=o.createElement("div",{className:`${x}-control-input`},o.createElement("div",{className:`${x}-control-input-content`},s)),j=o.useMemo(()=>({prefixCls:t,status:n}),[t,n]),b=M!==null||u.length||c.length?o.createElement(y.Rk.Provider,{value:j},o.createElement(je,{fieldId:f,errors:u,warnings:c,help:h,helpStatus:n,className:`${x}-explain-connected`,onVisibleChanged:Z})):null,E={};f&&(E.id=`${f}_extra`);const O=d?o.createElement("div",Object.assign({},E,{className:`${x}-extra`,ref:a}),d):null,X=b||O?o.createElement("div",{className:`${x}-additional`,style:M?{minHeight:M+S}:{}},b,O):null,G=g&&g.mark==="pro_table_render"&&g.render?g.render(e,{input:$,errorList:b,extra:O}):o.createElement(o.Fragment,null,$,X);return o.createElement(y.q3.Provider,{value:m},o.createElement(Le.Z,Object.assign({},R,{className:F}),G),o.createElement(yt,{prefixCls:t}))},St=i(25035);function It(e){return e==null?null:typeof e=="object"&&!(0,o.isValidElement)(e)?e:{title:e}}var Et=It,Ot=i(10110),Ft=i(24457),jt=i(83062),Pt=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,r=Object.getOwnPropertySymbols(e);l<r.length;l++)t.indexOf(r[l])<0&&Object.prototype.propertyIsEnumerable.call(e,r[l])&&(n[r[l]]=e[r[l]]);return n},Mt=({prefixCls:e,label:t,htmlFor:n,labelCol:r,labelAlign:l,colon:s,required:u,requiredMark:c,tooltip:g,vertical:d})=>{var h;const[f]=(0,Ot.Z)("Form"),{labelAlign:M,labelCol:Z,labelWrap:N,colon:x}=o.useContext(y.q3);if(!t)return null;const v=r||Z||{},R=l||M,F=`${e}-item-label`,m=K()(F,R==="left"&&`${F}-left`,v.className,{[`${F}-wrap`]:!!N});let a=t;const S=s===!0||x!==!1&&s!==!1;S&&!d&&typeof t=="string"&&t.trim()&&(a=t.replace(/[:|:]\s*$/,""));const $=Et(g);if($){const{icon:G=o.createElement(St.Z,null)}=$,H=Pt($,["icon"]),T=o.createElement(jt.Z,Object.assign({},H),o.cloneElement(G,{className:`${e}-item-tooltip`,title:"",onClick:z=>{z.preventDefault()},tabIndex:null}));a=o.createElement(o.Fragment,null,a,T)}const j=c==="optional",b=typeof c=="function",E=c===!1;b?a=c(a,{required:!!u}):j&&!u&&(a=o.createElement(o.Fragment,null,a,o.createElement("span",{className:`${e}-item-optional`,title:""},(f==null?void 0:f.optional)||((h=Ft.Z.Form)===null||h===void 0?void 0:h.optional))));let O;E?O="hidden":(j||b)&&(O="optional");const X=K()({[`${e}-item-required`]:u,[`${e}-item-required-mark-${O}`]:O,[`${e}-item-no-colon`]:!S});return o.createElement(Le.Z,Object.assign({},v,{className:m}),o.createElement("label",{htmlFor:n,className:X,title:typeof t=="string"?t:""},a))},wt=i(89739),Nt=i(4340),Rt=i(21640),Lt=i(50888);const Vt={success:wt.Z,warning:Rt.Z,error:Nt.Z,validating:Lt.Z};function Ve({children:e,errors:t,warnings:n,hasFeedback:r,validateStatus:l,prefixCls:s,meta:u,noStyle:c,name:g}){const d=`${s}-item`,{feedbackIcons:h}=o.useContext(y.q3),f=(0,le.lR)(t,n,u,null,!!r,l),{isFormItemInput:M,status:Z,hasFeedback:N,feedbackIcon:x,name:v}=o.useContext(y.aM),R=o.useMemo(()=>{var F;let m;if(r){const S=r!==!0&&r.icons||h,L=f&&((F=S==null?void 0:S({status:f,errors:t,warnings:n}))===null||F===void 0?void 0:F[f]),$=f&&Vt[f];m=L!==!1&&$?o.createElement("span",{className:K()(`${d}-feedback-icon`,`${d}-feedback-icon-${f}`)},L||o.createElement($,null)):null}const a={status:f||"",errors:t,warnings:n,hasFeedback:!!r,feedbackIcon:m,isFormItemInput:!0,name:g};return c&&(a.status=(f!=null?f:Z)||"",a.isFormItemInput=M,a.hasFeedback=!!(r!=null?r:N),a.feedbackIcon=r!==void 0?a.feedbackIcon:x,a.name=g!=null?g:v),a},[f,r,c,M,Z]);return o.createElement(y.aM.Provider,{value:R},e)}var Zt=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,r=Object.getOwnPropertySymbols(e);l<r.length;l++)t.indexOf(r[l])<0&&Object.prototype.propertyIsEnumerable.call(e,r[l])&&(n[r[l]]=e[r[l]]);return n};function Tt(e){const{prefixCls:t,className:n,rootClassName:r,style:l,help:s,errors:u,warnings:c,validateStatus:g,meta:d,hasFeedback:h,hidden:f,children:M,fieldId:Z,required:N,isRequired:x,onSubItemMetaChange:v,layout:R,name:F}=e,m=Zt(e,["prefixCls","className","rootClassName","style","help","errors","warnings","validateStatus","meta","hasFeedback","hidden","children","fieldId","required","isRequired","onSubItemMetaChange","layout","name"]),a=`${t}-item`,{requiredMark:S,layout:L}=o.useContext(y.q3),$=R||L,j=$==="vertical",b=o.useRef(null),E=me(u),O=me(c),X=s!=null,G=!!(X||u.length||c.length),H=!!b.current&&(0,pt.Z)(b.current),[T,z]=o.useState(null);(0,Re.Z)(()=>{if(G&&b.current){const W=getComputedStyle(b.current);z(parseInt(W.marginBottom,10))}},[G,H]);const D=W=>{W||z(null)},p=((W=!1)=>{const ae=W?E:d.errors,q=W?O:d.warnings;return(0,le.lR)(ae,q,d,"",!!h,g)})(),Y=K()(a,n,r,{[`${a}-with-help`]:X||E.length||O.length,[`${a}-has-feedback`]:p&&h,[`${a}-has-success`]:p==="success",[`${a}-has-warning`]:p==="warning",[`${a}-has-error`]:p==="error",[`${a}-is-validating`]:p==="validating",[`${a}-hidden`]:f,[`${a}-${$}`]:$});return o.createElement("div",{className:Y,style:l,ref:b},o.createElement(vt.Z,Object.assign({className:`${a}-row`},(0,ht.Z)(m,["_internalItemRender","colon","dependencies","extra","fieldKey","getValueFromEvent","getValueProps","htmlFor","id","initialValue","isListField","label","labelAlign","labelCol","labelWrap","messageVariables","name","normalize","noStyle","preserve","requiredMark","rules","shouldUpdate","trigger","tooltip","validateFirst","validateTrigger","valuePropName","wrapperCol","validateDebounce"])),o.createElement(Mt,Object.assign({htmlFor:Z},e,{requiredMark:S,required:N!=null?N:x,prefixCls:t,vertical:j})),o.createElement($t,Object.assign({},e,d,{errors:E,warnings:O,prefixCls:t,status:p,help:s,marginBottom:T,onErrorVisibleChanged:D}),o.createElement(y.qI.Provider,{value:v},o.createElement(Ve,{prefixCls:t,meta:d,errors:d.errors,warnings:d.warnings,hasFeedback:h,validateStatus:p,name:F},M)))),!!T&&o.createElement("div",{className:`${a}-margin-offset`,style:{marginBottom:-T}}))}const zt="__SPLIT__",en=null;function Ht(e,t){const n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(l=>{const s=e[l],u=t[l];return s===u||typeof s=="function"||typeof u=="function"})}const Dt=o.memo(({children:e})=>e,(e,t)=>Ht(e.control,t.control)&&e.update===t.update&&e.childProps.length===t.childProps.length&&e.childProps.every((n,r)=>n===t.childProps[r]));function Ze(){return{errors:[],warnings:[],touched:!1,validating:!1,name:[],validated:!1}}function Wt(e){const{name:t,noStyle:n,className:r,dependencies:l,prefixCls:s,shouldUpdate:u,rules:c,children:g,required:d,label:h,messageVariables:f,trigger:M="onChange",validateTrigger:Z,hidden:N,help:x,layout:v}=e,{getPrefixCls:R}=o.useContext(pe.E_),{name:F}=o.useContext(y.q3),m=dt(g),a=typeof m=="function",S=o.useContext(y.qI),{validateTrigger:L}=o.useContext(oe.zb),$=Z!==void 0?Z:L,j=t!=null,b=R("form",s),E=(0,ue.Z)(b),[O,X,G]=fe(b,E),H=(0,ct.ln)("Form.Item"),T=o.useContext(oe.ZM),z=o.useRef(null),[D,J]=ft({}),[p,Y]=(0,it.Z)(()=>Ze()),W=C=>{const V=T==null?void 0:T.getKey(C.name);if(Y(C.destroy?Ze():C,!0),n&&x!==!1&&S){let w=C.name;if(C.destroy)w=z.current||w;else if(V!==void 0){const[I,A]=V;w=[I].concat((0,B.Z)(A)),z.current=w}S(C,w)}},ae=(C,V)=>{J(w=>{const I=Object.assign({},w),Q=[].concat((0,B.Z)(C.name.slice(0,-1)),(0,B.Z)(V)).join(zt);return C.destroy?delete I[Q]:I[Q]=C,I})},[q,ie]=o.useMemo(()=>{const C=(0,B.Z)(p.errors),V=(0,B.Z)(p.warnings);return Object.values(D).forEach(w=>{C.push.apply(C,(0,B.Z)(w.errors||[])),V.push.apply(V,(0,B.Z)(w.warnings||[]))}),[C,V]},[D,p.errors,p.warnings]),k=gt();function se(C,V,w){return n&&!N?o.createElement(Ve,{prefixCls:b,hasFeedback:e.hasFeedback,validateStatus:e.validateStatus,meta:p,errors:q,warnings:ie,noStyle:!0,name:t},C):o.createElement(Tt,Object.assign({key:"row"},e,{className:K()(r,G,E,X),prefixCls:b,fieldId:V,isRequired:w,errors:q,warnings:ie,meta:p,onSubItemMetaChange:ae,layout:v,name:t}),C)}if(!j&&!a&&!l)return O(se(m));let ee={};return typeof h=="string"?ee.label=h:t&&(ee.label=String(t)),f&&(ee=Object.assign(Object.assign({},ee),f)),O(o.createElement(oe.gN,Object.assign({},e,{messageVariables:ee,trigger:M,validateTrigger:$,onMetaChange:W}),(C,V,w)=>{const I=(0,le.qo)(t).length&&V?V.name:[],A=(0,le.dD)(I,F),Q=d!==void 0?d:!!(c!=null&&c.some(P=>{if(P&&typeof P=="object"&&P.required&&!P.warningOnly)return!0;if(typeof P=="function"){const te=P(w);return(te==null?void 0:te.required)&&!(te!=null&&te.warningOnly)}return!1})),de=Object.assign({},C);let ce=null;if(Array.isArray(m)&&j)ce=m;else if(!(a&&(!(u||l)||j))){if(!(l&&!a&&!j))if(o.isValidElement(m)){const P=Object.assign(Object.assign({},m.props),de);if(P.id||(P.id=A),x||q.length>0||ie.length>0||e.extra){const ne=[];(x||q.length>0)&&ne.push(`${A}_help`),e.extra&&ne.push(`${A}_extra`),P["aria-describedby"]=ne.join(" ")}q.length>0&&(P["aria-invalid"]="true"),Q&&(P["aria-required"]="true"),(0,he.Yr)(m)&&(P.ref=k(I,m)),new Set([].concat((0,B.Z)((0,le.qo)(M)),(0,B.Z)((0,le.qo)($)))).forEach(ne=>{P[ne]=(...ze)=>{var He,De,be,We,ye;(be=de[ne])===null||be===void 0||(He=be).call.apply(He,[de].concat(ze)),(ye=(We=m.props)[ne])===null||ye===void 0||(De=ye).call.apply(De,[We].concat(ze))}});const Ut=[P["aria-required"],P["aria-invalid"],P["aria-describedby"]];ce=o.createElement(Dt,{control:de,update:m,childProps:Ut},(0,st.Tm)(m,P))}else a&&(u||l)&&!j?ce=m(w):ce=m}return se(ce,A,Q)}))}const Te=Wt;Te.useStatus=ut;var At=Te,Bt=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,r=Object.getOwnPropertySymbols(e);l<r.length;l++)t.indexOf(r[l])<0&&Object.prototype.propertyIsEnumerable.call(e,r[l])&&(n[r[l]]=e[r[l]]);return n},Xt=e=>{var{prefixCls:t,children:n}=e,r=Bt(e,["prefixCls","children"]);const{getPrefixCls:l}=o.useContext(pe.E_),s=l("form",t),u=o.useMemo(()=>({prefixCls:s,status:"error"}),[s]);return o.createElement(oe.aV,Object.assign({},r),(c,g,d)=>o.createElement(y.Rk.Provider,{value:u},n(c.map(h=>Object.assign(Object.assign({},h),{fieldKey:h.key})),g,{errors:d.errors,warnings:d.warnings})))};function Gt(){const{form:e}=o.useContext(y.q3);return e}const U=at;U.Item=At,U.List=Xt,U.ErrorList=je,U.useForm=Me.Z,U.useFormInstance=Gt,U.useWatch=oe.qo,U.Provider=y.RV,U.create=()=>{};var Kt=U}}]);
|