-
Notifications
You must be signed in to change notification settings - Fork 1
/
459-a242ce299808f150ebfc.js
1 lines (1 loc) · 15.1 KB
/
459-a242ce299808f150ebfc.js
1
(self.webpackChunkzent_docs=self.webpackChunkzent_docs||[]).push([[459],{82148:(e,t,n)=>{"use strict";n.d(t,{w:()=>i,Z:()=>u});var r=n(59312),o=n(8234);function a(e){var t=e.current,n=e.total,r=(0,o.J)(e),a=r.min,i=r.max,u=i-a+1+2,p=new Array(u);p[0]={type:"left-arrow",disabled:t<=1||n<=0};for(var s=a;s<=i;s++)p[s-a+1]={type:"number",page:s,selected:t===s};return p[u-1]={type:"right-arrow",disabled:t>=i||n<=0},p}var i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,r.ZT)(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"lite"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layoutFn",{get:function(){return a},enumerable:!1,configurable:!0}),t.defaultProps={current:1,pageSize:10,buttonBordered:!1,showQuickJumper:!1,showSizeChanger:!1},t}(n(72645).Z),u=i},36055:(e,t,n)=>{"use strict";n.d(t,{m:()=>c,Z:()=>g});var r=n(59312),o=n(24246),a=n(60042),i=n.n(a),u=n(88510),p=n(80964),s=function(e){function t(t){var n=e.call(this,t)||this;return n.reset=!1,n.state.prevCurrent=t.current,n}return(0,r.ZT)(t,e),t.prototype.render=function(){var e=this.state.value,t=this.props.totalPages;return(0,o.jsxs)("div",(0,r.pi)({className:"zent-pagination-mini-page-jumper","data-zv":"10.0.10"},{children:[(0,o.jsx)(p.Y,{integer:!0,value:e,onChange:this.onChange,onPressEnter:this.onConfirm,width:56},void 0),(0,o.jsx)("span",(0,r.pi)({className:"zent-pagination-mini-page-jumper__sep","data-zv":"10.0.10"},{children:"/"}),void 0),(0,o.jsx)("span",(0,r.pi)({className:"zent-pagination-mini-page-jumper__total","data-zv":"10.0.10"},{children:t}),void 0)]}),void 0)},t.getDerivedStateFromProps=function(e,t){return{value:e.current!==t.prevCurrent?e.current:t.value,prevCurrent:e.current}},t.prototype.handleJump=function(e){var t=this.props,n=t.onJump,r=t.totalPages;n(e),e>r&&this.setState({value:r}),e<1&&this.setState({value:1})},t}(n(17840).Z),l=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.onPrevPage=t.jumpToPageDelta(-1),t.onNextPage=t.jumpToPageDelta(1),t}return(0,r.ZT)(t,e),t.prototype.resetActiveDoubleArrowButton=function(){},t.prototype.render=function(){var e=this,t=this.props,n=t.layout,a=t.buttonBordered,i=t.current,p=t.onPageChange,l=t.lastPageHelp;return(0,o.jsx)("div",(0,r.pi)({className:"zent-pagination-page-list--mini","data-zv":"10.0.10"},{children:n.map((function(t){var n=t.type;return"left-arrow"===n?(0,o.jsx)(u.Z,{direction:"left",disabled:t.disabled,bordered:a,onClick:e.onPrevPage},n):"right-arrow"===n?(0,o.jsx)(u.Z,{direction:"right",disabled:t.disabled,bordered:a,onClick:e.onNextPage,disabledHelp:l},n):"mini-jumper"===n?(0,o.jsx)(s,{current:i,totalPages:t.totalPages,onJump:p},n):null}))}),void 0)},t}(n(28645).Z);function d(e){var t=e.current,n=e.pageSize,r=e.total,o=Math.ceil(r/n);return[{type:"left-arrow",disabled:t<=1||r<=0},{type:"mini-jumper",totalPages:o},{type:"right-arrow",disabled:t>=o||r<=0}]}var c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,r.ZT)(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"mini"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layoutFn",{get:function(){return d},enumerable:!1,configurable:!0}),t.prototype.render=function(){var e=this.props,t=e.current,n=e.buttonBordered,a=e.className,u=e.lastPageHelp,p=this.getLayout(this.props);return(0,o.jsx)("div",(0,r.pi)({className:i()("zent-pagination zent-pagination--"+this.name,a),"data-zv":"10.0.10"},{children:(0,o.jsx)(l,{layout:p,current:t,onPageChange:this.onPageChange,buttonBordered:n,lastPageHelp:u},void 0)}),void 0)},t.defaultProps={current:1,pageSize:10,buttonBordered:!1},t}(n(97714).Z),g=c},31770:(e,t,n)=>{"use strict";n.d(t,{t:()=>i,Z:()=>u});var r=n(59312),o=n(8234);function a(e){var t=e.pageSize,n=e.total,a=e.current,i=Math.ceil(n/t);if(i<=5){var u=2+i,p=new Array(u);p[0]={type:"left-arrow",disabled:a<=1||n<=0},p[u-1]={type:"right-arrow",disabled:a>=i||n<=0};for(var s=1;s<=i;s++)p[s]={type:"number",page:s,selected:a===s};return p}var l=[{type:"left-arrow",disabled:a<=1||n<=0},{type:"number",page:1,selected:1===a||n<=0}];a>4&&l.push({type:"double-left-arrow"});var d=(0,o.J)((0,r.pi)((0,r.pi)({},e),{startDelta:1,endDelta:-1})),c=d.min,g=d.max;for(s=c;s<=g;s++)l.push({type:"number",page:s,selected:a===s});return a<i-3&&l.push({type:"double-right-arrow"}),l.push({type:"number",page:i,selected:a===i},{type:"right-arrow",disabled:a>=i||n<=0}),function(e,t){if(e.length<4)return e;var n=e[1],r=e[2],o=e[3];if("double-left-arrow"===r.type&&"number"===n.type&&"number"===o.type){var a=o.page-n.page;if(2===a){var i=n.page+1;e[2]={type:"number",page:i,selected:t===i}}else 1===a&&e.splice(2,1)}}(l,a),function(e,t){if(e.length<5)return e;var n=e.length,r=e[n-2],o=e[n-3],a=e[n-4];if("double-right-arrow"===o.type&&"number"===a.type&&"number"===r.type){var i=r.page-a.page;if(2===i){var u=a.page+1;e[n-3]={type:"number",page:u,selected:u===t}}else 1===i&&e.splice(n-3,1)}}(l,a),l}var i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,r.ZT)(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"normal"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layoutFn",{get:function(){return a},enumerable:!1,configurable:!0}),t.defaultProps={current:1,pageSize:10,buttonBordered:!0,showQuickJumper:!0,showSizeChanger:!0},t}(n(72645).Z),u=i},88510:(e,t,n)=>{"use strict";var r=n(59312),o=n(24246),a=n(27378),i=n(60042),u=n.n(i),p=n(90347),s=n(85883),l=n(27036),d={position:"top-right",trigger:"hover",centerArrow:!0},c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,r.ZT)(t,e),t.prototype.render=function(){var e=this.props,t=e.direction,n=e.double,a=e.active,i=e.bordered,l=e.disabledHelp,c=(0,r._T)(e,["direction","double","active","bordered","disabledHelp"]);if(n)return(0,o.jsx)(g,(0,r.pi)({direction:t,active:a,bordered:i},c),void 0);var f=null;"left"===t?f=h:"right"===t&&(f=v);var m=(0,o.jsx)(p.ZP,(0,r.pi)({},c,{className:u()("zent-pagination-arrow-button","zent-pagination-button--layout",{"zent-pagination-page-button--no-border":!i})},{children:(0,o.jsx)(f,{},void 0)}),void 0);if(l&&c.disabled){var b=(0,r.pi)((0,r.pi)({},d),l);return"hover"===b.trigger&&(b.fixMouseEventsOnDisabledChildren=!0),(0,o.jsx)(s.Z,(0,r.pi)({},b,{children:m}),void 0)}return m},t.defaultProps={double:!1,active:!1,bordered:!0},t}(a.Component),g=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={showArrow:!1,prevActive:!1},t.onMouseOver=function(){t.setState({showArrow:!0})},t.onMouseOut=function(){t.setState({showArrow:!1})},t}return(0,r.ZT)(t,e),t.prototype.render=function(){var e=this.props,t=e.direction,n=e.active,a=e.bordered,i=(e.double,(0,r._T)(e,["direction","active","bordered","double"])),s=null;"left"===t?s=f:"right"===t&&(s=m);var d=this.state.showArrow;return(0,o.jsx)(p.ZP,(0,r.pi)({className:u()("zent-pagination-arrow-button","zent-pagination-arrow-button--double","zent-pagination-button--layout",{"zent-pagination-arrow-button--double-active":d,"zent-pagination-page-button--no-border":!a})},i,{onMouseOver:n?void 0:this.onMouseOver,onMouseLeave:n?void 0:this.onMouseOut},{children:d?(0,o.jsx)(s,{},void 0):(0,o.jsx)(l.Z,{type:"more",className:"zent-pagination-more"},void 0)}),void 0)},t.getDerivedStateFromProps=function(e,t){var n=e.active,r={prevActive:n,showArrow:t.showArrow};return n!==t.prevActive&&(r.showArrow=!!n),r},t.defaultProps={double:!1,active:!1,bordered:!0},t}(a.Component);function h(){return(0,o.jsx)(l.Z,{type:"left",className:"zent-pagination-arrow"},void 0)}function v(){return(0,o.jsx)(l.Z,{type:"right",className:"zent-pagination-arrow"},void 0)}function f(){return(0,o.jsx)(l.Z,{type:"double-last",className:"zent-pagination-arrow"},void 0)}function m(){return(0,o.jsx)(l.Z,{type:"double-next",className:"zent-pagination-arrow"},void 0)}t.Z=c},17840:(e,t,n)=>{"use strict";var r=n(59312),o=function(e){function t(t){var n,r=e.call(this,t)||this;return r.onChange=function(e){r.setState({value:e})},r.onConfirm=function(e){e.preventDefault();var t=+e.target.value;r.handleJump(t)},r.state={value:null!==(n=t.current)&&void 0!==n?n:null},r}return(0,r.ZT)(t,e),t}(n(27378).Component);t.Z=o},28645:(e,t,n)=>{"use strict";var r=n(59312),o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.onPageNumberClick=function(e){return function(){(0,t.props.onPageChange)(e),t.resetActiveDoubleArrowButton()}},t.jumpToPageDelta=function(e,n){return function(){var r=t.props,o=r.current;(0,r.onPageChange)(o+e),n&&n()}},t}return(0,r.ZT)(t,e),t}(n(27378).Component);t.Z=o},72645:(e,t,n)=>{"use strict";n.d(t,{Z:()=>w});var r=n(59312),o=n(24246),a=n(60042),i=n.n(a),u=n(27378),p=n(41925),s=n(7360),l=n(52074),d=(0,p.Z)((function(e,t){return(e||[]).map((function(e){return"number"==typeof e?{key:e,text:e+" "+t.items}:{key:e.value,text:e.text}}))})),c=function(e){return(0,o.jsx)("span",(0,r.pi)({className:"zent-pagination-count--"+e.type,"data-zv":"10.0.10"},{children:e.children}),void 0)},g=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,r.ZT)(t,e),t.prototype.render=function(){var e=this.props,t=e.total,n=e.formatTotal,a=e.pageSize,i=e.pageSizeOptions,u=e.onPageSizeChange;if(!i||0===i.length)return(0,o.jsx)(v,{total:t,formatTotal:n,pageSize:a},void 0);var p=n?n(t):t;return(0,o.jsx)(l.Z,(0,r.pi)({componentName:"Pagination"},{children:function(e){var t=(0,o.jsx)(h,{pageSizeOptions:i,onPageSizeChange:u,pageSize:a,i18n:e},void 0);return(0,o.jsx)("div",(0,r.pi)({className:"zent-pagination-page-size-changer","data-zv":"10.0.10"},{children:e.pageStats({select:t,total:p,Text:c})}),void 0)}}),void 0)},t}(u.Component),h=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.onChange=function(e){var n=e.key;t.props.onPageSizeChange(n)},t}return(0,r.ZT)(t,e),t.prototype.render=function(){var e=this.props,t=e.pageSize,n=e.i18n,r=e.pageSizeOptions,a=d(r,n);return(0,o.jsx)(s.Z,{width:n.selectWidth,options:a,value:{key:t,text:t+" "+n.items},onChange:this.onChange},void 0)},t}(u.Component),v=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,r.ZT)(t,e),t.prototype.render=function(){var e=this.props,t=e.total,n=e.formatTotal,a=e.pageSize,i=n?n(t):t;return(0,o.jsx)(l.Z,(0,r.pi)({componentName:"Pagination"},{children:function(e){return(0,o.jsx)("div",(0,r.pi)({className:"zent-pagination-page-size-changer","data-zv":"10.0.10"},{children:e.pageStatsStatic({total:i,pageSize:a,Text:c})}),void 0)}}),void 0)},t}(u.Component),f=n(88510),m=n(90347),b=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,r.ZT)(t,e),t.prototype.render=function(){var e,t=this.props,n=t.selected,a=t.bordered,u=(0,r._T)(t,["selected","bordered"]);return e=n?"primary":"default",(0,o.jsx)(m.ZP,(0,r.pi)({},u,{type:e,className:i()("zent-pagination-page-number-button","zent-pagination-button--layout",{"zent-pagination-page-button--no-border":!a})}),void 0)},t.defaultProps={selected:!1,bordered:!0},t}(u.Component),y=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={activeDoubleArrowButton:""},t.onPrevPage=t.jumpToPageDelta(-1,t.resetActiveDoubleArrowButton),t.onNextPage=t.jumpToPageDelta(1,t.resetActiveDoubleArrowButton),t.onFastForwardPrevPage=t.jumpToPageDelta(-5,(function(){t.setState({activeDoubleArrowButton:"left"})})),t.onFastForwardNextPage=t.jumpToPageDelta(5,(function(){t.setState({activeDoubleArrowButton:"right"})})),t.resetActiveDoubleArrowButton=function(){t.setState({activeDoubleArrowButton:""})},t}return(0,r.ZT)(t,e),t.prototype.render=function(){var e=this,t=this.props,n=t.layout,a=t.buttonBordered,i=t.lastPageHelp,u=this.state.activeDoubleArrowButton;return(0,o.jsx)("div",(0,r.pi)({className:"zent-pagination-page-list--normal","data-zv":"10.0.10"},{children:n.map((function(t){var n=t.type;if("number"===n){var p=t.page,s=t.selected;return(0,o.jsx)(b,(0,r.pi)({selected:s,bordered:a,onClick:e.onPageNumberClick(p)},{children:p}),"page-"+p)}return"left-arrow"===n?(0,o.jsx)(f.Z,{direction:"left",disabled:t.disabled,bordered:a,onClick:e.onPrevPage},n):"right-arrow"===n?(0,o.jsx)(f.Z,{direction:"right",disabled:t.disabled,bordered:a,onClick:e.onNextPage,disabledHelp:i},n):"double-left-arrow"===n?(0,o.jsx)(f.Z,{direction:"left",double:!0,active:"left"===u,bordered:a,onClick:e.onFastForwardPrevPage},n):"double-right-arrow"===n?(0,o.jsx)(f.Z,{direction:"right",double:!0,active:"right"===u,bordered:a,onClick:e.onFastForwardNextPage},n):null}))}),void 0)},t}(n(28645).Z),z=n(80964),P=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,r.ZT)(t,e),t.prototype.render=function(){var e=this.state.value,t=(0,o.jsx)(z.Y,{integer:!0,value:e,onChange:this.onChange,onPressEnter:this.onConfirm,width:56},void 0);return(0,o.jsx)(l.Z,(0,r.pi)({componentName:"Pagination"},{children:function(e){return(0,o.jsx)("div",(0,r.pi)({className:"zent-pagination-page-jumper","data-zv":"10.0.10"},{children:e.jumpTo({input:t})}),void 0)}}),void 0)},t.prototype.handleJump=function(e){this.props.onJump(e),this.setState({value:null})},t}(n(17840).Z),w=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,r.ZT)(t,e),t.prototype.render=function(){var e=this.getLayout(this.props),t=this.props,n=t.current,a=t.pageSize,u=t.pageSizeOptions,p=t.showQuickJumper,s=t.showSizeChanger,l=t.buttonBordered,d=t.className,c=t.formatTotal,h=t.lastPageHelp,v=this.getTotal();return(0,o.jsxs)("div",(0,r.pi)({className:i()("zent-pagination zent-pagination--"+this.name,d),"data-zv":"10.0.10"},{children:[s&&(0,o.jsx)(g,{pageSize:a,total:v,formatTotal:c,pageSizeOptions:u,onPageSizeChange:this.onPageSizeChange},void 0),(0,o.jsx)(y,{layout:e,current:n,buttonBordered:l,onPageChange:this.onPageChange,lastPageHelp:h},void 0),p&&(0,o.jsx)(P,{onJump:this.onPageChange},void 0)]}),void 0)},t}(n(97714).Z)},97714:(e,t,n)=>{"use strict";var r=n(59312),o=n(27378),a=n(41925),i=n(72551),u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.getLayout=(0,a.Z)((function(e){return t.layoutFn(t.getLayoutOptions(e))})),t.onPageChange=function(e){var n=t.props,r=n.current,o=n.pageSize,a=n.onChange,i=t.getTotal();e=Math.max(1,e),(e=Math.min(e,t.getTotalPages(i,o)))!==r&&a({current:e,pageSize:o})},t.onPageSizeChange=function(e){var n=t.props.current,r=t.getTotal();if(t.props.pageSize!==e){var o=t.getTotalPages(r,e),a={pageSize:e,current:Math.min(n,o)};t.props.onChange(a)}},t}return(0,r.ZT)(t,e),t.prototype.shouldUpdateLayout=function(e,t){var n=t.current,r=t.pageSize;return n!==e.current||this.getTotal(t)!==this.getTotal(e)||r!==e.pageSize},t.prototype.getLayoutOptions=function(e){var t=e.current,n=e.pageSize;return{current:t,total:this.getTotal(e),pageSize:n}},t.prototype.getTotalPages=function(e,t){return Math.ceil(e/t)},t.prototype.getTotal=function(e){return e=e||this.props,(0,i.n)(e,"total")?e.total||0:(0,i.n)(e,"totalItem")&&e.totalItem||0},t}(o.Component);t.Z=u},8234:(e,t,n)=>{"use strict";function r(e){var t=e.pageSize,n=e.total,r=e.current,o=e.startDelta,a=e.endDelta,i=1+(o||0),u=Math.ceil(n/t)+(a||0),p=Math.max(i,r-2),s=Math.min(r+2,u),l=s-p+1;if(l<5){var d=5-l;p>i&&(p=Math.max(i,p-d)),s<u&&(s=Math.min(s+d,u))}return{min:p,max:s}}n.d(t,{J:()=>r})},7360:(e,t,n)=>{"use strict";var r=n(95388);t.Z=r.Z}}]);