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
10 KiB
1 line
10 KiB
(self.webpackChunk=self.webpackChunk||[]).push([[10211,10794],{88522:function(e,t,n){"use strict";var o=n(92310),r=n.n(o),s=n(11592),i=n(2738),l=n(59301),a=n(53487),u=n(92343),c=n(36355),p=n(57809);const{Option:f}=p.default;function d(e){return e&&e.type&&(e.type.isSelectOption||e.type.isSelectOptGroup)}const h=(e,t)=>{const{prefixCls:n,className:o,popupClassName:a,dropdownClassName:h,children:m,dataSource:v}=e,g=(0,s.Z)(m);let y;1===g.length&&(0,u.l$)(g[0])&&!d(g[0])&&([y]=g);const S=y?()=>y:void 0;let b;b=g.length&&d(g[0])?m:v?v.map((e=>{if((0,u.l$)(e))return e;switch(typeof e){case"string":return l.createElement(f,{key:e,value:e},e);case"object":{const{value:t}=e;return l.createElement(f,{key:t,value:t},e.text)}default:return}})):[];const{getPrefixCls:w}=l.useContext(c.E_),L=w("select",n);return l.createElement(p.default,Object.assign({ref:t,suffixIcon:null},(0,i.Z)(e,["dataSource","dropdownClassName"]),{prefixCls:L,popupClassName:a||h,className:r()(`${L}-auto-complete`,o),mode:p.default.SECRET_COMBOBOX_MODE_DO_NOT_USE},{getInputElement:S}),b)},m=l.forwardRef(h),v=(0,a.Z)(m);m.Option=f,m._InternalPanelDoNotUseOrYouWillBeFired=v,t.Z=m},31797:function(e,t,n){"use strict";n.d(t,{Z:function(){return w}});var o=n(59301),r=n(56762),s=n(92343),i=n(92310),l=n.n(i),a=n(36355),u=n(61621);var c=e=>{const{value:t,formatter:n,precision:r,decimalSeparator:s,groupSeparator:i="",prefixCls:l}=e;let a;if("function"==typeof n)a=n(t);else{const e=String(t),n=e.match(/^(-?)(\d*)(\.(\d+))?$/);if(n&&"-"!==e){const e=n[1];let t=n[2]||"0",u=n[4]||"";t=t.replace(/\B(?=(\d{3})+(?!\d))/g,i),"number"==typeof r&&(u=u.padEnd(r,"0").slice(0,r>0?r:0)),u&&(u=`${s}${u}`),a=[o.createElement("span",{key:"int",className:`${l}-content-value-int`},e,t),u&&o.createElement("span",{key:"decimal",className:`${l}-content-value-decimal`},u)]}else a=e}return o.createElement("span",{className:`${l}-content-value`},a)},p=n(17313),f=n(83116),d=n(37613);const h=e=>{const{componentCls:t,marginXXS:n,padding:o,colorTextDescription:r,titleFontSize:s,colorTextHeading:i,contentFontSize:l,fontFamily:a}=e;return{[`${t}`]:Object.assign(Object.assign({},(0,p.Wf)(e)),{[`${t}-title`]:{marginBottom:n,color:r,fontSize:s},[`${t}-skeleton`]:{paddingTop:o},[`${t}-content`]:{color:i,fontSize:l,fontFamily:a,[`${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 m=(0,f.Z)("Statistic",(e=>{const t=(0,d.TS)(e,{});return[h(t)]}),(e=>{const{fontSizeHeading3:t,fontSize:n}=e;return{titleFontSize:n,contentFontSize:t}}));var v=e=>{const{prefixCls:t,className:n,rootClassName:r,style:s,valueStyle:i,value:p=0,title:f,valueRender:d,prefix:h,suffix:v,loading:g=!1,onMouseEnter:y,onMouseLeave:S,decimalSeparator:b=".",groupSeparator:w=","}=e,{getPrefixCls:L,direction:E,statistic:C}=o.useContext(a.E_),O=L("statistic",t),[P,k]=m(O),x=o.createElement(c,Object.assign({decimalSeparator:b,groupSeparator:w,prefixCls:O},e,{value:p})),M=l()(O,{[`${O}-rtl`]:"rtl"===E},null==C?void 0:C.className,n,r,k);return P(o.createElement("div",{className:M,style:Object.assign(Object.assign({},null==C?void 0:C.style),s),onMouseEnter:y,onMouseLeave:S},f&&o.createElement("div",{className:`${O}-title`},f),o.createElement(u.Z,{paragraph:!1,loading:g,className:`${O}-skeleton`},o.createElement("div",{style:i,className:`${O}-content`},h&&o.createElement("span",{className:`${O}-content-prefix`},h),d?d(x):x,v&&o.createElement("span",{className:`${O}-content-suffix`},v)))))};const g=[["Y",31536e6],["M",2592e6],["D",864e5],["H",36e5],["m",6e4],["s",1e3],["S",1]];function y(e,t){const{format:n=""}=t,o=new Date(e).getTime(),r=Date.now();return function(e,t){let n=e;const o=/\[[^\]]*]/g,r=(t.match(o)||[]).map((e=>e.slice(1,-1))),s=t.replace(o,"[]"),i=g.reduce(((e,t)=>{let[o,r]=t;if(e.includes(o)){const t=Math.floor(n/r);return n-=t*r,e.replace(new RegExp(`${o}+`,"g"),(e=>{const n=e.length;return t.toString().padStart(n,"0")}))}return e}),s);let l=0;return i.replace(o,(()=>{const e=r[l];return l+=1,e}))}(Math.max(o-r,0),n)}const S=e=>{const{value:t,format:n="HH:mm:ss",onChange:i,onFinish:l}=e,a=(0,r.Z)(),u=o.useRef(null),c=()=>{const e=function(e){return new Date(e).getTime()}(t);e>=Date.now()&&(u.current=setInterval((()=>{a(),null==i||i(e-Date.now()),e<Date.now()&&(null==l||l(),u.current&&(clearInterval(u.current),u.current=null))}),33.333333333333336))};o.useEffect((()=>(c(),()=>{u.current&&(clearInterval(u.current),u.current=null)})),[t]);return o.createElement(v,Object.assign({},e,{valueRender:e=>(0,s.Tm)(e,{title:void 0}),formatter:(e,t)=>y(e,Object.assign(Object.assign({},t),{format:n}))}))};var b=o.memo(S);v.Countdown=b;var w=v},51581:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=n(59301),s=l(r),i=l(n(12708));function l(e){return e&&e.__esModule?e:{default:e}}var a=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.scrollListener=n.scrollListener.bind(n),n.eventListenerOptions=n.eventListenerOptions.bind(n),n.mousewheelListener=n.mousewheelListener.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"componentDidMount",value:function(){this.pageLoaded=this.props.pageStart,this.options=this.eventListenerOptions(),this.attachScrollListener()}},{key:"componentDidUpdate",value:function(){if(this.props.isReverse&&this.loadMore){var e=this.getParentElement(this.scrollComponent);e.scrollTop=e.scrollHeight-this.beforeScrollHeight+this.beforeScrollTop,this.loadMore=!1}this.attachScrollListener()}},{key:"componentWillUnmount",value:function(){this.detachScrollListener(),this.detachMousewheelListener()}},{key:"isPassiveSupported",value:function(){var e=!1,t={get passive(){e=!0}};try{document.addEventListener("test",null,t),document.removeEventListener("test",null,t)}catch(e){}return e}},{key:"eventListenerOptions",value:function(){var e=this.props.useCapture;return this.isPassiveSupported()&&(e={useCapture:this.props.useCapture,passive:!0}),e}},{key:"setDefaultLoader",value:function(e){this.defaultLoader=e}},{key:"detachMousewheelListener",value:function(){var e=window;!1===this.props.useWindow&&(e=this.scrollComponent.parentNode),e.removeEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture)}},{key:"detachScrollListener",value:function(){var e=window;!1===this.props.useWindow&&(e=this.getParentElement(this.scrollComponent)),e.removeEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),e.removeEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture)}},{key:"getParentElement",value:function(e){var t=this.props.getScrollParent&&this.props.getScrollParent();return null!=t?t:e&&e.parentNode}},{key:"filterProps",value:function(e){return e}},{key:"attachScrollListener",value:function(){var e=this.getParentElement(this.scrollComponent);if(this.props.hasMore&&e){var t=window;!1===this.props.useWindow&&(t=e),t.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),t.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),t.addEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture),this.props.initialLoad&&this.scrollListener()}}},{key:"mousewheelListener",value:function(e){1!==e.deltaY||this.isPassiveSupported()||e.preventDefault()}},{key:"scrollListener",value:function(){var e=this.scrollComponent,t=window,n=this.getParentElement(e),o=void 0;if(this.props.useWindow){var r=document.documentElement||document.body.parentNode||document.body,s=void 0!==t.pageYOffset?t.pageYOffset:r.scrollTop;o=this.props.isReverse?s:this.calculateOffset(e,s)}else o=this.props.isReverse?n.scrollTop:e.scrollHeight-n.scrollTop-n.clientHeight;o<Number(this.props.threshold)&&e&&null!==e.offsetParent&&(this.detachScrollListener(),this.beforeScrollHeight=n.scrollHeight,this.beforeScrollTop=n.scrollTop,"function"==typeof this.props.loadMore&&(this.props.loadMore(this.pageLoaded+=1),this.loadMore=!0))}},{key:"calculateOffset",value:function(e,t){return e?this.calculateTopPosition(e)+(e.offsetHeight-t-window.innerHeight):0}},{key:"calculateTopPosition",value:function(e){return e?e.offsetTop+this.calculateTopPosition(e.offsetParent):0}},{key:"render",value:function(){var e=this,t=this.filterProps(this.props),n=t.children,o=t.element,r=t.hasMore,i=(t.initialLoad,t.isReverse),l=t.loader,a=(t.loadMore,t.pageStart,t.ref),u=(t.threshold,t.useCapture,t.useWindow,t.getScrollParent,function(e,t){var n={};for(var o in e)t.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}(t,["children","element","hasMore","initialLoad","isReverse","loader","loadMore","pageStart","ref","threshold","useCapture","useWindow","getScrollParent"]));u.ref=function(t){e.scrollComponent=t,a&&a(t)};var c=[n];return r&&(l?i?c.unshift(l):c.push(l):this.defaultLoader&&(i?c.unshift(this.defaultLoader):c.push(this.defaultLoader))),s.default.createElement(o,u,c)}}]),t}(r.Component);a.propTypes={children:i.default.node.isRequired,element:i.default.node,hasMore:i.default.bool,initialLoad:i.default.bool,isReverse:i.default.bool,loader:i.default.node,loadMore:i.default.func.isRequired,pageStart:i.default.number,ref:i.default.func,getScrollParent:i.default.func,threshold:i.default.number,useCapture:i.default.bool,useWindow:i.default.bool},a.defaultProps={element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null},t.default=a,e.exports=t.default},26724:function(e,t,n){e.exports=n(51581)}}]); |