diff --git a/README.md b/README.md index 7c861c9b3..ceedfb96e 100644 --- a/README.md +++ b/README.md @@ -9,23 +9,24 @@ [![peerDependency Status][peer-deps-badge]][peer-deps] It's a [react.js](http://facebook.github.io/react/) table for bootstrap, named react-bootstrap-table. It's a configurable, functional table component and make you build a Bootstrap Table more efficiency and easy in your React application, However ```react-bootstrap-table``` support these features: -- striped, borderless, condensed table -- column align, hidden, width, sort, title -- scrolling table -- cell format -- pagination -- row selection -- column filter with multi type -- cell edit with multi type editor -- insert & delete Row -- table, row and column styling -- global search -- export to CSV -- rich function hooks -- large columns table -- header colum span -- remote mode -- expandable row +- Striped, Borderless, Condensed table +- Column align, hidden, width, sort, title, styling +- Scrolling table +- Cell format +- Pagination +- Row selection +- Column filter with multi type +- Cell edit with multi type editor +- Insert & delete Row +- Table, row and column styling +- Search +- Export to CSV +- Rich function hooks +- Header colum span +- Remote mode +- Expandable row +- Key board Navigation +- Customization ![Example](http://i.imgur.com/Ov1wMse.png) Explore more example on [examples](https://github.com/AllenFang/react-bootstrap-table/tree/master/examples/js) folder
@@ -34,16 +35,17 @@ Check [this](http://allenfang.github.io/react-bootstrap-table/advance.html) for Check the CHANGELOG for more detail release notes. ## Notes -***```v2.10.0-beta.1``` is a revised version for fixing couples unalign column and incorrect height etc. If you have any unalign problems before `v2.9.2`, give this beta version a try and any feedback is welcome*** +***```v3.0.0``` released, check [examples](https://github.com/AllenFang/react-bootstrap-table/tree/v3.0.0-dev/examples/js/custom) to learn how to customize the component. following +is the major things we completed in this release*** +- Remove the `bootstrap.js` and `jQuery` dependencies +- More easy and have ability to customize the components(search, pagination, insert modal etc.) -***```v3.0.0-beta.7``` released, check [release page](https://github.com/AllenFang/react-bootstrap-table/releases). [There](https://github.com/AllenFang/react-bootstrap-table/tree/v3.0.0-dev/examples/js/custom) are a lots of example for customization component, you can also check the [online](http://allenfang.github.io/react-bootstrap-table/example.html#custom) version
*** +***```v2.10.0-beta.1``` is a revised version for fixing couples unalign column and incorrect height etc. If you have any unalign problems before `v2.9.2`, give this beta version a try and any feedback is welcome*** ***```v3.0.0``` is under planning, check [Milestone to v3.0.0](https://github.com/AllenFang/react-bootstrap-table/issues/497).
*** ***After ```v2.4.4```, we move the css files to ```dist``` folder for allowing this repo can be hosted on [cdnjs](https://github.com/cdnjs/cdnjs)
*** -***```v2.0.0``` has been released, the main patches are fixing the unalign or wrong size column on different browsers and improving the table structure. Please check [this](https://github.com/AllenFang/react-bootstrap-table/issues/331) for more detail explanation.
*** - ## Development ```react-bootstrap-table``` dependencies on react.js and Bootstrap 3, also written by ES6 and use gulp and browserify for building and bundling. @@ -141,7 +143,7 @@ The example source codes is in the [examples](https://github.com/AllenFang/react $ git clone https://github.com/AllenFang/react-bootstrap-table.git $ cd react-bootstrap-table $ npm install -$ gulp example-server #after start, open browser and go to http://localhost:3004 +$ npm start # after start, open browser and go to http://localhost:3004 ``` ### [Documentation](http://allenfang.github.io/react-bootstrap-table/docs.html) diff --git a/css/react-bootstrap-table.css b/css/react-bootstrap-table.css index 8120633ac..14ef2f7d3 100644 --- a/css/react-bootstrap-table.css +++ b/css/react-bootstrap-table.css @@ -45,8 +45,15 @@ width: 100%; } +.react-bootstrap-table-page-btns-ul { + float: right; + /* override the margin-top defined in .pagination class in bootstrap. */ + margin-top: 0; +} + .react-bs-table .table-bordered { border: 0; + outline: none !important; } .react-bs-table .table-bordered > thead > tr > th, @@ -54,6 +61,15 @@ border-bottom-width: 2px; } +.react-bs-table .table-bordered > tbody > tr > td { + outline: none !important; +} + +.react-bs-table .table-bordered > tbody > tr > td.default-focus-cell { + outline: 3px solid cornflowerblue !important; + outline-offset: -1px; +} + .react-bs-table .table-bordered > tfoot > tr > th, .react-bs-table .table-bordered > tfoot > tr > td { border-top-width: 2px; @@ -159,6 +175,47 @@ text-align: center; } + +.ReactModal__Overlay { + -webkit-perspective: 600; + perspective: 600; + opacity: 0; + overflow-x: hidden; + overflow-y: auto; + background-color: rgba(0, 0, 0, 0.5); +} + +.ReactModal__Overlay--after-open { + opacity: 1; + transition: opacity 150ms ease-out; +} + +.ReactModal__Content { + -webkit-transform: scale(0.5) rotateX(-30deg); + transform: scale(0.5) rotateX(-30deg); +} + +.ReactModal__Content--after-open { + -webkit-transform: scale(1) rotateX(0deg); + transform: scale(1) rotateX(0deg); + transition: all 150ms ease-in; +} + +.ReactModal__Overlay--before-close { + opacity: 0; +} + +.ReactModal__Content--before-close { + -webkit-transform: scale(0.5) rotateX(30deg); + transform: scale(0.5) rotateX(30deg); + transition: all 150ms ease-in; +} + +.ReactModal__Content.modal-dialog { + border: none; + background-color: transparent; +} + /*error tip style*/ .animated { animation-fill-mode: both; diff --git a/dist/react-bootstrap-table-all.min.css b/dist/react-bootstrap-table-all.min.css index 12a146556..4656191b2 100644 --- a/dist/react-bootstrap-table-all.min.css +++ b/dist/react-bootstrap-table-all.min.css @@ -1 +1 @@ -.react-bs-table-container .react-bs-table-search-form{margin-bottom:0}.react-bs-table table{margin-bottom:0;table-layout:fixed}.react-bs-table table td,.react-bs-table table th{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.react-bs-table{border:1px solid #ddd;border-radius:5px;margin:5px 10px}.react-bs-table-pagination{margin:10px}.react-bs-table-tool-bar{margin:10px 10px 0}.react-bs-container-header{overflow:hidden;width:100%}.react-bs-container-body{overflow:auto;width:100%}.react-bs-table .table-bordered{border:0}.react-bs-table .table-bordered>thead>tr>td,.react-bs-table .table-bordered>thead>tr>th{border-bottom-width:2px}.react-bs-table .table-bordered>tfoot>tr>td,.react-bs-table .table-bordered>tfoot>tr>th{border-top-width:2px;border-bottom-width:0}.react-bs-table .table-bordered>tbody>tr>td:first-child,.react-bs-table .table-bordered>tbody>tr>th:first-child,.react-bs-table .table-bordered>tfoot>tr>td:first-child,.react-bs-table .table-bordered>tfoot>tr>th:first-child,.react-bs-table .table-bordered>thead>tr>td:first-child,.react-bs-table .table-bordered>thead>tr>th:first-child{border-left-width:0}.react-bs-table .table-bordered>tbody>tr>td:last-child,.react-bs-table .table-bordered>tbody>tr>th:last-child,.react-bs-table .table-bordered>tfoot>tr>td:last-child,.react-bs-table .table-bordered>tfoot>tr>th:last-child,.react-bs-table .table-bordered>thead>tr>td:last-child,.react-bs-table .table-bordered>thead>tr>th:last-child{border-right-width:0}.react-bs-table .table-bordered>thead>tr:first-child>td,.react-bs-table .table-bordered>thead>tr:first-child>th{border-top-width:0}.react-bs-table .table-bordered>tfoot>tr:last-child>td,.react-bs-table .table-bordered>tfoot>tr:last-child>th{border-bottom-width:0}.react-bs-table .react-bs-container-header>table>thead>tr>th{vertical-align:middle}.react-bs-table .react-bs-container-header>table>thead>tr>th .filter{font-weight:400}.react-bs-table .react-bs-container-header>table>thead>tr>th .filter::-webkit-input-placeholder,.react-bs-table .react-bs-container-header>table>thead>tr>th .number-filter-input::-webkit-input-placeholder,.react-bs-table .react-bs-container-header>table>thead>tr>th .select-filter option[value=''],.react-bs-table .react-bs-container-header>table>thead>tr>th .select-filter.placeholder-selected{color:#d3d3d3;font-style:italic}.react-bs-table .react-bs-container-header>table>thead>tr>th .select-filter.placeholder-selected option:not([value='']){color:initial;font-style:initial}.react-bs-table .react-bs-container-header>table>thead>tr>th .date-filter,.react-bs-table .react-bs-container-header>table>thead>tr>th .number-filter{display:flex}.react-bs-table .react-bs-container-header>table>thead>tr>th .date-filter-input,.react-bs-table .react-bs-container-header>table>thead>tr>th .number-filter-input{margin-left:5px;float:left;width:calc(100% - 67px - 5px)}.react-bs-table .react-bs-container-header>table>thead>tr>th .date-filter-comparator,.react-bs-table .react-bs-container-header>table>thead>tr>th .number-filter-comparator{width:67px;float:left}.react-bs-table .react-bs-container-header .sort-column{cursor:pointer}.react-bs-container .textarea-save-btn{position:absolute;z-index:100;right:0;top:-21px}.react-bs-table-no-data{text-align:center}.animated{animation-fill-mode:both}.animated.bounceIn,.animated.bounceOut{animation-duration:.75s}.animated.shake{animation-duration:.3s}@keyframes shake{from,to{transform:translate3d(0,0,0)}10%,50%,90%{transform:translate3d(-10px,0,0)}30%,70%{transform:translate3d(10px,0,0)}}.shake{animation-name:shake}@keyframes bounceIn{20%,40%,60%,80%,from,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:scale3d(.3,.3,.3)}20%{transform:scale3d(1.1,1.1,1.1)}40%{transform:scale3d(.9,.9,.9)}60%{opacity:1;transform:scale3d(1.03,1.03,1.03)}80%{transform:scale3d(.97,.97,.97)}to{opacity:1;transform:scale3d(1,1,1)}}.bounceIn{animation-name:bounceIn}@keyframes bounceOut{20%{transform:scale3d(.9,.9,.9)}50%,55%{opacity:1;transform:scale3d(1.1,1.1,1.1)}to{opacity:0;transform:scale3d(.3,.3,.3)}}.bounceOut{animation-name:bounceOut}.toast-title{font-weight:700}.toast-message{-ms-word-wrap:break-word;word-wrap:break-word}.toast-message a,.toast-message label{color:#fff}.toast-message a:hover{color:#ccc;text-decoration:none}.toast-close-button{position:relative;right:-.3em;top:-.3em;float:right;font-size:20px;font-weight:700;color:#fff;-webkit-text-shadow:0 1px 0 #fff;text-shadow:0 1px 0 #fff;opacity:.8;-ms-filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=80);filter:alpha(opacity=80)}.toast-top-center,.toast-top-full-width{top:0;right:0;width:100%}.toast-close-button:focus,.toast-close-button:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.4;-ms-filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=40);filter:alpha(opacity=40)}button.toast-close-button{padding:0;cursor:pointer;background:0 0;border:0;-webkit-appearance:none}.toast-bottom-center{bottom:0;right:0;width:100%}.toast-bottom-full-width{bottom:0;right:0;width:100%}.toast-top-left{top:12px;left:12px}.toast-top-right{top:12px;right:12px}.toast-bottom-right{right:12px;bottom:12px}.toast-bottom-left{bottom:12px;left:12px}#toast-container{position:fixed;z-index:999999}#toast-container *{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}#toast-container>div{position:relative;overflow:hidden;margin:0 0 6px;padding:15px 15px 15px 50px;width:300px;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;background-position:15px center;background-repeat:no-repeat;-moz-box-shadow:0 0 12px #999;-webkit-box-shadow:0 0 12px #999;box-shadow:0 0 12px #999;color:#fff;opacity:.8;-ms-filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=80);filter:alpha(opacity=80)}#toast-container>:hover{-moz-box-shadow:0 0 12px #000;-webkit-box-shadow:0 0 12px #000;box-shadow:0 0 12px #000;opacity:1;-ms-filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=100);filter:alpha(opacity=100);cursor:pointer}#toast-container>.toast-info{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGwSURBVEhLtZa9SgNBEMc9sUxxRcoUKSzSWIhXpFMhhYWFhaBg4yPYiWCXZxBLERsLRS3EQkEfwCKdjWJAwSKCgoKCcudv4O5YLrt7EzgXhiU3/4+b2ckmwVjJSpKkQ6wAi4gwhT+z3wRBcEz0yjSseUTrcRyfsHsXmD0AmbHOC9Ii8VImnuXBPglHpQ5wwSVM7sNnTG7Za4JwDdCjxyAiH3nyA2mtaTJufiDZ5dCaqlItILh1NHatfN5skvjx9Z38m69CgzuXmZgVrPIGE763Jx9qKsRozWYw6xOHdER+nn2KkO+Bb+UV5CBN6WC6QtBgbRVozrahAbmm6HtUsgtPC19tFdxXZYBOfkbmFJ1VaHA1VAHjd0pp70oTZzvR+EVrx2Ygfdsq6eu55BHYR8hlcki+n+kERUFG8BrA0BwjeAv2M8WLQBtcy+SD6fNsmnB3AlBLrgTtVW1c2QN4bVWLATaIS60J2Du5y1TiJgjSBvFVZgTmwCU+dAZFoPxGEEs8nyHC9Bwe2GvEJv2WXZb0vjdyFT4Cxk3e/kIqlOGoVLwwPevpYHT+00T+hWwXDf4AJAOUqWcDhbwAAAAASUVORK5CYII=)!important}#toast-container>.toast-error{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHOSURBVEhLrZa/SgNBEMZzh0WKCClSCKaIYOED+AAKeQQLG8HWztLCImBrYadgIdY+gIKNYkBFSwu7CAoqCgkkoGBI/E28PdbLZmeDLgzZzcx83/zZ2SSXC1j9fr+I1Hq93g2yxH4iwM1vkoBWAdxCmpzTxfkN2RcyZNaHFIkSo10+8kgxkXIURV5HGxTmFuc75B2RfQkpxHG8aAgaAFa0tAHqYFfQ7Iwe2yhODk8+J4C7yAoRTWI3w/4klGRgR4lO7Rpn9+gvMyWp+uxFh8+H+ARlgN1nJuJuQAYvNkEnwGFck18Er4q3egEc/oO+mhLdKgRyhdNFiacC0rlOCbhNVz4H9FnAYgDBvU3QIioZlJFLJtsoHYRDfiZoUyIxqCtRpVlANq0EU4dApjrtgezPFad5S19Wgjkc0hNVnuF4HjVA6C7QrSIbylB+oZe3aHgBsqlNqKYH48jXyJKMuAbiyVJ8KzaB3eRc0pg9VwQ4niFryI68qiOi3AbjwdsfnAtk0bCjTLJKr6mrD9g8iq/S/B81hguOMlQTnVyG40wAcjnmgsCNESDrjme7wfftP4P7SP4N3CJZdvzoNyGq2c/HWOXJGsvVg+RA/k2MC/wN6I2YA2Pt8GkAAAAASUVORK5CYII=)!important}#toast-container>.toast-success{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADsSURBVEhLY2AYBfQMgf///3P8+/evAIgvA/FsIF+BavYDDWMBGroaSMMBiE8VC7AZDrIFaMFnii3AZTjUgsUUWUDA8OdAH6iQbQEhw4HyGsPEcKBXBIC4ARhex4G4BsjmweU1soIFaGg/WtoFZRIZdEvIMhxkCCjXIVsATV6gFGACs4Rsw0EGgIIH3QJYJgHSARQZDrWAB+jawzgs+Q2UO49D7jnRSRGoEFRILcdmEMWGI0cm0JJ2QpYA1RDvcmzJEWhABhD/pqrL0S0CWuABKgnRki9lLseS7g2AlqwHWQSKH4oKLrILpRGhEQCw2LiRUIa4lwAAAABJRU5ErkJggg==)!important}#toast-container>.toast-warning{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGYSURBVEhL5ZSvTsNQFMbXZGICMYGYmJhAQIJAICYQPAACiSDB8AiICQQJT4CqQEwgJvYASAQCiZiYmJhAIBATCARJy+9rTsldd8sKu1M0+dLb057v6/lbq/2rK0mS/TRNj9cWNAKPYIJII7gIxCcQ51cvqID+GIEX8ASG4B1bK5gIZFeQfoJdEXOfgX4QAQg7kH2A65yQ87lyxb27sggkAzAuFhbbg1K2kgCkB1bVwyIR9m2L7PRPIhDUIXgGtyKw575yz3lTNs6X4JXnjV+LKM/m3MydnTbtOKIjtz6VhCBq4vSm3ncdrD2lk0VgUXSVKjVDJXJzijW1RQdsU7F77He8u68koNZTz8Oz5yGa6J3H3lZ0xYgXBK2QymlWWA+RWnYhskLBv2vmE+hBMCtbA7KX5drWyRT/2JsqZ2IvfB9Y4bWDNMFbJRFmC9E74SoS0CqulwjkC0+5bpcV1CZ8NMej4pjy0U+doDQsGyo1hzVJttIjhQ7GnBtRFN1UarUlH8F3xict+HY07rEzoUGPlWcjRFRr4/gChZgc3ZL2d8oAAAAASUVORK5CYII=)!important}#toast-container.toast-bottom-center>div,#toast-container.toast-top-center>div{width:300px;margin:auto}#toast-container.toast-bottom-full-width>div,#toast-container.toast-top-full-width>div{width:96%;margin:auto}.toast{background-color:#030303}.toast-success{background-color:#51a351}.toast-error{background-color:#bd362f}.toast-info{background-color:#2f96b4}.toast-warning{background-color:#f89406}.toast-progress{position:absolute;left:0;bottom:0;height:4px;background-color:#000;opacity:.4;-ms-filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=40);filter:alpha(opacity=40)}@media all and (max-width:240px){#toast-container>div{padding:8px 8px 8px 50px;width:11em}#toast-container .toast-close-button{right:-.2em;top:-.2em}}@media all and (min-width:241px) and (max-width:480px){#toast-container>div{padding:8px 8px 8px 50px;width:18em}#toast-container .toast-close-button{right:-.2em;top:-.2em}}@media all and (min-width:481px) and (max-width:768px){#toast-container>div{padding:15px 15px 15px 50px;width:25em}} \ No newline at end of file +.react-bs-table-container .react-bs-table-search-form{margin-bottom:0}.react-bs-table table{margin-bottom:0;table-layout:fixed}.react-bs-table table td,.react-bs-table table th{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.react-bs-table{border:1px solid #ddd;border-radius:5px;margin:5px 10px}.react-bs-table-pagination{margin:10px}.react-bs-table-tool-bar{margin:10px 10px 0}.react-bs-container-header{overflow:hidden;width:100%}.react-bs-container-body{overflow:auto;width:100%}.react-bootstrap-table-page-btns-ul{float:right;margin-top:0}.react-bs-table .table-bordered{border:0;outline:0!important}.react-bs-table .table-bordered>thead>tr>td,.react-bs-table .table-bordered>thead>tr>th{border-bottom-width:2px}.react-bs-table .table-bordered>tbody>tr>td{outline:0!important}.react-bs-table .table-bordered>tbody>tr>td.default-focus-cell{outline:#6495ed solid 3px!important;outline-offset:-1px}.react-bs-table .table-bordered>tfoot>tr>td,.react-bs-table .table-bordered>tfoot>tr>th{border-top-width:2px;border-bottom-width:0}.react-bs-table .table-bordered>tbody>tr>td:first-child,.react-bs-table .table-bordered>tbody>tr>th:first-child,.react-bs-table .table-bordered>tfoot>tr>td:first-child,.react-bs-table .table-bordered>tfoot>tr>th:first-child,.react-bs-table .table-bordered>thead>tr>td:first-child,.react-bs-table .table-bordered>thead>tr>th:first-child{border-left-width:0}.react-bs-table .table-bordered>tbody>tr>td:last-child,.react-bs-table .table-bordered>tbody>tr>th:last-child,.react-bs-table .table-bordered>tfoot>tr>td:last-child,.react-bs-table .table-bordered>tfoot>tr>th:last-child,.react-bs-table .table-bordered>thead>tr>td:last-child,.react-bs-table .table-bordered>thead>tr>th:last-child{border-right-width:0}.react-bs-table .table-bordered>thead>tr:first-child>td,.react-bs-table .table-bordered>thead>tr:first-child>th{border-top-width:0}.react-bs-table .table-bordered>tfoot>tr:last-child>td,.react-bs-table .table-bordered>tfoot>tr:last-child>th{border-bottom-width:0}.react-bs-table .react-bs-container-header>table>thead>tr>th{vertical-align:middle}.react-bs-table .react-bs-container-header>table>thead>tr>th .filter{font-weight:400}.react-bs-table .react-bs-container-header>table>thead>tr>th .filter::-webkit-input-placeholder,.react-bs-table .react-bs-container-header>table>thead>tr>th .number-filter-input::-webkit-input-placeholder,.react-bs-table .react-bs-container-header>table>thead>tr>th .select-filter option[value=''],.react-bs-table .react-bs-container-header>table>thead>tr>th .select-filter.placeholder-selected{color:#d3d3d3;font-style:italic}.react-bs-table .react-bs-container-header>table>thead>tr>th .select-filter.placeholder-selected option:not([value='']){color:initial;font-style:initial}.react-bs-table .react-bs-container-header>table>thead>tr>th .date-filter,.react-bs-table .react-bs-container-header>table>thead>tr>th .number-filter{display:flex}.react-bs-table .react-bs-container-header>table>thead>tr>th .date-filter-input,.react-bs-table .react-bs-container-header>table>thead>tr>th .number-filter-input{margin-left:5px;float:left;width:calc(100% - 67px - 5px)}.react-bs-table .react-bs-container-header>table>thead>tr>th .date-filter-comparator,.react-bs-table .react-bs-container-header>table>thead>tr>th .number-filter-comparator{width:67px;float:left}.react-bs-table .react-bs-container-header .sort-column{cursor:pointer}.react-bs-container .textarea-save-btn{position:absolute;z-index:100;right:0;top:-21px}.react-bs-table-no-data{text-align:center}.ReactModal__Overlay{-webkit-perspective:600;perspective:600;opacity:0;overflow-x:hidden;overflow-y:auto;background-color:rgba(0,0,0,.5)}.ReactModal__Overlay--after-open{opacity:1;transition:opacity 150ms ease-out}.ReactModal__Content{-webkit-transform:scale(.5) rotateX(-30deg);transform:scale(.5) rotateX(-30deg)}.ReactModal__Content--after-open{-webkit-transform:scale(1) rotateX(0);transform:scale(1) rotateX(0);transition:all 150ms ease-in}.ReactModal__Overlay--before-close{opacity:0}.ReactModal__Content--before-close{-webkit-transform:scale(.5) rotateX(30deg);transform:scale(.5) rotateX(30deg);transition:all 150ms ease-in}.ReactModal__Content.modal-dialog{border:none;background-color:transparent}.animated{animation-fill-mode:both}.animated.bounceIn,.animated.bounceOut{animation-duration:.75s}.animated.shake{animation-duration:.3s}@keyframes shake{from,to{transform:translate3d(0,0,0)}10%,50%,90%{transform:translate3d(-10px,0,0)}30%,70%{transform:translate3d(10px,0,0)}}.shake{animation-name:shake}@keyframes bounceIn{20%,40%,60%,80%,from,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:scale3d(.3,.3,.3)}20%{transform:scale3d(1.1,1.1,1.1)}40%{transform:scale3d(.9,.9,.9)}60%{opacity:1;transform:scale3d(1.03,1.03,1.03)}80%{transform:scale3d(.97,.97,.97)}to{opacity:1;transform:scale3d(1,1,1)}}.bounceIn{animation-name:bounceIn}@keyframes bounceOut{20%{transform:scale3d(.9,.9,.9)}50%,55%{opacity:1;transform:scale3d(1.1,1.1,1.1)}to{opacity:0;transform:scale3d(.3,.3,.3)}}.bounceOut{animation-name:bounceOut}.toast-title{font-weight:700}.toast-message{-ms-word-wrap:break-word;word-wrap:break-word}.toast-message a,.toast-message label{color:#fff}.toast-message a:hover{color:#ccc;text-decoration:none}.toast-close-button{position:relative;right:-.3em;top:-.3em;float:right;font-size:20px;font-weight:700;color:#fff;-webkit-text-shadow:0 1px 0 #fff;text-shadow:0 1px 0 #fff;opacity:.8;-ms-filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=80);filter:alpha(opacity=80)}.toast-top-center,.toast-top-full-width{top:0;right:0;width:100%}.toast-close-button:focus,.toast-close-button:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.4;-ms-filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=40);filter:alpha(opacity=40)}button.toast-close-button{padding:0;cursor:pointer;background:0 0;border:0;-webkit-appearance:none}.toast-bottom-center{bottom:0;right:0;width:100%}.toast-bottom-full-width{bottom:0;right:0;width:100%}.toast-top-left{top:12px;left:12px}.toast-top-right{top:12px;right:12px}.toast-bottom-right{right:12px;bottom:12px}.toast-bottom-left{bottom:12px;left:12px}#toast-container{position:fixed;z-index:999999}#toast-container *{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}#toast-container>div{position:relative;overflow:hidden;margin:0 0 6px;padding:15px 15px 15px 50px;width:300px;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;background-position:15px center;background-repeat:no-repeat;-moz-box-shadow:0 0 12px #999;-webkit-box-shadow:0 0 12px #999;box-shadow:0 0 12px #999;color:#fff;opacity:.8;-ms-filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=80);filter:alpha(opacity=80)}#toast-container>:hover{-moz-box-shadow:0 0 12px #000;-webkit-box-shadow:0 0 12px #000;box-shadow:0 0 12px #000;opacity:1;-ms-filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=100);filter:alpha(opacity=100);cursor:pointer}#toast-container>.toast-info{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGwSURBVEhLtZa9SgNBEMc9sUxxRcoUKSzSWIhXpFMhhYWFhaBg4yPYiWCXZxBLERsLRS3EQkEfwCKdjWJAwSKCgoKCcudv4O5YLrt7EzgXhiU3/4+b2ckmwVjJSpKkQ6wAi4gwhT+z3wRBcEz0yjSseUTrcRyfsHsXmD0AmbHOC9Ii8VImnuXBPglHpQ5wwSVM7sNnTG7Za4JwDdCjxyAiH3nyA2mtaTJufiDZ5dCaqlItILh1NHatfN5skvjx9Z38m69CgzuXmZgVrPIGE763Jx9qKsRozWYw6xOHdER+nn2KkO+Bb+UV5CBN6WC6QtBgbRVozrahAbmm6HtUsgtPC19tFdxXZYBOfkbmFJ1VaHA1VAHjd0pp70oTZzvR+EVrx2Ygfdsq6eu55BHYR8hlcki+n+kERUFG8BrA0BwjeAv2M8WLQBtcy+SD6fNsmnB3AlBLrgTtVW1c2QN4bVWLATaIS60J2Du5y1TiJgjSBvFVZgTmwCU+dAZFoPxGEEs8nyHC9Bwe2GvEJv2WXZb0vjdyFT4Cxk3e/kIqlOGoVLwwPevpYHT+00T+hWwXDf4AJAOUqWcDhbwAAAAASUVORK5CYII=)!important}#toast-container>.toast-error{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHOSURBVEhLrZa/SgNBEMZzh0WKCClSCKaIYOED+AAKeQQLG8HWztLCImBrYadgIdY+gIKNYkBFSwu7CAoqCgkkoGBI/E28PdbLZmeDLgzZzcx83/zZ2SSXC1j9fr+I1Hq93g2yxH4iwM1vkoBWAdxCmpzTxfkN2RcyZNaHFIkSo10+8kgxkXIURV5HGxTmFuc75B2RfQkpxHG8aAgaAFa0tAHqYFfQ7Iwe2yhODk8+J4C7yAoRTWI3w/4klGRgR4lO7Rpn9+gvMyWp+uxFh8+H+ARlgN1nJuJuQAYvNkEnwGFck18Er4q3egEc/oO+mhLdKgRyhdNFiacC0rlOCbhNVz4H9FnAYgDBvU3QIioZlJFLJtsoHYRDfiZoUyIxqCtRpVlANq0EU4dApjrtgezPFad5S19Wgjkc0hNVnuF4HjVA6C7QrSIbylB+oZe3aHgBsqlNqKYH48jXyJKMuAbiyVJ8KzaB3eRc0pg9VwQ4niFryI68qiOi3AbjwdsfnAtk0bCjTLJKr6mrD9g8iq/S/B81hguOMlQTnVyG40wAcjnmgsCNESDrjme7wfftP4P7SP4N3CJZdvzoNyGq2c/HWOXJGsvVg+RA/k2MC/wN6I2YA2Pt8GkAAAAASUVORK5CYII=)!important}#toast-container>.toast-success{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADsSURBVEhLY2AYBfQMgf///3P8+/evAIgvA/FsIF+BavYDDWMBGroaSMMBiE8VC7AZDrIFaMFnii3AZTjUgsUUWUDA8OdAH6iQbQEhw4HyGsPEcKBXBIC4ARhex4G4BsjmweU1soIFaGg/WtoFZRIZdEvIMhxkCCjXIVsATV6gFGACs4Rsw0EGgIIH3QJYJgHSARQZDrWAB+jawzgs+Q2UO49D7jnRSRGoEFRILcdmEMWGI0cm0JJ2QpYA1RDvcmzJEWhABhD/pqrL0S0CWuABKgnRki9lLseS7g2AlqwHWQSKH4oKLrILpRGhEQCw2LiRUIa4lwAAAABJRU5ErkJggg==)!important}#toast-container>.toast-warning{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGYSURBVEhL5ZSvTsNQFMbXZGICMYGYmJhAQIJAICYQPAACiSDB8AiICQQJT4CqQEwgJvYASAQCiZiYmJhAIBATCARJy+9rTsldd8sKu1M0+dLb057v6/lbq/2rK0mS/TRNj9cWNAKPYIJII7gIxCcQ51cvqID+GIEX8ASG4B1bK5gIZFeQfoJdEXOfgX4QAQg7kH2A65yQ87lyxb27sggkAzAuFhbbg1K2kgCkB1bVwyIR9m2L7PRPIhDUIXgGtyKw575yz3lTNs6X4JXnjV+LKM/m3MydnTbtOKIjtz6VhCBq4vSm3ncdrD2lk0VgUXSVKjVDJXJzijW1RQdsU7F77He8u68koNZTz8Oz5yGa6J3H3lZ0xYgXBK2QymlWWA+RWnYhskLBv2vmE+hBMCtbA7KX5drWyRT/2JsqZ2IvfB9Y4bWDNMFbJRFmC9E74SoS0CqulwjkC0+5bpcV1CZ8NMej4pjy0U+doDQsGyo1hzVJttIjhQ7GnBtRFN1UarUlH8F3xict+HY07rEzoUGPlWcjRFRr4/gChZgc3ZL2d8oAAAAASUVORK5CYII=)!important}#toast-container.toast-bottom-center>div,#toast-container.toast-top-center>div{width:300px;margin:auto}#toast-container.toast-bottom-full-width>div,#toast-container.toast-top-full-width>div{width:96%;margin:auto}.toast{background-color:#030303}.toast-success{background-color:#51a351}.toast-error{background-color:#bd362f}.toast-info{background-color:#2f96b4}.toast-warning{background-color:#f89406}.toast-progress{position:absolute;left:0;bottom:0;height:4px;background-color:#000;opacity:.4;-ms-filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=40);filter:alpha(opacity=40)}@media all and (max-width:240px){#toast-container>div{padding:8px 8px 8px 50px;width:11em}#toast-container .toast-close-button{right:-.2em;top:-.2em}}@media all and (min-width:241px) and (max-width:480px){#toast-container>div{padding:8px 8px 8px 50px;width:18em}#toast-container .toast-close-button{right:-.2em;top:-.2em}}@media all and (min-width:481px) and (max-width:768px){#toast-container>div{padding:15px 15px 15px 50px;width:25em}} \ No newline at end of file diff --git a/dist/react-bootstrap-table.js b/dist/react-bootstrap-table.js index 6f3e4d051..24be1cf60 100644 --- a/dist/react-bootstrap-table.js +++ b/dist/react-bootstrap-table.js @@ -59,24 +59,90 @@ return /******/ (function(modules) { // webpackBootstrap Object.defineProperty(exports, "__esModule", { value: true }); - exports.TableHeaderColumn = exports.BootstrapTable = undefined; + exports.SizePerPageDropDown = exports.ButtonGroup = exports.SearchField = exports.ClearSearchButton = exports.ExportCSVButton = exports.ShowSelectedOnlyButton = exports.DeleteButton = exports.InsertButton = exports.InsertModalFooter = exports.InsertModalBody = exports.InsertModalHeader = exports.TableHeaderColumn = exports.BootstrapTable = undefined; var _BootstrapTable = __webpack_require__(1); var _BootstrapTable2 = _interopRequireDefault(_BootstrapTable); - var _TableHeaderColumn = __webpack_require__(191); + var _TableHeaderColumn = __webpack_require__(212); var _TableHeaderColumn2 = _interopRequireDefault(_TableHeaderColumn); + var _InsertModalHeader = __webpack_require__(195); + + var _InsertModalHeader2 = _interopRequireDefault(_InsertModalHeader); + + var _InsertModalBody = __webpack_require__(197); + + var _InsertModalBody2 = _interopRequireDefault(_InsertModalBody); + + var _InsertModalFooter = __webpack_require__(196); + + var _InsertModalFooter2 = _interopRequireDefault(_InsertModalFooter); + + var _InsertButton = __webpack_require__(198); + + var _InsertButton2 = _interopRequireDefault(_InsertButton); + + var _DeleteButton = __webpack_require__(199); + + var _DeleteButton2 = _interopRequireDefault(_DeleteButton); + + var _ExportCSVButton = __webpack_require__(200); + + var _ExportCSVButton2 = _interopRequireDefault(_ExportCSVButton); + + var _ShowSelectedOnlyButton = __webpack_require__(201); + + var _ShowSelectedOnlyButton2 = _interopRequireDefault(_ShowSelectedOnlyButton); + + var _ClearSearchButton = __webpack_require__(203); + + var _ClearSearchButton2 = _interopRequireDefault(_ClearSearchButton); + + var _SearchField = __webpack_require__(202); + + var _SearchField2 = _interopRequireDefault(_SearchField); + + var _ButtonGroup = __webpack_require__(218); + + var _ButtonGroup2 = _interopRequireDefault(_ButtonGroup); + + var _SizePerPageDropDown = __webpack_require__(182); + + var _SizePerPageDropDown2 = _interopRequireDefault(_SizePerPageDropDown); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } if (typeof window !== 'undefined') { window.BootstrapTable = _BootstrapTable2.default; window.TableHeaderColumn = _TableHeaderColumn2.default; + window.InsertModalHeader = _InsertModalHeader2.default; + window.InsertModalBody = _InsertModalBody2.default; + window.InsertModalFooter = _InsertModalFooter2.default; + window.InsertButton = _InsertButton2.default; + window.DeleteButton = _DeleteButton2.default; + window.ShowSelectedOnlyButton = _ShowSelectedOnlyButton2.default; + window.ExportCSVButton = _ExportCSVButton2.default; + window.ClearSearchButton = _ClearSearchButton2.default; + window.SearchField = _SearchField2.default; + window.ButtonGroup = _ButtonGroup2.default; + window.SizePerPageDropDown = _SizePerPageDropDown2.default; } exports.BootstrapTable = _BootstrapTable2.default; exports.TableHeaderColumn = _TableHeaderColumn2.default; + exports.InsertModalHeader = _InsertModalHeader2.default; + exports.InsertModalBody = _InsertModalBody2.default; + exports.InsertModalFooter = _InsertModalFooter2.default; + exports.InsertButton = _InsertButton2.default; + exports.DeleteButton = _DeleteButton2.default; + exports.ShowSelectedOnlyButton = _ShowSelectedOnlyButton2.default; + exports.ExportCSVButton = _ExportCSVButton2.default; + exports.ClearSearchButton = _ClearSearchButton2.default; + exports.SearchField = _SearchField2.default; + exports.ButtonGroup = _ButtonGroup2.default; + exports.SizePerPageDropDown = _SizePerPageDropDown2.default; ; var _temp = function () { @@ -97,6 +163,8 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); @@ -125,25 +193,25 @@ return /******/ (function(modules) { // webpackBootstrap var _PaginationList2 = _interopRequireDefault(_PaginationList); - var _ToolBar = __webpack_require__(182); + var _ToolBar = __webpack_require__(183); var _ToolBar2 = _interopRequireDefault(_ToolBar); - var _TableFilter = __webpack_require__(183); + var _TableFilter = __webpack_require__(204); var _TableFilter2 = _interopRequireDefault(_TableFilter); - var _TableDataStore = __webpack_require__(184); + var _TableDataStore = __webpack_require__(205); var _util = __webpack_require__(9); var _util2 = _interopRequireDefault(_util); - var _csv_export_util = __webpack_require__(185); + var _csv_export_util = __webpack_require__(206); var _csv_export_util2 = _interopRequireDefault(_csv_export_util); - var _Filter = __webpack_require__(189); + var _Filter = __webpack_require__(210); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -191,6 +259,10 @@ return /******/ (function(modules) { // webpackBootstrap return _this.__handleRowMouseOver__REACT_HOT_LOADER__.apply(_this, arguments); }; + _this.handleNavigateCell = function () { + return _this.__handleNavigateCell__REACT_HOT_LOADER__.apply(_this, arguments); + }; + _this.handleRowClick = function () { return _this.__handleRowClick__REACT_HOT_LOADER__.apply(_this, arguments); }; @@ -248,7 +320,7 @@ return /******/ (function(modules) { // webpackBootstrap if (_util2.default.canUseDOM()) { _this.isIE = document.documentMode; } - _this.store = new _TableDataStore.TableDataStore(_this.props.data.slice()); + _this.store = new _TableDataStore.TableDataStore(_this.props.data ? _this.props.data.slice() : []); _this.initTable(_this.props); @@ -273,7 +345,9 @@ return /******/ (function(modules) { // webpackBootstrap expanding: _this.props.options.expanding || [], sizePerPage: _this.props.options.sizePerPage || _Const2.default.SIZE_PER_PAGE_LIST[0], selectedRowKeys: _this.store.getSelectedRowKeys(), - reset: false + reset: false, + x: _this.props.keyBoardNav ? 0 : -1, + y: _this.props.keyBoardNav ? 0 : -1 }; return _this; } @@ -587,11 +661,18 @@ return /******/ (function(modules) { // webpackBootstrap var colGroups = _util2.default.renderColGroup(columns, this.props.selectRow); var sortIndicator = this.props.options.sortIndicator; if (typeof this.props.options.sortIndicator === 'undefined') sortIndicator = true; + var _props$options$pagina = this.props.options.paginationPosition, + paginationPosition = _props$options$pagina === undefined ? _Const2.default.PAGINATION_POS_BOTTOM : _props$options$pagina; + + var showPaginationOnTop = paginationPosition !== _Const2.default.PAGINATION_POS_BOTTOM; + var showPaginationOnBottom = paginationPosition !== _Const2.default.PAGINATION_POS_TOP; + return _react2.default.createElement( 'div', - { className: (0, _classnames2.default)('react-bs-table-container', this.props.containerClass), + { className: (0, _classnames2.default)('react-bs-table-container', this.props.className, this.props.containerClass), style: this.props.containerStyle }, toolBar, + showPaginationOnTop ? pagination : null, _react2.default.createElement( 'div', { ref: 'table', @@ -649,10 +730,14 @@ return /******/ (function(modules) { // webpackBootstrap withoutNoDataText: this.props.options.withoutNoDataText, expanding: this.state.expanding, onExpand: this.handleExpandRow, - beforeShowError: this.props.options.beforeShowError }) + beforeShowError: this.props.options.beforeShowError, + keyBoardNav: this.props.keyBoardNav, + onNavigateCell: this.handleNavigateCell, + x: this.state.x, + y: this.state.y }) ), tableFilter, - pagination + showPaginationOnBottom ? pagination : null ); } }, { @@ -778,11 +863,100 @@ return /******/ (function(modules) { // webpackBootstrap this.props.options.onRowMouseOver(row, event); } } + }, { + key: '__handleNavigateCell__REACT_HOT_LOADER__', + value: function __handleNavigateCell__REACT_HOT_LOADER__(_ref4) { + var offSetX = _ref4.x, + offSetY = _ref4.y, + lastEditCell = _ref4.lastEditCell; + var pagination = this.props.pagination; + var _state = this.state, + x = _state.x, + y = _state.y, + currPage = _state.currPage; + + x += offSetX; + y += offSetY; + // currPage += 1; + // console.log(currPage); + + var columns = this.store.getColInfos(); + var visibleRowSize = this.state.data.length; + var visibleColumnSize = Object.keys(columns).filter(function (k) { + return !columns[k].hidden; + }).length; + + if (y >= visibleRowSize) { + currPage++; + var lastPage = pagination ? this.refs.pagination.getLastPage() : -1; + if (currPage <= lastPage) { + this.handlePaginationData(currPage, this.state.sizePerPage); + } else { + return; + } + y = 0; + } else if (y < 0) { + currPage--; + if (currPage > 0) { + this.handlePaginationData(currPage, this.state.sizePerPage); + } else { + return; + } + y = visibleRowSize - 1; + } else if (x >= visibleColumnSize) { + if (y + 1 === visibleRowSize) { + currPage++; + var _lastPage = pagination ? this.refs.pagination.getLastPage() : -1; + if (currPage <= _lastPage) { + this.handlePaginationData(currPage, this.state.sizePerPage); + } else { + return; + } + y = 0; + } else { + y++; + } + x = lastEditCell ? 1 : 0; + } else if (x < 0) { + x = visibleColumnSize - 1; + if (y === 0) { + currPage--; + if (currPage > 0) { + this.handlePaginationData(currPage, this.state.sizePerPage); + } else { + return; + } + y = this.state.sizePerPage - 1; + } else { + y--; + } + } + this.setState({ + x: x, y: y, currPage: currPage, reset: false + }); + } }, { key: '__handleRowClick__REACT_HOT_LOADER__', - value: function __handleRowClick__REACT_HOT_LOADER__(row) { - if (this.props.options.onRowClick) { - this.props.options.onRowClick(row); + value: function __handleRowClick__REACT_HOT_LOADER__(row, rowIndex, cellIndex) { + var _props2 = this.props, + options = _props2.options, + keyBoardNav = _props2.keyBoardNav; + + if (options.onRowClick) { + options.onRowClick(row); + } + if (keyBoardNav) { + var _ref5 = (typeof keyBoardNav === 'undefined' ? 'undefined' : _typeof(keyBoardNav)) === 'object' ? keyBoardNav : {}, + clickToNav = _ref5.clickToNav; + + clickToNav = clickToNav === false ? clickToNav : true; + if (clickToNav) { + this.setState({ + x: cellIndex, + y: rowIndex, + reset: false + }); + } } } }, { @@ -1202,12 +1376,15 @@ return /******/ (function(modules) { // webpackBootstrap } var options = this.props.options; + var withFirstAndLast = options.withFirstAndLast === undefined ? true : options.withFirstAndLast; if (Math.ceil(dataSize / this.state.sizePerPage) <= 1 && this.props.ignoreSinglePage) return null; return _react2.default.createElement( 'div', { className: 'react-bs-table-pagination' }, _react2.default.createElement(_PaginationList2.default, { ref: 'pagination', + withFirstAndLast: withFirstAndLast, + alwaysShowAllBtns: options.alwaysShowAllBtns, currPage: this.state.currPage, changePage: this.handlePaginationData, sizePerPage: this.state.sizePerPage, @@ -1221,7 +1398,10 @@ return /******/ (function(modules) { // webpackBootstrap nextPage: options.nextPage || _Const2.default.NEXT_PAGE, firstPage: options.firstPage || _Const2.default.FIRST_PAGE, lastPage: options.lastPage || _Const2.default.LAST_PAGE, - hideSizePerPage: options.hideSizePerPage }) + hideSizePerPage: options.hideSizePerPage, + sizePerPageDropDown: options.sizePerPageDropDown, + paginationPanel: options.paginationPanel, + open: false }) ); } return null; @@ -1229,15 +1409,16 @@ return /******/ (function(modules) { // webpackBootstrap }, { key: 'renderToolBar', value: function renderToolBar() { - var _props2 = this.props, - selectRow = _props2.selectRow, - insertRow = _props2.insertRow, - deleteRow = _props2.deleteRow, - search = _props2.search, - children = _props2.children; + var _props3 = this.props, + exportCSV = _props3.exportCSV, + selectRow = _props3.selectRow, + insertRow = _props3.insertRow, + deleteRow = _props3.deleteRow, + search = _props3.search, + children = _props3.children; var enableShowOnlySelected = selectRow && selectRow.showOnlySelected; - if (enableShowOnlySelected || insertRow || deleteRow || search || this.props.exportCSV) { + if (enableShowOnlySelected || insertRow || deleteRow || search || exportCSV || this.props.options.searchPanel || this.props.options.btnGroup || this.props.options.toolBar) { var columns = void 0; if (Array.isArray(children)) { columns = children.map(function (column, r) { @@ -1271,11 +1452,12 @@ return /******/ (function(modules) { // webpackBootstrap ref: 'toolbar', defaultSearch: this.props.options.defaultSearch, clearSearch: this.props.options.clearSearch, + searchPosition: this.props.options.searchPosition, searchDelayTime: this.props.options.searchDelayTime, enableInsert: insertRow, enableDelete: deleteRow, enableSearch: search, - enableExportCSV: this.props.exportCSV, + enableExportCSV: exportCSV, enableShowOnlySelected: enableShowOnlySelected, columns: columns, searchPlaceholder: this.props.searchPlaceholder, @@ -1290,6 +1472,19 @@ return /******/ (function(modules) { // webpackBootstrap onSearch: this.handleSearch, onExportCSV: this.handleExportCSV, onShowOnlySelected: this.handleShowOnlySelected, + insertModalHeader: this.props.options.insertModalHeader, + insertModalFooter: this.props.options.insertModalFooter, + insertModalBody: this.props.options.insertModalBody, + insertModal: this.props.options.insertModal, + insertBtn: this.props.options.insertBtn, + deleteBtn: this.props.options.deleteBtn, + showSelectedOnlyBtn: this.props.options.showSelectedOnlyBtn, + exportCSVBtn: this.props.options.exportCSVBtn, + clearSearchBtn: this.props.options.clearSearchBtn, + searchField: this.props.options.searchField, + searchPanel: this.props.options.searchPanel, + btnGroup: this.props.options.btnGroup, + toolBar: this.props.options.toolBar, reset: this.state.reset }) ); } else { @@ -1456,6 +1651,7 @@ return /******/ (function(modules) { // webpackBootstrap condensed: _react.PropTypes.bool, pagination: _react.PropTypes.bool, printable: _react.PropTypes.bool, + keyBoardNav: _react.PropTypes.oneOfType([_react.PropTypes.bool, _react.PropTypes.object]), searchPlaceholder: _react.PropTypes.string, selectRow: _react.PropTypes.shape({ mode: _react.PropTypes.oneOf([_Const2.default.ROW_SELECT_NONE, _Const2.default.ROW_SELECT_SINGLE, _Const2.default.ROW_SELECT_MULTI]), @@ -1514,7 +1710,10 @@ return /******/ (function(modules) { // webpackBootstrap sizePerPageList: _react.PropTypes.array, sizePerPage: _react.PropTypes.number, paginationSize: _react.PropTypes.number, + paginationPosition: _react.PropTypes.oneOf([_Const2.default.PAGINATION_POS_TOP, _Const2.default.PAGINATION_POS_BOTTOM, _Const2.default.PAGINATION_POS_BOTH]), hideSizePerPage: _react.PropTypes.bool, + alwaysShowAllBtns: _react.PropTypes.bool, + withFirstAndLast: _react.PropTypes.bool, onSortChange: _react.PropTypes.func, onPageChange: _react.PropTypes.func, onSizePerPageList: _react.PropTypes.func, @@ -1538,6 +1737,22 @@ return /******/ (function(modules) { // webpackBootstrap closeText: _react.PropTypes.string, ignoreEditable: _react.PropTypes.bool, defaultSearch: _react.PropTypes.string, + insertModalHeader: _react.PropTypes.func, + insertModalBody: _react.PropTypes.func, + insertModalFooter: _react.PropTypes.func, + insertModal: _react.PropTypes.func, + insertBtn: _react.PropTypes.func, + deleteBtn: _react.PropTypes.func, + showSelectedOnlyBtn: _react.PropTypes.func, + exportCSVBtn: _react.PropTypes.func, + clearSearchBtn: _react.PropTypes.func, + searchField: _react.PropTypes.func, + searchPanel: _react.PropTypes.func, + btnGroup: _react.PropTypes.func, + toolBar: _react.PropTypes.func, + sizePerPageDropDown: _react.PropTypes.func, + paginationPanel: _react.PropTypes.func, + searchPosition: _react.PropTypes.string, expandRowBgColor: _react.PropTypes.string, expandBy: _react.PropTypes.string, expanding: _react.PropTypes.array, @@ -1564,6 +1779,7 @@ return /******/ (function(modules) { // webpackBootstrap condensed: false, pagination: false, printable: false, + keyBoardNav: false, searchPlaceholder: undefined, selectRow: { mode: _Const2.default.ROW_SELECT_NONE, @@ -1626,7 +1842,10 @@ return /******/ (function(modules) { // webpackBootstrap sizePerPageList: _Const2.default.SIZE_PER_PAGE_LIST, sizePerPage: undefined, paginationSize: _Const2.default.PAGINATION_SIZE, + paginationPosition: _Const2.default.PAGINATION_POS_BOTTOM, hideSizePerPage: false, + alwaysShowAllBtns: false, + withFirstAndLast: true, onSizePerPageList: undefined, noDataText: undefined, withoutNoDataText: false, @@ -1644,6 +1863,22 @@ return /******/ (function(modules) { // webpackBootstrap closeText: _Const2.default.CLOSE_BTN_TEXT, ignoreEditable: false, defaultSearch: '', + insertModalHeader: undefined, + insertModalBody: undefined, + insertModalFooter: undefined, + insertModal: undefined, + insertBtn: undefined, + deleteBtn: undefined, + showSelectedOnlyBtn: undefined, + exportCSVBtn: undefined, + clearSearchBtn: undefined, + searchField: undefined, + searchPanel: undefined, + btnGroup: undefined, + toolBar: undefined, + sizePerPageDropDown: undefined, + paginationPanel: undefined, + searchPosition: 'right', expandRowBgColor: undefined, expandBy: _Const2.default.EXPAND_BY_ROW, expanding: [], @@ -1760,6 +1995,9 @@ return /******/ (function(modules) { // webpackBootstrap CELL_EDIT_DBCLICK: 'dbclick', SIZE_PER_PAGE_LIST: [10, 25, 30, 50], PAGINATION_SIZE: 5, + PAGINATION_POS_TOP: 'top', + PAGINATION_POS_BOTTOM: 'bottom', + PAGINATION_POS_BOTH: 'both', NO_DATA_TEXT: 'There is no data to display', SHOW_ONLY_SELECT: 'Show Selected Only', SHOW_ALL: 'Show All', @@ -2159,6 +2397,10 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); + var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _react = __webpack_require__(2); @@ -2213,6 +2455,10 @@ return /******/ (function(modules) { // webpackBootstrap var _this = _possibleConstructorReturn(this, (TableBody.__proto__ || Object.getPrototypeOf(TableBody)).call(this, props)); + _this.handleCellKeyDown = function () { + return _this.__handleCellKeyDown__REACT_HOT_LOADER__.apply(_this, arguments); + }; + _this.handleRowMouseOut = function () { return _this.__handleRowMouseOut__REACT_HOT_LOADER__.apply(_this, arguments); }; @@ -2268,7 +2514,10 @@ return /******/ (function(modules) { // webpackBootstrap value: function render() { var _props = this.props, cellEdit = _props.cellEdit, - beforeShowError = _props.beforeShowError; + beforeShowError = _props.beforeShowError, + x = _props.x, + y = _props.y, + keyBoardNav = _props.keyBoardNav; var tableClasses = (0, _classnames2.default)('table', { 'table-striped': this.props.striped, @@ -2283,16 +2532,20 @@ return /******/ (function(modules) { // webpackBootstrap var tableHeader = _util2.default.renderColGroup(this.props.columns, this.props.selectRow, 'header'); var inputType = this.props.selectRow.mode === _Const2.default.ROW_SELECT_SINGLE ? 'radio' : 'checkbox'; var CustomComponent = this.props.selectRow.customComponent; + var enableKeyBoardNav = keyBoardNav === true || (typeof keyBoardNav === 'undefined' ? 'undefined' : _typeof(keyBoardNav)) === 'object'; + var customEditAndNavStyle = (typeof keyBoardNav === 'undefined' ? 'undefined' : _typeof(keyBoardNav)) === 'object' ? keyBoardNav.customStyleOnEditCell : null; + var customNavStyle = (typeof keyBoardNav === 'undefined' ? 'undefined' : _typeof(keyBoardNav)) === 'object' ? keyBoardNav.customStyle : null; var expandColSpan = this.props.columns.filter(function (col) { return !col.hidden; }).length; if (isSelectRowDefined && !this.props.selectRow.hideSelectColumn) { expandColSpan += 1; } - + var tabIndex = 1; var tableRows = this.props.data.map(function (data, r) { var tableColumns = this.props.columns.map(function (column, i) { var fieldValue = data[column.name]; + var isFocusCell = r === y && i === x; if (column.name !== this.props.keyField && // Key field can't be edit column.editable && // column is editable? default is true, user can set it false this.state.currEditCell !== null && this.state.currEditCell.rid === r && this.state.currEditCell.cid === i && noneditableRows.indexOf(data[this.props.keyField]) === -1) { @@ -2312,13 +2565,16 @@ return /******/ (function(modules) { // webpackBootstrap format: column.format ? format : false, key: i, blurToSave: cellEdit.blurToSave, + onTab: this.handleEditCell, rowIndex: r, colIndex: i, row: data, fieldValue: fieldValue, className: column.editClassName, invalidColumnClassName: column.invalidEditColumnClassName, - beforeShowError: beforeShowError }); + beforeShowError: beforeShowError, + isFocus: isFocusCell, + customStyleWithNav: customEditAndNavStyle }); } else { // add by bluespring for className customize var columnChild = fieldValue && fieldValue.toString(); @@ -2352,7 +2608,13 @@ return /******/ (function(modules) { // webpackBootstrap width: column.width, onClick: this.handleClickCell, attrs: column.attrs, - style: column.style }, + style: column.style, + tabIndex: tabIndex++ + '', + isFocus: isFocusCell, + keyBoardNav: enableKeyBoardNav, + onKeyDown: this.handleCellKeyDown, + customNavStyle: customNavStyle, + row: data }, columnChild ); } @@ -2428,6 +2690,39 @@ return /******/ (function(modules) { // webpackBootstrap ) ); } + }, { + key: '__handleCellKeyDown__REACT_HOT_LOADER__', + value: function __handleCellKeyDown__REACT_HOT_LOADER__(e, lastEditCell) { + e.preventDefault(); + var _props2 = this.props, + keyBoardNav = _props2.keyBoardNav, + onNavigateCell = _props2.onNavigateCell, + cellEdit = _props2.cellEdit; + + var offset = void 0; + if (e.keyCode === 37) { + offset = { x: -1, y: 0 }; + } else if (e.keyCode === 38) { + offset = { x: 0, y: -1 }; + } else if (e.keyCode === 39 || e.keyCode === 9) { + offset = { x: 1, y: 0 }; + if (e.keyCode === 9 && lastEditCell) { + offset = _extends({}, offset, { + lastEditCell: lastEditCell + }); + } + } else if (e.keyCode === 40) { + offset = { x: 0, y: 1 }; + } else if (e.keyCode === 13) { + var enterToEdit = (typeof keyBoardNav === 'undefined' ? 'undefined' : _typeof(keyBoardNav)) === 'object' ? keyBoardNav.enterToEdit : false; + if (cellEdit && enterToEdit) { + this.handleEditCell(e.target.parentElement.rowIndex + 1, e.currentTarget.cellIndex, '', e); + } + } + if (offset && keyBoardNav) { + onNavigateCell(offset); + } + } }, { key: '__handleRowMouseOut__REACT_HOT_LOADER__', value: function __handleRowMouseOut__REACT_HOT_LOADER__(rowIndex, event) { @@ -2442,8 +2737,10 @@ return /******/ (function(modules) { // webpackBootstrap } }, { key: '__handleRowClick__REACT_HOT_LOADER__', - value: function __handleRowClick__REACT_HOT_LOADER__(rowIndex) { - this.props.onRowClick(this.props.data[rowIndex - 1]); + value: function __handleRowClick__REACT_HOT_LOADER__(rowIndex, cellIndex) { + var onRowClick = this.props.onRowClick; + + onRowClick(this.props.data[rowIndex - 1], rowIndex - 1, this._isSelectRowDefined() ? cellIndex - 1 : cellIndex); } }, { key: '__handleRowDoubleClick__REACT_HOT_LOADER__', @@ -2457,9 +2754,9 @@ return /******/ (function(modules) { // webpackBootstrap key: '__handleSelectRow__REACT_HOT_LOADER__', value: function __handleSelectRow__REACT_HOT_LOADER__(rowIndex, isSelected, e) { var selectedRow = void 0; - var _props2 = this.props, - data = _props2.data, - onSelectRow = _props2.onSelectRow; + var _props3 = this.props, + data = _props3.data, + onSelectRow = _props3.onSelectRow; data.forEach(function (row, i) { if (i === rowIndex - 1) { @@ -2482,16 +2779,15 @@ return /******/ (function(modules) { // webpackBootstrap var _this2 = this; var columnIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : -1; - var _props3 = this.props, - columns = _props3.columns, - keyField = _props3.keyField, - expandBy = _props3.expandBy, - expandableRow = _props3.expandableRow, - clickToExpand = _props3.selectRow.clickToExpand; + var _props4 = this.props, + columns = _props4.columns, + keyField = _props4.keyField, + expandBy = _props4.expandBy, + expandableRow = _props4.expandableRow, + clickToExpand = _props4.selectRow.clickToExpand; var selectRowAndExpand = this._isSelectRowDefined() && !clickToExpand ? false : true; columnIndex = this._isSelectRowDefined() ? columnIndex - 1 : columnIndex; - if (expandableRow && selectRowAndExpand && (expandBy === _Const2.default.EXPAND_BY_ROW || /* Below will allow expanding trigger by clicking on selection column if configure as expanding by column */ @@ -2512,12 +2808,24 @@ return /******/ (function(modules) { // webpackBootstrap } }, { key: '__handleEditCell__REACT_HOT_LOADER__', - value: function __handleEditCell__REACT_HOT_LOADER__(rowIndex, columnIndex, e) { + value: function __handleEditCell__REACT_HOT_LOADER__(rowIndex, columnIndex, action, e) { if (this._isSelectRowDefined()) { columnIndex--; if (this.props.selectRow.hideSelectColumn) columnIndex++; } rowIndex--; + + if (action === 'tab') { + this.handleCompleteEditCell(e.target.value, rowIndex, columnIndex - 1); + if (columnIndex >= this.props.columns.length) { + rowIndex = rowIndex + 1; + columnIndex = 1; + this.handleCellKeyDown(e, true); + } else { + this.handleCellKeyDown(e); + } + } + var stateObj = { currEditCell: { rid: rowIndex, @@ -2614,7 +2922,11 @@ return /******/ (function(modules) { // webpackBootstrap expandBy: _react.PropTypes.string, expanding: _react.PropTypes.array, onExpand: _react.PropTypes.func, - beforeShowError: _react.PropTypes.func + beforeShowError: _react.PropTypes.func, + keyBoardNav: _react.PropTypes.oneOfType([_react.PropTypes.bool, _react.PropTypes.object]), + x: _react.PropTypes.number, + y: _react.PropTypes.number, + onNavigateCell: _react.PropTypes.func }; var _default = TableBody; exports.default = _default; @@ -2703,8 +3015,8 @@ return /******/ (function(modules) { // webpackBootstrap var isSelectRowDefined = selectRow.mode === _Const2.default.ROW_SELECT_SINGLE || selectRow.mode === _Const2.default.ROW_SELECT_MULTI; if (isSelectRowDefined) { var style = { - width: selectRow.columnWidth || 30, - minWidth: selectRow.columnWidth || 30 + width: selectRow.columnWidth || '30px', + minWidth: selectRow.columnWidth || '30px' }; if (!selectRow.hideSelectColumn) { selectRowHeader = _react2.default.createElement('col', { style: style, key: -1 }); @@ -2715,10 +3027,11 @@ return /******/ (function(modules) { // webpackBootstrap display: column.hidden ? 'none' : null }; if (column.width) { - style.width = column.width; + var width = !isNaN(column.width) ? column.width + 'px' : column.width; + style.width = width; /** add min-wdth to fix user assign column width not eq offsetWidth in large column table **/ - style.minWidth = column.width; + style.minWidth = width; } return _react2.default.createElement('col', { style: style, key: i, className: column.className }); }); @@ -2813,8 +3126,8 @@ return /******/ (function(modules) { // webpackBootstrap var _this2 = this; var rowIndex = this.props.index + 1; - if (this.props.onRowClick) this.props.onRowClick(rowIndex); var cellIndex = e.target.cellIndex; + if (this.props.onRowClick) this.props.onRowClick(rowIndex, cellIndex); var _props = this.props, selectRow = _props.selectRow, unselectableRow = _props.unselectableRow, @@ -2892,23 +3205,15 @@ return /******/ (function(modules) { // webpackBootstrap className: (0, _classnames2.default)(this.props.isSelected ? this.props.selectRow.className : null, this.props.className) }; - if (this.props.selectRow && (this.props.selectRow.clickToSelect || this.props.selectRow.clickToSelectAndEditCell) || this.props.onRowClick || this.props.onRowDoubleClick) { - return _react2.default.createElement( - 'tr', - _extends({}, trCss, { - onMouseOver: this.rowMouseOver, - onMouseOut: this.rowMouseOut, - onClick: this.rowClick, - onDoubleClick: this.rowDoubleClick }), - this.props.children - ); - } else { - return _react2.default.createElement( - 'tr', - trCss, - this.props.children - ); - } + return _react2.default.createElement( + 'tr', + _extends({}, trCss, { + onMouseOver: this.rowMouseOver, + onMouseOut: this.rowMouseOut, + onClick: this.rowClick, + onDoubleClick: this.rowDoubleClick }), + this.props.children + ); } }]); @@ -2967,6 +3272,10 @@ return /******/ (function(modules) { // webpackBootstrap var _react2 = _interopRequireDefault(_react); + var _reactDom = __webpack_require__(6); + + var _reactDom2 = _interopRequireDefault(_reactDom); + var _Const = __webpack_require__(4); var _Const2 = _interopRequireDefault(_Const); @@ -2995,6 +3304,10 @@ return /******/ (function(modules) { // webpackBootstrap return _this.__handleCellClick__REACT_HOT_LOADER__.apply(_this, arguments); }; + _this.handleKeyDown = function () { + return _this.__handleKeyDown__REACT_HOT_LOADER__.apply(_this, arguments); + }; + return _this; } /* eslint no-unused-vars: [0, { "args": "after-used" }] */ @@ -3005,7 +3318,7 @@ return /******/ (function(modules) { // webpackBootstrap value: function shouldComponentUpdate(nextProps, nextState) { var children = this.props.children; - var shouldUpdated = this.props.width !== nextProps.width || this.props.className !== nextProps.className || this.props.hidden !== nextProps.hidden || this.props.dataAlign !== nextProps.dataAlign || (typeof children === 'undefined' ? 'undefined' : _typeof(children)) !== _typeof(nextProps.children) || ('' + this.props.onEdit).toString() !== ('' + nextProps.onEdit).toString(); + var shouldUpdated = this.props.width !== nextProps.width || this.props.className !== nextProps.className || this.props.hidden !== nextProps.hidden || this.props.dataAlign !== nextProps.dataAlign || this.props.isFocus !== nextProps.isFocus || (typeof children === 'undefined' ? 'undefined' : _typeof(children)) !== _typeof(nextProps.children) || ('' + this.props.onEdit).toString() !== ('' + nextProps.onEdit).toString(); if (shouldUpdated) { return shouldUpdated; @@ -3031,6 +3344,26 @@ return /******/ (function(modules) { // webpackBootstrap return shouldUpdated || this.props.cellEdit.mode !== nextProps.cellEdit.mode; } } + }, { + key: 'componentDidMount', + value: function componentDidMount() { + var dom = _reactDom2.default.findDOMNode(this); + if (this.props.isFocus) { + dom.focus(); + } else { + dom.blur(); + } + } + }, { + key: 'componentDidUpdate', + value: function componentDidUpdate() { + var dom = _reactDom2.default.findDOMNode(this); + if (this.props.isFocus) { + dom.focus(); + } else { + dom.blur(); + } + } }, { key: '__handleCellEdit__REACT_HOT_LOADER__', value: function __handleCellEdit__REACT_HOT_LOADER__(e) { @@ -3058,18 +3391,30 @@ return /******/ (function(modules) { // webpackBootstrap onClick(rIndex + 1, e.currentTarget.cellIndex, e); } } + }, { + key: '__handleKeyDown__REACT_HOT_LOADER__', + value: function __handleKeyDown__REACT_HOT_LOADER__(e) { + if (this.props.keyBoardNav) { + this.props.onKeyDown(e); + } + } }, { key: 'render', value: function render() { var _props2 = this.props, children = _props2.children, columnTitle = _props2.columnTitle, - className = _props2.className, dataAlign = _props2.dataAlign, hidden = _props2.hidden, cellEdit = _props2.cellEdit, attrs = _props2.attrs, - style = _props2.style; + style = _props2.style, + isFocus = _props2.isFocus, + keyBoardNav = _props2.keyBoardNav, + tabIndex = _props2.tabIndex, + customNavStyle = _props2.customNavStyle, + row = _props2.row; + var className = this.props.className; var tdStyle = _extends({ @@ -3088,9 +3433,22 @@ return /******/ (function(modules) { // webpackBootstrap opts.onClick = this.handleCellClick; } } + + if (keyBoardNav && isFocus) { + opts.onKeyDown = this.handleKeyDown; + } + + if (isFocus) { + if (customNavStyle) { + var cusmtStyle = typeof customNavStyle === 'function' ? customNavStyle(children, row) : customNavStyle; + tdStyle = _extends({}, tdStyle, cusmtStyle); + } else { + className = className + ' default-focus-cell'; + } + } return _react2.default.createElement( 'td', - _extends({ style: tdStyle, + _extends({ tabIndex: tabIndex, style: tdStyle, title: columnTitle, className: className }, opts, attrs), @@ -3111,13 +3469,21 @@ return /******/ (function(modules) { // webpackBootstrap children: _react.PropTypes.node, onClick: _react.PropTypes.func, attrs: _react.PropTypes.object, - style: _react.PropTypes.object + style: _react.PropTypes.object, + isFocus: _react.PropTypes.bool, + onKeyDown: _react.PropTypes.func, + tabIndex: _react.PropTypes.string, + keyBoardNav: _react.PropTypes.oneOfType([_react.PropTypes.bool, _react.PropTypes.object]), + customNavStyle: _react.PropTypes.oneOfType([_react.PropTypes.func, _react.PropTypes.object]), + row: _react.PropTypes.any /* only used on custom styling for navigation */ }; TableColumn.defaultProps = { dataAlign: 'left', hidden: false, - className: '' + className: '', + isFocus: false, + keyBoardNav: false }; var _default = TableColumn; exports.default = _default; @@ -3155,6 +3521,10 @@ return /******/ (function(modules) { // webpackBootstrap var _react2 = _interopRequireDefault(_react); + var _reactDom = __webpack_require__(6); + + var _reactDom2 = _interopRequireDefault(_reactDom); + var _Editor = __webpack_require__(13); var _Editor2 = _interopRequireDefault(_Editor); @@ -3229,6 +3599,9 @@ return /******/ (function(modules) { // webpackBootstrap this.props.completeEdit(value, this.props.rowIndex, this.props.colIndex); } else if (e.keyCode === 27) { this.props.completeEdit(null, this.props.rowIndex, this.props.colIndex); + } else if (e.keyCode === 9) { + this.props.onTab(this.props.rowIndex + 1, this.props.colIndex + 1, 'tab', e); + e.preventDefault(); } else if (e.type === 'click' && !this.props.blurToSave) { // textarea click save button var _value = e.target.parentElement.firstChild.value; @@ -3257,6 +3630,9 @@ return /******/ (function(modules) { // webpackBootstrap // modified by iuculanop // BEGIN value: function __handleCustomUpdate__REACT_HOT_LOADER__(value) { + if (!this.validator(value)) { + return; + } this.props.completeEdit(value, this.props.rowIndex, this.props.colIndex); } }, { @@ -3323,6 +3699,22 @@ return /******/ (function(modules) { // webpackBootstrap key: 'componentDidMount', value: function componentDidMount() { this.refs.inputRef.focus(); + var dom = _reactDom2.default.findDOMNode(this); + if (this.props.isFocus) { + dom.focus(); + } else { + dom.blur(); + } + } + }, { + key: 'componentDidUpdate', + value: function componentDidUpdate() { + var dom = _reactDom2.default.findDOMNode(this); + if (this.props.isFocus) { + dom.focus(); + } else { + dom.blur(); + } } }, { key: 'componentWillUnmount', @@ -3342,17 +3734,20 @@ return /******/ (function(modules) { // webpackBootstrap var _props2 = this.props, editable = _props2.editable, format = _props2.format, - customEditor = _props2.customEditor; - var _state = this.state, - shakeEditor = _state.shakeEditor, - className = _state.className; + customEditor = _props2.customEditor, + isFocus = _props2.isFocus, + customStyleWithNav = _props2.customStyleWithNav, + row = _props2.row; + var shakeEditor = this.state.shakeEditor; var attr = { ref: 'inputRef', onKeyDown: this.handleKeyPress, onBlur: this.handleBlur }; + var style = { position: 'relative' }; var fieldValue = this.props.fieldValue; + var className = this.state.className; // put placeholder if exist editable.placeholder && (attr.placeholder = editable.placeholder); @@ -3361,7 +3756,7 @@ return /******/ (function(modules) { // webpackBootstrap var cellEditor = void 0; if (customEditor) { var customEditorProps = _extends({ - row: this.props.row + row: row }, attr, { defaultValue: fieldValue || '' }, customEditor.customEditorParameters); @@ -3371,10 +3766,19 @@ return /******/ (function(modules) { // webpackBootstrap cellEditor = (0, _Editor2.default)(editable, attr, format, editorClass, fieldValue || ''); } + if (isFocus) { + if (customStyleWithNav) { + var customStyle = typeof customStyleWithNav === 'function' ? customStyleWithNav(fieldValue, row) : customStyleWithNav; + style = _extends({}, style, customStyle); + } else { + className = className + ' default-focus-cell'; + } + } + return _react2.default.createElement( 'td', { ref: 'td', - style: { position: 'relative' }, + style: style, className: className, onClick: this.handleClick }, cellEditor, @@ -3404,7 +3808,9 @@ return /******/ (function(modules) { // webpackBootstrap row: _react.PropTypes.any, fieldValue: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.bool, _react.PropTypes.number, _react.PropTypes.array, _react.PropTypes.object]), className: _react.PropTypes.any, - beforeShowError: _react.PropTypes.func + beforeShowError: _react.PropTypes.func, + isFocus: _react.PropTypes.bool, + customStyleWithNav: _react.PropTypes.oneOfType([_react.PropTypes.func, _react.PropTypes.object]) }; var _default = TableEditColumn; @@ -9833,16 +10239,26 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); + var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _react = __webpack_require__(2); var _react2 = _interopRequireDefault(_react); + var _classnames = __webpack_require__(3); + + var _classnames2 = _interopRequireDefault(_classnames); + var _PageButton = __webpack_require__(181); var _PageButton2 = _interopRequireDefault(_PageButton); + var _SizePerPageDropDown = __webpack_require__(182); + + var _SizePerPageDropDown2 = _interopRequireDefault(_SizePerPageDropDown); + var _Const = __webpack_require__(4); var _Const2 = _interopRequireDefault(_Const); @@ -9858,29 +10274,35 @@ return /******/ (function(modules) { // webpackBootstrap var PaginationList = function (_Component) { _inherits(PaginationList, _Component); - function PaginationList() { - var _ref; - - var _temp, _this, _ret; - + function PaginationList(props) { _classCallCheck(this, PaginationList); - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } + var _this = _possibleConstructorReturn(this, (PaginationList.__proto__ || Object.getPrototypeOf(PaginationList)).call(this, props)); - return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = PaginationList.__proto__ || Object.getPrototypeOf(PaginationList)).call.apply(_ref, [this].concat(args))), _this), _this.changePage = function () { - var _this2; + _this.changePage = function () { + return _this.__changePage__REACT_HOT_LOADER__.apply(_this, arguments); + }; - return (_this2 = _this).__changePage__REACT_HOT_LOADER__.apply(_this2, arguments); - }, _this.changeSizePerPage = function () { - var _this3; + _this.changeSizePerPage = function () { + return _this.__changeSizePerPage__REACT_HOT_LOADER__.apply(_this, arguments); + }; - return (_this3 = _this).__changeSizePerPage__REACT_HOT_LOADER__.apply(_this3, arguments); - }, _temp), _possibleConstructorReturn(_this, _ret); + _this.toggleDropDown = function () { + return _this.__toggleDropDown__REACT_HOT_LOADER__.apply(_this, arguments); + }; + + _this.state = { + open: _this.props.open + }; + return _this; } _createClass(PaginationList, [{ + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps() { + this.setState({ open: false }); + } + }, { key: '__changePage__REACT_HOT_LOADER__', value: function __changePage__REACT_HOT_LOADER__(page) { var _props = this.props, @@ -9911,10 +10333,8 @@ return /******/ (function(modules) { // webpackBootstrap } }, { key: '__changeSizePerPage__REACT_HOT_LOADER__', - value: function __changeSizePerPage__REACT_HOT_LOADER__(e) { - e.preventDefault(); - - var selectSize = parseInt(e.currentTarget.getAttribute('data-page'), 10); + value: function __changeSizePerPage__REACT_HOT_LOADER__(pageNum) { + var selectSize = typeof pageNum === 'string' ? parseInt(pageNum, 10) : pageNum; var currPage = this.props.currPage; if (selectSize !== this.props.sizePerPage) { @@ -9925,13 +10345,20 @@ return /******/ (function(modules) { // webpackBootstrap if (this.props.onSizePerPageList) { this.props.onSizePerPageList(selectSize); } + } else { + this.setState({ open: false }); } } + }, { + key: '__toggleDropDown__REACT_HOT_LOADER__', + value: function __toggleDropDown__REACT_HOT_LOADER__() { + this.setState({ + open: !this.state.open + }); + } }, { key: 'render', value: function render() { - var _this4 = this; - var _props2 = this.props, currPage = _props2.currPage, dataSize = _props2.dataSize, @@ -9939,35 +10366,12 @@ return /******/ (function(modules) { // webpackBootstrap sizePerPageList = _props2.sizePerPageList, paginationShowsTotal = _props2.paginationShowsTotal, pageStartIndex = _props2.pageStartIndex, - hideSizePerPage = _props2.hideSizePerPage; + paginationPanel = _props2.paginationPanel; - var sizePerPageText = ''; this.totalPages = Math.ceil(dataSize / sizePerPage); this.lastPage = this.props.pageStartIndex + this.totalPages - 1; - var pageBtns = this.makePage(); - var pageListStyle = { - float: 'right', - // override the margin-top defined in .pagination class in bootstrap. - marginTop: '0px' - }; - - var sizePerPageOptions = sizePerPageList.map(function (_sizePerPage) { - var pageText = _sizePerPage.text || _sizePerPage; - var pageNum = _sizePerPage.value || _sizePerPage; - if (sizePerPage === pageNum) sizePerPageText = pageText; - return _react2.default.createElement( - 'li', - { key: pageText, role: 'presentation' }, - _react2.default.createElement( - 'a', - { role: 'menuitem', - tabIndex: '-1', href: '#', - 'data-page': pageNum, - onClick: _this4.changeSizePerPage }, - pageText - ) - ); - }); + var pageBtns = this.makePage(typeof paginationPanel === 'function'); + var dropdown = this.makeDropDown(); var offset = Math.abs(_Const2.default.PAGE_START_INDEX - pageStartIndex); var start = (currPage - pageStartIndex) * sizePerPage; @@ -9989,99 +10393,151 @@ return /******/ (function(modules) { // webpackBootstrap total = paginationShowsTotal(start, to + 1, dataSize); } - var dropDownStyle = { - visibility: hideSizePerPage ? 'hidden' : 'visible' - }; + var content = paginationPanel && paginationPanel({ + currPage: currPage, + sizePerPage: sizePerPage, + sizePerPageList: sizePerPageList, + pageStartIndex: pageStartIndex, + changePage: this.changePage, + toggleDropDown: this.toggleDropDown, + changeSizePerPage: this.changeSizePerPage, + components: { + totalText: total, + sizePerPageDropdown: dropdown, + pageList: pageBtns + } + }); return _react2.default.createElement( 'div', { className: 'row', style: { marginTop: 15 } }, - sizePerPageList.length > 1 ? _react2.default.createElement( + content || _react2.default.createElement( 'div', null, _react2.default.createElement( 'div', - { className: 'col-md-6' }, + { className: 'col-md-6 col-xs-6 col-sm-6 col-lg-6' }, total, - ' ', - _react2.default.createElement( - 'span', - { className: 'dropdown', style: dropDownStyle }, - _react2.default.createElement( - 'button', - { className: 'btn btn-default dropdown-toggle', - type: 'button', id: 'pageDropDown', 'data-toggle': 'dropdown', - 'aria-expanded': 'true' }, - sizePerPageText, - _react2.default.createElement( - 'span', - null, - ' ', - _react2.default.createElement('span', { className: 'caret' }) - ) - ), - _react2.default.createElement( - 'ul', - { className: 'dropdown-menu', role: 'menu', 'aria-labelledby': 'pageDropDown' }, - sizePerPageOptions - ) - ) - ), - _react2.default.createElement( - 'div', - { className: 'col-md-6' }, - _react2.default.createElement( - 'ul', - { className: 'pagination', style: pageListStyle }, - pageBtns - ) - ) - ) : _react2.default.createElement( - 'div', - null, - _react2.default.createElement( - 'div', - { className: 'col-md-6' }, - total + sizePerPageList.length > 1 ? dropdown : null ), _react2.default.createElement( 'div', - { className: 'col-md-6' }, - _react2.default.createElement( - 'ul', - { className: 'pagination', style: pageListStyle }, - pageBtns - ) + { className: 'col-md-6 col-xs-6 col-sm-6 col-lg-6' }, + pageBtns ) ) ); } + }, { + key: 'makeDropDown', + value: function makeDropDown() { + var _this2 = this; + + var dropdown = void 0; + var dropdownProps = void 0; + var sizePerPageText = ''; + var _props3 = this.props, + sizePerPageDropDown = _props3.sizePerPageDropDown, + hideSizePerPage = _props3.hideSizePerPage, + sizePerPage = _props3.sizePerPage, + sizePerPageList = _props3.sizePerPageList; + + if (sizePerPageDropDown) { + dropdown = sizePerPageDropDown({ + open: this.state.open, + hideSizePerPage: hideSizePerPage, + currSizePerPage: sizePerPage, + sizePerPageList: sizePerPageList, + toggleDropDown: this.toggleDropDown, + changeSizePerPage: this.changeSizePerPage + }); + if (dropdown.type.name === _SizePerPageDropDown2.default.name) { + dropdownProps = dropdown.props; + } else { + return dropdown; + } + } + + if (dropdownProps || !dropdown) { + var sizePerPageOptions = sizePerPageList.map(function (_sizePerPage) { + var pageText = _sizePerPage.text || _sizePerPage; + var pageNum = _sizePerPage.value || _sizePerPage; + if (sizePerPage === pageNum) sizePerPageText = pageText; + return _react2.default.createElement( + 'li', + { key: pageText, role: 'presentation' }, + _react2.default.createElement( + 'a', + { role: 'menuitem', + tabIndex: '-1', href: '#', + 'data-page': pageNum, + onClick: function onClick(e) { + e.preventDefault(); + _this2.changeSizePerPage(pageNum); + } }, + pageText + ) + ); + }); + dropdown = _react2.default.createElement(_SizePerPageDropDown2.default, _extends({ + open: this.state.open, + hidden: hideSizePerPage, + currSizePerPage: String(sizePerPageText), + options: sizePerPageOptions, + onClick: this.toggleDropDown + }, dropdownProps)); + } + return dropdown; + } }, { key: 'makePage', value: function makePage() { + var _this3 = this; + + var isCustomPagingPanel = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + var pages = this.getPages(); - return pages.map(function (page) { - var isActive = page === this.props.currPage; - var disabled = false; - var hidden = false; - if (this.props.currPage === this.props.pageStartIndex && (page === this.props.firstPage || page === this.props.prePage)) { - disabled = true; - hidden = true; - } - if (this.props.currPage === this.lastPage && (page === this.props.nextPage || page === this.props.lastPage)) { - disabled = true; - hidden = true; + var isStart = function isStart(page, _ref) { + var currPage = _ref.currPage, + pageStartIndex = _ref.pageStartIndex, + firstPage = _ref.firstPage, + prePage = _ref.prePage; + return currPage === pageStartIndex && (page === firstPage || page === prePage); + }; + var isEnd = function isEnd(page, _ref2) { + var currPage = _ref2.currPage, + nextPage = _ref2.nextPage, + lastPage = _ref2.lastPage; + return currPage === _this3.lastPage && (page === nextPage || page === lastPage); + }; + var pageBtns = pages.filter(function (page) { + if (this.props.alwaysShowAllBtns) { + return true; } + return isStart(page, this.props) || isEnd(page, this.props) ? false : true; + }, this).map(function (page) { + var isActive = page === this.props.currPage; + var isDisabled = isStart(page, this.props) || isEnd(page, this.props) ? true : false; return _react2.default.createElement( _PageButton2.default, { key: page, changePage: this.changePage, active: isActive, - disable: disabled, - hidden: hidden }, + disable: isDisabled }, page ); }, this); + var classname = (0, _classnames2.default)(isCustomPagingPanel ? null : 'react-bootstrap-table-page-btns-ul', 'pagination'); + return _react2.default.createElement( + 'ul', + { className: classname }, + pageBtns + ); + } + }, { + key: 'getLastPage', + value: function getLastPage() { + return this.lastPage; } }, { key: 'getPages', @@ -10097,9 +10553,9 @@ return /******/ (function(modules) { // webpackBootstrap startPage = endPage - this.props.paginationSize + 1; } - if (startPage !== this.props.pageStartIndex && this.totalPages > this.props.paginationSize) { + if (startPage !== this.props.pageStartIndex && this.totalPages > this.props.paginationSize && this.props.withFirstAndLast) { pages = [this.props.firstPage, this.props.prePage]; - } else if (this.totalPages > 1) { + } else if (this.totalPages > 1 || this.props.alwaysShowAllBtns) { pages = [this.props.prePage]; } else { pages = []; @@ -10109,11 +10565,11 @@ return /******/ (function(modules) { // webpackBootstrap if (i >= this.props.pageStartIndex) pages.push(i); } - if (endPage < this.lastPage) { + if (endPage <= this.lastPage) { pages.push(this.props.nextPage); + } + if (endPage !== this.totalPages && this.props.withFirstAndLast) { pages.push(this.props.lastPage); - } else if (endPage === this.lastPage && this.props.currPage !== this.lastPage) { - pages.push(this.props.nextPage); } return pages; @@ -10134,7 +10590,11 @@ return /******/ (function(modules) { // webpackBootstrap onSizePerPageList: _react.PropTypes.func, prePage: _react.PropTypes.string, pageStartIndex: _react.PropTypes.number, - hideSizePerPage: _react.PropTypes.bool + hideSizePerPage: _react.PropTypes.bool, + alwaysShowAllBtns: _react.PropTypes.bool, + withFirstAndLast: _react.PropTypes.bool, + sizePerPageDropDown: _react.PropTypes.func, + paginationPanel: _react.PropTypes.func }; PaginationList.defaultProps = { @@ -10146,7 +10606,7 @@ return /******/ (function(modules) { // webpackBootstrap exports.default = _default; ; - var _temp2 = function () { + var _temp = function () { if (typeof __REACT_HOT_LOADER__ === 'undefined') { return; } @@ -10265,37 +10725,181 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _react = __webpack_require__(2); var _react2 = _interopRequireDefault(_react); - var _classnames = __webpack_require__(3); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - var _classnames2 = _interopRequireDefault(_classnames); + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - var _Const = __webpack_require__(4); + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - var _Const2 = _interopRequireDefault(_Const); + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - var _Editor = __webpack_require__(13); + var SizePerPageDropDown = function (_Component) { + _inherits(SizePerPageDropDown, _Component); - var _Editor2 = _interopRequireDefault(_Editor); + function SizePerPageDropDown() { + _classCallCheck(this, SizePerPageDropDown); + + return _possibleConstructorReturn(this, (SizePerPageDropDown.__proto__ || Object.getPrototypeOf(SizePerPageDropDown)).apply(this, arguments)); + } + + _createClass(SizePerPageDropDown, [{ + key: 'render', + value: function render() { + var _props = this.props, + open = _props.open, + hidden = _props.hidden, + onClick = _props.onClick, + options = _props.options, + className = _props.className, + variation = _props.variation, + btnContextual = _props.btnContextual, + currSizePerPage = _props.currSizePerPage; + + + var openClass = open ? 'open' : ''; + var dropDownStyle = { visibility: hidden ? 'hidden' : 'visible' }; + + return _react2.default.createElement( + 'span', + { className: variation + ' ' + openClass + ' ' + className, style: dropDownStyle }, + _react2.default.createElement( + 'button', + { className: 'btn ' + btnContextual + ' dropdown-toggle', + id: 'pageDropDown', 'data-toggle': 'dropdown', + 'aria-expanded': open, + onClick: onClick }, + currSizePerPage, + _react2.default.createElement( + 'span', + null, + ' ', + _react2.default.createElement('span', { className: 'caret' }) + ) + ), + _react2.default.createElement( + 'ul', + { className: 'dropdown-menu', role: 'menu', 'aria-labelledby': 'pageDropDown' }, + options + ) + ); + } + }]); + + return SizePerPageDropDown; + }(_react.Component); + + SizePerPageDropDown.propTypes = { + open: _react.PropTypes.bool, + hidden: _react.PropTypes.bool, + btnContextual: _react.PropTypes.string, + currSizePerPage: _react.PropTypes.string, + options: _react.PropTypes.array, + variation: _react.PropTypes.oneOf(['dropdown', 'dropup']), + className: _react.PropTypes.string, + onClick: _react.PropTypes.func + }; + SizePerPageDropDown.defaultProps = { + open: false, + hidden: false, + btnContextual: 'btn-default', + variation: 'dropdown', + className: '' + }; + + var _default = SizePerPageDropDown; + exports.default = _default; + ; + + var _temp = function () { + if (typeof __REACT_HOT_LOADER__ === 'undefined') { + return; + } + + __REACT_HOT_LOADER__.register(SizePerPageDropDown, 'SizePerPageDropDown', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/pagination/SizePerPageDropDown.js'); + + __REACT_HOT_LOADER__.register(_default, 'default', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/pagination/SizePerPageDropDown.js'); + }(); + + ; + +/***/ }, +/* 183 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _react = __webpack_require__(2); + + var _react2 = _interopRequireDefault(_react); + + var _reactModal = __webpack_require__(184); + + var _reactModal2 = _interopRequireDefault(_reactModal); + + var _Const = __webpack_require__(4); + + var _Const2 = _interopRequireDefault(_Const); var _Notification = __webpack_require__(14); var _Notification2 = _interopRequireDefault(_Notification); + var _InsertModal = __webpack_require__(194); + + var _InsertModal2 = _interopRequireDefault(_InsertModal); + + var _InsertButton = __webpack_require__(198); + + var _InsertButton2 = _interopRequireDefault(_InsertButton); + + var _DeleteButton = __webpack_require__(199); + + var _DeleteButton2 = _interopRequireDefault(_DeleteButton); + + var _ExportCSVButton = __webpack_require__(200); + + var _ExportCSVButton2 = _interopRequireDefault(_ExportCSVButton); + + var _ShowSelectedOnlyButton = __webpack_require__(201); + + var _ShowSelectedOnlyButton2 = _interopRequireDefault(_ShowSelectedOnlyButton); + + var _SearchField = __webpack_require__(202); + + var _SearchField2 = _interopRequireDefault(_SearchField); + + var _ClearSearchButton = __webpack_require__(203); + + var _ClearSearchButton2 = _interopRequireDefault(_ClearSearchButton); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /* eslint no-console: 0 */ + + // import classSet from 'classnames'; + + // import editor from '../Editor'; + var ToolBar = function (_Component) { _inherits(ToolBar, _Component); @@ -10311,6 +10915,14 @@ return /******/ (function(modules) { // webpackBootstrap return _this.__handleSaveBtnClick__REACT_HOT_LOADER__.apply(_this, arguments); }; + _this.handleModalClose = function () { + return _this.__handleModalClose__REACT_HOT_LOADER__.apply(_this, arguments); + }; + + _this.handleModalOpen = function () { + return _this.__handleModalOpen__REACT_HOT_LOADER__.apply(_this, arguments); + }; + _this.handleShowOnlyToggle = function () { return _this.__handleShowOnlyToggle__REACT_HOT_LOADER__.apply(_this, arguments); }; @@ -10358,7 +10970,7 @@ return /******/ (function(modules) { // webpackBootstrap _this.timeouteClear = 0; _this.modalClassName; _this.state = { - isInsertRowTrigger: true, + isInsertModalOpen: false, validateState: null, shakeEditor: false, showSelected: false @@ -10373,7 +10985,9 @@ return /******/ (function(modules) { // webpackBootstrap var delay = this.props.searchDelayTime ? this.props.searchDelayTime : 0; this.debounceCallback = this.handleDebounce(function () { - _this2.props.onSearch(_this2.refs.seachInput.value); + var seachInput = _this2.refs.seachInput; + + seachInput && _this2.props.onSearch(seachInput.getValue()); }, delay); } }, { @@ -10391,8 +11005,10 @@ return /******/ (function(modules) { // webpackBootstrap }, { key: 'setSearchInput', value: function setSearchInput(text) { - if (this.refs.seachInput.value !== text) { - this.refs.seachInput.value = text; + var seachInput = this.refs.seachInput; + + if (seachInput && seachInput.value !== text) { + seachInput.value = text; } } }, { @@ -10413,59 +11029,35 @@ return /******/ (function(modules) { // webpackBootstrap this.timeouteClear = 0; } }) - - // modified by iuculanop - // BEGIN - }, { - key: 'checkAndParseForm', - value: function checkAndParseForm() { + key: 'validateNewRow', + value: function validateNewRow(newRow) { var _this3 = this; - var newObj = {}; var validateState = {}; var isValid = true; - var checkVal = void 0; + var tempMsg = void 0; var responseType = void 0; - var tempValue = void 0; - - this.props.columns.forEach(function (column, i) { - if (column.autoValue) { - // when you want same auto generate value and not allow edit, example ID field - var time = new Date().getTime(); - tempValue = typeof column.autoValue === 'function' ? column.autoValue() : 'autovalue-' + time; - } else if (column.hiddenOnInsert || !column.field) { - tempValue = ''; - } else { - var dom = this.refs[column.field + i]; - tempValue = dom.value; - - if (column.editable && column.editable.type === 'checkbox') { - var values = tempValue.split(':'); - tempValue = dom.checked ? values[0] : values[1]; - } - if (column.editable && column.editable.validator) { - // process validate - checkVal = column.editable.validator(tempValue); - responseType = typeof checkVal === 'undefined' ? 'undefined' : _typeof(checkVal); - if (responseType !== 'object' && checkVal !== true) { - this.refs.notifier.notice('error', 'Form validate errors, please checking!', 'Pressed ESC can cancel'); - isValid = false; - validateState[column.field] = checkVal; - } else if (responseType === 'object' && checkVal.isValid !== true) { - this.refs.notifier.notice(checkVal.notification.type, checkVal.notification.msg, checkVal.notification.title); - isValid = false; - validateState[column.field] = checkVal.notification.msg; - } + this.props.columns.forEach(function (column) { + if (column.editable && column.editable.validator) { + // process validate + tempMsg = column.editable.validator(newRow[column.field]); + responseType = typeof tempMsg === 'undefined' ? 'undefined' : _typeof(tempMsg); + if (responseType !== 'object' && tempMsg !== true) { + _this3.refs.notifier.notice('error', 'Form validate errors, please checking!', 'Pressed ESC can cancel'); + isValid = false; + validateState[column.field] = tempMsg; + } else if (responseType === 'object' && tempMsg.isValid !== true) { + _this3.refs.notifier.notice(tempMsg.notification.type, tempMsg.notification.msg, tempMsg.notification.title); + isValid = false; + validateState[column.field] = tempMsg.notification.msg; } } - - newObj[column.field] = tempValue; - }, this); + }); if (isValid) { - return newObj; + return true; } else { this.clearTimeout(); // show error in form and shake it @@ -10476,19 +11068,16 @@ return /******/ (function(modules) { // webpackBootstrap return null; } } - // END - }, { key: '__handleSaveBtnClick__REACT_HOT_LOADER__', - value: function __handleSaveBtnClick__REACT_HOT_LOADER__() { + value: function __handleSaveBtnClick__REACT_HOT_LOADER__(newRow) { var _this4 = this; - var newObj = this.checkAndParseForm(); - if (!newObj) { - // validate errors + if (!this.validateNewRow(newRow)) { + // validation fail return; } - var msg = this.props.onAddRow(newObj); + var msg = this.props.onAddRow(newRow); if (msg) { this.refs.notifier.notice('error', msg, 'Pressed ESC can cancel'); this.clearTimeout(); @@ -10505,15 +11094,21 @@ return /******/ (function(modules) { // webpackBootstrap // reset state and hide modal hide this.setState({ validateState: null, - shakeEditor: false - }, function () { - document.querySelector('.modal-backdrop').click(); - document.querySelector('.' + _this4.modalClassName).click(); + shakeEditor: false, + isInsertModalOpen: false }); - // reset form - this.refs.form.reset(); } } + }, { + key: '__handleModalClose__REACT_HOT_LOADER__', + value: function __handleModalClose__REACT_HOT_LOADER__() { + this.setState({ isInsertModalOpen: false }); + } + }, { + key: '__handleModalOpen__REACT_HOT_LOADER__', + value: function __handleModalOpen__REACT_HOT_LOADER__() { + this.setState({ isInsertModalOpen: true }); + } }, { key: '__handleShowOnlyToggle__REACT_HOT_LOADER__', value: function __handleShowOnlyToggle__REACT_HOT_LOADER__() { @@ -10546,292 +11141,2890 @@ return /******/ (function(modules) { // webpackBootstrap }, { key: '__handleClearBtnClick__REACT_HOT_LOADER__', value: function __handleClearBtnClick__REACT_HOT_LOADER__() { - this.refs.seachInput.value = ''; + var seachInput = this.refs.seachInput; + + seachInput && seachInput.setValue(''); this.props.onSearch(''); } }, { key: 'render', value: function render() { this.modalClassName = 'bs-table-modal-sm' + ToolBar.modalSeq++; + var toolbar = null; + var btnGroup = null; var insertBtn = null; var deleteBtn = null; - var exportCSV = null; + var exportCSVBtn = null; var showSelectedOnlyBtn = null; - if (this.props.enableInsert) { - insertBtn = _react2.default.createElement( - 'button', - { type: 'button', - className: 'btn btn-info react-bs-table-add-btn', - 'data-toggle': 'modal', - 'data-target': '.' + this.modalClassName }, - _react2.default.createElement('i', { className: 'glyphicon glyphicon-plus' }), - ' ', - this.props.insertText - ); - } + if (this.props.enableInsert) { + if (this.props.insertBtn) { + insertBtn = this.renderCustomBtn(this.props.insertBtn, [this.handleModalOpen], _InsertButton2.default.name, 'onClick', this.handleModalOpen); + } else { + insertBtn = _react2.default.createElement(_InsertButton2.default, { btnText: this.props.insertText, + onClick: this.handleModalOpen }); + } + } + + if (this.props.enableDelete) { + if (this.props.deleteBtn) { + deleteBtn = this.renderCustomBtn(this.props.deleteBtn, [this.handleDropRowBtnClick], _DeleteButton2.default.name, 'onClick', this.handleDropRowBtnClick); + } else { + deleteBtn = _react2.default.createElement(_DeleteButton2.default, { btnText: this.props.deleteText, + onClick: this.handleDropRowBtnClick }); + } + } + + if (this.props.enableShowOnlySelected) { + if (this.props.showSelectedOnlyBtn) { + showSelectedOnlyBtn = this.renderCustomBtn(this.props.showSelectedOnlyBtn, [this.handleShowOnlyToggle, this.state.showSelected], _ShowSelectedOnlyButton2.default.name, 'onClick', this.handleShowOnlyToggle); + } else { + showSelectedOnlyBtn = _react2.default.createElement(_ShowSelectedOnlyButton2.default, { toggle: this.state.showSelected, + onClick: this.handleShowOnlyToggle }); + } + } + + if (this.props.enableExportCSV) { + if (this.props.exportCSVBtn) { + exportCSVBtn = this.renderCustomBtn(this.props.exportCSVBtn, [this.handleExportCSV], _ExportCSVButton2.default.name, 'onClick', this.handleExportCSV); + } else { + exportCSVBtn = _react2.default.createElement(_ExportCSVButton2.default, { btnText: this.props.exportCSVText, + onClick: this.handleExportCSV }); + } + } + + if (this.props.btnGroup) { + btnGroup = this.props.btnGroup({ + exportCSVBtn: exportCSVBtn, + insertBtn: insertBtn, + deleteBtn: deleteBtn, + showSelectedOnlyBtn: showSelectedOnlyBtn + }); + } else { + btnGroup = _react2.default.createElement( + 'div', + { className: 'btn-group btn-group-sm', role: 'group' }, + exportCSVBtn, + insertBtn, + deleteBtn, + showSelectedOnlyBtn + ); + } + + var _renderSearchPanel = this.renderSearchPanel(), + _renderSearchPanel2 = _slicedToArray(_renderSearchPanel, 3), + searchPanel = _renderSearchPanel2[0], + searchField = _renderSearchPanel2[1], + clearBtn = _renderSearchPanel2[2]; + + var modal = this.props.enableInsert ? this.renderInsertRowModal() : null; + + if (this.props.toolBar) { + toolbar = this.props.toolBar({ + components: { + exportCSVBtn: exportCSVBtn, + insertBtn: insertBtn, + deleteBtn: deleteBtn, + showSelectedOnlyBtn: showSelectedOnlyBtn, + searchPanel: searchPanel, + btnGroup: btnGroup, + searchField: searchField, + clearBtn: clearBtn + }, + event: { + openInsertModal: this.handleModalOpen, + closeInsertModal: this.handleModalClose, + dropRow: this.handleDropRowBtnClick, + showOnlyToogle: this.handleShowOnlyToggle, + exportCSV: this.handleExportCSV, + search: this.props.onSearch + } + }); + } else { + toolbar = _react2.default.createElement( + 'div', + null, + _react2.default.createElement( + 'div', + { className: 'col-xs-6 col-sm-6 col-md-6 col-lg-8' }, + this.props.searchPosition === 'left' ? searchPanel : btnGroup + ), + _react2.default.createElement( + 'div', + { className: 'col-xs-6 col-sm-6 col-md-6 col-lg-4' }, + this.props.searchPosition === 'left' ? btnGroup : searchPanel + ) + ); + } + + return _react2.default.createElement( + 'div', + { className: 'row' }, + toolbar, + _react2.default.createElement(_Notification2.default, { ref: 'notifier' }), + modal + ); + } + }, { + key: 'renderSearchPanel', + value: function renderSearchPanel() { + if (this.props.enableSearch) { + var classNames = 'form-group form-group-sm react-bs-table-search-form'; + var clearBtn = null; + var searchField = null; + var searchPanel = null; + if (this.props.clearSearch) { + if (this.props.clearSearchBtn) { + clearBtn = this.renderCustomBtn(this.props.clearSearchBtn, [this.handleClearBtnClick], _ClearSearchButton2.default.name, 'onClick', this.handleClearBtnClick); /* eslint max-len: 0*/ + } else { + clearBtn = _react2.default.createElement(_ClearSearchButton2.default, { onClick: this.handleClearBtnClick }); + } + classNames += ' input-group input-group-sm'; + } + + if (this.props.searchField) { + searchField = this.props.searchField({ + search: this.handleKeyUp, + defaultValue: this.props.defaultSearch, + placeholder: this.props.searchPlaceholder + }); + if (searchField.type.name === _SearchField2.default.name) { + searchField = _react2.default.cloneElement(searchField, { + ref: 'seachInput', + onKeyUp: this.handleKeyUp + }); + } else { + searchField = _react2.default.cloneElement(searchField, { + ref: 'seachInput' + }); + } + } else { + searchField = _react2.default.createElement(_SearchField2.default, { ref: 'seachInput', + defaultValue: this.props.defaultSearch, + placeholder: this.props.searchPlaceholder, + onKeyUp: this.handleKeyUp }); + } + if (this.props.searchPanel) { + searchPanel = this.props.searchPanel({ + searchField: searchField, clearBtn: clearBtn, + search: this.props.onSearch, + defaultValue: this.props.defaultSearch, + placeholder: this.props.searchPlaceholder, + clearBtnClick: this.handleClearBtnClick + }); + } else { + searchPanel = _react2.default.createElement( + 'div', + { className: classNames }, + searchField, + _react2.default.createElement( + 'span', + { className: 'input-group-btn' }, + clearBtn + ) + ); + } + return [searchPanel, searchField, clearBtn]; + } else { + return []; + } + } + }, { + key: 'renderInsertRowModal', + value: function renderInsertRowModal() { + var validateState = this.state.validateState || {}; + var _props = this.props, + columns = _props.columns, + ignoreEditable = _props.ignoreEditable, + insertModalHeader = _props.insertModalHeader, + insertModalBody = _props.insertModalBody, + insertModalFooter = _props.insertModalFooter, + insertModal = _props.insertModal; + + + var modal = void 0; + modal = insertModal && insertModal(this.handleModalClose, this.handleSaveBtnClick, columns, validateState, ignoreEditable); + + if (!modal) { + modal = _react2.default.createElement(_InsertModal2.default, { + columns: columns, + validateState: validateState, + ignoreEditable: ignoreEditable, + onModalClose: this.handleModalClose, + onSave: this.handleSaveBtnClick, + headerComponent: insertModalHeader, + bodyComponent: insertModalBody, + footerComponent: insertModalFooter }); + } + + return _react2.default.createElement( + _reactModal2.default, + { className: 'react-bs-insert-modal modal-dialog', + isOpen: this.state.isInsertModalOpen, + onRequestClose: this.handleModalClose, + contentLabel: 'Modal' }, + modal + ); + } + }, { + key: 'renderCustomBtn', + value: function renderCustomBtn(cb, params, componentName, eventName, event) { + var element = cb.apply(null, params); + if (element.type.name === componentName && !element.props[eventName]) { + var props = {}; + props[eventName] = event; + element = _react2.default.cloneElement(element, props); + } + return element; + } + }]); + + return ToolBar; + }(_react.Component); + + ToolBar.modalSeq = 0; + + + ToolBar.propTypes = { + onAddRow: _react.PropTypes.func, + onDropRow: _react.PropTypes.func, + onShowOnlySelected: _react.PropTypes.func, + enableInsert: _react.PropTypes.bool, + enableDelete: _react.PropTypes.bool, + enableSearch: _react.PropTypes.bool, + enableShowOnlySelected: _react.PropTypes.bool, + columns: _react.PropTypes.array, + searchPlaceholder: _react.PropTypes.string, + exportCSVText: _react.PropTypes.string, + insertText: _react.PropTypes.string, + deleteText: _react.PropTypes.string, + saveText: _react.PropTypes.string, + closeText: _react.PropTypes.string, + clearSearch: _react.PropTypes.bool, + ignoreEditable: _react.PropTypes.bool, + defaultSearch: _react.PropTypes.string, + insertModalHeader: _react.PropTypes.func, + insertModalBody: _react.PropTypes.func, + insertModalFooter: _react.PropTypes.func, + insertModal: _react.PropTypes.func, + insertBtn: _react.PropTypes.func, + deleteBtn: _react.PropTypes.func, + showSelectedOnlyBtn: _react.PropTypes.func, + exportCSVBtn: _react.PropTypes.func, + clearSearchBtn: _react.PropTypes.func, + searchField: _react.PropTypes.func, + searchPanel: _react.PropTypes.func, + btnGroup: _react.PropTypes.func, + toolBar: _react.PropTypes.func, + searchPosition: _react.PropTypes.string, + reset: _react.PropTypes.bool + }; + + ToolBar.defaultProps = { + reset: false, + enableInsert: false, + enableDelete: false, + enableSearch: false, + enableShowOnlySelected: false, + clearSearch: false, + ignoreEditable: false, + exportCSVText: _Const2.default.EXPORT_CSV_TEXT, + insertText: _Const2.default.INSERT_BTN_TEXT, + deleteText: _Const2.default.DELETE_BTN_TEXT, + saveText: _Const2.default.SAVE_BTN_TEXT, + closeText: _Const2.default.CLOSE_BTN_TEXT + }; + + var _default = ToolBar; + exports.default = _default; + ; + + var _temp = function () { + if (typeof __REACT_HOT_LOADER__ === 'undefined') { + return; + } + + __REACT_HOT_LOADER__.register(ToolBar, 'ToolBar', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/toolbar/ToolBar.js'); + + __REACT_HOT_LOADER__.register(_default, 'default', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/toolbar/ToolBar.js'); + }(); + + ; + +/***/ }, +/* 184 */ +/***/ function(module, exports, __webpack_require__) { + + module.exports = __webpack_require__(185); + + + +/***/ }, +/* 185 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {var React = __webpack_require__(2); + var ReactDOM = __webpack_require__(6); + var ExecutionEnvironment = __webpack_require__(186); + var ModalPortal = React.createFactory(__webpack_require__(187)); + var ariaAppHider = __webpack_require__(192); + var elementClass = __webpack_require__(193); + var renderSubtreeIntoContainer = __webpack_require__(6).unstable_renderSubtreeIntoContainer; + var Assign = __webpack_require__(191); + + var SafeHTMLElement = ExecutionEnvironment.canUseDOM ? window.HTMLElement : {}; + var AppElement = ExecutionEnvironment.canUseDOM ? document.body : {appendChild: function() {}}; + + function getParentElement(parentSelector) { + return parentSelector(); + } + + var Modal = React.createClass({ + + displayName: 'Modal', + statics: { + setAppElement: function(element) { + AppElement = ariaAppHider.setElement(element); + }, + injectCSS: function() { + "production" !== process.env.NODE_ENV + && console.warn('React-Modal: injectCSS has been deprecated ' + + 'and no longer has any effect. It will be removed in a later version'); + } + }, + + propTypes: { + isOpen: React.PropTypes.bool.isRequired, + style: React.PropTypes.shape({ + content: React.PropTypes.object, + overlay: React.PropTypes.object + }), + portalClassName: React.PropTypes.string, + appElement: React.PropTypes.instanceOf(SafeHTMLElement), + onAfterOpen: React.PropTypes.func, + onRequestClose: React.PropTypes.func, + closeTimeoutMS: React.PropTypes.number, + ariaHideApp: React.PropTypes.bool, + shouldCloseOnOverlayClick: React.PropTypes.bool, + parentSelector: React.PropTypes.func, + role: React.PropTypes.string, + contentLabel: React.PropTypes.string.isRequired + }, + + getDefaultProps: function () { + return { + isOpen: false, + portalClassName: 'ReactModalPortal', + ariaHideApp: true, + closeTimeoutMS: 0, + shouldCloseOnOverlayClick: true, + parentSelector: function () { return document.body; } + }; + }, + + componentDidMount: function() { + this.node = document.createElement('div'); + this.node.className = this.props.portalClassName; + + var parent = getParentElement(this.props.parentSelector); + parent.appendChild(this.node); + this.renderPortal(this.props); + }, + + componentWillReceiveProps: function(newProps) { + var currentParent = getParentElement(this.props.parentSelector); + var newParent = getParentElement(newProps.parentSelector); + + if(newParent !== currentParent) { + currentParent.removeChild(this.node); + newParent.appendChild(this.node); + } + + this.renderPortal(newProps); + }, + + componentWillUnmount: function() { + if (this.props.ariaHideApp) { + ariaAppHider.show(this.props.appElement); + } + + ReactDOM.unmountComponentAtNode(this.node); + var parent = getParentElement(this.props.parentSelector); + parent.removeChild(this.node); + elementClass(document.body).remove('ReactModal__Body--open'); + }, + + renderPortal: function(props) { + if (props.isOpen) { + elementClass(document.body).add('ReactModal__Body--open'); + } else { + elementClass(document.body).remove('ReactModal__Body--open'); + } + + if (props.ariaHideApp) { + ariaAppHider.toggle(props.isOpen, props.appElement); + } + + this.portal = renderSubtreeIntoContainer(this, ModalPortal(Assign({}, props, {defaultStyles: Modal.defaultStyles})), this.node); + }, + + render: function () { + return React.DOM.noscript(); + } + }); + + Modal.defaultStyles = { + overlay: { + position : 'fixed', + top : 0, + left : 0, + right : 0, + bottom : 0, + backgroundColor : 'rgba(255, 255, 255, 0.75)' + }, + content: { + position : 'absolute', + top : '40px', + left : '40px', + right : '40px', + bottom : '40px', + border : '1px solid #ccc', + background : '#fff', + overflow : 'auto', + WebkitOverflowScrolling : 'touch', + borderRadius : '4px', + outline : 'none', + padding : '20px' + } + } + + module.exports = Modal + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(167))) + +/***/ }, +/* 186 */ +/***/ function(module, exports, __webpack_require__) { + + var __WEBPACK_AMD_DEFINE_RESULT__;/*! + Copyright (c) 2015 Jed Watson. + Based on code that is Copyright 2013-2015, Facebook, Inc. + All rights reserved. + */ + + (function () { + 'use strict'; + + var canUseDOM = !!( + typeof window !== 'undefined' && + window.document && + window.document.createElement + ); + + var ExecutionEnvironment = { + + canUseDOM: canUseDOM, + + canUseWorkers: typeof Worker !== 'undefined', + + canUseEventListeners: + canUseDOM && !!(window.addEventListener || window.attachEvent), + + canUseViewport: canUseDOM && !!window.screen + + }; + + if (true) { + !(__WEBPACK_AMD_DEFINE_RESULT__ = function () { + return ExecutionEnvironment; + }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else if (typeof module !== 'undefined' && module.exports) { + module.exports = ExecutionEnvironment; + } else { + window.ExecutionEnvironment = ExecutionEnvironment; + } + + }()); + + +/***/ }, +/* 187 */ +/***/ function(module, exports, __webpack_require__) { + + var React = __webpack_require__(2); + var div = React.DOM.div; + var focusManager = __webpack_require__(188); + var scopeTab = __webpack_require__(190); + var Assign = __webpack_require__(191); + + // so that our CSS is statically analyzable + var CLASS_NAMES = { + overlay: { + base: 'ReactModal__Overlay', + afterOpen: 'ReactModal__Overlay--after-open', + beforeClose: 'ReactModal__Overlay--before-close' + }, + content: { + base: 'ReactModal__Content', + afterOpen: 'ReactModal__Content--after-open', + beforeClose: 'ReactModal__Content--before-close' + } + }; + + var ModalPortal = module.exports = React.createClass({ + + displayName: 'ModalPortal', + shouldClose: null, + + getDefaultProps: function() { + return { + style: { + overlay: {}, + content: {} + } + }; + }, + + getInitialState: function() { + return { + afterOpen: false, + beforeClose: false + }; + }, + + componentDidMount: function() { + // Focus needs to be set when mounting and already open + if (this.props.isOpen) { + this.setFocusAfterRender(true); + this.open(); + } + }, + + componentWillUnmount: function() { + clearTimeout(this.closeTimer); + }, + + componentWillReceiveProps: function(newProps) { + // Focus only needs to be set once when the modal is being opened + if (!this.props.isOpen && newProps.isOpen) { + this.setFocusAfterRender(true); + this.open(); + } else if (this.props.isOpen && !newProps.isOpen) { + this.close(); + } + }, + + componentDidUpdate: function () { + if (this.focusAfterRender) { + this.focusContent(); + this.setFocusAfterRender(false); + } + }, + + setFocusAfterRender: function (focus) { + this.focusAfterRender = focus; + }, + + open: function() { + if (this.state.afterOpen && this.state.beforeClose) { + clearTimeout(this.closeTimer); + this.setState({ beforeClose: false }); + } else { + focusManager.setupScopedFocus(this.node); + focusManager.markForFocusLater(); + this.setState({isOpen: true}, function() { + this.setState({afterOpen: true}); + + if (this.props.isOpen && this.props.onAfterOpen) { + this.props.onAfterOpen(); + } + }.bind(this)); + } + }, + + close: function() { + if (!this.ownerHandlesClose()) + return; + if (this.props.closeTimeoutMS > 0) + this.closeWithTimeout(); + else + this.closeWithoutTimeout(); + }, + + focusContent: function() { + // Don't steal focus from inner elements + if (!this.contentHasFocus()) { + this.refs.content.focus(); + } + }, + + closeWithTimeout: function() { + this.setState({beforeClose: true}, function() { + this.closeTimer = setTimeout(this.closeWithoutTimeout, this.props.closeTimeoutMS); + }.bind(this)); + }, + + closeWithoutTimeout: function() { + this.setState({ + beforeClose: false, + isOpen: false, + afterOpen: false, + }, this.afterClose); + }, + + afterClose: function() { + focusManager.returnFocus(); + focusManager.teardownScopedFocus(); + }, + + handleKeyDown: function(event) { + if (event.keyCode == 9 /*tab*/) scopeTab(this.refs.content, event); + if (event.keyCode == 27 /*esc*/) { + event.preventDefault(); + this.requestClose(event); + } + }, + + handleOverlayMouseDown: function(event) { + if (this.shouldClose === null) { + this.shouldClose = true; + } + }, + + handleOverlayMouseUp: function(event) { + if (this.shouldClose && this.props.shouldCloseOnOverlayClick) { + if (this.ownerHandlesClose()) + this.requestClose(event); + else + this.focusContent(); + } + this.shouldClose = null; + }, + + handleContentMouseDown: function(event) { + this.shouldClose = false; + }, + + handleContentMouseUp: function(event) { + this.shouldClose = false; + }, + + requestClose: function(event) { + if (this.ownerHandlesClose()) + this.props.onRequestClose(event); + }, + + ownerHandlesClose: function() { + return this.props.onRequestClose; + }, + + shouldBeClosed: function() { + return !this.props.isOpen && !this.state.beforeClose; + }, + + contentHasFocus: function() { + return document.activeElement === this.refs.content || this.refs.content.contains(document.activeElement); + }, + + buildClassName: function(which, additional) { + var className = CLASS_NAMES[which].base; + if (this.state.afterOpen) + className += ' '+CLASS_NAMES[which].afterOpen; + if (this.state.beforeClose) + className += ' '+CLASS_NAMES[which].beforeClose; + return additional ? className + ' ' + additional : className; + }, + + render: function() { + var contentStyles = (this.props.className) ? {} : this.props.defaultStyles.content; + var overlayStyles = (this.props.overlayClassName) ? {} : this.props.defaultStyles.overlay; + + return this.shouldBeClosed() ? div() : ( + div({ + ref: "overlay", + className: this.buildClassName('overlay', this.props.overlayClassName), + style: Assign({}, overlayStyles, this.props.style.overlay || {}), + onMouseDown: this.handleOverlayMouseDown, + onMouseUp: this.handleOverlayMouseUp + }, + div({ + ref: "content", + style: Assign({}, contentStyles, this.props.style.content || {}), + className: this.buildClassName('content', this.props.className), + tabIndex: "-1", + onKeyDown: this.handleKeyDown, + onMouseDown: this.handleContentMouseDown, + onMouseUp: this.handleContentMouseUp, + role: this.props.role, + "aria-label": this.props.contentLabel + }, + this.props.children + ) + ) + ); + } + }); + + +/***/ }, +/* 188 */ +/***/ function(module, exports, __webpack_require__) { + + var findTabbable = __webpack_require__(189); + var modalElement = null; + var focusLaterElement = null; + var needToFocus = false; + + function handleBlur(event) { + needToFocus = true; + } + + function handleFocus(event) { + if (needToFocus) { + needToFocus = false; + if (!modalElement) { + return; + } + // need to see how jQuery shims document.on('focusin') so we don't need the + // setTimeout, firefox doesn't support focusin, if it did, we could focus + // the element outside of a setTimeout. Side-effect of this implementation + // is that the document.body gets focus, and then we focus our element right + // after, seems fine. + setTimeout(function() { + if (modalElement.contains(document.activeElement)) + return; + var el = (findTabbable(modalElement)[0] || modalElement); + el.focus(); + }, 0); + } + } + + exports.markForFocusLater = function() { + focusLaterElement = document.activeElement; + }; + + exports.returnFocus = function() { + try { + focusLaterElement.focus(); + } + catch (e) { + console.warn('You tried to return focus to '+focusLaterElement+' but it is not in the DOM anymore'); + } + focusLaterElement = null; + }; + + exports.setupScopedFocus = function(element) { + modalElement = element; + + if (window.addEventListener) { + window.addEventListener('blur', handleBlur, false); + document.addEventListener('focus', handleFocus, true); + } else { + window.attachEvent('onBlur', handleBlur); + document.attachEvent('onFocus', handleFocus); + } + }; + + exports.teardownScopedFocus = function() { + modalElement = null; + + if (window.addEventListener) { + window.removeEventListener('blur', handleBlur); + document.removeEventListener('focus', handleFocus); + } else { + window.detachEvent('onBlur', handleBlur); + document.detachEvent('onFocus', handleFocus); + } + }; + + + + +/***/ }, +/* 189 */ +/***/ function(module, exports) { + + /*! + * Adapted from jQuery UI core + * + * http://jqueryui.com + * + * Copyright 2014 jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + * + * http://api.jqueryui.com/category/ui-core/ + */ + + function focusable(element, isTabIndexNotNaN) { + var nodeName = element.nodeName.toLowerCase(); + return (/input|select|textarea|button|object/.test(nodeName) ? + !element.disabled : + "a" === nodeName ? + element.href || isTabIndexNotNaN : + isTabIndexNotNaN) && visible(element); + } + + function hidden(el) { + return (el.offsetWidth <= 0 && el.offsetHeight <= 0) || + el.style.display === 'none'; + } + + function visible(element) { + while (element) { + if (element === document.body) break; + if (hidden(element)) return false; + element = element.parentNode; + } + return true; + } + + function tabbable(element) { + var tabIndex = element.getAttribute('tabindex'); + if (tabIndex === null) tabIndex = undefined; + var isTabIndexNaN = isNaN(tabIndex); + return (isTabIndexNaN || tabIndex >= 0) && focusable(element, !isTabIndexNaN); + } + + function findTabbableDescendants(element) { + return [].slice.call(element.querySelectorAll('*'), 0).filter(function(el) { + return tabbable(el); + }); + } + + module.exports = findTabbableDescendants; + + + +/***/ }, +/* 190 */ +/***/ function(module, exports, __webpack_require__) { + + var findTabbable = __webpack_require__(189); + + module.exports = function(node, event) { + var tabbable = findTabbable(node); + if (!tabbable.length) { + event.preventDefault(); + return; + } + var finalTabbable = tabbable[event.shiftKey ? 0 : tabbable.length - 1]; + var leavingFinalTabbable = ( + finalTabbable === document.activeElement || + // handle immediate shift+tab after opening with mouse + node === document.activeElement + ); + if (!leavingFinalTabbable) return; + event.preventDefault(); + var target = tabbable[event.shiftKey ? tabbable.length - 1 : 0]; + target.focus(); + }; + + +/***/ }, +/* 191 */ +/***/ function(module, exports) { + + /** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + + /** Used as references for various `Number` constants. */ + var MAX_SAFE_INTEGER = 9007199254740991; + + /** `Object#toString` result references. */ + var argsTag = '[object Arguments]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]'; + + /** Used to detect unsigned integer values. */ + var reIsUint = /^(?:0|[1-9]\d*)$/; + + /** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ + function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); + } + + /** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ + function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; + } + + /** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ + function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; + } + + /** Used for built-in method references. */ + var objectProto = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ + var objectToString = objectProto.toString; + + /** Built-in value references. */ + var propertyIsEnumerable = objectProto.propertyIsEnumerable; + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeKeys = overArg(Object.keys, Object), + nativeMax = Math.max; + + /** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */ + var nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf'); + + /** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ + function arrayLikeKeys(value, inherited) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + // Safari 9 makes `arguments.length` enumerable in strict mode. + var result = (isArray(value) || isArguments(value)) + ? baseTimes(value.length, String) + : []; + + var length = result.length, + skipIndexes = !!length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && (key == 'length' || isIndex(key, length)))) { + result.push(key); + } + } + return result; + } + + /** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + object[key] = value; + } + } + + /** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; + } + + /** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ + function baseRest(func, start) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = array; + return apply(func, this, otherArgs); + }; + } + + /** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ + function copyObject(source, props, object, customizer) { + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; + + assignValue(object, key, newValue === undefined ? source[key] : newValue); + } + return object; + } + + /** + * Creates a function like `_.assign`. + * + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. + */ + function createAssigner(assigner) { + return baseRest(function(object, sources) { + var index = -1, + length = sources.length, + customizer = length > 1 ? sources[length - 1] : undefined, + guard = length > 2 ? sources[2] : undefined; + + customizer = (assigner.length > 3 && typeof customizer == 'function') + ? (length--, customizer) + : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? undefined : customizer; + length = 1; + } + object = Object(object); + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, index, customizer); + } + } + return object; + }); + } + + /** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ + function isIndex(value, length) { + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && + (typeof value == 'number' || reIsUint.test(value)) && + (value > -1 && value % 1 == 0 && value < length); + } + + /** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ + function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; + } + + /** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ + function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; + } + + /** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ + function eq(value, other) { + return value === other || (value !== value && other !== other); + } + + /** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ + function isArguments(value) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && + (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); + } + + /** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ + var isArray = Array.isArray; + + /** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ + function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); + } + + /** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ + function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); + } + + /** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ + function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8-9 which returns 'object' for typed array and other constructors. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; + } + + /** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ + function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + + /** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ + function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); + } + + /** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ + function isObjectLike(value) { + return !!value && typeof value == 'object'; + } + + /** + * Assigns own enumerable string keyed properties of source objects to the + * destination object. Source objects are applied from left to right. + * Subsequent sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object` and is loosely based on + * [`Object.assign`](https://mdn.io/Object/assign). + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assignIn + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assign({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'c': 3 } + */ + var assign = createAssigner(function(object, source) { + if (nonEnumShadows || isPrototype(source) || isArrayLike(source)) { + copyObject(source, keys(source), object); + return; + } + for (var key in source) { + if (hasOwnProperty.call(source, key)) { + assignValue(object, key, source[key]); + } + } + }); + + /** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ + function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); + } + + module.exports = assign; + + +/***/ }, +/* 192 */ +/***/ function(module, exports) { + + var _element = typeof document !== 'undefined' ? document.body : null; + + function setElement(element) { + if (typeof element === 'string') { + var el = document.querySelectorAll(element); + element = 'length' in el ? el[0] : el; + } + _element = element || _element; + return _element; + } + + function hide(appElement) { + validateElement(appElement); + (appElement || _element).setAttribute('aria-hidden', 'true'); + } + + function show(appElement) { + validateElement(appElement); + (appElement || _element).removeAttribute('aria-hidden'); + } + + function toggle(shouldHide, appElement) { + if (shouldHide) + hide(appElement); + else + show(appElement); + } + + function validateElement(appElement) { + if (!appElement && !_element) + throw new Error('react-modal: You must set an element with `Modal.setAppElement(el)` to make this accessible'); + } + + function resetForTesting() { + _element = document.body; + } + + exports.toggle = toggle; + exports.setElement = setElement; + exports.show = show; + exports.hide = hide; + exports.resetForTesting = resetForTesting; + + +/***/ }, +/* 193 */ +/***/ function(module, exports) { + + module.exports = function(opts) { + return new ElementClass(opts) + } + + function indexOf(arr, prop) { + if (arr.indexOf) return arr.indexOf(prop) + for (var i = 0, len = arr.length; i < len; i++) + if (arr[i] === prop) return i + return -1 + } + + function ElementClass(opts) { + if (!(this instanceof ElementClass)) return new ElementClass(opts) + var self = this + if (!opts) opts = {} + + // similar doing instanceof HTMLElement but works in IE8 + if (opts.nodeType) opts = {el: opts} + + this.opts = opts + this.el = opts.el || document.body + if (typeof this.el !== 'object') this.el = document.querySelector(this.el) + } + + ElementClass.prototype.add = function(className) { + var el = this.el + if (!el) return + if (el.className === "") return el.className = className + var classes = el.className.split(' ') + if (indexOf(classes, className) > -1) return classes + classes.push(className) + el.className = classes.join(' ') + return classes + } + + ElementClass.prototype.remove = function(className) { + var el = this.el + if (!el) return + if (el.className === "") return + var classes = el.className.split(' ') + var idx = indexOf(classes, className) + if (idx > -1) classes.splice(idx, 1) + el.className = classes.join(' ') + return classes + } + + ElementClass.prototype.has = function(className) { + var el = this.el + if (!el) return + var classes = el.className.split(' ') + return indexOf(classes, className) > -1 + } + + ElementClass.prototype.toggle = function(className) { + var el = this.el + if (!el) return + if (this.has(className)) this.remove(className) + else this.add(className) + } + + +/***/ }, +/* 194 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _react = __webpack_require__(2); + + var _react2 = _interopRequireDefault(_react); + + var _InsertModalHeader = __webpack_require__(195); + + var _InsertModalHeader2 = _interopRequireDefault(_InsertModalHeader); + + var _InsertModalFooter = __webpack_require__(196); + + var _InsertModalFooter2 = _interopRequireDefault(_InsertModalFooter); + + var _InsertModalBody = __webpack_require__(197); + + var _InsertModalBody2 = _interopRequireDefault(_InsertModalBody); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /* eslint no-console: 0 */ + + var defaultModalClassName = 'react-bs-table-insert-modal'; + + var InsertModal = function (_Component) { + _inherits(InsertModal, _Component); + + function InsertModal() { + var _ref; + + var _temp, _this, _ret; + + _classCallCheck(this, InsertModal); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = InsertModal.__proto__ || Object.getPrototypeOf(InsertModal)).call.apply(_ref, [this].concat(args))), _this), _this.handleSave = function () { + var _this2; + + return (_this2 = _this).__handleSave__REACT_HOT_LOADER__.apply(_this2, arguments); + }, _temp), _possibleConstructorReturn(_this, _ret); + } + + _createClass(InsertModal, [{ + key: '__handleSave__REACT_HOT_LOADER__', + value: function __handleSave__REACT_HOT_LOADER__() { + var bodyRefs = this.refs.body; + if (bodyRefs.getFieldValue) { + this.props.onSave(bodyRefs.getFieldValue()); + } else { + console.error('Custom InsertModalBody should implement getFieldValue function\n and should return an object presented as the new row that user input.'); + } + } + }, { + key: 'render', + value: function render() { + var _props = this.props, + headerComponent = _props.headerComponent, + footerComponent = _props.footerComponent, + bodyComponent = _props.bodyComponent; + var _props2 = this.props, + columns = _props2.columns, + validateState = _props2.validateState, + ignoreEditable = _props2.ignoreEditable, + onModalClose = _props2.onModalClose; + + var bodyAttr = { columns: columns, validateState: validateState, ignoreEditable: ignoreEditable }; + + bodyComponent = bodyComponent && bodyComponent(columns, validateState, ignoreEditable); + + headerComponent = headerComponent && headerComponent(onModalClose, this.handleSave); + + footerComponent = footerComponent && footerComponent(onModalClose, this.handleSave); + + if (bodyComponent) { + bodyComponent = _react2.default.cloneElement(bodyComponent, { ref: 'body' }); + } + + if (headerComponent && headerComponent.type.name === _InsertModalHeader2.default.name) { + var eventProps = {}; + if (!headerComponent.props.onModalClose) eventProps.onModalClose = onModalClose; + if (!headerComponent.props.onSave) eventProps.onSave = this.handleSave; + if (Object.keys(eventProps).length > 0) { + headerComponent = _react2.default.cloneElement(headerComponent, eventProps); + } + } else if (headerComponent && headerComponent.type.name !== _InsertModalHeader2.default.name) { + var className = headerComponent.props.className; + + if (typeof className === 'undefined' || className.indexOf('modal-header') === -1) { + headerComponent = _react2.default.createElement( + 'div', + { className: 'modal-header' }, + headerComponent + ); + } + } + + if (footerComponent && footerComponent.type.name === _InsertModalFooter2.default.name) { + var _eventProps = {}; + if (!footerComponent.props.onModalClose) _eventProps.onModalClose = onModalClose; + if (!footerComponent.props.onSave) _eventProps.onSave = this.handleSave; + if (Object.keys(_eventProps).length > 0) { + footerComponent = _react2.default.cloneElement(footerComponent, _eventProps); + } + } else if (footerComponent && footerComponent.type.name !== _InsertModalFooter2.default.name) { + var _className = footerComponent.props.className; + + if (typeof _className === 'undefined' || _className.indexOf('modal-footer') === -1) { + footerComponent = _react2.default.createElement( + 'div', + { className: 'modal-footer' }, + footerComponent + ); + } + } + + return _react2.default.createElement( + 'div', + { className: 'modal-content ' + defaultModalClassName }, + headerComponent || _react2.default.createElement(_InsertModalHeader2.default, { + className: 'react-bs-table-inser-modal-header', + onModalClose: onModalClose }), + bodyComponent || _react2.default.createElement(_InsertModalBody2.default, _extends({ ref: 'body' }, bodyAttr)), + footerComponent || _react2.default.createElement(_InsertModalFooter2.default, { + className: 'react-bs-table-inser-modal-footer', + onModalClose: onModalClose, + onSave: this.handleSave }) + ); + } + }]); + + return InsertModal; + }(_react.Component); + + var _default = InsertModal; + exports.default = _default; + + InsertModal.propTypes = { + columns: _react.PropTypes.array.isRequired, + validateState: _react.PropTypes.object.isRequired, + ignoreEditable: _react.PropTypes.bool, + headerComponent: _react.PropTypes.func, + bodyComponent: _react.PropTypes.func, + footerComponent: _react.PropTypes.func, + onModalClose: _react.PropTypes.func, + onSave: _react.PropTypes.func + }; + + InsertModal.defaultProps = {}; + ; + + var _temp2 = function () { + if (typeof __REACT_HOT_LOADER__ === 'undefined') { + return; + } + + __REACT_HOT_LOADER__.register(defaultModalClassName, 'defaultModalClassName', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/toolbar/InsertModal.js'); + + __REACT_HOT_LOADER__.register(InsertModal, 'InsertModal', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/toolbar/InsertModal.js'); + + __REACT_HOT_LOADER__.register(_default, 'default', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/toolbar/InsertModal.js'); + }(); + + ; + +/***/ }, +/* 195 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _react = __webpack_require__(2); + + var _react2 = _interopRequireDefault(_react); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var InsertModalHeader = function (_Component) { + _inherits(InsertModalHeader, _Component); + + function InsertModalHeader() { + var _ref; + + var _temp, _this, _ret; + + _classCallCheck(this, InsertModalHeader); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = InsertModalHeader.__proto__ || Object.getPrototypeOf(InsertModalHeader)).call.apply(_ref, [this].concat(args))), _this), _this.handleCloseBtnClick = function () { + var _this2; + + return (_this2 = _this).__handleCloseBtnClick__REACT_HOT_LOADER__.apply(_this2, arguments); + }, _temp), _possibleConstructorReturn(_this, _ret); + } + + _createClass(InsertModalHeader, [{ + key: '__handleCloseBtnClick__REACT_HOT_LOADER__', + value: function __handleCloseBtnClick__REACT_HOT_LOADER__(e) { + var _props = this.props, + onModalClose = _props.onModalClose, + beforeClose = _props.beforeClose; + + beforeClose && beforeClose(e); + onModalClose(); + } + }, { + key: 'render', + value: function render() { + var _props2 = this.props, + title = _props2.title, + hideClose = _props2.hideClose, + className = _props2.className, + children = _props2.children; + + + var closeBtn = hideClose ? null : _react2.default.createElement( + 'button', + { type: 'button', + className: 'close', onClick: this.handleCloseBtnClick }, + _react2.default.createElement( + 'span', + { 'aria-hidden': 'true' }, + '\xD7' + ), + _react2.default.createElement( + 'span', + { className: 'sr-only' }, + 'Close' + ) + ); + + var content = children || _react2.default.createElement( + 'span', + null, + closeBtn, + _react2.default.createElement( + 'h4', + { className: 'modal-title' }, + title + ) + ); + + return _react2.default.createElement( + 'div', + { className: 'modal-header ' + className }, + content + ); + } + }]); + + return InsertModalHeader; + }(_react.Component); + + InsertModalHeader.propTypes = { + className: _react.PropTypes.string, + title: _react.PropTypes.string, + onModalClose: _react.PropTypes.func, + hideClose: _react.PropTypes.bool, + beforeClose: _react.PropTypes.func + }; + InsertModalHeader.defaultProps = { + className: '', + title: 'Add Row', + onModalClose: undefined, + hideClose: false, + beforeClose: undefined + }; + + var _default = InsertModalHeader; + exports.default = _default; + ; + + var _temp2 = function () { + if (typeof __REACT_HOT_LOADER__ === 'undefined') { + return; + } + + __REACT_HOT_LOADER__.register(InsertModalHeader, 'InsertModalHeader', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/toolbar/InsertModalHeader.js'); + + __REACT_HOT_LOADER__.register(_default, 'default', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/toolbar/InsertModalHeader.js'); + }(); + + ; + +/***/ }, +/* 196 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _react = __webpack_require__(2); + + var _react2 = _interopRequireDefault(_react); + + var _Const = __webpack_require__(4); + + var _Const2 = _interopRequireDefault(_Const); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var InsertModalFooter = function (_Component) { + _inherits(InsertModalFooter, _Component); + + function InsertModalFooter() { + var _ref; + + var _temp, _this, _ret; + + _classCallCheck(this, InsertModalFooter); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = InsertModalFooter.__proto__ || Object.getPrototypeOf(InsertModalFooter)).call.apply(_ref, [this].concat(args))), _this), _this.handleCloseBtnClick = function () { + var _this2; + + return (_this2 = _this).__handleCloseBtnClick__REACT_HOT_LOADER__.apply(_this2, arguments); + }, _this.handleSaveBtnClick = function () { + var _this3; + + return (_this3 = _this).__handleSaveBtnClick__REACT_HOT_LOADER__.apply(_this3, arguments); + }, _temp), _possibleConstructorReturn(_this, _ret); + } + + _createClass(InsertModalFooter, [{ + key: '__handleCloseBtnClick__REACT_HOT_LOADER__', + value: function __handleCloseBtnClick__REACT_HOT_LOADER__(e) { + var _props = this.props, + beforeClose = _props.beforeClose, + onModalClose = _props.onModalClose; + + beforeClose && beforeClose(e); + onModalClose(); + } + }, { + key: '__handleSaveBtnClick__REACT_HOT_LOADER__', + value: function __handleSaveBtnClick__REACT_HOT_LOADER__(e) { + var _props2 = this.props, + beforeSave = _props2.beforeSave, + onSave = _props2.onSave; + + beforeSave && beforeSave(e); + onSave(); + } + }, { + key: 'render', + value: function render() { + var _props3 = this.props, + className = _props3.className, + saveBtnText = _props3.saveBtnText, + closeBtnText = _props3.closeBtnText, + closeBtnContextual = _props3.closeBtnContextual, + saveBtnContextual = _props3.saveBtnContextual, + closeBtnClass = _props3.closeBtnClass, + saveBtnClass = _props3.saveBtnClass, + children = _props3.children; + + + var content = children || _react2.default.createElement( + 'span', + null, + _react2.default.createElement( + 'button', + { + type: 'button', + className: 'btn ' + closeBtnContextual + ' ' + closeBtnClass, + onClick: this.handleCloseBtnClick }, + closeBtnText + ), + _react2.default.createElement( + 'button', + { + type: 'button', + className: 'btn ' + saveBtnContextual + ' ' + saveBtnClass, + onClick: this.handleSaveBtnClick }, + saveBtnText + ) + ); + + return _react2.default.createElement( + 'div', + { className: 'modal-footer ' + className }, + content + ); + } + }]); + + return InsertModalFooter; + }(_react.Component); + + InsertModalFooter.propTypes = { + className: _react.PropTypes.string, + saveBtnText: _react.PropTypes.string, + closeBtnText: _react.PropTypes.string, + closeBtnContextual: _react.PropTypes.string, + saveBtnContextual: _react.PropTypes.string, + closeBtnClass: _react.PropTypes.string, + saveBtnClass: _react.PropTypes.string, + beforeClose: _react.PropTypes.func, + beforeSave: _react.PropTypes.func, + onSave: _react.PropTypes.func, + onModalClose: _react.PropTypes.func + }; + InsertModalFooter.defaultProps = { + className: '', + saveBtnText: _Const2.default.SAVE_BTN_TEXT, + closeBtnText: _Const2.default.CLOSE_BTN_TEXT, + closeBtnContextual: 'btn-default', + saveBtnContextual: 'btn-primary', + closeBtnClass: '', + saveBtnClass: '', + beforeClose: undefined, + beforeSave: undefined + }; + + var _default = InsertModalFooter; + exports.default = _default; + ; + + var _temp2 = function () { + if (typeof __REACT_HOT_LOADER__ === 'undefined') { + return; + } + + __REACT_HOT_LOADER__.register(InsertModalFooter, 'InsertModalFooter', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/toolbar/InsertModalFooter.js'); + + __REACT_HOT_LOADER__.register(_default, 'default', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/toolbar/InsertModalFooter.js'); + }(); + + ; + +/***/ }, +/* 197 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _react = __webpack_require__(2); + + var _react2 = _interopRequireDefault(_react); + + var _Editor = __webpack_require__(13); + + var _Editor2 = _interopRequireDefault(_Editor); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /* eslint react/display-name: 0 */ + + + var InsertModalBody = function (_Component) { + _inherits(InsertModalBody, _Component); + + function InsertModalBody() { + _classCallCheck(this, InsertModalBody); + + return _possibleConstructorReturn(this, (InsertModalBody.__proto__ || Object.getPrototypeOf(InsertModalBody)).apply(this, arguments)); + } + + _createClass(InsertModalBody, [{ + key: 'getFieldValue', + value: function getFieldValue() { + var _this2 = this; + + var newRow = {}; + this.props.columns.forEach(function (column, i) { + var inputVal = void 0; + if (column.autoValue) { + // when you want same auto generate value and not allow edit, example ID field + var time = new Date().getTime(); + inputVal = typeof column.autoValue === 'function' ? column.autoValue() : 'autovalue-' + time; + } else if (column.hiddenOnInsert || !column.field) { + inputVal = ''; + } else { + var dom = _this2.refs[column.field + i]; + inputVal = dom.value; + + if (column.editable && column.editable.type === 'checkbox') { + var values = inputVal.split(':'); + inputVal = dom.checked ? values[0] : values[1]; + } + } + newRow[column.field] = inputVal; + }, this); + return newRow; + } + }, { + key: 'render', + value: function render() { + var _props = this.props, + columns = _props.columns, + validateState = _props.validateState, + ignoreEditable = _props.ignoreEditable; + + return _react2.default.createElement( + 'div', + { className: 'modal-body' }, + columns.map(function (column, i) { + var editable = column.editable, + format = column.format, + field = column.field, + name = column.name, + autoValue = column.autoValue, + hiddenOnInsert = column.hiddenOnInsert; + + var attr = { + ref: field + i, + placeholder: editable.placeholder ? editable.placeholder : name + }; + + if (autoValue || hiddenOnInsert || !column.field) { + // when you want same auto generate value + // and not allow edit, for example ID field + return null; + } + var error = validateState[field] ? _react2.default.createElement( + 'span', + { className: 'help-block bg-danger' }, + validateState[field] + ) : null; + return _react2.default.createElement( + 'div', + { className: 'form-group', key: field }, + _react2.default.createElement( + 'label', + null, + name + ), + (0, _Editor2.default)(editable, attr, format, '', undefined, ignoreEditable), + error + ); + }) + ); + } + }]); + + return InsertModalBody; + }(_react.Component); + + InsertModalBody.propTypes = { + columns: _react.PropTypes.array, + validateState: _react.PropTypes.object, + ignoreEditable: _react.PropTypes.bool + }; + + InsertModalBody.defaultProps = { + validateState: {}, + ignoreEditable: false + }; + + var _default = InsertModalBody; + exports.default = _default; + ; + + var _temp = function () { + if (typeof __REACT_HOT_LOADER__ === 'undefined') { + return; + } + + __REACT_HOT_LOADER__.register(InsertModalBody, 'InsertModalBody', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/toolbar/InsertModalBody.js'); + + __REACT_HOT_LOADER__.register(_default, 'default', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/toolbar/InsertModalBody.js'); + }(); + + ; + +/***/ }, +/* 198 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _react = __webpack_require__(2); + + var _react2 = _interopRequireDefault(_react); + + var _Const = __webpack_require__(4); + + var _Const2 = _interopRequireDefault(_Const); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var insertBtnDefaultClass = 'react-bs-table-add-btn'; + + var InsertButton = function (_Component) { + _inherits(InsertButton, _Component); + + function InsertButton() { + _classCallCheck(this, InsertButton); + + return _possibleConstructorReturn(this, (InsertButton.__proto__ || Object.getPrototypeOf(InsertButton)).apply(this, arguments)); + } + + _createClass(InsertButton, [{ + key: 'render', + value: function render() { + var _props = this.props, + btnContextual = _props.btnContextual, + className = _props.className, + onClick = _props.onClick, + btnGlyphicon = _props.btnGlyphicon, + btnText = _props.btnText, + children = _props.children, + rest = _objectWithoutProperties(_props, ['btnContextual', 'className', 'onClick', 'btnGlyphicon', 'btnText', 'children']); + + var content = children || _react2.default.createElement( + 'span', + null, + _react2.default.createElement('i', { className: 'glyphicon ' + btnGlyphicon }), + btnText + ); + return _react2.default.createElement( + 'button', + _extends({ type: 'button', + className: 'btn ' + btnContextual + ' ' + insertBtnDefaultClass + ' ' + className, + onClick: onClick + }, rest), + content + ); + } + }]); + + return InsertButton; + }(_react.Component); + + InsertButton.propTypes = { + btnText: _react.PropTypes.string, + btnContextual: _react.PropTypes.string, + className: _react.PropTypes.string, + onClick: _react.PropTypes.func, + btnGlyphicon: _react.PropTypes.string + }; + InsertButton.defaultProps = { + btnText: _Const2.default.INSERT_BTN_TEXT, + btnContextual: 'btn-info', + className: '', + onClick: undefined, + btnGlyphicon: 'glyphicon-plus' + }; + + var _default = InsertButton; + exports.default = _default; + ; + + var _temp = function () { + if (typeof __REACT_HOT_LOADER__ === 'undefined') { + return; + } + + __REACT_HOT_LOADER__.register(insertBtnDefaultClass, 'insertBtnDefaultClass', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/toolbar/InsertButton.js'); + + __REACT_HOT_LOADER__.register(InsertButton, 'InsertButton', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/toolbar/InsertButton.js'); + + __REACT_HOT_LOADER__.register(_default, 'default', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/toolbar/InsertButton.js'); + }(); + + ; + +/***/ }, +/* 199 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _react = __webpack_require__(2); + + var _react2 = _interopRequireDefault(_react); + + var _Const = __webpack_require__(4); + + var _Const2 = _interopRequireDefault(_Const); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var deleteBtnDefaultClass = 'react-bs-table-del-btn'; + + var DeleteButton = function (_Component) { + _inherits(DeleteButton, _Component); + + function DeleteButton() { + _classCallCheck(this, DeleteButton); + + return _possibleConstructorReturn(this, (DeleteButton.__proto__ || Object.getPrototypeOf(DeleteButton)).apply(this, arguments)); + } + + _createClass(DeleteButton, [{ + key: 'render', + value: function render() { + var _props = this.props, + btnContextual = _props.btnContextual, + className = _props.className, + onClick = _props.onClick, + btnGlyphicon = _props.btnGlyphicon, + btnText = _props.btnText, + children = _props.children, + rest = _objectWithoutProperties(_props, ['btnContextual', 'className', 'onClick', 'btnGlyphicon', 'btnText', 'children']); + + var content = children || _react2.default.createElement( + 'span', + null, + _react2.default.createElement('i', { className: 'glyphicon ' + btnGlyphicon }), + ' ', + btnText + ); + return _react2.default.createElement( + 'button', + _extends({ type: 'button', + className: 'btn ' + btnContextual + ' ' + deleteBtnDefaultClass + ' ' + className, + onClick: onClick + }, rest), + content + ); + } + }]); + + return DeleteButton; + }(_react.Component); + + DeleteButton.propTypes = { + btnText: _react.PropTypes.string, + btnContextual: _react.PropTypes.string, + className: _react.PropTypes.string, + onClick: _react.PropTypes.func, + btnGlyphicon: _react.PropTypes.string + }; + DeleteButton.defaultProps = { + btnText: _Const2.default.DELETE_BTN_TEXT, + btnContextual: 'btn-warning', + className: '', + onClick: undefined, + btnGlyphicon: 'glyphicon-trash' + }; + + var _default = DeleteButton; + exports.default = _default; + ; + + var _temp = function () { + if (typeof __REACT_HOT_LOADER__ === 'undefined') { + return; + } + + __REACT_HOT_LOADER__.register(deleteBtnDefaultClass, 'deleteBtnDefaultClass', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/toolbar/DeleteButton.js'); + + __REACT_HOT_LOADER__.register(DeleteButton, 'DeleteButton', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/toolbar/DeleteButton.js'); + + __REACT_HOT_LOADER__.register(_default, 'default', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/toolbar/DeleteButton.js'); + }(); + + ; + +/***/ }, +/* 200 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _react = __webpack_require__(2); + + var _react2 = _interopRequireDefault(_react); + + var _Const = __webpack_require__(4); + + var _Const2 = _interopRequireDefault(_Const); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var exportCsvBtnDefaultClass = 'react-bs-table-csv-btn'; + + var ExportCSVButton = function (_Component) { + _inherits(ExportCSVButton, _Component); + + function ExportCSVButton() { + _classCallCheck(this, ExportCSVButton); + + return _possibleConstructorReturn(this, (ExportCSVButton.__proto__ || Object.getPrototypeOf(ExportCSVButton)).apply(this, arguments)); + } + + _createClass(ExportCSVButton, [{ + key: 'render', + value: function render() { + var _props = this.props, + btnContextual = _props.btnContextual, + className = _props.className, + onClick = _props.onClick, + btnGlyphicon = _props.btnGlyphicon, + btnText = _props.btnText, + children = _props.children, + rest = _objectWithoutProperties(_props, ['btnContextual', 'className', 'onClick', 'btnGlyphicon', 'btnText', 'children']); + + var content = children || _react2.default.createElement( + 'span', + null, + _react2.default.createElement('i', { className: 'glyphicon ' + btnGlyphicon }), + ' ', + btnText + ); + return _react2.default.createElement( + 'button', + _extends({ type: 'button', + className: 'btn ' + btnContextual + ' ' + exportCsvBtnDefaultClass + ' ' + className + ' hidden-print', + onClick: onClick + }, rest), + content + ); + } + }]); + + return ExportCSVButton; + }(_react.Component); + + ExportCSVButton.propTypes = { + btnText: _react.PropTypes.string, + btnContextual: _react.PropTypes.string, + className: _react.PropTypes.string, + onClick: _react.PropTypes.func, + btnGlyphicon: _react.PropTypes.string + }; + ExportCSVButton.defaultProps = { + btnText: _Const2.default.EXPORT_CSV_TEXT, + btnContextual: 'btn-success', + className: '', + onClick: undefined, + btnGlyphicon: 'glyphicon-export' + }; + + var _default = ExportCSVButton; + exports.default = _default; + ; + + var _temp = function () { + if (typeof __REACT_HOT_LOADER__ === 'undefined') { + return; + } + + __REACT_HOT_LOADER__.register(exportCsvBtnDefaultClass, 'exportCsvBtnDefaultClass', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/toolbar/ExportCSVButton.js'); + + __REACT_HOT_LOADER__.register(ExportCSVButton, 'ExportCSVButton', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/toolbar/ExportCSVButton.js'); + + __REACT_HOT_LOADER__.register(_default, 'default', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/toolbar/ExportCSVButton.js'); + }(); + + ; + +/***/ }, +/* 201 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _react = __webpack_require__(2); + + var _react2 = _interopRequireDefault(_react); + + var _Const = __webpack_require__(4); + + var _Const2 = _interopRequireDefault(_Const); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var showSelectedOnlyBtnDefaultClass = 'react-bs-table-show-sel-only-btn'; + + var ShowSelectedOnlyButton = function (_Component) { + _inherits(ShowSelectedOnlyButton, _Component); + + function ShowSelectedOnlyButton() { + _classCallCheck(this, ShowSelectedOnlyButton); + + return _possibleConstructorReturn(this, (ShowSelectedOnlyButton.__proto__ || Object.getPrototypeOf(ShowSelectedOnlyButton)).apply(this, arguments)); + } + + _createClass(ShowSelectedOnlyButton, [{ + key: 'render', + value: function render() { + var _props = this.props, + btnContextual = _props.btnContextual, + className = _props.className, + onClick = _props.onClick, + toggle = _props.toggle, + showAllText = _props.showAllText, + showOnlySelectText = _props.showOnlySelectText, + children = _props.children, + rest = _objectWithoutProperties(_props, ['btnContextual', 'className', 'onClick', 'toggle', 'showAllText', 'showOnlySelectText', 'children']); + + var content = children || _react2.default.createElement( + 'span', + null, + toggle ? showOnlySelectText : showAllText + ); + return _react2.default.createElement( + 'button', + _extends({ type: 'button', + 'aria-pressed': 'false', + 'data-toggle': 'button', + className: 'btn ' + btnContextual + ' ' + showSelectedOnlyBtnDefaultClass + ' ' + className, + onClick: onClick + }, rest), + content + ); + } + }]); + + return ShowSelectedOnlyButton; + }(_react.Component); + + ShowSelectedOnlyButton.propTypes = { + showAllText: _react.PropTypes.string, + showOnlySelectText: _react.PropTypes.string, + toggle: _react.PropTypes.bool, + btnContextual: _react.PropTypes.string, + className: _react.PropTypes.string, + onClick: _react.PropTypes.func + }; + ShowSelectedOnlyButton.defaultProps = { + showAllText: _Const2.default.SHOW_ALL, + showOnlySelectText: _Const2.default.SHOW_ONLY_SELECT, + toggle: false, + btnContextual: 'btn-primary', + className: '', + onClick: undefined + }; + + var _default = ShowSelectedOnlyButton; + exports.default = _default; + ; + + var _temp = function () { + if (typeof __REACT_HOT_LOADER__ === 'undefined') { + return; + } + + __REACT_HOT_LOADER__.register(showSelectedOnlyBtnDefaultClass, 'showSelectedOnlyBtnDefaultClass', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/toolbar/ShowSelectedOnlyButton.js'); + + __REACT_HOT_LOADER__.register(ShowSelectedOnlyButton, 'ShowSelectedOnlyButton', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/toolbar/ShowSelectedOnlyButton.js'); + + __REACT_HOT_LOADER__.register(_default, 'default', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/toolbar/ShowSelectedOnlyButton.js'); + }(); + + ; + +/***/ }, +/* 202 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _react = __webpack_require__(2); + + var _react2 = _interopRequireDefault(_react); + + var _reactDom = __webpack_require__(6); + + var _reactDom2 = _interopRequireDefault(_reactDom); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var SearchField = function (_Component) { + _inherits(SearchField, _Component); + + function SearchField() { + _classCallCheck(this, SearchField); + + return _possibleConstructorReturn(this, (SearchField.__proto__ || Object.getPrototypeOf(SearchField)).apply(this, arguments)); + } + + _createClass(SearchField, [{ + key: 'getValue', + value: function getValue() { + return _reactDom2.default.findDOMNode(this).value; + } + }, { + key: 'setValue', + value: function setValue(value) { + _reactDom2.default.findDOMNode(this).value = value; + } + }, { + key: 'render', + value: function render() { + var _props = this.props, + className = _props.className, + defaultValue = _props.defaultValue, + placeholder = _props.placeholder, + onKeyUp = _props.onKeyUp, + rest = _objectWithoutProperties(_props, ['className', 'defaultValue', 'placeholder', 'onKeyUp']); + + return _react2.default.createElement('input', _extends({ + className: 'form-control ' + className, + type: 'text', + defaultValue: defaultValue, + placeholder: placeholder || SearchField.defaultProps.placeholder, + onKeyUp: onKeyUp, + style: { zIndex: 0 } + }, rest)); + } + }]); + + return SearchField; + }(_react.Component); + + SearchField.propTypes = { + className: _react.PropTypes.string, + defaultValue: _react.PropTypes.string, + placeholder: _react.PropTypes.string, + onKeyUp: _react.PropTypes.func + }; + SearchField.defaultProps = { + className: '', + defaultValue: '', + placeholder: 'Search', + onKeyUp: undefined + }; + + var _default = SearchField; + exports.default = _default; + ; + + var _temp = function () { + if (typeof __REACT_HOT_LOADER__ === 'undefined') { + return; + } - if (this.props.enableDelete) { - deleteBtn = _react2.default.createElement( - 'button', - { type: 'button', - className: 'btn btn-warning react-bs-table-del-btn', - 'data-toggle': 'tooltip', - 'data-placement': 'right', - title: 'Drop selected row', - onClick: this.handleDropRowBtnClick }, - _react2.default.createElement('i', { className: 'glyphicon glyphicon-trash' }), - ' ', - this.props.deleteText - ); - } + __REACT_HOT_LOADER__.register(SearchField, 'SearchField', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/toolbar/SearchField.js'); - if (this.props.enableShowOnlySelected) { - showSelectedOnlyBtn = _react2.default.createElement( - 'button', - { type: 'button', - onClick: this.handleShowOnlyToggle, - className: 'btn btn-primary', - 'data-toggle': 'button', - 'aria-pressed': 'false' }, - this.state.showSelected ? _Const2.default.SHOW_ALL : _Const2.default.SHOW_ONLY_SELECT - ); - } + __REACT_HOT_LOADER__.register(_default, 'default', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/toolbar/SearchField.js'); + }(); - if (this.props.enableExportCSV) { - exportCSV = _react2.default.createElement( - 'button', - { type: 'button', - className: 'btn btn-success hidden-print', - onClick: this.handleExportCSV }, - _react2.default.createElement('i', { className: 'glyphicon glyphicon-export' }), - this.props.exportCSVText - ); - } + ; - var searchTextInput = this.renderSearchPanel(); - var modal = this.props.enableInsert ? this.renderInsertRowModal() : null; +/***/ }, +/* 203 */ +/***/ function(module, exports, __webpack_require__) { - return _react2.default.createElement( - 'div', - { className: 'row' }, - _react2.default.createElement( - 'div', - { className: 'col-xs-12 col-sm-6 col-md-6 col-lg-8' }, - _react2.default.createElement( - 'div', - { className: 'btn-group btn-group-sm', role: 'group' }, - exportCSV, - insertBtn, - deleteBtn, - showSelectedOnlyBtn - ) - ), - _react2.default.createElement( - 'div', - { className: 'col-xs-12 col-sm-6 col-md-6 col-lg-4' }, - searchTextInput - ), - _react2.default.createElement(_Notification2.default, { ref: 'notifier' }), - modal - ); - } - }, { - key: 'renderSearchPanel', - value: function renderSearchPanel() { - if (this.props.enableSearch) { - var classNames = 'form-group form-group-sm react-bs-table-search-form'; - var clearBtn = null; - if (this.props.clearSearch) { - clearBtn = _react2.default.createElement( - 'span', - { className: 'input-group-btn' }, - _react2.default.createElement( - 'button', - { - className: 'btn btn-default', - type: 'button', - onClick: this.handleClearBtnClick }, - 'Clear' - ) - ); - classNames += ' input-group input-group-sm'; - } + 'use strict'; - return _react2.default.createElement( - 'div', - { className: classNames }, - _react2.default.createElement('input', { ref: 'seachInput', - className: 'form-control', - type: 'text', - defaultValue: this.props.defaultSearch, - placeholder: this.props.searchPlaceholder ? this.props.searchPlaceholder : 'Search', - onKeyUp: this.handleKeyUp }), - clearBtn - ); - } else { - return null; - } - } - }, { - key: 'renderInsertRowModal', - value: function renderInsertRowModal() { - var _this5 = this; + Object.defineProperty(exports, "__esModule", { + value: true + }); - var validateState = this.state.validateState || {}; - var shakeEditor = this.state.shakeEditor; - var inputField = this.props.columns.map(function (column, i) { - var editable = column.editable, - format = column.format, - field = column.field, - name = column.name, - autoValue = column.autoValue, - hiddenOnInsert = column.hiddenOnInsert; - - var attr = { - ref: field + i, - placeholder: editable.placeholder ? editable.placeholder : name - }; + var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - if (autoValue || hiddenOnInsert || !column.field) { - // when you want same auto generate value - // and not allow edit, for example ID field - return null; - } - var error = validateState[field] ? _react2.default.createElement( - 'span', - { className: 'help-block bg-danger' }, - validateState[field] - ) : null; + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - // let editor = Editor(editable,attr,format); - // if(editor.props.type && editor.props.type == 'checkbox'){ - return _react2.default.createElement( - 'div', - { className: 'form-group', key: field }, - _react2.default.createElement( - 'label', - null, - name - ), - (0, _Editor2.default)(editable, attr, format, '', undefined, _this5.props.ignoreEditable), - error - ); - }); - var modalClass = (0, _classnames2.default)('modal', 'fade', this.modalClassName, { - // hack prevent bootstrap modal hide by reRender - 'in': shakeEditor || this.state.validateState - }); - var dialogClass = (0, _classnames2.default)('modal-dialog', 'modal-sm', { - 'animated': shakeEditor, - 'shake': shakeEditor - }); + var _react = __webpack_require__(2); + + var _react2 = _interopRequireDefault(_react); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var clearBtnDefaultClass = 'react-bs-table-search-clear-btn'; + + var ClearSearchButton = function (_Component) { + _inherits(ClearSearchButton, _Component); + + function ClearSearchButton() { + _classCallCheck(this, ClearSearchButton); + + return _possibleConstructorReturn(this, (ClearSearchButton.__proto__ || Object.getPrototypeOf(ClearSearchButton)).apply(this, arguments)); + } + + _createClass(ClearSearchButton, [{ + key: 'render', + value: function render() { + var _props = this.props, + btnContextual = _props.btnContextual, + className = _props.className, + onClick = _props.onClick, + btnText = _props.btnText, + children = _props.children, + rest = _objectWithoutProperties(_props, ['btnContextual', 'className', 'onClick', 'btnText', 'children']); + + var content = children || _react2.default.createElement( + 'span', + null, + btnText + ); return _react2.default.createElement( - 'div', - { ref: 'modal', className: modalClass, tabIndex: '-1', role: 'dialog' }, - _react2.default.createElement( - 'div', - { className: dialogClass }, - _react2.default.createElement( - 'div', - { className: 'modal-content' }, - _react2.default.createElement( - 'div', - { className: 'modal-header' }, - _react2.default.createElement( - 'button', - { type: 'button', - className: 'close', - 'data-dismiss': 'modal', - 'aria-label': 'Close' }, - _react2.default.createElement( - 'span', - { 'aria-hidden': 'true' }, - '\xD7' - ) - ), - _react2.default.createElement( - 'h4', - { className: 'modal-title' }, - 'New Record' - ) - ), - _react2.default.createElement( - 'div', - { className: 'modal-body' }, - _react2.default.createElement( - 'form', - { ref: 'form' }, - inputField - ) - ), - _react2.default.createElement( - 'div', - { className: 'modal-footer' }, - _react2.default.createElement( - 'button', - { type: 'button', - className: 'btn btn-default', - 'data-dismiss': 'modal' }, - this.props.closeText - ), - _react2.default.createElement( - 'button', - { type: 'button', - className: 'btn btn-primary', - onClick: this.handleSaveBtnClick }, - this.props.saveText - ) - ) - ) - ) + 'button', + _extends({ ref: 'btn', + className: 'btn ' + btnContextual + ' ' + className + ' ' + clearBtnDefaultClass, + type: 'button', + onClick: onClick + }, rest), + content ); } }]); - return ToolBar; + return ClearSearchButton; }(_react.Component); - ToolBar.modalSeq = 0; - - - ToolBar.propTypes = { - onAddRow: _react.PropTypes.func, - onDropRow: _react.PropTypes.func, - onShowOnlySelected: _react.PropTypes.func, - enableInsert: _react.PropTypes.bool, - enableDelete: _react.PropTypes.bool, - enableSearch: _react.PropTypes.bool, - enableShowOnlySelected: _react.PropTypes.bool, - columns: _react.PropTypes.array, - searchPlaceholder: _react.PropTypes.string, - exportCSVText: _react.PropTypes.string, - insertText: _react.PropTypes.string, - deleteText: _react.PropTypes.string, - saveText: _react.PropTypes.string, - closeText: _react.PropTypes.string, - clearSearch: _react.PropTypes.bool, - ignoreEditable: _react.PropTypes.bool, - defaultSearch: _react.PropTypes.string, - reset: _react.PropTypes.bool + ClearSearchButton.propTypes = { + btnContextual: _react.PropTypes.string, + className: _react.PropTypes.string, + btnText: _react.PropTypes.string, + onClick: _react.PropTypes.func }; - - ToolBar.defaultProps = { - reset: false, - enableInsert: false, - enableDelete: false, - enableSearch: false, - enableShowOnlySelected: false, - clearSearch: false, - ignoreEditable: false, - exportCSVText: _Const2.default.EXPORT_CSV_TEXT, - insertText: _Const2.default.INSERT_BTN_TEXT, - deleteText: _Const2.default.DELETE_BTN_TEXT, - saveText: _Const2.default.SAVE_BTN_TEXT, - closeText: _Const2.default.CLOSE_BTN_TEXT + ClearSearchButton.defaultProps = { + btnContextual: 'btn-default', + className: '', + btnText: 'Clear', + onClick: undefined }; - var _default = ToolBar; + var _default = ClearSearchButton; exports.default = _default; ; @@ -10840,15 +14033,17 @@ return /******/ (function(modules) { // webpackBootstrap return; } - __REACT_HOT_LOADER__.register(ToolBar, 'ToolBar', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/toolbar/ToolBar.js'); + __REACT_HOT_LOADER__.register(clearBtnDefaultClass, 'clearBtnDefaultClass', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/toolbar/ClearSearchButton.js'); - __REACT_HOT_LOADER__.register(_default, 'default', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/toolbar/ToolBar.js'); + __REACT_HOT_LOADER__.register(ClearSearchButton, 'ClearSearchButton', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/toolbar/ClearSearchButton.js'); + + __REACT_HOT_LOADER__.register(_default, 'default', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/toolbar/ClearSearchButton.js'); }(); ; /***/ }, -/* 183 */ +/* 204 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -11000,7 +14195,7 @@ return /******/ (function(modules) { // webpackBootstrap ; /***/ }, -/* 184 */ +/* 205 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -11759,7 +14954,7 @@ return /******/ (function(modules) { // webpackBootstrap ; /***/ }, -/* 185 */ +/* 206 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -11775,7 +14970,7 @@ return /******/ (function(modules) { // webpackBootstrap function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } if (_util2.default.canUseDOM()) { - var filesaver = __webpack_require__(186); + var filesaver = __webpack_require__(207); var saveAs = filesaver.saveAs; } /* eslint block-scoped-var: 0 */ /* eslint vars-on-top: 0 */ @@ -11865,7 +15060,7 @@ return /******/ (function(modules) { // webpackBootstrap ; /***/ }, -/* 186 */ +/* 207 */ /***/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;"use strict"; @@ -12127,7 +15322,7 @@ return /******/ (function(modules) { // webpackBootstrap if (typeof module !== "undefined" && module.exports) { module.exports.saveAs = saveAs; - } else if ("function" !== "undefined" && __webpack_require__(187) !== null && __webpack_require__(188) != null) { + } else if ("function" !== "undefined" && __webpack_require__(208) !== null && __webpack_require__(209) != null) { !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function () { return saveAs; }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); @@ -12145,14 +15340,14 @@ return /******/ (function(modules) { // webpackBootstrap ; /***/ }, -/* 187 */ +/* 208 */ /***/ function(module, exports) { module.exports = function() { throw new Error("define cannot be used indirect"); }; /***/ }, -/* 188 */ +/* 209 */ /***/ function(module, exports) { /* WEBPACK VAR INJECTION */(function(__webpack_amd_options__) {module.exports = __webpack_amd_options__; @@ -12160,7 +15355,7 @@ return /******/ (function(modules) { // webpackBootstrap /* WEBPACK VAR INJECTION */}.call(exports, {})) /***/ }, -/* 189 */ +/* 210 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -12178,7 +15373,7 @@ return /******/ (function(modules) { // webpackBootstrap var _Const2 = _interopRequireDefault(_Const); - var _events = __webpack_require__(190); + var _events = __webpack_require__(211); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -12249,7 +15444,7 @@ return /******/ (function(modules) { // webpackBootstrap ; /***/ }, -/* 190 */ +/* 211 */ /***/ function(module, exports) { // Copyright Joyent, Inc. and other Node contributors. @@ -12557,7 +15752,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 191 */ +/* 212 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -12586,23 +15781,23 @@ return /******/ (function(modules) { // webpackBootstrap var _util2 = _interopRequireDefault(_util); - var _Date = __webpack_require__(192); + var _Date = __webpack_require__(213); var _Date2 = _interopRequireDefault(_Date); - var _Text = __webpack_require__(193); + var _Text = __webpack_require__(214); var _Text2 = _interopRequireDefault(_Text); - var _Regex = __webpack_require__(194); + var _Regex = __webpack_require__(215); var _Regex2 = _interopRequireDefault(_Regex); - var _Select = __webpack_require__(195); + var _Select = __webpack_require__(216); var _Select2 = _interopRequireDefault(_Select); - var _Number = __webpack_require__(196); + var _Number = __webpack_require__(217); var _Number2 = _interopRequireDefault(_Number); @@ -12958,7 +16153,7 @@ return /******/ (function(modules) { // webpackBootstrap ; /***/ }, -/* 192 */ +/* 213 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -13161,7 +16356,7 @@ return /******/ (function(modules) { // webpackBootstrap ; /***/ }, -/* 193 */ +/* 214 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -13289,7 +16484,7 @@ return /******/ (function(modules) { // webpackBootstrap ; /***/ }, -/* 194 */ +/* 215 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -13417,7 +16612,7 @@ return /******/ (function(modules) { // webpackBootstrap ; /***/ }, -/* 195 */ +/* 216 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -13464,6 +16659,30 @@ return /******/ (function(modules) { // webpackBootstrap } _createClass(SelectFilter, [{ + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps(nextProps) { + var isPlaceholderSelected = nextProps.defaultValue === undefined || !nextProps.options.hasOwnProperty(nextProps.defaultValue); + this.setState({ + isPlaceholderSelected: isPlaceholderSelected + }); + } + }, { + key: 'componentDidUpdate', + value: function componentDidUpdate(prevProps) { + var needFilter = false; + if (this.props.defaultValue !== prevProps.defaultValue) { + needFilter = true; + } else if (this.props.options !== prevProps.options) { + needFilter = true; + } + if (needFilter) { + var value = this.refs.selectInput.value; + if (value) { + this.props.filterHandler(value, _Const2.default.FILTER_TYPE.SELECT); + } + } + } + }, { key: 'filter', value: function filter(event) { var value = event.target.value; @@ -13563,7 +16782,7 @@ return /******/ (function(modules) { // webpackBootstrap ; /***/ }, -/* 196 */ +/* 217 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -13812,6 +17031,88 @@ return /******/ (function(modules) { // webpackBootstrap ; +/***/ }, +/* 218 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _react = __webpack_require__(2); + + var _react2 = _interopRequireDefault(_react); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var ButtonGroup = function (_Component) { + _inherits(ButtonGroup, _Component); + + function ButtonGroup() { + _classCallCheck(this, ButtonGroup); + + return _possibleConstructorReturn(this, (ButtonGroup.__proto__ || Object.getPrototypeOf(ButtonGroup)).apply(this, arguments)); + } + + _createClass(ButtonGroup, [{ + key: 'render', + value: function render() { + var _props = this.props, + className = _props.className, + sizeClass = _props.sizeClass, + children = _props.children, + rest = _objectWithoutProperties(_props, ['className', 'sizeClass', 'children']); + + return _react2.default.createElement( + 'div', + _extends({ className: 'btn-group ' + sizeClass + ' ' + className, role: 'group' }, rest), + children + ); + } + }]); + + return ButtonGroup; + }(_react.Component); + + ButtonGroup.propTypes = { + sizeClass: _react.PropTypes.string, + className: _react.PropTypes.string + }; + ButtonGroup.defaultProps = { + sizeClass: 'btn-group-sm', + className: '' + }; + + var _default = ButtonGroup; + exports.default = _default; + ; + + var _temp = function () { + if (typeof __REACT_HOT_LOADER__ === 'undefined') { + return; + } + + __REACT_HOT_LOADER__.register(ButtonGroup, 'ButtonGroup', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/toolbar/ButtonGroup.js'); + + __REACT_HOT_LOADER__.register(_default, 'default', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/toolbar/ButtonGroup.js'); + }(); + + ; + /***/ } /******/ ]) }); diff --git a/dist/react-bootstrap-table.js.map b/dist/react-bootstrap-table.js.map index c3c3eeb9f..971b8b0d9 100644 --- a/dist/react-bootstrap-table.js.map +++ b/dist/react-bootstrap-table.js.map @@ -1 +1 @@ -{"version":3,"file":"react-bootstrap-table.js","sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap f907b098756e200b57dd","webpack:///src/index.js","webpack:///src/BootstrapTable.js","webpack:///external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}","webpack:///./~/classnames/index.js","webpack:///src/Const.js","webpack:///src/TableHeader.js","webpack:///external {\"root\":\"ReactDOM\",\"commonjs2\":\"react-dom\",\"commonjs\":\"react-dom\",\"amd\":\"react-dom\"}","webpack:///src/SelectRowHeaderColumn.js","webpack:///src/TableBody.js","webpack:///src/util.js","webpack:///src/TableRow.js","webpack:///src/TableColumn.js","webpack:///src/TableEditColumn.js","webpack:///src/Editor.js","webpack:///src/Notification.js","webpack:///./~/@allenfang/react-toastr/lib/index.js","webpack:///./~/@allenfang/react-toastr/lib/ToastContainer.js","webpack:///./~/@allenfang/react-toastr/~/lodash/omit.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_arrayMap.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_baseClone.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_Stack.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_ListCache.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_listCacheClear.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_listCacheDelete.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_assocIndexOf.js","webpack:///./~/@allenfang/react-toastr/~/lodash/eq.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_listCacheGet.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_listCacheHas.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_listCacheSet.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_stackClear.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_stackDelete.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_stackGet.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_stackHas.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_stackSet.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_Map.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_getNative.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_baseIsNative.js","webpack:///./~/@allenfang/react-toastr/~/lodash/isFunction.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_baseGetTag.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_Symbol.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_root.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_freeGlobal.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_getRawTag.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_objectToString.js","webpack:///./~/@allenfang/react-toastr/~/lodash/isObject.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_isMasked.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_coreJsData.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_toSource.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_getValue.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_MapCache.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_mapCacheClear.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_Hash.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_hashClear.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_nativeCreate.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_hashDelete.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_hashGet.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_hashHas.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_hashSet.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_mapCacheDelete.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_getMapData.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_isKeyable.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_mapCacheGet.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_mapCacheHas.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_mapCacheSet.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_arrayEach.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_assignValue.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_baseAssignValue.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_defineProperty.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_baseAssign.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_copyObject.js","webpack:///./~/@allenfang/react-toastr/~/lodash/keys.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_arrayLikeKeys.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_baseTimes.js","webpack:///./~/@allenfang/react-toastr/~/lodash/isArguments.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_baseIsArguments.js","webpack:///./~/@allenfang/react-toastr/~/lodash/isObjectLike.js","webpack:///./~/@allenfang/react-toastr/~/lodash/isArray.js","webpack:///./~/@allenfang/react-toastr/~/lodash/isBuffer.js","webpack:///(webpack)/buildin/module.js","webpack:///./~/@allenfang/react-toastr/~/lodash/stubFalse.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_isIndex.js","webpack:///./~/@allenfang/react-toastr/~/lodash/isTypedArray.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_baseIsTypedArray.js","webpack:///./~/@allenfang/react-toastr/~/lodash/isLength.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_baseUnary.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_nodeUtil.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_baseKeys.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_isPrototype.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_nativeKeys.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_overArg.js","webpack:///./~/@allenfang/react-toastr/~/lodash/isArrayLike.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_baseAssignIn.js","webpack:///./~/@allenfang/react-toastr/~/lodash/keysIn.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_baseKeysIn.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_nativeKeysIn.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_cloneBuffer.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_copyArray.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_copySymbols.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_getSymbols.js","webpack:///./~/@allenfang/react-toastr/~/lodash/stubArray.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_copySymbolsIn.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_getSymbolsIn.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_arrayPush.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_getPrototype.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_getAllKeys.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_baseGetAllKeys.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_getAllKeysIn.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_getTag.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_DataView.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_Promise.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_Set.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_WeakMap.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_initCloneArray.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_initCloneByTag.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_cloneArrayBuffer.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_Uint8Array.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_cloneDataView.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_cloneMap.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_addMapEntry.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_arrayReduce.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_mapToArray.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_cloneRegExp.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_cloneSet.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_addSetEntry.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_setToArray.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_cloneSymbol.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_cloneTypedArray.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_initCloneObject.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_baseCreate.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_baseUnset.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_castPath.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_isKey.js","webpack:///./~/@allenfang/react-toastr/~/lodash/isSymbol.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_stringToPath.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_memoizeCapped.js","webpack:///./~/@allenfang/react-toastr/~/lodash/memoize.js","webpack:///./~/@allenfang/react-toastr/~/lodash/toString.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_baseToString.js","webpack:///./~/@allenfang/react-toastr/~/lodash/last.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_parent.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_baseGet.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_toKey.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_baseSlice.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_flatRest.js","webpack:///./~/@allenfang/react-toastr/~/lodash/flatten.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_baseFlatten.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_isFlattenable.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_overRest.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_apply.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_setToString.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_baseSetToString.js","webpack:///./~/@allenfang/react-toastr/~/lodash/constant.js","webpack:///./~/@allenfang/react-toastr/~/lodash/identity.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_shortOut.js","webpack:///./~/@allenfang/react-toastr/~/lodash/includes.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_baseIndexOf.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_baseFindIndex.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_baseIsNaN.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_strictIndexOf.js","webpack:///./~/@allenfang/react-toastr/~/lodash/isString.js","webpack:///./~/@allenfang/react-toastr/~/lodash/toInteger.js","webpack:///./~/@allenfang/react-toastr/~/lodash/toFinite.js","webpack:///./~/@allenfang/react-toastr/~/lodash/toNumber.js","webpack:///./~/@allenfang/react-toastr/~/lodash/values.js","webpack:///./~/@allenfang/react-toastr/~/lodash/_baseValues.js","webpack:///./~/@allenfang/react-toastr/~/react-addons-update/index.js","webpack:///./~/@allenfang/react-toastr/~/react/lib/update.js","webpack:///(webpack)/~/node-libs-browser/~/process/browser.js","webpack:///./~/@allenfang/react-toastr/~/react/lib/reactProdInvariant.js","webpack:///./~/@allenfang/react-toastr/~/react/~/object-assign/index.js","webpack:///./~/@allenfang/react-toastr/~/react/~/fbjs/lib/keyOf.js","webpack:///./~/@allenfang/react-toastr/~/react/~/fbjs/lib/invariant.js","webpack:///./~/@allenfang/react-toastr/lib/ToastMessage/index.js","webpack:///./~/@allenfang/react-toastr/lib/ToastMessage/animationMixin.js","webpack:///./~/@allenfang/react-toastr/~/react/lib/ReactTransitionEvents.js","webpack:///./~/@allenfang/react-toastr/~/react/~/fbjs/lib/ExecutionEnvironment.js","webpack:///./~/@allenfang/react-toastr/~/react/lib/getVendorPrefixedEventName.js","webpack:///./~/@allenfang/react-toastr/~/element-class/index.js","webpack:///./~/@allenfang/react-toastr/lib/ToastMessage/jQueryMixin.js","webpack:///src/ExpandComponent.js","webpack:///src/pagination/PaginationList.js","webpack:///src/pagination/PageButton.js","webpack:///src/toolbar/ToolBar.js","webpack:///src/TableFilter.js","webpack:///src/store/TableDataStore.js","webpack:///src/csv_export_util.js","webpack:///src/filesaver.js","webpack:///(webpack)/buildin/amd-define.js","webpack:///(webpack)/buildin/amd-options.js","webpack:///src/Filter.js","webpack:///(webpack)/~/node-libs-browser/~/events/events.js","webpack:///src/TableHeaderColumn.js","webpack:///src/filters/Date.js","webpack:///src/filters/Text.js","webpack:///src/filters/Regex.js","webpack:///src/filters/Select.js","webpack:///src/filters/Number.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"), require(\"react-dom\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\", \"react-dom\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ReactBootstrapTable\"] = factory(require(\"react\"), require(\"react-dom\"));\n\telse\n\t\troot[\"ReactBootstrapTable\"] = factory(root[\"React\"], root[\"ReactDOM\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_2__, __WEBPACK_EXTERNAL_MODULE_6__) {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap f907b098756e200b57dd","import BootstrapTable from './BootstrapTable';\nimport TableHeaderColumn from './TableHeaderColumn';\n\nif (typeof window !== 'undefined') {\n window.BootstrapTable = BootstrapTable;\n window.TableHeaderColumn = TableHeaderColumn;\n}\nexport {\n BootstrapTable,\n TableHeaderColumn\n};\n\n\n\n// WEBPACK FOOTER //\n// src/index.js","/* eslint no-alert: 0 */\n/* eslint max-len: 0 */\nimport React, { Component, PropTypes } from 'react';\nimport classSet from 'classnames';\nimport Const from './Const';\nimport TableHeader from './TableHeader';\nimport TableBody from './TableBody';\nimport PaginationList from './pagination/PaginationList';\nimport ToolBar from './toolbar/ToolBar';\nimport TableFilter from './TableFilter';\nimport { TableDataStore } from './store/TableDataStore';\nimport Util from './util';\nimport exportCSV from './csv_export_util';\nimport { Filter } from './Filter';\n\nclass BootstrapTable extends Component {\n\n constructor(props) {\n super(props);\n this.isIE = false;\n this._attachCellEditFunc();\n if (Util.canUseDOM()) {\n this.isIE = document.documentMode;\n }\n this.store = new TableDataStore(this.props.data.slice());\n\n this.initTable(this.props);\n\n if (this.props.selectRow && this.props.selectRow.selected) {\n const copy = this.props.selectRow.selected.slice();\n this.store.setSelectedRowKey(copy);\n }\n let currPage = Const.PAGE_START_INDEX;\n if (typeof this.props.options.page !== 'undefined') {\n currPage = this.props.options.page;\n } else if (typeof this.props.options.pageStartIndex !== 'undefined') {\n currPage = this.props.options.pageStartIndex;\n }\n\n this._adjustHeaderWidth = this._adjustHeaderWidth.bind(this);\n this._adjustHeight = this._adjustHeight.bind(this);\n this._adjustTable = this._adjustTable.bind(this);\n\n this.state = {\n data: this.getTableData(),\n currPage: currPage,\n expanding: this.props.options.expanding || [],\n sizePerPage: this.props.options.sizePerPage || Const.SIZE_PER_PAGE_LIST[0],\n selectedRowKeys: this.store.getSelectedRowKeys(),\n reset: false\n };\n }\n\n initTable(props) {\n let { keyField } = props;\n\n const isKeyFieldDefined = typeof keyField === 'string' && keyField.length;\n React.Children.forEach(props.children, column => {\n if (column.props.isKey) {\n if (keyField) {\n throw new Error('Error. Multiple key column be detected in TableHeaderColumn.');\n }\n keyField = column.props.dataField;\n }\n if (column.props.filter) {\n // a column contains a filter\n if (!this.filter) {\n // first time create the filter on the BootstrapTable\n this.filter = new Filter();\n }\n // pass the filter to column with filter\n column.props.filter.emitter = this.filter;\n }\n });\n\n if (this.filter) {\n this.filter.removeAllListeners('onFilterChange');\n this.filter.on('onFilterChange', (currentFilter) => {\n this.handleFilterData(currentFilter);\n });\n }\n\n this.colInfos = this.getColumnsDescription(props).reduce(( prev, curr ) => {\n prev[curr.name] = curr;\n return prev;\n }, {});\n\n if (!isKeyFieldDefined && !keyField) {\n throw new Error(`Error. No any key column defined in TableHeaderColumn.\n Use 'isKey={true}' to specify a unique column after version 0.5.4.`);\n }\n\n this.store.setProps({\n isPagination: props.pagination,\n keyField: keyField,\n colInfos: this.colInfos,\n multiColumnSearch: props.multiColumnSearch,\n multiColumnSort: props.multiColumnSort,\n remote: this.props.remote\n });\n }\n\n getTableData() {\n let result = [];\n const { options, pagination } = this.props;\n const sortName = options.defaultSortName || options.sortName;\n const sortOrder = options.defaultSortOrder || options.sortOrder;\n const searchText = options.defaultSearch;\n if (sortName && sortOrder) {\n this.store.setSortInfo(sortOrder, sortName);\n this.store.sort();\n }\n\n if (searchText) {\n this.store.search(searchText);\n }\n\n if (pagination) {\n let page;\n let sizePerPage;\n if (this.store.isChangedPage()) {\n sizePerPage = this.state.sizePerPage;\n page = this.state.currPage;\n } else {\n sizePerPage = options.sizePerPage || Const.SIZE_PER_PAGE_LIST[0];\n page = options.page || 1;\n }\n result = this.store.page(page, sizePerPage).get();\n } else {\n result = this.store.get();\n }\n return result;\n }\n\n getColumnsDescription({ children }) {\n let rowCount = 0;\n React.Children.forEach(children, (column) => {\n if (Number(column.props.row) > rowCount) {\n rowCount = Number(column.props.row);\n }\n });\n return React.Children.map(children, (column, i) => {\n const rowIndex = column.props.row ? Number(column.props.row) : 0;\n const rowSpan = column.props.rowSpan ? Number(column.props.rowSpan) : 1;\n if ((rowSpan + rowIndex) === (rowCount + 1)) {\n return {\n name: column.props.dataField,\n align: column.props.dataAlign,\n sort: column.props.dataSort,\n format: column.props.dataFormat,\n formatExtraData: column.props.formatExtraData,\n filterFormatted: column.props.filterFormatted,\n filterValue: column.props.filterValue,\n editable: column.props.editable,\n customEditor: column.props.customEditor,\n hidden: column.props.hidden,\n hiddenOnInsert: column.props.hiddenOnInsert,\n searchable: column.props.searchable,\n className: column.props.columnClassName,\n editClassName: column.props.editColumnClassName,\n invalidEditColumnClassName: column.props.invalidEditColumnClassName,\n columnTitle: column.props.columnTitle,\n width: column.props.width,\n text: column.props.headerText || column.props.children,\n sortFunc: column.props.sortFunc,\n sortFuncExtraData: column.props.sortFuncExtraData,\n export: column.props.export,\n expandable: column.props.expandable,\n index: i,\n attrs: column.props.tdAttr,\n style: column.props.tdStyle\n };\n }\n });\n }\n\n reset() {\n this.store.clean();\n this.setState({\n data: this.getTableData(),\n currPage: 1,\n expanding: [],\n sizePerPage: Const.SIZE_PER_PAGE_LIST[0],\n selectedRowKeys: this.store.getSelectedRowKeys(),\n reset: true\n });\n }\n\n componentWillReceiveProps(nextProps) {\n this.initTable(nextProps);\n const { options, selectRow } = nextProps;\n\n this.store.setData(nextProps.data.slice());\n\n // from #481\n let page = this.state.currPage;\n if (this.props.options.page !== options.page) {\n page = options.page;\n }\n // from #481\n let sizePerPage = this.state.sizePerPage;\n if (this.props.options.sizePerPage !== options.sizePerPage) {\n sizePerPage = options.sizePerPage;\n }\n\n if (this.isRemoteDataSource()) {\n let data = nextProps.data.slice();\n if (nextProps.pagination && !this.allowRemote(Const.REMOTE_PAGE)) {\n data = this.store.page(page, sizePerPage).get();\n }\n this.setState({\n data,\n currPage: page,\n sizePerPage,\n reset: false\n });\n } else {\n // #125\n // remove !options.page for #709\n if (page > Math.ceil(nextProps.data.length / sizePerPage)) {\n page = 1;\n }\n const sortList = this.store.getSortInfo();\n const sortField = options.sortName;\n const sortOrder = options.sortOrder;\n if (sortField && sortOrder) {\n this.store.setSortInfo(sortOrder, sortField);\n this.store.sort();\n } else if (sortList.length > 0) {\n this.store.sort();\n }\n const data = this.store.page(page, sizePerPage).get();\n this.setState({\n data,\n currPage: page,\n sizePerPage,\n reset: false\n });\n }\n\n if (selectRow && selectRow.selected) {\n // set default select rows to store.\n const copy = selectRow.selected.slice();\n this.store.setSelectedRowKey(copy);\n this.setState({\n selectedRowKeys: copy,\n reset: false\n });\n }\n }\n\n componentDidMount() {\n this._adjustTable();\n window.addEventListener('resize', this._adjustTable);\n this.refs.body.refs.container.addEventListener('scroll', this._scrollHeader);\n if (this.props.scrollTop) {\n this._scrollTop();\n }\n }\n\n componentWillUnmount() {\n window.removeEventListener('resize', this._adjustTable);\n this.refs.body.refs.container.removeEventListener('scroll', this._scrollHeader);\n if (this.filter) {\n this.filter.removeAllListeners('onFilterChange');\n }\n }\n\n componentDidUpdate() {\n this._adjustTable();\n this._attachCellEditFunc();\n if (this.props.options.afterTableComplete) {\n this.props.options.afterTableComplete();\n }\n }\n\n _attachCellEditFunc() {\n const { cellEdit } = this.props;\n if (cellEdit) {\n this.props.cellEdit.__onCompleteEdit__ = this.handleEditCell.bind(this);\n if (cellEdit.mode !== Const.CELL_EDIT_NONE) {\n this.props.selectRow.clickToSelect = false;\n }\n }\n }\n\n /**\n * Returns true if in the current configuration,\n * the datagrid should load its data remotely.\n *\n * @param {Object} [props] Optional. If not given, this.props will be used\n * @return {Boolean}\n */\n isRemoteDataSource(props) {\n const { remote } = (props || this.props);\n return remote === true || typeof remote === 'function';\n }\n\n /**\n * Returns true if this action can be handled remote store\n * From #990, Sometimes, we need some actions as remote, some actions are handled by default\n * so function will tell you the target action is can be handled as remote or not.\n * @param {String} [action] Required.\n * @param {Object} [props] Optional. If not given, this.props will be used\n * @return {Boolean}\n */\n allowRemote(action, props) {\n const { remote } = (props || this.props);\n if (typeof remote === 'function') {\n const remoteObj = remote(Const.REMOTE);\n return remoteObj[action];\n } else {\n return remote;\n }\n }\n\n render() {\n const style = {\n height: this.props.height,\n maxHeight: this.props.maxHeight\n };\n\n const columns = this.getColumnsDescription(this.props);\n const sortList = this.store.getSortInfo();\n const pagination = this.renderPagination();\n const toolBar = this.renderToolBar();\n const tableFilter = this.renderTableFilter(columns);\n const isSelectAll = this.isSelectAll();\n const colGroups = Util.renderColGroup(columns, this.props.selectRow);\n let sortIndicator = this.props.options.sortIndicator;\n if (typeof this.props.options.sortIndicator === 'undefined') sortIndicator = true;\n return (\n
\n { toolBar }\n
\n \n { this.props.children }\n \n \n
\n { tableFilter }\n { pagination }\n
\n );\n }\n\n isSelectAll() {\n if (this.store.isEmpty()) return false;\n const unselectable = this.props.selectRow.unselectable;\n const defaultSelectRowKeys = this.store.getSelectedRowKeys();\n const allRowKeys = this.store.getAllRowkey();\n\n if (defaultSelectRowKeys.length === 0) return false;\n let match = 0;\n let noFound = 0;\n let unSelectableCnt = 0;\n defaultSelectRowKeys.forEach(selected => {\n if (allRowKeys.indexOf(selected) !== -1) match++;\n else noFound++;\n if (unselectable &&\n unselectable.indexOf(selected) !== -1) unSelectableCnt++;\n });\n\n if (noFound === defaultSelectRowKeys.length) return false;\n if (match === allRowKeys.length) {\n return true;\n } else {\n if (unselectable && match <= unSelectableCnt &&\n unSelectableCnt === unselectable.length) return false;\n else return 'indeterminate';\n }\n // return (match === allRowKeys.length) ? true : 'indeterminate';\n }\n\n cleanSelected() {\n this.store.setSelectedRowKey([]);\n this.setState({\n selectedRowKeys: [],\n reset: false\n });\n }\n\n handleSort = (order, sortField) => {\n if (this.props.options.onSortChange) {\n this.props.options.onSortChange(sortField, order, this.props);\n }\n this.store.setSortInfo(order, sortField);\n if (this.allowRemote(Const.REMOTE_SORT)) {\n return;\n }\n\n const result = this.store.sort().get();\n this.setState({\n data: result,\n reset: false\n });\n }\n\n handleExpandRow = expanding => {\n this.setState({ expanding, reset: false }, () => {\n this._adjustHeaderWidth();\n });\n }\n\n handlePaginationData = (page, sizePerPage) => {\n const { onPageChange, pageStartIndex } = this.props.options;\n if (onPageChange) {\n onPageChange(page, sizePerPage);\n }\n\n this.setState({\n currPage: page,\n sizePerPage,\n reset: false\n });\n\n if (this.allowRemote(Const.REMOTE_PAGE)) {\n return;\n }\n\n // We calculate an offset here in order to properly fetch the indexed data,\n // despite the page start index not always being 1\n let normalizedPage;\n if (pageStartIndex !== undefined) {\n const offset = Math.abs(Const.PAGE_START_INDEX - pageStartIndex);\n normalizedPage = page + offset;\n } else {\n normalizedPage = page;\n }\n\n const result = this.store.page(normalizedPage, sizePerPage).get();\n\n this.setState({ data: result, reset: false });\n }\n\n handleMouseLeave = () => {\n if (this.props.options.onMouseLeave) {\n this.props.options.onMouseLeave();\n }\n }\n\n handleMouseEnter = () => {\n if (this.props.options.onMouseEnter) {\n this.props.options.onMouseEnter();\n }\n }\n\n handleRowMouseOut = (row, event) => {\n if (this.props.options.onRowMouseOut) {\n this.props.options.onRowMouseOut(row, event);\n }\n }\n\n handleRowMouseOver = (row, event) => {\n if (this.props.options.onRowMouseOver) {\n this.props.options.onRowMouseOver(row, event);\n }\n }\n\n handleRowClick = row => {\n if (this.props.options.onRowClick) {\n this.props.options.onRowClick(row);\n }\n }\n\n handleRowDoubleClick = row => {\n if (this.props.options.onRowDoubleClick) {\n this.props.options.onRowDoubleClick(row);\n }\n }\n\n handleSelectAllRow = e => {\n const isSelected = e.currentTarget.checked;\n const keyField = this.store.getKeyField();\n const { selectRow: { onSelectAll, unselectable, selected } } = this.props;\n let selectedRowKeys = [];\n let result = true;\n let rows = isSelected ?\n this.store.get() :\n this.store.getRowByKey(this.state.selectedRowKeys);\n\n if (unselectable && unselectable.length > 0) {\n if (isSelected) {\n rows = rows.filter(r => {\n return unselectable.indexOf(r[keyField]) === -1 ||\n (selected && selected.indexOf(r[keyField]) !== -1);\n });\n } else {\n rows = rows.filter(r => unselectable.indexOf(r[keyField]) === -1);\n }\n }\n\n if (onSelectAll) {\n result = this.props.selectRow.onSelectAll(isSelected, rows);\n }\n\n if (typeof result == 'undefined' || result !== false) {\n if (isSelected) {\n selectedRowKeys = Array.isArray(result) ?\n result :\n rows.map(r => r[keyField]);\n } else {\n if (unselectable && selected) {\n selectedRowKeys = selected.filter(r => unselectable.indexOf(r) > -1 );\n }\n }\n\n this.store.setSelectedRowKey(selectedRowKeys);\n this.setState({ selectedRowKeys, reset: false });\n }\n }\n\n handleShowOnlySelected = () => {\n this.store.ignoreNonSelected();\n let result;\n if (this.props.pagination) {\n result = this.store.page(1, this.state.sizePerPage).get();\n } else {\n result = this.store.get();\n }\n this.setState({\n data: result,\n reset: false,\n currPage: this.props.options.pageStartIndex || Const.PAGE_START_INDEX\n });\n }\n\n handleSelectRow = (row, isSelected, e) => {\n let result = true;\n let currSelected = this.store.getSelectedRowKeys();\n const rowKey = row[ this.store.getKeyField() ];\n const { selectRow } = this.props;\n if (selectRow.onSelect) {\n result = selectRow.onSelect(row, isSelected, e);\n }\n\n if (typeof result === 'undefined' || result !== false) {\n if (selectRow.mode === Const.ROW_SELECT_SINGLE) {\n currSelected = isSelected ? [ rowKey ] : [];\n } else {\n if (isSelected) {\n currSelected.push(rowKey);\n } else {\n currSelected = currSelected.filter(key => rowKey !== key);\n }\n }\n\n this.store.setSelectedRowKey(currSelected);\n this.setState({\n selectedRowKeys: currSelected,\n reset: false\n });\n }\n }\n\n handleEditCell(newVal, rowIndex, colIndex) {\n const { onCellEdit } = this.props.options;\n const { beforeSaveCell, afterSaveCell } = this.props.cellEdit;\n const columns = this.getColumnsDescription(this.props);\n const fieldName = columns[colIndex].name;\n\n if (beforeSaveCell) {\n const isValid = beforeSaveCell(this.state.data[rowIndex], fieldName, newVal);\n if (!isValid && typeof isValid !== 'undefined') {\n this.setState({\n data: this.store.get(),\n reset: false\n });\n return;\n }\n }\n\n if (onCellEdit) {\n newVal = onCellEdit(this.state.data[rowIndex], fieldName, newVal);\n }\n\n if (this.allowRemote(Const.REMOTE_CELL_EDIT)) {\n if (afterSaveCell) {\n afterSaveCell(this.state.data[rowIndex], fieldName, newVal);\n }\n return;\n }\n\n const result = this.store.edit(newVal, rowIndex, fieldName).get();\n this.setState({\n data: result,\n reset: false\n });\n\n if (afterSaveCell) {\n afterSaveCell(this.state.data[rowIndex], fieldName, newVal);\n }\n }\n\n handleAddRowAtBegin(newObj) {\n try {\n this.store.addAtBegin(newObj);\n } catch (e) {\n return e;\n }\n this._handleAfterAddingRow(newObj, true);\n }\n\n handleAddRow = newObj => {\n const { onAddRow } = this.props.options;\n if (onAddRow) {\n const colInfos = this.store.getColInfos();\n onAddRow(newObj, colInfos);\n }\n\n if (this.allowRemote(Const.REMOTE_INSERT_ROW)) {\n if (this.props.options.afterInsertRow) {\n this.props.options.afterInsertRow(newObj);\n }\n return null;\n }\n\n try {\n this.store.add(newObj);\n } catch (e) {\n return e.message;\n }\n this._handleAfterAddingRow(newObj, false);\n }\n\n getSizePerPage() {\n return this.state.sizePerPage;\n }\n\n getCurrentPage() {\n return this.state.currPage;\n }\n\n getTableDataIgnorePaging() {\n return this.store.getCurrentDisplayData();\n }\n\n getPageByRowKey = rowKey => {\n const { sizePerPage } = this.state;\n const currentData = this.store.getCurrentDisplayData();\n const keyField = this.store.getKeyField();\n const result = currentData.findIndex((x) => x[ keyField ] === rowKey);\n if (result > -1) {\n return parseInt((result / sizePerPage), 10) + 1;\n } else {\n return result;\n }\n }\n\n handleDropRow = rowKeys => {\n const dropRowKeys = rowKeys ? rowKeys : this.store.getSelectedRowKeys();\n // add confirm before the delete action if that option is set.\n if (dropRowKeys && dropRowKeys.length > 0) {\n if (this.props.options.handleConfirmDeleteRow) {\n this.props.options.handleConfirmDeleteRow(() => {\n this.deleteRow(dropRowKeys);\n }, dropRowKeys);\n } else if (confirm('Are you sure you want to delete?')) {\n this.deleteRow(dropRowKeys);\n }\n }\n }\n\n deleteRow(dropRowKeys) {\n const { onDeleteRow } = this.props.options;\n if (onDeleteRow) {\n onDeleteRow(dropRowKeys);\n }\n\n this.store.setSelectedRowKey([]); // clear selected row key\n\n if (this.allowRemote(Const.REMOTE_DROP_ROW)) {\n if (this.props.options.afterDeleteRow) {\n this.props.options.afterDeleteRow(dropRowKeys);\n }\n return;\n }\n\n this.store.remove(dropRowKeys); // remove selected Row\n let result;\n if (this.props.pagination) {\n const { sizePerPage } = this.state;\n const currLastPage = Math.ceil(this.store.getDataNum() / sizePerPage);\n let { currPage } = this.state;\n if (currPage > currLastPage) currPage = currLastPage;\n result = this.store.page(currPage, sizePerPage).get();\n this.setState({\n data: result,\n selectedRowKeys: this.store.getSelectedRowKeys(),\n currPage,\n reset: false\n });\n } else {\n result = this.store.get();\n this.setState({\n data: result,\n reset: false,\n selectedRowKeys: this.store.getSelectedRowKeys()\n });\n }\n if (this.props.options.afterDeleteRow) {\n this.props.options.afterDeleteRow(dropRowKeys);\n }\n }\n\n handleFilterData = filterObj => {\n const { onFilterChange } = this.props.options;\n if (onFilterChange) {\n const colInfos = this.store.getColInfos();\n onFilterChange(filterObj, colInfos);\n }\n\n this.setState({\n currPage: this.props.options.pageStartIndex || Const.PAGE_START_INDEX,\n reset: false\n });\n\n if (this.allowRemote(Const.REMOTE_FILTER)) {\n if (this.props.options.afterColumnFilter) {\n this.props.options.afterColumnFilter(filterObj, this.store.getDataIgnoringPagination());\n }\n return;\n }\n\n this.store.filter(filterObj);\n\n const sortList = this.store.getSortInfo();\n\n if (sortList.length > 0) {\n this.store.sort();\n }\n\n let result;\n\n if (this.props.pagination) {\n const { sizePerPage } = this.state;\n result = this.store.page(1, sizePerPage).get();\n } else {\n result = this.store.get();\n }\n if (this.props.options.afterColumnFilter) {\n this.props.options.afterColumnFilter(filterObj,\n this.store.getDataIgnoringPagination());\n }\n this.setState({\n data: result,\n reset: false\n });\n }\n\n handleExportCSV = () => {\n let result = {};\n\n let { csvFileName } = this.props;\n const { onExportToCSV } = this.props.options;\n if (onExportToCSV) {\n result = onExportToCSV();\n } else {\n result = this.store.getDataIgnoringPagination();\n }\n\n const keys = [];\n this.props.children.map(function(column) {\n if (column.props.export === true ||\n (typeof column.props.export === 'undefined' &&\n column.props.hidden === false)) {\n keys.push({\n field: column.props.dataField,\n format: column.props.csvFormat,\n header: column.props.csvHeader || column.props.dataField,\n row: Number(column.props.row) || 0,\n rowSpan: Number(column.props.rowSpan) || 1,\n colSpan: Number(column.props.colSpan) || 1\n });\n }\n });\n\n if (typeof csvFileName === 'function') {\n csvFileName = csvFileName();\n }\n\n exportCSV(result, keys, csvFileName);\n }\n\n handleSearch = searchText => {\n // Set search field if this function being called outside\n // but it's not necessary if calling fron inside.\n if (this.refs.toolbar) {\n this.refs.toolbar.setSearchInput(searchText);\n }\n const { onSearchChange } = this.props.options;\n if (onSearchChange) {\n const colInfos = this.store.getColInfos();\n onSearchChange(searchText, colInfos, this.props.multiColumnSearch);\n }\n\n this.setState({\n currPage: this.props.options.pageStartIndex || Const.PAGE_START_INDEX,\n reset: false\n });\n\n if (this.allowRemote(Const.REMOTE_SEARCH)) {\n if (this.props.options.afterSearch) {\n this.props.options.afterSearch(searchText, this.store.getDataIgnoringPagination());\n }\n return;\n }\n\n\n this.store.search(searchText);\n\n const sortList = this.store.getSortInfo();\n\n if (sortList.length > 0) {\n this.store.sort();\n }\n\n let result;\n if (this.props.pagination) {\n const { sizePerPage } = this.state;\n result = this.store.page(1, sizePerPage).get();\n } else {\n result = this.store.get();\n }\n if (this.props.options.afterSearch) {\n this.props.options.afterSearch(searchText,\n this.store.getDataIgnoringPagination());\n }\n this.setState({\n data: result,\n reset: false\n });\n }\n\n renderPagination() {\n if (this.props.pagination) {\n let dataSize;\n if (this.allowRemote(Const.REMOTE_PAGE)) {\n dataSize = this.props.fetchInfo.dataTotalSize;\n } else {\n dataSize = this.store.getDataNum();\n }\n const { options } = this.props;\n if (Math.ceil(dataSize / this.state.sizePerPage) <= 1 &&\n this.props.ignoreSinglePage) return null;\n return (\n
\n \n
\n );\n }\n return null;\n }\n\n renderToolBar() {\n const { selectRow, insertRow, deleteRow, search, children } = this.props;\n const enableShowOnlySelected = selectRow && selectRow.showOnlySelected;\n if (enableShowOnlySelected\n || insertRow\n || deleteRow\n || search\n || this.props.exportCSV) {\n let columns;\n if (Array.isArray(children)) {\n columns = children.map((column, r) => {\n const { props } = column;\n return {\n name: props.headerText || props.children,\n field: props.dataField,\n hiddenOnInsert: props.hiddenOnInsert,\n // when you want same auto generate value and not allow edit, example ID field\n autoValue: props.autoValue || false,\n // for create editor, no params for column.editable() indicate that editor for new row\n editable: props.editable && (typeof props.editable === 'function') ? props.editable() : props.editable,\n format: props.dataFormat ? function(value) {\n return props.dataFormat(value, null, props.formatExtraData, r).replace(/<.*?>/g, '');\n } : false\n };\n });\n } else {\n columns = [ {\n name: children.props.headerText || children.props.children,\n field: children.props.dataField,\n editable: children.props.editable,\n hiddenOnInsert: children.props.hiddenOnInsert\n } ];\n }\n return (\n
\n \n
\n );\n } else {\n return null;\n }\n }\n\n renderTableFilter(columns) {\n if (this.props.columnFilter) {\n return (\n \n );\n } else {\n return null;\n }\n }\n\n _scrollTop = () => {\n const { scrollTop } = this.props;\n if (scrollTop === Const.SCROLL_TOP) {\n this.refs.body.refs.container.scrollTop = 0;\n } else if (scrollTop === Const.SCROLL_BOTTOM) {\n this.refs.body.refs.container.scrollTop = this.refs.body.refs.container.scrollHeight;\n } else if (typeof scrollTop === 'number' && !isNaN(scrollTop)) {\n this.refs.body.refs.container.scrollTop = scrollTop;\n }\n }\n _scrollHeader = (e) => {\n this.refs.header.refs.container.scrollLeft = e.currentTarget.scrollLeft;\n }\n\n _adjustTable() {\n this._adjustHeight();\n if (!this.props.printable) {\n this._adjustHeaderWidth();\n }\n }\n\n _adjustHeaderWidth() {\n const header = this.refs.header.getHeaderColGrouop();\n const tbody = this.refs.body.refs.tbody;\n const bodyHeader = this.refs.body.getHeaderColGrouop();\n const firstRow = tbody.childNodes[0];\n const isScroll = tbody.parentNode.getBoundingClientRect().height >\n tbody.parentNode.parentNode.getBoundingClientRect().height;\n\n const scrollBarWidth = isScroll ? Util.getScrollBarWidth() : 0;\n if (firstRow && this.store.getDataNum()) {\n if (isScroll) {\n const cells = firstRow.childNodes;\n for (let i = 0; i < cells.length; i++) {\n const cell = cells[i];\n const computedStyle = window.getComputedStyle(cell);\n let width = parseFloat(computedStyle.width.replace('px', ''));\n if (this.isIE) {\n const paddingLeftWidth = parseFloat(computedStyle.paddingLeft.replace('px', ''));\n const paddingRightWidth = parseFloat(computedStyle.paddingRight.replace('px', ''));\n const borderRightWidth = parseFloat(computedStyle.borderRightWidth.replace('px', ''));\n const borderLeftWidth = parseFloat(computedStyle.borderLeftWidth.replace('px', ''));\n width = width + paddingLeftWidth + paddingRightWidth + borderRightWidth + borderLeftWidth;\n }\n const lastPadding = (cells.length - 1 === i ? scrollBarWidth : 0);\n if (width <= 0) {\n width = 120;\n cell.width = width + lastPadding + 'px';\n }\n const result = width + lastPadding + 'px';\n header[i].style.width = result;\n header[i].style.minWidth = result;\n if (cells.length - 1 === i) {\n bodyHeader[i].style.width = width + 'px';\n bodyHeader[i].style.minWidth = width + 'px';\n } else {\n bodyHeader[i].style.width = result;\n bodyHeader[i].style.minWidth = result;\n }\n }\n }\n } else {\n React.Children.forEach(this.props.children, (child, i) => {\n if (child.props.width) {\n header[i].style.width = `${child.props.width}px`;\n header[i].style.minWidth = `${child.props.width}px`;\n }\n });\n }\n }\n\n _adjustHeight() {\n const { height } = this.props;\n let { maxHeight } = this.props;\n if ((typeof height === 'number' && !isNaN(height)) || height.indexOf('%') === -1) {\n this.refs.body.refs.container.style.height =\n parseFloat(height, 10) - this.refs.header.refs.container.offsetHeight + 'px';\n }\n if (maxHeight) {\n maxHeight = typeof maxHeight === 'number' ?\n maxHeight :\n parseInt(maxHeight.replace('px', ''), 10);\n\n this.refs.body.refs.container.style.maxHeight =\n maxHeight - this.refs.header.refs.container.offsetHeight + 'px';\n }\n }\n\n _handleAfterAddingRow(newObj, atTheBeginning) {\n let result;\n if (this.props.pagination) {\n // if pagination is enabled and inserting row at the end,\n // change page to the last page\n // otherwise, change it to the first page\n const { sizePerPage } = this.state;\n\n if (atTheBeginning) {\n const firstPage = this.props.options.pageStartIndex || Const.PAGE_START_INDEX;\n result = this.store.page(firstPage, sizePerPage).get();\n this.setState({\n data: result,\n currPage: firstPage,\n reset: false\n });\n } else {\n const currLastPage = Math.ceil(this.store.getDataNum() / sizePerPage);\n result = this.store.page(currLastPage, sizePerPage).get();\n this.setState({\n data: result,\n currPage: currLastPage,\n reset: false\n });\n }\n } else {\n result = this.store.get();\n this.setState({\n data: result,\n reset: false\n });\n }\n\n if (this.props.options.afterInsertRow) {\n this.props.options.afterInsertRow(newObj);\n }\n }\n}\n\nBootstrapTable.propTypes = {\n keyField: PropTypes.string,\n height: PropTypes.oneOfType([ PropTypes.string, PropTypes.number ]),\n maxHeight: PropTypes.oneOfType([ PropTypes.string, PropTypes.number ]),\n data: PropTypes.oneOfType([ PropTypes.array, PropTypes.object ]),\n remote: PropTypes.oneOfType([ PropTypes.bool, PropTypes.func ]), // remote data, default is false\n scrollTop: PropTypes.oneOfType([ PropTypes.string, PropTypes.number ]),\n striped: PropTypes.bool,\n bordered: PropTypes.bool,\n hover: PropTypes.bool,\n condensed: PropTypes.bool,\n pagination: PropTypes.bool,\n printable: PropTypes.bool,\n searchPlaceholder: PropTypes.string,\n selectRow: PropTypes.shape({\n mode: PropTypes.oneOf([\n Const.ROW_SELECT_NONE,\n Const.ROW_SELECT_SINGLE,\n Const.ROW_SELECT_MULTI\n ]),\n customComponent: PropTypes.func,\n bgColor: PropTypes.string,\n selected: PropTypes.array,\n onSelect: PropTypes.func,\n onSelectAll: PropTypes.func,\n clickToSelect: PropTypes.bool,\n hideSelectColumn: PropTypes.bool,\n clickToSelectAndEditCell: PropTypes.bool,\n clickToExpand: PropTypes.bool,\n showOnlySelected: PropTypes.bool,\n unselectable: PropTypes.array,\n columnWidth: PropTypes.oneOfType([ PropTypes.number, PropTypes.string ])\n }),\n cellEdit: PropTypes.shape({\n mode: PropTypes.string,\n blurToSave: PropTypes.bool,\n beforeSaveCell: PropTypes.func,\n afterSaveCell: PropTypes.func,\n nonEditableRows: PropTypes.func\n }),\n insertRow: PropTypes.bool,\n deleteRow: PropTypes.bool,\n search: PropTypes.bool,\n columnFilter: PropTypes.bool,\n trClassName: PropTypes.any,\n tableStyle: PropTypes.object,\n containerStyle: PropTypes.object,\n headerStyle: PropTypes.object,\n bodyStyle: PropTypes.object,\n containerClass: PropTypes.string,\n tableContainerClass: PropTypes.string,\n headerContainerClass: PropTypes.string,\n bodyContainerClass: PropTypes.string,\n tableHeaderClass: PropTypes.string,\n tableBodyClass: PropTypes.string,\n options: PropTypes.shape({\n clearSearch: PropTypes.bool,\n sortName: PropTypes.oneOfType([ PropTypes.string, PropTypes.array ]),\n sortOrder: PropTypes.oneOfType([ PropTypes.string, PropTypes.array ]),\n defaultSortName: PropTypes.oneOfType([ PropTypes.string, PropTypes.array ]),\n defaultSortOrder: PropTypes.oneOfType([ PropTypes.string, PropTypes.array ]),\n sortIndicator: PropTypes.bool,\n afterTableComplete: PropTypes.func,\n afterDeleteRow: PropTypes.func,\n afterInsertRow: PropTypes.func,\n afterSearch: PropTypes.func,\n afterColumnFilter: PropTypes.func,\n onRowClick: PropTypes.func,\n onRowDoubleClick: PropTypes.func,\n page: PropTypes.number,\n pageStartIndex: PropTypes.number,\n paginationShowsTotal: PropTypes.oneOfType([ PropTypes.bool, PropTypes.func ]),\n sizePerPageList: PropTypes.array,\n sizePerPage: PropTypes.number,\n paginationSize: PropTypes.number,\n hideSizePerPage: PropTypes.bool,\n onSortChange: PropTypes.func,\n onPageChange: PropTypes.func,\n onSizePerPageList: PropTypes.func,\n onFilterChange: React.PropTypes.func,\n onSearchChange: React.PropTypes.func,\n onAddRow: React.PropTypes.func,\n onExportToCSV: React.PropTypes.func,\n onCellEdit: React.PropTypes.func,\n noDataText: PropTypes.oneOfType([ PropTypes.string, PropTypes.object ]),\n withoutNoDataText: React.PropTypes.bool,\n handleConfirmDeleteRow: PropTypes.func,\n prePage: PropTypes.string,\n nextPage: PropTypes.string,\n firstPage: PropTypes.string,\n lastPage: PropTypes.string,\n searchDelayTime: PropTypes.number,\n exportCSVText: PropTypes.string,\n insertText: PropTypes.string,\n deleteText: PropTypes.string,\n saveText: PropTypes.string,\n closeText: PropTypes.string,\n ignoreEditable: PropTypes.bool,\n defaultSearch: PropTypes.string,\n expandRowBgColor: PropTypes.string,\n expandBy: PropTypes.string,\n expanding: PropTypes.array,\n beforeShowError: PropTypes.func\n }),\n fetchInfo: PropTypes.shape({\n dataTotalSize: PropTypes.number\n }),\n exportCSV: PropTypes.bool,\n csvFileName: PropTypes.oneOfType([ PropTypes.string, PropTypes.func ]),\n ignoreSinglePage: PropTypes.bool,\n expandableRow: PropTypes.func,\n expandComponent: PropTypes.func\n};\nBootstrapTable.defaultProps = {\n scrollTop: undefined,\n expandComponent: undefined,\n expandableRow: undefined,\n height: '100%',\n maxHeight: undefined,\n striped: false,\n bordered: true,\n hover: false,\n condensed: false,\n pagination: false,\n printable: false,\n searchPlaceholder: undefined,\n selectRow: {\n mode: Const.ROW_SELECT_NONE,\n bgColor: Const.ROW_SELECT_BG_COLOR,\n selected: [],\n onSelect: undefined,\n onSelectAll: undefined,\n clickToSelect: false,\n hideSelectColumn: false,\n clickToSelectAndEditCell: false,\n clickToExpand: false,\n showOnlySelected: false,\n unselectable: [],\n customComponent: undefined\n },\n cellEdit: {\n mode: Const.CELL_EDIT_NONE,\n blurToSave: false,\n beforeSaveCell: undefined,\n afterSaveCell: undefined,\n nonEditableRows: undefined\n },\n insertRow: false,\n deleteRow: false,\n search: false,\n multiColumnSearch: false,\n multiColumnSort: 1,\n columnFilter: false,\n trClassName: '',\n tableStyle: undefined,\n containerStyle: undefined,\n headerStyle: undefined,\n bodyStyle: undefined,\n containerClass: null,\n tableContainerClass: null,\n headerContainerClass: null,\n bodyContainerClass: null,\n tableHeaderClass: null,\n tableBodyClass: null,\n options: {\n clearSearch: false,\n sortName: undefined,\n sortOrder: undefined,\n defaultSortName: undefined,\n defaultSortOrder: undefined,\n sortIndicator: true,\n afterTableComplete: undefined,\n afterDeleteRow: undefined,\n afterInsertRow: undefined,\n afterSearch: undefined,\n afterColumnFilter: undefined,\n onRowClick: undefined,\n onRowDoubleClick: undefined,\n onMouseLeave: undefined,\n onMouseEnter: undefined,\n onRowMouseOut: undefined,\n onRowMouseOver: undefined,\n page: undefined,\n paginationShowsTotal: false,\n sizePerPageList: Const.SIZE_PER_PAGE_LIST,\n sizePerPage: undefined,\n paginationSize: Const.PAGINATION_SIZE,\n hideSizePerPage: false,\n onSizePerPageList: undefined,\n noDataText: undefined,\n withoutNoDataText: false,\n handleConfirmDeleteRow: undefined,\n prePage: Const.PRE_PAGE,\n nextPage: Const.NEXT_PAGE,\n firstPage: Const.FIRST_PAGE,\n lastPage: Const.LAST_PAGE,\n pageStartIndex: undefined,\n searchDelayTime: undefined,\n exportCSVText: Const.EXPORT_CSV_TEXT,\n insertText: Const.INSERT_BTN_TEXT,\n deleteText: Const.DELETE_BTN_TEXT,\n saveText: Const.SAVE_BTN_TEXT,\n closeText: Const.CLOSE_BTN_TEXT,\n ignoreEditable: false,\n defaultSearch: '',\n expandRowBgColor: undefined,\n expandBy: Const.EXPAND_BY_ROW,\n expanding: [],\n beforeShowError: undefined\n },\n fetchInfo: {\n dataTotalSize: 0\n },\n exportCSV: false,\n csvFileName: 'spreadsheet.csv',\n ignoreSinglePage: false\n};\n\nexport default BootstrapTable;\n\n\n\n// WEBPACK FOOTER //\n// src/BootstrapTable.js","module.exports = __WEBPACK_EXTERNAL_MODULE_2__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}\n// module id = 2\n// module chunks = 0","/*!\n Copyright (c) 2016 Jed Watson.\n Licensed under the MIT License (MIT), see\n http://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg)) {\n\t\t\t\tclasses.push(classNames.apply(null, arg));\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/classnames/index.js\n// module id = 3\n// module chunks = 0","const CONST_VAR = {\n SORT_DESC: 'desc',\n SORT_ASC: 'asc',\n SIZE_PER_PAGE: 10,\n NEXT_PAGE: '>',\n LAST_PAGE: '>>',\n PRE_PAGE: '<',\n FIRST_PAGE: '<<',\n PAGE_START_INDEX: 1,\n ROW_SELECT_BG_COLOR: '',\n ROW_SELECT_NONE: 'none',\n ROW_SELECT_SINGLE: 'radio',\n ROW_SELECT_MULTI: 'checkbox',\n CELL_EDIT_NONE: 'none',\n CELL_EDIT_CLICK: 'click',\n CELL_EDIT_DBCLICK: 'dbclick',\n SIZE_PER_PAGE_LIST: [ 10, 25, 30, 50 ],\n PAGINATION_SIZE: 5,\n NO_DATA_TEXT: 'There is no data to display',\n SHOW_ONLY_SELECT: 'Show Selected Only',\n SHOW_ALL: 'Show All',\n EXPORT_CSV_TEXT: 'Export to CSV',\n INSERT_BTN_TEXT: 'New',\n DELETE_BTN_TEXT: 'Delete',\n SAVE_BTN_TEXT: 'Save',\n CLOSE_BTN_TEXT: 'Close',\n FILTER_DELAY: 500,\n SCROLL_TOP: 'Top',\n SCROLL_BOTTOM: 'Bottom',\n FILTER_TYPE: {\n TEXT: 'TextFilter',\n REGEX: 'RegexFilter',\n SELECT: 'SelectFilter',\n NUMBER: 'NumberFilter',\n DATE: 'DateFilter',\n CUSTOM: 'CustomFilter'\n },\n FILTER_COND_EQ: 'eq',\n FILTER_COND_LIKE: 'like',\n EXPAND_BY_ROW: 'row',\n EXPAND_BY_COL: 'column',\n CANCEL_TOASTR: 'Pressed ESC can cancel',\n REMOTE_SORT: 'sort',\n REMOTE_PAGE: 'pagination',\n REMOTE_CELL_EDIT: 'cellEdit',\n REMOTE_INSERT_ROW: 'insertRow',\n REMOTE_DROP_ROW: 'dropRow',\n REMOTE_FILTER: 'filter',\n REMOTE_SEARCH: 'search',\n REMOTE_EXPORT_CSV: 'exportCSV'\n};\n\nCONST_VAR.REMOTE = {};\nCONST_VAR.REMOTE[CONST_VAR.REMOTE_SORT] = false;\nCONST_VAR.REMOTE[CONST_VAR.REMOTE_PAGE] = false;\nCONST_VAR.REMOTE[CONST_VAR.REMOTE_CELL_EDIT] = false;\nCONST_VAR.REMOTE[CONST_VAR.REMOTE_INSERT_ROW] = false;\nCONST_VAR.REMOTE[CONST_VAR.REMOTE_DROP_ROW] = false;\nCONST_VAR.REMOTE[CONST_VAR.REMOTE_FILTER] = false;\nCONST_VAR.REMOTE[CONST_VAR.REMOTE_SEARCH] = false;\nCONST_VAR.REMOTE[CONST_VAR.REMOTE_EXPORT_CSV] = false;\n\nexport default CONST_VAR;\n\n\n\n// WEBPACK FOOTER //\n// src/Const.js","import React, { Component, PropTypes } from 'react';\nimport ReactDOM from 'react-dom';\nimport Const from './Const';\nimport classSet from 'classnames';\nimport SelectRowHeaderColumn from './SelectRowHeaderColumn';\n\nclass Checkbox extends Component {\n componentDidMount() { this.update(this.props.checked); }\n componentWillReceiveProps(props) { this.update(props.checked); }\n update(checked) {\n ReactDOM.findDOMNode(this).indeterminate = checked === 'indeterminate';\n }\n render() {\n return (\n \n );\n }\n}\n\nfunction getSortOrder(sortList, field, enableSort) {\n if (!enableSort) return undefined;\n const result = sortList.filter(sortObj => {\n return sortObj.sortField === field;\n });\n if (result.length > 0) {\n return result[0].order;\n } else {\n return undefined;\n }\n}\n\nclass TableHeader extends Component {\n\n render() {\n const containerClasses = classSet(\n 'react-bs-container-header',\n 'table-header-wrapper',\n this.props.headerContainerClass);\n const tableClasses = classSet('table', 'table-hover', {\n 'table-bordered': this.props.bordered,\n 'table-condensed': this.props.condensed\n }, this.props.tableHeaderClass);\n\n const rowCount = Math.max(...React.Children.map(this.props.children, elm =>\n elm.props.row ? Number(elm.props.row) : 0\n ));\n\n const rows = [];\n let rowKey = 0;\n\n if (!this.props.hideSelectColumn) {\n rows[0] = [ this.renderSelectRowHeader(rowCount + 1, rowKey++) ];\n }\n\n const { sortIndicator, sortList, onSort, reset } = this.props;\n\n React.Children.forEach(this.props.children, (elm) => {\n const { dataField, dataSort } = elm.props;\n const sort = getSortOrder(sortList, dataField, dataSort);\n const rowIndex = elm.props.row ? Number(elm.props.row) : 0;\n const rowSpan = elm.props.rowSpan ? Number(elm.props.rowSpan) : 1;\n if (rows[rowIndex] === undefined) {\n rows[rowIndex] = [];\n }\n if ((rowSpan + rowIndex) === (rowCount + 1)) {\n rows[rowIndex].push(React.cloneElement(\n elm, { reset, key: rowKey++, onSort, sort, sortIndicator, isOnlyHead: false }\n ));\n } else {\n rows[rowIndex].push(React.cloneElement(\n elm, { key: rowKey++, isOnlyHead: true }\n ));\n }\n });\n\n const trs = rows.map((row, indexRow)=>{\n return (\n \n { row }\n \n );\n });\n\n return (\n
\n \n { React.cloneElement(this.props.colGroups, { ref: 'headerGrp' }) }\n \n { trs }\n \n
\n
\n );\n }\n\n getHeaderColGrouop = () => {\n return this.refs.headerGrp.childNodes;\n }\n\n renderSelectRowHeader(rowCount, rowKey) {\n if (this.props.customComponent) {\n const CustomComponent = this.props.customComponent;\n return (\n \n \n \n );\n } else if (this.props.rowSelectType === Const.ROW_SELECT_SINGLE) {\n return ();\n } else if (this.props.rowSelectType === Const.ROW_SELECT_MULTI) {\n return (\n \n \n \n );\n } else {\n return null;\n }\n }\n}\nTableHeader.propTypes = {\n headerContainerClass: PropTypes.string,\n tableHeaderClass: PropTypes.string,\n style: PropTypes.object,\n rowSelectType: PropTypes.string,\n onSort: PropTypes.func,\n onSelectAllRow: PropTypes.func,\n sortList: PropTypes.array,\n hideSelectColumn: PropTypes.bool,\n bordered: PropTypes.bool,\n condensed: PropTypes.bool,\n isFiltered: PropTypes.bool,\n isSelectAll: PropTypes.oneOf([ true, 'indeterminate', false ]),\n sortIndicator: PropTypes.bool,\n customComponent: PropTypes.func,\n colGroups: PropTypes.element,\n reset: PropTypes.bool\n};\n\nexport default TableHeader;\n\n\n\n// WEBPACK FOOTER //\n// src/TableHeader.js","module.exports = __WEBPACK_EXTERNAL_MODULE_6__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"root\":\"ReactDOM\",\"commonjs2\":\"react-dom\",\"commonjs\":\"react-dom\",\"amd\":\"react-dom\"}\n// module id = 6\n// module chunks = 0","import React, { Component, PropTypes } from 'react';\n\nclass SelectRowHeaderColumn extends Component {\n\n render() {\n return (\n \n { this.props.children }\n \n );\n }\n}\nSelectRowHeaderColumn.propTypes = {\n children: PropTypes.node,\n rowCount: PropTypes.number\n};\nexport default SelectRowHeaderColumn;\n\n\n\n// WEBPACK FOOTER //\n// src/SelectRowHeaderColumn.js","import React, { Component, PropTypes } from 'react';\nimport Utils from './util';\nimport Const from './Const';\nimport TableRow from './TableRow';\nimport TableColumn from './TableColumn';\nimport TableEditColumn from './TableEditColumn';\nimport classSet from 'classnames';\nimport ExpandComponent from './ExpandComponent';\n\nconst isFun = function(obj) {\n return obj && (typeof obj === 'function');\n};\n\nclass TableBody extends Component {\n constructor(props) {\n super(props);\n this.state = {\n currEditCell: null\n };\n }\n\n render() {\n const { cellEdit, beforeShowError } = this.props;\n const tableClasses = classSet('table', {\n 'table-striped': this.props.striped,\n 'table-bordered': this.props.bordered,\n 'table-hover': this.props.hover,\n 'table-condensed': this.props.condensed\n }, this.props.tableBodyClass);\n\n const noneditableRows = (cellEdit.nonEditableRows && cellEdit.nonEditableRows()) || [];\n const unselectable = this.props.selectRow.unselectable || [];\n const isSelectRowDefined = this._isSelectRowDefined();\n const tableHeader = Utils.renderColGroup(this.props.columns, this.props.selectRow, 'header');\n const inputType = this.props.selectRow.mode === Const.ROW_SELECT_SINGLE ? 'radio' : 'checkbox';\n const CustomComponent = this.props.selectRow.customComponent;\n let expandColSpan = this.props.columns.filter(col => !col.hidden).length;\n if (isSelectRowDefined && !this.props.selectRow.hideSelectColumn) {\n expandColSpan += 1;\n }\n\n const tableRows = this.props.data.map(function(data, r) {\n const tableColumns = this.props.columns.map(function(column, i) {\n const fieldValue = data[column.name];\n if (column.name !== this.props.keyField && // Key field can't be edit\n column.editable && // column is editable? default is true, user can set it false\n this.state.currEditCell !== null &&\n this.state.currEditCell.rid === r &&\n this.state.currEditCell.cid === i &&\n noneditableRows.indexOf(data[this.props.keyField]) === -1) {\n let editable = column.editable;\n const format = column.format ? function(value) {\n return column.format(value, data, column.formatExtraData, r).replace(/<.*?>/g, '');\n } : false;\n if (isFun(column.editable)) {\n editable = column.editable(fieldValue, data, r, i);\n }\n\n return (\n \n );\n } else {\n // add by bluespring for className customize\n let columnChild = fieldValue && fieldValue.toString();\n let columnTitle = null;\n let tdClassName = column.className;\n if (isFun(column.className)) {\n tdClassName = column.className(fieldValue, data, r, i);\n }\n\n if (typeof column.format !== 'undefined') {\n const formattedValue = column.format(fieldValue, data, column.formatExtraData, r);\n if (!React.isValidElement(formattedValue)) {\n columnChild = (\n
\n );\n } else {\n columnChild = formattedValue;\n columnTitle = column.columnTitle && formattedValue ? formattedValue.toString() : null;\n }\n } else {\n columnTitle = column.columnTitle && fieldValue ? fieldValue.toString() : null;\n }\n return (\n \n );\n }\n }, this);\n const key = data[this.props.keyField];\n const disable = unselectable.indexOf(key) !== -1;\n const selected = this.props.selectedRowKeys.indexOf(key) !== -1;\n const selectRowColumn = isSelectRowDefined && !this.props.selectRow.hideSelectColumn ?\n this.renderSelectRowColumn(selected, inputType, disable, CustomComponent, r, data) : null;\n // add by bluespring for className customize\n let trClassName = this.props.trClassName;\n if (isFun(this.props.trClassName)) {\n trClassName = this.props.trClassName(data, r);\n }\n const result = [ \n { selectRowColumn }\n { tableColumns }\n ];\n\n if (this.props.expandableRow && this.props.expandableRow(data)) {\n result.push(\n