18 lines
21 KiB
JavaScript
18 lines
21 KiB
JavaScript
|
|
(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[960],{60960:function(oe,A,i){"use strict";i.d(A,{Z:function(){return $t}});var o=i(67294),N=i(74902),_=i(86548),re=i(93967),B=i.n(re),E=i(9220),v=i(50344),x=i(8410),z=i(21770),se=i(98423),ee=i(42550),F=i(79370),S=i(53124),le=i(10110),ie=i(83062),Z=i(9957),te=i(15105),ze=i(96159),Fe=i(2961),Pe=i(14747),Ve=i(83559),Ke=i(84898);const Xe=(e,n,r,t)=>{const{titleMarginBottom:s,fontWeightStrong:a}=t;return{marginBottom:s,color:r,fontWeight:a,fontSize:e,lineHeight:n}},Ge=e=>{const n=[1,2,3,4,5],r={};return n.forEach(t=>{r[`
|
||
|
|
h${t}&,
|
||
|
|
div&-h${t},
|
||
|
|
div&-h${t} > textarea,
|
||
|
|
h${t}
|
||
|
|
`]=Xe(e[`fontSizeHeading${t}`],e[`lineHeightHeading${t}`],e.colorTextHeading,e)}),r},Je=e=>{const{componentCls:n}=e;return{"a&, a":Object.assign(Object.assign({},(0,Pe.Nd)(e)),{userSelect:"text",[`&[disabled], &${n}-disabled`]:{color:e.colorTextDisabled,cursor:"not-allowed","&:active, &:hover":{color:e.colorTextDisabled},"&:active":{pointerEvents:"none"}}})}},Qe=e=>({code:{margin:"0 0.2em",paddingInline:"0.4em",paddingBlock:"0.2em 0.1em",fontSize:"85%",fontFamily:e.fontFamilyCode,background:"rgba(150, 150, 150, 0.1)",border:"1px solid rgba(100, 100, 100, 0.2)",borderRadius:3},kbd:{margin:"0 0.2em",paddingInline:"0.4em",paddingBlock:"0.15em 0.1em",fontSize:"90%",fontFamily:e.fontFamilyCode,background:"rgba(150, 150, 150, 0.06)",border:"1px solid rgba(100, 100, 100, 0.2)",borderBottomWidth:2,borderRadius:3},mark:{padding:0,backgroundColor:Ke.gold[2]},"u, ins":{textDecoration:"underline",textDecorationSkipInk:"auto"},"s, del":{textDecoration:"line-through"},strong:{fontWeight:e.fontWeightStrong},"ul, ol":{marginInline:0,marginBlock:"0 1em",padding:0,li:{marginInline:"20px 0",marginBlock:0,paddingInline:"4px 0",paddingBlock:0}},ul:{listStyleType:"circle",ul:{listStyleType:"disc"}},ol:{listStyleType:"decimal"},"pre, blockquote":{margin:"1em 0"},pre:{padding:"0.4em 0.6em",whiteSpace:"pre-wrap",wordWrap:"break-word",background:"rgba(150, 150, 150, 0.1)",border:"1px solid rgba(100, 100, 100, 0.2)",borderRadius:3,fontFamily:e.fontFamilyCode,code:{display:"inline",margin:0,padding:0,fontSize:"inherit",fontFamily:"inherit",background:"transparent",border:0}},blockquote:{paddingInline:"0.6em 0",paddingBlock:0,borderInlineStart:"4px solid rgba(100, 100, 100, 0.2)",opacity:.85}}),Ye=e=>{const{componentCls:n,paddingSM:r}=e,t=r;return{"&-edit-content":{position:"relative","div&":{insetInlineStart:e.calc(e.paddingSM).mul(-1).equal(),insetBlockStart:e.calc(t).div(-2).add(1).equal(),marginBottom:e.calc(t).div(2).sub(2).equal()},[`${n}-edit-content-confirm`]:{position:"absolute",insetInlineEnd:e.calc(e.marginXS).add(2).equal(),insetBlockEnd:e.marginXS,color:e.colorIcon,fontWeight:"normal",fontSize:e.fontSize,fontStyle:"normal",pointerEvents:"none"},textarea:{margin:"0!important",MozTransition:"none",height:"1em"}}}},qe=e=>({[`${e.componentCls}-copy-success`]:{"\n &,\n &:hover,\n &:focus":{color:e.colorSuccess}},[`${e.componentCls}-copy-icon-only`]:{marginInlineStart:0}}),_e=()=>({"\n a&-ellipsis,\n span&-ellipsis\n ":{display:"inline-block",maxWidth:"100%"},"&-ellipsis-single-line":{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis","a&, span&":{verticalAlign:"bottom"},"> code":{paddingBlock:0,maxWidth:"calc(100% - 1.2em)",display:"inline-block",overflow:"hidden",textOverflow:"ellipsis",verticalAlign:"bottom",boxSizing:"content-box"}},"&-ellipsis-multiple-line":{display:"-webkit-box",overflow:"hidden",WebkitLineClamp:3,WebkitBoxOrient:"vertical"}}),et=e=>{const{componentCls:n,titleMarginTop:r}=e;return{[n]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({color:e.colorText,wordBreak:"break-word",lineHeight:e.lineHeight,[`&${n}-secondary`]:{color:e.colorTextDescription},[`&${n}-success`]:{color:e.colorSuccessText},[`&${n}-warning`]:{color:e.colorWarningText},[`&${n}-danger`]:{color:e.colorErrorText,"a&:active, a&:focus":{color:e.colorErrorTextActive},"a&:hover":{color:e.colorErrorTextHover}},[`&${n}-disabled`]:{color:e.colorTextDisabled,cursor:"not-allowed",userSelect:"none"},"\n div&,\n p\n ":{marginBottom:"1em"}},Ge(e)),{[`
|
||
|
|
& + h1${n},
|
||
|
|
& + h2${n},
|
||
|
|
& + h3${n},
|
||
|
|
& + h4${n},
|
||
|
|
& + h5${n}
|
||
|
|
`]:{marginTop:r},"\n div,\n ul,\n li,\n p,\n h1,\n h2,\n h3,\n h4,\n h5":{"\n + h1,\n + h2,\n + h3,\n + h4,\n + h5\n ":{marginTop:r}}}),Qe(e)),Je(e)),{[`
|
||
|
|
${n}-expand,
|
||
|
|
${n}-collapse,
|
||
|
|
${n}-edit,
|
||
|
|
${n}-copy
|
||
|
|
`]:Object.assign(Object.assign({},(0,Pe.Nd)(e)),{marginInlineStart:e.marginXXS})}),Ye(e)),qe(e)),_e()),{"&-rtl":{direction:"rtl"}})}},tt=()=>({titleMarginTop:"1.2em",titleMarginBottom:"0.5em"});var Le=(0,Ve.I$)("Typography",et,tt),nt=e=>{const{prefixCls:n,"aria-label":r,className:t,style:s,direction:a,maxLength:g,autoSize:C=!0,value:c,onSave:u,onCancel:p,onEnd:b,component:f,enterIcon:I=o.createElement(Z.Z,null)}=e,P=o.useRef(null),L=o.useRef(!1),H=o.useRef(null),[m,W]=o.useState(c);o.useEffect(()=>{W(c)},[c]),o.useEffect(()=>{var y;if(!((y=P.current)===null||y===void 0)&&y.resizableTextArea){const{textArea:T}=P.current.resizableTextArea;T.focus();const{length:O}=T.value;T.setSelectionRange(O,O)}},[]);const J=({target:y})=>{W(y.value.replace(/[\n\r]/g,""))},w=()=>{L.current=!0},R=()=>{L.current=!1},D=({keyCode:y})=>{L.current||(H.current=y)},h=()=>{u(m.trim())},Q=({keyCode:y,ctrlKey:T,altKey:O,metaKey:X,shiftKey:$})=>{H.current!==y||L.current||T||O||X||$||(y===te.Z.ENTER?(h(),b==null||b()):y===te.Z.ESC&&p())},ce=()=>{h()},[ne,V,ue]=Le(n),K=B()(n,`${n}-edit-content`,{[`${n}-rtl`]:a==="rtl",[`${n}-${f}`]:!!f},t,V,ue);return ne(o.createElement("div",{className:K,style:s},o.createElement(Fe.Z,{ref:P,maxLength:g,value:m,onChange:J,onKeyDown:D,onKeyUp:Q,onCompositionStart:w,onCompositionEnd:R,onBlur:ce,"aria-label":r,rows:1,autoSize:C}),I!==null?(0,ze.Tm)(I,{className:`${n}-edit-content-confirm`}):null))},ot=i(20640),rt=i.n(ot),st=i(66680),lt=(e,n=!1)=>n&&e==null?[]:Array.isArray(e)?e:[e],it=function(e,n,r,t){function s(a){return a instanceof r?a:new r(function(g){g(a)})}return new(r||(r=Promise))(function(a,g){function C(p){try{u(t.next(p))}catch(b){g(b)}}function c(p){try{u(t.throw(p))}catch(b){g(b)}}function u(p){p.done?a(p.value):s(p.value).then(C,c)}u((t=t.apply(e,n||[])).next())})},at=({copyConfig:e,children:n})=>{const[r,t]=o.useState(!1),[s,a]=o.useState(!1),g=o.useRef(null),C=()=>{g.current&&clearTimeout(g.current)},c={};e.format&&(c.format=e.format),o.useEffect(()=>C,[]);const u=(0,st.Z)(p=>it(void 0,void 0,void 0,function*(){var b;p==null||p.preventDefault(),p==null||p.stopPropagation(),a(!0);try{const f=typeof e.text=="function"?yield e.text():e.text;rt()(f||lt(n,!0).join("")||"",c),a(!1),t(!0),C(),g.current=setTimeout(()=>{t(!1)},3e3),(b=e.onCopy)===null||b===void 0||b.call(e,p)}catch(f){throw a(!1),f}}));return{copied:r,copyLoading:s,onClick:u}};function be(e,n){return o.useMemo(()=>{const r=!!e;return[r,Object.assign(Object.assign({},n),r&&typeof e=="object"?e:null)]},[e])}var ct=e=>{const n=(0,o.useRef)(void 0);return(0,o.useEffect)(()=>{n.current=e}),n.current},ut=(e,n,r)=>(0,o.useMemo)(()=>e===!0?{title:n!=null?n:r}:(0,o.isValidElement)(e)?{title:e}:typeof e=="object"?Object.assign({title:n!=null?n:r},e):{title:e},[e,n,r]),dt=function(e,n){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(r[t]=e[t]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,t=Object.getOwnPropertySymbols(e);s<t.length;s++)n.indexOf(t[s])<0&&Object.prototype.propertyIsEnumerable.call(e,t[s])&&(r[t[s]]=e[t[s]]);return r},$e=o.forwardRef((e,n)=>{const{prefixCls:r,component:t="article",className:s,rootClassName:a,setContentRef:g,children:C,direction:c,style:u}=e,p=dt(e,["prefixCls","component","className","rootClassName","setContentRef","children","direction","style"]),{getPrefixCls:b,direction:f,className:I,style:P}=(0,S.dj)("typography"),L=c!=null?c:f,H=g?(0,ee.sQ)(n,g):n,m=b("typography",r),[W,J,w]=Le(m),R=B()(m,I,{[`${m}-rtl`]:L==="rtl"},s,a,J,w),D=Object.assign(Object.assign({},P),u);return W(o.createElement(t,Object.assign({className:R,style:D,ref:H},p),C))}),pt=i(63606),ft=i(57132),mt=i(50888);function Ae(e){return e===!1?[!1,!1]:Array.isArray(e)?e:[e]}function Ee(e,n,r){return e===!0||e===void 0?n:e||r&&n}function gt(e){const n=document.createElement("em");e.appendChild(n);const r=e.getBoundingClientRect(),t=n.getBoundingClientRect();return e.removeChild(n),r.left>t.left||t.right>r.right||r.top>t.top||t.bottom>r.bottom}const he=e=>["string","number"].includes(typeof e);
|