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 line
11 KiB
1 line
11 KiB
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[2021],{17178:function(e,t,n){n.d(t,{Z:function(){return D}});var a=n(33614),r=n(59301),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3z"}}]},name:"star",theme:"filled"},l=n(1393),c=function(e,t){return r.createElement(l.Z,(0,a.Z)({},e,{ref:t,icon:o}))};var i=r.forwardRef(c),s=n(92310),u=n.n(s),f=n(24018),d=n(54099),m=n(63011),v=n(71366),p=n(20287),g=n(47413);function h(e,t){var n=e.disabled,a=e.prefixCls,o=e.character,l=e.characterRender,c=e.index,i=e.count,s=e.value,f=e.allowHalf,d=e.focused,m=e.onHover,v=e.onClick,g=c+1,h=new Set([a]);0===s&&0===c&&d?h.add("".concat(a,"-focused")):f&&s+.5>=g&&s<g?(h.add("".concat(a,"-half")),h.add("".concat(a,"-active")),d&&h.add("".concat(a,"-focused"))):(g<=s?h.add("".concat(a,"-full")):h.add("".concat(a,"-zero")),g===s&&d&&h.add("".concat(a,"-focused")));var b="function"==typeof o?o(e):o,y=r.createElement("li",{className:u()(Array.from(h)),ref:t},r.createElement("div",{onClick:n?null:function(e){v(e,c)},onKeyDown:n?null:function(e){e.keyCode===p.Z.ENTER&&v(e,c)},onMouseMove:n?null:function(e){m(e,c)},role:"radio","aria-checked":s>c?"true":"false","aria-posinset":c+1,"aria-setsize":i,tabIndex:n?-1:0},r.createElement("div",{className:"".concat(a,"-first")},b),r.createElement("div",{className:"".concat(a,"-second")},b)));return l&&(y=l(y,e)),y}var b=r.forwardRef(h);var y=["prefixCls","className","defaultValue","value","count","allowHalf","allowClear","character","characterRender","disabled","direction","tabIndex","autoFocus","onHoverChange","onChange","onFocus","onBlur","onKeyDown","onMouseLeave"];function S(e,t){var n,o,l=e.prefixCls,c=void 0===l?"rc-rate":l,i=e.className,s=e.defaultValue,h=e.value,S=e.count,C=void 0===S?5:S,x=e.allowHalf,E=void 0!==x&&x,w=e.allowClear,$=void 0===w||w,O=e.character,Z=void 0===O?"★":O,N=e.characterRender,H=e.disabled,j=e.direction,k=void 0===j?"ltr":j,R=e.tabIndex,D=void 0===R?0:R,z=e.autoFocus,I=e.onHoverChange,F=e.onChange,M=e.onFocus,T=e.onBlur,L=e.onKeyDown,B=e.onMouseLeave,X=(0,m.Z)(e,y),P=(o=r.useRef({}),[function(e){return o.current[e]},function(e){return function(t){o.current[e]=t}}]),W=(0,d.Z)(P,2),K=W[0],A=W[1],G=r.useRef(null),V=function(){var e;H||(null===(e=G.current)||void 0===e||e.focus())};r.useImperativeHandle(t,(function(){return{focus:V,blur:function(){var e;H||(null===(e=G.current)||void 0===e||e.blur())}}}));var _=(0,v.Z)(s||0,{value:h}),Y=(0,d.Z)(_,2),q=Y[0],J=Y[1],Q=(0,v.Z)(null),U=(0,d.Z)(Q,2),ee=U[0],te=U[1],ne=function(e,t){var n,a,r,o,l="rtl"===k,c=e+1;if(E){var i=K(e),s=(a=function(e){var t,n,a=e.ownerDocument,r=a.body,o=a&&a.documentElement,l=e.getBoundingClientRect();return t=l.left,n=l.top,{left:t-=o.clientLeft||r.clientLeft||0,top:n-=o.clientTop||r.clientTop||0}}(n=i),r=n.ownerDocument,o=r.defaultView||r.parentWindow,a.left+=function(e){var t=e.pageXOffset,n="scrollLeft";if("number"!=typeof t){var a=e.document;"number"!=typeof(t=a.documentElement[n])&&(t=a.body[n])}return t}(o),a.left),u=i.clientWidth;(l&&t-s>u/2||!l&&t-s<u/2)&&(c-=.5)}return c},ae=function(e){J(e),null==F||F(e)},re=r.useState(!1),oe=(0,d.Z)(re,2),le=oe[0],ce=oe[1],ie=r.useState(null),se=(0,d.Z)(ie,2),ue=se[0],fe=se[1],de=function(e,t){var n=ne(t,e.pageX);n!==ee&&(fe(n),te(null)),null==I||I(n)},me=function(e){H||(fe(null),te(null),null==I||I(void 0)),e&&(null==B||B(e))},ve=function(e,t){var n=ne(t,e.pageX),a=!1;$&&(a=n===q),me(),ae(a?0:n),te(a?n:null)};r.useEffect((function(){z&&!H&&V()}),[]);var pe=new Array(C).fill(0).map((function(e,t){return r.createElement(b,{ref:A(t),index:t,count:C,disabled:H,prefixCls:"".concat(c,"-star"),allowHalf:E,value:null===ue?q:ue,onClick:ve,onHover:de,key:e||t,character:Z,characterRender:N,focused:le})})),ge=u()(c,i,(n={},(0,f.Z)(n,"".concat(c,"-disabled"),H),(0,f.Z)(n,"".concat(c,"-rtl"),"rtl"===k),n));return r.createElement("ul",(0,a.Z)({className:ge,onMouseLeave:me,tabIndex:H?-1:D,onFocus:H?null:function(){ce(!0),null==M||M()},onBlur:H?null:function(){ce(!1),null==T||T()},onKeyDown:H?null:function(e){var t=e.keyCode,n="rtl"===k,a=q;t===p.Z.RIGHT&&a<C&&!n?(ae(a+=E?.5:1),e.preventDefault()):t===p.Z.LEFT&&a>0&&!n||t===p.Z.RIGHT&&a>0&&n?(ae(a-=E?.5:1),e.preventDefault()):t===p.Z.LEFT&&a<C&&n&&(ae(a+=E?.5:1),e.preventDefault()),null==L||L(e)},ref:G,role:"radiogroup"},(0,g.Z)(X,{aria:!0,data:!0,attr:!0})),pe)}var C=r.forwardRef(S),x=n(36355),E=n(6848),w=n(17313),$=n(83116),O=n(37613);const Z=e=>{const{componentCls:t}=e;return{[`${t}-star`]:{position:"relative",display:"inline-block",color:"inherit",cursor:"pointer","&:not(:last-child)":{marginInlineEnd:e.marginXS},"> div":{transition:`all ${e.motionDurationMid}, outline 0s`,"&:hover":{transform:e.starHoverScale},"&:focus":{outline:0},"&:focus-visible":{outline:`${e.lineWidth}px dashed ${e.starColor}`,transform:e.starHoverScale}},"&-first, &-second":{color:e.starBg,transition:`all ${e.motionDurationMid}`,userSelect:"none",[e.iconCls]:{verticalAlign:"middle"}},"&-first":{position:"absolute",top:0,insetInlineStart:0,width:"50%",height:"100%",overflow:"hidden",opacity:0},[`&-half ${t}-star-first, &-half ${t}-star-second`]:{opacity:1},[`&-half ${t}-star-first, &-full ${t}-star-second`]:{color:"inherit"}}}},N=e=>({[`&-rtl${e.componentCls}`]:{direction:"rtl"}}),H=e=>{const{componentCls:t}=e;return{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,w.Wf)(e)),{display:"inline-block",margin:0,padding:0,color:e.starColor,fontSize:e.starSize,lineHeight:"unset",listStyle:"none",outline:"none",[`&-disabled${t} ${t}-star`]:{cursor:"default","> div:hover":{transform:"scale(1)"}}}),Z(e)),{[`+ ${t}-text`]:{display:"inline-block",marginInlineStart:e.marginXS,fontSize:e.fontSize}}),N(e))}};var j=(0,$.Z)("Rate",(e=>{const t=(0,O.TS)(e,{});return[H(t)]}),(e=>({starColor:e.yellow6,starSize:.5*e.controlHeightLG,starHoverScale:"scale(1.1)",starBg:e.colorFillContent}))),k=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(n[a[r]]=e[a[r]])}return n};const R=r.forwardRef(((e,t)=>{const{prefixCls:n,className:a,rootClassName:o,style:l,tooltips:c,character:s=r.createElement(i,null)}=e,f=k(e,["prefixCls","className","rootClassName","style","tooltips","character"]),{getPrefixCls:d,direction:m,rate:v}=r.useContext(x.E_),p=d("rate",n),[g,h]=j(p),b=Object.assign(Object.assign({},null==v?void 0:v.style),l);return g(r.createElement(C,Object.assign({ref:t,character:s,characterRender:(e,t)=>{let{index:n}=t;return c?r.createElement(E.Z,{title:c[n]},e):e}},f,{className:u()(a,o,h,null==v?void 0:v.className),style:b,prefixCls:p,direction:m})))}));var D=R},31797:function(e,t,n){n.d(t,{Z:function(){return C}});var a=n(59301),r=n(56762),o=n(92343),l=n(92310),c=n.n(l),i=n(36355),s=n(66999);var u=e=>{const{value:t,formatter:n,precision:r,decimalSeparator:o,groupSeparator:l="",prefixCls:c}=e;let i;if("function"==typeof n)i=n(t);else{const e=String(t),n=e.match(/^(-?)(\d*)(\.(\d+))?$/);if(n&&"-"!==e){const e=n[1];let t=n[2]||"0",s=n[4]||"";t=t.replace(/\B(?=(\d{3})+(?!\d))/g,l),"number"==typeof r&&(s=s.padEnd(r,"0").slice(0,r>0?r:0)),s&&(s=`${o}${s}`),i=[a.createElement("span",{key:"int",className:`${c}-content-value-int`},e,t),s&&a.createElement("span",{key:"decimal",className:`${c}-content-value-decimal`},s)]}else i=e}return a.createElement("span",{className:`${c}-content-value`},i)},f=n(17313),d=n(83116),m=n(37613);const v=e=>{const{componentCls:t,marginXXS:n,padding:a,colorTextDescription:r,titleFontSize:o,colorTextHeading:l,contentFontSize:c,fontFamily:i}=e;return{[`${t}`]:Object.assign(Object.assign({},(0,f.Wf)(e)),{[`${t}-title`]:{marginBottom:n,color:r,fontSize:o},[`${t}-skeleton`]:{paddingTop:a},[`${t}-content`]:{color:l,fontSize:c,fontFamily:i,[`${t}-content-value`]:{display:"inline-block",direction:"ltr"},[`${t}-content-prefix, ${t}-content-suffix`]:{display:"inline-block"},[`${t}-content-prefix`]:{marginInlineEnd:n},[`${t}-content-suffix`]:{marginInlineStart:n}}})}};var p=(0,d.Z)("Statistic",(e=>{const t=(0,m.TS)(e,{});return[v(t)]}),(e=>{const{fontSizeHeading3:t,fontSize:n}=e;return{titleFontSize:n,contentFontSize:t}}));var g=e=>{const{prefixCls:t,className:n,rootClassName:r,style:o,valueStyle:l,value:f=0,title:d,valueRender:m,prefix:v,suffix:g,loading:h=!1,onMouseEnter:b,onMouseLeave:y,decimalSeparator:S=".",groupSeparator:C=","}=e,{getPrefixCls:x,direction:E,statistic:w}=a.useContext(i.E_),$=x("statistic",t),[O,Z]=p($),N=a.createElement(u,Object.assign({decimalSeparator:S,groupSeparator:C,prefixCls:$},e,{value:f})),H=c()($,{[`${$}-rtl`]:"rtl"===E},null==w?void 0:w.className,n,r,Z);return O(a.createElement("div",{className:H,style:Object.assign(Object.assign({},null==w?void 0:w.style),o),onMouseEnter:b,onMouseLeave:y},d&&a.createElement("div",{className:`${$}-title`},d),a.createElement(s.Z,{paragraph:!1,loading:h,className:`${$}-skeleton`},a.createElement("div",{style:l,className:`${$}-content`},v&&a.createElement("span",{className:`${$}-content-prefix`},v),m?m(N):N,g&&a.createElement("span",{className:`${$}-content-suffix`},g)))))};const h=[["Y",31536e6],["M",2592e6],["D",864e5],["H",36e5],["m",6e4],["s",1e3],["S",1]];function b(e,t){const{format:n=""}=t,a=new Date(e).getTime(),r=Date.now();return function(e,t){let n=e;const a=/\[[^\]]*]/g,r=(t.match(a)||[]).map((e=>e.slice(1,-1))),o=t.replace(a,"[]"),l=h.reduce(((e,t)=>{let[a,r]=t;if(e.includes(a)){const t=Math.floor(n/r);return n-=t*r,e.replace(new RegExp(`${a}+`,"g"),(e=>{const n=e.length;return t.toString().padStart(n,"0")}))}return e}),o);let c=0;return l.replace(a,(()=>{const e=r[c];return c+=1,e}))}(Math.max(a-r,0),n)}const y=e=>{const{value:t,format:n="HH:mm:ss",onChange:l,onFinish:c}=e,i=(0,r.Z)(),s=a.useRef(null),u=()=>{const e=function(e){return new Date(e).getTime()}(t);e>=Date.now()&&(s.current=setInterval((()=>{i(),null==l||l(e-Date.now()),e<Date.now()&&(null==c||c(),s.current&&(clearInterval(s.current),s.current=null))}),33.333333333333336))};a.useEffect((()=>(u(),()=>{s.current&&(clearInterval(s.current),s.current=null)})),[t]);return a.createElement(g,Object.assign({},e,{valueRender:e=>(0,o.Tm)(e,{title:void 0}),formatter:(e,t)=>b(e,Object.assign(Object.assign({},t),{format:n}))}))};var S=a.memo(y);g.Countdown=S;var C=g}}]); |