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([[6928],{66197:function(Oe,de,e){e.d(de,{A:function(){return t}});var p=e(93264),i=e(73952),P=e(79685),T=e(29927),ne=e(43901),L=e(6346),U=e(89342),te=e(60190),ve=e(46501),me=e(89869),K=e(89543),X=e(27097),J=e(68591),re=e.n(J),fe=e(77204),W=e(25393),Q=e(33298),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,Q.Xj)("ProFormGroup",function(h){var Z=(0,p.Z)((0,p.Z)({},h),{},{componentCls:".".concat(m)});return[A(Z)]})}var u=e(63342),w=P.forwardRef(function(m,h){var Z=P.useContext(fe.Z),s=Z.groupProps,d=(0,p.Z)((0,p.Z)({},s),m),oe=d.children,q=d.collapsible,b=d.defaultCollapsed,De=d.style,Le=d.labelLayout,Ze=d.title,_=Ze===void 0?m.label:Ze,ye=d.tooltip,se=d.align,Ce=se===void 0?"start":se,ae=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,ee=(0,ve.Z)(function(){return b||!1},{value:m.collapsed,onChange:m.onCollapse}),Se=(0,U.Z)(ee,2),o=Se[0],y=Se[1],E=(0,P.useContext)(K.ZP.ConfigContext),V=E.getPrefixCls,C=(0,W.zx)(m),$=C.ColWrapper,ie=C.RowWrapper,S=V("pro-form-group"),Fe=R(S),We=Fe.wrapSSR,B=Fe.hashId,Pe=q&&(0,u.jsx)(te.Z,{style:{marginInlineEnd:8},rotate:o?void 0:90}),le=(0,u.jsx)(me.G,{label:Pe?(0,u.jsxs)("div",{children:[Pe,_]}):_,tooltip:ye}),G=(0,P.useCallback)(function(H){var Y=H.children;return(0,u.jsx)(X.Z,(0,p.Z)((0,p.Z)({},c),{},{className:re()("".concat(S,"-container ").concat(B),c==null?void 0:c.className),size:v,align:Ce,direction:ae,style:(0,p.Z)({rowGap:0},c==null?void 0:c.style),children:Y}))},[Ce,S,ae,B,v,c]),N=x?x(le,m):le,Ae=(0,P.useMemo)(function(){var H=[],Y=P.Children.toArray(oe).map(function(M,ue){var O;return P.isValidElement(M)&&M!==null&&M!==void 0&&(O=M.props)!==null&&O!==void 0&&O.hidden?(H.push(M),null):ue===0&&P.isValidElement(M)&&D?P.cloneElement(M,(0,p.Z)((0,p.Z)({},M.props),{},{autoFocus:D})):M});return[(0,u.jsx)(ie,{Wrapper:G,children:Y},"children"),H.length>0?(0,u.jsx)("div",{style:{display:"none"},children:H}):null]},[oe,ie,G,D]),he=(0,U.Z)(Ae,2),j=he[0],Re=he[1];return We((0,u.jsx)($,{children:(0,u.jsxs)("div",{className:re()(S,B,(0,L.Z)({},"".concat(S,"-twoLine"),Le==="twoLine")),style:De,ref:h,children:[Re,(_||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:q&&o?"none":void 0},children:j})]})}))});w.displayName="ProForm-Group";var k=w,pe=e(30825);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=k,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=ne.A},7676:function(Oe,de,e){e.d(de,{U9:function(){return se},L0:function(){return ae},bg:function(){return _}});var p=e(6346),i=e(93264),P=e(7623),T=e(64632),ne=e(57963),L=e(89342),U=e(98787),te=e(56671),ve=e(18750),me=e(97340),K=e(5745),X=e(61728),J=e(43241),re=e(89543),fe=e(91509),W=e(36642),Q=e(10951),A=e(27097),R=e(73952),u=e(68591),w=e.n(u),k=e(89259),pe=e(46501),t=e(79685),m=e(12869),h=e(30765),Z=e(29927),s=e(63342),d=["onFinish","step","formRef","title","stepProps"];function oe(l){var v=(0,t.useRef)(),n=(0,t.useContext)(_),x=(0,t.useContext)(se),c=(0,i.Z)((0,i.Z)({},l),x),z=c.onFinish,D=c.step,ee=c.formRef,Se=c.title,o=c.stepProps,y=(0,U.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)(ee,function(){return v.current},[ee==null?void 0:ee.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 q=oe,b=e(33298),De=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 Le(l){return(0,b.Xj)("StepsForm",function(v){var n=(0,i.Z)((0,i.Z)({},v),{},{componentCls:".".concat(l)});return[De(n)]})}var Ze=["current","onCurrentChange","submitter","stepsFormRender","stepsRender","stepFormRender","stepsProps","onFinish","formProps","containerStyle","formRef","formMapRef","layoutRender"],_=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})})]})}},se=t.createContext(null);function Ce(l){var v=(0,t.useContext)(re.ZP.ConfigContext),n=v.getPrefixCls,x=n("pro-steps-form"),c=Le(x),z=c.wrapSSR,D=c.hashId,ee=l.current,Se=l.onCurrentChange,o=l.submitter,y=l.stepsFormRender,E=l.stepsRender,V=l.stepFormRender,C=l.stepsProps,$=l.onFinish,ie=l.formProps,S=l.containerStyle,Fe=l.formRef,We=l.formMapRef,B=l.layoutRender,Pe=(0,U.Z)(l,Ze),le=(0,t.useRef)(new Map),G=(0,t.useRef)(new Map),N=(0,t.useRef)([]),Ae=(0,t.useState)([]),he=(0,L.Z)(Ae,2),j=he[0],Re=he[1],H=(0,t.useState)(!1),Y=(0,L.Z)(H,2),M=Y[0],ue=Y[1],O=(0,te.YB)(),Je=(0,pe.Z)(0,{value:l.current,onChange:l.onCurrentChange}),be=(0,L.Z)(Je,2),F=be[0],je=be[1],$e=(0,t.useMemo)(function(){return ye[(C==null?void 0:C.direction)||"horizontal"]},[C==null?void 0:C.direction]),Ee=(0,t.useMemo)(function(){return F===j.length-1},[j.length,F]),Ye=(0,t.useCallback)(function(r,a){G.current.has(r)||Re(function(g){return[].concat((0,ne.Z)(g),[r])}),G.current.set(r,a)},[]),Ue=(0,t.useCallback)(function(r){Re(function(a){return a.filter(function(g){return g!==r})}),G.current.delete(r),le.current.delete(r)},[]);(0,t.useImperativeHandle)(We,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(le.current.set(g,f),!(!Ee||!$)){I.next=3;break}return I.abrupt("return");case 3:return ue(!0),xe=ve.T.apply(void 0,[{}].concat((0,ne.Z)(Array.from(le.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,ue(!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)}}(),[Ee,$,ue,je]),Ne=(0,t.useMemo)(function(){var r=(0,me.n)(fe.Z,"4.24.0")>-1,a=r?{items:j.map(function(g){var f=G.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=G.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]),ce=(0,K.J)(function(){var r,a=N.current[F];(r=a.current)===null||r===void 0||r.submit()}),Me=(0,K.J)(function(){F<1||je(F-1)}),Te=(0,t.useMemo)(function(){return o!==!1&&(0,s.jsx)(Q.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),ce()},children:O.getMessage("stepsForm.next","\u4E0B\u4E00\u6B65")}),"next")},[O,M,ce,o]),ze=(0,t.useMemo)(function(){return o!==!1&&(0,s.jsx)(Q.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:O.getMessage("stepsForm.prev","\u4E0A\u4E00\u6B65")}),"pre")},[O,Me,o]),Be=(0,t.useMemo)(function(){return o!==!1&&(0,s.jsx)(Q.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),ce()},children:O.getMessage("stepsForm.submit","\u63D0\u4EA4")}),"submit")},[O,M,ce,o]),Qe=(0,K.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(Be):r.push(Te):a+1===j.length?r.push(ze,Be):r.push(ze,Te),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:ce,step:F,onPre:Me};return o.render(f,r)}return o&&(o==null?void 0:o.render)===!1?null:r},[j.length,Te,ce,ze,Me,F,Be,o]),Ve=(0,t.useMemo)(function(){return(0,k.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:w()("".concat(x,"-step"),D,(0,p.Z)({},"".concat(x,"-step-active"),xe)),children:(0,s.jsx)(se.Provider,{value:(0,i.Z)((0,i.Z)((0,i.Z)((0,i.Z)({},Ie),ie),g),{},{name:f,step:a}),children:r})},f)})},[ie,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=G.current.get(r))===null||a===void 0?void 0:a.title}}),Ne):Ne},[j,Ne,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):$e(r),ge):B?B(r):$e(r)},[He,Xe,$e,y,ge,B]);return z((0,s.jsx)("div",{className:w()(x,D),children:(0,s.jsx)(R.Z.Provider,(0,i.Z)((0,i.Z)({},Pe),{},{children:(0,s.jsx)(_.Provider,{value:{loading:M,setLoading:ue,regForm:Ye,keyArray:j,next:Qe,formArrayRef:N,formMapRef:G,lastStep:Ee,unRegForm:Ue,onFormFinish:Ke},children:we})}))}))}function ae(l){return(0,s.jsx)(te._Y,{needDeps:!0,children:(0,s.jsx)(Ce,(0,i.Z)({},l))})}ae.StepForm=q,ae.useForm=R.Z.useForm},89869:function(Oe,de,e){e.d(de,{G:function(){return Q}});var p=e(93264),i=e(6346),P=e(21137),T=e(79685),ne=e(92933),L=e(83317),U=function(R,u){return T.createElement(L.Z,(0,P.Z)({},R,{ref:u,icon:ne.Z}))},te=T.forwardRef(U),ve=e(89543),me=e(58898),K=e(68591),X=e.n(K),J=e(33298),re=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[re(u)]})}var W=e(63342),Q=T.memo(function(A){var R=A.label,u=A.tooltip,w=A.ellipsis,k=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&&!k)return(0,W.jsx)(W.Fragment,{children:R});var d=typeof u=="string"||T.isValidElement(u)?{title:u}:u,oe=(d==null?void 0:d.icon)||(0,W.jsx)(te,{});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"),w)),children:R}),k&&(0,W.jsx)("div",{className:"".concat(m,"-subtitle ").concat(s).trim(),children:k}),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:oe})}))]}))})}}]);
|
|
|