forked from bytedance/Elkeid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
5f42e5.0.min.js
1 lines (1 loc) · 8.65 KB
/
5f42e5.0.min.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[0],{666:function(e,t,a){"use strict";a(13),a(299),a(300),a(677)},667:function(e,t,a){var n=a(232),r=a(46);e.exports=function(e,t,a){var i=!0,o=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return r(a)&&(i="leading"in a?!!a.leading:i,o="trailing"in a?!!a.trailing:o),n(e,t,{leading:i,maxWait:t,trailing:o})}},672:function(e,t,a){"use strict";var n,r=a(0),i=a.n(r),o=a(1),l=a(76),c=a(54),s=a(60),u=function(){return(u=Object.assign||function(e){for(var t,a=1,n=arguments.length;a<n;a++)for(var r in t=arguments[a])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function p(e,t){switch(e){case"prev":return t&&t.prev?t.prev:i.a.createElement(l.a,null);case"next":return t&&t.next?t.next:i.a.createElement(c.a,null);case"more":return t&&t.more?t.more:i.a.createElement(s.a,null);default:return null}}!function(e){e[e.previous=0]="previous",e[e.next=1]="next"}(n||(n={}));var m=function(e){var t=e.rootPrefixCls,a=e.current,n=e.allPages,r=e.jumpPage,l=e.icons,c=e.disabled,s=e.pageItemStyle,u=e.itemRender,m=n>0?1:0,f=Math.min(n,Math.max(m,a+r)),g=t+"-item "+t+"-item-jumper",v=Object(o.a)(g),d=p("more",l);return i.a.createElement("li",{style:s,className:v,onClick:function(){!c&&e.onClick&&e.onClick(f)}},u?u(void 0,"more",d):d)},f=function(e){var t,a=e.rootPrefixCls,r=e.current,l=e.allPages,c=e.type,s=e.icons,u=e.disabled,m=e.pageItemStyle,f=e.itemRender,g=a+"-item",v=c===n.previous?p("prev",s):p("next",s),d=!1;d=0===l||(c===n.previous?r<=1:r===l);var y=u||d,h=r+(c===n.previous?-1:1);h=Math.max(0,Math.min(l,h));var b=n.previous===c?"prev":"next",P=Object(o.a)(g,g+"-"+b,((t={})[g+"-disabled"]=y,t));return i.a.createElement("li",{style:m,className:P,onClick:function(){y||e.onClick&&e.onClick(h)}},f?f(void 0,b,v):v)},g=function(e){var t=e.pageNum,a=e.current,n=e.rootPrefixCls,r=e.pageItemStyle,l=e.activePageItemStyle,c=e.itemRender,s=n+"-item",p=a===t,m=Object(o.a)(s,p?s+"-active":""),f=r;return p&&(f=u(u({},f),l)),i.a.createElement("li",{style:f,className:m,"data-active":p,onClick:function(t){var a=e.pageNum,n=e.onClick,r=e.disabled;"true"!==t.currentTarget.dataset.active&&(t.stopPropagation(),r||n&&n(a))}},c?c(t,"page",t):t)},v=a(211),d=a(3),y=function(){return(y=Object.assign||function(e){for(var t,a=1,n=arguments.length;a<n;a++)for(var r in t=arguments[a])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},h=function(){},b=v.a.Option,P=[10,20,30,40,50];var C=function(e){var t=Object(r.useRef)(),a=Object(r.useContext)(d.a).locale,n=e.sizeCanChange,o=void 0!==n&&n,l=e.onPageSizeChange,c=void 0===l?h:l,s=e.rootPrefixCls,u=e.sizeOptions,p=void 0===u?P:u,m=e.pageSize,f=void 0===m?10:m,g=e.size,C=e.selectProps,E=e.disabled;return o&&i.a.createElement("div",{ref:t,className:s+"-option"},i.a.createElement(v.a,y({value:-1!==p.indexOf(f)?f:p[0],onChange:function(e){c(e)},size:g,getPopupContainer:function(){return t.current},disabled:E},C),p.map((function(e){return i.a.createElement(b,{key:e,value:e},e+" "+a.Pagination.countPerPage)}))))},E=a(74),x=a(2),O=function(e,t){var a="function"==typeof Symbol&&e[Symbol.iterator];if(!a)return e;var n,r,i=a.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(a=i.return)&&a.call(i)}finally{if(r)throw r.error}}return o};var S=function(e){var t=e.simple?e.current:void 0,a=Object(r.useContext)(d.a).locale,n=O(Object(r.useState)(t),2),o=n[0],l=n[1],c=O(Object(r.useState)(t),2),s=c[0],u=c[1],p=Object(r.useRef)();Object(r.useEffect)((function(){e.current!==s&&e.simple&&(l(e.current),u(e.current))}),[e.current,e.simple,s]);var m=function(){var t=e.onPageChange,a=e.totalPages,n=e.current,r=e.simple;if(!Object(x.g)(o))if(o!==n||r){var i=isNaN(Number(o))?n:Number(o);i<1?i=1:i>a&&(i=a),l(r?i:void 0),Object(x.c)(t)&&t(i)}else l(void 0)},f=e.rootPrefixCls,g=e.simple,v=e.totalPages,y=e.size,h=e.disabled,b=f+"-jumper";return i.a.createElement("div",{className:""+b},!g&&i.a.createElement("span",{className:b+"-text-goto"},a.Pagination.goto),i.a.createElement(E.a,{ref:function(e){return p.current=e},className:b+"-input",value:Object(x.g)(o)?void 0:o.toString(),size:y,disabled:h||!v,onChange:function(e){var t=parseInt(e,10);l(isNaN(t)?void 0:t)},onPressEnter:m,onFocus:function(){var e=p.current.dom;String(o)&&e&&e.setSelectionRange(0,String(o).length)},onBlur:m}),g&&i.a.createElement(i.a.Fragment,null,i.a.createElement("span",{className:b+"-separator"},"/"),i.a.createElement("span",null,v)))},j=a(7),z=function(){return(z=Object.assign||function(e){for(var t,a=1,n=arguments.length;a<n;a++)for(var r in t=arguments[a])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},N=function(e,t){var a="function"==typeof Symbol&&e[Symbol.iterator];if(!a)return e;var n,r,i=a.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(a=i.return)&&a.call(i)}finally{if(r)throw r.error}}return o};function k(e,t){return Math.ceil(t/e)}var w={total:0,pageSizeChangeResetCurrent:!0,bufferSize:2};var R=Object(r.forwardRef)((function(e,t){var a,l=Object(r.useContext)(d.a),c=l.getPrefixCls,s=l.size,u=l.locale,p=l.componentConfig,v=Object(j.a)(e,w,null==p?void 0:p.Pagination),y=v.total,h=v.pageSize,b=v.current,P=v.bufferSize,E=v.showMore,x=v.pageSizeChangeResetCurrent,O=v.defaultCurrent,R=v.defaultPageSize,I=N(Object(r.useState)(b||O||1),2),M=I[0],J=I[1],T=N(Object(r.useState)(h||R||10),2),F=T[0],W=T[1],B=N(Object(r.useState)(y),2),q=B[0],A=B[1],D=N(Object(r.useState)(!!E),2),G=D[0],H=D[1];b&&!v.onChange&&console.warn("Warning: you have provide current prop for pagination but without onChange handler , this will cause no-change when you change page. "),Object(r.useEffect)((function(){if("total"in v&&y!==q&&A(y),!!E!==G&&H(!!E),b&&b!==M&&J(b),h&&h!==F){W(h);var e=k(h,y),t=M>e?e:M;t!==M&&J(t)}}),[h,y,E,b]);var K,L=function(e,t){void 0===e&&(e=M),void 0===t&&(t=F);var a=v.onChange;a&&a(e,t)},Q=function(e){"current"in v||J(e),L(e)},U=v.className,V=v.style,X=v.pageItemStyle,Y=v.activePageItemStyle,Z=v.showTotal,$=v.sizeCanChange,_=v.sizeOptions,ee=v.simple,te=v.mini,ae=v.showJumper,ne=v.selectProps,re=v.icons,ie=v.disabled,oe=v.itemRender,le=v.hideOnSinglePage,ce=v.size||s,se=c("pagination"),ue=te?"mini":ce,pe=Object(o.a)(se,se+"-size-"+ue,((a={})[se+"-simple"]=ee,a[se+"-disabled"]=ie,a),U),me=[],fe=k(F,q);if(le&&fe<=1)return null;var ge={onClick:Q,rootPrefixCls:se,simple:ee,current:M,allPages:fe,icons:re,disabled:ie,pageItemStyle:X,activePageItemStyle:Y,itemRender:oe};if(ee){var ve=se+"-item-simple";K=i.a.createElement("ul",{className:se+"-list"},i.a.createElement(f,z({key:"previous"},ge,{type:n.previous})),i.a.createElement("li",{className:ve+"-pager"},i.a.createElement(S,{disabled:ie,rootPrefixCls:se,totalPages:fe,current:M,onPageChange:Q,simple:!0,size:ue})),i.a.createElement(f,z({key:"next"},ge,{type:n.next})))}else{if(fe<6+2*P)for(var de=1;de<=fe;de++)me.push(i.a.createElement(g,z({},ge,{key:de,pageNum:de})));else{var ye=1,he=fe,be=!0,Pe=!0;M<=2*P?(be=!1,ye=1,he=Math.max(2*P+1,2+M)):fe-M<=3?(Pe=!1,he=fe,ye=Math.min(fe-2*P,M-2)):(he=M+2,ye=M-2);for(de=ye;de<=he;de++)me.push(i.a.createElement(g,z({key:de,pageNum:de},ge)));var Ce=i.a.createElement(m,z({},ge,{key:ye-1,type:n.previous,jumpPage:-(2*P+1)})),Ee=i.a.createElement(m,z({},ge,{key:he+1,type:n.next,jumpPage:2*P+1})),xe=i.a.createElement(g,z({key:1,pageNum:1},ge)),Oe=i.a.createElement(g,z({},ge,{key:fe,pageNum:fe}));be&&(me[0]=i.a.cloneElement(me[0],{className:se+"-item-after-pre"}),me.unshift(Ce),me.unshift(xe)),Pe&&(me[me.length-1]=i.a.cloneElement(me[me.length-1],{className:se+"-item-before-next"}),me.push(Ee),me.push(Oe))}K=i.a.createElement("ul",{className:se+"-list"},i.a.createElement(f,z({},ge,{key:"previous",type:n.previous})),me,G&&i.a.createElement(m,z({},ge,{key:fe+1,type:n.next,jumpPage:2*P+1})),i.a.createElement(f,z({key:"next"},ge,{type:n.next})))}var Se=null;return"boolean"==typeof Z&&Z&&(Se=i.a.createElement("div",{className:se+"-total-text"},u.Pagination.total.replace("{0}",q))),"function"==typeof Z&&(Se=i.a.createElement("div",{className:se+"-total-text"},Z(q,[(M-1)*F+1,M*F]))),i.a.createElement("div",{className:pe,style:V,ref:t},Se,K,i.a.createElement(C,{disabled:ie,rootPrefixCls:se,sizeCanChange:$,sizeOptions:_,onPageSizeChange:function(e){var t=v.onPageSizeChange,a=k(e,q),n={pageSize:e};n.current=x?1:M>a?a:M,"pageSize"in v||W(n.pageSize),"current"in v||M===n.current||J(n.current),t&&t(e,n.current),L(x?1:n.current,e)},pageSize:F,size:ue,selectProps:ne}),!ee&&ae&&i.a.createElement(S,{disabled:ie,rootPrefixCls:se,totalPages:fe,current:M,onPageChange:Q,size:ue}))}));R.displayName="Pagination";var I=R;t.a=I},677:function(e,t,a){}}]);