-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1170.30b39df4.async.js
More file actions
1 lines (1 loc) · 13.5 KB
/
Copy path1170.30b39df4.async.js
File metadata and controls
1 lines (1 loc) · 13.5 KB
1
"use strict";(self.webpackChunk_metro_docs=self.webpackChunk_metro_docs||[]).push([[1170],{35835:function(Ie,_,R){R.d(_,{Z:function(){return ct}});var K=R(7896),w=R(33028),k=R(56666),D=R(76854),Pe=R(99980),u=R(41398),Fe=R(72779),V=R.n(Fe),Ue=R(62300),se=u.forwardRef(function(t,r){var o=t.height,e=t.offset,l=t.children,i=t.prefixCls,c=t.onInnerResize,n=t.innerProps,a={},s={display:"flex",flexDirection:"column"};return e!==void 0&&(a={height:o,position:"relative",overflow:"hidden"},s=(0,w.Z)((0,w.Z)({},s),{},{transform:"translateY(".concat(e,"px)"),position:"absolute",left:0,right:0,top:0})),u.createElement("div",{style:a},u.createElement(Ue.default,{onResize:function(f){var d=f.offsetHeight;d&&c&&c()}},u.createElement("div",(0,K.Z)({style:s,className:V()((0,k.Z)({},"".concat(i,"-holder-inner"),i)),ref:r},n),l)))});se.displayName="Filler";var Ne=se,fe=R(9249),ve=R(87371),$e=R(64136),ke=R(33219),he=function(r){return+setTimeout(r,16)},de=function(r){return clearTimeout(r)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(he=function(r){return window.requestAnimationFrame(r)},de=function(r){return window.cancelAnimationFrame(r)});var ge=0,ee=new Map;function me(t){ee.delete(t)}var pe=function(r){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;ge+=1;var e=ge;function l(i){if(i===0)me(e),r();else{var c=he(function(){l(i-1)});ee.set(e,c)}}return l(o),e};pe.cancel=function(t){var r=ee.get(t);return me(r),de(r)};var H=pe,Ye=20;function Re(t){return"touches"in t?t.touches[0].pageY:t.pageY}var Oe=function(t){(0,$e.Z)(o,t);var r=(0,ke.Z)(o);function o(){var e;(0,fe.Z)(this,o);for(var l=arguments.length,i=new Array(l),c=0;c<l;c++)i[c]=arguments[c];return e=r.call.apply(r,[this].concat(i)),e.moveRaf=null,e.scrollbarRef=u.createRef(),e.thumbRef=u.createRef(),e.visibleTimeout=null,e.state={dragging:!1,pageY:null,startTop:null,visible:!1},e.delayHidden=function(){clearTimeout(e.visibleTimeout),e.setState({visible:!0}),e.visibleTimeout=setTimeout(function(){e.setState({visible:!1})},2e3)},e.onScrollbarTouchStart=function(n){n.preventDefault()},e.onContainerMouseDown=function(n){n.stopPropagation(),n.preventDefault()},e.patchEvents=function(){window.addEventListener("mousemove",e.onMouseMove),window.addEventListener("mouseup",e.onMouseUp),e.thumbRef.current.addEventListener("touchmove",e.onMouseMove),e.thumbRef.current.addEventListener("touchend",e.onMouseUp)},e.removeEvents=function(){var n;window.removeEventListener("mousemove",e.onMouseMove),window.removeEventListener("mouseup",e.onMouseUp),(n=e.scrollbarRef.current)===null||n===void 0||n.removeEventListener("touchstart",e.onScrollbarTouchStart),e.thumbRef.current&&(e.thumbRef.current.removeEventListener("touchstart",e.onMouseDown),e.thumbRef.current.removeEventListener("touchmove",e.onMouseMove),e.thumbRef.current.removeEventListener("touchend",e.onMouseUp)),H.cancel(e.moveRaf)},e.onMouseDown=function(n){var a=e.props.onStartMove;e.setState({dragging:!0,pageY:Re(n),startTop:e.getTop()}),a(),e.patchEvents(),n.stopPropagation(),n.preventDefault()},e.onMouseMove=function(n){var a=e.state,s=a.dragging,v=a.pageY,f=a.startTop,d=e.props.onScroll;if(H.cancel(e.moveRaf),s){var g=Re(n)-v,m=f+g,M=e.getEnableScrollRange(),b=e.getEnableHeightRange(),L=b?m/b:0,Z=Math.ceil(L*M);e.moveRaf=H(function(){d(Z)})}},e.onMouseUp=function(){var n=e.props.onStopMove;e.setState({dragging:!1}),n(),e.removeEvents()},e.getSpinHeight=function(){var n=e.props,a=n.height,s=n.count,v=a/s*10;return v=Math.max(v,Ye),v=Math.min(v,a/2),Math.floor(v)},e.getEnableScrollRange=function(){var n=e.props,a=n.scrollHeight,s=n.height;return a-s||0},e.getEnableHeightRange=function(){var n=e.props.height,a=e.getSpinHeight();return n-a||0},e.getTop=function(){var n=e.props.scrollTop,a=e.getEnableScrollRange(),s=e.getEnableHeightRange();if(n===0||a===0)return 0;var v=n/a;return v*s},e.showScroll=function(){var n=e.props,a=n.height,s=n.scrollHeight;return s>a},e}return(0,ve.Z)(o,[{key:"componentDidMount",value:function(){this.scrollbarRef.current.addEventListener("touchstart",this.onScrollbarTouchStart),this.thumbRef.current.addEventListener("touchstart",this.onMouseDown)}},{key:"componentDidUpdate",value:function(l){l.scrollTop!==this.props.scrollTop&&this.delayHidden()}},{key:"componentWillUnmount",value:function(){this.removeEvents(),clearTimeout(this.visibleTimeout)}},{key:"render",value:function(){var l=this.state,i=l.dragging,c=l.visible,n=this.props,a=n.prefixCls,s=n.direction,v=this.getSpinHeight(),f=this.getTop(),d=this.showScroll(),g=d&&c,m=s==="rtl"?{left:0}:{right:0};return u.createElement("div",{ref:this.scrollbarRef,className:V()("".concat(a,"-scrollbar"),(0,k.Z)({},"".concat(a,"-scrollbar-show"),d)),style:(0,w.Z)((0,w.Z)({width:8,top:0,bottom:0},m),{},{position:"absolute",display:g?null:"none"}),onMouseDown:this.onContainerMouseDown,onMouseMove:this.delayHidden},u.createElement("div",{ref:this.thumbRef,className:V()("".concat(a,"-scrollbar-thumb"),(0,k.Z)({},"".concat(a,"-scrollbar-thumb-moving"),i)),style:{width:"100%",height:v,top:f,left:0,position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"},onMouseDown:this.onMouseDown}))}}]),o}(u.Component);function ze(t){var r=t.children,o=t.setRef,e=u.useCallback(function(l){o(l)},[]);return u.cloneElement(r,{ref:e})}function We(t,r,o,e,l,i){var c=i.getKey;return t.slice(r,o+1).map(function(n,a){var s=r+a,v=l(n,s,{}),f=c(n);return u.createElement(ze,{key:f,setRef:function(g){return e(n,g)}},v)})}var Ae=R(71720);function Ke(t){return t instanceof HTMLElement||t instanceof SVGElement}function Ve(t){return Ke(t)?t:t instanceof u.Component?Ae.findDOMNode(t):null}var je=function(){function t(){(0,fe.Z)(this,t),this.maps=void 0,this.maps=Object.create(null)}return(0,ve.Z)(t,[{key:"set",value:function(o,e){this.maps[o]=e}},{key:"get",value:function(o){return this.maps[o]}}]),t}(),Be=je;function Ge(t,r,o){var e=u.useState(0),l=(0,D.Z)(e,2),i=l[0],c=l[1],n=(0,u.useRef)(new Map),a=(0,u.useRef)(new Be),s=(0,u.useRef)();function v(){H.cancel(s.current)}function f(){v(),s.current=H(function(){n.current.forEach(function(g,m){if(g&&g.offsetParent){var M=Ve(g),b=M.offsetHeight;a.current.get(m)!==b&&a.current.set(m,M.offsetHeight)}}),c(function(g){return g+1})})}function d(g,m){var M=t(g),b=n.current.get(M);m?(n.current.set(M,m),f()):n.current.delete(M),!b!=!m&&(m?r==null||r(g):o==null||o(g))}return(0,u.useEffect)(function(){return v},[]),[d,f,a.current,i]}var Me=R(86522);function Je(t,r,o,e,l,i,c,n){var a=u.useRef();return function(s){if(s==null){n();return}if(H.cancel(a.current),typeof s=="number")c(s);else if(s&&(0,Me.Z)(s)==="object"){var v,f=s.align;"index"in s?v=s.index:v=r.findIndex(function(M){return l(M)===s.key});var d=s.offset,g=d===void 0?0:d,m=function M(b,L){if(!(b<0||!t.current)){var Z=t.current.clientHeight,j=!1,Y=L;if(Z){for(var y=L||f,O=0,F=0,I=0,C=Math.min(r.length,v),U=0;U<=C;U+=1){var re=l(r[U]);F=O;var N=o.get(re);I=F+(N===void 0?e:N),O=I,U===v&&N===void 0&&(j=!0)}var P=null;switch(y){case"top":P=F-g;break;case"bottom":P=I-Z+g;break;default:{var z=t.current.scrollTop,oe=z+Z;F<z?Y="top":I>oe&&(Y="bottom")}}P!==null&&P!==t.current.scrollTop&&c(P)}a.current=H(function(){j&&i(),M(b-1,Y)},2)}};m(3)}}}function Lt(t,r,o,e){var l=o-t,i=r-o,c=Math.min(l,i)*2;if(e<=c){var n=Math.floor(e/2);return e%2?o+n+1:o-n}return l>i?o-(e-i):o+(e-l)}function Qe(t,r,o){var e=t.length,l=r.length,i,c;if(e===0&&l===0)return null;e<l?(i=t,c=r):(i=r,c=t);var n={__EMPTY_ITEM__:!0};function a(m){return m!==void 0?o(m):n}for(var s=null,v=Math.abs(e-l)!==1,f=0;f<c.length;f+=1){var d=a(i[f]),g=a(c[f]);if(d!==g){s=f,v=v||d!==a(c[f+1]);break}}return s===null?null:{index:s,multiple:v}}function Xe(t,r,o){var e=u.useState(t),l=(0,D.Z)(e,2),i=l[0],c=l[1],n=u.useState(null),a=(0,D.Z)(n,2),s=a[0],v=a[1];return u.useEffect(function(){var f=Qe(i||[],t||[],r);(f==null?void 0:f.index)!==void 0&&(o==null||o(f.index),v(t[f.index])),c(t)},[t]),[s]}var qe=(typeof navigator=="undefined"?"undefined":(0,Me.Z)(navigator))==="object"&&/Firefox/i.test(navigator.userAgent),_e=qe,Se=function(t,r){var o=(0,u.useRef)(!1),e=(0,u.useRef)(null);function l(){clearTimeout(e.current),o.current=!0,e.current=setTimeout(function(){o.current=!1},50)}var i=(0,u.useRef)({top:t,bottom:r});return i.current.top=t,i.current.bottom=r,function(c){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=c<0&&i.current.top||c>0&&i.current.bottom;return n&&a?(clearTimeout(e.current),o.current=!1):(!a||o.current)&&l(),!o.current&&a}};function et(t,r,o,e){var l=(0,u.useRef)(0),i=(0,u.useRef)(null),c=(0,u.useRef)(null),n=(0,u.useRef)(!1),a=Se(r,o);function s(f){if(t){H.cancel(i.current);var d=f.deltaY;l.current+=d,c.current=d,!a(d)&&(_e||f.preventDefault(),i.current=H(function(){var g=n.current?10:1;e(l.current*g),l.current=0}))}}function v(f){t&&(n.current=f.detail===c.current)}return[s,v]}function tt(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var te=tt()?u.useLayoutEffect:u.useEffect,ne=te,Zt=function(r,o){var e=React.useRef(!0);te(function(){if(!e.current)return r()},o),te(function(){return e.current=!1,function(){e.current=!0}},[])},nt=14/15;function rt(t,r,o){var e=(0,u.useRef)(!1),l=(0,u.useRef)(0),i=(0,u.useRef)(null),c=(0,u.useRef)(null),n,a=function(d){if(e.current){var g=Math.ceil(d.touches[0].pageY),m=l.current-g;l.current=g,o(m)&&d.preventDefault(),clearInterval(c.current),c.current=setInterval(function(){m*=nt,(!o(m,!0)||Math.abs(m)<=.1)&&clearInterval(c.current)},16)}},s=function(){e.current=!1,n()},v=function(d){n(),d.touches.length===1&&!e.current&&(e.current=!0,l.current=Math.ceil(d.touches[0].pageY),i.current=d.target,i.current.addEventListener("touchmove",a),i.current.addEventListener("touchend",s))};n=function(){i.current&&(i.current.removeEventListener("touchmove",a),i.current.removeEventListener("touchend",s))},ne(function(){return t&&r.current.addEventListener("touchstart",v),function(){var f;(f=r.current)===null||f===void 0||f.removeEventListener("touchstart",v),n(),clearInterval(c.current)}},[t])}var ot=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","component","onScroll","onVisibleChange","innerProps"],at=[],ut={overflowY:"auto",overflowAnchor:"none"};function it(t,r){var o=t.prefixCls,e=o===void 0?"rc-virtual-list":o,l=t.className,i=t.height,c=t.itemHeight,n=t.fullHeight,a=n===void 0?!0:n,s=t.style,v=t.data,f=t.children,d=t.itemKey,g=t.virtual,m=t.direction,M=t.component,b=M===void 0?"div":M,L=t.onScroll,Z=t.onVisibleChange,j=t.innerProps,Y=(0,Pe.Z)(t,ot),y=!!(g!==!1&&i&&c),O=y&&v&&c*v.length>i,F=(0,u.useState)(0),I=(0,D.Z)(F,2),C=I[0],U=I[1],re=(0,u.useState)(!1),N=(0,D.Z)(re,2),P=N[0],z=N[1],oe=V()(e,(0,k.Z)({},"".concat(e,"-rtl"),m==="rtl"),l),S=v||at,T=(0,u.useRef)(),be=(0,u.useRef)(),ye=(0,u.useRef)(),W=u.useCallback(function(h){return typeof d=="function"?d(h):h==null?void 0:h[d]},[d]),st={getKey:W};function B(h){U(function(p){var E;typeof h=="function"?E=h(p):E=h;var $=Mt(E);return T.current.scrollTop=$,$})}var Te=(0,u.useRef)({start:0,end:S.length}),ft=(0,u.useRef)(),vt=Xe(S,W),ht=(0,D.Z)(vt,1),dt=ht[0];ft.current=dt;var gt=Ge(W,null,null),G=(0,D.Z)(gt,4),mt=G[0],we=G[1],He=G[2],pt=G[3],J=u.useMemo(function(){if(!y)return{scrollHeight:void 0,start:0,end:S.length-1,offset:void 0};if(!O){var h;return{scrollHeight:((h=be.current)===null||h===void 0?void 0:h.offsetHeight)||0,start:0,end:S.length-1,offset:void 0}}for(var p=0,E,$,x,Ht=S.length,A=0;A<Ht;A+=1){var Ct=S[A],Dt=W(Ct),xe=He.get(Dt),ce=p+(xe===void 0?c:xe);ce>=C&&E===void 0&&(E=A,$=p),ce>C+i&&x===void 0&&(x=A),p=ce}return E===void 0&&(E=0,$=0,x=Math.ceil(i/c)),x===void 0&&(x=S.length-1),x=Math.min(x+1,S.length),{scrollHeight:p,start:E,end:x,offset:$}},[O,y,C,S,pt,i]),ae=J.scrollHeight,Q=J.start,X=J.end,Rt=J.offset;Te.current.start=Q,Te.current.end=X;var ue=ae-i,ie=(0,u.useRef)(ue);ie.current=ue;function Mt(h){var p=h;return Number.isNaN(ie.current)||(p=Math.min(p,ie.current)),p=Math.max(p,0),p}var Ce=C<=0,De=C>=ue,St=Se(Ce,De);function Et(h){var p=h;B(p)}function bt(h){var p=h.currentTarget.scrollTop;p!==C&&B(p),L==null||L(h)}var yt=et(y,Ce,De,function(h){B(function(p){var E=p+h;return E})}),Le=(0,D.Z)(yt,2),le=Le[0],Ze=Le[1];rt(y,T,function(h,p){return St(h,p)?!1:(le({preventDefault:function(){},deltaY:h}),!0)}),ne(function(){function h(p){y&&p.preventDefault()}return T.current.addEventListener("wheel",le),T.current.addEventListener("DOMMouseScroll",Ze),T.current.addEventListener("MozMousePixelScroll",h),function(){T.current&&(T.current.removeEventListener("wheel",le),T.current.removeEventListener("DOMMouseScroll",Ze),T.current.removeEventListener("MozMousePixelScroll",h))}},[y]);var Tt=Je(T,S,He,c,W,we,B,function(){var h;(h=ye.current)===null||h===void 0||h.delayHidden()});u.useImperativeHandle(r,function(){return{scrollTo:Tt}}),ne(function(){if(Z){var h=S.slice(Q,X+1);Z(h,S)}},[Q,X,S]);var wt=We(S,Q,X,mt,f,st),q=null;return i&&(q=(0,w.Z)((0,k.Z)({},a?"height":"maxHeight",i),ut),y&&(q.overflowY="hidden",P&&(q.pointerEvents="none"))),u.createElement("div",(0,K.Z)({style:(0,w.Z)((0,w.Z)({},s),{},{position:"relative"}),className:oe},Y),u.createElement(b,{className:"".concat(e,"-holder"),style:q,ref:T,onScroll:bt},u.createElement(Ne,{prefixCls:e,height:ae,offset:Rt,onInnerResize:we,ref:be,innerProps:j},wt)),y&&u.createElement(Oe,{ref:ye,prefixCls:e,scrollTop:C,height:i,scrollHeight:ae,count:S.length,direction:m,onScroll:Et,onStartMove:function(){z(!0)},onStopMove:function(){z(!1)}}))}var Ee=u.forwardRef(it);Ee.displayName="List";var lt=Ee,ct=lt},33665:function(Ie,_,R){R.d(_,{Z:function(){return K}});function K(w){if(w==null)throw new TypeError("Cannot destructure "+w)}}}]);