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.
1 lines
14 KiB
1 lines
14 KiB
"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[825],{9455:function(De,U){var e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"}}]},name:"info-circle",theme:"outlined"};U.Z=e},43997:function(De,U,e){e.d(U,{A:function(){return t}});var p=e(33346),i=e(67190),P=e(50959),T=e(1704),te=e(58922),L=e(73273),K=e(32682),re=e(25671),ve=e(65589),me=e(21804),Q=e(56197),X=e(75200),J=e(84875),oe=e.n(J),fe=e(54970),W=e(21510),w=e(26488),A=function(h){var Z;return(0,L.Z)({},h.componentCls,{"&-title":{marginBlockEnd:h.marginXL,fontWeight:"bold"},"&-container":(0,L.Z)({flexWrap:"wrap",maxWidth:"100%"},"> div".concat(h.antCls,"-space-item"),{maxWidth:"100%"}),"&-twoLine":(Z={display:"block",width:"100%"},(0,L.Z)(Z,"".concat(h.componentCls,"-title"),{width:"100%",margin:"8px 0"}),(0,L.Z)(Z,"".concat(h.componentCls,"-container"),{paddingInlineStart:16}),(0,L.Z)(Z,"".concat(h.antCls,"-space-item,").concat(h.antCls,"-form-item"),{width:"100%"}),(0,L.Z)(Z,"".concat(h.antCls,"-form-item"),{"&-control":{display:"flex",alignItems:"center",justifyContent:"flex-end","&-input":{alignItems:"center",justifyContent:"flex-end","&-content":{flex:"none"}}}}),Z)})};function R(m){return(0,w.Xj)("ProFormGroup",function(h){var Z=(0,p.Z)((0,p.Z)({},h),{},{componentCls:".".concat(m)});return[A(Z)]})}var u=e(11527),k=P.forwardRef(function(m,h){var Z=P.useContext(fe.Z),s=Z.groupProps,d=(0,p.Z)((0,p.Z)({},s),m),se=d.children,_=d.collapsible,b=d.defaultCollapsed,Le=d.style,We=d.labelLayout,Ze=d.title,ee=Ze===void 0?m.label:Ze,ye=d.tooltip,ae=d.align,Ce=ae===void 0?"start":ae,ie=d.direction,l=d.size,v=l===void 0?32:l,n=d.titleStyle,x=d.titleRender,c=d.spaceProps,z=d.extra,D=d.autoFocus,ne=(0,ve.Z)(function(){return b||!1},{value:m.collapsed,onChange:m.onCollapse}),Se=(0,K.Z)(ne,2),o=Se[0],y=Se[1],E=(0,P.useContext)(Q.ZP.ConfigContext),V=E.getPrefixCls,C=(0,W.zx)(m),$=C.ColWrapper,le=C.RowWrapper,S=V("pro-form-group"),Fe=R(S),Ae=Fe.wrapSSR,B=Fe.hashId,Pe=_&&(0,u.jsx)(re.Z,{style:{marginInlineEnd:8},rotate:o?void 0:90}),ue=(0,u.jsx)(me.G,{label:Pe?(0,u.jsxs)("div",{children:[Pe,ee]}):ee,tooltip:ye}),O=(0,P.useCallback)(function(H){var Y=H.children;return(0,u.jsx)(X.Z,(0,p.Z)((0,p.Z)({},c),{},{className:oe()("".concat(S,"-container ").concat(B),c==null?void 0:c.className),size:v,align:Ce,direction:ie,style:(0,p.Z)({rowGap:0},c==null?void 0:c.style),children:Y}))},[Ce,S,ie,B,v,c]),N=x?x(ue,m):ue,$e=(0,P.useMemo)(function(){var H=[],Y=P.Children.toArray(se).map(function(M,ce){var G;return P.isValidElement(M)&&M!==null&&M!==void 0&&(G=M.props)!==null&&G!==void 0&&G.hidden?(H.push(M),null):ce===0&&P.isValidElement(M)&&D?P.cloneElement(M,(0,p.Z)((0,p.Z)({},M.props),{},{autoFocus:D})):M});return[(0,u.jsx)(le,{Wrapper:O,children:Y},"children"),H.length>0?(0,u.jsx)("div",{style:{display:"none"},children:H}):null]},[se,le,O,D]),he=(0,K.Z)($e,2),j=he[0],Re=he[1];return Ae((0,u.jsx)($,{children:(0,u.jsxs)("div",{className:oe()(S,B,(0,L.Z)({},"".concat(S,"-twoLine"),We==="twoLine")),style:Le,ref:h,children:[Re,(ee||ye||z)&&(0,u.jsx)("div",{className:"".concat(S,"-title ").concat(B).trim(),style:n,onClick:function(){y(!o)},children:z?(0,u.jsxs)("div",{style:{display:"flex",width:"100%",alignItems:"center",justifyContent:"space-between"},children:[N,(0,u.jsx)("span",{onClick:function(Y){return Y.stopPropagation()},children:z})]}):N}),(0,u.jsx)("div",{style:{display:_&&o?"none":void 0},children:j})]})}))});k.displayName="ProForm-Group";var q=k,pe=e(75693);function t(m){return(0,u.jsx)(T.I,(0,p.Z)({layout:"vertical",submitter:{render:function(Z,s){return s.reverse()}},contentRender:function(Z,s){return(0,u.jsxs)(u.Fragment,{children:[Z,s]})}},m))}t.Group=q,t.useForm=i.Z.useForm,t.Item=pe.Z,t.useWatch=i.Z.useWatch,t.ErrorList=i.Z.ErrorList,t.Provider=i.Z.Provider,t.useFormInstance=i.Z.useFormInstance,t.EditOrReadOnlyContext=te.A},76791:function(De,U,e){e.d(U,{U9:function(){return ae},L0:function(){return ie},bg:function(){return ee}});var p=e(73273),i=e(33346),P=e(3224),T=e(47801),te=e(1788),L=e(32682),K=e(10570),re=e(17122),ve=e(94204),me=e(11175),Q=e(13165),X=e(23870),J=e(82099),oe=e(56197),fe=e(63945),W=e(27575),w=e(47100),A=e(75200),R=e(67190),u=e(84875),k=e.n(u),q=e(13763),pe=e(65589),t=e(50959),m=e(71770),h=e(12868),Z=e(1704),s=e(11527),d=["onFinish","step","formRef","title","stepProps"];function se(l){var v=(0,t.useRef)(),n=(0,t.useContext)(ee),x=(0,t.useContext)(ae),c=(0,i.Z)((0,i.Z)({},l),x),z=c.onFinish,D=c.step,ne=c.formRef,Se=c.title,o=c.stepProps,y=(0,K.Z)(c,d);return(0,h.ET)(!y.submitter,"StepForm \u4E0D\u5305\u542B\u63D0\u4EA4\u6309\u94AE\uFF0C\u8BF7\u5728 StepsForm \u4E0A"),(0,t.useImperativeHandle)(ne,function(){return v.current},[ne==null?void 0:ne.current]),(0,t.useEffect)(function(){if(c.name||c.step){var E=(c.name||c.step).toString();return n==null||n.regForm(E,c),function(){n==null||n.unRegForm(E)}}},[]),n&&n!==null&&n!==void 0&&n.formArrayRef&&(n.formArrayRef.current[D||0]=v),(0,s.jsx)(Z.I,(0,i.Z)({formRef:v,onFinish:function(){var E=(0,T.Z)((0,P.Z)().mark(function V(C){var $;return(0,P.Z)().wrap(function(S){for(;;)switch(S.prev=S.next){case 0:if(y.name&&(n==null||n.onFormFinish(y.name,C)),!z){S.next=9;break}return n==null||n.setLoading(!0),S.next=5,z==null?void 0:z(C);case 5:return $=S.sent,$&&(n==null||n.next()),n==null||n.setLoading(!1),S.abrupt("return");case 9:n!=null&&n.lastStep||n==null||n.next();case 10:case"end":return S.stop()}},V)}));return function(V){return E.apply(this,arguments)}}(),onInit:function(V,C){var $;v.current=C,n&&n!==null&&n!==void 0&&n.formArrayRef&&(n.formArrayRef.current[D||0]=v),y==null||($=y.onInit)===null||$===void 0||$.call(y,V,C)},layout:"vertical"},(0,m.Z)(y,["layoutType","columns"])))}var _=se,b=e(26488),Le=function(v){return(0,p.Z)({},v.componentCls,{"&-container":{width:"max-content",minWidth:"420px",maxWidth:"100%",margin:"auto"},"&-steps-container":(0,p.Z)({maxWidth:"1160px",margin:"auto"},"".concat(v.antCls,"-steps-vertical"),{height:"100%"}),"&-step":{display:"none",marginBlockStart:"32px","&-active":{display:"block"},"> form":{maxWidth:"100%"}}})};function We(l){return(0,b.Xj)("StepsForm",function(v){var n=(0,i.Z)((0,i.Z)({},v),{},{componentCls:".".concat(l)});return[Le(n)]})}var Ze=["current","onCurrentChange","submitter","stepsFormRender","stepsRender","stepFormRender","stepsProps","onFinish","formProps","containerStyle","formRef","formMapRef","layoutRender"],ee=t.createContext(void 0),ye={horizontal:function(v){var n=v.stepsDom,x=v.formDom;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(X.Z,{gutter:{xs:8,sm:16,md:24},children:(0,s.jsx)(J.Z,{span:24,children:n})}),(0,s.jsx)(X.Z,{gutter:{xs:8,sm:16,md:24},children:(0,s.jsx)(J.Z,{span:24,children:x})})]})},vertical:function(v){var n=v.stepsDom,x=v.formDom;return(0,s.jsxs)(X.Z,{align:"stretch",wrap:!0,gutter:{xs:8,sm:16,md:24},children:[(0,s.jsx)(J.Z,{xxl:4,xl:6,lg:7,md:8,sm:10,xs:12,children:t.cloneElement(n,{style:{height:"100%"}})}),(0,s.jsx)(J.Z,{children:(0,s.jsx)("div",{style:{display:"flex",alignItems:"center",width:"100%",height:"100%"},children:x})})]})}},ae=t.createContext(null);function Ce(l){var v=(0,t.useContext)(oe.ZP.ConfigContext),n=v.getPrefixCls,x=n("pro-steps-form"),c=We(x),z=c.wrapSSR,D=c.hashId,ne=l.current,Se=l.onCurrentChange,o=l.submitter,y=l.stepsFormRender,E=l.stepsRender,V=l.stepFormRender,C=l.stepsProps,$=l.onFinish,le=l.formProps,S=l.containerStyle,Fe=l.formRef,Ae=l.formMapRef,B=l.layoutRender,Pe=(0,K.Z)(l,Ze),ue=(0,t.useRef)(new Map),O=(0,t.useRef)(new Map),N=(0,t.useRef)([]),$e=(0,t.useState)([]),he=(0,L.Z)($e,2),j=he[0],Re=he[1],H=(0,t.useState)(!1),Y=(0,L.Z)(H,2),M=Y[0],ce=Y[1],G=(0,re.YB)(),Je=(0,pe.Z)(0,{value:l.current,onChange:l.onCurrentChange}),be=(0,L.Z)(Je,2),F=be[0],je=be[1],Ee=(0,t.useMemo)(function(){return ye[(C==null?void 0:C.direction)||"horizontal"]},[C==null?void 0:C.direction]),Ne=(0,t.useMemo)(function(){return F===j.length-1},[j.length,F]),Ye=(0,t.useCallback)(function(r,a){O.current.has(r)||Re(function(g){return[].concat((0,te.Z)(g),[r])}),O.current.set(r,a)},[]),Ue=(0,t.useCallback)(function(r){Re(function(a){return a.filter(function(g){return g!==r})}),O.current.delete(r),ue.current.delete(r)},[]);(0,t.useImperativeHandle)(Ae,function(){return N.current},[N.current]),(0,t.useImperativeHandle)(Fe,function(){var r;return(r=N.current[F||0])===null||r===void 0?void 0:r.current},[F,N.current]);var Ke=(0,t.useCallback)(function(){var r=(0,T.Z)((0,P.Z)().mark(function a(g,f){var xe,Ie;return(0,P.Z)().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:if(ue.current.set(g,f),!(!Ne||!$)){I.next=3;break}return I.abrupt("return");case 3:return ce(!0),xe=ve.T.apply(void 0,[{}].concat((0,te.Z)(Array.from(ue.current.values())))),I.prev=5,I.next=8,$(xe);case 8:Ie=I.sent,Ie&&(je(0),N.current.forEach(function(ke){var Ge;return(Ge=ke.current)===null||Ge===void 0?void 0:Ge.resetFields()})),I.next=15;break;case 12:I.prev=12,I.t0=I.catch(5),console.log(I.t0);case 15:return I.prev=15,ce(!1),I.finish(15);case 18:case"end":return I.stop()}},a,null,[[5,12,15,18]])}));return function(a,g){return r.apply(this,arguments)}}(),[Ne,$,ce,je]),Te=(0,t.useMemo)(function(){var r=(0,me.n)(fe.Z,"4.24.0")>-1,a=r?{items:j.map(function(g){var f=O.current.get(g);return(0,i.Z)({key:g,title:f==null?void 0:f.title},f==null?void 0:f.stepProps)})}:{};return(0,s.jsx)("div",{className:"".concat(x,"-steps-container ").concat(D).trim(),style:{maxWidth:Math.min(j.length*320,1160)},children:(0,s.jsx)(W.Z,(0,i.Z)((0,i.Z)((0,i.Z)({},C),a),{},{current:F,onChange:void 0,children:!r&&j.map(function(g){var f=O.current.get(g);return(0,s.jsx)(W.Z.Step,(0,i.Z)({title:f==null?void 0:f.title},f==null?void 0:f.stepProps),g)})}))})},[j,D,x,F,C]),de=(0,Q.J)(function(){var r,a=N.current[F];(r=a.current)===null||r===void 0||r.submit()}),Me=(0,Q.J)(function(){F<1||je(F-1)}),ze=(0,t.useMemo)(function(){return o!==!1&&(0,s.jsx)(w.ZP,(0,i.Z)((0,i.Z)({type:"primary",loading:M},o==null?void 0:o.submitButtonProps),{},{onClick:function(){var a;o==null||(a=o.onSubmit)===null||a===void 0||a.call(o),de()},children:G.getMessage("stepsForm.next","\u4E0B\u4E00\u6B65")}),"next")},[G,M,de,o]),Be=(0,t.useMemo)(function(){return o!==!1&&(0,s.jsx)(w.ZP,(0,i.Z)((0,i.Z)({},o==null?void 0:o.resetButtonProps),{},{onClick:function(){var a;Me(),o==null||(a=o.onReset)===null||a===void 0||a.call(o)},children:G.getMessage("stepsForm.prev","\u4E0A\u4E00\u6B65")}),"pre")},[G,Me,o]),Oe=(0,t.useMemo)(function(){return o!==!1&&(0,s.jsx)(w.ZP,(0,i.Z)((0,i.Z)({type:"primary",loading:M},o==null?void 0:o.submitButtonProps),{},{onClick:function(){var a;o==null||(a=o.onSubmit)===null||a===void 0||a.call(o),de()},children:G.getMessage("stepsForm.submit","\u63D0\u4EA4")}),"submit")},[G,M,de,o]),Qe=(0,Q.J)(function(){F>j.length-2||je(F+1)}),ge=(0,t.useMemo)(function(){var r=[],a=F||0;if(a<1?j.length===1?r.push(Oe):r.push(ze):a+1===j.length?r.push(Be,Oe):r.push(Be,ze),r=r.filter(t.isValidElement),o&&o.render){var g,f={form:(g=N.current[F])===null||g===void 0?void 0:g.current,onSubmit:de,step:F,onPre:Me};return o.render(f,r)}return o&&(o==null?void 0:o.render)===!1?null:r},[j.length,ze,de,Be,Me,F,Oe,o]),Ve=(0,t.useMemo)(function(){return(0,q.Z)(l.children).map(function(r,a){var g=r.props,f=g.name||"".concat(a),xe=F===a,Ie=xe?{contentRender:V,submitter:!1}:{};return(0,s.jsx)("div",{className:k()("".concat(x,"-step"),D,(0,p.Z)({},"".concat(x,"-step-active"),xe)),children:(0,s.jsx)(ae.Provider,{value:(0,i.Z)((0,i.Z)((0,i.Z)((0,i.Z)({},Ie),le),g),{},{name:f,step:a}),children:r})},f)})},[le,D,x,l.children,F,V]),He=(0,t.useMemo)(function(){return E?E(j.map(function(r){var a;return{key:r,title:(a=O.current.get(r))===null||a===void 0?void 0:a.title}}),Te):Te},[j,Te,E]),Xe=(0,t.useMemo)(function(){return(0,s.jsxs)("div",{className:"".concat(x,"-container ").concat(D).trim(),style:S,children:[Ve,y?null:(0,s.jsx)(A.Z,{children:ge})]})},[S,Ve,D,x,y,ge]),we=(0,t.useMemo)(function(){var r={stepsDom:He,formDom:Xe};return y?y(B?B(r):Ee(r),ge):B?B(r):Ee(r)},[He,Xe,Ee,y,ge,B]);return z((0,s.jsx)("div",{className:k()(x,D),children:(0,s.jsx)(R.Z.Provider,(0,i.Z)((0,i.Z)({},Pe),{},{children:(0,s.jsx)(ee.Provider,{value:{loading:M,setLoading:ce,regForm:Ye,keyArray:j,next:Qe,formArrayRef:N,formMapRef:O,lastStep:Ne,unRegForm:Ue,onFormFinish:Ke},children:we})}))}))}function ie(l){return(0,s.jsx)(re._Y,{needDeps:!0,children:(0,s.jsx)(Ce,(0,i.Z)({},l))})}ie.StepForm=_,ie.useForm=R.Z.useForm},21804:function(De,U,e){e.d(U,{G:function(){return w}});var p=e(33346),i=e(73273),P=e(38126),T=e(50959),te=e(9455),L=e(38782),K=function(R,u){return T.createElement(L.Z,(0,P.Z)({},R,{ref:u,icon:te.Z}))},re=T.forwardRef(K),ve=e(56197),me=e(32618),Q=e(84875),X=e.n(Q),J=e(26488),oe=function(R){return(0,i.Z)({},R.componentCls,{display:"inline-flex",alignItems:"center",maxWidth:"100%","&-icon":{display:"block",marginInlineStart:"4px",cursor:"pointer","&:hover":{color:R.colorPrimary}},"&-title":{display:"inline-flex",flex:"1"},"&-subtitle ":{marginInlineStart:8,color:R.colorTextSecondary,fontWeight:"normal",fontSize:R.fontSize,whiteSpace:"nowrap"},"&-title-ellipsis":{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",wordBreak:"keep-all"}})};function fe(A){return(0,J.Xj)("LabelIconTip",function(R){var u=(0,p.Z)((0,p.Z)({},R),{},{componentCls:".".concat(A)});return[oe(u)]})}var W=e(11527),w=T.memo(function(A){var R=A.label,u=A.tooltip,k=A.ellipsis,q=A.subTitle,pe=(0,T.useContext)(ve.ZP.ConfigContext),t=pe.getPrefixCls,m=t("pro-core-label-tip"),h=fe(m),Z=h.wrapSSR,s=h.hashId;if(!u&&!q)return(0,W.jsx)(W.Fragment,{children:R});var d=typeof u=="string"||T.isValidElement(u)?{title:u}:u,se=(d==null?void 0:d.icon)||(0,W.jsx)(re,{});return Z((0,W.jsxs)("div",{className:X()(m,s),onMouseDown:function(b){return b.stopPropagation()},onMouseLeave:function(b){return b.stopPropagation()},onMouseMove:function(b){return b.stopPropagation()},children:[(0,W.jsx)("div",{className:X()("".concat(m,"-title"),s,(0,i.Z)({},"".concat(m,"-title-ellipsis"),k)),children:R}),q&&(0,W.jsx)("div",{className:"".concat(m,"-subtitle ").concat(s).trim(),children:q}),u&&(0,W.jsx)(me.Z,(0,p.Z)((0,p.Z)({},d),{},{children:(0,W.jsx)("span",{className:"".concat(m,"-icon ").concat(s).trim(),children:se})}))]}))})}}]);
|
|
|