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
20 KiB
1 line
20 KiB
(self.webpackChunk=self.webpackChunk||[]).push([[56472,49166,63527],{60186:function(e,t,o){"use strict";o.d(t,{Z:function(){return a}});var n=o(5891),r=o(59301),l={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M885.2 446.3l-.2-.8-112.2-285.1c-5-16.1-19.9-27.2-36.8-27.2H281.2c-17 0-32.1 11.3-36.9 27.6L139.4 443l-.3.7-.2.8c-1.3 4.9-1.7 9.9-1 14.8-.1 1.6-.2 3.2-.2 4.8V830a60.9 60.9 0 0060.8 60.8h627.2c33.5 0 60.8-27.3 60.9-60.8V464.1c0-1.3 0-2.6-.1-3.7.4-4.9 0-9.6-1.3-14.1zm-295.8-43l-.3 15.7c-.8 44.9-31.8 75.1-77.1 75.1-22.1 0-41.1-7.1-54.8-20.6S436 441.2 435.6 419l-.3-15.7H229.5L309 210h399.2l81.7 193.3H589.4zm-375 76.8h157.3c24.3 57.1 76 90.8 140.4 90.8 33.7 0 65-9.4 90.3-27.2 22.2-15.6 39.5-37.4 50.7-63.6h156.5V814H214.4V480.1z"}}]},name:"inbox",theme:"outlined"},i=o(22589),s=function(e,t){return r.createElement(i.Z,(0,n.Z)({},e,{ref:t,icon:l}))};var a=r.forwardRef(s)},77578:function(e,t,o){"use strict";o.d(t,{Z:function(){return n}});const n=e=>e?"function"==typeof e?e():e:null},14478:function(e,t,o){"use strict";o.d(t,{Z:function(){return k}});var n=o(54745),r=o(92310),l=o.n(r),i=o(20287),s=o(71366),a=o(55405),c=o(59301),p=o(92343),u=o(36355),d=o(60324),f=o(92806),h=o(77578),m=o(3113),g=o(67797),v=o(9763),b=o(31724),y=o(39722),C=o(83116);var O=(0,C.Z)("Popconfirm",(e=>(e=>{const{componentCls:t,iconCls:o,antCls:n,zIndexPopup:r,colorText:l,colorWarning:i,marginXXS:s,marginXS:a,fontSize:c,fontWeightStrong:p,colorTextHeading:u}=e;return{[t]:{zIndex:r,[`&${n}-popover`]:{fontSize:c},[`${t}-message`]:{marginBottom:a,display:"flex",flexWrap:"nowrap",alignItems:"start",[`> ${t}-message-icon ${o}`]:{color:i,fontSize:c,lineHeight:1,marginInlineEnd:a},[`${t}-title`]:{fontWeight:p,color:u,"&:only-child":{fontWeight:"normal"}},[`${t}-description`]:{marginTop:s,color:l}},[`${t}-buttons`]:{textAlign:"end",whiteSpace:"nowrap",button:{marginInlineStart:a}}}}})(e)),(e=>{const{zIndexPopupBase:t}=e;return{zIndexPopup:t+60}}),{resetStyle:!1}),x=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(o[n[r]]=e[n[r]])}return o};const S=e=>{const{prefixCls:t,okButtonProps:o,cancelButtonProps:r,title:i,description:s,cancelText:a,okText:p,okType:d="primary",icon:y=c.createElement(n.Z,null),showCancel:C=!0,close:O,onConfirm:x,onCancel:S,onPopupClick:P}=e,{getPrefixCls:w}=c.useContext(u.E_),[E]=(0,v.Z)("Popconfirm",b.Z.Popconfirm),k=(0,h.Z)(i),$=(0,h.Z)(s);return c.createElement("div",{className:`${t}-inner-content`,onClick:P},c.createElement("div",{className:`${t}-message`},y&&c.createElement("span",{className:`${t}-message-icon`},y),c.createElement("div",{className:`${t}-message-text`},k&&c.createElement("div",{className:l()(`${t}-title`)},k),$&&c.createElement("div",{className:`${t}-description`},$))),c.createElement("div",{className:`${t}-buttons`},C&&c.createElement(m.ZP,Object.assign({onClick:S,size:"small"},r),null!=a?a:null==E?void 0:E.cancelText),c.createElement(f.Z,{buttonProps:Object.assign(Object.assign({size:"small"},(0,g.n)(d)),o),actionFn:x,close:O,prefixCls:w("btn"),quitOnNullishReturnValue:!0,emitEvent:!0},null!=p?p:null==E?void 0:E.okText)))};var P=e=>{const{prefixCls:t,placement:o,className:n,style:r}=e,i=x(e,["prefixCls","placement","className","style"]),{getPrefixCls:s}=c.useContext(u.E_),a=s("popconfirm",t),[p]=O(a);return p(c.createElement(y.ZP,{placement:o,className:l()(a,n),style:r,content:c.createElement(S,Object.assign({prefixCls:a},i))}))},w=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(o[n[r]]=e[n[r]])}return o};const E=c.forwardRef(((e,t)=>{const{prefixCls:o,placement:r="top",trigger:f="click",okType:h="primary",icon:m=c.createElement(n.Z,null),children:g,overlayClassName:v,onOpenChange:b,onVisibleChange:y}=e,C=w(e,["prefixCls","placement","trigger","okType","icon","children","overlayClassName","onOpenChange","onVisibleChange"]),{getPrefixCls:x}=c.useContext(u.E_),[P,E]=(0,s.Z)(!1,{value:e.open,defaultValue:e.defaultOpen}),k=(e,t)=>{E(e,!0),null==y||y(e),null==b||b(e,t)},$=x("popconfirm",o),L=l()($,v),[j]=O($);return j(c.createElement(d.Z,Object.assign({},(0,a.Z)(C,["title"]),{trigger:f,placement:r,onOpenChange:t=>{const{disabled:o=!1}=e;o||k(t)},open:P,ref:t,overlayClassName:L,content:c.createElement(S,Object.assign({okType:h,icon:m},e,{prefixCls:$,close:e=>{k(!1,e)},onConfirm:t=>{var o;return null===(o=e.onConfirm)||void 0===o?void 0:o.call(void 0,t)},onCancel:t=>{var o;k(!1,t),null===(o=e.onCancel)||void 0===o||o.call(void 0,t)}})),"data-popover-inject":!0}),(0,p.Tm)(g,{onKeyDown:e=>{var t,o;c.isValidElement(g)&&(null===(o=null==g?void 0:(t=g.props).onKeyDown)||void 0===o||o.call(t,e)),(e=>{e.keyCode===i.Z.ESC&&P&&k(!1,e)})(e)}})))}));E._InternalPanelDoNotUseOrYouWillBeFired=P;var k=E},39722:function(e,t,o){"use strict";o.d(t,{t5:function(){return u}});var n=o(92310),r=o.n(n),l=o(55477),i=o(59301),s=o(36355),a=o(77578),c=o(17356),p=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(o[n[r]]=e[n[r]])}return o};const u=e=>{const{hashId:t,prefixCls:o,className:n,style:s,placement:c="top",title:p,content:u,children:d}=e;return i.createElement("div",{className:r()(t,o,`${o}-pure`,`${o}-placement-${c}`,n),style:s},i.createElement("div",{className:`${o}-arrow`}),i.createElement(l.G,Object.assign({},e,{className:t,prefixCls:o}),d||((e,t,o)=>{if(t||o)return i.createElement(i.Fragment,null,t&&i.createElement("div",{className:`${e}-title`},(0,a.Z)(t)),i.createElement("div",{className:`${e}-inner-content`},(0,a.Z)(o)))})(o,p,u)))};t.ZP=e=>{const{prefixCls:t}=e,o=p(e,["prefixCls"]),{getPrefixCls:n}=i.useContext(s.E_),r=n("popover",t),[l,a]=(0,c.Z)(r);return l(i.createElement(u,Object.assign({},o,{prefixCls:r,hashId:a})))}},60324:function(e,t,o){"use strict";var n=o(92310),r=o.n(n),l=o(59301),i=o(77578),s=o(62892),a=o(36355),c=o(6848),p=o(39722),u=o(17356),d=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(o[n[r]]=e[n[r]])}return o};const f=e=>{let{title:t,content:o,prefixCls:n}=e;return l.createElement(l.Fragment,null,t&&l.createElement("div",{className:`${n}-title`},(0,i.Z)(t)),l.createElement("div",{className:`${n}-inner-content`},(0,i.Z)(o)))},h=l.forwardRef(((e,t)=>{const{prefixCls:o,title:n,content:i,overlayClassName:p,placement:h="top",trigger:m="hover",mouseEnterDelay:g=.1,mouseLeaveDelay:v=.1,overlayStyle:b={}}=e,y=d(e,["prefixCls","title","content","overlayClassName","placement","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle"]),{getPrefixCls:C}=l.useContext(a.E_),O=C("popover",o),[x,S]=(0,u.Z)(O),P=C(),w=r()(p,S);return x(l.createElement(c.Z,Object.assign({placement:h,trigger:m,mouseEnterDelay:g,mouseLeaveDelay:v,overlayStyle:b},y,{prefixCls:O,overlayClassName:w,ref:t,overlay:n||i?l.createElement(f,{prefixCls:O,title:n,content:i}):null,transitionName:(0,s.m)(P,"zoom-big",y.transitionName),"data-popover-inject":!0})))}));h._InternalPanelDoNotUseOrYouWillBeFired=p.ZP,t.Z=h},17356:function(e,t,o){"use strict";var n=o(17313),r=o(29878),l=o(19447),i=o(33166),s=o(83116),a=o(37613);const c=e=>{const{componentCls:t,popoverColor:o,minWidth:r,fontWeightStrong:i,popoverPadding:s,boxShadowSecondary:a,colorTextHeading:c,borderRadiusLG:p,zIndexPopup:u,marginXS:d,colorBgElevated:f,popoverBg:h}=e;return[{[t]:Object.assign(Object.assign({},(0,n.Wf)(e)),{position:"absolute",top:0,left:{_skip_check_:!0,value:0},zIndex:u,fontWeight:"normal",whiteSpace:"normal",textAlign:"start",cursor:"auto",userSelect:"text",transformOrigin:"var(--arrow-x, 50%) var(--arrow-y, 50%)","--antd-arrow-background-color":f,"&-rtl":{direction:"rtl"},"&-hidden":{display:"none"},[`${t}-content`]:{position:"relative"},[`${t}-inner`]:{backgroundColor:h,backgroundClip:"padding-box",borderRadius:p,boxShadow:a,padding:s},[`${t}-title`]:{minWidth:r,marginBottom:d,color:c,fontWeight:i},[`${t}-inner-content`]:{color:o}})},(0,l.ZP)(e,{colorBg:"var(--antd-arrow-background-color)"}),{[`${t}-pure`]:{position:"relative",maxWidth:"none",margin:e.sizePopupArrow,display:"inline-block",[`${t}-content`]:{display:"inline-block"}}}]},p=e=>{const{componentCls:t}=e;return{[t]:i.i.map((o=>{const n=e[`${o}6`];return{[`&${t}-${o}`]:{"--antd-arrow-background-color":n,[`${t}-inner`]:{backgroundColor:n},[`${t}-arrow`]:{background:"transparent"}}}}))}},u=e=>{const{componentCls:t,lineWidth:o,lineType:n,colorSplit:r,paddingSM:l,controlHeight:i,fontSize:s,lineHeight:a,padding:c}=e,p=i-Math.round(s*a);return{[t]:{[`${t}-inner`]:{padding:0},[`${t}-title`]:{margin:0,padding:`${p/2}px ${c}px ${p/2-o}px`,borderBottom:`${o}px ${n} ${r}`},[`${t}-inner-content`]:{padding:`${l}px ${c}px`}}}};t.Z=(0,s.Z)("Popover",(e=>{const{colorBgElevated:t,colorText:o,wireframe:n}=e,l=(0,a.TS)(e,{popoverPadding:12,popoverBg:t,popoverColor:o});return[c(l),p(l),n&&u(l),(0,r._y)(l,"zoom-big")]}),(e=>({width:177,minWidth:177,zIndexPopup:e.zIndexPopupBase+30})),{resetStyle:!1,deprecatedTokens:[["width","minWidth"]]})},12563:function(e,t,o){"use strict";o.d(t,{Z:function(){return E}});var n=o(59301),r=o(51638),l=o(92310),i=o.n(l),s=o(36785),a=o(47729),c=o(14088),p=o(36355),u=o(17313),d=o(37613),f=o(83116);const h=e=>{const{lineWidth:t,fontSizeIcon:o}=e,n=e.fontSizeSM,r=e.lineHeightSM*n+"px";return(0,d.TS)(e,{tagFontSize:n,tagLineHeight:r,tagIconSize:o-2*t,tagPaddingHorizontal:8,tagBorderlessBg:e.colorFillTertiary})},m=e=>({defaultBg:e.colorFillQuaternary,defaultColor:e.colorText});var g=(0,f.Z)("Tag",(e=>(e=>{const{paddingXXS:t,lineWidth:o,tagPaddingHorizontal:n,componentCls:r}=e,l=n-o,i=t-o;return{[r]:Object.assign(Object.assign({},(0,u.Wf)(e)),{display:"inline-block",height:"auto",marginInlineEnd:e.marginXS,paddingInline:l,fontSize:e.tagFontSize,lineHeight:e.tagLineHeight,whiteSpace:"nowrap",background:e.defaultBg,border:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusSM,opacity:1,transition:`all ${e.motionDurationMid}`,textAlign:"start",position:"relative",[`&${r}-rtl`]:{direction:"rtl"},"&, a, a:hover":{color:e.defaultColor},[`${r}-close-icon`]:{marginInlineStart:i,color:e.colorTextDescription,fontSize:e.tagIconSize,cursor:"pointer",transition:`all ${e.motionDurationMid}`,"&:hover":{color:e.colorTextHeading}},[`&${r}-has-color`]:{borderColor:"transparent",[`&, a, a:hover, ${e.iconCls}-close, ${e.iconCls}-close:hover`]:{color:e.colorTextLightSolid}},"&-checkable":{backgroundColor:"transparent",borderColor:"transparent",cursor:"pointer",[`&:not(${r}-checkable-checked):hover`]:{color:e.colorPrimary,backgroundColor:e.colorFillSecondary},"&:active, &-checked":{color:e.colorTextLightSolid},"&-checked":{backgroundColor:e.colorPrimary,"&:hover":{backgroundColor:e.colorPrimaryHover}},"&:active":{backgroundColor:e.colorPrimaryActive}},"&-hidden":{display:"none"},[`> ${e.iconCls} + span, > span + ${e.iconCls}`]:{marginInlineStart:l}}),[`${r}-borderless`]:{borderColor:"transparent",background:e.tagBorderlessBg}}})(h(e))),m),v=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(o[n[r]]=e[n[r]])}return o};var b=e=>{const{prefixCls:t,style:o,className:r,checked:l,onChange:s,onClick:a}=e,c=v(e,["prefixCls","style","className","checked","onChange","onClick"]),{getPrefixCls:u,tag:d}=n.useContext(p.E_),f=u("tag",t),[h,m]=g(f),b=i()(f,`${f}-checkable`,{[`${f}-checkable-checked`]:l},null==d?void 0:d.className,r,m);return h(n.createElement("span",Object.assign({},c,{style:Object.assign(Object.assign({},o),null==d?void 0:d.style),className:b,onClick:e=>{null==s||s(!l),null==a||a(e)}})))},y=o(45157);var C=(0,f.b)(["Tag","preset"],(e=>(e=>(0,y.Z)(e,((t,o)=>{let{textColor:n,lightBorderColor:r,lightColor:l,darkColor:i}=o;return{[`${e.componentCls}-${t}`]:{color:n,background:l,borderColor:r,"&-inverse":{color:e.colorTextLightSolid,background:i,borderColor:i},[`&${e.componentCls}-borderless`]:{borderColor:"transparent"}}}})))(h(e))),m);const O=(e,t,o)=>{const n="string"!=typeof(r=o)?r:r.charAt(0).toUpperCase()+r.slice(1);var r;return{[`${e.componentCls}-${t}`]:{color:e[`color${o}`],background:e[`color${n}Bg`],borderColor:e[`color${n}Border`],[`&${e.componentCls}-borderless`]:{borderColor:"transparent"}}}};var x=(0,f.b)(["Tag","status"],(e=>{const t=h(e);return[O(t,"success","Success"),O(t,"processing","Info"),O(t,"error","Error"),O(t,"warning","Warning")]}),m),S=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(o[n[r]]=e[n[r]])}return o};const P=(e,t)=>{const{prefixCls:o,className:l,rootClassName:u,style:d,children:f,icon:h,color:m,onClose:v,closeIcon:b,closable:y,bordered:O=!0}=e,P=S(e,["prefixCls","className","rootClassName","style","children","icon","color","onClose","closeIcon","closable","bordered"]),{getPrefixCls:w,direction:E,tag:k}=n.useContext(p.E_),[$,L]=n.useState(!0);n.useEffect((()=>{"visible"in P&&L(P.visible)}),[P.visible]);const j=(0,s.o2)(m),T=(0,s.yT)(m),N=j||T,Z=Object.assign(Object.assign({backgroundColor:m&&!N?m:void 0},null==k?void 0:k.style),d),z=w("tag",o),[I,W]=g(z),M=i()(z,null==k?void 0:k.className,{[`${z}-${m}`]:N,[`${z}-has-color`]:m&&!N,[`${z}-hidden`]:!$,[`${z}-rtl`]:"rtl"===E,[`${z}-borderless`]:!O},l,u,W),B=e=>{e.stopPropagation(),null==v||v(e),e.defaultPrevented||L(!1)},[,H]=(0,a.Z)(y,b,(e=>null===e?n.createElement(r.Z,{className:`${z}-close-icon`,onClick:B}):n.createElement("span",{className:`${z}-close-icon`,onClick:B},e)),null,!1),_="function"==typeof P.onClick||f&&"a"===f.type,R=h||null,D=R?n.createElement(n.Fragment,null,R,f&&n.createElement("span",null,f)):f,F=n.createElement("span",Object.assign({},P,{ref:t,className:M,style:Z}),D,H,j&&n.createElement(C,{key:"preset",prefixCls:z}),T&&n.createElement(x,{key:"status",prefixCls:z}));return I(_?n.createElement(c.Z,{component:"Tag"},F):F)},w=n.forwardRef(P);w.CheckableTag=b;var E=w},51581:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),r=o(59301),l=s(r),i=s(o(12708));function s(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 o=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 o.scrollListener=o.scrollListener.bind(o),o.eventListenerOptions=o.eventListenerOptions.bind(o),o.mousewheelListener=o.mousewheelListener.bind(o),o}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),n(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,o=this.getParentElement(e),n=void 0;if(this.props.useWindow){var r=document.documentElement||document.body.parentNode||document.body,l=void 0!==t.pageYOffset?t.pageYOffset:r.scrollTop;n=this.props.isReverse?l:this.calculateOffset(e,l)}else n=this.props.isReverse?o.scrollTop:e.scrollHeight-o.scrollTop-o.clientHeight;n<Number(this.props.threshold)&&e&&null!==e.offsetParent&&(this.detachScrollListener(),this.beforeScrollHeight=o.scrollHeight,this.beforeScrollTop=o.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),o=t.children,n=t.element,r=t.hasMore,i=(t.initialLoad,t.isReverse),s=t.loader,a=(t.loadMore,t.pageStart,t.ref),c=(t.threshold,t.useCapture,t.useWindow,t.getScrollParent,function(e,t){var o={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}(t,["children","element","hasMore","initialLoad","isReverse","loader","loadMore","pageStart","ref","threshold","useCapture","useWindow","getScrollParent"]));c.ref=function(t){e.scrollComponent=t,a&&a(t)};var p=[o];return r&&(s?i?p.unshift(s):p.push(s):this.defaultLoader&&(i?p.unshift(this.defaultLoader):p.push(this.defaultLoader))),l.default.createElement(n,c,p)}}]),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,o){e.exports=o(51581)}}]); |