From 68f7b23c678f902ff91aaedd428d3c985ce5f432 Mon Sep 17 00:00:00 2001 From: Fatih Date: Tue, 24 Nov 2015 14:35:49 +0200 Subject: [PATCH] don't draw pagination dropdown for <=1 options --- dist/react-bootstrap-table.min.js | 8 ++++---- lib/pagination/PaginationList.js | 4 ++-- src/pagination/PaginationList.js | 4 ++++ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/dist/react-bootstrap-table.min.js b/dist/react-bootstrap-table.min.js index d3c025930..2af1fe1c9 100644 --- a/dist/react-bootstrap-table.min.js +++ b/dist/react-bootstrap-table.min.js @@ -1,8 +1,8 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):"object"==typeof exports?exports.ReactBootstrapTable=t(require("react"),require("react-dom")):e.ReactBootstrapTable=t(e.React,e.ReactDOM)}(this,function(e,t){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=r(1),i=n(o),a=r(39),s=n(a),l=r(33);"undefined"!=typeof window&&(window.BootstrapTable=i["default"],window.TableHeaderColumn=s["default"]),t["default"]={BootstrapTable:i["default"],TableHeaderColumn:s["default"],TableDataSet:l.TableDataSet},e.exports=t["default"]},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r0)||confirm("Are you sure want delete?")){if(this.store.remove(t),this.store.setSelectedRowKey([]),this.props.pagination){var r=this.refs.pagination.getSizePerPage(),n=Math.ceil(this.store.getDataNum()/r),o=this.refs.pagination.getCurrentPage();o>n&&(o=n),e=this.store.page(o,r).get(),this.setState({data:e,selectedRowKeys:this.store.getSelectedRowKeys()}),this.refs.pagination.changePage(o)}else e=this.store.get(),this.setState({data:e,selectedRowKeys:this.store.getSelectedRowKeys()});this.props.options.afterDeleteRow&&this.props.options.afterDeleteRow(t)}}},{key:"handleFilterData",value:function(e){this.store.filter(e);var t=void 0;if(this.props.pagination){var r=this.refs.pagination.getSizePerPage();t=this.store.page(1,r).get(),this.refs.pagination.changePage(1)}else t=this.store.get();this.props.options.afterColumnFilter&&this.props.options.afterColumnFilter(e,this.store.getDataIgnoringPagination()),this.setState({data:t})}},{key:"handleExportCSV",value:function(){var e=this.store.getDataIgnoringPagination(),t=[];this.props.children.map(function(e){e.props.hidden===!1&&t.push(e.props.dataField)}),(0,O["default"])(e,t,this.props.csvFileName)}},{key:"handleSearch",value:function(e){this.store.search(e);var t=void 0;if(this.props.pagination){var r=this.refs.pagination.getSizePerPage();t=this.store.page(1,r).get(),this.refs.pagination.changePage(1)}else t=this.store.get();this.props.options.afterSearch&&this.props.options.afterSearch(e,this.store.getDataIgnoringPagination()),this.setState({data:t})}},{key:"renderPagination",value:function(){if(this.props.pagination){var e=void 0;return e=this.isRemoteDataSource()?this.props.fetchInfo.dataTotalSize:this.store.getDataNum(),u["default"].createElement("div",null,u["default"].createElement(b["default"],{ref:"pagination",currPage:this.props.options.page||1,changePage:this.handlePaginationData.bind(this),sizePerPage:this.props.options.sizePerPage||f["default"].SIZE_PER_PAGE_LIST[0],sizePerPageList:this.props.options.sizePerPageList||f["default"].SIZE_PER_PAGE_LIST,paginationSize:this.props.options.paginationSize||f["default"].PAGINATION_SIZE,remote:this.isRemoteDataSource(),dataSize:e}))}return null}},{key:"renderToolBar",value:function(){var e=void 0;return e=Array.isArray(this.props.children)?this.props.children.map(function(e){var t=e.props;return{name:t.children,field:t.dataField,autoValue:t.autoValue||!1,editable:t.editable&&"function"==typeof t.editable?t.editable():t.editable,format:t.format?format:!1}}):[{name:this.props.children.props.children,field:this.props.children.props.dataField,editable:this.props.children.props.editable}],this.props.insertRow||this.props.deleteRow||this.props.search||this.props.exportCSV?u["default"].createElement("div",{className:"tool-bar"},u["default"].createElement(E["default"],{enableInsert:this.props.insertRow,enableDelete:this.props.deleteRow,enableSearch:this.props.search,enableExportCSV:this.props.exportCSV,columns:e,searchPlaceholder:this.props.searchPlaceholder,onAddRow:this.handleAddRow.bind(this),onAddRowBegin:this.handleAddRowBegin.bind(this),onDropRow:this.handleDropRow.bind(this),onSearch:this.handleSearch.bind(this),onExportCSV:this.handleExportCSV.bind(this)})):null}},{key:"renderTableFilter",value:function(e){return this.props.columnFilter?u["default"].createElement(P["default"],{columns:e,rowSelectType:this.props.selectRow.mode,onFilter:this.handleFilterData.bind(this)}):null}},{key:"_scrollHeader",value:function(e){this.refs.header.refs.container.scrollLeft=e.currentTarget.scrollLeft}},{key:"_adjustHeaderWidth",value:function(){var e=this.refs.header.refs.container.childNodes[0],t=this.refs.body.refs.container.childNodes[0];e.offsetWidth!==t.offsetWidth&&(e.style.width=t.offsetWidth+"px");var r=this.refs.body.getBodyHeaderDomProp();this.refs.header.fitHeader(r,this.refs.body.refs.container.scrollHeight>this.refs.body.refs.container.clientHeight)}}]),t}(u["default"].Component);C.propTypes={keyField:u["default"].PropTypes.string,height:u["default"].PropTypes.string,data:u["default"].PropTypes.oneOfType([u["default"].PropTypes.array,u["default"].PropTypes.object]),remote:u["default"].PropTypes.bool,striped:u["default"].PropTypes.bool,bordered:u["default"].PropTypes.bool,hover:u["default"].PropTypes.bool,condensed:u["default"].PropTypes.bool,pagination:u["default"].PropTypes.bool,searchPlaceholder:u["default"].PropTypes.string,selectRow:u["default"].PropTypes.shape({mode:u["default"].PropTypes.string,bgColor:u["default"].PropTypes.string,selected:u["default"].PropTypes.array,onSelect:u["default"].PropTypes.func,onSelectAll:u["default"].PropTypes.func,clickToSelect:u["default"].PropTypes.bool,hideSelectColumn:u["default"].PropTypes.bool,clickToSelectAndEditCell:u["default"].PropTypes.bool}),cellEdit:u["default"].PropTypes.shape({mode:u["default"].PropTypes.string,blurToSave:u["default"].PropTypes.bool,afterSaveCell:u["default"].PropTypes.func}),insertRow:u["default"].PropTypes.bool,deleteRow:u["default"].PropTypes.bool,search:u["default"].PropTypes.bool,columnFilter:u["default"].PropTypes.bool,trClassName:u["default"].PropTypes.any,options:u["default"].PropTypes.shape({sortName:u["default"].PropTypes.string,sortOrder:u["default"].PropTypes.string,afterTableComplete:u["default"].PropTypes.func,afterDeleteRow:u["default"].PropTypes.func,afterInsertRow:u["default"].PropTypes.func,afterSearch:u["default"].PropTypes.func,afterColumnFilter:u["default"].PropTypes.func,onRowClick:u["default"].PropTypes.func,page:u["default"].PropTypes.number,sizePerPageList:u["default"].PropTypes.array,sizePerPage:u["default"].PropTypes.number,paginationSize:u["default"].PropTypes.number,onSortChange:u["default"].PropTypes.func,onPageChange:u["default"].PropTypes.func}),fetchInfo:u["default"].PropTypes.shape({dataTotalSize:u["default"].PropTypes.number}),exportCSV:u["default"].PropTypes.bool,csvFileName:u["default"].PropTypes.string},C.defaultProps={height:"100%",striped:!1,bordered:!0,hover:!1,condensed:!1,pagination:!1,searchPlaceholder:void 0,selectRow:{mode:f["default"].ROW_SELECT_NONE,bgColor:f["default"].ROW_SELECT_BG_COLOR,selected:[],onSelect:void 0,onSelectAll:void 0,clickToSelect:!1,hideSelectColumn:!1,clickToSelectAndEditCell:!1},cellEdit:{mode:f["default"].CELL_EDIT_NONE,blurToSave:!1,afterSaveCell:void 0},insertRow:!1,deleteRow:!1,search:!1,multiColumnSearch:!1,columnFilter:!1,trClassName:"",options:{sortName:void 0,sortOrder:f["default"].SORT_DESC,afterTableComplete:void 0,afterDeleteRow:void 0,afterInsertRow:void 0,afterSearch:void 0,afterColumnFilter:void 0,onRowClick:void 0,page:1,sizePerPageList:f["default"].SIZE_PER_PAGE_LIST,sizePerPage:f["default"].SIZE_PER_PAGE_LIST[0],paginationSize:f["default"].PAGINATION_SIZE},fetchInfo:{dataTotalSize:0},exportCSV:!1,csvFileName:void 0},t["default"]=C,e.exports=t["default"]},function(t,r){t.exports=e},function(e,t,r){var n;/*! +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):"object"==typeof exports?exports.ReactBootstrapTable=t(require("react"),require("react-dom")):e.ReactBootstrapTable=t(e.React,e.ReactDOM)}(this,function(e,t){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=r(1),i=n(o),a=r(40),s=n(a),l=r(34);"undefined"!=typeof window&&(window.BootstrapTable=i["default"],window.TableHeaderColumn=s["default"]),t["default"]={BootstrapTable:i["default"],TableHeaderColumn:s["default"],TableDataSet:l.TableDataSet},e.exports=t["default"]},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r0)||confirm("Are you sure want delete?")){if(this.store.remove(t),this.store.setSelectedRowKey([]),this.props.pagination){var r=this.refs.pagination.getSizePerPage(),n=Math.ceil(this.store.getDataNum()/r),o=this.refs.pagination.getCurrentPage();o>n&&(o=n),e=this.store.page(o,r).get(),this.setState({data:e,selectedRowKeys:this.store.getSelectedRowKeys()}),this.refs.pagination.changePage(o)}else e=this.store.get(),this.setState({data:e,selectedRowKeys:this.store.getSelectedRowKeys()});this.props.options.afterDeleteRow&&this.props.options.afterDeleteRow(t)}}},{key:"handleFilterData",value:function(e){this.store.filter(e);var t=void 0;if(this.props.pagination){var r=this.refs.pagination.getSizePerPage();t=this.store.page(1,r).get(),this.refs.pagination.changePage(1)}else t=this.store.get();this.props.options.afterColumnFilter&&this.props.options.afterColumnFilter(e,this.store.getDataIgnoringPagination()),this.setState({data:t})}},{key:"handleExportCSV",value:function(){var e=this.store.getDataIgnoringPagination(),t=[];this.props.children.map(function(e){e.props.hidden===!1&&t.push(e.props.dataField)}),(0,O["default"])(e,t,this.props.csvFileName)}},{key:"handleSearch",value:function(e){this.store.search(e);var t=void 0;if(this.props.pagination){var r=this.refs.pagination.getSizePerPage();t=this.store.page(1,r).get(),this.refs.pagination.changePage(1)}else t=this.store.get();this.props.options.afterSearch&&this.props.options.afterSearch(e,this.store.getDataIgnoringPagination()),this.setState({data:t})}},{key:"renderPagination",value:function(){if(this.props.pagination){var e=void 0;return e=this.isRemoteDataSource()?this.props.fetchInfo.dataTotalSize:this.store.getDataNum(),u["default"].createElement("div",null,u["default"].createElement(b["default"],{ref:"pagination",currPage:this.props.options.page||1,changePage:this.handlePaginationData.bind(this),sizePerPage:this.props.options.sizePerPage||f["default"].SIZE_PER_PAGE_LIST[0],sizePerPageList:this.props.options.sizePerPageList||f["default"].SIZE_PER_PAGE_LIST,paginationSize:this.props.options.paginationSize||f["default"].PAGINATION_SIZE,remote:this.isRemoteDataSource(),dataSize:e}))}return null}},{key:"renderToolBar",value:function(){var e=void 0;return e=Array.isArray(this.props.children)?this.props.children.map(function(e){var t=e.props;return{name:t.children,field:t.dataField,autoValue:t.autoValue||!1,editable:t.editable&&"function"==typeof t.editable?t.editable():t.editable,format:t.format?format:!1}}):[{name:this.props.children.props.children,field:this.props.children.props.dataField,editable:this.props.children.props.editable}],this.props.insertRow||this.props.deleteRow||this.props.search||this.props.exportCSV?u["default"].createElement("div",{className:"tool-bar"},u["default"].createElement(_["default"],{enableInsert:this.props.insertRow,enableDelete:this.props.deleteRow,enableSearch:this.props.search,enableExportCSV:this.props.exportCSV,columns:e,searchPlaceholder:this.props.searchPlaceholder,onAddRow:this.handleAddRow.bind(this),onAddRowBegin:this.handleAddRowBegin.bind(this),onDropRow:this.handleDropRow.bind(this),onSearch:this.handleSearch.bind(this),onExportCSV:this.handleExportCSV.bind(this)})):null}},{key:"renderTableFilter",value:function(e){return this.props.columnFilter?u["default"].createElement(P["default"],{columns:e,rowSelectType:this.props.selectRow.mode,onFilter:this.handleFilterData.bind(this)}):null}},{key:"_scrollHeader",value:function(e){this.refs.header.refs.container.scrollLeft=e.currentTarget.scrollLeft}},{key:"_adjustHeaderWidth",value:function(){var e=this.refs.header.refs.container.childNodes[0],t=this.refs.body.refs.container.childNodes[0];e.offsetWidth!==t.offsetWidth&&(e.style.width=t.offsetWidth+"px");var r=this.refs.body.getBodyHeaderDomProp();this.refs.header.fitHeader(r,this.refs.body.refs.container.scrollHeight>this.refs.body.refs.container.clientHeight)}}]),t}(u["default"].Component);C.propTypes={keyField:u["default"].PropTypes.string,height:u["default"].PropTypes.string,data:u["default"].PropTypes.oneOfType([u["default"].PropTypes.array,u["default"].PropTypes.object]),remote:u["default"].PropTypes.bool,striped:u["default"].PropTypes.bool,bordered:u["default"].PropTypes.bool,hover:u["default"].PropTypes.bool,condensed:u["default"].PropTypes.bool,pagination:u["default"].PropTypes.bool,searchPlaceholder:u["default"].PropTypes.string,selectRow:u["default"].PropTypes.shape({mode:u["default"].PropTypes.string,bgColor:u["default"].PropTypes.string,selected:u["default"].PropTypes.array,onSelect:u["default"].PropTypes.func,onSelectAll:u["default"].PropTypes.func,clickToSelect:u["default"].PropTypes.bool,hideSelectColumn:u["default"].PropTypes.bool,clickToSelectAndEditCell:u["default"].PropTypes.bool}),cellEdit:u["default"].PropTypes.shape({mode:u["default"].PropTypes.string,blurToSave:u["default"].PropTypes.bool,afterSaveCell:u["default"].PropTypes.func}),insertRow:u["default"].PropTypes.bool,deleteRow:u["default"].PropTypes.bool,search:u["default"].PropTypes.bool,columnFilter:u["default"].PropTypes.bool,trClassName:u["default"].PropTypes.any,options:u["default"].PropTypes.shape({sortName:u["default"].PropTypes.string,sortOrder:u["default"].PropTypes.string,afterTableComplete:u["default"].PropTypes.func,afterDeleteRow:u["default"].PropTypes.func,afterInsertRow:u["default"].PropTypes.func,afterSearch:u["default"].PropTypes.func,afterColumnFilter:u["default"].PropTypes.func,onRowClick:u["default"].PropTypes.func,page:u["default"].PropTypes.number,sizePerPageList:u["default"].PropTypes.array,sizePerPage:u["default"].PropTypes.number,paginationSize:u["default"].PropTypes.number,onSortChange:u["default"].PropTypes.func,onPageChange:u["default"].PropTypes.func}),fetchInfo:u["default"].PropTypes.shape({dataTotalSize:u["default"].PropTypes.number}),exportCSV:u["default"].PropTypes.bool,csvFileName:u["default"].PropTypes.string},C.defaultProps={height:"100%",striped:!1,bordered:!0,hover:!1,condensed:!1,pagination:!1,searchPlaceholder:void 0,selectRow:{mode:f["default"].ROW_SELECT_NONE,bgColor:f["default"].ROW_SELECT_BG_COLOR,selected:[],onSelect:void 0,onSelectAll:void 0,clickToSelect:!1,hideSelectColumn:!1,clickToSelectAndEditCell:!1},cellEdit:{mode:f["default"].CELL_EDIT_NONE,blurToSave:!1,afterSaveCell:void 0},insertRow:!1,deleteRow:!1,search:!1,multiColumnSearch:!1,columnFilter:!1,trClassName:"",options:{sortName:void 0,sortOrder:f["default"].SORT_DESC,afterTableComplete:void 0,afterDeleteRow:void 0,afterInsertRow:void 0,afterSearch:void 0,afterColumnFilter:void 0,onRowClick:void 0,page:1,sizePerPageList:f["default"].SIZE_PER_PAGE_LIST,sizePerPage:f["default"].SIZE_PER_PAGE_LIST[0],paginationSize:f["default"].PAGINATION_SIZE},fetchInfo:{dataTotalSize:0},exportCSV:!1,csvFileName:void 0},t["default"]=C,e.exports=t["default"]},function(t,r){t.exports=e},function(e,t,r){var n;/*! Copyright (c) 2015 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */ -!function(){"use strict";function o(){for(var e="",t=0;t",LAST_PAGE:">>",PRE_PAGE:"<",FIRST_PAGE:"<<",ROW_SELECT_BG_COLOR:"",ROW_SELECT_NONE:"none",ROW_SELECT_SINGLE:"radio",ROW_SELECT_MULTI:"checkbox",CELL_EDIT_NONE:"none",CELL_EDIT_CLICK:"click",CELL_EDIT_DBCLICK:"dbclick",SIZE_PER_PAGE_LIST:[10,25,30,50],PAGINATION_SIZE:5},e.exports=t["default"]},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r0&&o.removeChild(o.getElementsByClassName("order")[0])}this.props.onSort(e,t)}},{key:"componentDidMount",value:function(){if(this.props.sortName){this.clearSortCaret(this.props.sortOrder,this.props.sortName);for(var e=this.refs.header,t=0;t/g,"")}:!1;return u["default"].createElement(b["default"],{completeEdit:this.handleCompleteEditCell.bind(this),editable:w(r.editable)?r.editable(o,e,t,n):r.editable,format:r.format?i:!1,key:n,blurToSave:this.props.cellEdit.blurToSave,rowIndex:t,colIndex:n},o)}var a=w(r.className)?r.className(o,e,t,n):r.className;if("undefined"!=typeof r.format){var s=r.format(o,e);return u["default"].isValidElement(s)||(s=u["default"].createElement("div",{dangerouslySetInnerHTML:{__html:s}})),u["default"].createElement(m["default"],{dataAlign:r.align,key:n,className:a,cellEdit:this.props.cellEdit,onEdit:this.handleEditCell.bind(this),width:r.width},s)}return u["default"].createElement(m["default"],{dataAlign:r.align,key:n,className:a,cellEdit:this.props.cellEdit,hidden:r.hidden,onEdit:this.handleEditCell.bind(this),width:r.width},o)},this),o=-1!=this.props.selectedRowKeys.indexOf(e[this.props.keyField]),i=r&&!this.props.selectRow.hideSelectColumn?this.renderSelectRowColumn(o):null,a=w(this.props.trClassName)?this.props.trClassName(e,t):this.props.trClassName;return u["default"].createElement(v["default"],{isSelected:o,key:t,className:a,selectRow:r?this.props.selectRow:void 0,enableCellEdit:this.props.cellEdit.mode!==d["default"].CELL_EDIT_NONE,onRowClick:this.handleRowClick.bind(this),onSelectRow:this.handleSelectRow.bind(this)},i,n)},this);0===o.length&&o.push(u["default"].createElement(v["default"],{key:"##table-empty##"},u["default"].createElement("td",{colSpan:this.props.columns.length+(r?1:0),style:{textAlign:"center"}},"There is no data to display"))),this.editing=!1;var i=this.calculateContainerHeight().toString();return u["default"].createElement("div",{ref:"container",className:e,style:{height:i}},u["default"].createElement("table",{className:t},n,u["default"].createElement("tbody",null,o)))}},{key:"renderTableHeader",value:function(e){var t=null;if(e){var r={width:35,minWidth:35};t=this.props.selectRow.hideSelectColumn?null:u["default"].createElement("th",{style:r,key:-1})}var n=this.props.columns.map(function(e,t){var r=parseInt(e.width),n={display:e.hidden?"none":null,width:r,maxWidth:r},o=e.sort?f["default"].renderReactSortCaret(d["default"].SORT_DESC):null;return u["default"].createElement("th",{style:n,key:t,className:e.className},e.text,o)});return u["default"].createElement("thead",{ref:"header"},u["default"].createElement("tr",null,t,n))}},{key:"handleRowClick",value:function(e){var t,r;this.props.data.forEach(function(n,o){o==e-1&&(t=n[this.props.keyField],r=n)},this),this.props.onRowClick(r)}},{key:"handleSelectRow",value:function(e,t){var r,n;this.props.data.forEach(function(t,o){o==e-1&&(r=t[this.props.keyField],n=t)},this),this.props.onSelectRow(n,t)}},{key:"handleSelectRowColumChange",value:function(e){this.props.selectRow.clickToSelect&&this.props.selectRow.clickToSelectAndEditCell||this.handleSelectRow(e.currentTarget.parentElement.parentElement.rowIndex,e.currentTarget.checked)}},{key:"handleEditCell",value:function(e,t){this.editing=!0,this._isSelectRowDefined()&&(t--,this.props.selectRow.hideSelectColumn&&t++),e--;var r={currEditCell:{rid:e,cid:t}};if(this.props.selectRow.clickToSelectAndEditCell){var n=-1!=this.props.selectedRowKeys.indexOf(this.props.data[e][this.props.keyField]);this.handleSelectRow(e+1,!n)}this.setState(r)}},{key:"cancelEdit",value:function(){var e=this.state.currEditCell;e&&this.handleCompleteEditCell(null,e.rid,e.cid)}},{key:"handleCompleteEditCell",value:function(e,t,r){this.setState({currEditCell:null}),null!=e&&this.props.cellEdit.__onCompleteEdit__(e,t,r)}},{key:"renderSelectRowColumn",value:function(e){return this.props.selectRow.mode==d["default"].ROW_SELECT_SINGLE?u["default"].createElement(m["default"],null,u["default"].createElement("input",{type:"radio",name:"selection",checked:e,onChange:this.handleSelectRowColumChange.bind(this)})):u["default"].createElement(m["default"],null,u["default"].createElement("input",{type:"checkbox",checked:e,onChange:this.handleSelectRowColumChange.bind(this)}))}},{key:"getBodyHeaderDomProp",value:function(){for(var e=this.refs.header.childNodes[0].childNodes,t=[],r=0;r1)for(var r=1;r-1}};e.exports=o}).call(t,r(18))},function(e,t,r){"use strict";function n(){var e=document.createElement("div"),t=e.style;"AnimationEvent"in window||delete s.animationend.animation,"TransitionEvent"in window||delete s.transitionend.transition;for(var r in s){var n=s[r];for(var o in n)if(o in t){l.push(n[o]);break}}}function o(e,t,r){e.addEventListener(t,r,!1)}function i(e,t,r){e.removeEventListener(t,r,!1)}var a=r(26),s={transitionend:{transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"mozTransitionEnd",OTransition:"oTransitionEnd",msTransition:"MSTransitionEnd"},animationend:{animation:"animationend",WebkitAnimation:"webkitAnimationEnd",MozAnimation:"mozAnimationEnd",OAnimation:"oAnimationEnd",msAnimation:"MSAnimationEnd"}},l=[];a.canUseDOM&&n();var u={addEndEventListener:function(e,t){return 0===l.length?void window.setTimeout(t,0):void l.forEach(function(r){o(e,r,t)})},removeEndEventListener:function(e,t){0!==l.length&&l.forEach(function(r){i(e,r,t)})}};e.exports=u},function(e,t){"use strict";var r=!("undefined"==typeof window||!window.document||!window.document.createElement),n={canUseDOM:r,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:r&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:r&&!!window.screen,isInWorker:!r};e.exports=n},function(e,r){e.exports=t},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){e[t.showMethod]({duration:t.showDuration,easing:t.showEasing})}var i=r(27),a=n(i);e.exports={getDefaultProps:function(){return{style:{display:"none"},showMethod:"fadeIn",showDuration:300,showEasing:"swing",hideMethod:"fadeOut",hideDuration:1e3,hideEasing:"swing",timeOut:5e3,extendedTimeOut:1e3}},getInitialState:function(){return{intervalId:null,isHiding:!1}},componentDidMount:function(){var e=this.props;o(this._get_$_node(),e),0this.totalPages?this.totalPages:this.state.currentPage+1:e==f["default"].LAST_PAGE?this.totalPages:e==f["default"].FIRST_PAGE?1:parseInt(e),e!=this.state.currentPage&&(this.setState({currentPage:e}),this.props.changePage(e,this.state.sizePerPage))}},{key:"componentWillReceiveProps",value:function(e){this.props.remote&&(e.currPage||e.sizePerPage)&&this.setState({currentPage:e.currPage,sizePerPage:e.sizePerPage})}},{key:"changeSizePerPage",value:function(e){e.preventDefault();var t=parseInt(e.currentTarget.text);t!=this.state.sizePerPage&&(this.totalPages=Math.ceil(this.props.dataSize/t),this.state.currentPage>this.totalPages&&(this.state.currentPage=this.totalPages),this.setState({sizePerPage:t,currentPage:this.state.currentPage}),this.props.changePage(this.state.currentPage,t))}},{key:"render",value:function(){var e=this;this.totalPages=Math.ceil(this.props.dataSize/this.state.sizePerPage);var t=this.makePage(),r={marginTop:"0px"},n=this.props.sizePerPageList.map(function(t){return u["default"].createElement("li",{key:t,role:"presentation"},u["default"].createElement("a",{role:"menuitem",tabIndex:"-1",href:"#",onClick:e.changeSizePerPage.bind(e)},t))});return u["default"].createElement("div",{className:"row"},u["default"].createElement("div",{className:"col-md-1"},u["default"].createElement("div",{className:"dropdown"},u["default"].createElement("button",{className:"btn btn-default dropdown-toggle",type:"button",id:"pageDropDown","data-toggle":"dropdown","aria-expanded":"true"},this.state.sizePerPage,u["default"].createElement("span",{className:"caret"})),u["default"].createElement("ul",{className:"dropdown-menu",role:"menu","aria-labelledby":"pageDropDown"},n))),u["default"].createElement("div",{className:"col-md-6"},u["default"].createElement("ul",{className:"pagination",style:r},t)))}},{key:"makePage",value:function(){var e=this.getPages();return e.map(function(e){var t=e===this.state.currentPage;return u["default"].createElement(d["default"],{changePage:this.changePage.bind(this),active:t,key:e},e)},this)}},{key:"getPages",value:function(){var e=1,t=this.totalPages;e=Math.max(this.state.currentPage-Math.floor(this.props.paginationSize/2),1),t=e+this.props.paginationSize-1,t>this.totalPages&&(t=this.totalPages,e=t-this.props.paginationSize+1);for(var r=[f["default"].FIRST_PAGE,f["default"].PRE_PAGE],n=e;t>=n;n++)n>0&&r.push(n);return r.push(f["default"].NEXT_PAGE),r.push(f["default"].LAST_PAGE),r}},{key:"getCurrentPage",value:function(){return this.state.currentPage}},{key:"getSizePerPage",value:function(){return this.state.sizePerPage}}]),t}(u["default"].Component);h.propTypes={currPage:u["default"].PropTypes.number,sizePerPage:u["default"].PropTypes.number,dataSize:u["default"].PropTypes.number,changePage:u["default"].PropTypes.func,sizePerPageList:u["default"].PropTypes.array,paginationSize:u["default"].PropTypes.number,remote:u["default"].PropTypes.bool},h.defaultProps={sizePerPage:f["default"].SIZE_PER_PAGE},t["default"]=h,e.exports=t["default"]},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;ro[t]?-1:e[t]o[t]?1:0}),e}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var r=0;re||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},r.prototype.emit=function(e){var t,r,o,s,l,u;if(this._events||(this._events={}),"error"===e&&(!this._events.error||i(this._events.error)&&!this._events.error.length)){if(t=arguments[1],t instanceof Error)throw t;throw TypeError('Uncaught, unspecified "error" event.')}if(r=this._events[e],a(r))return!1;if(n(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:for(o=arguments.length,s=new Array(o-1),l=1;o>l;l++)s[l-1]=arguments[l];r.apply(this,s)}else if(i(r)){for(o=arguments.length,s=new Array(o-1),l=1;o>l;l++)s[l-1]=arguments[l];for(u=r.slice(),o=u.length,l=0;o>l;l++)u[l].apply(this,s)}return!0},r.prototype.addListener=function(e,t){var o;if(!n(t))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,n(t.listener)?t.listener:t),this._events[e]?i(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,i(this._events[e])&&!this._events[e].warned){var o;o=a(this._maxListeners)?r.defaultMaxListeners:this._maxListeners, -o&&o>0&&this._events[e].length>o&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace())}return this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){function r(){this.removeListener(e,r),o||(o=!0,t.apply(this,arguments))}if(!n(t))throw TypeError("listener must be a function");var o=!1;return r.listener=t,this.on(e,r),this},r.prototype.removeListener=function(e,t){var r,o,a,s;if(!n(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(r=this._events[e],a=r.length,o=-1,r===t||n(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(i(r)){for(s=a;s-- >0;)if(r[s]===t||r[s].listener&&r[s].listener===t){o=s;break}if(0>o)return this;1===r.length?(r.length=0,delete this._events[e]):r.splice(o,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[e],n(r))this.removeListener(e,r);else for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?n(this._events[e])?[this._events[e]]:this._events[e].slice():[]},r.listenerCount=function(e,t){var r;return r=e._events&&e._events[t]?n(e._events[t])?1:e._events[t].length:0}},function(e,t,r){"use strict";function n(e,t){var r="";return 0===e.length?r:(r+=t.join(",")+"\n",e.map(function(e){t.map(function(t){var n=e[t]?'"'+e[t]+'"':"";r+=n+","}),r+="\n"}),r)}if(Object.defineProperty(t,"__esModule",{value:!0}),"undefined"!=typeof window)var o=r(36),i=o.saveAs;var a=function(e,t,r){var o=n(e,t);"undefined"!=typeof window&&i(new Blob([o],{type:"text/plain;charset=utf-8"}),r||"spreadsheet.csv")};t["default"]=a,e.exports=t["default"]},function(e,t,r){var n,o,i=i||function(e){"use strict";if("undefined"==typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent)){var t=e.document,r=function(){return e.URL||e.webkitURL||e},n=t.createElementNS("http://www.w3.org/1999/xhtml","a"),o="download"in n,i=function(e){var t=new MouseEvent("click");e.dispatchEvent(t)},a=/Version\/[\d\.]+.*Safari/.test(navigator.userAgent),s=e.webkitRequestFileSystem,l=e.requestFileSystem||s||e.mozRequestFileSystem,u=function(t){(e.setImmediate||e.setTimeout)(function(){throw t},0)},c="application/octet-stream",d=0,p=500,f=function(t){var n=function(){"string"==typeof t?r().revokeObjectURL(t):t.remove()};e.chrome?n():setTimeout(n,p)},h=function(e,t,r){t=[].concat(t);for(var n=t.length;n--;){var o=e["on"+t[n]];if("function"==typeof o)try{o.call(e,r||e)}catch(i){u(i)}}},v=function(e){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e},y=function(t,u,p){p||(t=v(t));var y,m,g,b=this,_=t.type,E=!1,w=function(){h(b,"writestart progress write writeend".split(" "))},P=function(){if(m&&a&&"undefined"!=typeof FileReader){var n=new FileReader;return n.onloadend=function(){var e=n.result;m.location.href="data:attachment/file"+e.slice(e.search(/[,;]/)),b.readyState=b.DONE,w()},n.readAsDataURL(t),void(b.readyState=b.INIT)}if((E||!y)&&(y=r().createObjectURL(t)),m)m.location.href=y;else{var o=e.open(y,"_blank");void 0==o&&a&&(e.location.href=y)}b.readyState=b.DONE,w(),f(y)},T=function(e){return function(){return b.readyState!==b.DONE?e.apply(this,arguments):void 0}},S={create:!0,exclusive:!1};return b.readyState=b.INIT,u||(u="download"),o?(y=r().createObjectURL(t),n.href=y,n.download=u,void setTimeout(function(){i(n),w(),f(y),b.readyState=b.DONE})):(e.chrome&&_&&_!==c&&(g=t.slice||t.webkitSlice,t=g.call(t,0,t.size,c),E=!0),s&&"download"!==u&&(u+=".download"),(_===c||s)&&(m=e),l?(d+=t.size,void l(e.TEMPORARY,d,T(function(e){e.root.getDirectory("saved",S,T(function(e){var r=function(){e.getFile(u,S,T(function(e){e.createWriter(T(function(r){r.onwriteend=function(t){m.location.href=e.toURL(),b.readyState=b.DONE,h(b,"writeend",t),f(e)},r.onerror=function(){var e=r.error;e.code!==e.ABORT_ERR&&P()},"writestart progress write abort".split(" ").forEach(function(e){r["on"+e]=b["on"+e]}),r.write(t),b.abort=function(){r.abort(),b.readyState=b.DONE},b.readyState=b.WRITING}),P)}),P)};e.getFile(u,{create:!1},T(function(e){e.remove(),r()}),T(function(e){e.code===e.NOT_FOUND_ERR?r():P()}))}),P)}),P)):void P())},m=y.prototype,g=function(e,t,r){return new y(e,t,r)};return"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(e,t,r){return r||(e=v(e)),navigator.msSaveOrOpenBlob(e,t||"download")}:(m.abort=function(){var e=this;e.readyState=e.DONE,h(e,"abort")},m.readyState=m.INIT=0,m.WRITING=1,m.DONE=2,m.error=m.onwritestart=m.onprogress=m.onwrite=m.onabort=m.onerror=m.onwriteend=null,g)}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||(void 0).content);"undefined"!=typeof e&&e.exports?e.exports.saveAs=i:null!==r(37)&&null!=r(38)&&(n=[],o=function(){return i}.apply(t,n),!(void 0!==o&&(e.exports=o)))},function(e,t){e.exports=function(){throw new Error("define cannot be used indirect")}},function(e,t){(function(t){e.exports=t}).call(t,{})},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r",LAST_PAGE:">>",PRE_PAGE:"<",FIRST_PAGE:"<<",ROW_SELECT_BG_COLOR:"",ROW_SELECT_NONE:"none",ROW_SELECT_SINGLE:"radio",ROW_SELECT_MULTI:"checkbox",CELL_EDIT_NONE:"none",CELL_EDIT_CLICK:"click",CELL_EDIT_DBCLICK:"dbclick",SIZE_PER_PAGE_LIST:[10,25,30,50],PAGINATION_SIZE:5},e.exports=t["default"]},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r0&&o.removeChild(o.getElementsByClassName("order")[0])}this.props.onSort(e,t)}},{key:"componentDidMount",value:function(){if(this.props.sortName){this.clearSortCaret(this.props.sortOrder,this.props.sortName);for(var e=this.refs.header,t=0;t/g,"")}:!1;return u["default"].createElement(b["default"],{completeEdit:this.handleCompleteEditCell.bind(this),editable:w(r.editable)?r.editable(o,e,t,n):r.editable,format:r.format?i:!1,key:n,blurToSave:this.props.cellEdit.blurToSave,rowIndex:t,colIndex:n},o)}var a=w(r.className)?r.className(o,e,t,n):r.className;if("undefined"!=typeof r.format){var s=r.format(o,e);return u["default"].isValidElement(s)||(s=u["default"].createElement("div",{dangerouslySetInnerHTML:{__html:s}})),u["default"].createElement(m["default"],{dataAlign:r.align,key:n,className:a,cellEdit:this.props.cellEdit,onEdit:this.handleEditCell.bind(this),width:r.width},s)}return u["default"].createElement(m["default"],{dataAlign:r.align,key:n,className:a,cellEdit:this.props.cellEdit,hidden:r.hidden,onEdit:this.handleEditCell.bind(this),width:r.width},o)},this),o=-1!=this.props.selectedRowKeys.indexOf(e[this.props.keyField]),i=r&&!this.props.selectRow.hideSelectColumn?this.renderSelectRowColumn(o):null,a=w(this.props.trClassName)?this.props.trClassName(e,t):this.props.trClassName;return u["default"].createElement(v["default"],{isSelected:o,key:t,className:a,selectRow:r?this.props.selectRow:void 0,enableCellEdit:this.props.cellEdit.mode!==d["default"].CELL_EDIT_NONE,onRowClick:this.handleRowClick.bind(this),onSelectRow:this.handleSelectRow.bind(this)},i,n)},this);0===o.length&&o.push(u["default"].createElement(v["default"],{key:"##table-empty##"},u["default"].createElement("td",{colSpan:this.props.columns.length+(r?1:0),style:{textAlign:"center"}},"There is no data to display"))),this.editing=!1;var i=this.calculateContainerHeight().toString();return u["default"].createElement("div",{ref:"container",className:e,style:{height:i}},u["default"].createElement("table",{className:t},n,u["default"].createElement("tbody",null,o)))}},{key:"renderTableHeader",value:function(e){var t=null;if(e){var r={width:35,minWidth:35};t=this.props.selectRow.hideSelectColumn?null:u["default"].createElement("th",{style:r,key:-1})}var n=this.props.columns.map(function(e,t){var r=parseInt(e.width),n={display:e.hidden?"none":null,width:r,maxWidth:r},o=e.sort?f["default"].renderReactSortCaret(d["default"].SORT_DESC):null;return u["default"].createElement("th",{style:n,key:t,className:e.className},e.text,o)});return u["default"].createElement("thead",{ref:"header"},u["default"].createElement("tr",null,t,n))}},{key:"handleRowClick",value:function(e){var t,r;this.props.data.forEach(function(n,o){o==e-1&&(t=n[this.props.keyField],r=n)},this),this.props.onRowClick(r)}},{key:"handleSelectRow",value:function(e,t){var r,n;this.props.data.forEach(function(t,o){o==e-1&&(r=t[this.props.keyField],n=t)},this),this.props.onSelectRow(n,t)}},{key:"handleSelectRowColumChange",value:function(e){this.props.selectRow.clickToSelect&&this.props.selectRow.clickToSelectAndEditCell||this.handleSelectRow(e.currentTarget.parentElement.parentElement.rowIndex,e.currentTarget.checked)}},{key:"handleEditCell",value:function(e,t){this.editing=!0,this._isSelectRowDefined()&&(t--,this.props.selectRow.hideSelectColumn&&t++),e--;var r={currEditCell:{rid:e,cid:t}};if(this.props.selectRow.clickToSelectAndEditCell){var n=-1!=this.props.selectedRowKeys.indexOf(this.props.data[e][this.props.keyField]);this.handleSelectRow(e+1,!n)}this.setState(r)}},{key:"cancelEdit",value:function(){var e=this.state.currEditCell;e&&this.handleCompleteEditCell(null,e.rid,e.cid)}},{key:"handleCompleteEditCell",value:function(e,t,r){this.setState({currEditCell:null}),null!=e&&this.props.cellEdit.__onCompleteEdit__(e,t,r)}},{key:"renderSelectRowColumn",value:function(e){return this.props.selectRow.mode==d["default"].ROW_SELECT_SINGLE?u["default"].createElement(m["default"],null,u["default"].createElement("input",{type:"radio",name:"selection",checked:e,onChange:this.handleSelectRowColumChange.bind(this)})):u["default"].createElement(m["default"],null,u["default"].createElement("input",{type:"checkbox",checked:e,onChange:this.handleSelectRowColumChange.bind(this)}))}},{key:"getBodyHeaderDomProp",value:function(){for(var e=this.refs.header.childNodes[0].childNodes,t=[],r=0;r1)for(var r=1;r-1}};e.exports=o}).call(t,r(18))},function(e,t,r){(function(t){"use strict";var r=function(e,r,n,o,i,a,s,l){if("production"!==t.env.NODE_ENV&&void 0===r)throw new Error("invariant requires an error message argument");if(!e){var u;if(void 0===r)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,o,i,a,s,l],d=0;u=new Error("Invariant Violation: "+r.replace(/%s/g,function(){return c[d++]}))}throw u.framesToPop=1,u}};e.exports=r}).call(t,r(18))},function(e,t,r){"use strict";function n(){var e=document.createElement("div"),t=e.style;"AnimationEvent"in window||delete s.animationend.animation,"TransitionEvent"in window||delete s.transitionend.transition;for(var r in s){var n=s[r];for(var o in n)if(o in t){l.push(n[o]);break}}}function o(e,t,r){e.addEventListener(t,r,!1)}function i(e,t,r){e.removeEventListener(t,r,!1)}var a=r(27),s={transitionend:{transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"mozTransitionEnd",OTransition:"oTransitionEnd",msTransition:"MSTransitionEnd"},animationend:{animation:"animationend",WebkitAnimation:"webkitAnimationEnd",MozAnimation:"mozAnimationEnd",OAnimation:"oAnimationEnd",msAnimation:"MSAnimationEnd"}},l=[];a.canUseDOM&&n();var u={addEndEventListener:function(e,t){return 0===l.length?void window.setTimeout(t,0):void l.forEach(function(r){o(e,r,t)})},removeEndEventListener:function(e,t){0!==l.length&&l.forEach(function(r){i(e,r,t)})}};e.exports=u},function(e,t){"use strict";var r=!("undefined"==typeof window||!window.document||!window.document.createElement),n={canUseDOM:r,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:r&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:r&&!!window.screen,isInWorker:!r};e.exports=n},function(e,r){e.exports=t},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){e[t.showMethod]({duration:t.showDuration,easing:t.showEasing})}var i=r(28),a=n(i);e.exports={getDefaultProps:function(){return{style:{display:"none"},showMethod:"fadeIn",showDuration:300,showEasing:"swing",hideMethod:"fadeOut",hideDuration:1e3,hideEasing:"swing",timeOut:5e3,extendedTimeOut:1e3}},getInitialState:function(){return{intervalId:null,isHiding:!1}},componentDidMount:function(){var e=this.props;o(this._get_$_node(),e),0this.totalPages?this.totalPages:this.state.currentPage+1:e==f["default"].LAST_PAGE?this.totalPages:e==f["default"].FIRST_PAGE?1:parseInt(e),e!=this.state.currentPage&&(this.setState({currentPage:e}),this.props.changePage(e,this.state.sizePerPage))}},{key:"componentWillReceiveProps",value:function(e){this.props.remote&&(e.currPage||e.sizePerPage)&&this.setState({currentPage:e.currPage,sizePerPage:e.sizePerPage})}},{key:"changeSizePerPage",value:function(e){e.preventDefault();var t=parseInt(e.currentTarget.text);t!=this.state.sizePerPage&&(this.totalPages=Math.ceil(this.props.dataSize/t),this.state.currentPage>this.totalPages&&(this.state.currentPage=this.totalPages),this.setState({sizePerPage:t,currentPage:this.state.currentPage}),this.props.changePage(this.state.currentPage,t))}},{key:"render",value:function(){var e=this;this.totalPages=Math.ceil(this.props.dataSize/this.state.sizePerPage);var t=this.makePage(),r={marginTop:"0px"},n=this.props.sizePerPageList.map(function(t){return u["default"].createElement("li",{key:t,role:"presentation"},u["default"].createElement("a",{role:"menuitem",tabIndex:"-1",href:"#",onClick:e.changeSizePerPage.bind(e)},t))});return u["default"].createElement("div",{className:"row"},this.props.sizePerPageList.length>1?u["default"].createElement("div",{className:"col-md-1"},u["default"].createElement("div",{className:"dropdown"},u["default"].createElement("button",{className:"btn btn-default dropdown-toggle",type:"button",id:"pageDropDown","data-toggle":"dropdown","aria-expanded":"true"},this.state.sizePerPage,u["default"].createElement("span",{className:"caret"})),u["default"].createElement("ul",{className:"dropdown-menu",role:"menu","aria-labelledby":"pageDropDown"},n))):"",u["default"].createElement("div",{className:"col-md-6"},u["default"].createElement("ul",{className:"pagination",style:r},t)))}},{key:"makePage",value:function(){var e=this.getPages();return e.map(function(e){var t=e===this.state.currentPage;return u["default"].createElement(d["default"],{changePage:this.changePage.bind(this),active:t,key:e},e)},this)}},{key:"getPages",value:function(){var e=1,t=this.totalPages;e=Math.max(this.state.currentPage-Math.floor(this.props.paginationSize/2),1),t=e+this.props.paginationSize-1,t>this.totalPages&&(t=this.totalPages,e=t-this.props.paginationSize+1);for(var r=[f["default"].FIRST_PAGE,f["default"].PRE_PAGE],n=e;t>=n;n++)n>0&&r.push(n);return r.push(f["default"].NEXT_PAGE),r.push(f["default"].LAST_PAGE),r}},{key:"getCurrentPage",value:function(){return this.state.currentPage}},{key:"getSizePerPage",value:function(){return this.state.sizePerPage}}]),t}(u["default"].Component);h.propTypes={currPage:u["default"].PropTypes.number,sizePerPage:u["default"].PropTypes.number,dataSize:u["default"].PropTypes.number,changePage:u["default"].PropTypes.func,sizePerPageList:u["default"].PropTypes.array,paginationSize:u["default"].PropTypes.number,remote:u["default"].PropTypes.bool},h.defaultProps={sizePerPage:f["default"].SIZE_PER_PAGE},t["default"]=h,e.exports=t["default"]},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;ro[t]?-1:e[t]o[t]?1:0}),e}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var r=0;re||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},r.prototype.emit=function(e){var t,r,o,s,l,u;if(this._events||(this._events={}),"error"===e&&(!this._events.error||i(this._events.error)&&!this._events.error.length)){if(t=arguments[1],t instanceof Error)throw t;throw TypeError('Uncaught, unspecified "error" event.')}if(r=this._events[e],a(r))return!1;if(n(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),r.apply(this,s)}else if(i(r))for(s=Array.prototype.slice.call(arguments,1), +u=r.slice(),o=u.length,l=0;o>l;l++)u[l].apply(this,s);return!0},r.prototype.addListener=function(e,t){var o;if(!n(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,n(t.listener)?t.listener:t),this._events[e]?i(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,i(this._events[e])&&!this._events[e].warned&&(o=a(this._maxListeners)?r.defaultMaxListeners:this._maxListeners,o&&o>0&&this._events[e].length>o&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace())),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){function r(){this.removeListener(e,r),o||(o=!0,t.apply(this,arguments))}if(!n(t))throw TypeError("listener must be a function");var o=!1;return r.listener=t,this.on(e,r),this},r.prototype.removeListener=function(e,t){var r,o,a,s;if(!n(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(r=this._events[e],a=r.length,o=-1,r===t||n(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(i(r)){for(s=a;s-- >0;)if(r[s]===t||r[s].listener&&r[s].listener===t){o=s;break}if(0>o)return this;1===r.length?(r.length=0,delete this._events[e]):r.splice(o,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[e],n(r))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?n(this._events[e])?[this._events[e]]:this._events[e].slice():[]},r.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(n(t))return 1;if(t)return t.length}return 0},r.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t,r){"use strict";function n(e,t){var r="";return 0===e.length?r:(r+=t.join(",")+"\n",e.map(function(e){t.map(function(t){var n=e[t]?'"'+e[t]+'"':"";r+=n+","}),r+="\n"}),r)}if(Object.defineProperty(t,"__esModule",{value:!0}),"undefined"!=typeof window)var o=r(37),i=o.saveAs;var a=function(e,t,r){var o=n(e,t);"undefined"!=typeof window&&i(new Blob([o],{type:"text/plain;charset=utf-8"}),r||"spreadsheet.csv")};t["default"]=a,e.exports=t["default"]},function(e,t,r){var n,o,i=i||function(e){"use strict";if("undefined"==typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent)){var t=e.document,r=function(){return e.URL||e.webkitURL||e},n=t.createElementNS("http://www.w3.org/1999/xhtml","a"),o="download"in n,i=function(e){var t=new MouseEvent("click");e.dispatchEvent(t)},a=/Version\/[\d\.]+.*Safari/.test(navigator.userAgent),s=e.webkitRequestFileSystem,l=e.requestFileSystem||s||e.mozRequestFileSystem,u=function(t){(e.setImmediate||e.setTimeout)(function(){throw t},0)},c="application/octet-stream",d=0,p=500,f=function(t){var n=function(){"string"==typeof t?r().revokeObjectURL(t):t.remove()};e.chrome?n():setTimeout(n,p)},h=function(e,t,r){t=[].concat(t);for(var n=t.length;n--;){var o=e["on"+t[n]];if("function"==typeof o)try{o.call(e,r||e)}catch(i){u(i)}}},v=function(e){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e},y=function(t,u,p){p||(t=v(t));var y,m,g,b=this,E=t.type,_=!1,w=function(){h(b,"writestart progress write writeend".split(" "))},P=function(){if(m&&a&&"undefined"!=typeof FileReader){var n=new FileReader;return n.onloadend=function(){var e=n.result;m.location.href="data:attachment/file"+e.slice(e.search(/[,;]/)),b.readyState=b.DONE,w()},n.readAsDataURL(t),void(b.readyState=b.INIT)}if((_||!y)&&(y=r().createObjectURL(t)),m)m.location.href=y;else{var o=e.open(y,"_blank");void 0==o&&a&&(e.location.href=y)}b.readyState=b.DONE,w(),f(y)},T=function(e){return function(){return b.readyState!==b.DONE?e.apply(this,arguments):void 0}},S={create:!0,exclusive:!1};return b.readyState=b.INIT,u||(u="download"),o?(y=r().createObjectURL(t),n.href=y,n.download=u,void setTimeout(function(){i(n),w(),f(y),b.readyState=b.DONE})):(e.chrome&&E&&E!==c&&(g=t.slice||t.webkitSlice,t=g.call(t,0,t.size,c),_=!0),s&&"download"!==u&&(u+=".download"),(E===c||s)&&(m=e),l?(d+=t.size,void l(e.TEMPORARY,d,T(function(e){e.root.getDirectory("saved",S,T(function(e){var r=function(){e.getFile(u,S,T(function(e){e.createWriter(T(function(r){r.onwriteend=function(t){m.location.href=e.toURL(),b.readyState=b.DONE,h(b,"writeend",t),f(e)},r.onerror=function(){var e=r.error;e.code!==e.ABORT_ERR&&P()},"writestart progress write abort".split(" ").forEach(function(e){r["on"+e]=b["on"+e]}),r.write(t),b.abort=function(){r.abort(),b.readyState=b.DONE},b.readyState=b.WRITING}),P)}),P)};e.getFile(u,{create:!1},T(function(e){e.remove(),r()}),T(function(e){e.code===e.NOT_FOUND_ERR?r():P()}))}),P)}),P)):void P())},m=y.prototype,g=function(e,t,r){return new y(e,t,r)};return"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(e,t,r){return r||(e=v(e)),navigator.msSaveOrOpenBlob(e,t||"download")}:(m.abort=function(){var e=this;e.readyState=e.DONE,h(e,"abort")},m.readyState=m.INIT=0,m.WRITING=1,m.DONE=2,m.error=m.onwritestart=m.onprogress=m.onwrite=m.onabort=m.onerror=m.onwriteend=null,g)}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||(void 0).content);"undefined"!=typeof e&&e.exports?e.exports.saveAs=i:null!==r(38)&&null!=r(39)&&(n=[],o=function(){return i}.apply(t,n),!(void 0!==o&&(e.exports=o)))},function(e,t){e.exports=function(){throw new Error("define cannot be used indirect")}},function(e,t){(function(t){e.exports=t}).call(t,{})},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r 1 ? _react2['default'].createElement( 'div', { className: 'col-md-1' }, _react2['default'].createElement( @@ -133,7 +133,7 @@ var PaginationList = (function (_React$Component) { sizePerPageList ) ) - ), + ) : "", _react2['default'].createElement( 'div', { className: 'col-md-6' }, diff --git a/src/pagination/PaginationList.js b/src/pagination/PaginationList.js index fdfc6d0b9..b9c02aac1 100644 --- a/src/pagination/PaginationList.js +++ b/src/pagination/PaginationList.js @@ -77,6 +77,8 @@ class PaginationList extends React.Component { return (
+ { + this.props.sizePerPageList.length > 1 ?
+ : "" + }
    {pageBtns}