From 95403f9248e90892dc5e00a46ae8a908d21d26a7 Mon Sep 17 00:00:00 2001 From: AllenFang Date: Sun, 16 Jul 2017 17:30:14 +0800 Subject: [PATCH] prod --- dist/react-bootstrap-table.js | 16943 +++++++++++----------------- dist/react-bootstrap-table.js.map | 6 +- dist/react-bootstrap-table.min.js | 44 +- 3 files changed, 6589 insertions(+), 10404 deletions(-) diff --git a/dist/react-bootstrap-table.js b/dist/react-bootstrap-table.js index 9201c0ef1..300c423a8 100644 --- a/dist/react-bootstrap-table.js +++ b/dist/react-bootstrap-table.js @@ -7,7 +7,7 @@ exports["ReactBootstrapTable"] = factory(require("react"), require("react-dom")); else root["ReactBootstrapTable"] = factory(root["React"], root["ReactDOM"]); -})(this, function(__WEBPACK_EXTERNAL_MODULE_2__, __WEBPACK_EXTERNAL_MODULE_14__) { +})(this, function(__WEBPACK_EXTERNAL_MODULE_2__, __WEBPACK_EXTERNAL_MODULE_15__) { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; @@ -52,7 +52,7 @@ return /******/ (function(modules) { // webpackBootstrap /************************************************************************/ /******/ ([ /* 0 */ -/***/ function(module, exports, __webpack_require__) { +/***/ (function(module, exports, __webpack_require__) { 'use strict'; @@ -65,51 +65,51 @@ return /******/ (function(modules) { // webpackBootstrap var _BootstrapTable2 = _interopRequireDefault(_BootstrapTable); - var _TableHeaderColumn = __webpack_require__(64); + var _TableHeaderColumn = __webpack_require__(71); var _TableHeaderColumn2 = _interopRequireDefault(_TableHeaderColumn); - var _InsertModalHeader = __webpack_require__(47); + var _InsertModalHeader = __webpack_require__(54); var _InsertModalHeader2 = _interopRequireDefault(_InsertModalHeader); - var _InsertModalBody = __webpack_require__(49); + var _InsertModalBody = __webpack_require__(56); var _InsertModalBody2 = _interopRequireDefault(_InsertModalBody); - var _InsertModalFooter = __webpack_require__(48); + var _InsertModalFooter = __webpack_require__(55); var _InsertModalFooter2 = _interopRequireDefault(_InsertModalFooter); - var _InsertButton = __webpack_require__(50); + var _InsertButton = __webpack_require__(57); var _InsertButton2 = _interopRequireDefault(_InsertButton); - var _DeleteButton = __webpack_require__(51); + var _DeleteButton = __webpack_require__(58); var _DeleteButton2 = _interopRequireDefault(_DeleteButton); - var _ExportCSVButton = __webpack_require__(52); + var _ExportCSVButton = __webpack_require__(59); var _ExportCSVButton2 = _interopRequireDefault(_ExportCSVButton); - var _ShowSelectedOnlyButton = __webpack_require__(53); + var _ShowSelectedOnlyButton = __webpack_require__(60); var _ShowSelectedOnlyButton2 = _interopRequireDefault(_ShowSelectedOnlyButton); - var _ClearSearchButton = __webpack_require__(55); + var _ClearSearchButton = __webpack_require__(62); var _ClearSearchButton2 = _interopRequireDefault(_ClearSearchButton); - var _SearchField = __webpack_require__(54); + var _SearchField = __webpack_require__(61); var _SearchField2 = _interopRequireDefault(_SearchField); - var _ButtonGroup = __webpack_require__(70); + var _ButtonGroup = __webpack_require__(77); var _ButtonGroup2 = _interopRequireDefault(_ButtonGroup); - var _SizePerPageDropDown = __webpack_require__(34); + var _SizePerPageDropDown = __webpack_require__(35); var _SizePerPageDropDown2 = _interopRequireDefault(_SizePerPageDropDown); @@ -153,9 +153,9 @@ return /******/ (function(modules) { // webpackBootstrap ; -/***/ }, +/***/ }), /* 1 */ -/***/ function(module, exports, __webpack_require__) { +/***/ (function(module, exports, __webpack_require__) { 'use strict'; @@ -177,47 +177,47 @@ return /******/ (function(modules) { // webpackBootstrap var _propTypes2 = _interopRequireDefault(_propTypes); - var _classnames = __webpack_require__(11); + var _classnames = __webpack_require__(12); var _classnames2 = _interopRequireDefault(_classnames); - var _Const = __webpack_require__(12); + var _Const = __webpack_require__(13); var _Const2 = _interopRequireDefault(_Const); - var _TableHeader = __webpack_require__(13); + var _TableHeader = __webpack_require__(14); var _TableHeader2 = _interopRequireDefault(_TableHeader); - var _TableBody = __webpack_require__(17); + var _TableBody = __webpack_require__(18); var _TableBody2 = _interopRequireDefault(_TableBody); - var _PaginationList = __webpack_require__(32); + var _PaginationList = __webpack_require__(33); var _PaginationList2 = _interopRequireDefault(_PaginationList); - var _ToolBar = __webpack_require__(35); + var _ToolBar = __webpack_require__(36); var _ToolBar2 = _interopRequireDefault(_ToolBar); - var _TableFilter = __webpack_require__(56); + var _TableFilter = __webpack_require__(63); var _TableFilter2 = _interopRequireDefault(_TableFilter); - var _TableDataStore = __webpack_require__(57); + var _TableDataStore = __webpack_require__(64); - var _util = __webpack_require__(18); + var _util = __webpack_require__(19); var _util2 = _interopRequireDefault(_util); - var _csv_export_util = __webpack_require__(58); + var _csv_export_util = __webpack_require__(65); var _csv_export_util2 = _interopRequireDefault(_csv_export_util); - var _Filter = __webpack_require__(62); + var _Filter = __webpack_require__(69); - var _reactSAlert = __webpack_require__(24); + var _reactSAlert = __webpack_require__(25); var _reactSAlert2 = _interopRequireDefault(_reactSAlert); @@ -536,8 +536,6 @@ return /******/ (function(modules) { // webpackBootstrap }, { key: 'componentWillReceiveProps', value: function componentWillReceiveProps(nextProps) { - var _this4 = this; - this.initTable(nextProps); var options = nextProps.options, selectRow = nextProps.selectRow; @@ -551,93 +549,85 @@ return /******/ (function(modules) { // webpackBootstrap this.store.setData(nextProps.data.slice()); if (!replace) { - (function () { - // from #481 - var page = _this4.state.currPage; - if (_this4.props.options.page !== options.page) { - page = options.page; + // from #481 + var page = this.state.currPage; + if (this.props.options.page !== options.page) { + page = options.page; + } + // from #481 + var sizePerPage = this.state.sizePerPage; + if (this.props.options.sizePerPage !== options.sizePerPage) { + sizePerPage = options.sizePerPage; + } + + if (this.isRemoteDataSource()) { + var data = nextProps.data.slice(); + if (nextProps.pagination && !this.allowRemote(_Const2.default.REMOTE_PAGE)) { + data = this.store.page(page, sizePerPage).get(); } - // from #481 - var sizePerPage = _this4.state.sizePerPage; - if (_this4.props.options.sizePerPage !== options.sizePerPage) { - sizePerPage = options.sizePerPage; + this.setState(function () { + return { + data: data, + currPage: page, + sizePerPage: sizePerPage, + reset: false + }; + }); + } else { + // #125 + // remove !options.page for #709 + if (page > Math.ceil(nextProps.data.length / sizePerPage)) { + page = 1; } - - if (_this4.isRemoteDataSource()) { - (function () { - var data = nextProps.data.slice(); - if (nextProps.pagination && !_this4.allowRemote(_Const2.default.REMOTE_PAGE)) { - data = _this4.store.page(page, sizePerPage).get(); - } - _this4.setState(function () { - return { - data: data, - currPage: page, - sizePerPage: sizePerPage, - reset: false - }; - }); - })(); - } else { - (function () { - // #125 - // remove !options.page for #709 - if (page > Math.ceil(nextProps.data.length / sizePerPage)) { - page = 1; - } - var sortList = _this4.store.getSortInfo(); - var sortField = options.sortName; - var sortOrder = options.sortOrder; - if (sortField && sortOrder) { - _this4.store.setSortInfo(sortOrder, sortField); - _this4.store.sort(); - } else if (sortList.length > 0) { - _this4.store.sort(); - } - var data = _this4.store.page(page, sizePerPage).get(); - _this4.setState(function () { - return { - data: data, - currPage: page, - sizePerPage: sizePerPage, - reset: false - }; - }); - - if (_this4.store.isSearching && options.afterSearch) { - options.afterSearch(_this4.store.searchText, _this4.store.getDataIgnoringPagination()); - } - - if (_this4.store.isFiltering && options.afterColumnFilter) { - options.afterColumnFilter(_this4.store.filterObj, _this4.store.getDataIgnoringPagination()); - } - })(); + var sortList = this.store.getSortInfo(); + var sortField = options.sortName; + var sortOrder = options.sortOrder; + if (sortField && sortOrder) { + this.store.setSortInfo(sortOrder, sortField); + this.store.sort(); + } else if (sortList.length > 0) { + this.store.sort(); } + var _data = this.store.page(page, sizePerPage).get(); + this.setState(function () { + return { + data: _data, + currPage: page, + sizePerPage: sizePerPage, + reset: false + }; + }); - // If setting the expanded rows is being handled externally - // then overwrite the current expanded rows. - if (_this4.props.options.expanding !== options.expanding) { - _this4.setState(function () { - return { - expanding: options.expanding || [] - }; - }); + if (this.store.isSearching && options.afterSearch) { + options.afterSearch(this.store.searchText, this.store.getDataIgnoringPagination()); } - if (selectRow && selectRow.selected) { - (function () { - // set default select rows to store. - var copy = selectRow.selected.slice(); - _this4.store.setSelectedRowKey(copy); - _this4.setState(function () { - return { - selectedRowKeys: copy, - reset: false - }; - }); - })(); + if (this.store.isFiltering && options.afterColumnFilter) { + options.afterColumnFilter(this.store.filterObj, this.store.getDataIgnoringPagination()); } - })(); + } + + // If setting the expanded rows is being handled externally + // then overwrite the current expanded rows. + if (this.props.options.expanding !== options.expanding) { + this.setState(function () { + return { + expanding: options.expanding || [] + }; + }); + } + + if (selectRow && selectRow.selected) { + // set default select rows to store. + var copy = selectRow.selected.slice(); + this.store.setSelectedRowKey(copy); + this.setState(function () { + return { + selectedRowKeys: copy, + reset: false + }; + }); + } } else { this.reset(); } @@ -906,7 +896,7 @@ return /******/ (function(modules) { // webpackBootstrap }, { key: '__handleExpandRow__REACT_HOT_LOADER__', value: function __handleExpandRow__REACT_HOT_LOADER__(expanding, rowKey, isRowExpanding) { - var _this5 = this; + var _this4 = this; var onExpand = this.props.options.onExpand; @@ -916,7 +906,7 @@ return /******/ (function(modules) { // webpackBootstrap this.setState(function () { return { expanding: expanding, reset: false }; }, function () { - _this5._adjustHeaderWidth(); + _this4._adjustHeaderWidth(); }); } }, { @@ -1139,14 +1129,12 @@ return /******/ (function(modules) { // webpackBootstrap return unselectable.indexOf(r) > -1; }); } else if (onlyUnselectVisible) { - (function () { - var currentRowKeys = rows.map(function (r) { - return r[keyField]; - }); - selectedRowKeys = selectedRowKeys.filter(function (k) { - return currentRowKeys.indexOf(k) === -1; - }); - })(); + var _currentRowKeys = rows.map(function (r) { + return r[keyField]; + }); + selectedRowKeys = selectedRowKeys.filter(function (k) { + return _currentRowKeys.indexOf(k) === -1; + }); } } @@ -1213,7 +1201,7 @@ return /******/ (function(modules) { // webpackBootstrap }, { key: '__handleEditCell__REACT_HOT_LOADER__', value: function __handleEditCell__REACT_HOT_LOADER__(newVal, rowIndex, colIndex) { - var _this6 = this; + var _this5 = this; var beforeSaveCell = this.props.cellEdit.beforeSaveCell; @@ -1221,9 +1209,9 @@ return /******/ (function(modules) { // webpackBootstrap var fieldName = columns[colIndex].name; var invalid = function invalid() { - _this6.setState(function () { + _this5.setState(function () { return { - data: _this6.store.get(), + data: _this5.store.get(), reset: false }; }); @@ -1232,9 +1220,9 @@ return /******/ (function(modules) { // webpackBootstrap if (beforeSaveCell) { var beforeSaveCellCB = function beforeSaveCellCB(result) { - _this6.refs.body.cancelEditCell(); + _this5.refs.body.cancelEditCell(); if (result || result === undefined) { - _this6.editCell(newVal, rowIndex, colIndex); + _this5.editCell(newVal, rowIndex, colIndex); } else { invalid(); } @@ -1293,7 +1281,7 @@ return /******/ (function(modules) { // webpackBootstrap }, { key: '__handleAddRow__REACT_HOT_LOADER__', value: function __handleAddRow__REACT_HOT_LOADER__(newObj) { - var _this7 = this; + var _this6 = this; var isAsync = false; var onAddRow = this.props.options.onAddRow; @@ -1301,7 +1289,7 @@ return /******/ (function(modules) { // webpackBootstrap var afterHandleAddRow = function afterHandleAddRow(errMsg) { if (isAsync) { - _this7.refs.toolbar.afterHandleSaveBtnClick(errMsg); + _this6.refs.toolbar.afterHandleSaveBtnClick(errMsg); } else { return errMsg; } @@ -1309,19 +1297,19 @@ return /******/ (function(modules) { // webpackBootstrap var afterAddRowCB = function afterAddRowCB(errMsg) { if (typeof errMsg !== 'undefined' && errMsg !== '') return afterHandleAddRow(errMsg); - if (_this7.allowRemote(_Const2.default.REMOTE_INSERT_ROW)) { - if (_this7.props.options.afterInsertRow) { - _this7.props.options.afterInsertRow(newObj); + if (_this6.allowRemote(_Const2.default.REMOTE_INSERT_ROW)) { + if (_this6.props.options.afterInsertRow) { + _this6.props.options.afterInsertRow(newObj); } return afterHandleAddRow(); } try { - _this7.store.add(newObj); + _this6.store.add(newObj); } catch (e) { return afterHandleAddRow(e.message); } - _this7._handleAfterAddingRow(newObj, false); + _this6._handleAfterAddingRow(newObj, false); return afterHandleAddRow(); }; @@ -1375,14 +1363,14 @@ return /******/ (function(modules) { // webpackBootstrap }, { key: '__handleDropRow__REACT_HOT_LOADER__', value: function __handleDropRow__REACT_HOT_LOADER__(rowKeys) { - var _this8 = this; + var _this7 = this; var dropRowKeys = rowKeys ? rowKeys : this.store.getSelectedRowKeys(); // add confirm before the delete action if that option is set. if (dropRowKeys && dropRowKeys.length > 0) { if (this.props.options.handleConfirmDeleteRow) { this.props.options.handleConfirmDeleteRow(function () { - _this8.deleteRow(dropRowKeys); + _this7.deleteRow(dropRowKeys); }, dropRowKeys); } else if (confirm('Are you sure you want to delete?')) { this.deleteRow(dropRowKeys); @@ -1392,7 +1380,7 @@ return /******/ (function(modules) { // webpackBootstrap }, { key: 'deleteRow', value: function deleteRow(dropRowKeys) { - var _this9 = this; + var _this8 = this; var dropRow = this.store.getRowByKey(dropRowKeys); var _props$options2 = this.props.options, @@ -1414,30 +1402,28 @@ return /******/ (function(modules) { // webpackBootstrap this.store.remove(dropRowKeys); // remove selected Row var result = void 0; if (this.props.pagination) { - (function () { - var sizePerPage = _this9.state.sizePerPage; + var sizePerPage = this.state.sizePerPage; - var currLastPage = Math.ceil(_this9.store.getDataNum() / sizePerPage); - var currPage = _this9.state.currPage; + var currLastPage = Math.ceil(this.store.getDataNum() / sizePerPage); + var currPage = this.state.currPage; - if (currPage > currLastPage) currPage = currLastPage; - result = _this9.store.page(_util2.default.getNormalizedPage(currPage), sizePerPage).get(); - _this9.setState(function () { - return { - data: result, - selectedRowKeys: _this9.store.getSelectedRowKeys(), - currPage: currPage, - reset: false - }; - }); - })(); + if (currPage > currLastPage) currPage = currLastPage; + result = this.store.page(_util2.default.getNormalizedPage(currPage), sizePerPage).get(); + this.setState(function () { + return { + data: result, + selectedRowKeys: _this8.store.getSelectedRowKeys(), + currPage: currPage, + reset: false + }; + }); } else { result = this.store.get(); this.setState(function () { return { data: result, reset: false, - selectedRowKeys: _this9.store.getSelectedRowKeys() + selectedRowKeys: _this8.store.getSelectedRowKeys() }; }); } @@ -1855,8 +1841,6 @@ return /******/ (function(modules) { // webpackBootstrap }, { key: '_handleAfterAddingRow', value: function _handleAfterAddingRow(newObj, atTheBeginning) { - var _this10 = this; - var result = void 0; if (this.props.pagination) { // if pagination is enabled and inserting row at the end, @@ -1866,30 +1850,26 @@ return /******/ (function(modules) { // webpackBootstrap if (atTheBeginning) { - (function () { - var pageStartIndex = _this10.props.options.pageStartIndex; - - result = _this10.store.page(_util2.default.getNormalizedPage(pageStartIndex), sizePerPage).get(); - _this10.setState(function () { - return { - data: result, - currPage: _util2.default.getFirstPage(pageStartIndex), - reset: false - }; - }); - })(); + var pageStartIndex = this.props.options.pageStartIndex; + + result = this.store.page(_util2.default.getNormalizedPage(pageStartIndex), sizePerPage).get(); + this.setState(function () { + return { + data: result, + currPage: _util2.default.getFirstPage(pageStartIndex), + reset: false + }; + }); } else { - (function () { - var currLastPage = Math.ceil(_this10.store.getDataNum() / sizePerPage); - result = _this10.store.page(currLastPage, sizePerPage).get(); - _this10.setState(function () { - return { - data: result, - currPage: currLastPage, - reset: false - }; - }); - })(); + var currLastPage = Math.ceil(this.store.getDataNum() / sizePerPage); + result = this.store.page(currLastPage, sizePerPage).get(); + this.setState(function () { + return { + data: result, + currPage: currLastPage, + reset: false + }; + }); } } else { result = this.store.get(); @@ -1911,7 +1891,6 @@ return /******/ (function(modules) { // webpackBootstrap }(_react.Component); BootstrapTable.propTypes = { -<<<<<<< HEAD keyField: _propTypes2.default.string, height: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]), maxHeight: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]), @@ -1925,6 +1904,7 @@ return /******/ (function(modules) { // webpackBootstrap condensed: _propTypes2.default.bool, pagination: _propTypes2.default.bool, printable: _propTypes2.default.bool, + withoutTabIndex: _propTypes2.default.bool, keyBoardNav: _propTypes2.default.oneOfType([_propTypes2.default.bool, _propTypes2.default.object]), searchPlaceholder: _propTypes2.default.string, selectRow: _propTypes2.default.shape({ @@ -1942,39 +1922,6 @@ return /******/ (function(modules) { // webpackBootstrap unselectable: _propTypes2.default.array, columnWidth: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.string]), onlyUnselectVisible: _propTypes2.default.bool -======= - keyField: _react.PropTypes.string, - height: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.number]), - maxHeight: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.number]), - data: _react.PropTypes.oneOfType([_react.PropTypes.array, _react.PropTypes.object]), - remote: _react.PropTypes.oneOfType([_react.PropTypes.bool, _react.PropTypes.func]), // remote data, default is false - replace: _react.PropTypes.oneOfType([_react.PropTypes.bool, _react.PropTypes.func]), - scrollTop: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.number]), - striped: _react.PropTypes.bool, - bordered: _react.PropTypes.bool, - hover: _react.PropTypes.bool, - condensed: _react.PropTypes.bool, - pagination: _react.PropTypes.bool, - printable: _react.PropTypes.bool, - withoutTabIndex: _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]), - customComponent: _react.PropTypes.func, - bgColor: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.func]), - selected: _react.PropTypes.array, - onSelect: _react.PropTypes.func, - onSelectAll: _react.PropTypes.func, - clickToSelect: _react.PropTypes.bool, - hideSelectColumn: _react.PropTypes.bool, - clickToSelectAndEditCell: _react.PropTypes.bool, - clickToExpand: _react.PropTypes.bool, - showOnlySelected: _react.PropTypes.bool, - unselectable: _react.PropTypes.array, - columnWidth: _react.PropTypes.oneOfType([_react.PropTypes.number, _react.PropTypes.string]), - onlyUnselectVisible: _react.PropTypes.bool ->>>>>>> master }), cellEdit: _propTypes2.default.shape({ mode: _propTypes2.default.string, @@ -1983,7 +1930,6 @@ return /******/ (function(modules) { // webpackBootstrap afterSaveCell: _propTypes2.default.func, nonEditableRows: _propTypes2.default.func }), -<<<<<<< HEAD insertRow: _propTypes2.default.bool, deleteRow: _propTypes2.default.bool, search: _propTypes2.default.bool, @@ -1991,6 +1937,7 @@ return /******/ (function(modules) { // webpackBootstrap strictSearch: _propTypes2.default.bool, columnFilter: _propTypes2.default.bool, trClassName: _propTypes2.default.any, + trStyle: _propTypes2.default.any, tableStyle: _propTypes2.default.object, containerStyle: _propTypes2.default.object, headerStyle: _propTypes2.default.object, @@ -2083,107 +2030,6 @@ return /******/ (function(modules) { // webpackBootstrap printToolBar: _propTypes2.default.bool, insertFailIndicator: _propTypes2.default.string, noAutoBOM: _propTypes2.default.bool -======= - insertRow: _react.PropTypes.bool, - deleteRow: _react.PropTypes.bool, - search: _react.PropTypes.bool, - multiColumnSearch: _react.PropTypes.bool, - strictSearch: _react.PropTypes.bool, - columnFilter: _react.PropTypes.bool, - trClassName: _react.PropTypes.any, - trStyle: _react.PropTypes.any, - tableStyle: _react.PropTypes.object, - containerStyle: _react.PropTypes.object, - headerStyle: _react.PropTypes.object, - bodyStyle: _react.PropTypes.object, - containerClass: _react.PropTypes.string, - tableContainerClass: _react.PropTypes.string, - headerContainerClass: _react.PropTypes.string, - bodyContainerClass: _react.PropTypes.string, - tableHeaderClass: _react.PropTypes.string, - tableBodyClass: _react.PropTypes.string, - options: _react.PropTypes.shape({ - clearSearch: _react.PropTypes.bool, - sortName: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.array]), - sortOrder: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.array]), - defaultSortName: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.array]), - defaultSortOrder: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.array]), - sortIndicator: _react.PropTypes.bool, - afterTableComplete: _react.PropTypes.func, - afterDeleteRow: _react.PropTypes.func, - afterInsertRow: _react.PropTypes.func, - afterSearch: _react.PropTypes.func, - afterColumnFilter: _react.PropTypes.func, - onRowClick: _react.PropTypes.func, - onRowDoubleClick: _react.PropTypes.func, - page: _react.PropTypes.number, - pageStartIndex: _react.PropTypes.number, - paginationShowsTotal: _react.PropTypes.oneOfType([_react.PropTypes.bool, _react.PropTypes.func]), - 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, - hidePageListOnlyOnePage: _react.PropTypes.bool, - alwaysShowAllBtns: _react.PropTypes.bool, - withFirstAndLast: _react.PropTypes.bool, - keepSizePerPageState: _react.PropTypes.bool, - onSortChange: _react.PropTypes.func, - onPageChange: _react.PropTypes.func, - onSizePerPageList: _react.PropTypes.func, - onFilterChange: _react2.default.PropTypes.func, - onSearchChange: _react2.default.PropTypes.func, - onAddRow: _react2.default.PropTypes.func, - onExportToCSV: _react2.default.PropTypes.func, - onCellEdit: _react2.default.PropTypes.func, - noDataText: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.object]), - withoutNoDataText: _react2.default.PropTypes.bool, - handleConfirmDeleteRow: _react.PropTypes.func, - prePage: _react.PropTypes.any, - nextPage: _react.PropTypes.any, - firstPage: _react.PropTypes.any, - lastPage: _react.PropTypes.any, - prePageTitle: _react.PropTypes.string, - nextPageTitle: _react.PropTypes.string, - firstPageTitle: _react.PropTypes.string, - lastPageTitle: _react.PropTypes.string, - searchDelayTime: _react.PropTypes.number, - excludeCSVHeader: _react.PropTypes.bool, - exportCSVText: _react.PropTypes.string, - exportCSVSeparator: _react.PropTypes.string, - insertText: _react.PropTypes.string, - deleteText: _react.PropTypes.string, - saveText: _react.PropTypes.string, - 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, - onExpand: _react.PropTypes.func, - onlyOneExpanding: _react.PropTypes.bool, - expandBodyClass: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.func]), - expandParentClass: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.func]), - beforeShowError: _react.PropTypes.func, - printToolBar: _react.PropTypes.bool, - noAutoBOM: _react.PropTypes.bool ->>>>>>> master }), fetchInfo: _propTypes2.default.shape({ dataTotalSize: _propTypes2.default.number @@ -2366,17 +2212,17 @@ return /******/ (function(modules) { // webpackBootstrap ; -/***/ }, +/***/ }), /* 2 */ -/***/ function(module, exports) { +/***/ (function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_2__; -/***/ }, +/***/ }), /* 3 */ -/***/ function(module, exports, __webpack_require__) { +/***/ (function(module, exports, __webpack_require__) { - /** + /* WEBPACK VAR INJECTION */(function(process) {/** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * @@ -2385,172 +2231,339 @@ return /******/ (function(modules) { // webpackBootstrap * of patent rights can be found in the PATENTS file in the same directory. */ - var factory = __webpack_require__(4); - - var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' && - Symbol.for && - Symbol.for('react.element')) || - 0xeac7; + if (process.env.NODE_ENV !== 'production') { + var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' && + Symbol.for && + Symbol.for('react.element')) || + 0xeac7; + + var isValidElement = function(object) { + return typeof object === 'object' && + object !== null && + object.$$typeof === REACT_ELEMENT_TYPE; + }; - function isValidElement(object) { - return typeof object === 'object' && - object !== null && - object.$$typeof === REACT_ELEMENT_TYPE; + // By explicitly using `prop-types` you are opting into new development behavior. + // http://fb.me/prop-types-in-prod + var throwOnDirectAccess = true; + module.exports = __webpack_require__(5)(isValidElement, throwOnDirectAccess); + } else { + // By explicitly using `prop-types` you are opting into new production behavior. + // http://fb.me/prop-types-in-prod + module.exports = __webpack_require__(11)(); } - module.exports = factory(isValidElement); + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4))) - -/***/ }, +/***/ }), /* 4 */ -/***/ function(module, exports, __webpack_require__) { +/***/ (function(module, exports) { - /* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ + // shim for using process in browser + var process = module.exports = {}; - 'use strict'; + // cached from whatever global is present so that test runners that stub it + // don't break things. But we need to wrap it in a try catch in case it is + // wrapped in strict mode code which doesn't define any globals. It's inside a + // function because try/catches deoptimize in certain engines. - var emptyFunction = __webpack_require__(6); - var invariant = __webpack_require__(7); - var warning = __webpack_require__(8); + var cachedSetTimeout; + var cachedClearTimeout; - var ReactPropTypesSecret = __webpack_require__(9); - var checkPropTypes = __webpack_require__(10); + function defaultSetTimout() { + throw new Error('setTimeout has not been defined'); + } + function defaultClearTimeout () { + throw new Error('clearTimeout has not been defined'); + } + (function () { + try { + if (typeof setTimeout === 'function') { + cachedSetTimeout = setTimeout; + } else { + cachedSetTimeout = defaultSetTimout; + } + } catch (e) { + cachedSetTimeout = defaultSetTimout; + } + try { + if (typeof clearTimeout === 'function') { + cachedClearTimeout = clearTimeout; + } else { + cachedClearTimeout = defaultClearTimeout; + } + } catch (e) { + cachedClearTimeout = defaultClearTimeout; + } + } ()) + function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + //normal enviroments in sane situations + return setTimeout(fun, 0); + } + // if setTimeout wasn't available but was latter defined + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedSetTimeout(fun, 0); + } catch(e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedSetTimeout.call(null, fun, 0); + } catch(e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error + return cachedSetTimeout.call(this, fun, 0); + } + } - module.exports = function (isValidElement) { - /* global Symbol */ - var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; - var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. - /** - * Returns the iterator method function contained on the iterable object. - * - * Be sure to invoke the function with the iterable as context: - * - * var iteratorFn = getIteratorFn(myIterable); - * if (iteratorFn) { - * var iterator = iteratorFn.call(myIterable); - * ... - * } - * - * @param {?object} maybeIterable - * @return {?function} - */ - function getIteratorFn(maybeIterable) { - var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); - if (typeof iteratorFn === 'function') { - return iteratorFn; + } + function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + //normal enviroments in sane situations + return clearTimeout(marker); + } + // if clearTimeout wasn't available but was latter defined + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedClearTimeout(marker); + } catch (e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedClearTimeout.call(null, marker); + } catch (e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. + // Some versions of I.E. have different rules for clearTimeout vs setTimeout + return cachedClearTimeout.call(this, marker); + } } - } - - /** - * Collection of methods that allow declaration and validation of props that are - * supplied to React components. Example usage: - * - * var Props = require('ReactPropTypes'); - * var MyArticle = React.createClass({ - * propTypes: { - * // An optional string prop named "description". - * description: Props.string, - * - * // A required enum prop named "category". - * category: Props.oneOf(['News','Photos']).isRequired, - * - * // A prop named "dialog" that requires an instance of Dialog. - * dialog: Props.instanceOf(Dialog).isRequired - * }, - * render: function() { ... } - * }); - * - * A more formal specification of how these methods are used: - * - * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) - * decl := ReactPropTypes.{type}(.isRequired)? - * - * Each and every declaration produces a function with the same signature. This - * allows the creation of custom validation functions. For example: - * - * var MyLink = React.createClass({ - * propTypes: { - * // An optional string or URI prop named "href". - * href: function(props, propName, componentName) { - * var propValue = props[propName]; - * if (propValue != null && typeof propValue !== 'string' && - * !(propValue instanceof URI)) { - * return new Error( - * 'Expected a string or an URI for ' + propName + ' in ' + - * componentName - * ); - * } - * } - * }, - * render: function() {...} - * }); - * - * @internal - */ - var ANONYMOUS = '<>'; - var ReactPropTypes; - if (process.env.NODE_ENV !== 'production') { - // Keep in sync with production version below - ReactPropTypes = { - array: createPrimitiveTypeChecker('array'), - bool: createPrimitiveTypeChecker('boolean'), - func: createPrimitiveTypeChecker('function'), - number: createPrimitiveTypeChecker('number'), - object: createPrimitiveTypeChecker('object'), - string: createPrimitiveTypeChecker('string'), - symbol: createPrimitiveTypeChecker('symbol'), - - any: createAnyTypeChecker(), - arrayOf: createArrayOfTypeChecker, - element: createElementTypeChecker(), - instanceOf: createInstanceTypeChecker, - node: createNodeChecker(), - objectOf: createObjectOfTypeChecker, - oneOf: createEnumTypeChecker, - oneOfType: createUnionTypeChecker, - shape: createShapeTypeChecker - }; - } else { - var productionTypeChecker = function () { - invariant(false, 'React.PropTypes type checking code is stripped in production.'); - }; - productionTypeChecker.isRequired = productionTypeChecker; - var getProductionTypeChecker = function () { - return productionTypeChecker; - }; - // Keep in sync with development version above - ReactPropTypes = { - array: productionTypeChecker, - bool: productionTypeChecker, - func: productionTypeChecker, - number: productionTypeChecker, - object: productionTypeChecker, - string: productionTypeChecker, - symbol: productionTypeChecker, - - any: productionTypeChecker, - arrayOf: getProductionTypeChecker, - element: productionTypeChecker, - instanceOf: getProductionTypeChecker, - node: productionTypeChecker, - objectOf: getProductionTypeChecker, - oneOf: getProductionTypeChecker, - oneOfType: getProductionTypeChecker, - shape: getProductionTypeChecker - }; + } + var queue = []; + var draining = false; + var currentQueue; + var queueIndex = -1; + + function cleanUpNextTick() { + if (!draining || !currentQueue) { + return; + } + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + drainQueue(); + } + } + + function drainQueue() { + if (draining) { + return; + } + var timeout = runTimeout(cleanUpNextTick); + draining = true; + + var len = queue.length; + while(len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + runClearTimeout(timeout); + } + + process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } + }; + + // v8 likes predictible objects + function Item(fun, array) { + this.fun = fun; + this.array = array; + } + Item.prototype.run = function () { + this.fun.apply(null, this.array); + }; + process.title = 'browser'; + process.browser = true; + process.env = {}; + process.argv = []; + process.version = ''; // empty string to avoid regexp issues + process.versions = {}; + + function noop() {} + + process.on = noop; + process.addListener = noop; + process.once = noop; + process.off = noop; + process.removeListener = noop; + process.removeAllListeners = noop; + process.emit = noop; + process.prependListener = noop; + process.prependOnceListener = noop; + + process.listeners = function (name) { return [] } + + process.binding = function (name) { + throw new Error('process.binding is not supported'); + }; + + process.cwd = function () { return '/' }; + process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); + }; + process.umask = function() { return 0; }; + + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + + 'use strict'; + + var emptyFunction = __webpack_require__(6); + var invariant = __webpack_require__(7); + var warning = __webpack_require__(8); + + var ReactPropTypesSecret = __webpack_require__(9); + var checkPropTypes = __webpack_require__(10); + + module.exports = function(isValidElement, throwOnDirectAccess) { + /* global Symbol */ + var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. + + /** + * Returns the iterator method function contained on the iterable object. + * + * Be sure to invoke the function with the iterable as context: + * + * var iteratorFn = getIteratorFn(myIterable); + * if (iteratorFn) { + * var iterator = iteratorFn.call(myIterable); + * ... + * } + * + * @param {?object} maybeIterable + * @return {?function} + */ + function getIteratorFn(maybeIterable) { + var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); + if (typeof iteratorFn === 'function') { + return iteratorFn; + } } + /** + * Collection of methods that allow declaration and validation of props that are + * supplied to React components. Example usage: + * + * var Props = require('ReactPropTypes'); + * var MyArticle = React.createClass({ + * propTypes: { + * // An optional string prop named "description". + * description: Props.string, + * + * // A required enum prop named "category". + * category: Props.oneOf(['News','Photos']).isRequired, + * + * // A prop named "dialog" that requires an instance of Dialog. + * dialog: Props.instanceOf(Dialog).isRequired + * }, + * render: function() { ... } + * }); + * + * A more formal specification of how these methods are used: + * + * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) + * decl := ReactPropTypes.{type}(.isRequired)? + * + * Each and every declaration produces a function with the same signature. This + * allows the creation of custom validation functions. For example: + * + * var MyLink = React.createClass({ + * propTypes: { + * // An optional string or URI prop named "href". + * href: function(props, propName, componentName) { + * var propValue = props[propName]; + * if (propValue != null && typeof propValue !== 'string' && + * !(propValue instanceof URI)) { + * return new Error( + * 'Expected a string or an URI for ' + propName + ' in ' + + * componentName + * ); + * } + * } + * }, + * render: function() {...} + * }); + * + * @internal + */ + + var ANONYMOUS = '<>'; + + // Important! + // Keep this list in sync with production version in `./factoryWithThrowingShims.js`. + var ReactPropTypes = { + array: createPrimitiveTypeChecker('array'), + bool: createPrimitiveTypeChecker('boolean'), + func: createPrimitiveTypeChecker('function'), + number: createPrimitiveTypeChecker('number'), + object: createPrimitiveTypeChecker('object'), + string: createPrimitiveTypeChecker('string'), + symbol: createPrimitiveTypeChecker('symbol'), + + any: createAnyTypeChecker(), + arrayOf: createArrayOfTypeChecker, + element: createElementTypeChecker(), + instanceOf: createInstanceTypeChecker, + node: createNodeChecker(), + objectOf: createObjectOfTypeChecker, + oneOf: createEnumTypeChecker, + oneOfType: createUnionTypeChecker, + shape: createShapeTypeChecker + }; + /** * inlined Object.is polyfill to avoid requiring consumers ship their own * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is @@ -2586,16 +2599,41 @@ return /******/ (function(modules) { // webpackBootstrap function createChainableTypeChecker(validate) { if (process.env.NODE_ENV !== 'production') { var manualPropTypeCallCache = {}; + var manualPropTypeWarningCount = 0; } function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { componentName = componentName || ANONYMOUS; propFullName = propFullName || propName; - if (process.env.NODE_ENV !== 'production') { - if (secret !== ReactPropTypesSecret && typeof console !== 'undefined') { + + if (secret !== ReactPropTypesSecret) { + if (throwOnDirectAccess) { + // New behavior only for users of `prop-types` package + invariant( + false, + 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + + 'Use `PropTypes.checkPropTypes()` to call them. ' + + 'Read more at http://fb.me/use-check-prop-types' + ); + } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') { + // Old behavior for people using React.PropTypes var cacheKey = componentName + ':' + propName; - if (!manualPropTypeCallCache[cacheKey]) { - process.env.NODE_ENV !== 'production' ? warning(false, 'You are manually calling a React.PropTypes validation ' + 'function for the `%s` prop on `%s`. This is deprecated ' + 'and will not work in production with the next major version. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.', propFullName, componentName) : void 0; + if ( + !manualPropTypeCallCache[cacheKey] && + // Avoid spamming the console because they are often not actionable except for lib authors + manualPropTypeWarningCount < 3 + ) { + warning( + false, + 'You are manually calling a React.PropTypes validation ' + + 'function for the `%s` prop on `%s`. This is deprecated ' + + 'and will throw in the standalone `prop-types` package. ' + + 'You may be seeing this warning due to a third-party PropTypes ' + + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.', + propFullName, + componentName + ); manualPropTypeCallCache[cacheKey] = true; + manualPropTypeWarningCount++; } } } @@ -2733,6 +2771,20 @@ return /******/ (function(modules) { // webpackBootstrap return emptyFunction.thatReturnsNull; } + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (typeof checker !== 'function') { + warning( + false, + 'Invalid argument supplid to oneOfType. Expected an array of check functions, but ' + + 'received %s at index %s.', + getPostfixForTypeWarning(checker), + i + ); + return emptyFunction.thatReturnsNull; + } + } + function validate(props, propName, componentName, location, propFullName) { for (var i = 0; i < arrayOfTypeCheckers.length; i++) { var checker = arrayOfTypeCheckers[i]; @@ -2865,6 +2917,9 @@ return /******/ (function(modules) { // webpackBootstrap // This handles more types than `getPropType`. Only used for error messages. // See `createPrimitiveTypeChecker`. function getPreciseType(propValue) { + if (typeof propValue === 'undefined' || propValue === null) { + return '' + propValue; + } var propType = getPropType(propValue); if (propType === 'object') { if (propValue instanceof Date) { @@ -2876,6 +2931,23 @@ return /******/ (function(modules) { // webpackBootstrap return propType; } + // Returns a string that is postfixed to a warning about an invalid type. + // For example, "undefined" or "of type array" + function getPostfixForTypeWarning(value) { + var type = getPreciseType(value); + switch (type) { + case 'array': + case 'object': + return 'an ' + type; + case 'boolean': + case 'date': + case 'regexp': + return 'a ' + type; + default: + return type; + } + } + // Returns class name of the object, if any. function getClassName(propValue) { if (!propValue.constructor || !propValue.constructor.name) { @@ -2890,215 +2962,29 @@ return /******/ (function(modules) { // webpackBootstrap return ReactPropTypes; }; - /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4))) -/***/ }, -/* 5 */ -/***/ function(module, exports) { - - // shim for using process in browser - var process = module.exports = {}; +/***/ }), +/* 6 */ +/***/ (function(module, exports) { - // cached from whatever global is present so that test runners that stub it - // don't break things. But we need to wrap it in a try catch in case it is - // wrapped in strict mode code which doesn't define any globals. It's inside a - // function because try/catches deoptimize in certain engines. + "use strict"; - var cachedSetTimeout; - var cachedClearTimeout; + /** + * Copyright (c) 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * + */ - function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); - } - function defaultClearTimeout () { - throw new Error('clearTimeout has not been defined'); - } - (function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } - } ()) - function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); - } - // if setTimeout wasn't available but was latter defined - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch(e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch(e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error - return cachedSetTimeout.call(this, fun, 0); - } - } - - - } - function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); - } - // if clearTimeout wasn't available but was latter defined - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); - } - } - - - - } - var queue = []; - var draining = false; - var currentQueue; - var queueIndex = -1; - - function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); - } - } - - function drainQueue() { - if (draining) { - return; - } - var timeout = runTimeout(cleanUpNextTick); - draining = true; - - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - queueIndex = -1; - len = queue.length; - } - currentQueue = null; - draining = false; - runClearTimeout(timeout); - } - - process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } - }; - - // v8 likes predictible objects - function Item(fun, array) { - this.fun = fun; - this.array = array; - } - Item.prototype.run = function () { - this.fun.apply(null, this.array); - }; - process.title = 'browser'; - process.browser = true; - process.env = {}; - process.argv = []; - process.version = ''; // empty string to avoid regexp issues - process.versions = {}; - - function noop() {} - - process.on = noop; - process.addListener = noop; - process.once = noop; - process.off = noop; - process.removeListener = noop; - process.removeAllListeners = noop; - process.emit = noop; - - process.binding = function (name) { - throw new Error('process.binding is not supported'); - }; - - process.cwd = function () { return '/' }; - process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); - }; - process.umask = function() { return 0; }; - - -/***/ }, -/* 6 */ -/***/ function(module, exports) { - - "use strict"; - - /** - * Copyright (c) 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * - */ - - function makeEmptyFunction(arg) { - return function () { - return arg; - }; + function makeEmptyFunction(arg) { + return function () { + return arg; + }; } /** @@ -3121,9 +3007,9 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = emptyFunction; -/***/ }, +/***/ }), /* 7 */ -/***/ function(module, exports, __webpack_require__) { +/***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** * Copyright (c) 2013-present, Facebook, Inc. @@ -3180,11 +3066,11 @@ return /******/ (function(modules) { // webpackBootstrap } module.exports = invariant; - /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4))) -/***/ }, +/***/ }), /* 8 */ -/***/ function(module, exports, __webpack_require__) { +/***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** * Copyright 2014-2015, Facebook, Inc. @@ -3252,11 +3138,11 @@ return /******/ (function(modules) { // webpackBootstrap } module.exports = warning; - /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4))) -/***/ }, +/***/ }), /* 9 */ -/***/ function(module, exports) { +/***/ (function(module, exports) { /** * Copyright 2013-present, Facebook, Inc. @@ -3274,9 +3160,9 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = ReactPropTypesSecret; -/***/ }, +/***/ }), /* 10 */ -/***/ function(module, exports, __webpack_require__) { +/***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** * Copyright 2013-present, Facebook, Inc. @@ -3289,12 +3175,12 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; - var invariant = __webpack_require__(7); - var warning = __webpack_require__(8); - - var ReactPropTypesSecret = __webpack_require__(9); - - var loggedTypeFailures = {}; + if (process.env.NODE_ENV !== 'production') { + var invariant = __webpack_require__(7); + var warning = __webpack_require__(8); + var ReactPropTypesSecret = __webpack_require__(9); + var loggedTypeFailures = {}; + } /** * Assert that the values match with the type specs. @@ -3323,7 +3209,7 @@ return /******/ (function(modules) { // webpackBootstrap } catch (ex) { error = ex; } - process.env.NODE_ENV !== 'production' ? warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error) : void 0; + warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error); if (error instanceof Error && !(error.message in loggedTypeFailures)) { // Only monitor this failure once because there tends to be a lot of the // same error. @@ -3331,7 +3217,7 @@ return /******/ (function(modules) { // webpackBootstrap var stack = getStack ? getStack() : ''; - process.env.NODE_ENV !== 'production' ? warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '') : void 0; + warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : ''); } } } @@ -3340,11 +3226,76 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = checkPropTypes; - /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4))) -/***/ }, +/***/ }), /* 11 */ -/***/ function(module, exports, __webpack_require__) { +/***/ (function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + + 'use strict'; + + var emptyFunction = __webpack_require__(6); + var invariant = __webpack_require__(7); + var ReactPropTypesSecret = __webpack_require__(9); + + module.exports = function() { + function shim(props, propName, componentName, location, propFullName, secret) { + if (secret === ReactPropTypesSecret) { + // It is still safe when called from React. + return; + } + invariant( + false, + 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + + 'Use PropTypes.checkPropTypes() to call them. ' + + 'Read more at http://fb.me/use-check-prop-types' + ); + }; + shim.isRequired = shim; + function getShim() { + return shim; + }; + // Important! + // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`. + var ReactPropTypes = { + array: shim, + bool: shim, + func: shim, + number: shim, + object: shim, + string: shim, + symbol: shim, + + any: shim, + arrayOf: getShim, + element: shim, + instanceOf: getShim, + node: shim, + objectOf: getShim, + oneOf: getShim, + oneOfType: getShim, + shape: getShim + }; + + ReactPropTypes.checkPropTypes = emptyFunction; + ReactPropTypes.PropTypes = ReactPropTypes; + + return ReactPropTypes; + }; + + +/***/ }), +/* 12 */ +/***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! Copyright (c) 2016 Jed Watson. @@ -3396,9 +3347,9 @@ return /******/ (function(modules) { // webpackBootstrap }()); -/***/ }, -/* 12 */ -/***/ function(module, exports) { +/***/ }), +/* 13 */ +/***/ (function(module, exports) { 'use strict'; @@ -3492,9 +3443,9 @@ return /******/ (function(modules) { // webpackBootstrap ; -/***/ }, -/* 13 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 14 */ +/***/ (function(module, exports, __webpack_require__) { 'use strict'; @@ -3512,23 +3463,23 @@ return /******/ (function(modules) { // webpackBootstrap var _propTypes2 = _interopRequireDefault(_propTypes); - var _reactDom = __webpack_require__(14); + var _reactDom = __webpack_require__(15); var _reactDom2 = _interopRequireDefault(_reactDom); - var _Const = __webpack_require__(12); + var _Const = __webpack_require__(13); var _Const2 = _interopRequireDefault(_Const); - var _classnames = __webpack_require__(11); + var _classnames = __webpack_require__(12); var _classnames2 = _interopRequireDefault(_classnames); - var _SelectRowHeaderColumn = __webpack_require__(15); + var _SelectRowHeaderColumn = __webpack_require__(16); var _SelectRowHeaderColumn2 = _interopRequireDefault(_SelectRowHeaderColumn); - var _ExpandRowHeaderColumn = __webpack_require__(16); + var _ExpandRowHeaderColumn = __webpack_require__(17); var _ExpandRowHeaderColumn2 = _interopRequireDefault(_ExpandRowHeaderColumn); @@ -3615,21 +3566,8 @@ return /******/ (function(modules) { // webpackBootstrap _createClass(TableHeader, [{ key: 'render', value: function render() { -<<<<<<< HEAD var containerClasses = (0, _classnames2.default)('react-bs-container-header', 'table-header-wrapper', this.props.headerContainerClass); var tableClasses = (0, _classnames2.default)('table', 'table-hover', { -======= - var _props = this.props, - cellEdit = _props.cellEdit, - beforeShowError = _props.beforeShowError, - x = _props.x, - y = _props.y, - keyBoardNav = _props.keyBoardNav, - trStyle = _props.trStyle; - - var tableClasses = (0, _classnames2.default)('table', { - 'table-striped': this.props.striped, ->>>>>>> master 'table-bordered': this.props.bordered, 'table-condensed': this.props.condensed }, this.props.tableHeaderClass); @@ -3649,84 +3587,15 @@ return /******/ (function(modules) { // webpackBootstrap onSort = _props.onSort, reset = _props.reset; -<<<<<<< HEAD -======= - if (typeof column.format !== 'undefined') { - var formattedValue = column.format(fieldValue, data, column.formatExtraData, r); - if (!_react2.default.isValidElement(formattedValue)) { - columnChild = _react2.default.createElement('div', { dangerouslySetInnerHTML: { __html: formattedValue } }); - } else { - columnChild = formattedValue; - columnTitle = column.columnTitle && formattedValue ? formattedValue.toString() : null; - } - } else { - columnTitle = column.columnTitle && fieldValue ? fieldValue.toString() : null; - } - return _react2.default.createElement( - _TableColumn2.default, - { key: i, - rIndex: r, - dataAlign: column.align, - className: tdClassName, - columnTitle: columnTitle, - cellEdit: cellEdit, - hidden: column.hidden, - onEdit: this.handleEditCell, - width: column.width, - onClick: this.handleClickCell, - attrs: column.attrs, - style: column.style, - tabIndex: tabIndex++ + '', - isFocus: isFocusCell, - keyBoardNav: enableKeyBoardNav, - onKeyDown: this.handleCellKeyDown, - customNavStyle: customNavStyle, - row: data, - withoutTabIndex: this.props.withoutTabIndex }, - columnChild - ); - } - }, this); - var key = data[this.props.keyField]; - var disable = unselectable.indexOf(key) !== -1; - var selected = this.props.selectedRowKeys.indexOf(key) !== -1; - var selectRowColumn = isSelectRowDefined && !this.props.selectRow.hideSelectColumn ? this.renderSelectRowColumn(selected, inputType, disable, CustomComponent, r, data) : null; - var expandedRowColumn = this.renderExpandRowColumn(this.props.expandableRow && this.props.expandableRow(data), this.props.expanding.indexOf(key) > -1, ExpandColumnCustomComponent, r, data); - var haveExpandContent = this.props.expandableRow && this.props.expandableRow(data); - var isExpanding = haveExpandContent && this.props.expanding.indexOf(key) > -1; ->>>>>>> master _react2.default.Children.forEach(this.props.children, function (elm) { if (elm === null || elm === undefined) { // Skip null or undefined elements. return; } -<<<<<<< HEAD var _elm$props = elm.props, dataField = _elm$props.dataField, dataSort = _elm$props.dataSort; -======= - var result = [_react2.default.createElement( - _TableRow2.default, - { isSelected: selected, key: key, className: trClassName, - index: r, - row: data, - selectRow: isSelectRowDefined ? this.props.selectRow : undefined, - enableCellEdit: cellEdit.mode !== _Const2.default.CELL_EDIT_NONE, - onRowClick: this.handleRowClick, - onRowDoubleClick: this.handleRowDoubleClick, - onRowMouseOver: this.handleRowMouseOver, - onRowMouseOut: this.handleRowMouseOut, - onSelectRow: this.handleSelectRow, - onExpandRow: this.handleClickCell, - unselectableRow: disable, - style: trStyle }, - this.props.expandColumnOptions.expandColumnVisible && this.props.expandColumnOptions.expandColumnBeforeSelectColumn && expandedRowColumn, - selectRowColumn, - this.props.expandColumnOptions.expandColumnVisible && !this.props.expandColumnOptions.expandColumnBeforeSelectColumn && expandedRowColumn, - tableColumns - )]; ->>>>>>> master var sort = getSortOrder(sortList, dataField, dataSort); var rowIndex = elm.props.row ? Number(elm.props.row) : 0; @@ -3734,7 +3603,6 @@ return /******/ (function(modules) { // webpackBootstrap if (rows[rowIndex] === undefined) { rows[rowIndex] = []; } -<<<<<<< HEAD if (rowSpan + rowIndex === rowCount + 1) { rows[rowIndex].push(_react2.default.cloneElement(elm, { reset: reset, key: rowKey++, onSort: onSort, sort: sort, sortIndicator: sortIndicator, isOnlyHead: false })); } else { @@ -3749,27 +3617,6 @@ return /******/ (function(modules) { // webpackBootstrap row ); }); -======= - return result; - }, this); - - if (tableRows.length === 0 && !this.props.withoutNoDataText) { - var colSpan = this.props.columns.filter(function (c) { - return !c.hidden; - }).length + (isSelectRowDefined && !this.props.selectRow.hideSelectColumn ? 1 : 0) + (this.props.expandColumnOptions.expandColumnVisible ? 1 : 0); - tableRows = [_react2.default.createElement( - _TableRow2.default, - { key: '##table-empty##', style: trStyle }, - _react2.default.createElement( - 'td', - { 'data-toggle': 'collapse', - colSpan: colSpan, - className: 'react-bs-table-no-data' }, - this.props.noDataText || _Const2.default.NO_DATA_TEXT - ) - )]; - } ->>>>>>> master return _react2.default.createElement( 'div', @@ -3866,83 +3713,17 @@ return /******/ (function(modules) { // webpackBootstrap ; -/***/ }, -/* 14 */ -/***/ function(module, exports) { +/***/ }), +/* 15 */ +/***/ (function(module, exports) { - module.exports = __WEBPACK_EXTERNAL_MODULE_14__; + module.exports = __WEBPACK_EXTERNAL_MODULE_15__; -/***/ }, -/* 15 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 16 */ +/***/ (function(module, exports, __webpack_require__) { -<<<<<<< HEAD 'use strict'; -======= - var nextRIndex = rIndex; - var nextCIndex = cIndex; - var row = void 0; - var column = void 0; - do { - if (nextCIndex >= this.props.columns.length) { - nextRIndex++; - nextCIndex = 0; - } - row = this.props.data[nextRIndex]; - column = this.props.columns[nextCIndex]; - if (!row) break; - var editable = column.editable; - if (_util2.default.isFunction(column.editable)) { - editable = column.editable(column, row, nextRIndex, nextCIndex); - } - if (editable && editable.readOnly !== true && !column.hidden && keyField !== column.name) { - break; - } else { - nextCIndex++; - } - } while (row); - return { nextRIndex: nextRIndex, nextCIndex: nextCIndex }; - } - }, { - key: '__handleCompleteEditCell__REACT_HOT_LOADER__', - value: function __handleCompleteEditCell__REACT_HOT_LOADER__(newVal, rowIndex, columnIndex) { - if (newVal !== null) { - var result = this.props.onEditCell(newVal, rowIndex, columnIndex); - if (result !== _Const2.default.AWAIT_BEFORE_CELL_EDIT) { - this.setState(function () { - return { currEditCell: null }; - }); - } - } else { - this.setState(function () { - return { currEditCell: null }; - }); - } - } - }, { - key: '__cancelEditCell__REACT_HOT_LOADER__', - value: function __cancelEditCell__REACT_HOT_LOADER__() { - this.setState(function () { - return { currEditCell: null }; - }); - } - }, { - key: '__handleClickonSelectColumn__REACT_HOT_LOADER__', - value: function __handleClickonSelectColumn__REACT_HOT_LOADER__(e, isSelect, rowIndex, row) { - e.stopPropagation(); - if (e.target.tagName === 'TD' && (this.props.selectRow.clickToSelect || this.props.selectRow.clickToSelectAndEditCell)) { - var unselectable = this.props.selectRow.unselectable || []; - if (unselectable.indexOf(row[this.props.keyField]) === -1) { - this.handleSelectRow(rowIndex + 1, isSelect, e); - this.handleClickCell(rowIndex + 1); - } - } - } - }, { - key: 'renderSelectRowColumn', - value: function renderSelectRowColumn(selected, inputType, disabled) { - var CustomComponent = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; ->>>>>>> master Object.defineProperty(exports, "__esModule", { value: true @@ -3990,44 +3771,9 @@ return /******/ (function(modules) { // webpackBootstrap return SelectRowHeaderColumn; }(_react.Component); -<<<<<<< HEAD SelectRowHeaderColumn.propTypes = { children: _propTypes2.default.node, rowCount: _propTypes2.default.number -======= - TableBody.propTypes = { - data: _react.PropTypes.array, - columns: _react.PropTypes.array, - striped: _react.PropTypes.bool, - bordered: _react.PropTypes.bool, - hover: _react.PropTypes.bool, - condensed: _react.PropTypes.bool, - keyField: _react.PropTypes.string, - selectedRowKeys: _react.PropTypes.array, - onRowClick: _react.PropTypes.func, - onRowDoubleClick: _react.PropTypes.func, - onSelectRow: _react.PropTypes.func, - noDataText: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.object]), - withoutNoDataText: _react.PropTypes.bool, - style: _react.PropTypes.object, - tableBodyClass: _react.PropTypes.string, - bodyContainerClass: _react.PropTypes.string, - expandableRow: _react.PropTypes.func, - expandComponent: _react.PropTypes.func, - expandRowBgColor: _react.PropTypes.string, - expandBy: _react.PropTypes.string, - expanding: _react.PropTypes.array, - onExpand: _react.PropTypes.func, - expandBodyClass: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.func]), - expandParentClass: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.func]), - onlyOneExpanding: _react.PropTypes.bool, - 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, - withoutTabIndex: _react.PropTypes.bool ->>>>>>> master }; var _default = SelectRowHeaderColumn; exports.default = _default; @@ -4045,9 +3791,9 @@ return /******/ (function(modules) { // webpackBootstrap ; -/***/ }, -/* 16 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 17 */ +/***/ (function(module, exports, __webpack_require__) { 'use strict'; @@ -4114,9 +3860,9 @@ return /******/ (function(modules) { // webpackBootstrap ; -/***/ }, -/* 17 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 18 */ +/***/ (function(module, exports, __webpack_require__) { 'use strict'; @@ -4138,31 +3884,31 @@ return /******/ (function(modules) { // webpackBootstrap var _propTypes2 = _interopRequireDefault(_propTypes); - var _util = __webpack_require__(18); + var _util = __webpack_require__(19); var _util2 = _interopRequireDefault(_util); - var _Const = __webpack_require__(12); + var _Const = __webpack_require__(13); var _Const2 = _interopRequireDefault(_Const); - var _TableRow = __webpack_require__(19); + var _TableRow = __webpack_require__(20); var _TableRow2 = _interopRequireDefault(_TableRow); - var _TableColumn = __webpack_require__(20); + var _TableColumn = __webpack_require__(21); var _TableColumn2 = _interopRequireDefault(_TableColumn); - var _TableEditColumn = __webpack_require__(21); + var _TableEditColumn = __webpack_require__(22); var _TableEditColumn2 = _interopRequireDefault(_TableEditColumn); - var _classnames = __webpack_require__(11); + var _classnames = __webpack_require__(12); var _classnames2 = _interopRequireDefault(_classnames); - var _ExpandComponent = __webpack_require__(31); + var _ExpandComponent = __webpack_require__(32); var _ExpandComponent2 = _interopRequireDefault(_ExpandComponent); @@ -4218,56 +3964,9 @@ return /******/ (function(modules) { // webpackBootstrap return _this.__handleEditCell__REACT_HOT_LOADER__.apply(_this, arguments); }; -<<<<<<< HEAD _this.nextEditableCell = function () { return _this.__nextEditableCell__REACT_HOT_LOADER__.apply(_this, arguments); }; -======= - this.clickNum++; - setTimeout(function () { - if (_this3.clickNum === 1) { - _this3.props.onExpandRow(rowIndex, cellIndex); - } - _this3.clickNum = 0; - }, 200); - } - }, { - key: '__rowDoubleClick__REACT_HOT_LOADER__', - value: function __rowDoubleClick__REACT_HOT_LOADER__(e) { - if (e.target.tagName !== 'INPUT' && e.target.tagName !== 'SELECT' && e.target.tagName !== 'TEXTAREA') { - if (this.props.onRowDoubleClick) { - this.props.onRowDoubleClick(this.props.index); - } - } - } - }, { - key: '__rowMouseOut__REACT_HOT_LOADER__', - value: function __rowMouseOut__REACT_HOT_LOADER__(e) { - var rowIndex = this.props.index; - if (this.props.onRowMouseOut) { - this.props.onRowMouseOut(rowIndex, e); - } - } - }, { - key: '__rowMouseOver__REACT_HOT_LOADER__', - value: function __rowMouseOver__REACT_HOT_LOADER__(e) { - var rowIndex = this.props.index; - if (this.props.onRowMouseOver) { - this.props.onRowMouseOver(rowIndex, e); - } - } - }, { - key: 'render', - value: function render() { - this.clickNum = 0; - var _props2 = this.props, - selectRow = _props2.selectRow, - row = _props2.row, - isSelected = _props2.isSelected, - className = _props2.className, - index = _props2.index; - var style = this.props.style; ->>>>>>> master _this.handleCompleteEditCell = function () { return _this.__handleCompleteEditCell__REACT_HOT_LOADER__.apply(_this, arguments); @@ -4281,25 +3980,9 @@ return /******/ (function(modules) { // webpackBootstrap return _this.__handleClickonSelectColumn__REACT_HOT_LOADER__.apply(_this, arguments); }; -<<<<<<< HEAD _this.getHeaderColGrouop = function () { return _this.__getHeaderColGrouop__REACT_HOT_LOADER__.apply(_this, arguments); }; -======= - if (_util2.default.isFunction(style)) { - style = style(row, index); - } else { - style = _extends({}, style) || {}; - } - // the bgcolor of row selection always overwrite the bgcolor defined by global. - if (style && backgroundColor && isSelected) { - style.backgroundColor = backgroundColor; - } - var trCss = { - style: _extends({}, style), - className: (0, _classnames2.default)(selectRowClass, className) - }; ->>>>>>> master _this.state = { currEditCell: null @@ -4307,7 +3990,6 @@ return /******/ (function(modules) { // webpackBootstrap return _this; } -<<<<<<< HEAD _createClass(TableBody, [{ key: 'render', value: function render() { @@ -4316,289 +3998,552 @@ return /******/ (function(modules) { // webpackBootstrap beforeShowError = _props.beforeShowError, x = _props.x, y = _props.y, - keyBoardNav = _props.keyBoardNav; -======= - return TableRow; - }(_react.Component); - - TableRow.propTypes = { - index: _react.PropTypes.number, - row: _react.PropTypes.any, - style: _react.PropTypes.any, - isSelected: _react.PropTypes.bool, - enableCellEdit: _react.PropTypes.bool, - onRowClick: _react.PropTypes.func, - onRowDoubleClick: _react.PropTypes.func, - onSelectRow: _react.PropTypes.func, - onExpandRow: _react.PropTypes.func, - onRowMouseOut: _react.PropTypes.func, - onRowMouseOver: _react.PropTypes.func, - unselectableRow: _react.PropTypes.bool - }; - TableRow.defaultProps = { - onRowClick: undefined, - onRowDoubleClick: undefined - }; - var _default = TableRow; - exports.default = _default; - ; - - var _temp = function () { - if (typeof __REACT_HOT_LOADER__ === 'undefined') { - return; - } - - __REACT_HOT_LOADER__.register(TableRow, 'TableRow', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/TableRow.js'); - - __REACT_HOT_LOADER__.register(_default, 'default', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/TableRow.js'); - }(); - - ; - -/***/ }, -/* 12 */ -/***/ 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; }; + keyBoardNav = _props.keyBoardNav, + trStyle = _props.trStyle; - 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 tableClasses = (0, _classnames2.default)('table', { + 'table-striped': this.props.striped, + 'table-bordered': this.props.bordered, + 'table-hover': this.props.hover, + 'table-condensed': this.props.condensed + }, this.props.tableBodyClass); - 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 noneditableRows = cellEdit.nonEditableRows && cellEdit.nonEditableRows() || []; + var unselectable = this.props.selectRow.unselectable || []; + var isSelectRowDefined = this._isSelectRowDefined(); + var tableHeader = _util2.default.renderColGroup(this.props.columns, this.props.selectRow, this.props.expandColumnOptions); + 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 ExpandColumnCustomComponent = this.props.expandColumnOptions.expandColumnComponent; + var expandColSpan = this.props.columns.filter(function (col) { + return col && !col.hidden; + }).length; + if (isSelectRowDefined && !this.props.selectRow.hideSelectColumn) { + expandColSpan += 1; + } + var tabIndex = 1; + if (this.props.expandColumnOptions.expandColumnVisible) { + expandColSpan += 1; + } - var _react = __webpack_require__(2); + var tableRows = this.props.data.map(function (data, r) { + var tableColumns = this.props.columns.filter(function (_) { + return _ != null; + }).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 + column.editable.readOnly !== true && this.state.currEditCell !== null && this.state.currEditCell.rid === r && this.state.currEditCell.cid === i && noneditableRows.indexOf(data[this.props.keyField]) === -1) { + var editable = column.editable; + var format = column.format ? function (value) { + return column.format(value, data, column.formatExtraData, r).replace(/<.*?>/g, ''); + } : false; + if (_util2.default.isFunction(column.editable)) { + editable = column.editable(fieldValue, data, r, i); + } - var _react2 = _interopRequireDefault(_react); - - var _reactDom = __webpack_require__(6); - - var _reactDom2 = _interopRequireDefault(_reactDom); - - var _Const = __webpack_require__(4); - - var _Const2 = _interopRequireDefault(_Const); - - var _util = __webpack_require__(10); - - var _util2 = _interopRequireDefault(_util); - - 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 TableColumn = function (_Component) { - _inherits(TableColumn, _Component); - - function TableColumn(props) { - _classCallCheck(this, TableColumn); - - var _this = _possibleConstructorReturn(this, (TableColumn.__proto__ || Object.getPrototypeOf(TableColumn)).call(this, props)); - - _this.handleCellEdit = function () { - return _this.__handleCellEdit__REACT_HOT_LOADER__.apply(_this, arguments); - }; - - _this.handleCellClick = function () { - return _this.__handleCellClick__REACT_HOT_LOADER__.apply(_this, arguments); - }; + return _react2.default.createElement(_TableEditColumn2.default, { + completeEdit: this.handleCompleteEditCell + // add by bluespring for column editor customize + , editable: editable, + customEditor: column.customEditor, + 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, + isFocus: isFocusCell, + customStyleWithNav: customEditAndNavStyle }); + } else { + // add by bluespring for className customize + var columnChild = fieldValue && fieldValue.toString(); + var columnTitle = null; + var tdClassName = column.className; + if (_util2.default.isFunction(column.className)) { + tdClassName = column.className(fieldValue, data, r, i); + } - _this.handleKeyDown = function () { - return _this.__handleKeyDown__REACT_HOT_LOADER__.apply(_this, arguments); - }; + if (typeof column.format !== 'undefined') { + var formattedValue = column.format(fieldValue, data, column.formatExtraData, r); + if (!_react2.default.isValidElement(formattedValue)) { + columnChild = _react2.default.createElement('div', { dangerouslySetInnerHTML: { __html: formattedValue } }); + } else { + columnChild = formattedValue; + columnTitle = column.columnTitle && formattedValue ? formattedValue.toString() : null; + } + } else { + columnTitle = column.columnTitle && fieldValue ? fieldValue.toString() : null; + } + return _react2.default.createElement( + _TableColumn2.default, + { key: i, + rIndex: r, + dataAlign: column.align, + className: tdClassName, + columnTitle: columnTitle, + cellEdit: cellEdit, + hidden: column.hidden, + onEdit: this.handleEditCell, + width: column.width, + onClick: this.handleClickCell, + attrs: column.attrs, + style: column.style, + tabIndex: tabIndex++ + '', + isFocus: isFocusCell, + keyBoardNav: enableKeyBoardNav, + onKeyDown: this.handleCellKeyDown, + customNavStyle: customNavStyle, + row: data, + withoutTabIndex: this.props.withoutTabIndex }, + columnChild + ); + } + }, this); + var key = data[this.props.keyField]; + var disable = unselectable.indexOf(key) !== -1; + var selected = this.props.selectedRowKeys.indexOf(key) !== -1; + var selectRowColumn = isSelectRowDefined && !this.props.selectRow.hideSelectColumn ? this.renderSelectRowColumn(selected, inputType, disable, CustomComponent, r, data) : null; + var expandedRowColumn = this.renderExpandRowColumn(this.props.expandableRow && this.props.expandableRow(data), this.props.expanding.indexOf(key) > -1, ExpandColumnCustomComponent, r, data); + var haveExpandContent = this.props.expandableRow && this.props.expandableRow(data); + var isExpanding = haveExpandContent && this.props.expanding.indexOf(key) > -1; - return _this; - } - /* eslint no-unused-vars: [0, { "args": "after-used" }] */ + // add by bluespring for className customize + var trClassName = this.props.trClassName; + if (_util2.default.isFunction(this.props.trClassName)) { + trClassName = this.props.trClassName(data, r); + } + if (isExpanding && this.props.expandParentClass) { + trClassName += _util2.default.isFunction(this.props.expandParentClass) ? this.props.expandParentClass(data, r) : this.props.expandParentClass; + } + var result = [_react2.default.createElement( + _TableRow2.default, + { isSelected: selected, key: key, className: trClassName, + index: r, + row: data, + selectRow: isSelectRowDefined ? this.props.selectRow : undefined, + enableCellEdit: cellEdit.mode !== _Const2.default.CELL_EDIT_NONE, + onRowClick: this.handleRowClick, + onRowDoubleClick: this.handleRowDoubleClick, + onRowMouseOver: this.handleRowMouseOver, + onRowMouseOut: this.handleRowMouseOut, + onSelectRow: this.handleSelectRow, + onExpandRow: this.handleClickCell, + unselectableRow: disable, + style: trStyle }, + this.props.expandColumnOptions.expandColumnVisible && this.props.expandColumnOptions.expandColumnBeforeSelectColumn && expandedRowColumn, + selectRowColumn, + this.props.expandColumnOptions.expandColumnVisible && !this.props.expandColumnOptions.expandColumnBeforeSelectColumn && expandedRowColumn, + tableColumns + )]; + if (haveExpandContent) { + var expandBodyClass = _util2.default.isFunction(this.props.expandBodyClass) ? this.props.expandBodyClass(data, r, isExpanding) : this.props.expandBodyClass; + result.push(_react2.default.createElement( + _ExpandComponent2.default, + { + key: key + '-expand', + row: data, + className: expandBodyClass, + bgColor: this.props.expandRowBgColor || this.props.selectRow.bgColor || undefined, + hidden: !isExpanding, + colSpan: expandColSpan, + width: "100%" }, + this.props.expandComponent(data) + )); + } + return result; + }, this); - _createClass(TableColumn, [{ - key: 'shouldComponentUpdate', - value: function shouldComponentUpdate(nextProps, nextState) { - var children = this.props.children; + if (tableRows.length === 0 && !this.props.withoutNoDataText) { + var colSpan = this.props.columns.filter(function (c) { + return !c.hidden; + }).length + (isSelectRowDefined && !this.props.selectRow.hideSelectColumn ? 1 : 0) + (this.props.expandColumnOptions.expandColumnVisible ? 1 : 0); + tableRows = [_react2.default.createElement( + _TableRow2.default, + { key: '##table-empty##', style: trStyle }, + _react2.default.createElement( + 'td', + { 'data-toggle': 'collapse', + colSpan: colSpan, + className: 'react-bs-table-no-data' }, + this.props.noDataText || _Const2.default.NO_DATA_TEXT + ) + )]; + } - 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(); + return _react2.default.createElement( + 'div', + { ref: 'container', + className: (0, _classnames2.default)('react-bs-container-body', this.props.bodyContainerClass), + style: this.props.style }, + _react2.default.createElement( + 'table', + { className: tableClasses }, + _react2.default.cloneElement(tableHeader, { ref: 'header' }), + _react2.default.createElement( + 'tbody', + { ref: 'tbody' }, + tableRows + ) + ) + ); + } + }, { + 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; - if (shouldUpdated) { - return shouldUpdated; - } + 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; + var enterToExpand = (typeof keyBoardNav === 'undefined' ? 'undefined' : _typeof(keyBoardNav)) === 'object' ? keyBoardNav.enterToExpand : false; - if ((typeof children === 'undefined' ? 'undefined' : _typeof(children)) === 'object' && children !== null && children.props !== null) { - if (children.props.type === 'checkbox' || children.props.type === 'radio') { - shouldUpdated = shouldUpdated || children.props.type !== nextProps.children.props.type || children.props.checked !== nextProps.children.props.checked || children.props.disabled !== nextProps.children.props.disabled; - } else { - shouldUpdated = true; + if (cellEdit && enterToEdit) { + this.handleEditCell(e.target.parentElement.rowIndex + 1, e.currentTarget.cellIndex, '', e); } - } else { - shouldUpdated = shouldUpdated || children !== nextProps.children; - } - if (shouldUpdated) { - return shouldUpdated; + if (enterToExpand) { + this.handleClickCell(this.props.y + 1, this.props.x); + } } - - if (!(this.props.cellEdit && nextProps.cellEdit)) { - return false; - } else { - return shouldUpdated || this.props.cellEdit.mode !== nextProps.cellEdit.mode; + if (offset && keyBoardNav) { + onNavigateCell(offset); } } }, { - key: 'componentDidMount', - value: function componentDidMount() { - var dom = _reactDom2.default.findDOMNode(this); - if (this.props.isFocus) { - dom.focus(); - } else { - dom.blur(); - } + key: '__handleRowMouseOut__REACT_HOT_LOADER__', + value: function __handleRowMouseOut__REACT_HOT_LOADER__(rowIndex, event) { + var targetRow = this.props.data[rowIndex]; + this.props.onRowMouseOut(targetRow, event); } }, { - key: 'componentDidUpdate', - value: function componentDidUpdate() { - var dom = _reactDom2.default.findDOMNode(this); - if (this.props.isFocus) { - dom.focus(); - } else { - dom.blur(); - } + key: '__handleRowMouseOver__REACT_HOT_LOADER__', + value: function __handleRowMouseOver__REACT_HOT_LOADER__(rowIndex, event) { + var targetRow = this.props.data[rowIndex]; + this.props.onRowMouseOver(targetRow, event); } }, { - key: '__handleCellEdit__REACT_HOT_LOADER__', - value: function __handleCellEdit__REACT_HOT_LOADER__(e) { - if (this.props.cellEdit.mode === _Const2.default.CELL_EDIT_DBCLICK) { - if (document.selection && document.selection.empty) { - document.selection.empty(); - } else if (window.getSelection) { - var sel = window.getSelection(); - sel.removeAllRanges(); - } - } - this.props.onEdit(this.props.rIndex + 1, e.currentTarget.cellIndex, e); - if (this.props.cellEdit.mode !== _Const2.default.CELL_EDIT_DBCLICK) { - this.props.onClick(this.props.rIndex + 1, e.currentTarget.cellIndex, e); - } + key: '__handleRowClick__REACT_HOT_LOADER__', + value: function __handleRowClick__REACT_HOT_LOADER__(rowIndex, cellIndex) { + var onRowClick = this.props.onRowClick; + + if (this._isSelectRowDefined()) cellIndex--; + if (this._isExpandColumnVisible()) cellIndex--; + onRowClick(this.props.data[rowIndex - 1], rowIndex - 1, cellIndex); } }, { - key: '__handleCellClick__REACT_HOT_LOADER__', - value: function __handleCellClick__REACT_HOT_LOADER__(e) { - var _props = this.props, - onClick = _props.onClick, - rIndex = _props.rIndex; + key: '__handleRowDoubleClick__REACT_HOT_LOADER__', + value: function __handleRowDoubleClick__REACT_HOT_LOADER__(rowIndex) { + var onRowDoubleClick = this.props.onRowDoubleClick; - if (onClick) { - onClick(rIndex + 1, e.currentTarget.cellIndex, e); - } + var targetRow = this.props.data[rowIndex]; + onRowDoubleClick(targetRow); } }, { - key: '__handleKeyDown__REACT_HOT_LOADER__', - value: function __handleKeyDown__REACT_HOT_LOADER__(e) { - if (this.props.keyBoardNav) { - this.props.onKeyDown(e); + key: '__handleSelectRow__REACT_HOT_LOADER__', + value: function __handleSelectRow__REACT_HOT_LOADER__(rowIndex, isSelected, e) { + var selectedRow = void 0; + var _props3 = this.props, + data = _props3.data, + onSelectRow = _props3.onSelectRow; + + data.forEach(function (row, i) { + if (i === rowIndex - 1) { + selectedRow = row; + return false; + } + }); + onSelectRow(selectedRow, isSelected, e); + } + }, { + key: '__handleSelectRowColumChange__REACT_HOT_LOADER__', + value: function __handleSelectRowColumChange__REACT_HOT_LOADER__(e, rowIndex) { + if (!this.props.selectRow.clickToSelect || !this.props.selectRow.clickToSelectAndEditCell) { + this.handleSelectRow(rowIndex + 1, e.currentTarget.checked, e); } } }, { - key: 'render', - value: function render() { - var _props2 = this.props, - children = _props2.children, - columnTitle = _props2.columnTitle, - dataAlign = _props2.dataAlign, - hidden = _props2.hidden, - cellEdit = _props2.cellEdit, - attrs = _props2.attrs, - style = _props2.style, - isFocus = _props2.isFocus, - keyBoardNav = _props2.keyBoardNav, - tabIndex = _props2.tabIndex, - customNavStyle = _props2.customNavStyle, - withoutTabIndex = _props2.withoutTabIndex, - row = _props2.row; - var className = this.props.className; - + key: '__handleClickCell__REACT_HOT_LOADER__', + value: function __handleClickCell__REACT_HOT_LOADER__(rowIndex) { + var columnIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : -1; + var _props4 = this.props, + columns = _props4.columns, + keyField = _props4.keyField, + expandBy = _props4.expandBy, + expandableRow = _props4.expandableRow, + _props4$selectRow = _props4.selectRow, + clickToExpand = _props4$selectRow.clickToExpand, + hideSelectColumn = _props4$selectRow.hideSelectColumn, + onlyOneExpanding = _props4.onlyOneExpanding; - var tdStyle = _extends({ - textAlign: dataAlign, - display: hidden ? 'none' : null - }, style); + var selectRowAndExpand = this._isSelectRowDefined() && !clickToExpand ? false : true; + columnIndex = this._isSelectRowDefined() && !hideSelectColumn ? columnIndex - 1 : columnIndex; + columnIndex = this._isExpandColumnVisible() ? 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 */ + expandBy === _Const2.default.EXPAND_BY_COL && columnIndex < 0 || expandBy === _Const2.default.EXPAND_BY_COL && columns[columnIndex].expandable)) { + var expanding = this.props.expanding; + var rowKey = this.props.data[rowIndex - 1][keyField]; + var isRowExpanding = expanding.indexOf(rowKey) > -1; + + if (isRowExpanding) { + // collapse + expanding = expanding.filter(function (k) { + return k !== rowKey; + }); + } else { + // expand + if (onlyOneExpanding) expanding = [rowKey];else expanding.push(rowKey); + } + this.props.onExpand(expanding, rowKey, isRowExpanding); + } + } + }, { + key: '__handleEditCell__REACT_HOT_LOADER__', + value: function __handleEditCell__REACT_HOT_LOADER__(rowIndex, columnIndex, action, e) { + var selectRow = this.props.selectRow; - var opts = {}; + var defineSelectRow = this._isSelectRowDefined(); + var expandColumnVisible = this._isExpandColumnVisible(); + if (defineSelectRow) { + columnIndex--; + if (selectRow.hideSelectColumn) columnIndex++; + } + if (expandColumnVisible) { + columnIndex--; + } + rowIndex--; - if (cellEdit) { - if (cellEdit.mode === _Const2.default.CELL_EDIT_CLICK) { - opts.onClick = this.handleCellEdit; - } else if (cellEdit.mode === _Const2.default.CELL_EDIT_DBCLICK) { - opts.onDoubleClick = this.handleCellEdit; + if (action === 'tab') { + if (defineSelectRow && !selectRow.hideSelectColumn) columnIndex++; + if (expandColumnVisible) columnIndex++; + this.handleCompleteEditCell(e.target.value, rowIndex, columnIndex - 1); + if (columnIndex >= this.props.columns.length) { + this.handleCellKeyDown(e, true); } else { - opts.onClick = this.handleCellClick; + this.handleCellKeyDown(e); } + + var _nextEditableCell = this.nextEditableCell(rowIndex, columnIndex), + nextRIndex = _nextEditableCell.nextRIndex, + nextCIndex = _nextEditableCell.nextCIndex; + + rowIndex = nextRIndex; + columnIndex = nextCIndex; } - if (keyBoardNav && isFocus) { - opts.onKeyDown = this.handleKeyDown; + var stateObj = { + currEditCell: { + rid: rowIndex, + cid: columnIndex + } + }; + + if (this.props.selectRow.clickToSelectAndEditCell && this.props.cellEdit.mode !== _Const2.default.CELL_EDIT_DBCLICK) { + var selected = this.props.selectedRowKeys.indexOf(this.props.data[rowIndex][this.props.keyField]) !== -1; + this.handleSelectRow(rowIndex + 1, !selected, e); } + this.setState(function () { + return stateObj; + }); + } + }, { + key: '__nextEditableCell__REACT_HOT_LOADER__', + value: function __nextEditableCell__REACT_HOT_LOADER__(rIndex, cIndex) { + var keyField = this.props.keyField; - if (isFocus) { - if (customNavStyle) { - var cusmtStyle = _util2.default.isFunction(customNavStyle) ? customNavStyle(children, row) : customNavStyle; - tdStyle = _extends({}, tdStyle, cusmtStyle); + var nextRIndex = rIndex; + var nextCIndex = cIndex; + var row = void 0; + var column = void 0; + do { + if (nextCIndex >= this.props.columns.length) { + nextRIndex++; + nextCIndex = 0; + } + row = this.props.data[nextRIndex]; + column = this.props.columns[nextCIndex]; + if (!row) break; + var editable = column.editable; + if (_util2.default.isFunction(column.editable)) { + editable = column.editable(column, row, nextRIndex, nextCIndex); + } + if (editable && editable.readOnly !== true && !column.hidden && keyField !== column.name) { + break; } else { - className = className + ' default-focus-cell'; + nextCIndex++; + } + } while (row); + return { nextRIndex: nextRIndex, nextCIndex: nextCIndex }; + } + }, { + key: '__handleCompleteEditCell__REACT_HOT_LOADER__', + value: function __handleCompleteEditCell__REACT_HOT_LOADER__(newVal, rowIndex, columnIndex) { + if (newVal !== null) { + var result = this.props.onEditCell(newVal, rowIndex, columnIndex); + if (result !== _Const2.default.AWAIT_BEFORE_CELL_EDIT) { + this.setState(function () { + return { currEditCell: null }; + }); + } + } else { + this.setState(function () { + return { currEditCell: null }; + }); + } + } + }, { + key: '__cancelEditCell__REACT_HOT_LOADER__', + value: function __cancelEditCell__REACT_HOT_LOADER__() { + this.setState(function () { + return { currEditCell: null }; + }); + } + }, { + key: '__handleClickonSelectColumn__REACT_HOT_LOADER__', + value: function __handleClickonSelectColumn__REACT_HOT_LOADER__(e, isSelect, rowIndex, row) { + e.stopPropagation(); + if (e.target.tagName === 'TD' && (this.props.selectRow.clickToSelect || this.props.selectRow.clickToSelectAndEditCell)) { + var unselectable = this.props.selectRow.unselectable || []; + if (unselectable.indexOf(row[this.props.keyField]) === -1) { + this.handleSelectRow(rowIndex + 1, isSelect, e); + this.handleClickCell(rowIndex + 1); } } + } + }, { + key: 'renderSelectRowColumn', + value: function renderSelectRowColumn(selected, inputType, disabled) { + var CustomComponent = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; + + var _this2 = this; + + var rowIndex = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null; + var row = arguments[5]; - var attr = {}; - if (!withoutTabIndex) attr.tabIndex = tabIndex; return _react2.default.createElement( 'td', - _extends({}, attr, { style: tdStyle, - title: columnTitle, - className: className - }, opts, attrs), - typeof children === 'boolean' ? children.toString() : children + { onClick: function onClick(e) { + _this2.handleClickonSelectColumn(e, !selected, rowIndex, row); + }, style: { textAlign: 'center' } }, + CustomComponent ? _react2.default.createElement(CustomComponent, { type: inputType, checked: selected, disabled: disabled, + rowIndex: rowIndex, + onChange: function onChange(e) { + return _this2.handleSelectRowColumChange(e, rowIndex); + } }) : _react2.default.createElement('input', { type: inputType, checked: selected, disabled: disabled, + onChange: function onChange(e) { + return _this2.handleSelectRowColumChange(e, rowIndex); + } }) ); } - }]); - - return TableColumn; - }(_react.Component); + }, { + key: 'renderExpandRowColumn', + value: function renderExpandRowColumn(isExpandableRow, isExpanded, CustomComponent) { + var _this3 = this; - TableColumn.propTypes = { - rIndex: _react.PropTypes.number, - dataAlign: _react.PropTypes.string, - hidden: _react.PropTypes.bool, - className: _react.PropTypes.string, - columnTitle: _react.PropTypes.string, - children: _react.PropTypes.node, - onClick: _react.PropTypes.func, - attrs: _react.PropTypes.object, - style: _react.PropTypes.object, - isFocus: _react.PropTypes.bool, - onKeyDown: _react.PropTypes.func, - tabIndex: _react.PropTypes.string, - withoutTabIndex: _react.PropTypes.bool, - 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 */ - }; + var rowIndex = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; - TableColumn.defaultProps = { - dataAlign: 'left', - withoutTabIndex: false, - hidden: false, - className: '', - isFocus: false, - keyBoardNav: false + var content = null; + if (CustomComponent) { + content = _react2.default.createElement(CustomComponent, { isExpandableRow: isExpandableRow, isExpanded: isExpanded }); + } else if (isExpandableRow) { + content = isExpanded ? _react2.default.createElement('span', { className: 'glyphicon glyphicon-minus' }) : _react2.default.createElement('span', { className: 'glyphicon glyphicon-plus' }); + } else { + content = ' '; + } + + return _react2.default.createElement( + 'td', + { + className: 'react-bs-table-expand-cell', + onClick: function onClick() { + return _this3.handleClickCell(rowIndex + 1); + } }, + content + ); + } + }, { + key: '_isSelectRowDefined', + value: function _isSelectRowDefined() { + return this.props.selectRow.mode === _Const2.default.ROW_SELECT_SINGLE || this.props.selectRow.mode === _Const2.default.ROW_SELECT_MULTI; + } + }, { + key: '_isExpandColumnVisible', + value: function _isExpandColumnVisible() { + return this.props.expandColumnOptions.expandColumnVisible; + } + }, { + key: '__getHeaderColGrouop__REACT_HOT_LOADER__', + value: function __getHeaderColGrouop__REACT_HOT_LOADER__() { + return this.refs.header.childNodes; + } + }]); + + return TableBody; + }(_react.Component); + + TableBody.propTypes = { + data: _propTypes2.default.array, + columns: _propTypes2.default.array, + striped: _propTypes2.default.bool, + bordered: _propTypes2.default.bool, + hover: _propTypes2.default.bool, + condensed: _propTypes2.default.bool, + keyField: _propTypes2.default.string, + selectedRowKeys: _propTypes2.default.array, + onRowClick: _propTypes2.default.func, + onRowDoubleClick: _propTypes2.default.func, + onSelectRow: _propTypes2.default.func, + noDataText: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]), + withoutNoDataText: _propTypes2.default.bool, + style: _propTypes2.default.object, + tableBodyClass: _propTypes2.default.string, + bodyContainerClass: _propTypes2.default.string, + expandableRow: _propTypes2.default.func, + expandComponent: _propTypes2.default.func, + expandRowBgColor: _propTypes2.default.string, + expandBy: _propTypes2.default.string, + expanding: _propTypes2.default.array, + onExpand: _propTypes2.default.func, + expandBodyClass: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]), + expandParentClass: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]), + onlyOneExpanding: _propTypes2.default.bool, + beforeShowError: _propTypes2.default.func, + keyBoardNav: _propTypes2.default.oneOfType([_propTypes2.default.bool, _propTypes2.default.object]), + x: _propTypes2.default.number, + y: _propTypes2.default.number, + onNavigateCell: _propTypes2.default.func, + withoutTabIndex: _propTypes2.default.bool }; - var _default = TableColumn; + var _default = TableBody; exports.default = _default; ; @@ -4607,16 +4552,16 @@ return /******/ (function(modules) { // webpackBootstrap return; } - __REACT_HOT_LOADER__.register(TableColumn, 'TableColumn', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/TableColumn.js'); + __REACT_HOT_LOADER__.register(TableBody, 'TableBody', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/TableBody.js'); - __REACT_HOT_LOADER__.register(_default, 'default', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/TableColumn.js'); + __REACT_HOT_LOADER__.register(_default, 'default', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/TableBody.js'); }(); ; -/***/ }, -/* 13 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 19 */ +/***/ (function(module, exports, __webpack_require__) { 'use strict'; @@ -4624,37 +4569,163 @@ 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 _react = __webpack_require__(2); - 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 _react2 = _interopRequireDefault(_react); - 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 _Const = __webpack_require__(13); - var _react = __webpack_require__(2); + var _Const2 = _interopRequireDefault(_Const); - var _react2 = _interopRequireDefault(_react); + var _classnames = __webpack_require__(12); - var _reactDom = __webpack_require__(6); + var _classnames2 = _interopRequireDefault(_classnames); - var _reactDom2 = _interopRequireDefault(_reactDom); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - var _Editor = __webpack_require__(14); + var _default = { + renderReactSortCaret: function renderReactSortCaret(order) { + var orderClass = (0, _classnames2.default)('order', { + 'dropup': order === _Const2.default.SORT_ASC + }); + return _react2.default.createElement( + 'span', + { className: orderClass }, + _react2.default.createElement('span', { className: 'caret', style: { margin: '10px 5px' } }) + ); + }, + isFunction: function isFunction(obj) { + return obj && typeof obj === 'function'; + }, + getScrollBarWidth: function getScrollBarWidth() { + var inner = document.createElement('p'); + inner.style.width = '100%'; + inner.style.height = '200px'; - var _Editor2 = _interopRequireDefault(_Editor); + var outer = document.createElement('div'); + outer.style.position = 'absolute'; + outer.style.top = '0px'; + outer.style.left = '0px'; + outer.style.visibility = 'hidden'; + outer.style.width = '200px'; + outer.style.height = '150px'; + outer.style.overflow = 'hidden'; + outer.appendChild(inner); + + document.body.appendChild(outer); + var w1 = inner.getBoundingClientRect().width; + outer.style.overflow = 'scroll'; + var w2 = inner.getBoundingClientRect().width; + + if (w1 === w2) w2 = outer.clientWidth; + + document.body.removeChild(outer); + + return w1 - w2; + }, + canUseDOM: function canUseDOM() { + return typeof window !== 'undefined' && typeof window.document !== 'undefined'; + }, + + + // We calculate an offset here in order to properly fetch the indexed data, + // despite the page start index not always being 1 + getNormalizedPage: function getNormalizedPage(pageStartIndex, page) { + pageStartIndex = this.getFirstPage(pageStartIndex); + if (page === undefined) page = pageStartIndex; + var offset = Math.abs(_Const2.default.PAGE_START_INDEX - pageStartIndex); + return page + offset; + }, + getFirstPage: function getFirstPage(pageStartIndex) { + return pageStartIndex !== undefined ? pageStartIndex : _Const2.default.PAGE_START_INDEX; + }, + renderColGroup: function renderColGroup(columns, selectRow) { + var expandColumnOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + var selectRowHeader = null; + var expandRowHeader = null; + var isSelectRowDefined = selectRow.mode === _Const2.default.ROW_SELECT_SINGLE || selectRow.mode === _Const2.default.ROW_SELECT_MULTI; + if (isSelectRowDefined) { + var style = { + width: selectRow.columnWidth || '30px', + minWidth: selectRow.columnWidth || '30px' + }; + if (!selectRow.hideSelectColumn) { + selectRowHeader = _react2.default.createElement('col', { key: 'select-col', style: style }); + } + } + if (expandColumnOptions.expandColumnVisible) { + var _style = { + width: expandColumnOptions.columnWidth || 30, + minWidth: expandColumnOptions.columnWidth || 30 + }; + expandRowHeader = _react2.default.createElement('col', { key: 'expand-col', style: _style }); + } + var theader = columns.map(function (column, i) { + var style = { + display: column.hidden ? 'none' : null + }; + if (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 = width; + } + return _react2.default.createElement('col', { style: style, key: i, className: column.className }); + }); + + return _react2.default.createElement( + 'colgroup', + null, + expandColumnOptions.expandColumnVisible && expandColumnOptions.expandColumnBeforeSelectColumn && expandRowHeader, + selectRowHeader, + expandColumnOptions.expandColumnVisible && !expandColumnOptions.expandColumnBeforeSelectColumn && expandRowHeader, + theader + ); + } + }; /* eslint react/display-name: 0 */ + + exports.default = _default; + ; + + var _temp = function () { + if (typeof __REACT_HOT_LOADER__ === 'undefined') { + return; + } + + __REACT_HOT_LOADER__.register(_default, 'default', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/util.js'); + }(); + + ; + +/***/ }), +/* 20 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); - var _Notification = __webpack_require__(15); + 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 _Notification2 = _interopRequireDefault(_Notification); + 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 _classnames = __webpack_require__(3); + var _classnames = __webpack_require__(12); var _classnames2 = _interopRequireDefault(_classnames); - var _Const = __webpack_require__(4); + var _react = __webpack_require__(2); - var _Const2 = _interopRequireDefault(_Const); + var _react2 = _interopRequireDefault(_react); + + var _propTypes = __webpack_require__(3); + + var _propTypes2 = _interopRequireDefault(_propTypes); - var _util = __webpack_require__(10); + var _util = __webpack_require__(19); var _util2 = _interopRequireDefault(_util); @@ -4664,298 +4735,184 @@ return /******/ (function(modules) { // webpackBootstrap 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-nested-ternary: 0 */ - var TableEditColumn = function (_Component) { - _inherits(TableEditColumn, _Component); - function TableEditColumn(props) { - _classCallCheck(this, TableEditColumn); + var TableRow = function (_Component) { + _inherits(TableRow, _Component); - var _this = _possibleConstructorReturn(this, (TableEditColumn.__proto__ || Object.getPrototypeOf(TableEditColumn)).call(this, props)); + function TableRow(props) { + _classCallCheck(this, TableRow); - _this.handleKeyPress = function () { - return _this.__handleKeyPress__REACT_HOT_LOADER__.apply(_this, arguments); + var _this = _possibleConstructorReturn(this, (TableRow.__proto__ || Object.getPrototypeOf(TableRow)).call(this, props)); + + _this.rowClick = function () { + return _this.__rowClick__REACT_HOT_LOADER__.apply(_this, arguments); }; - _this.handleBlur = function () { - return _this.__handleBlur__REACT_HOT_LOADER__.apply(_this, arguments); + _this.expandRow = function () { + return _this.__expandRow__REACT_HOT_LOADER__.apply(_this, arguments); }; - _this.handleCustomUpdate = function () { - return _this.__handleCustomUpdate__REACT_HOT_LOADER__.apply(_this, arguments); + _this.rowDoubleClick = function () { + return _this.__rowDoubleClick__REACT_HOT_LOADER__.apply(_this, arguments); }; - _this.notifyToastr = function () { - return _this.__notifyToastr__REACT_HOT_LOADER__.apply(_this, arguments); + _this.rowMouseOut = function () { + return _this.__rowMouseOut__REACT_HOT_LOADER__.apply(_this, arguments); }; - _this.handleClick = function () { - return _this.__handleClick__REACT_HOT_LOADER__.apply(_this, arguments); + _this.rowMouseOver = function () { + return _this.__rowMouseOver__REACT_HOT_LOADER__.apply(_this, arguments); }; - _this.timeouteClear = 0; - var _this$props = _this.props, - fieldValue = _this$props.fieldValue, - row = _this$props.row, - className = _this$props.className; - - _this.focusInEditor = _this.focusInEditor.bind(_this); - _this.state = { - shakeEditor: false, - className: _util2.default.isFunction(className) ? className(fieldValue, row) : className - }; + _this.clickNum = 0; return _this; } - _createClass(TableEditColumn, [{ - key: 'valueShortCircuit', - value: function valueShortCircuit(value) { - return value === null || typeof value === 'undefined' ? '' : value; - } - }, { - key: '__handleKeyPress__REACT_HOT_LOADER__', - value: function __handleKeyPress__REACT_HOT_LOADER__(e) { - if (e.keyCode === 13 || e.keyCode === 9) { - // Pressed ENTER - var value = e.currentTarget.type === 'checkbox' ? this._getCheckBoxValue(e) : e.currentTarget.value; + _createClass(TableRow, [{ + key: '__rowClick__REACT_HOT_LOADER__', + value: function __rowClick__REACT_HOT_LOADER__(e) { + var _this2 = this; - if (!this.validator(value)) { - return; - } - if (e.keyCode === 13) { - this.props.completeEdit(value, this.props.rowIndex, this.props.colIndex); + var rowIndex = this.props.index + 1; + var cellIndex = e.target.cellIndex; + if (this.props.onRowClick) this.props.onRowClick(rowIndex, cellIndex); + var _props = this.props, + selectRow = _props.selectRow, + unselectableRow = _props.unselectableRow, + isSelected = _props.isSelected, + onSelectRow = _props.onSelectRow, + onExpandRow = _props.onExpandRow; + + if (selectRow) { + if (selectRow.clickToSelect && !unselectableRow) { + onSelectRow(rowIndex, !isSelected, e); + } else if (selectRow.clickToSelectAndEditCell && !unselectableRow) { + this.clickNum++; + /** if clickToSelectAndEditCell is enabled, + * there should be a delay to prevent a selection changed when + * user dblick to edit cell on same row but different cell + **/ + setTimeout(function () { + if (_this2.clickNum === 1) { + onSelectRow(rowIndex, !isSelected, e); + onExpandRow(rowIndex, cellIndex); + } + _this2.clickNum = 0; + }, 200); } else { - this.props.onTab(this.props.rowIndex + 1, this.props.colIndex + 1, 'tab', e); - e.preventDefault(); - } - } else if (e.keyCode === 27) { - this.props.completeEdit(null, this.props.rowIndex, this.props.colIndex); - } else if (e.type === 'click' && !this.props.blurToSave) { - // textarea click save button - var _value = e.target.parentElement.firstChild.value; - if (!this.validator(_value)) { - return; - } - this.props.completeEdit(_value, this.props.rowIndex, this.props.colIndex); - } - } - }, { - key: '__handleBlur__REACT_HOT_LOADER__', - value: function __handleBlur__REACT_HOT_LOADER__(e) { - e.stopPropagation(); - if (this.props.blurToSave) { - var value = e.currentTarget.type === 'checkbox' ? this._getCheckBoxValue(e) : e.currentTarget.value; - if (!this.validator(value)) { - return false; + this.expandRow(rowIndex, cellIndex); } - this.props.completeEdit(value, this.props.rowIndex, this.props.colIndex); - } - } - }, { - key: '__handleCustomUpdate__REACT_HOT_LOADER__', - - - // 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); } }, { - key: 'validator', - value: function validator(value) { - var ts = this; - var valid = true; - if (ts.props.editable.validator) { - var checkVal = ts.props.editable.validator(value, this.props.row); - var responseType = typeof checkVal === 'undefined' ? 'undefined' : _typeof(checkVal); - if (responseType !== 'object' && checkVal !== true) { - valid = false; - this.notifyToastr('error', checkVal, _Const2.default.CANCEL_TOASTR); - } else if (responseType === 'object' && checkVal.isValid !== true) { - valid = false; - this.notifyToastr(checkVal.notification.type, checkVal.notification.msg, checkVal.notification.title); - } - if (!valid) { - // animate input - ts.clearTimeout(); - var _props = this.props, - invalidColumnClassName = _props.invalidColumnClassName, - row = _props.row; + key: '__expandRow__REACT_HOT_LOADER__', + value: function __expandRow__REACT_HOT_LOADER__(rowIndex, cellIndex) { + var _this3 = this; - var className = _util2.default.isFunction(invalidColumnClassName) ? invalidColumnClassName(value, row) : invalidColumnClassName; - ts.setState({ shakeEditor: true, className: className }); - ts.timeouteClear = setTimeout(function () { - ts.setState({ shakeEditor: false }); - }, 300); - this.focusInEditor(); - return valid; + this.clickNum++; + setTimeout(function () { + if (_this3.clickNum === 1) { + _this3.props.onExpandRow(rowIndex, cellIndex); } - } - return valid; - } - // END - - }, { - key: '__notifyToastr__REACT_HOT_LOADER__', - value: function __notifyToastr__REACT_HOT_LOADER__(type, message, title) { - var toastr = true; - var beforeShowError = this.props.beforeShowError; - - if (beforeShowError) { - toastr = beforeShowError(type, message, title); - } - if (toastr) { - this.refs.notifier.notice(type, message, title); - } - } - }, { - key: 'clearTimeout', - value: function (_clearTimeout) { - function clearTimeout() { - return _clearTimeout.apply(this, arguments); - } - - clearTimeout.toString = function () { - return _clearTimeout.toString(); - }; - - return clearTimeout; - }(function () { - if (this.timeouteClear !== 0) { - clearTimeout(this.timeouteClear); - this.timeouteClear = 0; - } - }) - }, { - key: 'componentDidMount', - value: function componentDidMount() { - this.focusInEditor(); - var dom = _reactDom2.default.findDOMNode(this); - if (this.props.isFocus) { - dom.focus(); - } else { - dom.blur(); - } + _this3.clickNum = 0; + }, 200); } }, { - key: 'componentDidUpdate', - value: function componentDidUpdate() { - var dom = _reactDom2.default.findDOMNode(this); - if (this.props.isFocus) { - dom.focus(); - } else { - dom.blur(); + key: '__rowDoubleClick__REACT_HOT_LOADER__', + value: function __rowDoubleClick__REACT_HOT_LOADER__(e) { + if (e.target.tagName !== 'INPUT' && e.target.tagName !== 'SELECT' && e.target.tagName !== 'TEXTAREA') { + if (this.props.onRowDoubleClick) { + this.props.onRowDoubleClick(this.props.index); + } } } }, { - key: 'componentWillUnmount', - value: function componentWillUnmount() { - this.clearTimeout(); - } - }, { - key: 'focusInEditor', - value: function focusInEditor() { - if (_util2.default.isFunction(this.refs.inputRef.focus)) { - this.refs.inputRef.focus(); + key: '__rowMouseOut__REACT_HOT_LOADER__', + value: function __rowMouseOut__REACT_HOT_LOADER__(e) { + var rowIndex = this.props.index; + if (this.props.onRowMouseOut) { + this.props.onRowMouseOut(rowIndex, e); } } }, { - key: '__handleClick__REACT_HOT_LOADER__', - value: function __handleClick__REACT_HOT_LOADER__(e) { - if (e.target.tagName !== 'TD') { - e.stopPropagation(); + key: '__rowMouseOver__REACT_HOT_LOADER__', + value: function __rowMouseOver__REACT_HOT_LOADER__(e) { + var rowIndex = this.props.index; + if (this.props.onRowMouseOver) { + this.props.onRowMouseOver(rowIndex, e); } } }, { key: 'render', value: function render() { + this.clickNum = 0; var _props2 = this.props, - editable = _props2.editable, - format = _props2.format, - customEditor = _props2.customEditor, - isFocus = _props2.isFocus, - customStyleWithNav = _props2.customStyleWithNav, - row = _props2.row; - var shakeEditor = this.state.shakeEditor; + selectRow = _props2.selectRow, + row = _props2.row, + isSelected = _props2.isSelected, + className = _props2.className, + index = _props2.index; + var style = this.props.style; - 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 + var backgroundColor = null; + var selectRowClass = null; - editable.placeholder && (attr.placeholder = editable.placeholder); + if (selectRow) { + backgroundColor = _util2.default.isFunction(selectRow.bgColor) ? selectRow.bgColor(row, isSelected) : isSelected ? selectRow.bgColor : null; - var editorClass = (0, _classnames2.default)({ 'animated': shakeEditor, 'shake': shakeEditor }); - fieldValue = fieldValue === 0 ? '0' : fieldValue; - var cellEditor = void 0; - if (customEditor) { - var customEditorProps = _extends({ - row: row - }, attr, { - defaultValue: this.valueShortCircuit(fieldValue) - }, customEditor.customEditorParameters); - cellEditor = customEditor.getElement(this.handleCustomUpdate, customEditorProps); - } else { - cellEditor = (0, _Editor2.default)(editable, attr, format, editorClass, this.valueShortCircuit(fieldValue)); + selectRowClass = _util2.default.isFunction(selectRow.className) ? selectRow.className(row, isSelected) : isSelected ? selectRow.className : null; } - if (isFocus) { - if (customStyleWithNav) { - var customStyle = _util2.default.isFunction(customStyleWithNav) ? customStyleWithNav(fieldValue, row) : customStyleWithNav; - style = _extends({}, style, customStyle); - } else { - className = className + ' default-focus-cell'; - } + if (_util2.default.isFunction(style)) { + style = style(row, index); + } else { + style = _extends({}, style) || {}; + } + // the bgcolor of row selection always overwrite the bgcolor defined by global. + if (style && backgroundColor && isSelected) { + style.backgroundColor = backgroundColor; } + var trCss = { + style: _extends({}, style), + className: (0, _classnames2.default)(selectRowClass, className) + }; return _react2.default.createElement( - 'td', - { ref: 'td', - style: style, - className: className, - onClick: this.handleClick }, - cellEditor, - _react2.default.createElement(_Notification2.default, { ref: 'notifier' }) + 'tr', + _extends({}, trCss, { + onMouseOver: this.rowMouseOver, + onMouseOut: this.rowMouseOut, + onClick: this.rowClick, + onDoubleClick: this.rowDoubleClick }), + this.props.children ); } - }, { - key: '_getCheckBoxValue', - value: function _getCheckBoxValue(e) { - var value = ''; - var values = e.currentTarget.value.split(':'); - value = e.currentTarget.checked ? values[0] : values[1]; - return value; - } }]); - return TableEditColumn; + return TableRow; }(_react.Component); - TableEditColumn.propTypes = { - completeEdit: _react.PropTypes.func, - rowIndex: _react.PropTypes.number, - colIndex: _react.PropTypes.number, - blurToSave: _react.PropTypes.bool, - editable: _react.PropTypes.oneOfType([_react.PropTypes.bool, _react.PropTypes.object]), - format: _react.PropTypes.oneOfType([_react.PropTypes.bool, _react.PropTypes.func]), - 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, - isFocus: _react.PropTypes.bool, - customStyleWithNav: _react.PropTypes.oneOfType([_react.PropTypes.func, _react.PropTypes.object]) + TableRow.propTypes = { + index: _propTypes2.default.number, + row: _propTypes2.default.any, + style: _propTypes2.default.any, + isSelected: _propTypes2.default.bool, + enableCellEdit: _propTypes2.default.bool, + onRowClick: _propTypes2.default.func, + onRowDoubleClick: _propTypes2.default.func, + onSelectRow: _propTypes2.default.func, + onExpandRow: _propTypes2.default.func, + onRowMouseOut: _propTypes2.default.func, + onRowMouseOver: _propTypes2.default.func, + unselectableRow: _propTypes2.default.bool }; - - var _default = TableEditColumn; + TableRow.defaultProps = { + onRowClick: undefined, + onRowDoubleClick: undefined + }; + var _default = TableRow; exports.default = _default; ; @@ -4964,16 +4921,16 @@ return /******/ (function(modules) { // webpackBootstrap return; } - __REACT_HOT_LOADER__.register(TableEditColumn, 'TableEditColumn', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/TableEditColumn.js'); + __REACT_HOT_LOADER__.register(TableRow, 'TableRow', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/TableRow.js'); - __REACT_HOT_LOADER__.register(_default, 'default', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/TableEditColumn.js'); + __REACT_HOT_LOADER__.register(_default, 'default', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/TableRow.js'); }(); ; -/***/ }, -/* 14 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 21 */ +/***/ (function(module, exports, __webpack_require__) { 'use strict'; @@ -4981,170 +4938,31 @@ 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 _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 }; } - - var editor = function editor(editable, attr, format, editorClass, defaultValue, ignoreEditable) { - if (editable === true || editable === false && ignoreEditable || typeof editable === 'string') { - // simple declare - var type = editable ? 'text' : editable; - return _react2.default.createElement('input', _extends({}, attr, { type: type, defaultValue: defaultValue, - className: (editorClass || '') + ' form-control editor edit-text' })); - } else if (!editable) { - var _type = editable ? 'text' : editable; - return _react2.default.createElement('input', _extends({}, attr, { type: _type, defaultValue: defaultValue, - disabled: 'disabled', - className: (editorClass || '') + ' form-control editor edit-text' })); - } else if (editable && (editable.type === undefined || editable.type === null || editable.type.trim() === '')) { - var _type2 = editable ? 'text' : editable; - return _react2.default.createElement('input', _extends({}, attr, { type: _type2, defaultValue: defaultValue, - className: (editorClass || '') + ' form-control editor edit-text' })); - } else if (editable.type) { - // standard declare - // put style if exist - editable.style && (attr.style = editable.style); - // put class if exist - attr.className = (editorClass || '') + ' form-control editor edit-' + editable.type + (editable.className ? ' ' + editable.className : ''); - - if (editable.type === 'select') { - var _ret = function () { - // process select input - var options = []; - var _editable$options = editable.options, - values = _editable$options.values, - textKey = _editable$options.textKey, - valueKey = _editable$options.valueKey; - - if (Array.isArray(values)) { - (function () { - // only can use arrray data for options - var text = void 0; - var value = void 0; - options = values.map(function (option, i) { - if ((typeof option === 'undefined' ? 'undefined' : _typeof(option)) === 'object') { - text = textKey ? option[textKey] : option.text; - value = valueKey ? option[valueKey] : option.value; - } else { - text = format ? format(option) : option; - value = option; - } - return _react2.default.createElement( - 'option', - { key: 'option' + i, value: value }, - text - ); - }); - })(); - } - return { - v: _react2.default.createElement( - 'select', - _extends({}, attr, { defaultValue: defaultValue }), - options - ) - }; - }(); - - if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === "object") return _ret.v; - } else if (editable.type === 'textarea') { - var _ret3 = function () { - // process textarea input - // put other if exist - editable.cols && (attr.cols = editable.cols); - editable.rows && (attr.rows = editable.rows); - var saveBtn = void 0; - var keyUpHandler = attr.onKeyDown; - if (keyUpHandler) { - attr.onKeyDown = function (e) { - if (e.keyCode !== 13) { - // not Pressed ENTER - keyUpHandler(e); - } - }; - saveBtn = _react2.default.createElement( - 'button', - { - className: 'btn btn-info btn-xs textarea-save-btn', - onClick: keyUpHandler }, - 'save' - ); - } - return { - v: _react2.default.createElement( - 'div', - null, - _react2.default.createElement('textarea', _extends({}, attr, { defaultValue: defaultValue })), - saveBtn - ) - }; - }(); - - if ((typeof _ret3 === 'undefined' ? 'undefined' : _typeof(_ret3)) === "object") return _ret3.v; - } else if (editable.type === 'checkbox') { - var _values = 'true:false'; - if (editable.options && editable.options.values) { - // values = editable.options.values.split(':'); - _values = editable.options.values; - } - attr.className = attr.className.replace('form-control', ''); - attr.className += ' checkbox pull-right'; - - var checked = defaultValue && defaultValue.toString() === _values.split(':')[0] ? true : false; - - return _react2.default.createElement('input', _extends({}, attr, { type: 'checkbox', - value: _values, defaultChecked: checked })); - } else if (editable.type === 'datetime') { - return _react2.default.createElement('input', _extends({}, attr, { type: 'datetime-local', defaultValue: defaultValue })); - } else { - // process other input type. as password,url,email... - return _react2.default.createElement('input', _extends({}, attr, { type: editable.type, defaultValue: defaultValue })); - } - } - // default return for other case of editable - return _react2.default.createElement('input', _extends({}, attr, { type: 'text', - className: (editorClass || '') + ' form-control editor edit-text' })); - }; - - var _default = editor; - exports.default = _default; - ; - - var _temp = function () { - if (typeof __REACT_HOT_LOADER__ === 'undefined') { - return; - } - - __REACT_HOT_LOADER__.register(editor, 'editor', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/Editor.js'); - - __REACT_HOT_LOADER__.register(_default, 'default', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/Editor.js'); - }(); - - ; + var _propTypes = __webpack_require__(3); -/***/ }, -/* 15 */ -/***/ function(module, exports, __webpack_require__) { + var _propTypes2 = _interopRequireDefault(_propTypes); - 'use strict'; + var _reactDom = __webpack_require__(15); - Object.defineProperty(exports, "__esModule", { - value: true - }); + var _reactDom2 = _interopRequireDefault(_reactDom); - 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 _Const = __webpack_require__(13); - var _react = __webpack_require__(2); + var _Const2 = _interopRequireDefault(_Const); - var _react2 = _interopRequireDefault(_react); + var _util = __webpack_require__(19); - var _reactToastr = __webpack_require__(16); + var _util2 = _interopRequireDefault(_util); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -5154,7455 +4972,3227 @@ return /******/ (function(modules) { // webpackBootstrap 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 ToastrMessageFactory = _react2.default.createFactory(_reactToastr.ToastMessage.animation); - - var Notification = function (_Component) { - _inherits(Notification, _Component); + var TableColumn = function (_Component) { + _inherits(TableColumn, _Component); - function Notification() { - _classCallCheck(this, Notification); + function TableColumn(props) { + _classCallCheck(this, TableColumn); - return _possibleConstructorReturn(this, (Notification.__proto__ || Object.getPrototypeOf(Notification)).apply(this, arguments)); - } + var _this = _possibleConstructorReturn(this, (TableColumn.__proto__ || Object.getPrototypeOf(TableColumn)).call(this, props)); - _createClass(Notification, [{ - key: 'notice', - - // allow type is success,info,warning,error - value: function notice(type, msg, title) { - this.refs.toastr[type](msg, title, { - mode: 'single', - timeOut: 5000, - extendedTimeOut: 1000, - showAnimation: 'animated bounceIn', - hideAnimation: 'animated bounceOut' - }); - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement(_reactToastr.ToastContainer, { ref: 'toastr', - toastMessageFactory: ToastrMessageFactory, - id: 'toast-container', - className: 'toast-top-right' }); - } - }]); + _this.handleCellEdit = function () { + return _this.__handleCellEdit__REACT_HOT_LOADER__.apply(_this, arguments); + }; - return Notification; - }(_react.Component); + _this.handleCellClick = function () { + return _this.__handleCellClick__REACT_HOT_LOADER__.apply(_this, arguments); + }; - var _default = Notification; - exports.default = _default; - ; + _this.handleKeyDown = function () { + return _this.__handleKeyDown__REACT_HOT_LOADER__.apply(_this, arguments); + }; - var _temp = function () { - if (typeof __REACT_HOT_LOADER__ === 'undefined') { - return; + return _this; } + /* eslint no-unused-vars: [0, { "args": "after-used" }] */ - __REACT_HOT_LOADER__.register(ToastrMessageFactory, 'ToastrMessageFactory', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/Notification.js'); - - __REACT_HOT_LOADER__.register(Notification, 'Notification', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/Notification.js'); - - __REACT_HOT_LOADER__.register(_default, 'default', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/Notification.js'); - }(); - - ; - -/***/ }, -/* 16 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.ToastMessage = exports.ToastContainer = undefined; - - var _ToastContainer = __webpack_require__(17); - - var _ToastContainer2 = _interopRequireDefault(_ToastContainer); - - var _ToastMessage = __webpack_require__(173); - - var _ToastMessage2 = _interopRequireDefault(_ToastMessage); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - exports.ToastContainer = _ToastContainer2.default; - exports.ToastMessage = _ToastMessage2.default; - -/***/ }, -/* 17 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _omit2 = __webpack_require__(18); - - var _omit3 = _interopRequireDefault(_omit2); - - var _includes2 = __webpack_require__(155); - - var _includes3 = _interopRequireDefault(_includes2); - - 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); + _createClass(TableColumn, [{ + key: 'shouldComponentUpdate', + value: function shouldComponentUpdate(nextProps, nextState) { + var children = this.props.children; - var _react2 = _interopRequireDefault(_react); + 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(); - var _reactAddonsUpdate = __webpack_require__(166); + if (shouldUpdated) { + return shouldUpdated; + } - var _reactAddonsUpdate2 = _interopRequireDefault(_reactAddonsUpdate); + if ((typeof children === 'undefined' ? 'undefined' : _typeof(children)) === 'object' && children !== null && children.props !== null) { + if (children.props.type === 'checkbox' || children.props.type === 'radio') { + shouldUpdated = shouldUpdated || children.props.type !== nextProps.children.props.type || children.props.checked !== nextProps.children.props.checked || children.props.disabled !== nextProps.children.props.disabled; + } else { + shouldUpdated = true; + } + } else { + shouldUpdated = shouldUpdated || children !== nextProps.children; + } - var _ToastMessage = __webpack_require__(173); + if (shouldUpdated) { + return shouldUpdated; + } - var _ToastMessage2 = _interopRequireDefault(_ToastMessage); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return 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 ToastContainer = function (_Component) { - _inherits(ToastContainer, _Component); - - function ToastContainer() { - var _ref; - - var _temp, _this, _ret; - - _classCallCheck(this, ToastContainer); - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = ToastContainer.__proto__ || Object.getPrototypeOf(ToastContainer)).call.apply(_ref, [this].concat(args))), _this), _this.state = { - toasts: [], - toastId: 0, - messageList: [] - }, _this._handle_toast_remove = _this._handle_toast_remove.bind(_this), _temp), _possibleConstructorReturn(_this, _ret); - } - - _createClass(ToastContainer, [{ - key: "error", - value: function error(message, title, optionsOverride) { - this._notify(this.props.toastType.error, message, title, optionsOverride); + if (!(this.props.cellEdit && nextProps.cellEdit)) { + return false; + } else { + return shouldUpdated || this.props.cellEdit.mode !== nextProps.cellEdit.mode; + } } }, { - key: "info", - value: function info(message, title, optionsOverride) { - this._notify(this.props.toastType.info, message, title, optionsOverride); + key: 'componentDidMount', + value: function componentDidMount() { + var dom = _reactDom2.default.findDOMNode(this); + if (this.props.isFocus) { + dom.focus(); + } else { + dom.blur(); + } } }, { - key: "success", - value: function success(message, title, optionsOverride) { - this._notify(this.props.toastType.success, message, title, optionsOverride); + key: 'componentDidUpdate', + value: function componentDidUpdate() { + var dom = _reactDom2.default.findDOMNode(this); + if (this.props.isFocus) { + dom.focus(); + } else { + dom.blur(); + } } }, { - key: "warning", - value: function warning(message, title, optionsOverride) { - this._notify(this.props.toastType.warning, message, title, optionsOverride); + key: '__handleCellEdit__REACT_HOT_LOADER__', + value: function __handleCellEdit__REACT_HOT_LOADER__(e) { + if (this.props.cellEdit.mode === _Const2.default.CELL_EDIT_DBCLICK) { + if (document.selection && document.selection.empty) { + document.selection.empty(); + } else if (window.getSelection) { + var sel = window.getSelection(); + sel.removeAllRanges(); + } + } + this.props.onEdit(this.props.rIndex + 1, e.currentTarget.cellIndex, e); + if (this.props.cellEdit.mode !== _Const2.default.CELL_EDIT_DBCLICK) { + this.props.onClick(this.props.rIndex + 1, e.currentTarget.cellIndex, e); + } } }, { - key: "clear", - value: function clear() { - var _this2 = this; + key: '__handleCellClick__REACT_HOT_LOADER__', + value: function __handleCellClick__REACT_HOT_LOADER__(e) { + var _props = this.props, + onClick = _props.onClick, + rIndex = _props.rIndex; - Object.keys(this.refs).forEach(function (key) { - _this2.refs[key].hideToast(false); - }); + if (onClick) { + onClick(rIndex + 1, e.currentTarget.cellIndex, e); + } } }, { - key: "_notify", - value: function _notify(type, message, title) { - var _this3 = this; + 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, + dataAlign = _props2.dataAlign, + hidden = _props2.hidden, + cellEdit = _props2.cellEdit, + attrs = _props2.attrs, + style = _props2.style, + isFocus = _props2.isFocus, + keyBoardNav = _props2.keyBoardNav, + tabIndex = _props2.tabIndex, + customNavStyle = _props2.customNavStyle, + withoutTabIndex = _props2.withoutTabIndex, + row = _props2.row; + var className = this.props.className; - var optionsOverride = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; - if (this.props.preventDuplicates) { - if ((0, _includes3.default)(this.state.messageList, message)) { - return; - } - } - var key = this.state.toastId++; - var toastId = key; - var newToast = (0, _reactAddonsUpdate2.default)(optionsOverride, { - $merge: { - type: type, - title: title, - message: message, - toastId: toastId, - key: key, - ref: "toasts__" + key, - handleOnClick: function handleOnClick(e) { - if ("function" === typeof optionsOverride.handleOnClick) { - optionsOverride.handleOnClick(); - } - return _this3._handle_toast_on_click(e); - }, - handleRemove: this._handle_toast_remove - } - }); - var toastOperation = _defineProperty({}, "" + (this.props.newestOnTop ? "$unshift" : "$push"), [newToast]); + var tdStyle = _extends({ + textAlign: dataAlign, + display: hidden ? 'none' : null + }, style); - var messageOperation = _defineProperty({}, "" + (this.props.newestOnTop ? "$unshift" : "$push"), [message]); + var opts = {}; - var nextState = (0, _reactAddonsUpdate2.default)(this.state, { - toasts: toastOperation, - messageList: messageOperation - }); - this.setState(nextState); - } - }, { - key: "_handle_toast_on_click", - value: function _handle_toast_on_click(event) { - this.props.onClick(event); - if (event.defaultPrevented) { - return; + if (cellEdit) { + if (cellEdit.mode === _Const2.default.CELL_EDIT_CLICK) { + opts.onClick = this.handleCellEdit; + } else if (cellEdit.mode === _Const2.default.CELL_EDIT_DBCLICK) { + opts.onDoubleClick = this.handleCellEdit; + } else { + opts.onClick = this.handleCellClick; + } } - event.preventDefault(); - event.stopPropagation(); - } - }, { - key: "_handle_toast_remove", - value: function _handle_toast_remove(toastId) { - var _this4 = this; - if (this.props.preventDuplicates) { - this.state.previousMessage = ""; + if (keyBoardNav && isFocus) { + opts.onKeyDown = this.handleKeyDown; } - var operationName = "" + (this.props.newestOnTop ? "reduceRight" : "reduce"); - this.state.toasts[operationName](function (found, toast, index) { - if (found || toast.toastId !== toastId) { - return false; - } - _this4.setState((0, _reactAddonsUpdate2.default)(_this4.state, { - toasts: { $splice: [[index, 1]] }, - messageList: { $splice: [[index, 1]] } - })); - return true; - }, false); - } - }, { - key: "render", - value: function render() { - var _this5 = this; - var divProps = (0, _omit3.default)(this.props, ["toastType", "toastMessageFactory", "preventDuplicates", "newestOnTop"]); + if (isFocus) { + if (customNavStyle) { + var cusmtStyle = _util2.default.isFunction(customNavStyle) ? customNavStyle(children, row) : customNavStyle; + tdStyle = _extends({}, tdStyle, cusmtStyle); + } else { + className = className + ' default-focus-cell'; + } + } + var attr = {}; + if (!withoutTabIndex) attr.tabIndex = tabIndex; return _react2.default.createElement( - "div", - _extends({}, divProps, { "aria-live": "polite", role: "alert" }), - this.state.toasts.map(function (toast) { - return _this5.props.toastMessageFactory(toast); - }) + 'td', + _extends({}, attr, { style: tdStyle, + title: columnTitle, + className: className + }, opts, attrs), + typeof children === 'boolean' ? children.toString() : children ); } }]); - return ToastContainer; + return TableColumn; }(_react.Component); - ToastContainer.propTypes = { - toastType: _react.PropTypes.shape({ - error: _react.PropTypes.string, - info: _react.PropTypes.string, - success: _react.PropTypes.string, - warning: _react.PropTypes.string - }).isRequired, - id: _react.PropTypes.string.isRequired, - toastMessageFactory: _react.PropTypes.func.isRequired, - preventDuplicates: _react.PropTypes.bool.isRequired, - newestOnTop: _react.PropTypes.bool.isRequired, - onClick: _react.PropTypes.func.isRequired + TableColumn.propTypes = { + rIndex: _propTypes2.default.number, + dataAlign: _propTypes2.default.string, + hidden: _propTypes2.default.bool, + className: _propTypes2.default.string, + columnTitle: _propTypes2.default.string, + children: _propTypes2.default.node, + onClick: _propTypes2.default.func, + attrs: _propTypes2.default.object, + style: _propTypes2.default.object, + isFocus: _propTypes2.default.bool, + onKeyDown: _propTypes2.default.func, + tabIndex: _propTypes2.default.string, + withoutTabIndex: _propTypes2.default.bool, + keyBoardNav: _propTypes2.default.oneOfType([_propTypes2.default.bool, _propTypes2.default.object]), + customNavStyle: _propTypes2.default.oneOfType([_propTypes2.default.func, _propTypes2.default.object]), + row: _propTypes2.default.any /* only used on custom styling for navigation */ }; - ToastContainer.defaultProps = { - toastType: { - error: "error", - info: "info", - success: "success", - warning: "warning" - }, - id: "toast-container", - toastMessageFactory: _react2.default.createFactory(_ToastMessage2.default.animation), - preventDuplicates: true, - newestOnTop: true, - onClick: function onClick() {} + + TableColumn.defaultProps = { + dataAlign: 'left', + withoutTabIndex: false, + hidden: false, + className: '', + isFocus: false, + keyBoardNav: false }; - exports.default = ToastContainer; + var _default = TableColumn; + exports.default = _default; + ; -/***/ }, -/* 18 */ -/***/ function(module, exports, __webpack_require__) { + var _temp = function () { + if (typeof __REACT_HOT_LOADER__ === 'undefined') { + return; + } - var arrayMap = __webpack_require__(19), - baseClone = __webpack_require__(20), - baseUnset = __webpack_require__(130), - castPath = __webpack_require__(131), - copyObject = __webpack_require__(70), - flatRest = __webpack_require__(144), - getAllKeysIn = __webpack_require__(107); + __REACT_HOT_LOADER__.register(TableColumn, 'TableColumn', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/TableColumn.js'); - /** Used to compose bitmasks for cloning. */ - var CLONE_DEEP_FLAG = 1, - CLONE_FLAT_FLAG = 2, - CLONE_SYMBOLS_FLAG = 4; + __REACT_HOT_LOADER__.register(_default, 'default', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/TableColumn.js'); + }(); - /** - * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable property paths of `object` that are not omitted. - * - * **Note:** This method is considerably slower than `_.pick`. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The source object. - * @param {...(string|string[])} [paths] The property paths to omit. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omit(object, ['a', 'c']); - * // => { 'b': '2' } - */ - var omit = flatRest(function(object, paths) { - var result = {}; - if (object == null) { - return result; - } - var isDeep = false; - paths = arrayMap(paths, function(path) { - path = castPath(path, object); - isDeep || (isDeep = path.length > 1); - return path; - }); - copyObject(object, getAllKeysIn(object), result); - if (isDeep) { - result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG); - } - var length = paths.length; - while (length--) { - baseUnset(result, paths[length]); - } - return result; + ; + +/***/ }), +/* 22 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true }); - module.exports = omit; + 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; }; -/***/ }, -/* 19 */ -/***/ function(module, exports) { + 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; }; }(); - /** - * A specialized version of `_.map` for arrays without support for iteratee - * shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ - function arrayMap(array, iteratee) { - var index = -1, - length = array == null ? 0 : array.length, - result = Array(length); + var _react = __webpack_require__(2); - while (++index < length) { - result[index] = iteratee(array[index], index, array); - } - return result; - } + var _react2 = _interopRequireDefault(_react); - module.exports = arrayMap; + var _propTypes = __webpack_require__(3); + var _propTypes2 = _interopRequireDefault(_propTypes); -/***/ }, -/* 20 */ -/***/ function(module, exports, __webpack_require__) { - - var Stack = __webpack_require__(21), - arrayEach = __webpack_require__(65), - assignValue = __webpack_require__(66), - baseAssign = __webpack_require__(69), - baseAssignIn = __webpack_require__(92), - cloneBuffer = __webpack_require__(96), - copyArray = __webpack_require__(97), - copySymbols = __webpack_require__(98), - copySymbolsIn = __webpack_require__(101), - getAllKeys = __webpack_require__(105), - getAllKeysIn = __webpack_require__(107), - getTag = __webpack_require__(108), - initCloneArray = __webpack_require__(113), - initCloneByTag = __webpack_require__(114), - initCloneObject = __webpack_require__(128), - isArray = __webpack_require__(77), - isBuffer = __webpack_require__(78), - isObject = __webpack_require__(45), - keys = __webpack_require__(71); - - /** Used to compose bitmasks for cloning. */ - var CLONE_DEEP_FLAG = 1, - CLONE_FLAT_FLAG = 2, - CLONE_SYMBOLS_FLAG = 4; + var _reactDom = __webpack_require__(15); - /** `Object#toString` result references. */ - var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - mapTag = '[object Map]', - numberTag = '[object Number]', - objectTag = '[object Object]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - symbolTag = '[object Symbol]', - weakMapTag = '[object WeakMap]'; - - var arrayBufferTag = '[object ArrayBuffer]', - dataViewTag = '[object DataView]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; - - /** Used to identify `toStringTag` values supported by `_.clone`. */ - var cloneableTags = {}; - cloneableTags[argsTag] = cloneableTags[arrayTag] = - cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = - cloneableTags[boolTag] = cloneableTags[dateTag] = - cloneableTags[float32Tag] = cloneableTags[float64Tag] = - cloneableTags[int8Tag] = cloneableTags[int16Tag] = - cloneableTags[int32Tag] = cloneableTags[mapTag] = - cloneableTags[numberTag] = cloneableTags[objectTag] = - cloneableTags[regexpTag] = cloneableTags[setTag] = - cloneableTags[stringTag] = cloneableTags[symbolTag] = - cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = - cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; - cloneableTags[errorTag] = cloneableTags[funcTag] = - cloneableTags[weakMapTag] = false; + var _reactDom2 = _interopRequireDefault(_reactDom); - /** - * The base implementation of `_.clone` and `_.cloneDeep` which tracks - * traversed objects. - * - * @private - * @param {*} value The value to clone. - * @param {boolean} bitmask The bitmask flags. - * 1 - Deep clone - * 2 - Flatten inherited properties - * 4 - Clone symbols - * @param {Function} [customizer] The function to customize cloning. - * @param {string} [key] The key of `value`. - * @param {Object} [object] The parent object of `value`. - * @param {Object} [stack] Tracks traversed objects and their clone counterparts. - * @returns {*} Returns the cloned value. - */ - function baseClone(value, bitmask, customizer, key, object, stack) { - var result, - isDeep = bitmask & CLONE_DEEP_FLAG, - isFlat = bitmask & CLONE_FLAT_FLAG, - isFull = bitmask & CLONE_SYMBOLS_FLAG; - - if (customizer) { - result = object ? customizer(value, key, object, stack) : customizer(value); - } - if (result !== undefined) { - return result; - } - if (!isObject(value)) { - return value; - } - var isArr = isArray(value); - if (isArr) { - result = initCloneArray(value); - if (!isDeep) { - return copyArray(value, result); - } - } else { - var tag = getTag(value), - isFunc = tag == funcTag || tag == genTag; + var _Editor = __webpack_require__(23); - if (isBuffer(value)) { - return cloneBuffer(value, isDeep); - } - if (tag == objectTag || tag == argsTag || (isFunc && !object)) { - result = (isFlat || isFunc) ? {} : initCloneObject(value); - if (!isDeep) { - return isFlat - ? copySymbolsIn(value, baseAssignIn(result, value)) - : copySymbols(value, baseAssign(result, value)); - } - } else { - if (!cloneableTags[tag]) { - return object ? value : {}; - } - result = initCloneByTag(value, tag, baseClone, isDeep); - } - } - // Check for circular references and return its corresponding clone. - stack || (stack = new Stack); - var stacked = stack.get(value); - if (stacked) { - return stacked; - } - stack.set(value, result); + var _Editor2 = _interopRequireDefault(_Editor); - var keysFunc = isFull - ? (isFlat ? getAllKeysIn : getAllKeys) - : (isFlat ? keysIn : keys); + var _Notification = __webpack_require__(24); - var props = isArr ? undefined : keysFunc(value); - arrayEach(props || value, function(subValue, key) { - if (props) { - key = subValue; - subValue = value[key]; - } - // Recursively populate clone (susceptible to call stack limits). - assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); - }); - return result; - } + var _classnames = __webpack_require__(12); - module.exports = baseClone; + var _classnames2 = _interopRequireDefault(_classnames); + var _util = __webpack_require__(19); -/***/ }, -/* 21 */ -/***/ function(module, exports, __webpack_require__) { + var _util2 = _interopRequireDefault(_util); - var ListCache = __webpack_require__(22), - stackClear = __webpack_require__(30), - stackDelete = __webpack_require__(31), - stackGet = __webpack_require__(32), - stackHas = __webpack_require__(33), - stackSet = __webpack_require__(34); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - /** - * Creates a stack cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function Stack(entries) { - var data = this.__data__ = new ListCache(entries); - this.size = data.size; - } - - // Add methods to `Stack`. - Stack.prototype.clear = stackClear; - Stack.prototype['delete'] = stackDelete; - Stack.prototype.get = stackGet; - Stack.prototype.has = stackHas; - Stack.prototype.set = stackSet; + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - module.exports = Stack; + 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; } -/***/ }, -/* 22 */ -/***/ function(module, exports, __webpack_require__) { + var TableEditColumn = function (_Component) { + _inherits(TableEditColumn, _Component); - var listCacheClear = __webpack_require__(23), - listCacheDelete = __webpack_require__(24), - listCacheGet = __webpack_require__(27), - listCacheHas = __webpack_require__(28), - listCacheSet = __webpack_require__(29); + function TableEditColumn(props) { + _classCallCheck(this, TableEditColumn); - /** - * Creates an list cache object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function ListCache(entries) { - var index = -1, - length = entries == null ? 0 : entries.length; + var _this = _possibleConstructorReturn(this, (TableEditColumn.__proto__ || Object.getPrototypeOf(TableEditColumn)).call(this, props)); - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } - } + _this.handleKeyPress = function () { + return _this.__handleKeyPress__REACT_HOT_LOADER__.apply(_this, arguments); + }; - // Add methods to `ListCache`. - ListCache.prototype.clear = listCacheClear; - ListCache.prototype['delete'] = listCacheDelete; - ListCache.prototype.get = listCacheGet; - ListCache.prototype.has = listCacheHas; - ListCache.prototype.set = listCacheSet; + _this.handleBlur = function () { + return _this.__handleBlur__REACT_HOT_LOADER__.apply(_this, arguments); + }; - module.exports = ListCache; + _this.handleCustomUpdate = function () { + return _this.__handleCustomUpdate__REACT_HOT_LOADER__.apply(_this, arguments); + }; + _this.notifyToastr = function () { + return _this.__notifyToastr__REACT_HOT_LOADER__.apply(_this, arguments); + }; -/***/ }, -/* 23 */ -/***/ function(module, exports) { + _this.handleClick = function () { + return _this.__handleClick__REACT_HOT_LOADER__.apply(_this, arguments); + }; - /** - * Removes all key-value entries from the list cache. - * - * @private - * @name clear - * @memberOf ListCache - */ - function listCacheClear() { - this.__data__ = []; - this.size = 0; - } + _this.getInputRef = function () { + return _this.__getInputRef__REACT_HOT_LOADER__.apply(_this, arguments); + }; - module.exports = listCacheClear; + _this.getHandleKeyPress = function () { + return _this.__getHandleKeyPress__REACT_HOT_LOADER__.apply(_this, arguments); + }; + _this.getHandleBlur = function () { + return _this.__getHandleBlur__REACT_HOT_LOADER__.apply(_this, arguments); + }; -/***/ }, -/* 24 */ -/***/ function(module, exports, __webpack_require__) { + _this.timeouteClear = 0; + var _this$props = _this.props, + fieldValue = _this$props.fieldValue, + row = _this$props.row, + className = _this$props.className; - var assocIndexOf = __webpack_require__(25); + _this.focusInEditor = _this.focusInEditor.bind(_this); + _this.state = { + shakeEditor: false, + className: _util2.default.isFunction(className) ? className(fieldValue, row) : className + }; + return _this; + } - /** Used for built-in method references. */ - var arrayProto = Array.prototype; + _createClass(TableEditColumn, [{ + key: 'valueShortCircuit', + value: function valueShortCircuit(value) { + return value === null || typeof value === 'undefined' ? '' : value; + } + }, { + key: '__handleKeyPress__REACT_HOT_LOADER__', + value: function __handleKeyPress__REACT_HOT_LOADER__(e) { + if (e.keyCode === 13 || e.keyCode === 9) { + // Pressed ENTER + var value = e.currentTarget.type === 'checkbox' ? this._getCheckBoxValue(e) : e.currentTarget.value; - /** Built-in value references. */ - var splice = arrayProto.splice; + if (!this.validator(value)) { + return; + } + if (e.keyCode === 13) { + this.props.completeEdit(value, this.props.rowIndex, this.props.colIndex); + } else { + this.props.onTab(this.props.rowIndex + 1, this.props.colIndex + 1, 'tab', e); + e.preventDefault(); + } + } else if (e.keyCode === 27) { + this.props.completeEdit(null, this.props.rowIndex, this.props.colIndex); + } else if (e.type === 'click' && !this.props.blurToSave) { + // textarea click save button + var _value = e.target.parentElement.firstChild.value; + if (!this.validator(_value)) { + return; + } + this.props.completeEdit(_value, this.props.rowIndex, this.props.colIndex); + } + } + }, { + key: '__handleBlur__REACT_HOT_LOADER__', + value: function __handleBlur__REACT_HOT_LOADER__(e) { + e.stopPropagation(); + if (this.props.blurToSave) { + var value = e.currentTarget.type === 'checkbox' ? this._getCheckBoxValue(e) : e.currentTarget.value; + if (!this.validator(value)) { + return false; + } + this.props.completeEdit(value, this.props.rowIndex, this.props.colIndex); + } + } + }, { + key: '__handleCustomUpdate__REACT_HOT_LOADER__', - /** - * Removes `key` and its value from the list cache. - * - * @private - * @name delete - * @memberOf ListCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function listCacheDelete(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - if (index < 0) { - return false; - } - var lastIndex = data.length - 1; - if (index == lastIndex) { - data.pop(); - } else { - splice.call(data, index, 1); - } - --this.size; - return true; - } + // 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); + } + }, { + key: 'validator', + value: function validator(value) { + var ts = this; + var valid = true; + if (ts.props.editable.validator) { + var checkVal = ts.props.editable.validator(value, this.props.row); + var responseType = typeof checkVal === 'undefined' ? 'undefined' : _typeof(checkVal); + if (responseType !== 'object' && checkVal !== true) { + valid = false; + this.notifyToastr('error', checkVal, ''); + } else if (responseType === 'object' && checkVal.isValid !== true) { + valid = false; + this.notifyToastr(checkVal.notification.type, checkVal.notification.msg, checkVal.notification.title); + } + if (!valid) { + // animate input + ts.clearTimeout(); + var _props = this.props, + invalidColumnClassName = _props.invalidColumnClassName, + row = _props.row; - module.exports = listCacheDelete; + var className = _util2.default.isFunction(invalidColumnClassName) ? invalidColumnClassName(value, row) : invalidColumnClassName; + ts.setState({ shakeEditor: true, className: className }); + ts.timeouteClear = setTimeout(function () { + ts.setState({ shakeEditor: false }); + }, 300); + this.focusInEditor(); + return valid; + } + } + return valid; + } + // END + }, { + key: '__notifyToastr__REACT_HOT_LOADER__', + value: function __notifyToastr__REACT_HOT_LOADER__(type, message, title) { + var toastr = true; + var beforeShowError = this.props.beforeShowError; -/***/ }, -/* 25 */ -/***/ function(module, exports, __webpack_require__) { + if (beforeShowError) { + toastr = beforeShowError(type, message, title); + } + if (toastr) { + (0, _Notification.notice)(type, message, title); + } + } + }, { + key: 'clearTimeout', + value: function (_clearTimeout) { + function clearTimeout() { + return _clearTimeout.apply(this, arguments); + } - var eq = __webpack_require__(26); + clearTimeout.toString = function () { + return _clearTimeout.toString(); + }; - /** - * Gets the index at which the `key` is found in `array` of key-value pairs. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} key The key to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; + return clearTimeout; + }(function () { + if (this.timeouteClear !== 0) { + clearTimeout(this.timeouteClear); + this.timeouteClear = 0; + } + }) + }, { + key: 'componentDidMount', + value: function componentDidMount() { + this.focusInEditor(); + var dom = _reactDom2.default.findDOMNode(this); + if (this.props.isFocus) { + dom.focus(); + } else { + dom.blur(); + } } - } - return -1; - } + }, { + key: 'componentDidUpdate', + value: function componentDidUpdate() { + var dom = _reactDom2.default.findDOMNode(this); + if (this.props.isFocus) { + dom.focus(); + } else { + dom.blur(); + } + } + }, { + key: 'componentWillUnmount', + value: function componentWillUnmount() { + this.clearTimeout(); + } + }, { + key: 'focusInEditor', + value: function focusInEditor() { + if (this.inputRef && _util2.default.isFunction(this.inputRef.focus)) { + this.inputRef.focus(); + } + } + }, { + key: '__handleClick__REACT_HOT_LOADER__', + value: function __handleClick__REACT_HOT_LOADER__(e) { + if (e.target.tagName !== 'TD') { + e.stopPropagation(); + } + } + }, { + key: '__getInputRef__REACT_HOT_LOADER__', + value: function __getInputRef__REACT_HOT_LOADER__(userRef) { + var _this2 = this; - module.exports = assocIndexOf; + return function (ref) { + _this2.inputRef = ref; + if (_util2.default.isFunction(userRef)) { + userRef(ref); + } else if (typeof userRef === 'string') { + throw new Error('Ref must be a function'); + } + }; + } + }, { + key: '__getHandleKeyPress__REACT_HOT_LOADER__', + value: function __getHandleKeyPress__REACT_HOT_LOADER__(customHandler) { + var _this3 = this; + return function (e) { + _this3.handleKeyPress(e); + if (_util2.default.isFunction(customHandler)) { + customHandler(e); + } + }; + } + }, { + key: '__getHandleBlur__REACT_HOT_LOADER__', + value: function __getHandleBlur__REACT_HOT_LOADER__(customHandler) { + var _this4 = this; -/***/ }, -/* 26 */ -/***/ function(module, exports) { + return function (e) { + _this4.handleBlur(e); + if (_util2.default.isFunction(customHandler)) { + customHandler(e); + } + }; + } + }, { + key: 'render', + value: function render() { + var _props2 = this.props, + editable = _props2.editable, + format = _props2.format, + customEditor = _props2.customEditor, + isFocus = _props2.isFocus, + customStyleWithNav = _props2.customStyleWithNav, + row = _props2.row; + var shakeEditor = this.state.shakeEditor; - /** - * 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); - } + var attr = _extends({}, editable.attrs, { + ref: this.getInputRef(editable.attrs && editable.attrs.ref), + onKeyDown: this.getHandleKeyPress(editable.attrs && editable.attrs.onKeyDown), + onBlur: this.getHandleBlur(editable.attrs && editable.attrs.onBlur) + }); + var style = { position: 'relative' }; + var fieldValue = this.props.fieldValue; + var className = this.state.className; - module.exports = eq; + if (editable.placeholder) { + attr.placeholder = editable.placeholder; + /* eslint-disable no-console */ + console.warn('Setting editable.placeholder is deprecated. Use editable.attrs to set input attributes'); + /* eslint-enable no-console */ + } -/***/ }, -/* 27 */ -/***/ function(module, exports, __webpack_require__) { + var editorClass = (0, _classnames2.default)({ 'animated': shakeEditor, 'shake': shakeEditor }); + fieldValue = fieldValue === 0 ? '0' : fieldValue; + var cellEditor = void 0; + if (customEditor) { + var customEditorProps = _extends({ + row: row + }, attr, { + defaultValue: this.valueShortCircuit(fieldValue) + }, customEditor.customEditorParameters); + cellEditor = customEditor.getElement(this.handleCustomUpdate, customEditorProps); + } else { + cellEditor = (0, _Editor2.default)(editable, attr, format, editorClass, this.valueShortCircuit(fieldValue), null, row); + } - var assocIndexOf = __webpack_require__(25); + if (isFocus) { + if (customStyleWithNav) { + var customStyle = _util2.default.isFunction(customStyleWithNav) ? customStyleWithNav(fieldValue, row) : customStyleWithNav; + style = _extends({}, style, customStyle); + } else { + className = className + ' default-focus-cell'; + } + } - /** - * Gets the list cache value for `key`. - * - * @private - * @name get - * @memberOf ListCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function listCacheGet(key) { - var data = this.__data__, - index = assocIndexOf(data, key); + return _react2.default.createElement( + 'td', + { ref: 'td', + style: style, + className: className, + onClick: this.handleClick }, + cellEditor + ); + } + }, { + key: '_getCheckBoxValue', + value: function _getCheckBoxValue(e) { + var value = ''; + var values = e.currentTarget.value.split(':'); + value = e.currentTarget.checked ? values[0] : values[1]; + return value; + } + }]); - return index < 0 ? undefined : data[index][1]; - } + return TableEditColumn; + }(_react.Component); - module.exports = listCacheGet; + TableEditColumn.propTypes = { + completeEdit: _propTypes2.default.func, + rowIndex: _propTypes2.default.number, + colIndex: _propTypes2.default.number, + blurToSave: _propTypes2.default.bool, + editable: _propTypes2.default.oneOfType([_propTypes2.default.bool, _propTypes2.default.object]), + format: _propTypes2.default.oneOfType([_propTypes2.default.bool, _propTypes2.default.func]), + row: _propTypes2.default.any, + fieldValue: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.bool, _propTypes2.default.number, _propTypes2.default.array, _propTypes2.default.object]), + className: _propTypes2.default.any, + beforeShowError: _propTypes2.default.func, + isFocus: _propTypes2.default.bool, + customStyleWithNav: _propTypes2.default.oneOfType([_propTypes2.default.func, _propTypes2.default.object]) + }; + var _default = TableEditColumn; + exports.default = _default; + ; -/***/ }, -/* 28 */ -/***/ function(module, exports, __webpack_require__) { + var _temp = function () { + if (typeof __REACT_HOT_LOADER__ === 'undefined') { + return; + } - var assocIndexOf = __webpack_require__(25); + __REACT_HOT_LOADER__.register(TableEditColumn, 'TableEditColumn', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/TableEditColumn.js'); - /** - * Checks if a list cache value for `key` exists. - * - * @private - * @name has - * @memberOf ListCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function listCacheHas(key) { - return assocIndexOf(this.__data__, key) > -1; - } + __REACT_HOT_LOADER__.register(_default, 'default', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/TableEditColumn.js'); + }(); - module.exports = listCacheHas; + ; +/***/ }), +/* 23 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ }, -/* 29 */ -/***/ function(module, exports, __webpack_require__) { + 'use strict'; - var assocIndexOf = __webpack_require__(25); + Object.defineProperty(exports, "__esModule", { + value: true + }); - /** - * Sets the list cache `key` to `value`. - * - * @private - * @name set - * @memberOf ListCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the list cache instance. - */ - function listCacheSet(key, value) { - var data = this.__data__, - index = assocIndexOf(data, key); + 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; }; - if (index < 0) { - ++this.size; - data.push([key, value]); - } else { - data[index][1] = value; - } - return this; - } + 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; }; - module.exports = listCacheSet; + var _util = __webpack_require__(19); + var _util2 = _interopRequireDefault(_util); -/***/ }, -/* 30 */ -/***/ function(module, exports, __webpack_require__) { + var _react = __webpack_require__(2); - var ListCache = __webpack_require__(22); + var _react2 = _interopRequireDefault(_react); - /** - * Removes all key-value entries from the stack. - * - * @private - * @name clear - * @memberOf Stack - */ - function stackClear() { - this.__data__ = new ListCache; - this.size = 0; - } + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - module.exports = stackClear; + var editor = function editor(editable, attr, format, editorClass, defaultValue, ignoreEditable, row) { + if (editable === true || editable === false && ignoreEditable || typeof editable === 'string') { + // simple declare + var type = editable ? 'text' : editable; + return _react2.default.createElement('input', _extends({}, attr, { type: type, defaultValue: defaultValue, + className: (editorClass || '') + ' form-control editor edit-text' })); + } else if (!editable) { + var _type = editable ? 'text' : editable; + return _react2.default.createElement('input', _extends({}, attr, { type: _type, defaultValue: defaultValue, + disabled: 'disabled', + className: (editorClass || '') + ' form-control editor edit-text' })); + } else if (editable && (editable.type === undefined || editable.type === null || editable.type.trim() === '')) { + var _type2 = editable ? 'text' : editable; + return _react2.default.createElement('input', _extends({}, attr, { type: _type2, defaultValue: defaultValue, + className: (editorClass || '') + ' form-control editor edit-text' })); + } else if (editable.type) { + // standard declare + // put style if exist + editable.style && (attr.style = editable.style); + // put class if exist + attr.className = (editorClass || '') + ' form-control editor edit-' + editable.type + (editable.className ? ' ' + editable.className : ''); + if (editable.type === 'select') { + // process select input + var options = []; + var values = editable.options.values; + var _editable$options = editable.options, + textKey = _editable$options.textKey, + valueKey = _editable$options.valueKey; + + if (_util2.default.isFunction(values)) { + values = values(row); + } + if (Array.isArray(values)) { + // only can use arrray data for options + var text = void 0; + var value = void 0; + options = values.map(function (option, i) { + if ((typeof option === 'undefined' ? 'undefined' : _typeof(option)) === 'object') { + text = textKey ? option[textKey] : option.text; + value = valueKey ? option[valueKey] : option.value; + } else { + text = format ? format(option) : option; + value = option; + } + return _react2.default.createElement( + 'option', + { key: 'option' + i, value: value }, + text + ); + }); + } + return _react2.default.createElement( + 'select', + _extends({}, attr, { defaultValue: defaultValue }), + options + ); + } else if (editable.type === 'textarea') { + // process textarea input + // put other if exist + editable.cols && (attr.cols = editable.cols); + editable.rows && (attr.rows = editable.rows); + var saveBtn = void 0; + var keyUpHandler = attr.onKeyDown; + if (keyUpHandler) { + attr.onKeyDown = function (e) { + if (e.keyCode !== 13) { + // not Pressed ENTER + keyUpHandler(e); + } + }; + saveBtn = _react2.default.createElement( + 'button', + { + className: 'btn btn-info btn-xs textarea-save-btn', + onClick: keyUpHandler }, + 'save' + ); + } + return _react2.default.createElement( + 'div', + null, + _react2.default.createElement('textarea', _extends({}, attr, { defaultValue: defaultValue })), + saveBtn + ); + } else if (editable.type === 'checkbox') { + var _values = 'true:false'; + if (editable.options && editable.options.values) { + // values = editable.options.values.split(':'); + _values = editable.options.values; + } + attr.className = attr.className.replace('form-control', ''); + attr.className += ' checkbox pull-right'; -/***/ }, -/* 31 */ -/***/ function(module, exports) { + var checked = defaultValue && defaultValue.toString() === _values.split(':')[0] ? true : false; - /** - * Removes `key` and its value from the stack. - * - * @private - * @name delete - * @memberOf Stack - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function stackDelete(key) { - var data = this.__data__, - result = data['delete'](key); + return _react2.default.createElement('input', _extends({}, attr, { type: 'checkbox', + value: _values, defaultChecked: checked })); + } else if (editable.type === 'datetime') { + return _react2.default.createElement('input', _extends({}, attr, { type: 'datetime-local', defaultValue: defaultValue })); + } else { + // process other input type. as password,url,email... + return _react2.default.createElement('input', _extends({}, attr, { type: editable.type, defaultValue: defaultValue })); + } + } + // default return for other case of editable + return _react2.default.createElement('input', _extends({}, attr, { type: 'text', + className: (editorClass || '') + ' form-control editor edit-text' })); + }; - this.size = data.size; - return result; - } + var _default = editor; + exports.default = _default; + ; - module.exports = stackDelete; + var _temp = function () { + if (typeof __REACT_HOT_LOADER__ === 'undefined') { + return; + } + __REACT_HOT_LOADER__.register(editor, 'editor', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/Editor.js'); -/***/ }, -/* 32 */ -/***/ function(module, exports) { + __REACT_HOT_LOADER__.register(_default, 'default', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/Editor.js'); + }(); - /** - * Gets the stack value for `key`. - * - * @private - * @name get - * @memberOf Stack - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function stackGet(key) { - return this.__data__.get(key); - } + ; - module.exports = stackGet; +/***/ }), +/* 24 */ +/***/ (function(module, exports, __webpack_require__) { + 'use strict'; -/***/ }, -/* 33 */ -/***/ function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.notice = undefined; - /** - * Checks if a stack value for `key` exists. - * - * @private - * @name has - * @memberOf Stack - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function stackHas(key) { - return this.__data__.has(key); - } + var _reactSAlert = __webpack_require__(25); - module.exports = stackHas; + var _reactSAlert2 = _interopRequireDefault(_reactSAlert); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -/***/ }, -/* 34 */ -/***/ function(module, exports, __webpack_require__) { + var notice = function notice(type, msg, title) { + var titleHTML = title ? '

' + title + '

' : ''; - var ListCache = __webpack_require__(22), - Map = __webpack_require__(35), - MapCache = __webpack_require__(50); + var bodyHTML = '\n ' + titleHTML + '\n
\n  \n ' + msg + '\n
\n '; - /** Used as the size to enable large array optimizations. */ - var LARGE_ARRAY_SIZE = 200; + _reactSAlert2.default.error(bodyHTML, { + position: 'top-right', + timeout: 3000, + html: true, + effect: 'scale' + }); + }; - /** - * Sets the stack `key` to `value`. - * - * @private - * @name set - * @memberOf Stack - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the stack cache instance. - */ - function stackSet(key, value) { - var data = this.__data__; - if (data instanceof ListCache) { - var pairs = data.__data__; - if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { - pairs.push([key, value]); - this.size = ++data.size; - return this; - } - data = this.__data__ = new MapCache(pairs); - } - data.set(key, value); - this.size = data.size; - return this; - } - - module.exports = stackSet; - - -/***/ }, -/* 35 */ -/***/ function(module, exports, __webpack_require__) { - - var getNative = __webpack_require__(36), - root = __webpack_require__(41); - - /* Built-in method references that are verified to be native. */ - var Map = getNative(root, 'Map'); - - module.exports = Map; - - -/***/ }, -/* 36 */ -/***/ function(module, exports, __webpack_require__) { - - var baseIsNative = __webpack_require__(37), - getValue = __webpack_require__(49); - - /** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ - function getNative(object, key) { - var value = getValue(object, key); - return baseIsNative(value) ? value : undefined; - } - - module.exports = getNative; - - -/***/ }, -/* 37 */ -/***/ function(module, exports, __webpack_require__) { - - var isFunction = __webpack_require__(38), - isMasked = __webpack_require__(46), - isObject = __webpack_require__(45), - toSource = __webpack_require__(48); - - /** - * Used to match `RegExp` - * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). - */ - var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; - - /** Used to detect host constructors (Safari). */ - var reIsHostCtor = /^\[object .+?Constructor\]$/; - - /** Used for built-in method references. */ - var funcProto = Function.prototype, - objectProto = Object.prototype; - - /** Used to resolve the decompiled source of functions. */ - var funcToString = funcProto.toString; - - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; - - /** Used to detect if a method is native. */ - var reIsNative = RegExp('^' + - funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' - ); + exports.notice = notice; + ; - /** - * The base implementation of `_.isNative` without bad shim checks. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, - * else `false`. - */ - function baseIsNative(value) { - if (!isObject(value) || isMasked(value)) { - return false; + var _temp = function () { + if (typeof __REACT_HOT_LOADER__ === 'undefined') { + return; } - var pattern = isFunction(value) ? reIsNative : reIsHostCtor; - return pattern.test(toSource(value)); - } - module.exports = baseIsNative; - - -/***/ }, -/* 38 */ -/***/ function(module, exports, __webpack_require__) { + __REACT_HOT_LOADER__.register(notice, 'notice', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/Notification.js'); + }(); - var baseGetTag = __webpack_require__(39), - isObject = __webpack_require__(45); + ; - /** `Object#toString` result references. */ - var asyncTag = '[object AsyncFunction]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - proxyTag = '[object Proxy]'; +/***/ }), +/* 25 */ +/***/ (function(module, exports, __webpack_require__) { - /** - * 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) { - if (!isObject(value)) { - return false; - } - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 9 which returns 'object' for typed arrays and other constructors. - var tag = baseGetTag(value); - return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; - } + module.exports = __webpack_require__(26); - module.exports = isFunction; +/***/ }), +/* 26 */ +/***/ (function(module, exports, __webpack_require__) { + var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { + if (true) { + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(2), __webpack_require__(27), __webpack_require__(3), __webpack_require__(29), __webpack_require__(28), __webpack_require__(31)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else if (typeof exports !== "undefined") { + factory(exports, require('react'), require('./SAlertContent'), require('prop-types'), require('./s-alert-parts/s-alert-store'), require('./s-alert-parts/s-alert-tools'), require('./s-alert-parts/s-alert-data-prep')); + } else { + var mod = { + exports: {} + }; + factory(mod.exports, global.react, global.SAlertContent, global.propTypes, global.sAlertStore, global.sAlertTools, global.sAlertDataPrep); + global.SAlert = mod.exports; + } + })(this, function (exports, _react, _SAlertContent, _propTypes, _sAlertStore, _sAlertTools, _sAlertDataPrep) { + 'use strict'; -/***/ }, -/* 39 */ -/***/ function(module, exports, __webpack_require__) { + Object.defineProperty(exports, "__esModule", { + value: true + }); - var Symbol = __webpack_require__(40), - getRawTag = __webpack_require__(43), - objectToString = __webpack_require__(44); + var _react2 = _interopRequireDefault(_react); - /** `Object#toString` result references. */ - var nullTag = '[object Null]', - undefinedTag = '[object Undefined]'; + var _SAlertContent2 = _interopRequireDefault(_SAlertContent); - /** Built-in value references. */ - var symToStringTag = Symbol ? Symbol.toStringTag : undefined; + var _propTypes2 = _interopRequireDefault(_propTypes); - /** - * The base implementation of `getTag` without fallbacks for buggy environments. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ - function baseGetTag(value) { - if (value == null) { - return value === undefined ? undefinedTag : nullTag; - } - value = Object(value); - return (symToStringTag && symToStringTag in value) - ? getRawTag(value) - : objectToString(value); - } + var _sAlertStore2 = _interopRequireDefault(_sAlertStore); - module.exports = baseGetTag; + var _sAlertTools2 = _interopRequireDefault(_sAlertTools); + var _sAlertDataPrep2 = _interopRequireDefault(_sAlertDataPrep); -/***/ }, -/* 40 */ -/***/ function(module, exports, __webpack_require__) { + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; + } - var root = __webpack_require__(41); + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } - /** Built-in value references. */ - var Symbol = root.Symbol; + 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); + } + } - module.exports = Symbol; + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; + }(); + function _possibleConstructorReturn(self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } -/***/ }, -/* 41 */ -/***/ function(module, exports, __webpack_require__) { + return call && (typeof call === "object" || typeof call === "function") ? call : self; + } - var freeGlobal = __webpack_require__(42); + 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); + } - /** Detect free variable `self`. */ - var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + 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; + } - /** Used as a reference to the global object. */ - var root = freeGlobal || freeSelf || Function('return this')(); + var insertFunc = function insertFunc(msg, data, condition) { + var id = _sAlertTools2.default.randomId(); + _sAlertStore2.default.dispatch({ + type: 'INSERT', + data: Object.assign({}, data, { + id: id, + condition: condition, + message: msg + }) + }); + return id; + }; - module.exports = root; + var SAlert = function (_React$Component) { + _inherits(SAlert, _React$Component); + function SAlert(props) { + _classCallCheck(this, SAlert); -/***/ }, -/* 42 */ -/***/ function(module, exports) { + var _this = _possibleConstructorReturn(this, (SAlert.__proto__ || Object.getPrototypeOf(SAlert)).call(this, props)); - /* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */ - var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + _this.state = { + dataRight: [], + dataLeft: [], + dataTop: [], + dataBottom: [] + }; + return _this; + } - module.exports = freeGlobal; + _createClass(SAlert, [{ + key: 'componentDidMount', + value: function componentDidMount() { + var _this2 = this; - /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) + var storeStateLeft = void 0; + var storeStateRight = void 0; + var storeStateTop = void 0; + var storeStateBottom = void 0; -/***/ }, -/* 43 */ -/***/ function(module, exports, __webpack_require__) { + var addToStoreRight = function addToStoreRight() { + var length = void 0; + storeStateRight = (0, _sAlertDataPrep2.default)('right') || []; + length = storeStateRight.length; + if (_this2.props.stack && _this2.props.stack.limit && length > _this2.props.stack.limit) { + var id = storeStateRight[0].id; + _sAlertStore2.default.dispatch({ type: 'REMOVE', data: { id: id } }); + storeStateRight = (0, _sAlertDataPrep2.default)('right') || []; + } + _this2.setState({ dataRight: storeStateRight }); + }; + this.unsubStoreRight = _sAlertStore2.default.subscribe(addToStoreRight); - var Symbol = __webpack_require__(40); + var addToStoreLeft = function addToStoreLeft() { + var length = void 0; + storeStateLeft = (0, _sAlertDataPrep2.default)('left') || []; + length = storeStateLeft.length; + if (_this2.props.stack && _this2.props.stack.limit && length > _this2.props.stack.limit) { + var id = storeStateLeft[0].id; + _sAlertStore2.default.dispatch({ type: 'REMOVE', data: { id: id } }); + storeStateLeft = (0, _sAlertDataPrep2.default)('left') || []; + } + _this2.setState({ dataLeft: storeStateLeft }); + }; + this.unsubStoreLeft = _sAlertStore2.default.subscribe(addToStoreLeft); - /** Used for built-in method references. */ - var objectProto = Object.prototype; + var addToStoreTop = function addToStoreTop() { + var length = void 0; + storeStateTop = (0, _sAlertDataPrep2.default)('full-top') || []; + length = storeStateTop.length; + if (_this2.props.stack && _this2.props.stack.limit && length > _this2.props.stack.limit) { + var id = storeStateTop[0].id; + _sAlertStore2.default.dispatch({ type: 'REMOVE', data: { id: id } }); + storeStateTop = (0, _sAlertDataPrep2.default)('full-top') || []; + } + _this2.setState({ dataTop: storeStateTop }); + }; + this.unsubStoreTop = _sAlertStore2.default.subscribe(addToStoreTop); - /** 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 nativeObjectToString = objectProto.toString; - - /** Built-in value references. */ - var symToStringTag = Symbol ? Symbol.toStringTag : undefined; - - /** - * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the raw `toStringTag`. - */ - function getRawTag(value) { - var isOwn = hasOwnProperty.call(value, symToStringTag), - tag = value[symToStringTag]; - - try { - value[symToStringTag] = undefined; - var unmasked = true; - } catch (e) {} - - var result = nativeObjectToString.call(value); - if (unmasked) { - if (isOwn) { - value[symToStringTag] = tag; - } else { - delete value[symToStringTag]; - } - } - return result; - } - - module.exports = getRawTag; + var addToStoreBottom = function addToStoreBottom() { + var length = void 0; + storeStateBottom = (0, _sAlertDataPrep2.default)('full-bottom') || []; + length = storeStateBottom.length; + if (_this2.props.stack && _this2.props.stack.limit && length > _this2.props.stack.limit) { + var id = storeStateBottom[0].id; + _sAlertStore2.default.dispatch({ type: 'REMOVE', data: { id: id } }); + storeStateBottom = (0, _sAlertDataPrep2.default)('full-bottom') || []; + } + _this2.setState({ dataBottom: storeStateBottom }); + }; + this.unsubStoreBottom = _sAlertStore2.default.subscribe(addToStoreBottom); + // set up global config from global SAlert props + // only stuff needed for getAlertData + var globalConfig = { + contentTemplate: this.props.contentTemplate, + offset: this.props.offset, + message: this.props.message, + stack: this.props.stack, + html: this.props.html, + customFields: this.props.customFields, + position: this.props.position || 'top-right' + }; + _sAlertTools2.default.setGlobalConfig(globalConfig); + } + }, { + key: 'componentWillUnmount', + value: function componentWillUnmount() { + this.unsubStoreTop(); + this.unsubStoreBottom(); + this.unsubStoreLeft(); + this.unsubStoreRight(); + } + }, { + key: 'render', + value: function render() { + var _this3 = this; -/***/ }, -/* 44 */ -/***/ function(module, exports) { + var mapFunc = function mapFunc(alert, index) { + var customKey = 'alert-key-' + alert.id + '-' + alert.position; + var id = alert.id; + var condition = _sAlertTools2.default.returnFirstDefined(alert.condition, 'info'); + var message = _sAlertTools2.default.returnFirstDefined(alert.message, _this3.props.message, ''); + var position = _sAlertTools2.default.returnFirstDefined(alert.position, _this3.props.position, 'top-right'); + var offset = _sAlertTools2.default.returnFirstDefined(alert.offset, _this3.props.offset, 0); + var effect = _sAlertTools2.default.returnFirstDefined(alert.effect, _this3.props.effect); + var boxPosition = alert.boxPosition; + var beep = _sAlertTools2.default.returnFirstDefined(alert.beep, _this3.props.beep, false); + var timeout = _sAlertTools2.default.returnFirstDefined(alert.timeout, _this3.props.timeout, 5000); + var html = _sAlertTools2.default.returnFirstDefined(alert.html, _this3.props.html); + var onClose = _sAlertTools2.default.returnFirstDefined(alert.onClose, _this3.props.onClose); + var onShow = _sAlertTools2.default.returnFirstDefined(alert.onShow, _this3.props.onShow); + var customFields = _sAlertTools2.default.returnFirstDefined(alert.customFields, _this3.props.customFields); + var contentTemplate = _this3.props.contentTemplate; + return _react2.default.createElement(_SAlertContent2.default, { + key: customKey, + id: id, + customFields: customFields, + condition: condition, + message: message, + position: position, + effect: effect, + boxPosition: boxPosition, + beep: beep, + timeout: timeout, + html: html, + onClose: onClose, + onShow: onShow, + contentTemplate: contentTemplate }); + }; + var sAlertElemsRight = this.state.dataRight.map(mapFunc); + var sAlertElemsLeft = this.state.dataLeft.map(mapFunc); + var sAlertElemsTop = this.state.dataTop.map(mapFunc); + var sAlertElemsBottom = this.state.dataBottom.map(mapFunc); + return _react2.default.createElement( + 'div', + { className: 's-alert-wrapper' }, + sAlertElemsRight, + sAlertElemsLeft, + sAlertElemsTop, + sAlertElemsBottom + ); + } + }], [{ + key: 'info', + value: function info(msg, data) { + return insertFunc(msg, data, 'info'); + } + }, { + key: 'error', + value: function error(msg, data) { + return insertFunc(msg, data, 'error'); + } + }, { + key: 'warning', + value: function warning(msg, data) { + return insertFunc(msg, data, 'warning'); + } + }, { + key: 'success', + value: function success(msg, data) { + return insertFunc(msg, data, 'success'); + } + }, { + key: 'close', + value: function close(id) { + _sAlertStore2.default.dispatch({ type: 'REMOVE', data: { id: id } }); + } + }, { + key: 'closeAll', + value: function closeAll() { + _sAlertStore2.default.dispatch({ type: 'REMOVEALL' }); + } + }]); - /** Used for built-in method references. */ - var objectProto = Object.prototype; + return SAlert; + }(_react2.default.Component); - /** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ - var nativeObjectToString = objectProto.toString; + SAlert.propTypes = { + message: _propTypes2.default.string, + position: _propTypes2.default.string, + offset: _propTypes2.default.number, + stack: _propTypes2.default.oneOfType([_propTypes2.default.bool, _propTypes2.default.object]), + effect: _propTypes2.default.string, + beep: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object, _propTypes2.default.bool]), + timeout: _propTypes2.default.oneOfType([_propTypes2.default.oneOf(['none']), _propTypes2.default.number]), + html: _propTypes2.default.bool, + onClose: _propTypes2.default.func, + onShow: _propTypes2.default.func, + customFields: _propTypes2.default.object, + contentTemplate: _propTypes2.default.func + }; - /** - * Converts `value` to a string using `Object.prototype.toString`. - * - * @private - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. - */ - function objectToString(value) { - return nativeObjectToString.call(value); - } + exports.default = SAlert; + }); - module.exports = objectToString; +/***/ }), +/* 27 */ +/***/ (function(module, exports, __webpack_require__) { + var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { + if (true) { + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(2), __webpack_require__(15), __webpack_require__(3), __webpack_require__(28), __webpack_require__(29), __webpack_require__(30)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else if (typeof exports !== "undefined") { + factory(exports, require('react'), require('react-dom'), require('prop-types'), require('./s-alert-parts/s-alert-tools'), require('./s-alert-parts/s-alert-store'), require('./SAlertContentTmpl')); + } else { + var mod = { + exports: {} + }; + factory(mod.exports, global.react, global.reactDom, global.propTypes, global.sAlertTools, global.sAlertStore, global.SAlertContentTmpl); + global.SAlertContent = mod.exports; + } + })(this, function (exports, _react, _reactDom, _propTypes, _sAlertTools, _sAlertStore, _SAlertContentTmpl) { + 'use strict'; -/***/ }, -/* 45 */ -/***/ function(module, exports) { + Object.defineProperty(exports, "__esModule", { + value: true + }); - /** - * 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 != null && (type == 'object' || type == 'function'); - } + var _react2 = _interopRequireDefault(_react); - module.exports = isObject; + var _reactDom2 = _interopRequireDefault(_reactDom); + var _propTypes2 = _interopRequireDefault(_propTypes); -/***/ }, -/* 46 */ -/***/ function(module, exports, __webpack_require__) { + var _sAlertTools2 = _interopRequireDefault(_sAlertTools); - var coreJsData = __webpack_require__(47); + var _sAlertStore2 = _interopRequireDefault(_sAlertStore); - /** Used to detect methods masquerading as native. */ - var maskSrcKey = (function() { - var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); - return uid ? ('Symbol(src)_1.' + uid) : ''; - }()); + var _SAlertContentTmpl2 = _interopRequireDefault(_SAlertContentTmpl); - /** - * Checks if `func` has its source masked. - * - * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` is masked, else `false`. - */ - function isMasked(func) { - return !!maskSrcKey && (maskSrcKey in func); - } + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; + } - module.exports = isMasked; + 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; + }; + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } -/***/ }, -/* 47 */ -/***/ function(module, exports, __webpack_require__) { + 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); + } + } - var root = __webpack_require__(41); + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; + }(); - /** Used to detect overreaching core-js shims. */ - var coreJsData = root['__core-js_shared__']; + function _possibleConstructorReturn(self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } - module.exports = coreJsData; + 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); + } -/***/ }, -/* 48 */ -/***/ function(module, exports) { - - /** Used for built-in method references. */ - var funcProto = Function.prototype; + 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; + } - /** Used to resolve the decompiled source of functions. */ - var funcToString = funcProto.toString; + var SAlertContent = function (_React$Component) { + _inherits(SAlertContent, _React$Component); - /** - * Converts `func` to its source code. - * - * @private - * @param {Function} func The function to convert. - * @returns {string} Returns the source code. - */ - function toSource(func) { - if (func != null) { - try { - return funcToString.call(func); - } catch (e) {} - try { - return (func + ''); - } catch (e) {} - } - return ''; - } + function SAlertContent(props) { + _classCallCheck(this, SAlertContent); - module.exports = toSource; + return _possibleConstructorReturn(this, (SAlertContent.__proto__ || Object.getPrototypeOf(SAlertContent)).call(this, props)); + } + _createClass(SAlertContent, [{ + key: 'handleCloseAlert', + value: function handleCloseAlert() { + var closingTimeout = void 0; + var alertId = this.props.id; + var currentAlertElem = _reactDom2.default.findDOMNode(this); + var animationClose = function animationClose() { + currentAlertElem.style.display = 'none'; + _sAlertStore2.default.dispatch({ type: 'REMOVE', data: { id: alertId } }); + clearTimeout(closingTimeout); + }; + if (document.hidden || document.webkitHidden || !currentAlertElem.classList.contains('s-alert-is-effect')) { + _sAlertStore2.default.dispatch({ type: 'REMOVE', data: { id: alertId } }); + } else { + currentAlertElem.classList.remove('s-alert-show'); + closingTimeout = setTimeout(function () { + currentAlertElem.classList.add('s-alert-hide'); + }, 100); + currentAlertElem.removeEventListener('webkitAnimationEnd', animationClose, false); + currentAlertElem.removeEventListener('animationend', animationClose, false); + currentAlertElem.addEventListener('webkitAnimationEnd', animationClose, false); + currentAlertElem.addEventListener('animationend', animationClose, false); + } + // stop audio when closing + this.alertAudio && this.alertAudio.load(); + } + }, { + key: 'componentWillMount', + value: function componentWillMount() { + var beep = this.props.beep; + var condition = this.props.condition; + if (beep && typeof beep === 'string') { + this.alertAudio = new Audio(beep); + this.alertAudio.load(); + this.alertAudio.play(); + } + if (beep && (typeof beep === 'undefined' ? 'undefined' : _typeof(beep)) === 'object' && condition === 'info') { + this.alertAudio = new Audio(beep.info); + this.alertAudio.load(); + this.alertAudio.play(); + } + if (beep && (typeof beep === 'undefined' ? 'undefined' : _typeof(beep)) === 'object' && condition === 'error') { + this.alertAudio = new Audio(beep.error); + this.alertAudio.load(); + this.alertAudio.play(); + } + if (beep && (typeof beep === 'undefined' ? 'undefined' : _typeof(beep)) === 'object' && condition === 'success') { + this.alertAudio = new Audio(beep.success); + this.alertAudio.load(); + this.alertAudio.play(); + } + if (beep && (typeof beep === 'undefined' ? 'undefined' : _typeof(beep)) === 'object' && condition === 'warning') { + this.alertAudio = new Audio(beep.warning); + this.alertAudio.load(); + this.alertAudio.play(); + } + } + }, { + key: 'componentDidMount', + value: function componentDidMount() { + var _this2 = this; -/***/ }, -/* 49 */ -/***/ function(module, exports) { + if (typeof this.props.timeout === 'number') { + this.closeTimer = setTimeout(function () { + _this2.handleCloseAlert(); + }, this.props.timeout); + } + if (this.props.onShow) { + this.props.onShow(); + } + } + }, { + key: 'componentWillUnmount', + value: function componentWillUnmount() { + if (this.closeTimer) { + clearTimeout(this.closeTimer); + } + if (this.props.onClose) { + this.props.onClose(); + } + } + }, { + key: 'render', + value: function render() { + var classNames = 's-alert-box s-alert-' + this.props.condition + ' s-alert-' + this.props.position + ' ' + (this.props.effect ? 's-alert-is-effect s-alert-effect-' + this.props.effect : '') + ' s-alert-show'; + var message = this.props.html ? _react2.default.createElement('span', { dangerouslySetInnerHTML: { __html: this.props.message } }) : this.props.message; + var styles = this.props.boxPosition ? _sAlertTools2.default.styleToObj(this.props.boxPosition) : {}; + var id = this.props.id; + var handleClose = this.handleCloseAlert.bind(this); + var contentTemplate = this.props.contentTemplate || _SAlertContentTmpl2.default; + var customFields = this.props.customFields || {}; - /** - * Gets the value at `key` of `object`. - * - * @private - * @param {Object} [object] The object to query. - * @param {string} key The key of the property to get. - * @returns {*} Returns the property value. - */ - function getValue(object, key) { - return object == null ? undefined : object[key]; - } + return _react2.default.createElement(contentTemplate, { classNames: classNames, id: id, styles: styles, message: message, handleClose: handleClose, customFields: customFields }); + } + }]); - module.exports = getValue; + return SAlertContent; + }(_react2.default.Component); + SAlertContent.propTypes = { + condition: _propTypes2.default.string.isRequired, + message: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.node]), + position: _propTypes2.default.string.isRequired, + boxPosition: _propTypes2.default.string, + id: _propTypes2.default.string.isRequired, + effect: _propTypes2.default.string, + beep: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object, _propTypes2.default.bool]), + timeout: _propTypes2.default.oneOfType([_propTypes2.default.oneOf(['none']), _propTypes2.default.number]), + html: _propTypes2.default.bool, + onClose: _propTypes2.default.func, + onShow: _propTypes2.default.func, + customFields: _propTypes2.default.object, + contentTemplate: _propTypes2.default.func + }; -/***/ }, -/* 50 */ -/***/ function(module, exports, __webpack_require__) { + exports.default = SAlertContent; + }); - var mapCacheClear = __webpack_require__(51), - mapCacheDelete = __webpack_require__(59), - mapCacheGet = __webpack_require__(62), - mapCacheHas = __webpack_require__(63), - mapCacheSet = __webpack_require__(64); +/***/ }), +/* 28 */ +/***/ (function(module, exports, __webpack_require__) { - /** - * Creates a map cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function MapCache(entries) { - var index = -1, - length = entries == null ? 0 : entries.length; + var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { + if (true) { + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else if (typeof exports !== "undefined") { + factory(exports); + } else { + var mod = { + exports: {} + }; + factory(mod.exports); + global.sAlertTools = mod.exports; + } + })(this, function (exports) { + 'use strict'; - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } - } + Object.defineProperty(exports, "__esModule", { + value: true + }); - // Add methods to `MapCache`. - MapCache.prototype.clear = mapCacheClear; - MapCache.prototype['delete'] = mapCacheDelete; - MapCache.prototype.get = mapCacheGet; - MapCache.prototype.has = mapCacheHas; - MapCache.prototype.set = mapCacheSet; + 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; + }; - module.exports = MapCache; + var actualGlobalConfig = void 0; + var sAlertTools = { + randomId: function randomId() { + return Math.random().toString(36).split('.')[1]; + }, + returnFirstDefined: function returnFirstDefined() { + var value = void 0; + var i = void 0; -/***/ }, -/* 51 */ -/***/ function(module, exports, __webpack_require__) { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } - var Hash = __webpack_require__(52), - ListCache = __webpack_require__(22), - Map = __webpack_require__(35); + for (i = 0; i < args.length; i++) { + if (typeof args[i] !== 'undefined') { + value = args[i]; + break; + } + } + return value; + }, + styleToObj: function styleToObj(input) { + var result = {}, + i = void 0, + entry = void 0, + attributes = input && input.split(';').filter(Boolean); - /** - * Removes all key-value entries from the map. - * - * @private - * @name clear - * @memberOf MapCache - */ - function mapCacheClear() { - this.size = 0; - this.__data__ = { - 'hash': new Hash, - 'map': new (Map || ListCache), - 'string': new Hash - }; - } + for (i = 0; i < attributes.length; i++) { + entry = attributes[i].split(':'); + result[entry.splice(0, 1)[0].trim()] = entry.join(':').trim(); + } + return result; + }, + setGlobalConfig: function setGlobalConfig(config) { + if ((typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object') { + actualGlobalConfig = config; + } + }, + getGlobalConfig: function getGlobalConfig() { + return actualGlobalConfig; + } + }; - module.exports = mapCacheClear; + exports.default = sAlertTools; + }); +/***/ }), +/* 29 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ }, -/* 52 */ -/***/ function(module, exports, __webpack_require__) { + var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { + if (true) { + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else if (typeof exports !== "undefined") { + factory(exports); + } else { + var mod = { + exports: {} + }; + factory(mod.exports); + global.sAlertStore = mod.exports; + } + })(this, function (exports) { + 'use strict'; - var hashClear = __webpack_require__(53), - hashDelete = __webpack_require__(55), - hashGet = __webpack_require__(56), - hashHas = __webpack_require__(57), - hashSet = __webpack_require__(58); + Object.defineProperty(exports, "__esModule", { + value: true + }); - /** - * Creates a hash object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function Hash(entries) { - var index = -1, - length = entries == null ? 0 : entries.length; + function _toConsumableArray(arr) { + if (Array.isArray(arr)) { + for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { + arr2[i] = arr[i]; + } - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } - } - - // Add methods to `Hash`. - Hash.prototype.clear = hashClear; - Hash.prototype['delete'] = hashDelete; - Hash.prototype.get = hashGet; - Hash.prototype.has = hashHas; - Hash.prototype.set = hashSet; - - module.exports = Hash; - - -/***/ }, -/* 53 */ -/***/ function(module, exports, __webpack_require__) { - - var nativeCreate = __webpack_require__(54); - - /** - * Removes all key-value entries from the hash. - * - * @private - * @name clear - * @memberOf Hash - */ - function hashClear() { - this.__data__ = nativeCreate ? nativeCreate(null) : {}; - this.size = 0; - } - - module.exports = hashClear; - - -/***/ }, -/* 54 */ -/***/ function(module, exports, __webpack_require__) { - - var getNative = __webpack_require__(36); - - /* Built-in method references that are verified to be native. */ - var nativeCreate = getNative(Object, 'create'); - - module.exports = nativeCreate; + return arr2; + } else { + return Array.from(arr); + } + } + // custom simple store based on a awesome Redux library https://github.com/rackt/redux -/***/ }, -/* 55 */ -/***/ function(module, exports) { + var createSAlertStore = function createSAlertStore(reducer) { + var state = void 0; + var listeners = []; + var getState = function getState() { + return state; + }; + var dispatch = function dispatch(action) { + state = reducer(state, action); + listeners.forEach(function (listener) { + return listener(); + }); + }; + var subscribe = function subscribe(listener) { + listeners.push(listener); + return function () { + listeners = listeners.filter(function (l) { + return l !== listener; + }); + }; + }; + dispatch({}); + return { + getState: getState, dispatch: dispatch, subscribe: subscribe + }; + }; - /** - * Removes `key` and its value from the hash. - * - * @private - * @name delete - * @memberOf Hash - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function hashDelete(key) { - var result = this.has(key) && delete this.__data__[key]; - this.size -= result ? 1 : 0; - return result; - } + var insert = function insert(state, action) { + return [].concat(_toConsumableArray(state), [action.data]); + }; - module.exports = hashDelete; + var remove = function remove(state, action) { + var elemToRemoveArray = state.slice().filter(function (item) { + return item.id === action.data.id; + }); + if (Array.isArray(elemToRemoveArray)) { + var elemToRemoveIndex = state.indexOf(elemToRemoveArray[0]); + return [].concat(_toConsumableArray(state.slice(0, elemToRemoveIndex)), _toConsumableArray(state.slice(elemToRemoveIndex + 1))); + } + return state; + }; + var alertsReducer = function alertsReducer() { + var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + var action = arguments[1]; -/***/ }, -/* 56 */ -/***/ function(module, exports, __webpack_require__) { + switch (action.type) { + case 'INSERT': + return insert(state, action); + case 'REMOVE': + return remove(state, action); + case 'REMOVEALL': + return []; + default: + return state; + } + }; - var nativeCreate = __webpack_require__(54); + var sAlertStore = createSAlertStore(alertsReducer); - /** Used to stand-in for `undefined` hash values. */ - var HASH_UNDEFINED = '__lodash_hash_undefined__'; + exports.default = sAlertStore; + }); - /** Used for built-in method references. */ - var objectProto = Object.prototype; +/***/ }), +/* 30 */ +/***/ (function(module, exports, __webpack_require__) { - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; + var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { + if (true) { + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(2), __webpack_require__(3)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else if (typeof exports !== "undefined") { + factory(exports, require('react'), require('prop-types')); + } else { + var mod = { + exports: {} + }; + factory(mod.exports, global.react, global.propTypes); + global.SAlertContentTmpl = mod.exports; + } + })(this, function (exports, _react, _propTypes) { + 'use strict'; - /** - * Gets the hash value for `key`. - * - * @private - * @name get - * @memberOf Hash - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function hashGet(key) { - var data = this.__data__; - if (nativeCreate) { - var result = data[key]; - return result === HASH_UNDEFINED ? undefined : result; - } - return hasOwnProperty.call(data, key) ? data[key] : undefined; - } + Object.defineProperty(exports, "__esModule", { + value: true + }); - module.exports = hashGet; + var _react2 = _interopRequireDefault(_react); + var _propTypes2 = _interopRequireDefault(_propTypes); -/***/ }, -/* 57 */ -/***/ function(module, exports, __webpack_require__) { + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; + } - var nativeCreate = __webpack_require__(54); + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } - /** Used for built-in method references. */ - var objectProto = Object.prototype; + 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); + } + } - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; + }(); - /** - * Checks if a hash value for `key` exists. - * - * @private - * @name has - * @memberOf Hash - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function hashHas(key) { - var data = this.__data__; - return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); - } + function _possibleConstructorReturn(self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } - module.exports = hashHas; + 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); + } -/***/ }, -/* 58 */ -/***/ function(module, exports, __webpack_require__) { + 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 nativeCreate = __webpack_require__(54); + var SAlertContentTmpl = function (_React$Component) { + _inherits(SAlertContentTmpl, _React$Component); - /** Used to stand-in for `undefined` hash values. */ - var HASH_UNDEFINED = '__lodash_hash_undefined__'; + function SAlertContentTmpl(props) { + _classCallCheck(this, SAlertContentTmpl); - /** - * Sets the hash `key` to `value`. - * - * @private - * @name set - * @memberOf Hash - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the hash instance. - */ - function hashSet(key, value) { - var data = this.__data__; - this.size += this.has(key) ? 0 : 1; - data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; - return this; - } + return _possibleConstructorReturn(this, (SAlertContentTmpl.__proto__ || Object.getPrototypeOf(SAlertContentTmpl)).call(this, props)); + } - module.exports = hashSet; + _createClass(SAlertContentTmpl, [{ + key: 'render', + value: function render() { + return _react2.default.createElement( + 'div', + { className: this.props.classNames, id: this.props.id, style: this.props.styles }, + _react2.default.createElement( + 'div', + { className: 's-alert-box-inner' }, + this.props.message + ), + _react2.default.createElement('span', { className: 's-alert-close', onClick: this.props.handleClose }) + ); + } + }]); + return SAlertContentTmpl; + }(_react2.default.Component); -/***/ }, -/* 59 */ -/***/ function(module, exports, __webpack_require__) { + SAlertContentTmpl.propTypes = { + id: _propTypes2.default.string.isRequired, + classNames: _propTypes2.default.string.isRequired, + styles: _propTypes2.default.object.isRequired, + message: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]).isRequired, + handleClose: _propTypes2.default.func.isRequired, + customFields: _propTypes2.default.object + }; - var getMapData = __webpack_require__(60); + exports.default = SAlertContentTmpl; + }); - /** - * Removes `key` and its value from the map. - * - * @private - * @name delete - * @memberOf MapCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function mapCacheDelete(key) { - var result = getMapData(this, key)['delete'](key); - this.size -= result ? 1 : 0; - return result; - } +/***/ }), +/* 31 */ +/***/ (function(module, exports, __webpack_require__) { - module.exports = mapCacheDelete; + var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { + if (true) { + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(2), __webpack_require__(15), __webpack_require__(27), __webpack_require__(29), __webpack_require__(28)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else if (typeof exports !== "undefined") { + factory(exports, require('react'), require('react-dom'), require('../SAlertContent'), require('./s-alert-store'), require('./s-alert-tools')); + } else { + var mod = { + exports: {} + }; + factory(mod.exports, global.react, global.reactDom, global.SAlertContent, global.sAlertStore, global.sAlertTools); + global.sAlertDataPrep = mod.exports; + } + })(this, function (exports, _react, _reactDom, _SAlertContent, _sAlertStore, _sAlertTools) { + 'use strict'; + Object.defineProperty(exports, "__esModule", { + value: true + }); -/***/ }, -/* 60 */ -/***/ function(module, exports, __webpack_require__) { + var _react2 = _interopRequireDefault(_react); - var isKeyable = __webpack_require__(61); + var _reactDom2 = _interopRequireDefault(_reactDom); - /** - * Gets the data for `map`. - * - * @private - * @param {Object} map The map to query. - * @param {string} key The reference key. - * @returns {*} Returns the map data. - */ - function getMapData(map, key) { - var data = map.__data__; - return isKeyable(key) - ? data[typeof key == 'string' ? 'string' : 'hash'] - : data.map; - } + var _SAlertContent2 = _interopRequireDefault(_SAlertContent); - module.exports = getMapData; + var _sAlertStore2 = _interopRequireDefault(_sAlertStore); + var _sAlertTools2 = _interopRequireDefault(_sAlertTools); -/***/ }, -/* 61 */ -/***/ function(module, exports) { + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; + } - /** - * Checks if `value` is suitable for use as unique object key. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is suitable, else `false`. - */ - function isKeyable(value) { - var type = typeof value; - return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') - ? (value !== '__proto__') - : (value === null); - } - - module.exports = isKeyable; - - -/***/ }, -/* 62 */ -/***/ function(module, exports, __webpack_require__) { - - var getMapData = __webpack_require__(60); + var getAlertData = function getAlertData(sAlertPosition) { + var positionTop = 0; + var positionBottom = 0; + var padding = 0; + var alerts = {}; + var style = void 0; + var docElement = void 0; + var sAlertBoxHeight = void 0; + var positionTypeTop = void 0; + var positionTypeBottom = void 0; + var checkFirst = function checkFirst(type, objId) { + var collectionOfType = sAlertCollection.filter(function (obj) { + return obj.position === type || sAlertGlobalConfig.position === type; + }); + return collectionOfType && collectionOfType[0].id === objId; + }; + var positionFunc = function positionFunc(position, positionType, alert, docElement, sAlertBoxHeight, reactComponent) { + padding = aStack.spacing || parseInt(getComputedStyle(_reactDom2.default.findDOMNode(reactComponent))[positionType]); + if (checkFirst(aPosition, alert.id) && aOffset) { + position = 0; + position = position + parseInt(aOffset); + } + if (checkFirst(aPosition, alert.id) && aStack.spacing) { + position = position; + } else { + position = position + parseInt(padding); + } + style = positionType + ': ' + position + 'px;'; + position = position + sAlertBoxHeight; + return position; + }; - /** - * Gets the map value for `key`. - * - * @private - * @name get - * @memberOf MapCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function mapCacheGet(key) { - return getMapData(this, key).get(key); - } + var sAlertGlobalConfig = _sAlertTools2.default.getGlobalConfig(); + var aStack = void 0; + var aContentTemplate = void 0; + var aOffset = void 0; + var aMessage = void 0; + var aHtml = void 0; + var aCustomFields = void 0; + var aPosition = void 0; - module.exports = mapCacheGet; + var query = {}; + if (sAlertPosition === 'left') { + query = function query(item) { + return item.position === 'top-left' || item.position === 'bottom-left' || !item.position && (sAlertGlobalConfig.position === 'top-left' || sAlertGlobalConfig.position === 'bottom-left'); + }; + } + if (sAlertPosition === 'right') { + query = function query(item) { + return item.position === 'top-right' || item.position === 'bottom-right' || !item.position && (sAlertGlobalConfig.position === 'top-right' || sAlertGlobalConfig.position === 'bottom-right'); + }; + } + if (sAlertPosition === 'full-top') { + query = function query(item) { + return item.position === 'top' || !item.position && sAlertGlobalConfig.position === 'top'; + }; + } + if (sAlertPosition === 'full-bottom') { + query = function query(item) { + return item.position === 'bottom' || !item.position && sAlertGlobalConfig.position === 'bottom'; + }; + } + var currentState = _sAlertStore2.default.getState(); + var sAlertCollection = currentState.slice().filter(query); -/***/ }, -/* 63 */ -/***/ function(module, exports, __webpack_require__) { + return sAlertCollection.map(function (alert) { + aStack = sAlertGlobalConfig.stack; + aContentTemplate = sAlertGlobalConfig.contentTemplate; + aOffset = _sAlertTools2.default.returnFirstDefined(alert.offset, sAlertGlobalConfig.offset); + aMessage = _sAlertTools2.default.returnFirstDefined(alert.message, sAlertGlobalConfig.message); + aHtml = _sAlertTools2.default.returnFirstDefined(alert.html, sAlertGlobalConfig.html); + aCustomFields = _sAlertTools2.default.returnFirstDefined(alert.customFields, sAlertGlobalConfig.customFields); + aPosition = _sAlertTools2.default.returnFirstDefined(alert.position, sAlertGlobalConfig.position); + positionTypeTop = aPosition && /top/g.test(aPosition); + positionTypeBottom = aPosition && /bottom/g.test(aPosition); + if (aStack) { + // checking alert box height - needed to calculate position + docElement = document.createElement('div'); + docElement.classList.add('s-alert-box-height'); - var getMapData = __webpack_require__(60); + // mock element, needed for positions calculations + var reactElement = _react2.default.createElement(_SAlertContent2.default, { + key: _sAlertTools2.default.randomId(), + id: _sAlertTools2.default.randomId(), + condition: alert.condition, + message: aMessage, + position: aPosition, + effect: alert.effect, + boxPosition: alert.boxPosition, + beep: false, + timeout: 'none', + html: aHtml, + contentTemplate: aContentTemplate, + customFields: aCustomFields + }); + var reactComponent = _reactDom2.default.render(reactElement, docElement); - /** - * Checks if a map value for `key` exists. - * - * @private - * @name has - * @memberOf MapCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function mapCacheHas(key) { - return getMapData(this, key).has(key); - } + document.body.appendChild(docElement); + sAlertBoxHeight = parseInt(getComputedStyle(_reactDom2.default.findDOMNode(reactComponent))['height']); + if (positionTypeTop) { + positionTop = positionFunc(positionTop, 'top', alert, docElement, sAlertBoxHeight, reactComponent); + } + if (positionTypeBottom) { + positionBottom = positionFunc(positionBottom, 'bottom', alert, docElement, sAlertBoxHeight, reactComponent); + } + var sAlertComputedStyle = getComputedStyle(_reactDom2.default.findDOMNode(reactComponent)); + if (sAlertPosition === 'left') { + style = style + 'left: ' + (aStack.spacing || parseInt(sAlertComputedStyle.left)) + 'px;'; + } + if (sAlertPosition === 'right') { + style = style + 'right: ' + (aStack.spacing || parseInt(sAlertComputedStyle.right)) + 'px;'; + } + alerts = Object.assign({}, alert, { boxPosition: style }); + _reactDom2.default.unmountComponentAtNode(docElement); + docElement.parentNode.removeChild(docElement); + } else if (aOffset && positionTypeTop) { + alerts = Object.assign({}, alert, { boxPosition: 'top: ' + parseInt(aOffset) + 'px;' }); + } else if (aOffset && positionTypeBottom) { + alerts = Object.assign({}, alert, { boxPosition: 'bottom: ' + parseInt(aOffset) + 'px;' }); + } else { + alerts = alert; + } + return alerts; + }); + }; - module.exports = mapCacheHas; + exports.default = getAlertData; + }); +/***/ }), +/* 32 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ }, -/* 64 */ -/***/ function(module, exports, __webpack_require__) { + 'use strict'; - var getMapData = __webpack_require__(60); + Object.defineProperty(exports, "__esModule", { + value: true + }); - /** - * Sets the map `key` to `value`. - * - * @private - * @name set - * @memberOf MapCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the map cache instance. - */ - function mapCacheSet(key, value) { - var data = getMapData(this, key), - size = data.size; + 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; }; - data.set(key, value); - this.size += data.size == size ? 0 : 1; - return this; - } + 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; }; }(); - module.exports = mapCacheSet; + var _react = __webpack_require__(2); + var _react2 = _interopRequireDefault(_react); -/***/ }, -/* 65 */ -/***/ function(module, exports) { + var _classnames = __webpack_require__(12); - /** - * A specialized version of `_.forEach` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ - function arrayEach(array, iteratee) { - var index = -1, - length = array == null ? 0 : array.length; + var _classnames2 = _interopRequireDefault(_classnames); - while (++index < length) { - if (iteratee(array[index], index, array) === false) { - break; - } - } - return array; - } + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - module.exports = arrayEach; + 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; } -/***/ }, -/* 66 */ -/***/ function(module, exports, __webpack_require__) { + 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 max-len: 0 */ + /* eslint no-nested-ternary: 0 */ - var baseAssignValue = __webpack_require__(67), - eq = __webpack_require__(26); - /** Used for built-in method references. */ - var objectProto = Object.prototype; + var ExpandComponent = function (_Component) { + _inherits(ExpandComponent, _Component); - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; + function ExpandComponent() { + _classCallCheck(this, ExpandComponent); - /** - * 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))) { - baseAssignValue(object, key, value); + return _possibleConstructorReturn(this, (ExpandComponent.__proto__ || Object.getPrototypeOf(ExpandComponent)).apply(this, arguments)); } - } - module.exports = assignValue; + _createClass(ExpandComponent, [{ + key: 'render', + value: function render() { + var className = this.props.className; + var trCss = { + style: { + backgroundColor: this.props.bgColor + }, + className: (0, _classnames2.default)(className) + }; + return _react2.default.createElement( + 'tr', + _extends({ hidden: this.props.hidden, width: this.props.width }, trCss), + _react2.default.createElement( + 'td', + { colSpan: this.props.colSpan }, + this.props.children + ) + ); + } + }]); -/***/ }, -/* 67 */ -/***/ function(module, exports, __webpack_require__) { + return ExpandComponent; + }(_react.Component); - var defineProperty = __webpack_require__(68); + var _default = ExpandComponent; + exports.default = _default; + ; - /** - * The base implementation of `assignValue` and `assignMergeValue` without - * value checks. - * - * @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 baseAssignValue(object, key, value) { - if (key == '__proto__' && defineProperty) { - defineProperty(object, key, { - 'configurable': true, - 'enumerable': true, - 'value': value, - 'writable': true - }); - } else { - object[key] = value; + var _temp = function () { + if (typeof __REACT_HOT_LOADER__ === 'undefined') { + return; } - } - module.exports = baseAssignValue; + __REACT_HOT_LOADER__.register(ExpandComponent, 'ExpandComponent', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/ExpandComponent.js'); + __REACT_HOT_LOADER__.register(_default, 'default', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/ExpandComponent.js'); + }(); -/***/ }, -/* 68 */ -/***/ function(module, exports, __webpack_require__) { + ; - var getNative = __webpack_require__(36); +/***/ }), +/* 33 */ +/***/ (function(module, exports, __webpack_require__) { - var defineProperty = (function() { - try { - var func = getNative(Object, 'defineProperty'); - func({}, '', {}); - return func; - } catch (e) {} - }()); + 'use strict'; - module.exports = defineProperty; + 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; }; -/***/ }, -/* 69 */ -/***/ function(module, exports, __webpack_require__) { + 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 copyObject = __webpack_require__(70), - keys = __webpack_require__(71); + var _react = __webpack_require__(2); - /** - * The base implementation of `_.assign` without support for multiple sources - * or `customizer` functions. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @returns {Object} Returns `object`. - */ - function baseAssign(object, source) { - return object && copyObject(source, keys(source), object); - } + var _react2 = _interopRequireDefault(_react); - module.exports = baseAssign; + var _propTypes = __webpack_require__(3); + var _propTypes2 = _interopRequireDefault(_propTypes); -/***/ }, -/* 70 */ -/***/ function(module, exports, __webpack_require__) { + var _classnames = __webpack_require__(12); - var assignValue = __webpack_require__(66), - baseAssignValue = __webpack_require__(67); + var _classnames2 = _interopRequireDefault(_classnames); - /** - * 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) { - var isNew = !object; - object || (object = {}); + var _PageButton = __webpack_require__(34); - var index = -1, - length = props.length; + var _PageButton2 = _interopRequireDefault(_PageButton); - while (++index < length) { - var key = props[index]; + var _SizePerPageDropDown = __webpack_require__(35); - var newValue = customizer - ? customizer(object[key], source[key], key, object, source) - : undefined; + var _SizePerPageDropDown2 = _interopRequireDefault(_SizePerPageDropDown); - if (newValue === undefined) { - newValue = source[key]; - } - if (isNew) { - baseAssignValue(object, key, newValue); - } else { - assignValue(object, key, newValue); - } - } - return object; - } + var _Const = __webpack_require__(13); - module.exports = copyObject; + var _Const2 = _interopRequireDefault(_Const); + var _util = __webpack_require__(19); -/***/ }, -/* 71 */ -/***/ function(module, exports, __webpack_require__) { + var _util2 = _interopRequireDefault(_util); - var arrayLikeKeys = __webpack_require__(72), - baseKeys = __webpack_require__(87), - isArrayLike = __webpack_require__(91); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - /** - * 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); - } + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - module.exports = keys; + 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; } -/***/ }, -/* 72 */ -/***/ function(module, exports, __webpack_require__) { + var PaginationList = function (_Component) { + _inherits(PaginationList, _Component); - var baseTimes = __webpack_require__(73), - isArguments = __webpack_require__(74), - isArray = __webpack_require__(77), - isBuffer = __webpack_require__(78), - isIndex = __webpack_require__(81), - isTypedArray = __webpack_require__(82); + function PaginationList(props) { + _classCallCheck(this, PaginationList); - /** Used for built-in method references. */ - var objectProto = Object.prototype; + var _this = _possibleConstructorReturn(this, (PaginationList.__proto__ || Object.getPrototypeOf(PaginationList)).call(this, props)); - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; + _this.changePage = function () { + return _this.__changePage__REACT_HOT_LOADER__.apply(_this, arguments); + }; - /** - * 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) { - var isArr = isArray(value), - isArg = !isArr && isArguments(value), - isBuff = !isArr && !isArg && isBuffer(value), - isType = !isArr && !isArg && !isBuff && isTypedArray(value), - skipIndexes = isArr || isArg || isBuff || isType, - result = skipIndexes ? baseTimes(value.length, String) : [], - length = result.length; + _this.changeSizePerPage = function () { + return _this.__changeSizePerPage__REACT_HOT_LOADER__.apply(_this, arguments); + }; - for (var key in value) { - if ((inherited || hasOwnProperty.call(value, key)) && - !(skipIndexes && ( - // Safari 9 has enumerable `arguments.length` in strict mode. - key == 'length' || - // Node.js 0.10 has enumerable non-index properties on buffers. - (isBuff && (key == 'offset' || key == 'parent')) || - // PhantomJS 2 has enumerable non-index properties on typed arrays. - (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || - // Skip index properties. - isIndex(key, length) - ))) { - result.push(key); - } + _this.toggleDropDown = function () { + return _this.__toggleDropDown__REACT_HOT_LOADER__.apply(_this, arguments); + }; + + _this.state = { + open: _this.props.open + }; + return _this; } - return result; - } - module.exports = arrayLikeKeys; + _createClass(PaginationList, [{ + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps() { + var keepSizePerPageState = this.props.keepSizePerPageState; + if (!keepSizePerPageState) { + this.setState(function () { + return { open: false }; + }); + } + } + }, { + key: '__changePage__REACT_HOT_LOADER__', + value: function __changePage__REACT_HOT_LOADER__(page) { + var _props = this.props, + pageStartIndex = _props.pageStartIndex, + prePage = _props.prePage, + currPage = _props.currPage, + nextPage = _props.nextPage, + lastPage = _props.lastPage, + firstPage = _props.firstPage, + sizePerPage = _props.sizePerPage, + keepSizePerPageState = _props.keepSizePerPageState; -/***/ }, -/* 73 */ -/***/ function(module, exports) { - /** - * 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); + if (page === prePage) { + page = currPage - 1 < pageStartIndex ? pageStartIndex : currPage - 1; + } else if (page === nextPage) { + page = currPage + 1 > this.lastPage ? this.lastPage : currPage + 1; + } else if (page === lastPage) { + page = this.lastPage; + } else if (page === firstPage) { + page = pageStartIndex; + } else { + page = parseInt(page, 10); + } - while (++index < n) { - result[index] = iteratee(index); - } - return result; - } + if (keepSizePerPageState) { + this.setState(function () { + return { open: false }; + }); + } - module.exports = baseTimes; + if (page !== currPage) { + this.props.changePage(page, sizePerPage); + } + } + }, { + key: '__changeSizePerPage__REACT_HOT_LOADER__', + 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) { + this.totalPages = Math.ceil(this.props.dataSize / selectSize); + this.lastPage = this.props.pageStartIndex + this.totalPages - 1; + if (currPage > this.lastPage) currPage = this.lastPage; + this.props.changePage(currPage, selectSize); + if (this.props.onSizePerPageList) { + this.props.onSizePerPageList(selectSize); + } + } -/***/ }, -/* 74 */ -/***/ function(module, exports, __webpack_require__) { + this.setState(function () { + return { open: false }; + }); + } + }, { + key: '__toggleDropDown__REACT_HOT_LOADER__', + value: function __toggleDropDown__REACT_HOT_LOADER__() { + var _this2 = this; - var baseIsArguments = __webpack_require__(75), - isObjectLike = __webpack_require__(76); + this.setState(function () { + return { + open: !_this2.state.open + }; + }); + } + }, { + key: 'render', + value: function render() { + var _props2 = this.props, + currPage = _props2.currPage, + dataSize = _props2.dataSize, + sizePerPage = _props2.sizePerPage, + sizePerPageList = _props2.sizePerPageList, + paginationShowsTotal = _props2.paginationShowsTotal, + pageStartIndex = _props2.pageStartIndex, + paginationPanel = _props2.paginationPanel, + hidePageListOnlyOnePage = _props2.hidePageListOnlyOnePage; - /** Used for built-in method references. */ - var objectProto = Object.prototype; + this.totalPages = Math.ceil(dataSize / sizePerPage); + this.lastPage = this.props.pageStartIndex + this.totalPages - 1; + var pageBtns = this.makePage(_util2.default.isFunction(paginationPanel)); + var dropdown = this.makeDropDown(); - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; + var offset = Math.abs(_Const2.default.PAGE_START_INDEX - pageStartIndex); + var start = (currPage - pageStartIndex) * sizePerPage; + start = dataSize === 0 ? 0 : start + 1; + var to = Math.min(sizePerPage * (currPage + offset) - 1, dataSize); + if (to >= dataSize) to--; + var total = paginationShowsTotal ? _react2.default.createElement( + 'span', + null, + 'Showing rows ', + start, + ' to\xA0', + to + 1, + ' of\xA0', + dataSize + ) : null; - /** Built-in value references. */ - var propertyIsEnumerable = objectProto.propertyIsEnumerable; + if (_util2.default.isFunction(paginationShowsTotal)) { + total = paginationShowsTotal(start, to + 1, dataSize); + } - /** - * 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 - */ - var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { - return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && - !propertyIsEnumerable.call(value, 'callee'); - }; + 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 + } + }); - module.exports = isArguments; + var hidePageList = hidePageListOnlyOnePage && this.totalPages === 1 ? 'none' : 'block'; + return _react2.default.createElement( + 'div', + { className: 'row', style: { marginTop: 15 } }, + content || _react2.default.createElement( + 'div', + null, + _react2.default.createElement( + 'div', + { className: 'col-md-6 col-xs-6 col-sm-6 col-lg-6' }, + total, + sizePerPageList.length > 1 ? dropdown : null + ), + _react2.default.createElement( + 'div', + { style: { display: hidePageList }, + className: 'col-md-6 col-xs-6 col-sm-6 col-lg-6' }, + pageBtns + ) + ) + ); + } + }, { + key: 'makeDropDown', + value: function makeDropDown() { + var _this3 = 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; -/***/ }, -/* 75 */ -/***/ function(module, exports, __webpack_require__) { + if (sizePerPageDropDown) { + dropdown = sizePerPageDropDown({ + open: this.state.open, + hideSizePerPage: hideSizePerPage, + currSizePerPage: String(sizePerPage), + sizePerPageList: sizePerPageList, + toggleDropDown: this.toggleDropDown, + changeSizePerPage: this.changeSizePerPage + }); + if (dropdown.type.name === _SizePerPageDropDown2.default.name) { + dropdownProps = dropdown.props; + } else { + return dropdown; + } + } - var baseGetTag = __webpack_require__(39), - isObjectLike = __webpack_require__(76); + 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(); + _this3.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 _this4 = this; - /** `Object#toString` result references. */ - var argsTag = '[object Arguments]'; + var isCustomPagingPanel = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; - /** - * The base implementation of `_.isArguments`. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - */ - function baseIsArguments(value) { - return isObjectLike(value) && baseGetTag(value) == argsTag; - } + var pages = this.getPages(); + 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 === _this4.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; + var title = page + ''; - module.exports = baseIsArguments; + if (page === this.props.nextPage) { + title = this.props.nextPageTitle; + } else if (page === this.props.prePage) { + title = this.props.prePageTitle; + } else if (page === this.props.firstPage) { + title = this.props.firstPageTitle; + } else if (page === this.props.lastPage) { + title = this.props.lastPageTitle; + } + return _react2.default.createElement( + _PageButton2.default, + { key: page, + title: title, + changePage: this.changePage, + active: isActive, + 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', + value: function getPages() { + var pages = void 0; + var endPage = this.totalPages; + if (endPage <= 0) return []; + var startPage = Math.max(this.props.currPage - Math.floor(this.props.paginationSize / 2), this.props.pageStartIndex); + endPage = startPage + this.props.paginationSize - 1; -/***/ }, -/* 76 */ -/***/ function(module, exports) { + if (endPage > this.lastPage) { + endPage = this.lastPage; + startPage = endPage - this.props.paginationSize + 1; + } - /** - * 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 != null && typeof value == 'object'; - } + 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 || this.props.alwaysShowAllBtns) { + pages = [this.props.prePage]; + } else { + pages = []; + } - module.exports = isObjectLike; + for (var i = startPage; i <= endPage; i++) { + if (i >= this.props.pageStartIndex) pages.push(i); + } + if (endPage <= this.lastPage && pages.length > 1) { + pages.push(this.props.nextPage); + } + if (endPage !== this.lastPage && this.props.withFirstAndLast) { + pages.push(this.props.lastPage); + } -/***/ }, -/* 77 */ -/***/ function(module, exports) { + return pages; + } + }]); - /** - * 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; - - module.exports = isArray; - - -/***/ }, -/* 78 */ -/***/ function(module, exports, __webpack_require__) { - - /* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(41), - stubFalse = __webpack_require__(80); - - /** Detect free variable `exports`. */ - var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + return PaginationList; + }(_react.Component); - /** Detect free variable `module`. */ - var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + PaginationList.propTypes = { + currPage: _propTypes2.default.number, + sizePerPage: _propTypes2.default.number, + dataSize: _propTypes2.default.number, + changePage: _propTypes2.default.func, + sizePerPageList: _propTypes2.default.array, + paginationShowsTotal: _propTypes2.default.oneOfType([_propTypes2.default.bool, _propTypes2.default.func]), + paginationSize: _propTypes2.default.number, + onSizePerPageList: _propTypes2.default.func, + prePage: _propTypes2.default.string, + pageStartIndex: _propTypes2.default.number, + hideSizePerPage: _propTypes2.default.bool, + alwaysShowAllBtns: _propTypes2.default.bool, + withFirstAndLast: _propTypes2.default.bool, + sizePerPageDropDown: _propTypes2.default.func, + paginationPanel: _propTypes2.default.func, + prePageTitle: _propTypes2.default.string, + nextPageTitle: _propTypes2.default.string, + firstPageTitle: _propTypes2.default.string, + lastPageTitle: _propTypes2.default.string, + hidePageListOnlyOnePage: _propTypes2.default.bool, + keepSizePerPageState: _propTypes2.default.bool + }; - /** Detect the popular CommonJS extension `module.exports`. */ - var moduleExports = freeModule && freeModule.exports === freeExports; + PaginationList.defaultProps = { + sizePerPage: _Const2.default.SIZE_PER_PAGE, + pageStartIndex: _Const2.default.PAGE_START_INDEX + }; - /** Built-in value references. */ - var Buffer = moduleExports ? root.Buffer : undefined; + var _default = PaginationList; + exports.default = _default; + ; - /* Built-in method references for those with the same name as other `lodash` methods. */ - var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; + var _temp = function () { + if (typeof __REACT_HOT_LOADER__ === 'undefined') { + return; + } - /** - * Checks if `value` is a buffer. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. - * @example - * - * _.isBuffer(new Buffer(2)); - * // => true - * - * _.isBuffer(new Uint8Array(2)); - * // => false - */ - var isBuffer = nativeIsBuffer || stubFalse; + __REACT_HOT_LOADER__.register(PaginationList, 'PaginationList', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/pagination/PaginationList.js'); - module.exports = isBuffer; + __REACT_HOT_LOADER__.register(_default, 'default', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/pagination/PaginationList.js'); + }(); - /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(79)(module))) + ; -/***/ }, -/* 79 */ -/***/ function(module, exports) { +/***/ }), +/* 34 */ +/***/ (function(module, exports, __webpack_require__) { - module.exports = function(module) { - if(!module.webpackPolyfill) { - module.deprecate = function() {}; - module.paths = []; - // module.parent = undefined by default - module.children = []; - module.webpackPolyfill = 1; - } - return module; - } + 'use strict'; + Object.defineProperty(exports, "__esModule", { + value: true + }); -/***/ }, -/* 80 */ -/***/ function(module, exports) { + 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; }; }(); - /** - * This method returns `false`. - * - * @static - * @memberOf _ - * @since 4.13.0 - * @category Util - * @returns {boolean} Returns `false`. - * @example - * - * _.times(2, _.stubFalse); - * // => [false, false] - */ - function stubFalse() { - return false; - } + var _react = __webpack_require__(2); - module.exports = stubFalse; + var _react2 = _interopRequireDefault(_react); + var _propTypes = __webpack_require__(3); -/***/ }, -/* 81 */ -/***/ function(module, exports) { + var _propTypes2 = _interopRequireDefault(_propTypes); - /** Used as references for various `Number` constants. */ - var MAX_SAFE_INTEGER = 9007199254740991; + var _classnames = __webpack_require__(12); - /** Used to detect unsigned integer values. */ - var reIsUint = /^(?:0|[1-9]\d*)$/; + var _classnames2 = _interopRequireDefault(_classnames); - /** - * 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); - } + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - module.exports = isIndex; + 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; } -/***/ }, -/* 82 */ -/***/ function(module, exports, __webpack_require__) { + 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 baseIsTypedArray = __webpack_require__(83), - baseUnary = __webpack_require__(85), - nodeUtil = __webpack_require__(86); + var PageButton = function (_Component) { + _inherits(PageButton, _Component); - /* Node.js helper references. */ - var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + function PageButton(props) { + _classCallCheck(this, PageButton); - /** - * Checks if `value` is classified as a typed array. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. - * @example - * - * _.isTypedArray(new Uint8Array); - * // => true - * - * _.isTypedArray([]); - * // => false - */ - var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + var _this = _possibleConstructorReturn(this, (PageButton.__proto__ || Object.getPrototypeOf(PageButton)).call(this, props)); - module.exports = isTypedArray; + _this.pageBtnClick = function () { + return _this.__pageBtnClick__REACT_HOT_LOADER__.apply(_this, arguments); + }; + return _this; + } -/***/ }, -/* 83 */ -/***/ function(module, exports, __webpack_require__) { + _createClass(PageButton, [{ + key: '__pageBtnClick__REACT_HOT_LOADER__', + value: function __pageBtnClick__REACT_HOT_LOADER__(e) { + e.preventDefault(); + this.props.changePage(e.currentTarget.textContent); + } + }, { + key: 'render', + value: function render() { + var classes = (0, _classnames2.default)({ + 'active': this.props.active, + 'disabled': this.props.disable, + 'hidden': this.props.hidden, + 'page-item': true + }); + return _react2.default.createElement( + 'li', + { className: classes, title: this.props.title }, + _react2.default.createElement( + 'a', + { href: '#', onClick: this.pageBtnClick, className: 'page-link' }, + this.props.children + ) + ); + } + }]); - var baseGetTag = __webpack_require__(39), - isLength = __webpack_require__(84), - isObjectLike = __webpack_require__(76); + return PageButton; + }(_react.Component); - /** `Object#toString` result references. */ - var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - funcTag = '[object Function]', - mapTag = '[object Map]', - numberTag = '[object Number]', - objectTag = '[object Object]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - weakMapTag = '[object WeakMap]'; - - var arrayBufferTag = '[object ArrayBuffer]', - dataViewTag = '[object DataView]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; - - /** Used to identify `toStringTag` values of typed arrays. */ - var typedArrayTags = {}; - typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = - typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = - typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = - typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = - typedArrayTags[uint32Tag] = true; - typedArrayTags[argsTag] = typedArrayTags[arrayTag] = - typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = - typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = - typedArrayTags[errorTag] = typedArrayTags[funcTag] = - typedArrayTags[mapTag] = typedArrayTags[numberTag] = - typedArrayTags[objectTag] = typedArrayTags[regexpTag] = - typedArrayTags[setTag] = typedArrayTags[stringTag] = - typedArrayTags[weakMapTag] = false; + PageButton.propTypes = { + title: _propTypes2.default.string, + changePage: _propTypes2.default.func, + active: _propTypes2.default.bool, + disable: _propTypes2.default.bool, + hidden: _propTypes2.default.bool, + children: _propTypes2.default.node + }; - /** - * The base implementation of `_.isTypedArray` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. - */ - function baseIsTypedArray(value) { - return isObjectLike(value) && - isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; - } + var _default = PageButton; + exports.default = _default; + ; - module.exports = baseIsTypedArray; + var _temp = function () { + if (typeof __REACT_HOT_LOADER__ === 'undefined') { + return; + } + __REACT_HOT_LOADER__.register(PageButton, 'PageButton', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/pagination/PageButton.js'); -/***/ }, -/* 84 */ -/***/ function(module, exports) { + __REACT_HOT_LOADER__.register(_default, 'default', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/pagination/PageButton.js'); + }(); - /** Used as references for various `Number` constants. */ - var MAX_SAFE_INTEGER = 9007199254740991; + ; - /** - * 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; - } +/***/ }), +/* 35 */ +/***/ (function(module, exports, __webpack_require__) { - module.exports = isLength; + 'use strict'; + Object.defineProperty(exports, "__esModule", { + value: true + }); -/***/ }, -/* 85 */ -/***/ function(module, exports) { + 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; }; }(); - /** - * The base implementation of `_.unary` without support for storing metadata. - * - * @private - * @param {Function} func The function to cap arguments for. - * @returns {Function} Returns the new capped function. - */ - function baseUnary(func) { - return function(value) { - return func(value); - }; - } + var _react = __webpack_require__(2); - module.exports = baseUnary; + var _react2 = _interopRequireDefault(_react); + var _propTypes = __webpack_require__(3); -/***/ }, -/* 86 */ -/***/ function(module, exports, __webpack_require__) { + var _propTypes2 = _interopRequireDefault(_propTypes); - /* WEBPACK VAR INJECTION */(function(module) {var freeGlobal = __webpack_require__(42); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - /** Detect free variable `exports`. */ - var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - /** Detect free variable `module`. */ - var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + 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; } - /** Detect the popular CommonJS extension `module.exports`. */ - var moduleExports = freeModule && freeModule.exports === freeExports; + 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; } - /** Detect free variable `process` from Node.js. */ - var freeProcess = moduleExports && freeGlobal.process; + var sizePerPageDefaultClass = 'react-bs-table-sizePerPage-dropdown'; - /** Used to access faster Node.js helpers. */ - var nodeUtil = (function() { - try { - return freeProcess && freeProcess.binding && freeProcess.binding('util'); - } catch (e) {} - }()); + var SizePerPageDropDown = function (_Component) { + _inherits(SizePerPageDropDown, _Component); - module.exports = nodeUtil; + function SizePerPageDropDown() { + _classCallCheck(this, SizePerPageDropDown); - /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(79)(module))) + return _possibleConstructorReturn(this, (SizePerPageDropDown.__proto__ || Object.getPrototypeOf(SizePerPageDropDown)).apply(this, arguments)); + } -/***/ }, -/* 87 */ -/***/ function(module, exports, __webpack_require__) { + _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 isPrototype = __webpack_require__(88), - nativeKeys = __webpack_require__(89); - /** Used for built-in method references. */ - var objectProto = Object.prototype; + var openClass = open ? 'open show' : ''; + var dropDownStyle = { visibility: hidden ? 'hidden' : 'visible' }; - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; - - /** - * 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 _react2.default.createElement( + 'span', + { style: dropDownStyle, + className: variation + ' ' + openClass + ' ' + className + ' ' + sizePerPageDefaultClass }, + _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 result; - } - - module.exports = baseKeys; + }]); + return SizePerPageDropDown; + }(_react.Component); -/***/ }, -/* 88 */ -/***/ function(module, exports) { + SizePerPageDropDown.propTypes = { + open: _propTypes2.default.bool, + hidden: _propTypes2.default.bool, + btnContextual: _propTypes2.default.string, + currSizePerPage: _propTypes2.default.string, + options: _propTypes2.default.array, + variation: _propTypes2.default.oneOf(['dropdown', 'dropup']), + className: _propTypes2.default.string, + onClick: _propTypes2.default.func + }; + SizePerPageDropDown.defaultProps = { + open: false, + hidden: false, + btnContextual: 'btn-default', + variation: 'dropdown', + className: '' + }; - /** Used for built-in method references. */ - var objectProto = Object.prototype; + var _default = SizePerPageDropDown; + exports.default = _default; + ; - /** - * 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; + var _temp = function () { + if (typeof __REACT_HOT_LOADER__ === 'undefined') { + return; + } - return value === proto; - } + __REACT_HOT_LOADER__.register(sizePerPageDefaultClass, 'sizePerPageDefaultClass', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/pagination/SizePerPageDropDown.js'); - module.exports = isPrototype; + __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'); + }(); -/***/ }, -/* 89 */ -/***/ function(module, exports, __webpack_require__) { + ; - var overArg = __webpack_require__(90); +/***/ }), +/* 36 */ +/***/ (function(module, exports, __webpack_require__) { - /* Built-in method references for those with the same name as other `lodash` methods. */ - var nativeKeys = overArg(Object.keys, Object); + 'use strict'; - module.exports = nativeKeys; + 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"); } }; }(); -/***/ }, -/* 90 */ -/***/ function(module, exports) { + 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; }; - /** - * 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)); - }; - } + 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; }; }(); - module.exports = overArg; + var _react = __webpack_require__(2); + var _react2 = _interopRequireDefault(_react); -/***/ }, -/* 91 */ -/***/ function(module, exports, __webpack_require__) { + var _propTypes = __webpack_require__(3); - var isFunction = __webpack_require__(38), - isLength = __webpack_require__(84); + var _propTypes2 = _interopRequireDefault(_propTypes); - /** - * 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); - } + var _reactModal = __webpack_require__(37); - module.exports = isArrayLike; + var _reactModal2 = _interopRequireDefault(_reactModal); + var _Const = __webpack_require__(13); -/***/ }, -/* 92 */ -/***/ function(module, exports, __webpack_require__) { + var _Const2 = _interopRequireDefault(_Const); - var copyObject = __webpack_require__(70), - keysIn = __webpack_require__(93); + var _Notification = __webpack_require__(24); - /** - * The base implementation of `_.assignIn` without support for multiple sources - * or `customizer` functions. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @returns {Object} Returns `object`. - */ - function baseAssignIn(object, source) { - return object && copyObject(source, keysIn(source), object); - } + var _InsertModal = __webpack_require__(53); - module.exports = baseAssignIn; + var _InsertModal2 = _interopRequireDefault(_InsertModal); + var _InsertButton = __webpack_require__(57); -/***/ }, -/* 93 */ -/***/ function(module, exports, __webpack_require__) { + var _InsertButton2 = _interopRequireDefault(_InsertButton); - var arrayLikeKeys = __webpack_require__(72), - baseKeysIn = __webpack_require__(94), - isArrayLike = __webpack_require__(91); + var _DeleteButton = __webpack_require__(58); - /** - * Creates an array of the own and inherited enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @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; - * - * _.keysIn(new Foo); - * // => ['a', 'b', 'c'] (iteration order is not guaranteed) - */ - function keysIn(object) { - return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); - } + var _DeleteButton2 = _interopRequireDefault(_DeleteButton); - module.exports = keysIn; + var _ExportCSVButton = __webpack_require__(59); + var _ExportCSVButton2 = _interopRequireDefault(_ExportCSVButton); -/***/ }, -/* 94 */ -/***/ function(module, exports, __webpack_require__) { + var _ShowSelectedOnlyButton = __webpack_require__(60); - var isObject = __webpack_require__(45), - isPrototype = __webpack_require__(88), - nativeKeysIn = __webpack_require__(95); + var _ShowSelectedOnlyButton2 = _interopRequireDefault(_ShowSelectedOnlyButton); - /** Used for built-in method references. */ - var objectProto = Object.prototype; + var _SearchField = __webpack_require__(61); - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; + var _SearchField2 = _interopRequireDefault(_SearchField); - /** - * The base implementation of `_.keysIn` 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 baseKeysIn(object) { - if (!isObject(object)) { - return nativeKeysIn(object); - } - var isProto = isPrototype(object), - result = []; + var _ClearSearchButton = __webpack_require__(62); - for (var key in object) { - if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { - result.push(key); - } - } - return result; - } + var _ClearSearchButton2 = _interopRequireDefault(_ClearSearchButton); - module.exports = baseKeysIn; + 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"); } } -/***/ }, -/* 95 */ -/***/ function(module, exports) { + 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; } - /** - * This function is like - * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * except that it includes inherited enumerable properties. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ - function nativeKeysIn(object) { - var result = []; - if (object != null) { - for (var key in Object(object)) { - result.push(key); - } - } - return result; - } + 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 */ - module.exports = nativeKeysIn; + // import classSet from 'classnames'; + // import editor from '../Editor'; -/***/ }, -/* 96 */ -/***/ function(module, exports, __webpack_require__) { - /* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(41); + var ToolBar = function (_Component) { + _inherits(ToolBar, _Component); - /** Detect free variable `exports`. */ - var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + function ToolBar(props) { + var _arguments = arguments; - /** Detect free variable `module`. */ - var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + _classCallCheck(this, ToolBar); - /** Detect the popular CommonJS extension `module.exports`. */ - var moduleExports = freeModule && freeModule.exports === freeExports; + var _this = _possibleConstructorReturn(this, (ToolBar.__proto__ || Object.getPrototypeOf(ToolBar)).call(this, props)); - /** Built-in value references. */ - var Buffer = moduleExports ? root.Buffer : undefined, - allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined; + _this.displayCommonMessage = function () { + return _this.__displayCommonMessage__REACT_HOT_LOADER__.apply(_this, arguments); + }; - /** - * Creates a clone of `buffer`. - * - * @private - * @param {Buffer} buffer The buffer to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Buffer} Returns the cloned buffer. - */ - function cloneBuffer(buffer, isDeep) { - if (isDeep) { - return buffer.slice(); - } - var length = buffer.length, - result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); + _this.handleSaveBtnClick = function () { + return _this.__handleSaveBtnClick__REACT_HOT_LOADER__.apply(_this, arguments); + }; - buffer.copy(result); - return result; - } + _this.afterHandleSaveBtnClick = function () { + return _this.__afterHandleSaveBtnClick__REACT_HOT_LOADER__.apply(_this, arguments); + }; - module.exports = cloneBuffer; + _this.handleModalClose = function () { + return _this.__handleModalClose__REACT_HOT_LOADER__.apply(_this, arguments); + }; - /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(79)(module))) + _this.handleModalOpen = function () { + return _this.__handleModalOpen__REACT_HOT_LOADER__.apply(_this, arguments); + }; -/***/ }, -/* 97 */ -/***/ function(module, exports) { + _this.handleShowOnlyToggle = function () { + return _this.__handleShowOnlyToggle__REACT_HOT_LOADER__.apply(_this, arguments); + }; - /** - * Copies the values of `source` to `array`. - * - * @private - * @param {Array} source The array to copy values from. - * @param {Array} [array=[]] The array to copy values to. - * @returns {Array} Returns `array`. - */ - function copyArray(source, array) { - var index = -1, - length = source.length; + _this.handleDropRowBtnClick = function () { + return _this.__handleDropRowBtnClick__REACT_HOT_LOADER__.apply(_this, arguments); + }; - array || (array = Array(length)); - while (++index < length) { - array[index] = source[index]; - } - return array; - } - - module.exports = copyArray; - - -/***/ }, -/* 98 */ -/***/ function(module, exports, __webpack_require__) { - - var copyObject = __webpack_require__(70), - getSymbols = __webpack_require__(99); - - /** - * Copies own symbols of `source` to `object`. - * - * @private - * @param {Object} source The object to copy symbols from. - * @param {Object} [object={}] The object to copy symbols to. - * @returns {Object} Returns `object`. - */ - function copySymbols(source, object) { - return copyObject(source, getSymbols(source), object); - } - - module.exports = copySymbols; - - -/***/ }, -/* 99 */ -/***/ function(module, exports, __webpack_require__) { - - var overArg = __webpack_require__(90), - stubArray = __webpack_require__(100); - - /* Built-in method references for those with the same name as other `lodash` methods. */ - var nativeGetSymbols = Object.getOwnPropertySymbols; - - /** - * Creates an array of the own enumerable symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of symbols. - */ - var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray; - - module.exports = getSymbols; - - -/***/ }, -/* 100 */ -/***/ function(module, exports) { - - /** - * This method returns a new empty array. - * - * @static - * @memberOf _ - * @since 4.13.0 - * @category Util - * @returns {Array} Returns the new empty array. - * @example - * - * var arrays = _.times(2, _.stubArray); - * - * console.log(arrays); - * // => [[], []] - * - * console.log(arrays[0] === arrays[1]); - * // => false - */ - function stubArray() { - return []; - } - - module.exports = stubArray; - - -/***/ }, -/* 101 */ -/***/ function(module, exports, __webpack_require__) { - - var copyObject = __webpack_require__(70), - getSymbolsIn = __webpack_require__(102); - - /** - * Copies own and inherited symbols of `source` to `object`. - * - * @private - * @param {Object} source The object to copy symbols from. - * @param {Object} [object={}] The object to copy symbols to. - * @returns {Object} Returns `object`. - */ - function copySymbolsIn(source, object) { - return copyObject(source, getSymbolsIn(source), object); - } - - module.exports = copySymbolsIn; + _this.handleDebounce = function (func, wait, immediate) { + var timeout = void 0; + return function () { + var later = function later() { + timeout = null; -/***/ }, -/* 102 */ -/***/ function(module, exports, __webpack_require__) { + if (!immediate) { + func.apply(_this, _arguments); + } + }; - var arrayPush = __webpack_require__(103), - getPrototype = __webpack_require__(104), - getSymbols = __webpack_require__(99), - stubArray = __webpack_require__(100); + var callNow = immediate && !timeout; - /* Built-in method references for those with the same name as other `lodash` methods. */ - var nativeGetSymbols = Object.getOwnPropertySymbols; + clearTimeout(timeout); - /** - * Creates an array of the own and inherited enumerable symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of symbols. - */ - var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { - var result = []; - while (object) { - arrayPush(result, getSymbols(object)); - object = getPrototype(object); - } - return result; - }; + timeout = setTimeout(later, wait || 0); - module.exports = getSymbolsIn; + if (callNow) { + func.appy(_this, _arguments); + } + }; + }; + _this.handleKeyUp = function () { + return _this.__handleKeyUp__REACT_HOT_LOADER__.apply(_this, arguments); + }; -/***/ }, -/* 103 */ -/***/ function(module, exports) { + _this.handleExportCSV = function () { + return _this.__handleExportCSV__REACT_HOT_LOADER__.apply(_this, arguments); + }; - /** - * Appends the elements of `values` to `array`. - * - * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to append. - * @returns {Array} Returns `array`. - */ - function arrayPush(array, values) { - var index = -1, - length = values.length, - offset = array.length; + _this.handleClearBtnClick = function () { + return _this.__handleClearBtnClick__REACT_HOT_LOADER__.apply(_this, arguments); + }; - while (++index < length) { - array[offset + index] = values[index]; + _this.timeouteClear = 0; + _this.modalClassName; + _this.state = { + isInsertModalOpen: false, + validateState: null, + shakeEditor: false, + showSelected: false + }; + return _this; } - return array; - } - - module.exports = arrayPush; - - -/***/ }, -/* 104 */ -/***/ function(module, exports, __webpack_require__) { - - var overArg = __webpack_require__(90); - - /** Built-in value references. */ - var getPrototype = overArg(Object.getPrototypeOf, Object); - - module.exports = getPrototype; - - -/***/ }, -/* 105 */ -/***/ function(module, exports, __webpack_require__) { - - var baseGetAllKeys = __webpack_require__(106), - getSymbols = __webpack_require__(99), - keys = __webpack_require__(71); - - /** - * Creates an array of own enumerable property names and symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names and symbols. - */ - function getAllKeys(object) { - return baseGetAllKeys(object, keys, getSymbols); - } - - module.exports = getAllKeys; - - -/***/ }, -/* 106 */ -/***/ function(module, exports, __webpack_require__) { - - var arrayPush = __webpack_require__(103), - isArray = __webpack_require__(77); - - /** - * The base implementation of `getAllKeys` and `getAllKeysIn` which uses - * `keysFunc` and `symbolsFunc` to get the enumerable property names and - * symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Function} keysFunc The function to get the keys of `object`. - * @param {Function} symbolsFunc The function to get the symbols of `object`. - * @returns {Array} Returns the array of property names and symbols. - */ - function baseGetAllKeys(object, keysFunc, symbolsFunc) { - var result = keysFunc(object); - return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); - } - - module.exports = baseGetAllKeys; + _createClass(ToolBar, [{ + key: 'componentWillMount', + value: function componentWillMount() { + var _this2 = this; -/***/ }, -/* 107 */ -/***/ function(module, exports, __webpack_require__) { + var delay = this.props.searchDelayTime ? this.props.searchDelayTime : 0; + this.debounceCallback = this.handleDebounce(function () { + var seachInput = _this2.refs.seachInput; - var baseGetAllKeys = __webpack_require__(106), - getSymbolsIn = __webpack_require__(102), - keysIn = __webpack_require__(93); + seachInput && _this2.props.onSearch(seachInput.getValue()); + }, delay); + } + }, { + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps(nextProps) { + if (nextProps.reset) { + this.setSearchInput(''); + } + } + }, { + key: 'componentWillUnmount', + value: function componentWillUnmount() { + this.clearTimeout(); + } + }, { + key: 'setSearchInput', + value: function setSearchInput(text) { + var seachInput = this.refs.seachInput; - /** - * Creates an array of own and inherited enumerable property names and - * symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names and symbols. - */ - function getAllKeysIn(object) { - return baseGetAllKeys(object, keysIn, getSymbolsIn); - } + if (seachInput && seachInput.value !== text) { + seachInput.value = text; + } + } + }, { + key: 'clearTimeout', + value: function (_clearTimeout) { + function clearTimeout() { + return _clearTimeout.apply(this, arguments); + } - module.exports = getAllKeysIn; + clearTimeout.toString = function () { + return _clearTimeout.toString(); + }; + return clearTimeout; + }(function () { + if (this.timeouteClear) { + clearTimeout(this.timeouteClear); + this.timeouteClear = 0; + } + }) + }, { + key: '__displayCommonMessage__REACT_HOT_LOADER__', + value: function __displayCommonMessage__REACT_HOT_LOADER__() { + (0, _Notification.notice)('error', this.props.insertFailIndicator, ''); + } + }, { + key: 'validateNewRow', + value: function validateNewRow(newRow) { + var _this3 = this; -/***/ }, -/* 108 */ -/***/ function(module, exports, __webpack_require__) { + var validateState = {}; + var isValid = true; + var tempMsg = void 0; + var responseType = void 0; - var DataView = __webpack_require__(109), - Map = __webpack_require__(35), - Promise = __webpack_require__(110), - Set = __webpack_require__(111), - WeakMap = __webpack_require__(112), - baseGetTag = __webpack_require__(39), - toSource = __webpack_require__(48); + this.props.columns.forEach(function (column) { + if (column.isKey && column.keyValidator) { + // key validator for checking exist key + tempMsg = _this3.props.isValidKey(newRow[column.field]); + if (tempMsg) { + _this3.displayCommonMessage(); + isValid = false; + validateState[column.field] = tempMsg; + } + } else if (column.editable && column.editable.validator) { + // process validate + tempMsg = column.editable.validator(newRow[column.field], newRow); + responseType = typeof tempMsg === 'undefined' ? 'undefined' : _typeof(tempMsg); + if (responseType !== 'object' && tempMsg !== true) { + _this3.displayCommonMessage(); + isValid = false; + validateState[column.field] = tempMsg; + } else if (responseType === 'object' && tempMsg.isValid !== true) { + (0, _Notification.notice)(tempMsg.notification.type, tempMsg.notification.msg, tempMsg.notification.title); + isValid = false; + validateState[column.field] = tempMsg.notification.msg; + } + } + }); - /** `Object#toString` result references. */ - var mapTag = '[object Map]', - objectTag = '[object Object]', - promiseTag = '[object Promise]', - setTag = '[object Set]', - weakMapTag = '[object WeakMap]'; + if (isValid) { + return true; + } else { + this.clearTimeout(); + // show error in form and shake it + this.setState(function () { + return { validateState: validateState, shakeEditor: true }; + }); + this.timeouteClear = setTimeout(function () { + _this3.setState(function () { + return { shakeEditor: false }; + }); + }, 300); + return null; + } + } + }, { + key: '__handleSaveBtnClick__REACT_HOT_LOADER__', + value: function __handleSaveBtnClick__REACT_HOT_LOADER__(newRow) { + if (!this.validateNewRow(newRow)) { + // validation fail + return; + } + var msg = this.props.onAddRow(newRow); + if (msg !== false) { + this.afterHandleSaveBtnClick(msg); + } + } + }, { + key: '__afterHandleSaveBtnClick__REACT_HOT_LOADER__', + value: function __afterHandleSaveBtnClick__REACT_HOT_LOADER__(msg) { + var _this4 = this; - var dataViewTag = '[object DataView]'; - - /** Used to detect maps, sets, and weakmaps. */ - var dataViewCtorString = toSource(DataView), - mapCtorString = toSource(Map), - promiseCtorString = toSource(Promise), - setCtorString = toSource(Set), - weakMapCtorString = toSource(WeakMap); - - /** - * Gets the `toStringTag` of `value`. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ - var getTag = baseGetTag; - - // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. - if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || - (Map && getTag(new Map) != mapTag) || - (Promise && getTag(Promise.resolve()) != promiseTag) || - (Set && getTag(new Set) != setTag) || - (WeakMap && getTag(new WeakMap) != weakMapTag)) { - getTag = function(value) { - var result = baseGetTag(value), - Ctor = result == objectTag ? value.constructor : undefined, - ctorString = Ctor ? toSource(Ctor) : ''; - - if (ctorString) { - switch (ctorString) { - case dataViewCtorString: return dataViewTag; - case mapCtorString: return mapTag; - case promiseCtorString: return promiseTag; - case setCtorString: return setTag; - case weakMapCtorString: return weakMapTag; - } - } - return result; - }; - } - - module.exports = getTag; - - -/***/ }, -/* 109 */ -/***/ function(module, exports, __webpack_require__) { - - var getNative = __webpack_require__(36), - root = __webpack_require__(41); - - /* Built-in method references that are verified to be native. */ - var DataView = getNative(root, 'DataView'); - - module.exports = DataView; - - -/***/ }, -/* 110 */ -/***/ function(module, exports, __webpack_require__) { - - var getNative = __webpack_require__(36), - root = __webpack_require__(41); - - /* Built-in method references that are verified to be native. */ - var Promise = getNative(root, 'Promise'); - - module.exports = Promise; - - -/***/ }, -/* 111 */ -/***/ function(module, exports, __webpack_require__) { - - var getNative = __webpack_require__(36), - root = __webpack_require__(41); - - /* Built-in method references that are verified to be native. */ - var Set = getNative(root, 'Set'); - - module.exports = Set; - - -/***/ }, -/* 112 */ -/***/ function(module, exports, __webpack_require__) { - - var getNative = __webpack_require__(36), - root = __webpack_require__(41); - - /* Built-in method references that are verified to be native. */ - var WeakMap = getNative(root, 'WeakMap'); - - module.exports = WeakMap; - - -/***/ }, -/* 113 */ -/***/ function(module, exports) { - - /** Used for built-in method references. */ - var objectProto = Object.prototype; - - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; - - /** - * Initializes an array clone. - * - * @private - * @param {Array} array The array to clone. - * @returns {Array} Returns the initialized clone. - */ - function initCloneArray(array) { - var length = array.length, - result = array.constructor(length); - - // Add properties assigned by `RegExp#exec`. - if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { - result.index = array.index; - result.input = array.input; - } - return result; - } - - module.exports = initCloneArray; - - -/***/ }, -/* 114 */ -/***/ function(module, exports, __webpack_require__) { - - var cloneArrayBuffer = __webpack_require__(115), - cloneDataView = __webpack_require__(117), - cloneMap = __webpack_require__(118), - cloneRegExp = __webpack_require__(122), - cloneSet = __webpack_require__(123), - cloneSymbol = __webpack_require__(126), - cloneTypedArray = __webpack_require__(127); - - /** `Object#toString` result references. */ - var boolTag = '[object Boolean]', - dateTag = '[object Date]', - mapTag = '[object Map]', - numberTag = '[object Number]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - symbolTag = '[object Symbol]'; - - var arrayBufferTag = '[object ArrayBuffer]', - dataViewTag = '[object DataView]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; - - /** - * Initializes an object clone based on its `toStringTag`. - * - * **Note:** This function only supports cloning values with tags of - * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. - * - * @private - * @param {Object} object The object to clone. - * @param {string} tag The `toStringTag` of the object to clone. - * @param {Function} cloneFunc The function to clone values. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the initialized clone. - */ - function initCloneByTag(object, tag, cloneFunc, isDeep) { - var Ctor = object.constructor; - switch (tag) { - case arrayBufferTag: - return cloneArrayBuffer(object); - - case boolTag: - case dateTag: - return new Ctor(+object); - - case dataViewTag: - return cloneDataView(object, isDeep); - - case float32Tag: case float64Tag: - case int8Tag: case int16Tag: case int32Tag: - case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: - return cloneTypedArray(object, isDeep); - - case mapTag: - return cloneMap(object, isDeep, cloneFunc); - - case numberTag: - case stringTag: - return new Ctor(object); - - case regexpTag: - return cloneRegExp(object); - - case setTag: - return cloneSet(object, isDeep, cloneFunc); - - case symbolTag: - return cloneSymbol(object); - } - } - - module.exports = initCloneByTag; - - -/***/ }, -/* 115 */ -/***/ function(module, exports, __webpack_require__) { - - var Uint8Array = __webpack_require__(116); - - /** - * Creates a clone of `arrayBuffer`. - * - * @private - * @param {ArrayBuffer} arrayBuffer The array buffer to clone. - * @returns {ArrayBuffer} Returns the cloned array buffer. - */ - function cloneArrayBuffer(arrayBuffer) { - var result = new arrayBuffer.constructor(arrayBuffer.byteLength); - new Uint8Array(result).set(new Uint8Array(arrayBuffer)); - return result; - } - - module.exports = cloneArrayBuffer; - - -/***/ }, -/* 116 */ -/***/ function(module, exports, __webpack_require__) { - - var root = __webpack_require__(41); - - /** Built-in value references. */ - var Uint8Array = root.Uint8Array; - - module.exports = Uint8Array; - - -/***/ }, -/* 117 */ -/***/ function(module, exports, __webpack_require__) { - - var cloneArrayBuffer = __webpack_require__(115); - - /** - * Creates a clone of `dataView`. - * - * @private - * @param {Object} dataView The data view to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned data view. - */ - function cloneDataView(dataView, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; - return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); - } - - module.exports = cloneDataView; - - -/***/ }, -/* 118 */ -/***/ function(module, exports, __webpack_require__) { - - var addMapEntry = __webpack_require__(119), - arrayReduce = __webpack_require__(120), - mapToArray = __webpack_require__(121); - - /** Used to compose bitmasks for cloning. */ - var CLONE_DEEP_FLAG = 1; - - /** - * Creates a clone of `map`. - * - * @private - * @param {Object} map The map to clone. - * @param {Function} cloneFunc The function to clone values. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned map. - */ - function cloneMap(map, isDeep, cloneFunc) { - var array = isDeep ? cloneFunc(mapToArray(map), CLONE_DEEP_FLAG) : mapToArray(map); - return arrayReduce(array, addMapEntry, new map.constructor); - } - - module.exports = cloneMap; - - -/***/ }, -/* 119 */ -/***/ function(module, exports) { - - /** - * Adds the key-value `pair` to `map`. - * - * @private - * @param {Object} map The map to modify. - * @param {Array} pair The key-value pair to add. - * @returns {Object} Returns `map`. - */ - function addMapEntry(map, pair) { - // Don't return `map.set` because it's not chainable in IE 11. - map.set(pair[0], pair[1]); - return map; - } - - module.exports = addMapEntry; - - -/***/ }, -/* 120 */ -/***/ function(module, exports) { - - /** - * A specialized version of `_.reduce` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {boolean} [initAccum] Specify using the first element of `array` as - * the initial value. - * @returns {*} Returns the accumulated value. - */ - function arrayReduce(array, iteratee, accumulator, initAccum) { - var index = -1, - length = array == null ? 0 : array.length; - - if (initAccum && length) { - accumulator = array[++index]; - } - while (++index < length) { - accumulator = iteratee(accumulator, array[index], index, array); - } - return accumulator; - } - - module.exports = arrayReduce; - - -/***/ }, -/* 121 */ -/***/ function(module, exports) { - - /** - * Converts `map` to its key-value pairs. - * - * @private - * @param {Object} map The map to convert. - * @returns {Array} Returns the key-value pairs. - */ - function mapToArray(map) { - var index = -1, - result = Array(map.size); - - map.forEach(function(value, key) { - result[++index] = [key, value]; - }); - return result; - } - - module.exports = mapToArray; - - -/***/ }, -/* 122 */ -/***/ function(module, exports) { - - /** Used to match `RegExp` flags from their coerced string values. */ - var reFlags = /\w*$/; - - /** - * Creates a clone of `regexp`. - * - * @private - * @param {Object} regexp The regexp to clone. - * @returns {Object} Returns the cloned regexp. - */ - function cloneRegExp(regexp) { - var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); - result.lastIndex = regexp.lastIndex; - return result; - } - - module.exports = cloneRegExp; - - -/***/ }, -/* 123 */ -/***/ function(module, exports, __webpack_require__) { - - var addSetEntry = __webpack_require__(124), - arrayReduce = __webpack_require__(120), - setToArray = __webpack_require__(125); - - /** Used to compose bitmasks for cloning. */ - var CLONE_DEEP_FLAG = 1; - - /** - * Creates a clone of `set`. - * - * @private - * @param {Object} set The set to clone. - * @param {Function} cloneFunc The function to clone values. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned set. - */ - function cloneSet(set, isDeep, cloneFunc) { - var array = isDeep ? cloneFunc(setToArray(set), CLONE_DEEP_FLAG) : setToArray(set); - return arrayReduce(array, addSetEntry, new set.constructor); - } - - module.exports = cloneSet; - - -/***/ }, -/* 124 */ -/***/ function(module, exports) { - - /** - * Adds `value` to `set`. - * - * @private - * @param {Object} set The set to modify. - * @param {*} value The value to add. - * @returns {Object} Returns `set`. - */ - function addSetEntry(set, value) { - // Don't return `set.add` because it's not chainable in IE 11. - set.add(value); - return set; - } - - module.exports = addSetEntry; - - -/***/ }, -/* 125 */ -/***/ function(module, exports) { - - /** - * Converts `set` to an array of its values. - * - * @private - * @param {Object} set The set to convert. - * @returns {Array} Returns the values. - */ - function setToArray(set) { - var index = -1, - result = Array(set.size); - - set.forEach(function(value) { - result[++index] = value; - }); - return result; - } - - module.exports = setToArray; - - -/***/ }, -/* 126 */ -/***/ function(module, exports, __webpack_require__) { - - var Symbol = __webpack_require__(40); - - /** Used to convert symbols to primitives and strings. */ - var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; - - /** - * Creates a clone of the `symbol` object. - * - * @private - * @param {Object} symbol The symbol object to clone. - * @returns {Object} Returns the cloned symbol object. - */ - function cloneSymbol(symbol) { - return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; - } - - module.exports = cloneSymbol; - - -/***/ }, -/* 127 */ -/***/ function(module, exports, __webpack_require__) { - - var cloneArrayBuffer = __webpack_require__(115); - - /** - * Creates a clone of `typedArray`. - * - * @private - * @param {Object} typedArray The typed array to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned typed array. - */ - function cloneTypedArray(typedArray, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; - return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); - } - - module.exports = cloneTypedArray; - - -/***/ }, -/* 128 */ -/***/ function(module, exports, __webpack_require__) { - - var baseCreate = __webpack_require__(129), - getPrototype = __webpack_require__(104), - isPrototype = __webpack_require__(88); - - /** - * Initializes an object clone. - * - * @private - * @param {Object} object The object to clone. - * @returns {Object} Returns the initialized clone. - */ - function initCloneObject(object) { - return (typeof object.constructor == 'function' && !isPrototype(object)) - ? baseCreate(getPrototype(object)) - : {}; - } - - module.exports = initCloneObject; - - -/***/ }, -/* 129 */ -/***/ function(module, exports, __webpack_require__) { - - var isObject = __webpack_require__(45); - - /** Built-in value references. */ - var objectCreate = Object.create; - - /** - * The base implementation of `_.create` without support for assigning - * properties to the created object. - * - * @private - * @param {Object} proto The object to inherit from. - * @returns {Object} Returns the new object. - */ - var baseCreate = (function() { - function object() {} - return function(proto) { - if (!isObject(proto)) { - return {}; - } - if (objectCreate) { - return objectCreate(proto); - } - object.prototype = proto; - var result = new object; - object.prototype = undefined; - return result; - }; - }()); - - module.exports = baseCreate; - - -/***/ }, -/* 130 */ -/***/ function(module, exports, __webpack_require__) { - - var castPath = __webpack_require__(131), - last = __webpack_require__(139), - parent = __webpack_require__(140), - toKey = __webpack_require__(142); - - /** - * The base implementation of `_.unset`. - * - * @private - * @param {Object} object The object to modify. - * @param {Array|string} path The property path to unset. - * @returns {boolean} Returns `true` if the property is deleted, else `false`. - */ - function baseUnset(object, path) { - path = castPath(path, object); - object = parent(object, path); - return object == null || delete object[toKey(last(path))]; - } - - module.exports = baseUnset; - - -/***/ }, -/* 131 */ -/***/ function(module, exports, __webpack_require__) { - - var isArray = __webpack_require__(77), - isKey = __webpack_require__(132), - stringToPath = __webpack_require__(134), - toString = __webpack_require__(137); - - /** - * Casts `value` to a path array if it's not one. - * - * @private - * @param {*} value The value to inspect. - * @param {Object} [object] The object to query keys on. - * @returns {Array} Returns the cast property path array. - */ - function castPath(value, object) { - if (isArray(value)) { - return value; - } - return isKey(value, object) ? [value] : stringToPath(toString(value)); - } - - module.exports = castPath; - - -/***/ }, -/* 132 */ -/***/ function(module, exports, __webpack_require__) { - - var isArray = __webpack_require__(77), - isSymbol = __webpack_require__(133); - - /** Used to match property names within property paths. */ - var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, - reIsPlainProp = /^\w*$/; - - /** - * Checks if `value` is a property name and not a property path. - * - * @private - * @param {*} value The value to check. - * @param {Object} [object] The object to query keys on. - * @returns {boolean} Returns `true` if `value` is a property name, else `false`. - */ - function isKey(value, object) { - if (isArray(value)) { - return false; - } - var type = typeof value; - if (type == 'number' || type == 'symbol' || type == 'boolean' || - value == null || isSymbol(value)) { - return true; - } - return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || - (object != null && value in Object(object)); - } - - module.exports = isKey; - - -/***/ }, -/* 133 */ -/***/ function(module, exports, __webpack_require__) { - - var baseGetTag = __webpack_require__(39), - isObjectLike = __webpack_require__(76); - - /** `Object#toString` result references. */ - var symbolTag = '[object Symbol]'; - - /** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ - function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && baseGetTag(value) == symbolTag); - } - - module.exports = isSymbol; - - -/***/ }, -/* 134 */ -/***/ function(module, exports, __webpack_require__) { - - var memoizeCapped = __webpack_require__(135); - - /** Used to match property names within property paths. */ - var reLeadingDot = /^\./, - rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; - - /** Used to match backslashes in property paths. */ - var reEscapeChar = /\\(\\)?/g; - - /** - * Converts `string` to a property path array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the property path array. - */ - var stringToPath = memoizeCapped(function(string) { - var result = []; - if (reLeadingDot.test(string)) { - result.push(''); - } - string.replace(rePropName, function(match, number, quote, string) { - result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); - }); - return result; - }); - - module.exports = stringToPath; - - -/***/ }, -/* 135 */ -/***/ function(module, exports, __webpack_require__) { - - var memoize = __webpack_require__(136); - - /** Used as the maximum memoize cache size. */ - var MAX_MEMOIZE_SIZE = 500; - - /** - * A specialized version of `_.memoize` which clears the memoized function's - * cache when it exceeds `MAX_MEMOIZE_SIZE`. - * - * @private - * @param {Function} func The function to have its output memoized. - * @returns {Function} Returns the new memoized function. - */ - function memoizeCapped(func) { - var result = memoize(func, function(key) { - if (cache.size === MAX_MEMOIZE_SIZE) { - cache.clear(); - } - return key; - }); - - var cache = result.cache; - return result; - } - - module.exports = memoizeCapped; - - -/***/ }, -/* 136 */ -/***/ function(module, exports, __webpack_require__) { - - var MapCache = __webpack_require__(50); - - /** Error message constants. */ - var FUNC_ERROR_TEXT = 'Expected a function'; - - /** - * Creates a function that memoizes the result of `func`. If `resolver` is - * provided, it determines the cache key for storing the result based on the - * arguments provided to the memoized function. By default, the first argument - * provided to the memoized function is used as the map cache key. The `func` - * is invoked with the `this` binding of the memoized function. - * - * **Note:** The cache is exposed as the `cache` property on the memoized - * function. Its creation may be customized by replacing the `_.memoize.Cache` - * constructor with one whose instances implement the - * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) - * method interface of `clear`, `delete`, `get`, `has`, and `set`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to have its output memoized. - * @param {Function} [resolver] The function to resolve the cache key. - * @returns {Function} Returns the new memoized function. - * @example - * - * var object = { 'a': 1, 'b': 2 }; - * var other = { 'c': 3, 'd': 4 }; - * - * var values = _.memoize(_.values); - * values(object); - * // => [1, 2] - * - * values(other); - * // => [3, 4] - * - * object.a = 2; - * values(object); - * // => [1, 2] - * - * // Modify the result cache. - * values.cache.set(object, ['a', 'b']); - * values(object); - * // => ['a', 'b'] - * - * // Replace `_.memoize.Cache`. - * _.memoize.Cache = WeakMap; - */ - function memoize(func, resolver) { - if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { - throw new TypeError(FUNC_ERROR_TEXT); - } - var memoized = function() { - var args = arguments, - key = resolver ? resolver.apply(this, args) : args[0], - cache = memoized.cache; - - if (cache.has(key)) { - return cache.get(key); - } - var result = func.apply(this, args); - memoized.cache = cache.set(key, result) || cache; - return result; - }; - memoized.cache = new (memoize.Cache || MapCache); - return memoized; - } - - // Expose `MapCache`. - memoize.Cache = MapCache; - - module.exports = memoize; - - -/***/ }, -/* 137 */ -/***/ function(module, exports, __webpack_require__) { - - var baseToString = __webpack_require__(138); - - /** - * Converts `value` to a string. An empty string is returned for `null` - * and `undefined` values. The sign of `-0` is preserved. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. - * @example - * - * _.toString(null); - * // => '' - * - * _.toString(-0); - * // => '-0' - * - * _.toString([1, 2, 3]); - * // => '1,2,3' - */ - function toString(value) { - return value == null ? '' : baseToString(value); - } - - module.exports = toString; - - -/***/ }, -/* 138 */ -/***/ function(module, exports, __webpack_require__) { - - var Symbol = __webpack_require__(40), - arrayMap = __webpack_require__(19), - isArray = __webpack_require__(77), - isSymbol = __webpack_require__(133); - - /** Used as references for various `Number` constants. */ - var INFINITY = 1 / 0; - - /** Used to convert symbols to primitives and strings. */ - var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolToString = symbolProto ? symbolProto.toString : undefined; - - /** - * The base implementation of `_.toString` which doesn't convert nullish - * values to empty strings. - * - * @private - * @param {*} value The value to process. - * @returns {string} Returns the string. - */ - function baseToString(value) { - // Exit early for strings to avoid a performance hit in some environments. - if (typeof value == 'string') { - return value; - } - if (isArray(value)) { - // Recursively convert values (susceptible to call stack limits). - return arrayMap(value, baseToString) + ''; - } - if (isSymbol(value)) { - return symbolToString ? symbolToString.call(value) : ''; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; - } - - module.exports = baseToString; - - -/***/ }, -/* 139 */ -/***/ function(module, exports) { ->>>>>>> master - - var tableClasses = (0, _classnames2.default)('table', { - 'table-striped': this.props.striped, - 'table-bordered': this.props.bordered, - 'table-hover': this.props.hover, - 'table-condensed': this.props.condensed - }, this.props.tableBodyClass); - - var noneditableRows = cellEdit.nonEditableRows && cellEdit.nonEditableRows() || []; - var unselectable = this.props.selectRow.unselectable || []; - var isSelectRowDefined = this._isSelectRowDefined(); - var tableHeader = _util2.default.renderColGroup(this.props.columns, this.props.selectRow, this.props.expandColumnOptions); - 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 ExpandColumnCustomComponent = this.props.expandColumnOptions.expandColumnComponent; - var expandColSpan = this.props.columns.filter(function (col) { - return col && !col.hidden; - }).length; - if (isSelectRowDefined && !this.props.selectRow.hideSelectColumn) { - expandColSpan += 1; - } - var tabIndex = 1; - if (this.props.expandColumnOptions.expandColumnVisible) { - expandColSpan += 1; - } - - var tableRows = this.props.data.map(function (data, r) { - var tableColumns = this.props.columns.filter(function (_) { - return _ != null; - }).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 - column.editable.readOnly !== true && this.state.currEditCell !== null && this.state.currEditCell.rid === r && this.state.currEditCell.cid === i && noneditableRows.indexOf(data[this.props.keyField]) === -1) { - var editable = column.editable; - var format = column.format ? function (value) { - return column.format(value, data, column.formatExtraData, r).replace(/<.*?>/g, ''); - } : false; - if (_util2.default.isFunction(column.editable)) { - editable = column.editable(fieldValue, data, r, i); - } - - return _react2.default.createElement(_TableEditColumn2.default, { - completeEdit: this.handleCompleteEditCell - // add by bluespring for column editor customize - , editable: editable, - customEditor: column.customEditor, - 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, - isFocus: isFocusCell, - customStyleWithNav: customEditAndNavStyle }); - } else { - // add by bluespring for className customize - var columnChild = fieldValue && fieldValue.toString(); - var columnTitle = null; - var tdClassName = column.className; - if (_util2.default.isFunction(column.className)) { - tdClassName = column.className(fieldValue, data, r, i); - } - - if (typeof column.format !== 'undefined') { - var formattedValue = column.format(fieldValue, data, column.formatExtraData, r); - if (!_react2.default.isValidElement(formattedValue)) { - columnChild = _react2.default.createElement('div', { dangerouslySetInnerHTML: { __html: formattedValue } }); - } else { - columnChild = formattedValue; - columnTitle = column.columnTitle && formattedValue ? formattedValue.toString() : null; - } - } else { - columnTitle = column.columnTitle && fieldValue ? fieldValue.toString() : null; - } - return _react2.default.createElement( - _TableColumn2.default, - { key: i, - rIndex: r, - dataAlign: column.align, - className: tdClassName, - columnTitle: columnTitle, - cellEdit: cellEdit, - hidden: column.hidden, - onEdit: this.handleEditCell, - width: column.width, - onClick: this.handleClickCell, - attrs: column.attrs, - style: column.style, - tabIndex: tabIndex++ + '', - isFocus: isFocusCell, - keyBoardNav: enableKeyBoardNav, - onKeyDown: this.handleCellKeyDown, - customNavStyle: customNavStyle, - row: data }, - columnChild - ); - } - }, this); - var key = data[this.props.keyField]; - var disable = unselectable.indexOf(key) !== -1; - var selected = this.props.selectedRowKeys.indexOf(key) !== -1; - var selectRowColumn = isSelectRowDefined && !this.props.selectRow.hideSelectColumn ? this.renderSelectRowColumn(selected, inputType, disable, CustomComponent, r, data) : null; - var expandedRowColumn = this.renderExpandRowColumn(this.props.expandableRow && this.props.expandableRow(data), this.props.expanding.indexOf(key) > -1, ExpandColumnCustomComponent, r, data); - var haveExpandContent = this.props.expandableRow && this.props.expandableRow(data); - var isExpanding = haveExpandContent && this.props.expanding.indexOf(key) > -1; - - // add by bluespring for className customize - var trClassName = this.props.trClassName; - if (_util2.default.isFunction(this.props.trClassName)) { - trClassName = this.props.trClassName(data, r); - } - if (isExpanding && this.props.expandParentClass) { - trClassName += _util2.default.isFunction(this.props.expandParentClass) ? this.props.expandParentClass(data, r) : this.props.expandParentClass; - } - var result = [_react2.default.createElement( - _TableRow2.default, - { isSelected: selected, key: key, className: trClassName, - index: r, - row: data, - selectRow: isSelectRowDefined ? this.props.selectRow : undefined, - enableCellEdit: cellEdit.mode !== _Const2.default.CELL_EDIT_NONE, - onRowClick: this.handleRowClick, - onRowDoubleClick: this.handleRowDoubleClick, - onRowMouseOver: this.handleRowMouseOver, - onRowMouseOut: this.handleRowMouseOut, - onSelectRow: this.handleSelectRow, - onExpandRow: this.handleClickCell, - unselectableRow: disable }, - this.props.expandColumnOptions.expandColumnVisible && this.props.expandColumnOptions.expandColumnBeforeSelectColumn && expandedRowColumn, - selectRowColumn, - this.props.expandColumnOptions.expandColumnVisible && !this.props.expandColumnOptions.expandColumnBeforeSelectColumn && expandedRowColumn, - tableColumns - )]; - - if (haveExpandContent) { - var expandBodyClass = _util2.default.isFunction(this.props.expandBodyClass) ? this.props.expandBodyClass(data, r, isExpanding) : this.props.expandBodyClass; - result.push(_react2.default.createElement( - _ExpandComponent2.default, - { - key: key + '-expand', - row: data, - className: expandBodyClass, - bgColor: this.props.expandRowBgColor || this.props.selectRow.bgColor || undefined, - hidden: !isExpanding, - colSpan: expandColSpan, - width: "100%" }, - this.props.expandComponent(data) - )); - } - return result; - }, this); - - if (tableRows.length === 0 && !this.props.withoutNoDataText) { - var colSpan = this.props.columns.filter(function (c) { - return !c.hidden; - }).length + (isSelectRowDefined && !this.props.selectRow.hideSelectColumn ? 1 : 0) + (this.props.expandColumnOptions.expandColumnVisible ? 1 : 0); - tableRows = [_react2.default.createElement( - _TableRow2.default, - { key: '##table-empty##' }, - _react2.default.createElement( - 'td', - { 'data-toggle': 'collapse', - colSpan: colSpan, - className: 'react-bs-table-no-data' }, - this.props.noDataText || _Const2.default.NO_DATA_TEXT - ) - )]; - } - - return _react2.default.createElement( - 'div', - { ref: 'container', - className: (0, _classnames2.default)('react-bs-container-body', this.props.bodyContainerClass), - style: this.props.style }, - _react2.default.createElement( - 'table', - { className: tableClasses }, - _react2.default.cloneElement(tableHeader, { ref: 'header' }), - _react2.default.createElement( - 'tbody', - { ref: 'tbody' }, - tableRows - ) - ) - ); - } - }, { - 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; - var enterToExpand = (typeof keyBoardNav === 'undefined' ? 'undefined' : _typeof(keyBoardNav)) === 'object' ? keyBoardNav.enterToExpand : false; - - if (cellEdit && enterToEdit) { - this.handleEditCell(e.target.parentElement.rowIndex + 1, e.currentTarget.cellIndex, '', e); - } - - if (enterToExpand) { - this.handleClickCell(this.props.y + 1, this.props.x); - } - } - if (offset && keyBoardNav) { - onNavigateCell(offset); - } - } - }, { - key: '__handleRowMouseOut__REACT_HOT_LOADER__', - value: function __handleRowMouseOut__REACT_HOT_LOADER__(rowIndex, event) { - var targetRow = this.props.data[rowIndex]; - this.props.onRowMouseOut(targetRow, event); - } - }, { - key: '__handleRowMouseOver__REACT_HOT_LOADER__', - value: function __handleRowMouseOver__REACT_HOT_LOADER__(rowIndex, event) { - var targetRow = this.props.data[rowIndex]; - this.props.onRowMouseOver(targetRow, event); - } - }, { - key: '__handleRowClick__REACT_HOT_LOADER__', - value: function __handleRowClick__REACT_HOT_LOADER__(rowIndex, cellIndex) { - var onRowClick = this.props.onRowClick; - - if (this._isSelectRowDefined()) cellIndex--; - if (this._isExpandColumnVisible()) cellIndex--; - onRowClick(this.props.data[rowIndex - 1], rowIndex - 1, cellIndex); - } - }, { - key: '__handleRowDoubleClick__REACT_HOT_LOADER__', - value: function __handleRowDoubleClick__REACT_HOT_LOADER__(rowIndex) { - var onRowDoubleClick = this.props.onRowDoubleClick; - - var targetRow = this.props.data[rowIndex]; - onRowDoubleClick(targetRow); - } - }, { - key: '__handleSelectRow__REACT_HOT_LOADER__', - value: function __handleSelectRow__REACT_HOT_LOADER__(rowIndex, isSelected, e) { - var selectedRow = void 0; - var _props3 = this.props, - data = _props3.data, - onSelectRow = _props3.onSelectRow; - - data.forEach(function (row, i) { - if (i === rowIndex - 1) { - selectedRow = row; - return false; - } - }); - onSelectRow(selectedRow, isSelected, e); - } - }, { - key: '__handleSelectRowColumChange__REACT_HOT_LOADER__', - value: function __handleSelectRowColumChange__REACT_HOT_LOADER__(e, rowIndex) { - if (!this.props.selectRow.clickToSelect || !this.props.selectRow.clickToSelectAndEditCell) { - this.handleSelectRow(rowIndex + 1, e.currentTarget.checked, e); - } - } - }, { - key: '__handleClickCell__REACT_HOT_LOADER__', - value: function __handleClickCell__REACT_HOT_LOADER__(rowIndex) { - var _this2 = this; - - var columnIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : -1; - var _props4 = this.props, - columns = _props4.columns, - keyField = _props4.keyField, - expandBy = _props4.expandBy, - expandableRow = _props4.expandableRow, - _props4$selectRow = _props4.selectRow, - clickToExpand = _props4$selectRow.clickToExpand, - hideSelectColumn = _props4$selectRow.hideSelectColumn, - onlyOneExpanding = _props4.onlyOneExpanding; - - var selectRowAndExpand = this._isSelectRowDefined() && !clickToExpand ? false : true; - columnIndex = this._isSelectRowDefined() && !hideSelectColumn ? columnIndex - 1 : columnIndex; - columnIndex = this._isExpandColumnVisible() ? 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 */ - expandBy === _Const2.default.EXPAND_BY_COL && columnIndex < 0 || expandBy === _Const2.default.EXPAND_BY_COL && columns[columnIndex].expandable)) { - (function () { - var expanding = _this2.props.expanding; - var rowKey = _this2.props.data[rowIndex - 1][keyField]; - var isRowExpanding = expanding.indexOf(rowKey) > -1; - - if (isRowExpanding) { - // collapse - expanding = expanding.filter(function (k) { - return k !== rowKey; - }); - } else { - // expand - if (onlyOneExpanding) expanding = [rowKey];else expanding.push(rowKey); - } - _this2.props.onExpand(expanding, rowKey, isRowExpanding); - })(); - } - } - }, { - key: '__handleEditCell__REACT_HOT_LOADER__', - value: function __handleEditCell__REACT_HOT_LOADER__(rowIndex, columnIndex, action, e) { - var selectRow = this.props.selectRow; - - var defineSelectRow = this._isSelectRowDefined(); - var expandColumnVisible = this._isExpandColumnVisible(); - if (defineSelectRow) { - columnIndex--; - if (selectRow.hideSelectColumn) columnIndex++; - } - if (expandColumnVisible) { - columnIndex--; - } - rowIndex--; - - if (action === 'tab') { - if (defineSelectRow && !selectRow.hideSelectColumn) columnIndex++; - if (expandColumnVisible) columnIndex++; - this.handleCompleteEditCell(e.target.value, rowIndex, columnIndex - 1); - if (columnIndex >= this.props.columns.length) { - this.handleCellKeyDown(e, true); - } else { - this.handleCellKeyDown(e); - } - - var _nextEditableCell = this.nextEditableCell(rowIndex, columnIndex), - nextRIndex = _nextEditableCell.nextRIndex, - nextCIndex = _nextEditableCell.nextCIndex; - - rowIndex = nextRIndex; - columnIndex = nextCIndex; - } - - var stateObj = { - currEditCell: { - rid: rowIndex, - cid: columnIndex - } - }; - - if (this.props.selectRow.clickToSelectAndEditCell && this.props.cellEdit.mode !== _Const2.default.CELL_EDIT_DBCLICK) { - var selected = this.props.selectedRowKeys.indexOf(this.props.data[rowIndex][this.props.keyField]) !== -1; - this.handleSelectRow(rowIndex + 1, !selected, e); - } - this.setState(function () { - return stateObj; - }); - } - }, { - key: '__nextEditableCell__REACT_HOT_LOADER__', - value: function __nextEditableCell__REACT_HOT_LOADER__(rIndex, cIndex) { - var keyField = this.props.keyField; - - var nextRIndex = rIndex; - var nextCIndex = cIndex; - var row = void 0; - var column = void 0; - do { - if (nextCIndex >= this.props.columns.length) { - nextRIndex++; - nextCIndex = 0; - } - row = this.props.data[nextRIndex]; - column = this.props.columns[nextCIndex]; - if (!row) break; - var editable = column.editable; - if (_util2.default.isFunction(column.editable)) { - editable = column.editable(column, row, nextRIndex, nextCIndex); - } - if (editable && editable.readOnly !== true && !column.hidden && keyField !== column.name) { - break; - } else { - nextCIndex++; - } - } while (row); - return { nextRIndex: nextRIndex, nextCIndex: nextCIndex }; - } - }, { - key: '__handleCompleteEditCell__REACT_HOT_LOADER__', - value: function __handleCompleteEditCell__REACT_HOT_LOADER__(newVal, rowIndex, columnIndex) { - if (newVal !== null) { - var result = this.props.cellEdit.__onCompleteEdit__(newVal, rowIndex, columnIndex); - if (result !== _Const2.default.AWAIT_BEFORE_CELL_EDIT) { - this.setState(function () { - return { currEditCell: null }; - }); - } - } else { - this.setState(function () { - return { currEditCell: null }; - }); - } - } - }, { - key: '__cancelEditCell__REACT_HOT_LOADER__', - value: function __cancelEditCell__REACT_HOT_LOADER__() { - this.setState(function () { - return { currEditCell: null }; - }); - } - }, { - key: '__handleClickonSelectColumn__REACT_HOT_LOADER__', - value: function __handleClickonSelectColumn__REACT_HOT_LOADER__(e, isSelect, rowIndex, row) { - e.stopPropagation(); - if (e.target.tagName === 'TD' && (this.props.selectRow.clickToSelect || this.props.selectRow.clickToSelectAndEditCell)) { - var unselectable = this.props.selectRow.unselectable || []; - if (unselectable.indexOf(row[this.props.keyField]) === -1) { - this.handleSelectRow(rowIndex + 1, isSelect, e); - this.handleClickCell(rowIndex + 1); - } - } - } - }, { - key: 'renderSelectRowColumn', - value: function renderSelectRowColumn(selected, inputType, disabled) { - var CustomComponent = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; - - var _this3 = this; - - var rowIndex = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null; - var row = arguments[5]; - - return _react2.default.createElement( - 'td', - { onClick: function onClick(e) { - _this3.handleClickonSelectColumn(e, !selected, rowIndex, row); - }, style: { textAlign: 'center' } }, - CustomComponent ? _react2.default.createElement(CustomComponent, { type: inputType, checked: selected, disabled: disabled, - rowIndex: rowIndex, - onChange: function onChange(e) { - return _this3.handleSelectRowColumChange(e, rowIndex); - } }) : _react2.default.createElement('input', { type: inputType, checked: selected, disabled: disabled, - onChange: function onChange(e) { - return _this3.handleSelectRowColumChange(e, rowIndex); - } }) - ); - } - }, { - key: 'renderExpandRowColumn', - value: function renderExpandRowColumn(isExpandableRow, isExpanded, CustomComponent) { - var _this4 = this; - - var rowIndex = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; - - var content = null; - if (CustomComponent) { - content = _react2.default.createElement(CustomComponent, { isExpandableRow: isExpandableRow, isExpanded: isExpanded }); - } else if (isExpandableRow) { - content = isExpanded ? _react2.default.createElement('span', { className: 'glyphicon glyphicon-minus' }) : _react2.default.createElement('span', { className: 'glyphicon glyphicon-plus' }); - } else { - content = ' '; - } - - return _react2.default.createElement( - 'td', - { - className: 'react-bs-table-expand-cell', - onClick: function onClick() { - return _this4.handleClickCell(rowIndex + 1); - } }, - content - ); - } - }, { - key: '_isSelectRowDefined', - value: function _isSelectRowDefined() { - return this.props.selectRow.mode === _Const2.default.ROW_SELECT_SINGLE || this.props.selectRow.mode === _Const2.default.ROW_SELECT_MULTI; - } - }, { - key: '_isExpandColumnVisible', - value: function _isExpandColumnVisible() { - return this.props.expandColumnOptions.expandColumnVisible; - } - }, { - key: '__getHeaderColGrouop__REACT_HOT_LOADER__', - value: function __getHeaderColGrouop__REACT_HOT_LOADER__() { - return this.refs.header.childNodes; - } - }]); - - return TableBody; - }(_react.Component); - - TableBody.propTypes = { - data: _propTypes2.default.array, - columns: _propTypes2.default.array, - striped: _propTypes2.default.bool, - bordered: _propTypes2.default.bool, - hover: _propTypes2.default.bool, - condensed: _propTypes2.default.bool, - keyField: _propTypes2.default.string, - selectedRowKeys: _propTypes2.default.array, - onRowClick: _propTypes2.default.func, - onRowDoubleClick: _propTypes2.default.func, - onSelectRow: _propTypes2.default.func, - noDataText: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]), - withoutNoDataText: _propTypes2.default.bool, - style: _propTypes2.default.object, - tableBodyClass: _propTypes2.default.string, - bodyContainerClass: _propTypes2.default.string, - expandableRow: _propTypes2.default.func, - expandComponent: _propTypes2.default.func, - expandRowBgColor: _propTypes2.default.string, - expandBy: _propTypes2.default.string, - expanding: _propTypes2.default.array, - onExpand: _propTypes2.default.func, - expandBodyClass: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]), - expandParentClass: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]), - onlyOneExpanding: _propTypes2.default.bool, - beforeShowError: _propTypes2.default.func, - keyBoardNav: _propTypes2.default.oneOfType([_propTypes2.default.bool, _propTypes2.default.object]), - x: _propTypes2.default.number, - y: _propTypes2.default.number, - onNavigateCell: _propTypes2.default.func - }; - var _default = TableBody; - exports.default = _default; - ; - - var _temp = function () { - if (typeof __REACT_HOT_LOADER__ === 'undefined') { - return; - } - - __REACT_HOT_LOADER__.register(TableBody, 'TableBody', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/TableBody.js'); - - __REACT_HOT_LOADER__.register(_default, 'default', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/TableBody.js'); - }(); - - ; - -/***/ }, -/* 18 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _react = __webpack_require__(2); - - var _react2 = _interopRequireDefault(_react); - - var _Const = __webpack_require__(12); - - var _Const2 = _interopRequireDefault(_Const); - - var _classnames = __webpack_require__(11); - - var _classnames2 = _interopRequireDefault(_classnames); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - var _default = { - renderReactSortCaret: function renderReactSortCaret(order) { - var orderClass = (0, _classnames2.default)('order', { - 'dropup': order === _Const2.default.SORT_ASC - }); - return _react2.default.createElement( - 'span', - { className: orderClass }, - _react2.default.createElement('span', { className: 'caret', style: { margin: '10px 5px' } }) - ); - }, - isFunction: function isFunction(obj) { - return obj && typeof obj === 'function'; - }, - getScrollBarWidth: function getScrollBarWidth() { - var inner = document.createElement('p'); - inner.style.width = '100%'; - inner.style.height = '200px'; - - var outer = document.createElement('div'); - outer.style.position = 'absolute'; - outer.style.top = '0px'; - outer.style.left = '0px'; - outer.style.visibility = 'hidden'; - outer.style.width = '200px'; - outer.style.height = '150px'; - outer.style.overflow = 'hidden'; - outer.appendChild(inner); - - document.body.appendChild(outer); - var w1 = inner.getBoundingClientRect().width; - outer.style.overflow = 'scroll'; - var w2 = inner.getBoundingClientRect().width; - - if (w1 === w2) w2 = outer.clientWidth; - - document.body.removeChild(outer); - - return w1 - w2; - }, - canUseDOM: function canUseDOM() { - return typeof window !== 'undefined' && typeof window.document !== 'undefined'; - }, - - - // We calculate an offset here in order to properly fetch the indexed data, - // despite the page start index not always being 1 - getNormalizedPage: function getNormalizedPage(pageStartIndex, page) { - pageStartIndex = this.getFirstPage(pageStartIndex); - if (page === undefined) page = pageStartIndex; - var offset = Math.abs(_Const2.default.PAGE_START_INDEX - pageStartIndex); - return page + offset; - }, - getFirstPage: function getFirstPage(pageStartIndex) { - return pageStartIndex !== undefined ? pageStartIndex : _Const2.default.PAGE_START_INDEX; - }, - renderColGroup: function renderColGroup(columns, selectRow) { - var expandColumnOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - - var selectRowHeader = null; - var expandRowHeader = null; - var isSelectRowDefined = selectRow.mode === _Const2.default.ROW_SELECT_SINGLE || selectRow.mode === _Const2.default.ROW_SELECT_MULTI; - if (isSelectRowDefined) { - var style = { - width: selectRow.columnWidth || '30px', - minWidth: selectRow.columnWidth || '30px' - }; - if (!selectRow.hideSelectColumn) { - selectRowHeader = _react2.default.createElement('col', { key: 'select-col', style: style }); - } - } - if (expandColumnOptions.expandColumnVisible) { - var _style = { - width: expandColumnOptions.columnWidth || 30, - minWidth: expandColumnOptions.columnWidth || 30 - }; - expandRowHeader = _react2.default.createElement('col', { key: 'expand-col', style: _style }); - } - var theader = columns.map(function (column, i) { - var style = { - display: column.hidden ? 'none' : null - }; - if (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 = width; - } - return _react2.default.createElement('col', { style: style, key: i, className: column.className }); - }); - - return _react2.default.createElement( - 'colgroup', - null, - expandColumnOptions.expandColumnVisible && expandColumnOptions.expandColumnBeforeSelectColumn && expandRowHeader, - selectRowHeader, - expandColumnOptions.expandColumnVisible && !expandColumnOptions.expandColumnBeforeSelectColumn && expandRowHeader, - theader - ); - } - }; /* eslint react/display-name: 0 */ - - exports.default = _default; - ; - - var _temp = function () { - if (typeof __REACT_HOT_LOADER__ === 'undefined') { - return; - } - - __REACT_HOT_LOADER__.register(_default, 'default', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/util.js'); - }(); - - ; - -/***/ }, -/* 19 */ -/***/ 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 _classnames = __webpack_require__(11); - - var _classnames2 = _interopRequireDefault(_classnames); - - var _react = __webpack_require__(2); - - var _react2 = _interopRequireDefault(_react); - - var _propTypes = __webpack_require__(3); - - var _propTypes2 = _interopRequireDefault(_propTypes); - - var _util = __webpack_require__(18); - - var _util2 = _interopRequireDefault(_util); - - 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-nested-ternary: 0 */ - - - var TableRow = function (_Component) { - _inherits(TableRow, _Component); - - function TableRow(props) { - _classCallCheck(this, TableRow); - - var _this = _possibleConstructorReturn(this, (TableRow.__proto__ || Object.getPrototypeOf(TableRow)).call(this, props)); - - _this.rowClick = function () { - return _this.__rowClick__REACT_HOT_LOADER__.apply(_this, arguments); - }; - - _this.expandRow = function () { - return _this.__expandRow__REACT_HOT_LOADER__.apply(_this, arguments); - }; - - _this.rowDoubleClick = function () { - return _this.__rowDoubleClick__REACT_HOT_LOADER__.apply(_this, arguments); - }; - - _this.rowMouseOut = function () { - return _this.__rowMouseOut__REACT_HOT_LOADER__.apply(_this, arguments); - }; - - _this.rowMouseOver = function () { - return _this.__rowMouseOver__REACT_HOT_LOADER__.apply(_this, arguments); - }; - - _this.clickNum = 0; - return _this; - } - - _createClass(TableRow, [{ - key: '__rowClick__REACT_HOT_LOADER__', - value: function __rowClick__REACT_HOT_LOADER__(e) { - var _this2 = this; - - var rowIndex = this.props.index + 1; - var cellIndex = e.target.cellIndex; - if (this.props.onRowClick) this.props.onRowClick(rowIndex, cellIndex); - var _props = this.props, - selectRow = _props.selectRow, - unselectableRow = _props.unselectableRow, - isSelected = _props.isSelected, - onSelectRow = _props.onSelectRow, - onExpandRow = _props.onExpandRow; - - if (selectRow) { - if (selectRow.clickToSelect && !unselectableRow) { - onSelectRow(rowIndex, !isSelected, e); - } else if (selectRow.clickToSelectAndEditCell && !unselectableRow) { - this.clickNum++; - /** if clickToSelectAndEditCell is enabled, - * there should be a delay to prevent a selection changed when - * user dblick to edit cell on same row but different cell - **/ - setTimeout(function () { - if (_this2.clickNum === 1) { - onSelectRow(rowIndex, !isSelected, e); - onExpandRow(rowIndex, cellIndex); - } - _this2.clickNum = 0; - }, 200); - } else { - this.expandRow(rowIndex, cellIndex); - } - } - } - }, { - key: '__expandRow__REACT_HOT_LOADER__', - value: function __expandRow__REACT_HOT_LOADER__(rowIndex, cellIndex) { - var _this3 = this; - - this.clickNum++; - setTimeout(function () { - if (_this3.clickNum === 1) { - _this3.props.onExpandRow(rowIndex, cellIndex); - } - _this3.clickNum = 0; - }, 200); - } - }, { - key: '__rowDoubleClick__REACT_HOT_LOADER__', - value: function __rowDoubleClick__REACT_HOT_LOADER__(e) { - if (e.target.tagName !== 'INPUT' && e.target.tagName !== 'SELECT' && e.target.tagName !== 'TEXTAREA') { - if (this.props.onRowDoubleClick) { - this.props.onRowDoubleClick(this.props.index); - } - } - } - }, { - key: '__rowMouseOut__REACT_HOT_LOADER__', - value: function __rowMouseOut__REACT_HOT_LOADER__(e) { - var rowIndex = this.props.index; - if (this.props.onRowMouseOut) { - this.props.onRowMouseOut(rowIndex, e); - } - } - }, { - key: '__rowMouseOver__REACT_HOT_LOADER__', - value: function __rowMouseOver__REACT_HOT_LOADER__(e) { - var rowIndex = this.props.index; - if (this.props.onRowMouseOver) { - this.props.onRowMouseOver(rowIndex, e); - } - } - }, { - key: 'render', - value: function render() { - this.clickNum = 0; - var _props2 = this.props, - selectRow = _props2.selectRow, - row = _props2.row, - isSelected = _props2.isSelected, - className = _props2.className; - - var backgroundColor = null; - var selectRowClass = null; - - if (selectRow) { - backgroundColor = _util2.default.isFunction(selectRow.bgColor) ? selectRow.bgColor(row, isSelected) : isSelected ? selectRow.bgColor : null; - - selectRowClass = _util2.default.isFunction(selectRow.className) ? selectRow.className(row, isSelected) : isSelected ? selectRow.className : null; - } - - var trCss = { - style: { backgroundColor: backgroundColor }, - className: (0, _classnames2.default)(selectRowClass, className) - }; - - return _react2.default.createElement( - 'tr', - _extends({}, trCss, { - onMouseOver: this.rowMouseOver, - onMouseOut: this.rowMouseOut, - onClick: this.rowClick, - onDoubleClick: this.rowDoubleClick }), - this.props.children - ); - } - }]); - - return TableRow; - }(_react.Component); - - TableRow.propTypes = { - index: _propTypes2.default.number, - row: _propTypes2.default.any, - isSelected: _propTypes2.default.bool, - enableCellEdit: _propTypes2.default.bool, - onRowClick: _propTypes2.default.func, - onRowDoubleClick: _propTypes2.default.func, - onSelectRow: _propTypes2.default.func, - onExpandRow: _propTypes2.default.func, - onRowMouseOut: _propTypes2.default.func, - onRowMouseOver: _propTypes2.default.func, - unselectableRow: _propTypes2.default.bool - }; - TableRow.defaultProps = { - onRowClick: undefined, - onRowDoubleClick: undefined - }; - var _default = TableRow; - exports.default = _default; - ; - - var _temp = function () { - if (typeof __REACT_HOT_LOADER__ === 'undefined') { - return; - } - - __REACT_HOT_LOADER__.register(TableRow, 'TableRow', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/TableRow.js'); - - __REACT_HOT_LOADER__.register(_default, 'default', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/TableRow.js'); - }(); - - ; - -/***/ }, -/* 20 */ -/***/ 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 _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 _propTypes = __webpack_require__(3); - - var _propTypes2 = _interopRequireDefault(_propTypes); - - var _reactDom = __webpack_require__(14); - - var _reactDom2 = _interopRequireDefault(_reactDom); - - var _Const = __webpack_require__(12); - - var _Const2 = _interopRequireDefault(_Const); - - var _util = __webpack_require__(18); - - var _util2 = _interopRequireDefault(_util); - - 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 TableColumn = function (_Component) { - _inherits(TableColumn, _Component); - - function TableColumn(props) { - _classCallCheck(this, TableColumn); - - var _this = _possibleConstructorReturn(this, (TableColumn.__proto__ || Object.getPrototypeOf(TableColumn)).call(this, props)); - - _this.handleCellEdit = function () { - return _this.__handleCellEdit__REACT_HOT_LOADER__.apply(_this, arguments); - }; - - _this.handleCellClick = function () { - 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" }] */ - - - _createClass(TableColumn, [{ - key: 'shouldComponentUpdate', - 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 || 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; - } - - if ((typeof children === 'undefined' ? 'undefined' : _typeof(children)) === 'object' && children !== null && children.props !== null) { - if (children.props.type === 'checkbox' || children.props.type === 'radio') { - shouldUpdated = shouldUpdated || children.props.type !== nextProps.children.props.type || children.props.checked !== nextProps.children.props.checked || children.props.disabled !== nextProps.children.props.disabled; - } else { - shouldUpdated = true; - } - } else { - shouldUpdated = shouldUpdated || children !== nextProps.children; - } - - if (shouldUpdated) { - return shouldUpdated; - } - - if (!(this.props.cellEdit && nextProps.cellEdit)) { - return false; - } else { - 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) { - if (this.props.cellEdit.mode === _Const2.default.CELL_EDIT_DBCLICK) { - if (document.selection && document.selection.empty) { - document.selection.empty(); - } else if (window.getSelection) { - var sel = window.getSelection(); - sel.removeAllRanges(); - } - } - this.props.onEdit(this.props.rIndex + 1, e.currentTarget.cellIndex, e); - if (this.props.cellEdit.mode !== _Const2.default.CELL_EDIT_DBCLICK) { - this.props.onClick(this.props.rIndex + 1, e.currentTarget.cellIndex, e); - } - } - }, { - key: '__handleCellClick__REACT_HOT_LOADER__', - value: function __handleCellClick__REACT_HOT_LOADER__(e) { - var _props = this.props, - onClick = _props.onClick, - rIndex = _props.rIndex; - - if (onClick) { - 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, - dataAlign = _props2.dataAlign, - hidden = _props2.hidden, - cellEdit = _props2.cellEdit, - attrs = _props2.attrs, - 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({ - textAlign: dataAlign, - display: hidden ? 'none' : null - }, style); - - var opts = {}; - - if (cellEdit) { - if (cellEdit.mode === _Const2.default.CELL_EDIT_CLICK) { - opts.onClick = this.handleCellEdit; - } else if (cellEdit.mode === _Const2.default.CELL_EDIT_DBCLICK) { - opts.onDoubleClick = this.handleCellEdit; - } else { - opts.onClick = this.handleCellClick; - } - } - - if (keyBoardNav && isFocus) { - opts.onKeyDown = this.handleKeyDown; - } - - if (isFocus) { - if (customNavStyle) { - var cusmtStyle = _util2.default.isFunction(customNavStyle) ? customNavStyle(children, row) : customNavStyle; - tdStyle = _extends({}, tdStyle, cusmtStyle); - } else { - className = className + ' default-focus-cell'; - } - } - return _react2.default.createElement( - 'td', - _extends({ tabIndex: tabIndex, style: tdStyle, - title: columnTitle, - className: className - }, opts, attrs), - typeof children === 'boolean' ? children.toString() : children - ); - } - }]); - - return TableColumn; - }(_react.Component); - - TableColumn.propTypes = { - rIndex: _propTypes2.default.number, - dataAlign: _propTypes2.default.string, - hidden: _propTypes2.default.bool, - className: _propTypes2.default.string, - columnTitle: _propTypes2.default.string, - children: _propTypes2.default.node, - onClick: _propTypes2.default.func, - attrs: _propTypes2.default.object, - style: _propTypes2.default.object, - isFocus: _propTypes2.default.bool, - onKeyDown: _propTypes2.default.func, - tabIndex: _propTypes2.default.string, - keyBoardNav: _propTypes2.default.oneOfType([_propTypes2.default.bool, _propTypes2.default.object]), - customNavStyle: _propTypes2.default.oneOfType([_propTypes2.default.func, _propTypes2.default.object]), - row: _propTypes2.default.any /* only used on custom styling for navigation */ - }; - - TableColumn.defaultProps = { - dataAlign: 'left', - hidden: false, - className: '', - isFocus: false, - keyBoardNav: false - }; - var _default = TableColumn; - exports.default = _default; - ; - - var _temp = function () { - if (typeof __REACT_HOT_LOADER__ === 'undefined') { - return; - } - - __REACT_HOT_LOADER__.register(TableColumn, 'TableColumn', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/TableColumn.js'); - - __REACT_HOT_LOADER__.register(_default, 'default', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/TableColumn.js'); - }(); - - ; - -/***/ }, -/* 21 */ -/***/ 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 _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 _propTypes = __webpack_require__(3); - - var _propTypes2 = _interopRequireDefault(_propTypes); - - var _reactDom = __webpack_require__(14); - - var _reactDom2 = _interopRequireDefault(_reactDom); - - var _Editor = __webpack_require__(22); - - var _Editor2 = _interopRequireDefault(_Editor); - - var _Notification = __webpack_require__(23); - - var _classnames = __webpack_require__(11); - - var _classnames2 = _interopRequireDefault(_classnames); - - var _util = __webpack_require__(18); - - var _util2 = _interopRequireDefault(_util); - - 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 TableEditColumn = function (_Component) { - _inherits(TableEditColumn, _Component); - - function TableEditColumn(props) { - _classCallCheck(this, TableEditColumn); - - var _this = _possibleConstructorReturn(this, (TableEditColumn.__proto__ || Object.getPrototypeOf(TableEditColumn)).call(this, props)); - - _this.handleKeyPress = function () { - return _this.__handleKeyPress__REACT_HOT_LOADER__.apply(_this, arguments); - }; - - _this.handleBlur = function () { - return _this.__handleBlur__REACT_HOT_LOADER__.apply(_this, arguments); - }; - - _this.handleCustomUpdate = function () { - return _this.__handleCustomUpdate__REACT_HOT_LOADER__.apply(_this, arguments); - }; - - _this.notifyToastr = function () { - return _this.__notifyToastr__REACT_HOT_LOADER__.apply(_this, arguments); - }; - - _this.handleClick = function () { - return _this.__handleClick__REACT_HOT_LOADER__.apply(_this, arguments); - }; - - _this.timeouteClear = 0; - var _this$props = _this.props, - fieldValue = _this$props.fieldValue, - row = _this$props.row, - className = _this$props.className; - - _this.focusInEditor = _this.focusInEditor.bind(_this); - _this.state = { - shakeEditor: false, - className: _util2.default.isFunction(className) ? className(fieldValue, row) : className - }; - return _this; - } - - _createClass(TableEditColumn, [{ - key: 'valueShortCircuit', - value: function valueShortCircuit(value) { - return value === null || typeof value === 'undefined' ? '' : value; - } - }, { - key: '__handleKeyPress__REACT_HOT_LOADER__', - value: function __handleKeyPress__REACT_HOT_LOADER__(e) { - if (e.keyCode === 13 || e.keyCode === 9) { - // Pressed ENTER - var value = e.currentTarget.type === 'checkbox' ? this._getCheckBoxValue(e) : e.currentTarget.value; - - if (!this.validator(value)) { - return; - } - if (e.keyCode === 13) { - this.props.completeEdit(value, this.props.rowIndex, this.props.colIndex); - } else { - this.props.onTab(this.props.rowIndex + 1, this.props.colIndex + 1, 'tab', e); - e.preventDefault(); - } - } else if (e.keyCode === 27) { - this.props.completeEdit(null, this.props.rowIndex, this.props.colIndex); - } else if (e.type === 'click' && !this.props.blurToSave) { - // textarea click save button - var _value = e.target.parentElement.firstChild.value; - if (!this.validator(_value)) { - return; - } - this.props.completeEdit(_value, this.props.rowIndex, this.props.colIndex); - } - } - }, { - key: '__handleBlur__REACT_HOT_LOADER__', - value: function __handleBlur__REACT_HOT_LOADER__(e) { - e.stopPropagation(); - if (this.props.blurToSave) { - var value = e.currentTarget.type === 'checkbox' ? this._getCheckBoxValue(e) : e.currentTarget.value; - if (!this.validator(value)) { - return false; - } - this.props.completeEdit(value, this.props.rowIndex, this.props.colIndex); - } - } - }, { - key: '__handleCustomUpdate__REACT_HOT_LOADER__', - - - // 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); - } - }, { - key: 'validator', - value: function validator(value) { - var ts = this; - var valid = true; - if (ts.props.editable.validator) { - var checkVal = ts.props.editable.validator(value, this.props.row); - var responseType = typeof checkVal === 'undefined' ? 'undefined' : _typeof(checkVal); - if (responseType !== 'object' && checkVal !== true) { - valid = false; - this.notifyToastr('error', checkVal, ''); - } else if (responseType === 'object' && checkVal.isValid !== true) { - valid = false; - this.notifyToastr(checkVal.notification.type, checkVal.notification.msg, checkVal.notification.title); - } - if (!valid) { - // animate input - ts.clearTimeout(); - var _props = this.props, - invalidColumnClassName = _props.invalidColumnClassName, - row = _props.row; - - var className = _util2.default.isFunction(invalidColumnClassName) ? invalidColumnClassName(value, row) : invalidColumnClassName; - ts.setState({ shakeEditor: true, className: className }); - ts.timeouteClear = setTimeout(function () { - ts.setState({ shakeEditor: false }); - }, 300); - this.focusInEditor(); - return valid; - } - } - return valid; - } - // END - - }, { - key: '__notifyToastr__REACT_HOT_LOADER__', - value: function __notifyToastr__REACT_HOT_LOADER__(type, message, title) { - var toastr = true; - var beforeShowError = this.props.beforeShowError; - - if (beforeShowError) { - toastr = beforeShowError(type, message, title); - } - if (toastr) { - (0, _Notification.notice)(type, message, title); - } - } - }, { - key: 'clearTimeout', - value: function (_clearTimeout) { - function clearTimeout() { - return _clearTimeout.apply(this, arguments); - } - - clearTimeout.toString = function () { - return _clearTimeout.toString(); - }; - - return clearTimeout; - }(function () { - if (this.timeouteClear !== 0) { - clearTimeout(this.timeouteClear); - this.timeouteClear = 0; - } - }) - }, { - key: 'componentDidMount', - value: function componentDidMount() { - this.focusInEditor(); - 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', - value: function componentWillUnmount() { - this.clearTimeout(); - } - }, { - key: 'focusInEditor', - value: function focusInEditor() { - if (_util2.default.isFunction(this.refs.inputRef.focus)) { - this.refs.inputRef.focus(); - } - } - }, { - key: '__handleClick__REACT_HOT_LOADER__', - value: function __handleClick__REACT_HOT_LOADER__(e) { - if (e.target.tagName !== 'TD') { - e.stopPropagation(); - } - } - }, { - key: 'render', - value: function render() { - var _props2 = this.props, - editable = _props2.editable, - format = _props2.format, - 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); - - var editorClass = (0, _classnames2.default)({ 'animated': shakeEditor, 'shake': shakeEditor }); - fieldValue = fieldValue === 0 ? '0' : fieldValue; - var cellEditor = void 0; - if (customEditor) { - var customEditorProps = _extends({ - row: row - }, attr, { - defaultValue: this.valueShortCircuit(fieldValue) - }, customEditor.customEditorParameters); - cellEditor = customEditor.getElement(this.handleCustomUpdate, customEditorProps); - } else { - cellEditor = (0, _Editor2.default)(editable, attr, format, editorClass, this.valueShortCircuit(fieldValue)); - } - - if (isFocus) { - if (customStyleWithNav) { - var customStyle = _util2.default.isFunction(customStyleWithNav) ? customStyleWithNav(fieldValue, row) : customStyleWithNav; - style = _extends({}, style, customStyle); - } else { - className = className + ' default-focus-cell'; - } - } - - return _react2.default.createElement( - 'td', - { ref: 'td', - style: style, - className: className, - onClick: this.handleClick }, - cellEditor - ); - } - }, { - key: '_getCheckBoxValue', - value: function _getCheckBoxValue(e) { - var value = ''; - var values = e.currentTarget.value.split(':'); - value = e.currentTarget.checked ? values[0] : values[1]; - return value; - } - }]); - - return TableEditColumn; - }(_react.Component); - - TableEditColumn.propTypes = { - completeEdit: _propTypes2.default.func, - rowIndex: _propTypes2.default.number, - colIndex: _propTypes2.default.number, - blurToSave: _propTypes2.default.bool, - editable: _propTypes2.default.oneOfType([_propTypes2.default.bool, _propTypes2.default.object]), - format: _propTypes2.default.oneOfType([_propTypes2.default.bool, _propTypes2.default.func]), - row: _propTypes2.default.any, - fieldValue: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.bool, _propTypes2.default.number, _propTypes2.default.array, _propTypes2.default.object]), - className: _propTypes2.default.any, - beforeShowError: _propTypes2.default.func, - isFocus: _propTypes2.default.bool, - customStyleWithNav: _propTypes2.default.oneOfType([_propTypes2.default.func, _propTypes2.default.object]) - }; - - var _default = TableEditColumn; - exports.default = _default; - ; - - var _temp = function () { - if (typeof __REACT_HOT_LOADER__ === 'undefined') { - return; - } - - __REACT_HOT_LOADER__.register(TableEditColumn, 'TableEditColumn', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/TableEditColumn.js'); - - __REACT_HOT_LOADER__.register(_default, 'default', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/TableEditColumn.js'); - }(); - - ; - -/***/ }, -/* 22 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - 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 _react = __webpack_require__(2); - - var _react2 = _interopRequireDefault(_react); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - var editor = function editor(editable, attr, format, editorClass, defaultValue, ignoreEditable) { - if (editable === true || editable === false && ignoreEditable || typeof editable === 'string') { - // simple declare - var type = editable ? 'text' : editable; - return _react2.default.createElement('input', _extends({}, attr, { type: type, defaultValue: defaultValue, - className: (editorClass || '') + ' form-control editor edit-text' })); - } else if (!editable) { - var _type = editable ? 'text' : editable; - return _react2.default.createElement('input', _extends({}, attr, { type: _type, defaultValue: defaultValue, - disabled: 'disabled', - className: (editorClass || '') + ' form-control editor edit-text' })); - } else if (editable && (editable.type === undefined || editable.type === null || editable.type.trim() === '')) { - var _type2 = editable ? 'text' : editable; - return _react2.default.createElement('input', _extends({}, attr, { type: _type2, defaultValue: defaultValue, - className: (editorClass || '') + ' form-control editor edit-text' })); - } else if (editable.type) { - // standard declare - // put style if exist - editable.style && (attr.style = editable.style); - // put class if exist - attr.className = (editorClass || '') + ' form-control editor edit-' + editable.type + (editable.className ? ' ' + editable.className : ''); - - if (editable.type === 'select') { - var _ret = function () { - // process select input - var options = []; - var _editable$options = editable.options, - values = _editable$options.values, - textKey = _editable$options.textKey, - valueKey = _editable$options.valueKey; - - if (Array.isArray(values)) { - (function () { - // only can use arrray data for options - var text = void 0; - var value = void 0; - options = values.map(function (option, i) { - if ((typeof option === 'undefined' ? 'undefined' : _typeof(option)) === 'object') { - text = textKey ? option[textKey] : option.text; - value = valueKey ? option[valueKey] : option.value; - } else { - text = format ? format(option) : option; - value = option; - } - return _react2.default.createElement( - 'option', - { key: 'option' + i, value: value }, - text - ); - }); - })(); - } - return { - v: _react2.default.createElement( - 'select', - _extends({}, attr, { defaultValue: defaultValue }), - options - ) - }; - }(); - - if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === "object") return _ret.v; - } else if (editable.type === 'textarea') { - var _ret3 = function () { - // process textarea input - // put other if exist - editable.cols && (attr.cols = editable.cols); - editable.rows && (attr.rows = editable.rows); - var saveBtn = void 0; - var keyUpHandler = attr.onKeyDown; - if (keyUpHandler) { - attr.onKeyDown = function (e) { - if (e.keyCode !== 13) { - // not Pressed ENTER - keyUpHandler(e); - } - }; - saveBtn = _react2.default.createElement( - 'button', - { - className: 'btn btn-info btn-xs textarea-save-btn', - onClick: keyUpHandler }, - 'save' - ); - } - return { - v: _react2.default.createElement( - 'div', - null, - _react2.default.createElement('textarea', _extends({}, attr, { defaultValue: defaultValue })), - saveBtn - ) - }; - }(); - - if ((typeof _ret3 === 'undefined' ? 'undefined' : _typeof(_ret3)) === "object") return _ret3.v; - } else if (editable.type === 'checkbox') { - var _values = 'true:false'; - if (editable.options && editable.options.values) { - // values = editable.options.values.split(':'); - _values = editable.options.values; - } - attr.className = attr.className.replace('form-control', ''); - attr.className += ' checkbox pull-right'; - - var checked = defaultValue && defaultValue.toString() === _values.split(':')[0] ? true : false; - - return _react2.default.createElement('input', _extends({}, attr, { type: 'checkbox', - value: _values, defaultChecked: checked })); - } else if (editable.type === 'datetime') { - return _react2.default.createElement('input', _extends({}, attr, { type: 'datetime-local', defaultValue: defaultValue })); - } else { - // process other input type. as password,url,email... - return _react2.default.createElement('input', _extends({}, attr, { type: editable.type, defaultValue: defaultValue })); - } - } - // default return for other case of editable - return _react2.default.createElement('input', _extends({}, attr, { type: 'text', - className: (editorClass || '') + ' form-control editor edit-text' })); - }; - - var _default = editor; - exports.default = _default; - ; - - var _temp = function () { - if (typeof __REACT_HOT_LOADER__ === 'undefined') { - return; - } - - __REACT_HOT_LOADER__.register(editor, 'editor', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/Editor.js'); - - __REACT_HOT_LOADER__.register(_default, 'default', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/Editor.js'); - }(); - - ; - -/***/ }, -/* 23 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.notice = undefined; - - var _reactSAlert = __webpack_require__(24); - - var _reactSAlert2 = _interopRequireDefault(_reactSAlert); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - var notice = function notice(type, msg, title) { - var titleHTML = title ? '

' + title + '

' : ''; - - var bodyHTML = '\n ' + titleHTML + '\n
\n  \n ' + msg + '\n
\n '; - - _reactSAlert2.default.error(bodyHTML, { - position: 'top-right', - timeout: 3000, - html: true, - effect: 'scale' - }); - }; - - exports.notice = notice; - ; - - var _temp = function () { - if (typeof __REACT_HOT_LOADER__ === 'undefined') { - return; - } - - __REACT_HOT_LOADER__.register(notice, 'notice', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/Notification.js'); - }(); - - ; - -/***/ }, -/* 24 */ -/***/ function(module, exports, __webpack_require__) { - - module.exports = __webpack_require__(25); - -/***/ }, -/* 25 */ -/***/ function(module, exports, __webpack_require__) { - - var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(2), __webpack_require__(26), __webpack_require__(3), __webpack_require__(28), __webpack_require__(27), __webpack_require__(30)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else if (typeof exports !== "undefined") { - factory(exports, require('react'), require('./SAlertContent'), require('prop-types'), require('./s-alert-parts/s-alert-store'), require('./s-alert-parts/s-alert-tools'), require('./s-alert-parts/s-alert-data-prep')); - } else { - var mod = { - exports: {} - }; - factory(mod.exports, global.react, global.SAlertContent, global.propTypes, global.sAlertStore, global.sAlertTools, global.sAlertDataPrep); - global.SAlert = mod.exports; - } - })(this, function (exports, _react, _SAlertContent, _propTypes, _sAlertStore, _sAlertTools, _sAlertDataPrep) { - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _react2 = _interopRequireDefault(_react); - - var _SAlertContent2 = _interopRequireDefault(_SAlertContent); - - var _propTypes2 = _interopRequireDefault(_propTypes); - - var _sAlertStore2 = _interopRequireDefault(_sAlertStore); - - var _sAlertTools2 = _interopRequireDefault(_sAlertTools); - - var _sAlertDataPrep2 = _interopRequireDefault(_sAlertDataPrep); - - 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"); - } - } - - 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; - }; - }(); - - 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 insertFunc = function insertFunc(msg, data, condition) { - var id = _sAlertTools2.default.randomId(); - _sAlertStore2.default.dispatch({ - type: 'INSERT', - data: Object.assign({}, data, { - id: id, - condition: condition, - message: msg - }) - }); - return id; - }; - - var SAlert = function (_React$Component) { - _inherits(SAlert, _React$Component); - - function SAlert(props) { - _classCallCheck(this, SAlert); - - var _this = _possibleConstructorReturn(this, (SAlert.__proto__ || Object.getPrototypeOf(SAlert)).call(this, props)); - - _this.state = { - dataRight: [], - dataLeft: [], - dataTop: [], - dataBottom: [] - }; - return _this; - } - - _createClass(SAlert, [{ - key: 'componentDidMount', - value: function componentDidMount() { - var _this2 = this; - - var storeStateLeft = void 0; - var storeStateRight = void 0; - var storeStateTop = void 0; - var storeStateBottom = void 0; - - var addToStoreRight = function addToStoreRight() { - var length = void 0; - storeStateRight = (0, _sAlertDataPrep2.default)('right') || []; - length = storeStateRight.length; - if (_this2.props.stack && _this2.props.stack.limit && length > _this2.props.stack.limit) { - var id = storeStateRight[0].id; - _sAlertStore2.default.dispatch({ type: 'REMOVE', data: { id: id } }); - storeStateRight = (0, _sAlertDataPrep2.default)('right') || []; - } - _this2.setState({ dataRight: storeStateRight }); - }; - this.unsubStoreRight = _sAlertStore2.default.subscribe(addToStoreRight); - - var addToStoreLeft = function addToStoreLeft() { - var length = void 0; - storeStateLeft = (0, _sAlertDataPrep2.default)('left') || []; - length = storeStateLeft.length; - if (_this2.props.stack && _this2.props.stack.limit && length > _this2.props.stack.limit) { - var id = storeStateLeft[0].id; - _sAlertStore2.default.dispatch({ type: 'REMOVE', data: { id: id } }); - storeStateLeft = (0, _sAlertDataPrep2.default)('left') || []; - } - _this2.setState({ dataLeft: storeStateLeft }); - }; - this.unsubStoreLeft = _sAlertStore2.default.subscribe(addToStoreLeft); - - var addToStoreTop = function addToStoreTop() { - var length = void 0; - storeStateTop = (0, _sAlertDataPrep2.default)('full-top') || []; - length = storeStateTop.length; - if (_this2.props.stack && _this2.props.stack.limit && length > _this2.props.stack.limit) { - var id = storeStateTop[0].id; - _sAlertStore2.default.dispatch({ type: 'REMOVE', data: { id: id } }); - storeStateTop = (0, _sAlertDataPrep2.default)('full-top') || []; - } - _this2.setState({ dataTop: storeStateTop }); - }; - this.unsubStoreTop = _sAlertStore2.default.subscribe(addToStoreTop); - - var addToStoreBottom = function addToStoreBottom() { - var length = void 0; - storeStateBottom = (0, _sAlertDataPrep2.default)('full-bottom') || []; - length = storeStateBottom.length; - if (_this2.props.stack && _this2.props.stack.limit && length > _this2.props.stack.limit) { - var id = storeStateBottom[0].id; - _sAlertStore2.default.dispatch({ type: 'REMOVE', data: { id: id } }); - storeStateBottom = (0, _sAlertDataPrep2.default)('full-bottom') || []; - } - _this2.setState({ dataBottom: storeStateBottom }); - }; - this.unsubStoreBottom = _sAlertStore2.default.subscribe(addToStoreBottom); - - // set up global config from global SAlert props - // only stuff needed for getAlertData - var globalConfig = { - contentTemplate: this.props.contentTemplate, - offset: this.props.offset, - message: this.props.message, - stack: this.props.stack, - html: this.props.html, - customFields: this.props.customFields, - position: this.props.position || 'top-right' - }; - _sAlertTools2.default.setGlobalConfig(globalConfig); - } - }, { - key: 'componentWillUnmount', - value: function componentWillUnmount() { - this.unsubStoreTop(); - this.unsubStoreBottom(); - this.unsubStoreLeft(); - this.unsubStoreRight(); - } - }, { - key: 'render', - value: function render() { - var _this3 = this; - - var mapFunc = function mapFunc(alert, index) { - var customKey = 'alert-key-' + alert.id + '-' + alert.position; - var id = alert.id; - var condition = _sAlertTools2.default.returnFirstDefined(alert.condition, 'info'); - var message = _sAlertTools2.default.returnFirstDefined(alert.message, _this3.props.message, ''); - var position = _sAlertTools2.default.returnFirstDefined(alert.position, _this3.props.position, 'top-right'); - var offset = _sAlertTools2.default.returnFirstDefined(alert.offset, _this3.props.offset, 0); - var effect = _sAlertTools2.default.returnFirstDefined(alert.effect, _this3.props.effect); - var boxPosition = alert.boxPosition; - var beep = _sAlertTools2.default.returnFirstDefined(alert.beep, _this3.props.beep, false); - var timeout = _sAlertTools2.default.returnFirstDefined(alert.timeout, _this3.props.timeout, 5000); - var html = _sAlertTools2.default.returnFirstDefined(alert.html, _this3.props.html); - var onClose = _sAlertTools2.default.returnFirstDefined(alert.onClose, _this3.props.onClose); - var onShow = _sAlertTools2.default.returnFirstDefined(alert.onShow, _this3.props.onShow); - var customFields = _sAlertTools2.default.returnFirstDefined(alert.customFields, _this3.props.customFields); - var contentTemplate = _this3.props.contentTemplate; - return _react2.default.createElement(_SAlertContent2.default, { - key: customKey, - id: id, - customFields: customFields, - condition: condition, - message: message, - position: position, - effect: effect, - boxPosition: boxPosition, - beep: beep, - timeout: timeout, - html: html, - onClose: onClose, - onShow: onShow, - contentTemplate: contentTemplate }); - }; - var sAlertElemsRight = this.state.dataRight.map(mapFunc); - var sAlertElemsLeft = this.state.dataLeft.map(mapFunc); - var sAlertElemsTop = this.state.dataTop.map(mapFunc); - var sAlertElemsBottom = this.state.dataBottom.map(mapFunc); - return _react2.default.createElement( - 'div', - { className: 's-alert-wrapper' }, - sAlertElemsRight, - sAlertElemsLeft, - sAlertElemsTop, - sAlertElemsBottom - ); - } - }], [{ - key: 'info', - value: function info(msg, data) { - return insertFunc(msg, data, 'info'); - } - }, { - key: 'error', - value: function error(msg, data) { - return insertFunc(msg, data, 'error'); - } - }, { - key: 'warning', - value: function warning(msg, data) { - return insertFunc(msg, data, 'warning'); - } - }, { - key: 'success', - value: function success(msg, data) { - return insertFunc(msg, data, 'success'); - } - }, { - key: 'close', - value: function close(id) { - _sAlertStore2.default.dispatch({ type: 'REMOVE', data: { id: id } }); - } - }, { - key: 'closeAll', - value: function closeAll() { - _sAlertStore2.default.dispatch({ type: 'REMOVEALL' }); - } - }]); - - return SAlert; - }(_react2.default.Component); - - SAlert.propTypes = { - message: _propTypes2.default.string, - position: _propTypes2.default.string, - offset: _propTypes2.default.number, - stack: _propTypes2.default.oneOfType([_propTypes2.default.bool, _propTypes2.default.object]), - effect: _propTypes2.default.string, - beep: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object, _propTypes2.default.bool]), - timeout: _propTypes2.default.oneOfType([_propTypes2.default.oneOf(['none']), _propTypes2.default.number]), - html: _propTypes2.default.bool, - onClose: _propTypes2.default.func, - onShow: _propTypes2.default.func, - customFields: _propTypes2.default.object, - contentTemplate: _propTypes2.default.func - }; - - exports.default = SAlert; - }); - -/***/ }, -/* 26 */ -/***/ function(module, exports, __webpack_require__) { - - var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(2), __webpack_require__(14), __webpack_require__(3), __webpack_require__(27), __webpack_require__(28), __webpack_require__(29)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else if (typeof exports !== "undefined") { - factory(exports, require('react'), require('react-dom'), require('prop-types'), require('./s-alert-parts/s-alert-tools'), require('./s-alert-parts/s-alert-store'), require('./SAlertContentTmpl')); - } else { - var mod = { - exports: {} - }; - factory(mod.exports, global.react, global.reactDom, global.propTypes, global.sAlertTools, global.sAlertStore, global.SAlertContentTmpl); - global.SAlertContent = mod.exports; - } - })(this, function (exports, _react, _reactDom, _propTypes, _sAlertTools, _sAlertStore, _SAlertContentTmpl) { - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _react2 = _interopRequireDefault(_react); - - var _reactDom2 = _interopRequireDefault(_reactDom); - - var _propTypes2 = _interopRequireDefault(_propTypes); - - var _sAlertTools2 = _interopRequireDefault(_sAlertTools); - - var _sAlertStore2 = _interopRequireDefault(_sAlertStore); - - var _SAlertContentTmpl2 = _interopRequireDefault(_SAlertContentTmpl); - - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; - } - - 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; - }; - - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - 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; - }; - }(); - - 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 SAlertContent = function (_React$Component) { - _inherits(SAlertContent, _React$Component); - - function SAlertContent(props) { - _classCallCheck(this, SAlertContent); - - return _possibleConstructorReturn(this, (SAlertContent.__proto__ || Object.getPrototypeOf(SAlertContent)).call(this, props)); - } - - _createClass(SAlertContent, [{ - key: 'handleCloseAlert', - value: function handleCloseAlert() { - var closingTimeout = void 0; - var alertId = this.props.id; - var currentAlertElem = _reactDom2.default.findDOMNode(this); - var animationClose = function animationClose() { - currentAlertElem.style.display = 'none'; - _sAlertStore2.default.dispatch({ type: 'REMOVE', data: { id: alertId } }); - clearTimeout(closingTimeout); - }; - if (document.hidden || document.webkitHidden || !currentAlertElem.classList.contains('s-alert-is-effect')) { - _sAlertStore2.default.dispatch({ type: 'REMOVE', data: { id: alertId } }); - } else { - currentAlertElem.classList.remove('s-alert-show'); - closingTimeout = setTimeout(function () { - currentAlertElem.classList.add('s-alert-hide'); - }, 100); - currentAlertElem.removeEventListener('webkitAnimationEnd', animationClose, false); - currentAlertElem.removeEventListener('animationend', animationClose, false); - currentAlertElem.addEventListener('webkitAnimationEnd', animationClose, false); - currentAlertElem.addEventListener('animationend', animationClose, false); - } - // stop audio when closing - this.alertAudio && this.alertAudio.load(); - } - }, { - key: 'componentWillMount', - value: function componentWillMount() { - var beep = this.props.beep; - var condition = this.props.condition; - if (beep && typeof beep === 'string') { - this.alertAudio = new Audio(beep); - this.alertAudio.load(); - this.alertAudio.play(); - } - if (beep && (typeof beep === 'undefined' ? 'undefined' : _typeof(beep)) === 'object' && condition === 'info') { - this.alertAudio = new Audio(beep.info); - this.alertAudio.load(); - this.alertAudio.play(); - } - if (beep && (typeof beep === 'undefined' ? 'undefined' : _typeof(beep)) === 'object' && condition === 'error') { - this.alertAudio = new Audio(beep.error); - this.alertAudio.load(); - this.alertAudio.play(); - } - if (beep && (typeof beep === 'undefined' ? 'undefined' : _typeof(beep)) === 'object' && condition === 'success') { - this.alertAudio = new Audio(beep.success); - this.alertAudio.load(); - this.alertAudio.play(); - } - if (beep && (typeof beep === 'undefined' ? 'undefined' : _typeof(beep)) === 'object' && condition === 'warning') { - this.alertAudio = new Audio(beep.warning); - this.alertAudio.load(); - this.alertAudio.play(); - } - } - }, { - key: 'componentDidMount', - value: function componentDidMount() { - var _this2 = this; - - if (typeof this.props.timeout === 'number') { - this.closeTimer = setTimeout(function () { - _this2.handleCloseAlert(); - }, this.props.timeout); - } - if (this.props.onShow) { - this.props.onShow(); - } - } - }, { - key: 'componentWillUnmount', - value: function componentWillUnmount() { - if (this.closeTimer) { - clearTimeout(this.closeTimer); - } - if (this.props.onClose) { - this.props.onClose(); - } - } - }, { - key: 'render', - value: function render() { - var classNames = 's-alert-box s-alert-' + this.props.condition + ' s-alert-' + this.props.position + ' ' + (this.props.effect ? 's-alert-is-effect s-alert-effect-' + this.props.effect : '') + ' s-alert-show'; - var message = this.props.html ? _react2.default.createElement('span', { dangerouslySetInnerHTML: { __html: this.props.message } }) : this.props.message; - var styles = this.props.boxPosition ? _sAlertTools2.default.styleToObj(this.props.boxPosition) : {}; - var id = this.props.id; - var handleClose = this.handleCloseAlert.bind(this); - var contentTemplate = this.props.contentTemplate || _SAlertContentTmpl2.default; - var customFields = this.props.customFields || {}; - - return _react2.default.createElement(contentTemplate, { classNames: classNames, id: id, styles: styles, message: message, handleClose: handleClose, customFields: customFields }); - } - }]); - - return SAlertContent; - }(_react2.default.Component); - - SAlertContent.propTypes = { - condition: _propTypes2.default.string.isRequired, - message: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.node]), - position: _propTypes2.default.string.isRequired, - boxPosition: _propTypes2.default.string, - id: _propTypes2.default.string.isRequired, - effect: _propTypes2.default.string, - beep: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object, _propTypes2.default.bool]), - timeout: _propTypes2.default.oneOfType([_propTypes2.default.oneOf(['none']), _propTypes2.default.number]), - html: _propTypes2.default.bool, - onClose: _propTypes2.default.func, - onShow: _propTypes2.default.func, - customFields: _propTypes2.default.object, - contentTemplate: _propTypes2.default.func - }; - - exports.default = SAlertContent; - }); - -/***/ }, -/* 27 */ -/***/ function(module, exports, __webpack_require__) { - - var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else if (typeof exports !== "undefined") { - factory(exports); - } else { - var mod = { - exports: {} - }; - factory(mod.exports); - global.sAlertTools = mod.exports; - } - })(this, function (exports) { - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - 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 actualGlobalConfig = void 0; - - var sAlertTools = { - randomId: function randomId() { - return Math.random().toString(36).split('.')[1]; - }, - returnFirstDefined: function returnFirstDefined() { - var value = void 0; - var i = void 0; - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - for (i = 0; i < args.length; i++) { - if (typeof args[i] !== 'undefined') { - value = args[i]; - break; - } - } - return value; - }, - styleToObj: function styleToObj(input) { - var result = {}, - i = void 0, - entry = void 0, - attributes = input && input.split(';').filter(Boolean); - - for (i = 0; i < attributes.length; i++) { - entry = attributes[i].split(':'); - result[entry.splice(0, 1)[0].trim()] = entry.join(':').trim(); - } - return result; - }, - setGlobalConfig: function setGlobalConfig(config) { - if ((typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object') { - actualGlobalConfig = config; - } - }, - getGlobalConfig: function getGlobalConfig() { - return actualGlobalConfig; - } - }; - - exports.default = sAlertTools; - }); - -/***/ }, -/* 28 */ -/***/ function(module, exports, __webpack_require__) { - - var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else if (typeof exports !== "undefined") { - factory(exports); - } else { - var mod = { - exports: {} - }; - factory(mod.exports); - global.sAlertStore = mod.exports; - } - })(this, function (exports) { - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - - function _toConsumableArray(arr) { - if (Array.isArray(arr)) { - for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { - arr2[i] = arr[i]; - } - - return arr2; - } else { - return Array.from(arr); - } - } - - // custom simple store based on a awesome Redux library https://github.com/rackt/redux - - var createSAlertStore = function createSAlertStore(reducer) { - var state = void 0; - var listeners = []; - var getState = function getState() { - return state; - }; - var dispatch = function dispatch(action) { - state = reducer(state, action); - listeners.forEach(function (listener) { - return listener(); - }); - }; - var subscribe = function subscribe(listener) { - listeners.push(listener); - return function () { - listeners = listeners.filter(function (l) { - return l !== listener; - }); - }; - }; - dispatch({}); - return { - getState: getState, dispatch: dispatch, subscribe: subscribe - }; - }; - - var insert = function insert(state, action) { - return [].concat(_toConsumableArray(state), [action.data]); - }; - - var remove = function remove(state, action) { - var elemToRemoveArray = state.slice().filter(function (item) { - return item.id === action.data.id; - }); - if (Array.isArray(elemToRemoveArray)) { - var elemToRemoveIndex = state.indexOf(elemToRemoveArray[0]); - return [].concat(_toConsumableArray(state.slice(0, elemToRemoveIndex)), _toConsumableArray(state.slice(elemToRemoveIndex + 1))); - } - return state; - }; - - var alertsReducer = function alertsReducer() { - var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - var action = arguments[1]; - - switch (action.type) { - case 'INSERT': - return insert(state, action); - case 'REMOVE': - return remove(state, action); - case 'REMOVEALL': - return []; - default: - return state; - } - }; - - var sAlertStore = createSAlertStore(alertsReducer); - - exports.default = sAlertStore; - }); - -/***/ }, -/* 29 */ -/***/ function(module, exports, __webpack_require__) { - - var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(2), __webpack_require__(3)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else if (typeof exports !== "undefined") { - factory(exports, require('react'), require('prop-types')); - } else { - var mod = { - exports: {} - }; - factory(mod.exports, global.react, global.propTypes); - global.SAlertContentTmpl = mod.exports; - } - })(this, function (exports, _react, _propTypes) { - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _react2 = _interopRequireDefault(_react); - - var _propTypes2 = _interopRequireDefault(_propTypes); - - 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"); - } - } - - 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; - }; - }(); - - 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 SAlertContentTmpl = function (_React$Component) { - _inherits(SAlertContentTmpl, _React$Component); - - function SAlertContentTmpl(props) { - _classCallCheck(this, SAlertContentTmpl); - - return _possibleConstructorReturn(this, (SAlertContentTmpl.__proto__ || Object.getPrototypeOf(SAlertContentTmpl)).call(this, props)); - } - - _createClass(SAlertContentTmpl, [{ - key: 'render', - value: function render() { - return _react2.default.createElement( - 'div', - { className: this.props.classNames, id: this.props.id, style: this.props.styles }, - _react2.default.createElement( - 'div', - { className: 's-alert-box-inner' }, - this.props.message - ), - _react2.default.createElement('span', { className: 's-alert-close', onClick: this.props.handleClose }) - ); - } - }]); - - return SAlertContentTmpl; - }(_react2.default.Component); - - SAlertContentTmpl.propTypes = { - id: _propTypes2.default.string.isRequired, - classNames: _propTypes2.default.string.isRequired, - styles: _propTypes2.default.object.isRequired, - message: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]).isRequired, - handleClose: _propTypes2.default.func.isRequired, - customFields: _propTypes2.default.object - }; - - exports.default = SAlertContentTmpl; - }); - -/***/ }, -/* 30 */ -/***/ function(module, exports, __webpack_require__) { - - var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(2), __webpack_require__(14), __webpack_require__(26), __webpack_require__(28), __webpack_require__(27)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else if (typeof exports !== "undefined") { - factory(exports, require('react'), require('react-dom'), require('../SAlertContent'), require('./s-alert-store'), require('./s-alert-tools')); - } else { - var mod = { - exports: {} - }; - factory(mod.exports, global.react, global.reactDom, global.SAlertContent, global.sAlertStore, global.sAlertTools); - global.sAlertDataPrep = mod.exports; - } - })(this, function (exports, _react, _reactDom, _SAlertContent, _sAlertStore, _sAlertTools) { - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _react2 = _interopRequireDefault(_react); - - var _reactDom2 = _interopRequireDefault(_reactDom); - - var _SAlertContent2 = _interopRequireDefault(_SAlertContent); - - var _sAlertStore2 = _interopRequireDefault(_sAlertStore); - - var _sAlertTools2 = _interopRequireDefault(_sAlertTools); - - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; - } - - var getAlertData = function getAlertData(sAlertPosition) { - var positionTop = 0; - var positionBottom = 0; - var padding = 0; - var alerts = {}; - var style = void 0; - var docElement = void 0; - var sAlertBoxHeight = void 0; - var positionTypeTop = void 0; - var positionTypeBottom = void 0; - var checkFirst = function checkFirst(type, objId) { - var collectionOfType = sAlertCollection.filter(function (obj) { - return obj.position === type || sAlertGlobalConfig.position === type; - }); - return collectionOfType && collectionOfType[0].id === objId; - }; - var positionFunc = function positionFunc(position, positionType, alert, docElement, sAlertBoxHeight, reactComponent) { - padding = aStack.spacing || parseInt(getComputedStyle(_reactDom2.default.findDOMNode(reactComponent))[positionType]); - if (checkFirst(aPosition, alert.id) && aOffset) { - position = 0; - position = position + parseInt(aOffset); - } - if (checkFirst(aPosition, alert.id) && aStack.spacing) { - position = position; - } else { - position = position + parseInt(padding); - } - style = positionType + ': ' + position + 'px;'; - position = position + sAlertBoxHeight; - return position; - }; - - var sAlertGlobalConfig = _sAlertTools2.default.getGlobalConfig(); - var aStack = void 0; - var aContentTemplate = void 0; - var aOffset = void 0; - var aMessage = void 0; - var aHtml = void 0; - var aCustomFields = void 0; - var aPosition = void 0; - - var query = {}; - if (sAlertPosition === 'left') { - query = function query(item) { - return item.position === 'top-left' || item.position === 'bottom-left' || !item.position && (sAlertGlobalConfig.position === 'top-left' || sAlertGlobalConfig.position === 'bottom-left'); - }; - } - if (sAlertPosition === 'right') { - query = function query(item) { - return item.position === 'top-right' || item.position === 'bottom-right' || !item.position && (sAlertGlobalConfig.position === 'top-right' || sAlertGlobalConfig.position === 'bottom-right'); - }; - } - if (sAlertPosition === 'full-top') { - query = function query(item) { - return item.position === 'top' || !item.position && sAlertGlobalConfig.position === 'top'; - }; - } - if (sAlertPosition === 'full-bottom') { - query = function query(item) { - return item.position === 'bottom' || !item.position && sAlertGlobalConfig.position === 'bottom'; - }; - } - - var currentState = _sAlertStore2.default.getState(); - var sAlertCollection = currentState.slice().filter(query); - - return sAlertCollection.map(function (alert) { - aStack = sAlertGlobalConfig.stack; - aContentTemplate = sAlertGlobalConfig.contentTemplate; - aOffset = _sAlertTools2.default.returnFirstDefined(alert.offset, sAlertGlobalConfig.offset); - aMessage = _sAlertTools2.default.returnFirstDefined(alert.message, sAlertGlobalConfig.message); - aHtml = _sAlertTools2.default.returnFirstDefined(alert.html, sAlertGlobalConfig.html); - aCustomFields = _sAlertTools2.default.returnFirstDefined(alert.customFields, sAlertGlobalConfig.customFields); - aPosition = _sAlertTools2.default.returnFirstDefined(alert.position, sAlertGlobalConfig.position); - positionTypeTop = aPosition && /top/g.test(aPosition); - positionTypeBottom = aPosition && /bottom/g.test(aPosition); - if (aStack) { - // checking alert box height - needed to calculate position - docElement = document.createElement('div'); - docElement.classList.add('s-alert-box-height'); - - // mock element, needed for positions calculations - var reactElement = _react2.default.createElement(_SAlertContent2.default, { - key: _sAlertTools2.default.randomId(), - id: _sAlertTools2.default.randomId(), - condition: alert.condition, - message: aMessage, - position: aPosition, - effect: alert.effect, - boxPosition: alert.boxPosition, - beep: false, - timeout: 'none', - html: aHtml, - contentTemplate: aContentTemplate, - customFields: aCustomFields - }); - var reactComponent = _reactDom2.default.render(reactElement, docElement); - - document.body.appendChild(docElement); - sAlertBoxHeight = parseInt(getComputedStyle(_reactDom2.default.findDOMNode(reactComponent))['height']); - if (positionTypeTop) { - positionTop = positionFunc(positionTop, 'top', alert, docElement, sAlertBoxHeight, reactComponent); - } - if (positionTypeBottom) { - positionBottom = positionFunc(positionBottom, 'bottom', alert, docElement, sAlertBoxHeight, reactComponent); - } - var sAlertComputedStyle = getComputedStyle(_reactDom2.default.findDOMNode(reactComponent)); - if (sAlertPosition === 'left') { - style = style + 'left: ' + (aStack.spacing || parseInt(sAlertComputedStyle.left)) + 'px;'; - } - if (sAlertPosition === 'right') { - style = style + 'right: ' + (aStack.spacing || parseInt(sAlertComputedStyle.right)) + 'px;'; - } - alerts = Object.assign({}, alert, { boxPosition: style }); - _reactDom2.default.unmountComponentAtNode(docElement); - docElement.parentNode.removeChild(docElement); - } else if (aOffset && positionTypeTop) { - alerts = Object.assign({}, alert, { boxPosition: 'top: ' + parseInt(aOffset) + 'px;' }); - } else if (aOffset && positionTypeBottom) { - alerts = Object.assign({}, alert, { boxPosition: 'bottom: ' + parseInt(aOffset) + 'px;' }); - } else { - alerts = alert; - } - return alerts; - }); - }; - - exports.default = getAlertData; - }); - -/***/ }, -/* 31 */ -/***/ 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 _classnames = __webpack_require__(11); - - var _classnames2 = _interopRequireDefault(_classnames); - - 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 max-len: 0 */ - /* eslint no-nested-ternary: 0 */ - - - var ExpandComponent = function (_Component) { - _inherits(ExpandComponent, _Component); - - function ExpandComponent() { - _classCallCheck(this, ExpandComponent); - - return _possibleConstructorReturn(this, (ExpandComponent.__proto__ || Object.getPrototypeOf(ExpandComponent)).apply(this, arguments)); - } - - _createClass(ExpandComponent, [{ - key: 'render', - value: function render() { - var className = this.props.className; - - var trCss = { - style: { - backgroundColor: this.props.bgColor - }, - className: (0, _classnames2.default)(className) - }; - return _react2.default.createElement( - 'tr', - _extends({ hidden: this.props.hidden, width: this.props.width }, trCss), - _react2.default.createElement( - 'td', - { colSpan: this.props.colSpan }, - this.props.children - ) - ); - } - }]); - - return ExpandComponent; - }(_react.Component); - - var _default = ExpandComponent; - exports.default = _default; - ; - - var _temp = function () { - if (typeof __REACT_HOT_LOADER__ === 'undefined') { - return; - } - - __REACT_HOT_LOADER__.register(ExpandComponent, 'ExpandComponent', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/ExpandComponent.js'); - - __REACT_HOT_LOADER__.register(_default, 'default', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/ExpandComponent.js'); - }(); - - ; - -/***/ }, -/* 32 */ -/***/ 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 _propTypes = __webpack_require__(3); - - var _propTypes2 = _interopRequireDefault(_propTypes); - - var _classnames = __webpack_require__(11); - - var _classnames2 = _interopRequireDefault(_classnames); - - var _PageButton = __webpack_require__(33); - - var _PageButton2 = _interopRequireDefault(_PageButton); - - var _SizePerPageDropDown = __webpack_require__(34); - - var _SizePerPageDropDown2 = _interopRequireDefault(_SizePerPageDropDown); - - var _Const = __webpack_require__(12); - - var _Const2 = _interopRequireDefault(_Const); - - var _util = __webpack_require__(18); - - var _util2 = _interopRequireDefault(_util); - - 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 PaginationList = function (_Component) { - _inherits(PaginationList, _Component); - - function PaginationList(props) { - _classCallCheck(this, PaginationList); - - var _this = _possibleConstructorReturn(this, (PaginationList.__proto__ || Object.getPrototypeOf(PaginationList)).call(this, props)); - - _this.changePage = function () { - return _this.__changePage__REACT_HOT_LOADER__.apply(_this, arguments); - }; - - _this.changeSizePerPage = function () { - return _this.__changeSizePerPage__REACT_HOT_LOADER__.apply(_this, arguments); - }; - - _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() { - var keepSizePerPageState = this.props.keepSizePerPageState; - - if (!keepSizePerPageState) { - this.setState(function () { - return { open: false }; - }); - } - } - }, { - key: '__changePage__REACT_HOT_LOADER__', - value: function __changePage__REACT_HOT_LOADER__(page) { - var _props = this.props, - pageStartIndex = _props.pageStartIndex, - prePage = _props.prePage, - currPage = _props.currPage, - nextPage = _props.nextPage, - lastPage = _props.lastPage, - firstPage = _props.firstPage, - sizePerPage = _props.sizePerPage, - keepSizePerPageState = _props.keepSizePerPageState; - - - if (page === prePage) { - page = currPage - 1 < pageStartIndex ? pageStartIndex : currPage - 1; - } else if (page === nextPage) { - page = currPage + 1 > this.lastPage ? this.lastPage : currPage + 1; - } else if (page === lastPage) { - page = this.lastPage; - } else if (page === firstPage) { - page = pageStartIndex; - } else { - page = parseInt(page, 10); - } - - if (keepSizePerPageState) { - this.setState(function () { - return { open: false }; - }); - } - - if (page !== currPage) { - this.props.changePage(page, sizePerPage); - } - } - }, { - key: '__changeSizePerPage__REACT_HOT_LOADER__', - 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) { - this.totalPages = Math.ceil(this.props.dataSize / selectSize); - this.lastPage = this.props.pageStartIndex + this.totalPages - 1; - if (currPage > this.lastPage) currPage = this.lastPage; - this.props.changePage(currPage, selectSize); - if (this.props.onSizePerPageList) { - this.props.onSizePerPageList(selectSize); - } - } - - this.setState(function () { - return { open: false }; - }); - } - }, { - key: '__toggleDropDown__REACT_HOT_LOADER__', - value: function __toggleDropDown__REACT_HOT_LOADER__() { - var _this2 = this; - - this.setState(function () { - return { - open: !_this2.state.open - }; - }); - } - }, { - key: 'render', - value: function render() { - var _props2 = this.props, - currPage = _props2.currPage, - dataSize = _props2.dataSize, - sizePerPage = _props2.sizePerPage, - sizePerPageList = _props2.sizePerPageList, - paginationShowsTotal = _props2.paginationShowsTotal, - pageStartIndex = _props2.pageStartIndex, - paginationPanel = _props2.paginationPanel, - hidePageListOnlyOnePage = _props2.hidePageListOnlyOnePage; - - this.totalPages = Math.ceil(dataSize / sizePerPage); - this.lastPage = this.props.pageStartIndex + this.totalPages - 1; - var pageBtns = this.makePage(_util2.default.isFunction(paginationPanel)); - var dropdown = this.makeDropDown(); - - var offset = Math.abs(_Const2.default.PAGE_START_INDEX - pageStartIndex); - var start = (currPage - pageStartIndex) * sizePerPage; - start = dataSize === 0 ? 0 : start + 1; - var to = Math.min(sizePerPage * (currPage + offset) - 1, dataSize); - if (to >= dataSize) to--; - var total = paginationShowsTotal ? _react2.default.createElement( - 'span', - null, - 'Showing rows ', - start, - ' to\xA0', - to + 1, - ' of\xA0', - dataSize - ) : null; - - if (_util2.default.isFunction(paginationShowsTotal)) { - total = paginationShowsTotal(start, to + 1, dataSize); - } - - 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 - } - }); - - var hidePageList = hidePageListOnlyOnePage && this.totalPages === 1 ? 'none' : 'block'; - return _react2.default.createElement( - 'div', - { className: 'row', style: { marginTop: 15 } }, - content || _react2.default.createElement( - 'div', - null, - _react2.default.createElement( - 'div', - { className: 'col-md-6 col-xs-6 col-sm-6 col-lg-6' }, - total, - sizePerPageList.length > 1 ? dropdown : null - ), - _react2.default.createElement( - 'div', - { style: { display: hidePageList }, - className: 'col-md-6 col-xs-6 col-sm-6 col-lg-6' }, - pageBtns - ) - ) - ); - } - }, { - key: 'makeDropDown', - value: function makeDropDown() { - var _this3 = 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: String(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(); - _this3.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 _this4 = this; - - var isCustomPagingPanel = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; - - var pages = this.getPages(); - 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 === _this4.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; - var title = page + ''; - - if (page === this.props.nextPage) { - title = this.props.nextPageTitle; - } else if (page === this.props.prePage) { - title = this.props.prePageTitle; - } else if (page === this.props.firstPage) { - title = this.props.firstPageTitle; - } else if (page === this.props.lastPage) { - title = this.props.lastPageTitle; - } - - return _react2.default.createElement( - _PageButton2.default, - { key: page, - title: title, - changePage: this.changePage, - active: isActive, - 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', - value: function getPages() { - var pages = void 0; - var endPage = this.totalPages; - if (endPage <= 0) return []; - var startPage = Math.max(this.props.currPage - Math.floor(this.props.paginationSize / 2), this.props.pageStartIndex); - endPage = startPage + this.props.paginationSize - 1; - - if (endPage > this.lastPage) { - endPage = this.lastPage; - startPage = endPage - this.props.paginationSize + 1; - } - - 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 || this.props.alwaysShowAllBtns) { - pages = [this.props.prePage]; + if (msg) { + (0, _Notification.notice)('error', msg, ''); + this.clearTimeout(); + // shake form and hack prevent modal hide + this.setState(function () { + return { + shakeEditor: true, + validateState: 'this is hack for prevent bootstrap modal hide' + }; + }); + // clear animate class + this.timeouteClear = setTimeout(function () { + _this4.setState(function () { + return { shakeEditor: false }; + }); + }, 300); } else { - pages = []; - } - - for (var i = startPage; i <= endPage; i++) { - if (i >= this.props.pageStartIndex) pages.push(i); - } - - if (endPage <= this.lastPage && pages.length > 1) { - pages.push(this.props.nextPage); - } - if (endPage !== this.lastPage && this.props.withFirstAndLast) { - pages.push(this.props.lastPage); + // reset state and hide modal hide + this.setState(function () { + return { + validateState: null, + shakeEditor: false, + isInsertModalOpen: false + }; + }); } - - return pages; } - }]); - - return PaginationList; - }(_react.Component); - - PaginationList.propTypes = { - currPage: _propTypes2.default.number, - sizePerPage: _propTypes2.default.number, - dataSize: _propTypes2.default.number, - changePage: _propTypes2.default.func, - sizePerPageList: _propTypes2.default.array, - paginationShowsTotal: _propTypes2.default.oneOfType([_propTypes2.default.bool, _propTypes2.default.func]), - paginationSize: _propTypes2.default.number, - onSizePerPageList: _propTypes2.default.func, - prePage: _propTypes2.default.string, - pageStartIndex: _propTypes2.default.number, - hideSizePerPage: _propTypes2.default.bool, - alwaysShowAllBtns: _propTypes2.default.bool, - withFirstAndLast: _propTypes2.default.bool, - sizePerPageDropDown: _propTypes2.default.func, - paginationPanel: _propTypes2.default.func, - prePageTitle: _propTypes2.default.string, - nextPageTitle: _propTypes2.default.string, - firstPageTitle: _propTypes2.default.string, - lastPageTitle: _propTypes2.default.string, - hidePageListOnlyOnePage: _propTypes2.default.bool, - keepSizePerPageState: _propTypes2.default.bool - }; - - PaginationList.defaultProps = { - sizePerPage: _Const2.default.SIZE_PER_PAGE, - pageStartIndex: _Const2.default.PAGE_START_INDEX - }; - - var _default = PaginationList; - exports.default = _default; - ; - - var _temp = function () { - if (typeof __REACT_HOT_LOADER__ === 'undefined') { - return; - } - - __REACT_HOT_LOADER__.register(PaginationList, 'PaginationList', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/pagination/PaginationList.js'); - - __REACT_HOT_LOADER__.register(_default, 'default', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/pagination/PaginationList.js'); - }(); - - ; - -/***/ }, -/* 33 */ -/***/ 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 _propTypes = __webpack_require__(3); - - var _propTypes2 = _interopRequireDefault(_propTypes); - - var _classnames = __webpack_require__(11); - - var _classnames2 = _interopRequireDefault(_classnames); - - 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 PageButton = function (_Component) { - _inherits(PageButton, _Component); - - function PageButton(props) { - _classCallCheck(this, PageButton); - - var _this = _possibleConstructorReturn(this, (PageButton.__proto__ || Object.getPrototypeOf(PageButton)).call(this, props)); - - _this.pageBtnClick = function () { - return _this.__pageBtnClick__REACT_HOT_LOADER__.apply(_this, arguments); - }; - - return _this; - } - - _createClass(PageButton, [{ - key: '__pageBtnClick__REACT_HOT_LOADER__', - value: function __pageBtnClick__REACT_HOT_LOADER__(e) { - e.preventDefault(); - this.props.changePage(e.currentTarget.textContent); + }, { + key: '__handleModalClose__REACT_HOT_LOADER__', + value: function __handleModalClose__REACT_HOT_LOADER__() { + this.setState(function () { + return { isInsertModalOpen: false }; + }); } }, { - key: 'render', - value: function render() { - var classes = (0, _classnames2.default)({ - 'active': this.props.active, - 'disabled': this.props.disable, - 'hidden': this.props.hidden, - 'page-item': true + key: '__handleModalOpen__REACT_HOT_LOADER__', + value: function __handleModalOpen__REACT_HOT_LOADER__() { + this.setState(function () { + return { isInsertModalOpen: true }; }); - return _react2.default.createElement( - 'li', - { className: classes, title: this.props.title }, - _react2.default.createElement( - 'a', - { href: '#', onClick: this.pageBtnClick, className: 'page-link' }, - this.props.children - ) - ); } - }]); - - return PageButton; - }(_react.Component); - - PageButton.propTypes = { - title: _propTypes2.default.string, - changePage: _propTypes2.default.func, - active: _propTypes2.default.bool, - disable: _propTypes2.default.bool, - hidden: _propTypes2.default.bool, - children: _propTypes2.default.node - }; - - var _default = PageButton; - exports.default = _default; - ; - - var _temp = function () { - if (typeof __REACT_HOT_LOADER__ === 'undefined') { - return; - } - - __REACT_HOT_LOADER__.register(PageButton, 'PageButton', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/pagination/PageButton.js'); - - __REACT_HOT_LOADER__.register(_default, 'default', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/pagination/PageButton.js'); - }(); - - ; - -/***/ }, -/* 34 */ -/***/ 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); + }, { + key: '__handleShowOnlyToggle__REACT_HOT_LOADER__', + value: function __handleShowOnlyToggle__REACT_HOT_LOADER__() { + var _this5 = this; - var _react2 = _interopRequireDefault(_react); + this.setState(function () { + return { + showSelected: !_this5.state.showSelected + }; + }); + this.props.onShowOnlySelected(); + } + }, { + key: '__handleDropRowBtnClick__REACT_HOT_LOADER__', + value: function __handleDropRowBtnClick__REACT_HOT_LOADER__() { + this.props.onDropRow(); + } + }, { + key: 'handleCloseBtn', + value: function handleCloseBtn() { + this.refs.warning.style.display = 'none'; + } + }, { + key: '__handleKeyUp__REACT_HOT_LOADER__', + value: function __handleKeyUp__REACT_HOT_LOADER__(event) { + event.persist(); + this.debounceCallback(event); + } + }, { + key: '__handleExportCSV__REACT_HOT_LOADER__', + value: function __handleExportCSV__REACT_HOT_LOADER__() { + this.props.onExportCSV(); + } + }, { + key: '__handleClearBtnClick__REACT_HOT_LOADER__', + value: function __handleClearBtnClick__REACT_HOT_LOADER__() { + var seachInput = this.refs.seachInput; - var _propTypes = __webpack_require__(3); + 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 exportCSVBtn = null; + var showSelectedOnlyBtn = null; - var _propTypes2 = _interopRequireDefault(_propTypes); + 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 }); + } + } - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + 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 }); + } + } - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + 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 }); + } + } - 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; } + 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 }); + } + } - 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; } + 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 sizePerPageDefaultClass = 'react-bs-table-sizePerPage-dropdown'; + var _renderSearchPanel = this.renderSearchPanel(), + _renderSearchPanel2 = _slicedToArray(_renderSearchPanel, 3), + searchPanel = _renderSearchPanel2[0], + searchField = _renderSearchPanel2[1], + clearBtn = _renderSearchPanel2[2]; - var SizePerPageDropDown = function (_Component) { - _inherits(SizePerPageDropDown, _Component); + var modal = this.props.enableInsert ? this.renderInsertRowModal() : null; - function SizePerPageDropDown() { - _classCallCheck(this, SizePerPageDropDown); + 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 _possibleConstructorReturn(this, (SizePerPageDropDown.__proto__ || Object.getPrototypeOf(SizePerPageDropDown)).apply(this, arguments)); - } + return _react2.default.createElement( + 'div', + { className: 'row' }, + toolbar, + 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'; + } - _createClass(SizePerPageDropDown, [{ - key: 'render', - value: function render() { + 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, - open = _props.open, - hidden = _props.hidden, - onClick = _props.onClick, - options = _props.options, - className = _props.className, - variation = _props.variation, - btnContextual = _props.btnContextual, - currSizePerPage = _props.currSizePerPage; + columns = _props.columns, + ignoreEditable = _props.ignoreEditable, + insertModalHeader = _props.insertModalHeader, + insertModalBody = _props.insertModalBody, + insertModalFooter = _props.insertModalFooter, + insertModal = _props.insertModal; - var openClass = open ? 'open show' : ''; - var dropDownStyle = { visibility: hidden ? 'hidden' : 'visible' }; + 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( - 'span', - { style: dropDownStyle, - className: variation + ' ' + openClass + ' ' + className + ' ' + sizePerPageDefaultClass }, - _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 - ) + _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 SizePerPageDropDown; + return ToolBar; }(_react.Component); - SizePerPageDropDown.propTypes = { - open: _propTypes2.default.bool, - hidden: _propTypes2.default.bool, - btnContextual: _propTypes2.default.string, - currSizePerPage: _propTypes2.default.string, - options: _propTypes2.default.array, - variation: _propTypes2.default.oneOf(['dropdown', 'dropup']), - className: _propTypes2.default.string, - onClick: _propTypes2.default.func + ToolBar.modalSeq = 0; + + + ToolBar.propTypes = { + onAddRow: _propTypes2.default.func, + onDropRow: _propTypes2.default.func, + onShowOnlySelected: _propTypes2.default.func, + enableInsert: _propTypes2.default.bool, + enableDelete: _propTypes2.default.bool, + enableSearch: _propTypes2.default.bool, + enableShowOnlySelected: _propTypes2.default.bool, + columns: _propTypes2.default.array, + searchPlaceholder: _propTypes2.default.string, + exportCSVText: _propTypes2.default.string, + insertText: _propTypes2.default.string, + deleteText: _propTypes2.default.string, + saveText: _propTypes2.default.string, + closeText: _propTypes2.default.string, + clearSearch: _propTypes2.default.bool, + ignoreEditable: _propTypes2.default.bool, + defaultSearch: _propTypes2.default.string, + insertModalHeader: _propTypes2.default.func, + insertModalBody: _propTypes2.default.func, + insertModalFooter: _propTypes2.default.func, + insertModal: _propTypes2.default.func, + insertBtn: _propTypes2.default.func, + deleteBtn: _propTypes2.default.func, + showSelectedOnlyBtn: _propTypes2.default.func, + exportCSVBtn: _propTypes2.default.func, + clearSearchBtn: _propTypes2.default.func, + searchField: _propTypes2.default.func, + searchPanel: _propTypes2.default.func, + btnGroup: _propTypes2.default.func, + toolBar: _propTypes2.default.func, + searchPosition: _propTypes2.default.string, + reset: _propTypes2.default.bool, + isValidKey: _propTypes2.default.func, + insertFailIndicator: _propTypes2.default.string }; - SizePerPageDropDown.defaultProps = { - open: false, - hidden: false, - btnContextual: 'btn-default', - variation: 'dropdown', - className: '' + + 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 = SizePerPageDropDown; + var _default = ToolBar; exports.default = _default; ; @@ -12611,1903 +8201,2492 @@ return /******/ (function(modules) { // webpackBootstrap return; } - __REACT_HOT_LOADER__.register(sizePerPageDefaultClass, 'sizePerPageDefaultClass', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/pagination/SizePerPageDropDown.js'); - - __REACT_HOT_LOADER__.register(SizePerPageDropDown, 'SizePerPageDropDown', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/pagination/SizePerPageDropDown.js'); + __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/pagination/SizePerPageDropDown.js'); + __REACT_HOT_LOADER__.register(_default, 'default', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/toolbar/ToolBar.js'); }(); ; -/***/ }, -/* 35 */ -/***/ 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 _propTypes = __webpack_require__(3); - - var _propTypes2 = _interopRequireDefault(_propTypes); - - var _reactModal = __webpack_require__(36); - - var _reactModal2 = _interopRequireDefault(_reactModal); - - var _Const = __webpack_require__(12); - - var _Const2 = _interopRequireDefault(_Const); - - var _Notification = __webpack_require__(23); - - var _InsertModal = __webpack_require__(46); - - var _InsertModal2 = _interopRequireDefault(_InsertModal); - - var _InsertButton = __webpack_require__(50); - - var _InsertButton2 = _interopRequireDefault(_InsertButton); - - var _DeleteButton = __webpack_require__(51); - - var _DeleteButton2 = _interopRequireDefault(_DeleteButton); - - var _ExportCSVButton = __webpack_require__(52); - - var _ExportCSVButton2 = _interopRequireDefault(_ExportCSVButton); - - var _ShowSelectedOnlyButton = __webpack_require__(53); - - var _ShowSelectedOnlyButton2 = _interopRequireDefault(_ShowSelectedOnlyButton); - - var _SearchField = __webpack_require__(54); - - var _SearchField2 = _interopRequireDefault(_SearchField); - - var _ClearSearchButton = __webpack_require__(55); - - 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; } /* eslint no-console: 0 */ - - // import classSet from 'classnames'; - - // import editor from '../Editor'; - +/***/ }), +/* 37 */ +/***/ (function(module, exports, __webpack_require__) { - var ToolBar = function (_Component) { - _inherits(ToolBar, _Component); + module.exports = __webpack_require__(38); - function ToolBar(props) { - var _arguments = arguments; - _classCallCheck(this, ToolBar); - var _this = _possibleConstructorReturn(this, (ToolBar.__proto__ || Object.getPrototypeOf(ToolBar)).call(this, props)); +/***/ }), +/* 38 */ +/***/ (function(module, exports, __webpack_require__) { - _this.displayCommonMessage = function () { - return _this.__displayCommonMessage__REACT_HOT_LOADER__.apply(_this, arguments); - }; + /* WEBPACK VAR INJECTION */(function(process) {var React = __webpack_require__(2); + var ReactDOM = __webpack_require__(15); + var DOMFactories = __webpack_require__(39); + var PropTypes = __webpack_require__(3); + var ExecutionEnvironment = __webpack_require__(40); + var ModalPortal = React.createFactory(__webpack_require__(41)); + var ariaAppHider = __webpack_require__(50); + var refCount = __webpack_require__(51); + var elementClass = __webpack_require__(52); + var renderSubtreeIntoContainer = __webpack_require__(15).unstable_renderSubtreeIntoContainer; + var Assign = __webpack_require__(45); + var createReactClass = __webpack_require__(46); - _this.handleSaveBtnClick = function () { - return _this.__handleSaveBtnClick__REACT_HOT_LOADER__.apply(_this, arguments); - }; + var SafeHTMLElement = ExecutionEnvironment.canUseDOM ? window.HTMLElement : {}; + var AppElement = ExecutionEnvironment.canUseDOM ? document.body : {appendChild: function() {}}; - _this.afterHandleSaveBtnClick = function () { - return _this.__afterHandleSaveBtnClick__REACT_HOT_LOADER__.apply(_this, arguments); - }; + function getParentElement(parentSelector) { + return parentSelector(); + } - _this.handleModalClose = function () { - return _this.__handleModalClose__REACT_HOT_LOADER__.apply(_this, arguments); - }; + var Modal = createReactClass({ - _this.handleModalOpen = function () { - return _this.__handleModalOpen__REACT_HOT_LOADER__.apply(_this, arguments); - }; + 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'); + } + }, - _this.handleShowOnlyToggle = function () { - return _this.__handleShowOnlyToggle__REACT_HOT_LOADER__.apply(_this, arguments); - }; + propTypes: { + isOpen: PropTypes.bool.isRequired, + style: PropTypes.shape({ + content: PropTypes.object, + overlay: PropTypes.object + }), + portalClassName: PropTypes.string, + bodyOpenClassName: PropTypes.string, + appElement: PropTypes.instanceOf(SafeHTMLElement), + onAfterOpen: PropTypes.func, + onRequestClose: PropTypes.func, + closeTimeoutMS: PropTypes.number, + ariaHideApp: PropTypes.bool, + shouldCloseOnOverlayClick: PropTypes.bool, + parentSelector: PropTypes.func, + role: PropTypes.string, + contentLabel: PropTypes.string.isRequired + }, - _this.handleDropRowBtnClick = function () { - return _this.__handleDropRowBtnClick__REACT_HOT_LOADER__.apply(_this, arguments); + getDefaultProps: function () { + return { + isOpen: false, + portalClassName: 'ReactModalPortal', + bodyOpenClassName: 'ReactModal__Body--open', + ariaHideApp: true, + closeTimeoutMS: 0, + shouldCloseOnOverlayClick: true, + parentSelector: function () { return document.body; } }; + }, - _this.handleDebounce = function (func, wait, immediate) { - var timeout = void 0; - - return function () { - var later = function later() { - timeout = null; - - if (!immediate) { - func.apply(_this, _arguments); - } - }; - - var callNow = immediate && !timeout; - - clearTimeout(timeout); + componentDidMount: function() { + this.node = document.createElement('div'); + this.node.className = this.props.portalClassName; - timeout = setTimeout(later, wait || 0); + if (this.props.isOpen) refCount.add(this); - if (callNow) { - func.appy(_this, _arguments); - } - }; - }; + var parent = getParentElement(this.props.parentSelector); + parent.appendChild(this.node); + this.renderPortal(this.props); + }, - _this.handleKeyUp = function () { - return _this.__handleKeyUp__REACT_HOT_LOADER__.apply(_this, arguments); - }; + componentWillUpdate: function(newProps) { + if(newProps.portalClassName !== this.props.portalClassName) { + this.node.className = newProps.portalClassName; + } + }, - _this.handleExportCSV = function () { - return _this.__handleExportCSV__REACT_HOT_LOADER__.apply(_this, arguments); - }; + componentWillReceiveProps: function(newProps) { + if (newProps.isOpen) refCount.add(this); + if (!newProps.isOpen) refCount.remove(this); + var currentParent = getParentElement(this.props.parentSelector); + var newParent = getParentElement(newProps.parentSelector); - _this.handleClearBtnClick = function () { - return _this.__handleClearBtnClick__REACT_HOT_LOADER__.apply(_this, arguments); - }; + if(newParent !== currentParent) { + currentParent.removeChild(this.node); + newParent.appendChild(this.node); + } - _this.timeouteClear = 0; - _this.modalClassName; - _this.state = { - isInsertModalOpen: false, - validateState: null, - shakeEditor: false, - showSelected: false - }; - return _this; - } + this.renderPortal(newProps); + }, - _createClass(ToolBar, [{ - key: 'componentWillMount', - value: function componentWillMount() { - var _this2 = this; + componentWillUnmount: function() { + if (!this.node) return; - var delay = this.props.searchDelayTime ? this.props.searchDelayTime : 0; - this.debounceCallback = this.handleDebounce(function () { - var seachInput = _this2.refs.seachInput; + refCount.remove(this); - seachInput && _this2.props.onSearch(seachInput.getValue()); - }, delay); + if (this.props.ariaHideApp) { + ariaAppHider.show(this.props.appElement); } - }, { - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(nextProps) { - if (nextProps.reset) { - this.setSearchInput(''); + + var state = this.portal.state; + var now = Date.now(); + var closesAt = state.isOpen && this.props.closeTimeoutMS + && (state.closesAt + || now + this.props.closeTimeoutMS); + + if (closesAt) { + if (!state.beforeClose) { + this.portal.closeWithTimeout(); } + + var that = this; + setTimeout(function() { that.removePortal(); }, closesAt - now); + } else { + this.removePortal(); } - }, { - key: 'componentWillUnmount', - value: function componentWillUnmount() { - this.clearTimeout(); - } - }, { - key: 'setSearchInput', - value: function setSearchInput(text) { - var seachInput = this.refs.seachInput; + }, - if (seachInput && seachInput.value !== text) { - seachInput.value = text; - } + removePortal: function() { + ReactDOM.unmountComponentAtNode(this.node); + var parent = getParentElement(this.props.parentSelector); + parent.removeChild(this.node); + + if (refCount.count() === 0) { + elementClass(document.body).remove(this.props.bodyOpenClassName); } - }, { - key: 'clearTimeout', - value: function (_clearTimeout) { - function clearTimeout() { - return _clearTimeout.apply(this, arguments); - } + }, - clearTimeout.toString = function () { - return _clearTimeout.toString(); - }; + renderPortal: function(props) { + if (props.isOpen || refCount.count() > 0) { + elementClass(document.body).add(this.props.bodyOpenClassName); + } else { + elementClass(document.body).remove(this.props.bodyOpenClassName); + } - return clearTimeout; - }(function () { - if (this.timeouteClear) { - clearTimeout(this.timeouteClear); - this.timeouteClear = 0; - } - }) - }, { - key: '__displayCommonMessage__REACT_HOT_LOADER__', - value: function __displayCommonMessage__REACT_HOT_LOADER__() { - (0, _Notification.notice)('error', this.props.insertFailIndicator, ''); + if (props.ariaHideApp) { + ariaAppHider.toggle(props.isOpen, props.appElement); } - }, { - key: 'validateNewRow', - value: function validateNewRow(newRow) { - var _this3 = this; - var validateState = {}; - var isValid = true; - var tempMsg = void 0; - var responseType = void 0; + this.portal = renderSubtreeIntoContainer(this, ModalPortal(Assign({}, props, {defaultStyles: Modal.defaultStyles})), this.node); + }, - this.props.columns.forEach(function (column) { - if (column.isKey && column.keyValidator) { - // key validator for checking exist key - tempMsg = _this3.props.isValidKey(newRow[column.field]); - if (tempMsg) { - _this3.displayCommonMessage(); - isValid = false; - validateState[column.field] = tempMsg; - } - } else if (column.editable && column.editable.validator) { - // process validate - tempMsg = column.editable.validator(newRow[column.field], newRow); - responseType = typeof tempMsg === 'undefined' ? 'undefined' : _typeof(tempMsg); - if (responseType !== 'object' && tempMsg !== true) { - _this3.displayCommonMessage(); - isValid = false; - validateState[column.field] = tempMsg; - } else if (responseType === 'object' && tempMsg.isValid !== true) { - (0, _Notification.notice)(tempMsg.notification.type, tempMsg.notification.msg, tempMsg.notification.title); - isValid = false; - validateState[column.field] = tempMsg.notification.msg; - } - } - }); + render: function () { + return DOMFactories.noscript(); + } + }); - if (isValid) { - return true; - } else { - this.clearTimeout(); - // show error in form and shake it - this.setState(function () { - return { validateState: validateState, shakeEditor: true }; - }); - this.timeouteClear = setTimeout(function () { - _this3.setState(function () { - return { shakeEditor: false }; - }); - }, 300); - return null; - } - } - }, { - key: '__handleSaveBtnClick__REACT_HOT_LOADER__', - value: function __handleSaveBtnClick__REACT_HOT_LOADER__(newRow) { - if (!this.validateNewRow(newRow)) { - // validation fail - return; - } - var msg = this.props.onAddRow(newRow); - if (msg !== false) { - this.afterHandleSaveBtnClick(msg); - } - } - }, { - key: '__afterHandleSaveBtnClick__REACT_HOT_LOADER__', - value: function __afterHandleSaveBtnClick__REACT_HOT_LOADER__(msg) { - var _this4 = this; + 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' + } + } - if (msg) { - (0, _Notification.notice)('error', msg, ''); - this.clearTimeout(); - // shake form and hack prevent modal hide - this.setState(function () { - return { - shakeEditor: true, - validateState: 'this is hack for prevent bootstrap modal hide' - }; - }); - // clear animate class - this.timeouteClear = setTimeout(function () { - _this4.setState(function () { - return { shakeEditor: false }; - }); - }, 300); - } else { - // reset state and hide modal hide - this.setState(function () { - return { - validateState: null, - shakeEditor: false, - isInsertModalOpen: false - }; - }); - } - } - }, { - key: '__handleModalClose__REACT_HOT_LOADER__', - value: function __handleModalClose__REACT_HOT_LOADER__() { - this.setState(function () { - return { isInsertModalOpen: false }; - }); - } - }, { - key: '__handleModalOpen__REACT_HOT_LOADER__', - value: function __handleModalOpen__REACT_HOT_LOADER__() { - this.setState(function () { - return { isInsertModalOpen: true }; - }); - } - }, { - key: '__handleShowOnlyToggle__REACT_HOT_LOADER__', - value: function __handleShowOnlyToggle__REACT_HOT_LOADER__() { - var _this5 = this; + module.exports = Modal + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4))) + +/***/ }), +/* 39 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + /** + * Copyright 2015-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ - this.setState(function () { - return { - showSelected: !_this5.state.showSelected - }; - }); - this.props.onShowOnlySelected(); - } - }, { - key: '__handleDropRowBtnClick__REACT_HOT_LOADER__', - value: function __handleDropRowBtnClick__REACT_HOT_LOADER__() { - this.props.onDropRow(); - } - }, { - key: 'handleCloseBtn', - value: function handleCloseBtn() { - this.refs.warning.style.display = 'none'; - } - }, { - key: '__handleKeyUp__REACT_HOT_LOADER__', - value: function __handleKeyUp__REACT_HOT_LOADER__(event) { - event.persist(); - this.debounceCallback(event); - } - }, { - key: '__handleExportCSV__REACT_HOT_LOADER__', - value: function __handleExportCSV__REACT_HOT_LOADER__() { - this.props.onExportCSV(); + (function(f) { + if (true) { + module.exports = f(__webpack_require__(2)); + /* global define */ + } else if (typeof define === 'function' && define.amd) { + define(['react'], f); + } else { + var g; + if (typeof window !== 'undefined') { + g = window; + } else if (typeof global !== 'undefined') { + g = global; + } else if (typeof self !== 'undefined') { + g = self; + } else { + g = this; } - }, { - key: '__handleClearBtnClick__REACT_HOT_LOADER__', - value: function __handleClearBtnClick__REACT_HOT_LOADER__() { - var seachInput = this.refs.seachInput; - seachInput && seachInput.setValue(''); - this.props.onSearch(''); + if (typeof g.React === 'undefined') { + throw Error('React module should be required before ReactDOMFactories'); } - }, { - 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 exportCSVBtn = null; - var showSelectedOnlyBtn = null; - 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 }); - } - } + g.ReactDOMFactories = f(g.React); + } + })(function(React) { + /** + * Create a factory that creates HTML tag elements. + */ + var createDOMFactory = React.createFactory; - 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 }); - } - } + /** + * Creates a mapping from supported HTML tags to `ReactDOMComponent` classes. + */ + var ReactDOMFactories = { + a: createDOMFactory('a'), + abbr: createDOMFactory('abbr'), + address: createDOMFactory('address'), + area: createDOMFactory('area'), + article: createDOMFactory('article'), + aside: createDOMFactory('aside'), + audio: createDOMFactory('audio'), + b: createDOMFactory('b'), + base: createDOMFactory('base'), + bdi: createDOMFactory('bdi'), + bdo: createDOMFactory('bdo'), + big: createDOMFactory('big'), + blockquote: createDOMFactory('blockquote'), + body: createDOMFactory('body'), + br: createDOMFactory('br'), + button: createDOMFactory('button'), + canvas: createDOMFactory('canvas'), + caption: createDOMFactory('caption'), + cite: createDOMFactory('cite'), + code: createDOMFactory('code'), + col: createDOMFactory('col'), + colgroup: createDOMFactory('colgroup'), + data: createDOMFactory('data'), + datalist: createDOMFactory('datalist'), + dd: createDOMFactory('dd'), + del: createDOMFactory('del'), + details: createDOMFactory('details'), + dfn: createDOMFactory('dfn'), + dialog: createDOMFactory('dialog'), + div: createDOMFactory('div'), + dl: createDOMFactory('dl'), + dt: createDOMFactory('dt'), + em: createDOMFactory('em'), + embed: createDOMFactory('embed'), + fieldset: createDOMFactory('fieldset'), + figcaption: createDOMFactory('figcaption'), + figure: createDOMFactory('figure'), + footer: createDOMFactory('footer'), + form: createDOMFactory('form'), + h1: createDOMFactory('h1'), + h2: createDOMFactory('h2'), + h3: createDOMFactory('h3'), + h4: createDOMFactory('h4'), + h5: createDOMFactory('h5'), + h6: createDOMFactory('h6'), + head: createDOMFactory('head'), + header: createDOMFactory('header'), + hgroup: createDOMFactory('hgroup'), + hr: createDOMFactory('hr'), + html: createDOMFactory('html'), + i: createDOMFactory('i'), + iframe: createDOMFactory('iframe'), + img: createDOMFactory('img'), + input: createDOMFactory('input'), + ins: createDOMFactory('ins'), + kbd: createDOMFactory('kbd'), + keygen: createDOMFactory('keygen'), + label: createDOMFactory('label'), + legend: createDOMFactory('legend'), + li: createDOMFactory('li'), + link: createDOMFactory('link'), + main: createDOMFactory('main'), + map: createDOMFactory('map'), + mark: createDOMFactory('mark'), + menu: createDOMFactory('menu'), + menuitem: createDOMFactory('menuitem'), + meta: createDOMFactory('meta'), + meter: createDOMFactory('meter'), + nav: createDOMFactory('nav'), + noscript: createDOMFactory('noscript'), + object: createDOMFactory('object'), + ol: createDOMFactory('ol'), + optgroup: createDOMFactory('optgroup'), + option: createDOMFactory('option'), + output: createDOMFactory('output'), + p: createDOMFactory('p'), + param: createDOMFactory('param'), + picture: createDOMFactory('picture'), + pre: createDOMFactory('pre'), + progress: createDOMFactory('progress'), + q: createDOMFactory('q'), + rp: createDOMFactory('rp'), + rt: createDOMFactory('rt'), + ruby: createDOMFactory('ruby'), + s: createDOMFactory('s'), + samp: createDOMFactory('samp'), + script: createDOMFactory('script'), + section: createDOMFactory('section'), + select: createDOMFactory('select'), + small: createDOMFactory('small'), + source: createDOMFactory('source'), + span: createDOMFactory('span'), + strong: createDOMFactory('strong'), + style: createDOMFactory('style'), + sub: createDOMFactory('sub'), + summary: createDOMFactory('summary'), + sup: createDOMFactory('sup'), + table: createDOMFactory('table'), + tbody: createDOMFactory('tbody'), + td: createDOMFactory('td'), + textarea: createDOMFactory('textarea'), + tfoot: createDOMFactory('tfoot'), + th: createDOMFactory('th'), + thead: createDOMFactory('thead'), + time: createDOMFactory('time'), + title: createDOMFactory('title'), + tr: createDOMFactory('tr'), + track: createDOMFactory('track'), + u: createDOMFactory('u'), + ul: createDOMFactory('ul'), + var: createDOMFactory('var'), + video: createDOMFactory('video'), + wbr: createDOMFactory('wbr'), + + // SVG + circle: createDOMFactory('circle'), + clipPath: createDOMFactory('clipPath'), + defs: createDOMFactory('defs'), + ellipse: createDOMFactory('ellipse'), + g: createDOMFactory('g'), + image: createDOMFactory('image'), + line: createDOMFactory('line'), + linearGradient: createDOMFactory('linearGradient'), + mask: createDOMFactory('mask'), + path: createDOMFactory('path'), + pattern: createDOMFactory('pattern'), + polygon: createDOMFactory('polygon'), + polyline: createDOMFactory('polyline'), + radialGradient: createDOMFactory('radialGradient'), + rect: createDOMFactory('rect'), + stop: createDOMFactory('stop'), + svg: createDOMFactory('svg'), + text: createDOMFactory('text'), + tspan: createDOMFactory('tspan'), + }; - 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 }); - } - } + // due to wrapper and conditionals at the top, this will either become + // `module.exports ReactDOMFactories` if that is available, + // otherwise it will be defined via `define(['react'], ReactDOMFactories)` + // if that is available, + // otherwise it will be defined as global variable. + return ReactDOMFactories; + }); - 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]; +/***/ }), +/* 40 */ +/***/ (function(module, exports, __webpack_require__) { - var modal = this.props.enableInsert ? this.renderInsertRowModal() : null; + var __WEBPACK_AMD_DEFINE_RESULT__;/*! + Copyright (c) 2015 Jed Watson. + Based on code that is Copyright 2013-2015, Facebook, Inc. + All rights reserved. + */ - 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 - ) - ); + (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; + } + + }()); + + +/***/ }), +/* 41 */ +/***/ (function(module, exports, __webpack_require__) { + + var React = __webpack_require__(2); + var DOMFactories = __webpack_require__(39); + var focusManager = __webpack_require__(42); + var scopeTab = __webpack_require__(44); + var Assign = __webpack_require__(45); + var createReactClass = __webpack_require__(46); + + var div = DOMFactories.div; + + // so that our CSS is statically analyzable + var CLASS_NAMES = { + overlay: 'ReactModal__Overlay', + content: 'ReactModal__Content' + }; + + var ModalPortal = module.exports = createReactClass({ + + displayName: 'ModalPortal', + shouldClose: null, + + getDefaultProps: function() { + return { + style: { + overlay: {}, + content: {} } + }; + }, - return _react2.default.createElement( - 'div', - { className: 'row' }, - toolbar, - modal - ); + 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(); } - }, { - 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'; - } + }, + + 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); + } + }, - 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 - ) - ); + setFocusAfterRender: function (focus) { + this.focusAfterRender = focus; + }, + + afterClose: function () { + focusManager.returnFocus(); + focusManager.teardownScopedFocus(); + }, + + 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(); } - return [searchPanel, searchField, clearBtn]; - } else { - return []; - } + }.bind(this)); } - }, { - 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; + }, + close: function() { + if (this.props.closeTimeoutMS > 0) + this.closeWithTimeout(); + else + this.closeWithoutTimeout(); + }, - var modal = void 0; - modal = insertModal && insertModal(this.handleModalClose, this.handleSaveBtnClick, columns, validateState, ignoreEditable); + focusContent: function() { + // Don't steal focus from inner elements + if (!this.contentHasFocus()) { + this.refs.content.focus(); + } + }, - 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 }); - } + closeWithTimeout: function() { + var closesAt = Date.now() + this.props.closeTimeoutMS; + this.setState({beforeClose: true, closesAt: closesAt}, function() { + this.closeTimer = setTimeout(this.closeWithoutTimeout, this.state.closesAt - Date.now()); + }.bind(this)); + }, - return _react2.default.createElement( - _reactModal2.default, - { className: 'react-bs-insert-modal modal-dialog', - isOpen: this.state.isInsertModalOpen, - onRequestClose: this.handleModalClose, - contentLabel: 'Modal' }, - modal - ); + closeWithoutTimeout: function() { + this.setState({ + beforeClose: false, + isOpen: false, + afterOpen: false, + closesAt: null + }, this.afterClose); + }, + + handleKeyDown: function(event) { + if (event.keyCode == 9 /*tab*/) scopeTab(this.refs.content, event); + if (event.keyCode == 27 /*esc*/) { + event.preventDefault(); + this.requestClose(event); } - }, { - 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; + }, + + handleOverlayOnClick: function (event) { + if (this.shouldClose === null) { + this.shouldClose = true; } - }]); - return ToolBar; - }(_react.Component); + if (this.shouldClose && this.props.shouldCloseOnOverlayClick) { + if (this.ownerHandlesClose()) + this.requestClose(event); + else + this.focusContent(); + } + this.shouldClose = null; + }, - ToolBar.modalSeq = 0; + handleContentOnClick: function () { + this.shouldClose = false; + }, + requestClose: function(event) { + if (this.ownerHandlesClose()) + this.props.onRequestClose(event); + }, - ToolBar.propTypes = { - onAddRow: _propTypes2.default.func, - onDropRow: _propTypes2.default.func, - onShowOnlySelected: _propTypes2.default.func, - enableInsert: _propTypes2.default.bool, - enableDelete: _propTypes2.default.bool, - enableSearch: _propTypes2.default.bool, - enableShowOnlySelected: _propTypes2.default.bool, - columns: _propTypes2.default.array, - searchPlaceholder: _propTypes2.default.string, - exportCSVText: _propTypes2.default.string, - insertText: _propTypes2.default.string, - deleteText: _propTypes2.default.string, - saveText: _propTypes2.default.string, - closeText: _propTypes2.default.string, - clearSearch: _propTypes2.default.bool, - ignoreEditable: _propTypes2.default.bool, - defaultSearch: _propTypes2.default.string, - insertModalHeader: _propTypes2.default.func, - insertModalBody: _propTypes2.default.func, - insertModalFooter: _propTypes2.default.func, - insertModal: _propTypes2.default.func, - insertBtn: _propTypes2.default.func, - deleteBtn: _propTypes2.default.func, - showSelectedOnlyBtn: _propTypes2.default.func, - exportCSVBtn: _propTypes2.default.func, - clearSearchBtn: _propTypes2.default.func, - searchField: _propTypes2.default.func, - searchPanel: _propTypes2.default.func, - btnGroup: _propTypes2.default.func, - toolBar: _propTypes2.default.func, - searchPosition: _propTypes2.default.string, - reset: _propTypes2.default.bool, - isValidKey: _propTypes2.default.func, - insertFailIndicator: _propTypes2.default.string - }; + ownerHandlesClose: function() { + return this.props.onRequestClose; + }, - 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 - }; + shouldBeClosed: function() { + return !this.state.isOpen && !this.state.beforeClose; + }, - var _default = ToolBar; - exports.default = _default; - ; + contentHasFocus: function() { + return document.activeElement === this.refs.content || this.refs.content.contains(document.activeElement); + }, - var _temp = function () { - if (typeof __REACT_HOT_LOADER__ === 'undefined') { - return; - } + buildClassName: function(which, additional) { + var classNames = (typeof additional === 'object') ? additional : { + base: CLASS_NAMES[which], + afterOpen: CLASS_NAMES[which] + "--after-open", + beforeClose: CLASS_NAMES[which] + "--before-close" + }; + var className = classNames.base; + if (this.state.afterOpen) { className += " " + classNames.afterOpen; } + if (this.state.beforeClose) { className += " " + classNames.beforeClose; } + return (typeof additional === 'string' && additional) ? [className, additional].join(" ") : className; + }, - __REACT_HOT_LOADER__.register(ToolBar, 'ToolBar', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/toolbar/ToolBar.js'); + 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 || {}), + onClick: this.handleOverlayOnClick + }, + div({ + ref: "content", + style: Assign({}, contentStyles, this.props.style.content || {}), + className: this.buildClassName('content', this.props.className), + tabIndex: "-1", + onKeyDown: this.handleKeyDown, + onClick: this.handleContentOnClick, + role: this.props.role, + "aria-label": this.props.contentLabel + }, + this.props.children + ) + ) + ); + } + }); - __REACT_HOT_LOADER__.register(_default, 'default', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/toolbar/ToolBar.js'); - }(); - ; +/***/ }), +/* 42 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ }, -/* 36 */ -/***/ function(module, exports, __webpack_require__) { + var findTabbable = __webpack_require__(43); + var focusLaterElements = []; + var modalElement = null; + var needToFocus = false; - module.exports = __webpack_require__(37); + 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() { + focusLaterElements.push(document.activeElement); + }; -/***/ }, -/* 37 */ -/***/ function(module, exports, __webpack_require__) { + exports.returnFocus = function() { + var toFocus = null; + try { + toFocus = focusLaterElements.pop(); + toFocus.focus(); + return; + } + catch (e) { + console.warn('You tried to return focus to '+toFocus+' but it is not in the DOM anymore'); + } + }; - /* WEBPACK VAR INJECTION */(function(process) {var React = __webpack_require__(2); - var ReactDOM = __webpack_require__(14); - var ExecutionEnvironment = __webpack_require__(38); - var ModalPortal = React.createFactory(__webpack_require__(39)); - var ariaAppHider = __webpack_require__(44); - var elementClass = __webpack_require__(45); - var renderSubtreeIntoContainer = __webpack_require__(14).unstable_renderSubtreeIntoContainer; - var Assign = __webpack_require__(43); + exports.setupScopedFocus = function(element) { + modalElement = element; - var SafeHTMLElement = ExecutionEnvironment.canUseDOM ? window.HTMLElement : {}; - var AppElement = ExecutionEnvironment.canUseDOM ? document.body : {appendChild: function() {}}; + if (window.addEventListener) { + window.addEventListener('blur', handleBlur, false); + document.addEventListener('focus', handleFocus, true); + } else { + window.attachEvent('onBlur', handleBlur); + document.attachEvent('onFocus', handleFocus); + } + }; - function getParentElement(parentSelector) { - return parentSelector(); - } + exports.teardownScopedFocus = function() { + modalElement = null; - var Modal = React.createClass({ + if (window.addEventListener) { + window.removeEventListener('blur', handleBlur); + document.removeEventListener('focus', handleFocus); + } else { + window.detachEvent('onBlur', handleBlur); + document.detachEvent('onFocus', handleFocus); + } + }; - 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 - }, +/***/ }), +/* 43 */ +/***/ (function(module, exports) { - getDefaultProps: function () { - return { - isOpen: false, - portalClassName: 'ReactModalPortal', - ariaHideApp: true, - closeTimeoutMS: 0, - shouldCloseOnOverlayClick: true, - parentSelector: function () { return document.body; } - }; - }, + /*! + * 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/ + */ - componentDidMount: function() { - this.node = document.createElement('div'); - this.node.className = this.props.portalClassName; + 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); + } - var parent = getParentElement(this.props.parentSelector); - parent.appendChild(this.node); - this.renderPortal(this.props); - }, + function hidden(el) { + return (el.offsetWidth <= 0 && el.offsetHeight <= 0) || + el.style.display === 'none'; + } - componentWillReceiveProps: function(newProps) { - var currentParent = getParentElement(this.props.parentSelector); - var newParent = getParentElement(newProps.parentSelector); + function visible(element) { + while (element) { + if (element === document.body) break; + if (hidden(element)) return false; + element = element.parentNode; + } + return true; + } - if(newParent !== currentParent) { - currentParent.removeChild(this.node); - newParent.appendChild(this.node); - } + function tabbable(element) { + var tabIndex = element.getAttribute('tabindex'); + if (tabIndex === null) tabIndex = undefined; + var isTabIndexNaN = isNaN(tabIndex); + return (isTabIndexNaN || tabIndex >= 0) && focusable(element, !isTabIndexNaN); + } - this.renderPortal(newProps); - }, + function findTabbableDescendants(element) { + return [].slice.call(element.querySelectorAll('*'), 0).filter(function(el) { + return tabbable(el); + }); + } - componentWillUnmount: function() { - if (this.props.ariaHideApp) { - ariaAppHider.show(this.props.appElement); - } + module.exports = findTabbableDescendants; - 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); - } +/***/ }), +/* 44 */ +/***/ (function(module, exports, __webpack_require__) { - this.portal = renderSubtreeIntoContainer(this, ModalPortal(Assign({}, props, {defaultStyles: Modal.defaultStyles})), this.node); - }, + var findTabbable = __webpack_require__(43); - render: function () { - return React.DOM.noscript(); + 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(); + }; - 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 +/***/ }), +/* 45 */ +/***/ (function(module, exports) { - /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) + /** + * 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 + */ -/***/ }, -/* 38 */ -/***/ function(module, exports, __webpack_require__) { + /** Used as references for various `Number` constants. */ + var MAX_SAFE_INTEGER = 9007199254740991; - var __WEBPACK_AMD_DEFINE_RESULT__;/*! - Copyright (c) 2015 Jed Watson. - Based on code that is Copyright 2013-2015, Facebook, Inc. - All rights reserved. - */ + /** `Object#toString` result references. */ + var argsTag = '[object Arguments]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]'; - (function () { - 'use strict'; + /** Used to detect unsigned integer values. */ + var reIsUint = /^(?:0|[1-9]\d*)$/; - var canUseDOM = !!( - typeof window !== 'undefined' && - window.document && - window.document.createElement - ); + /** + * 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); + } - var ExecutionEnvironment = { + /** + * 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); - canUseDOM: canUseDOM, + while (++index < n) { + result[index] = iteratee(index); + } + return result; + } - canUseWorkers: typeof Worker !== 'undefined', + /** + * 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)); + }; + } - canUseEventListeners: - canUseDOM && !!(window.addEventListener || window.attachEvent), + /** Used for built-in method references. */ + var objectProto = Object.prototype; - canUseViewport: canUseDOM && !!window.screen + /** 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; - 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; - } + /** 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'); -/***/ }, -/* 39 */ -/***/ function(module, exports, __webpack_require__) { + /** + * 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 React = __webpack_require__(2); - var div = React.DOM.div; - var focusManager = __webpack_require__(40); - var scopeTab = __webpack_require__(42); - var Assign = __webpack_require__(43); + var length = result.length, + skipIndexes = !!length; - // 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' + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && (key == 'length' || isIndex(key, length)))) { + result.push(key); + } } - }; - - var ModalPortal = module.exports = React.createClass({ - - displayName: 'ModalPortal', - shouldClose: null, - - getDefaultProps: function() { - return { - style: { - overlay: {}, - content: {} - } - }; - }, + return result; + } - getInitialState: function() { - return { - afterOpen: false, - beforeClose: false - }; - }, + /** + * 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; + } + } - componentDidMount: function() { - // Focus needs to be set when mounting and already open - if (this.props.isOpen) { - this.setFocusAfterRender(true); - this.open(); + /** + * 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); } - }, - - componentWillUnmount: function() { - clearTimeout(this.closeTimer); - }, + } + return result; + } - 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(); - } - }, + /** + * 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); - componentDidUpdate: function () { - if (this.focusAfterRender) { - this.focusContent(); - this.setFocusAfterRender(false); + while (++index < length) { + array[index] = args[start + index]; } - }, - - 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)); + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; } - }, + otherArgs[start] = array; + return apply(func, this, otherArgs); + }; + } - close: function() { - if (!this.ownerHandlesClose()) - return; - if (this.props.closeTimeoutMS > 0) - this.closeWithTimeout(); - else - this.closeWithoutTimeout(); - }, + /** + * 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 = {}); - focusContent: function() { - // Don't steal focus from inner elements - if (!this.contentHasFocus()) { - this.refs.content.focus(); - } - }, + var index = -1, + length = props.length; - closeWithTimeout: function() { - this.setState({beforeClose: true}, function() { - this.closeTimer = setTimeout(this.closeWithoutTimeout, this.props.closeTimeoutMS); - }.bind(this)); - }, + while (++index < length) { + var key = props[index]; - closeWithoutTimeout: function() { - this.setState({ - beforeClose: false, - isOpen: false, - afterOpen: false, - }, this.afterClose); - }, + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; - afterClose: function() { - focusManager.returnFocus(); - focusManager.teardownScopedFocus(); - }, + assignValue(object, key, newValue === undefined ? source[key] : newValue); + } + return object; + } - handleKeyDown: function(event) { - if (event.keyCode == 9 /*tab*/) scopeTab(this.refs.content, event); - if (event.keyCode == 27 /*esc*/) { - event.preventDefault(); - this.requestClose(event); - } - }, + /** + * 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; - handleOverlayMouseDown: function(event) { - if (this.shouldClose === null) { - this.shouldClose = true; - } - }, + customizer = (assigner.length > 3 && typeof customizer == 'function') + ? (length--, customizer) + : undefined; - handleOverlayMouseUp: function(event) { - if (this.shouldClose && this.props.shouldCloseOnOverlayClick) { - if (this.ownerHandlesClose()) - this.requestClose(event); - else - this.focusContent(); + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? undefined : customizer; + length = 1; } - this.shouldClose = null; - }, - - handleContentMouseDown: function(event) { - this.shouldClose = false; - }, + object = Object(object); + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, index, customizer); + } + } + return object; + }); + } - handleContentMouseUp: function(event) { - this.shouldClose = false; - }, + /** + * 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); + } - requestClose: function(event) { - if (this.ownerHandlesClose()) - this.props.onRequestClose(event); - }, + /** + * 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; + } - ownerHandlesClose: function() { - return this.props.onRequestClose; - }, + /** + * 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; - shouldBeClosed: function() { - return !this.props.isOpen && !this.state.beforeClose; - }, + return value === proto; + } - contentHasFocus: function() { - return document.activeElement === this.refs.content || this.refs.content.contains(document.activeElement); - }, + /** + * 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); + } - 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; - }, + /** + * 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); + } - render: function() { - var contentStyles = (this.props.className) ? {} : this.props.defaultStyles.content; - var overlayStyles = (this.props.overlayClassName) ? {} : this.props.defaultStyles.overlay; + /** + * 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; - 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 - ) - ) - ); - } - }); + /** + * 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); + } -/***/ }, -/* 40 */ -/***/ function(module, exports, __webpack_require__) { + /** + * 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; + } - var findTabbable = __webpack_require__(41); - var modalElement = null; - var focusLaterElement = null; - var needToFocus = false; + /** + * 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; + } - function handleBlur(event) { - needToFocus = true; + /** + * 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'); } - function handleFocus(event) { - if (needToFocus) { - needToFocus = false; - if (!modalElement) { - return; + /** + * 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]); } - // 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); } + }); + + /** + * 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); } - exports.markForFocusLater = function() { - focusLaterElement = document.activeElement; - }; + module.exports = assign; - 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; +/***/ }), +/* 46 */ +/***/ (function(module, exports, __webpack_require__) { - if (window.addEventListener) { - window.addEventListener('blur', handleBlur, false); - document.addEventListener('focus', handleFocus, true); - } else { - window.attachEvent('onBlur', handleBlur); - document.attachEvent('onFocus', handleFocus); - } - }; + /** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ - exports.teardownScopedFocus = function() { - modalElement = null; + 'use strict'; - if (window.addEventListener) { - window.removeEventListener('blur', handleBlur); - document.removeEventListener('focus', handleFocus); - } else { - window.detachEvent('onBlur', handleBlur); - document.detachEvent('onFocus', handleFocus); - } - }; + var React = __webpack_require__(2); + var factory = __webpack_require__(47); + if (typeof React === 'undefined') { + throw Error( + 'create-react-class could not find the React object. If you are using script tags, ' + + 'make sure that React is being loaded before create-react-class.' + ); + } + // Hack to grab NoopUpdateQueue from isomorphic React + var ReactNoopUpdateQueue = new React.Component().updater; + module.exports = factory( + React.Component, + React.isValidElement, + ReactNoopUpdateQueue + ); -/***/ }, -/* 41 */ -/***/ function(module, exports) { - /*! - * Adapted from jQuery UI core - * - * http://jqueryui.com +/***/ }), +/* 47 */ +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. * - * Copyright 2014 jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * - * 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); - } + 'use strict'; - function hidden(el) { - return (el.offsetWidth <= 0 && el.offsetHeight <= 0) || - el.style.display === 'none'; - } + var _assign = __webpack_require__(48); - function visible(element) { - while (element) { - if (element === document.body) break; - if (hidden(element)) return false; - element = element.parentNode; - } - return true; + var emptyObject = __webpack_require__(49); + var _invariant = __webpack_require__(7); + + if (process.env.NODE_ENV !== 'production') { + var warning = __webpack_require__(8); } - function tabbable(element) { - var tabIndex = element.getAttribute('tabindex'); - if (tabIndex === null) tabIndex = undefined; - var isTabIndexNaN = isNaN(tabIndex); - return (isTabIndexNaN || tabIndex >= 0) && focusable(element, !isTabIndexNaN); + var MIXINS_KEY = 'mixins'; + + // Helper function to allow the creation of anonymous functions which do not + // have .name set to the name of the variable being assigned to. + function identity(fn) { + return fn; } - function findTabbableDescendants(element) { - return [].slice.call(element.querySelectorAll('*'), 0).filter(function(el) { - return tabbable(el); - }); + var ReactPropTypeLocationNames; + if (process.env.NODE_ENV !== 'production') { + ReactPropTypeLocationNames = { + prop: 'prop', + context: 'context', + childContext: 'child context' + }; + } else { + ReactPropTypeLocationNames = {}; } - module.exports = findTabbableDescendants; + function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) { + /** + * Policies that describe methods in `ReactClassInterface`. + */ + var injectedMixins = []; + /** + * Composite components are higher-level components that compose other composite + * or host components. + * + * To create a new type of `ReactClass`, pass a specification of + * your new class to `React.createClass`. The only requirement of your class + * specification is that you implement a `render` method. + * + * var MyComponent = React.createClass({ + * render: function() { + * return
Hello World
; + * } + * }); + * + * The class specification supports a specific protocol of methods that have + * special meaning (e.g. `render`). See `ReactClassInterface` for + * more the comprehensive protocol. Any other properties and methods in the + * class specification will be available on the prototype. + * + * @interface ReactClassInterface + * @internal + */ + var ReactClassInterface = { + /** + * An array of Mixin objects to include when defining your component. + * + * @type {array} + * @optional + */ + mixins: 'DEFINE_MANY', -/***/ }, -/* 42 */ -/***/ function(module, exports, __webpack_require__) { + /** + * An object containing properties and methods that should be defined on + * the component's constructor instead of its prototype (static methods). + * + * @type {object} + * @optional + */ + statics: 'DEFINE_MANY', - var findTabbable = __webpack_require__(41); + /** + * Definition of prop types for this component. + * + * @type {object} + * @optional + */ + propTypes: 'DEFINE_MANY', - 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(); - }; + /** + * Definition of context types for this component. + * + * @type {object} + * @optional + */ + contextTypes: 'DEFINE_MANY', + /** + * Definition of context types this component sets for its children. + * + * @type {object} + * @optional + */ + childContextTypes: 'DEFINE_MANY', -/***/ }, -/* 43 */ -/***/ function(module, exports) { + // ==== Definition methods ==== - /** - * 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 - */ + /** + * Invoked when the component is mounted. Values in the mapping will be set on + * `this.props` if that prop is not specified (i.e. using an `in` check). + * + * This method is invoked before `getInitialState` and therefore cannot rely + * on `this.state` or use `this.setState`. + * + * @return {object} + * @optional + */ + getDefaultProps: 'DEFINE_MANY_MERGED', - /** Used as references for various `Number` constants. */ - var MAX_SAFE_INTEGER = 9007199254740991; + /** + * Invoked once before the component is mounted. The return value will be used + * as the initial value of `this.state`. + * + * getInitialState: function() { + * return { + * isOn: false, + * fooBaz: new BazFoo() + * } + * } + * + * @return {object} + * @optional + */ + getInitialState: 'DEFINE_MANY_MERGED', - /** `Object#toString` result references. */ - var argsTag = '[object Arguments]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]'; + /** + * @return {object} + * @optional + */ + getChildContext: 'DEFINE_MANY_MERGED', - /** Used to detect unsigned integer values. */ - var reIsUint = /^(?:0|[1-9]\d*)$/; + /** + * Uses props from `this.props` and state from `this.state` to render the + * structure of the component. + * + * No guarantees are made about when or how often this method is invoked, so + * it must not have side effects. + * + * render: function() { + * var name = this.props.name; + * return
Hello, {name}!
; + * } + * + * @return {ReactComponent} + * @required + */ + render: 'DEFINE_ONCE', - /** - * 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); - } + // ==== Delegate methods ==== - /** - * 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); + /** + * Invoked when the component is initially created and about to be mounted. + * This may have side effects, but any external subscriptions or data created + * by this method must be cleaned up in `componentWillUnmount`. + * + * @optional + */ + componentWillMount: 'DEFINE_MANY', + + /** + * Invoked when the component has been mounted and has a DOM representation. + * However, there is no guarantee that the DOM node is in the document. + * + * Use this as an opportunity to operate on the DOM when the component has + * been mounted (initialized and rendered) for the first time. + * + * @param {DOMElement} rootNode DOM element representing the component. + * @optional + */ + componentDidMount: 'DEFINE_MANY', + + /** + * Invoked before the component receives new props. + * + * Use this as an opportunity to react to a prop transition by updating the + * state using `this.setState`. Current props are accessed via `this.props`. + * + * componentWillReceiveProps: function(nextProps, nextContext) { + * this.setState({ + * likesIncreasing: nextProps.likeCount > this.props.likeCount + * }); + * } + * + * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop + * transition may cause a state change, but the opposite is not true. If you + * need it, you are probably looking for `componentWillUpdate`. + * + * @param {object} nextProps + * @optional + */ + componentWillReceiveProps: 'DEFINE_MANY', + + /** + * Invoked while deciding if the component should be updated as a result of + * receiving new props, state and/or context. + * + * Use this as an opportunity to `return false` when you're certain that the + * transition to the new props/state/context will not require a component + * update. + * + * shouldComponentUpdate: function(nextProps, nextState, nextContext) { + * return !equal(nextProps, this.props) || + * !equal(nextState, this.state) || + * !equal(nextContext, this.context); + * } + * + * @param {object} nextProps + * @param {?object} nextState + * @param {?object} nextContext + * @return {boolean} True if the component should update. + * @optional + */ + shouldComponentUpdate: 'DEFINE_ONCE', + + /** + * Invoked when the component is about to update due to a transition from + * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState` + * and `nextContext`. + * + * Use this as an opportunity to perform preparation before an update occurs. + * + * NOTE: You **cannot** use `this.setState()` in this method. + * + * @param {object} nextProps + * @param {?object} nextState + * @param {?object} nextContext + * @param {ReactReconcileTransaction} transaction + * @optional + */ + componentWillUpdate: 'DEFINE_MANY', + + /** + * Invoked when the component's DOM representation has been updated. + * + * Use this as an opportunity to operate on the DOM when the component has + * been updated. + * + * @param {object} prevProps + * @param {?object} prevState + * @param {?object} prevContext + * @param {DOMElement} rootNode DOM element representing the component. + * @optional + */ + componentDidUpdate: 'DEFINE_MANY', + + /** + * Invoked when the component is about to be removed from its parent and have + * its DOM representation destroyed. + * + * Use this as an opportunity to deallocate any external resources. + * + * NOTE: There is no `componentDidUnmount` since your component will have been + * destroyed by that point. + * + * @optional + */ + componentWillUnmount: 'DEFINE_MANY', + + // ==== Advanced methods ==== + + /** + * Updates the component's currently mounted DOM representation. + * + * By default, this implements React's rendering and reconciliation algorithm. + * Sophisticated clients may wish to override this. + * + * @param {ReactReconcileTransaction} transaction + * @internal + * @overridable + */ + updateComponent: 'OVERRIDE_BASE' + }; + + /** + * Mapping from class specification keys to special processing functions. + * + * Although these are declared like instance properties in the specification + * when defining classes using `React.createClass`, they are actually static + * and are accessible on the constructor instead of the prototype. Despite + * being static, they must be defined outside of the "statics" key under + * which all other static methods are defined. + */ + var RESERVED_SPEC_KEYS = { + displayName: function(Constructor, displayName) { + Constructor.displayName = displayName; + }, + mixins: function(Constructor, mixins) { + if (mixins) { + for (var i = 0; i < mixins.length; i++) { + mixSpecIntoComponent(Constructor, mixins[i]); + } + } + }, + childContextTypes: function(Constructor, childContextTypes) { + if (process.env.NODE_ENV !== 'production') { + validateTypeDef(Constructor, childContextTypes, 'childContext'); + } + Constructor.childContextTypes = _assign( + {}, + Constructor.childContextTypes, + childContextTypes + ); + }, + contextTypes: function(Constructor, contextTypes) { + if (process.env.NODE_ENV !== 'production') { + validateTypeDef(Constructor, contextTypes, 'context'); + } + Constructor.contextTypes = _assign( + {}, + Constructor.contextTypes, + contextTypes + ); + }, + /** + * Special case getDefaultProps which should move into statics but requires + * automatic merging. + */ + getDefaultProps: function(Constructor, getDefaultProps) { + if (Constructor.getDefaultProps) { + Constructor.getDefaultProps = createMergedResultFunction( + Constructor.getDefaultProps, + getDefaultProps + ); + } else { + Constructor.getDefaultProps = getDefaultProps; + } + }, + propTypes: function(Constructor, propTypes) { + if (process.env.NODE_ENV !== 'production') { + validateTypeDef(Constructor, propTypes, 'prop'); + } + Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes); + }, + statics: function(Constructor, statics) { + mixStaticSpecIntoComponent(Constructor, statics); + }, + autobind: function() {} + }; + + function validateTypeDef(Constructor, typeDef, location) { + for (var propName in typeDef) { + if (typeDef.hasOwnProperty(propName)) { + // use a warning instead of an _invariant so components + // don't show up in prod but only in __DEV__ + if (process.env.NODE_ENV !== 'production') { + warning( + typeof typeDef[propName] === 'function', + '%s: %s type `%s` is invalid; it must be a function, usually from ' + + 'React.PropTypes.', + Constructor.displayName || 'ReactClass', + ReactPropTypeLocationNames[location], + propName + ); + } + } + } + } - while (++index < n) { - result[index] = iteratee(index); + function validateMethodOverride(isAlreadyDefined, name) { + var specPolicy = ReactClassInterface.hasOwnProperty(name) + ? ReactClassInterface[name] + : null; + + // Disallow overriding of base class methods unless explicitly allowed. + if (ReactClassMixin.hasOwnProperty(name)) { + _invariant( + specPolicy === 'OVERRIDE_BASE', + 'ReactClassInterface: You are attempting to override ' + + '`%s` from your class specification. Ensure that your method names ' + + 'do not overlap with React methods.', + name + ); + } + + // Disallow defining methods more than once unless explicitly allowed. + if (isAlreadyDefined) { + _invariant( + specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED', + 'ReactClassInterface: You are attempting to define ' + + '`%s` on your component more than once. This conflict may be due ' + + 'to a mixin.', + name + ); + } } - 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)); - }; - } + /** + * Mixin helper which handles policy validation and reserved + * specification keys when building React classes. + */ + function mixSpecIntoComponent(Constructor, spec) { + if (!spec) { + if (process.env.NODE_ENV !== 'production') { + var typeofSpec = typeof spec; + var isMixinValid = typeofSpec === 'object' && spec !== null; + + if (process.env.NODE_ENV !== 'production') { + warning( + isMixinValid, + "%s: You're attempting to include a mixin that is either null " + + 'or not an object. Check the mixins included by the component, ' + + 'as well as any mixins they include themselves. ' + + 'Expected object but got %s.', + Constructor.displayName || 'ReactClass', + spec === null ? null : typeofSpec + ); + } + } - /** Used for built-in method references. */ - var objectProto = Object.prototype; + return; + } - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; + _invariant( + typeof spec !== 'function', + "ReactClass: You're attempting to " + + 'use a component class or function as a mixin. Instead, just use a ' + + 'regular object.' + ); + _invariant( + !isValidElement(spec), + "ReactClass: You're attempting to " + + 'use a component as a mixin. Instead, just use a regular object.' + ); - /** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ - var objectToString = objectProto.toString; + var proto = Constructor.prototype; + var autoBindPairs = proto.__reactAutoBindPairs; - /** Built-in value references. */ - var propertyIsEnumerable = objectProto.propertyIsEnumerable; + // By handling mixins before any other properties, we ensure the same + // chaining order is applied to methods with DEFINE_MANY policy, whether + // mixins are listed before or after these methods in the spec. + if (spec.hasOwnProperty(MIXINS_KEY)) { + RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins); + } - /* Built-in method references for those with the same name as other `lodash` methods. */ - var nativeKeys = overArg(Object.keys, Object), - nativeMax = Math.max; + for (var name in spec) { + if (!spec.hasOwnProperty(name)) { + continue; + } - /** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */ - var nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf'); + if (name === MIXINS_KEY) { + // We have already handled mixins in a special case above. + continue; + } - /** - * 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 property = spec[name]; + var isAlreadyDefined = proto.hasOwnProperty(name); + validateMethodOverride(isAlreadyDefined, name); - var length = result.length, - skipIndexes = !!length; + if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) { + RESERVED_SPEC_KEYS[name](Constructor, property); + } else { + // Setup methods on prototype: + // The following member methods should not be automatically bound: + // 1. Expected ReactClass methods (in the "interface"). + // 2. Overridden methods (that were mixed in). + var isReactClassMethod = ReactClassInterface.hasOwnProperty(name); + var isFunction = typeof property === 'function'; + var shouldAutoBind = + isFunction && + !isReactClassMethod && + !isAlreadyDefined && + spec.autobind !== false; + + if (shouldAutoBind) { + autoBindPairs.push(name, property); + proto[name] = property; + } else { + if (isAlreadyDefined) { + var specPolicy = ReactClassInterface[name]; + + // These cases should already be caught by validateMethodOverride. + _invariant( + isReactClassMethod && + (specPolicy === 'DEFINE_MANY_MERGED' || + specPolicy === 'DEFINE_MANY'), + 'ReactClass: Unexpected spec policy %s for key %s ' + + 'when mixing in component specs.', + specPolicy, + name + ); - for (var key in value) { - if ((inherited || hasOwnProperty.call(value, key)) && - !(skipIndexes && (key == 'length' || isIndex(key, length)))) { - result.push(key); + // For methods which are defined more than once, call the existing + // methods before calling the new property, merging if appropriate. + if (specPolicy === 'DEFINE_MANY_MERGED') { + proto[name] = createMergedResultFunction(proto[name], property); + } else if (specPolicy === 'DEFINE_MANY') { + proto[name] = createChainedFunction(proto[name], property); + } + } else { + proto[name] = property; + if (process.env.NODE_ENV !== 'production') { + // Add verbose displayName to the function, which helps when looking + // at profiling tools. + if (typeof property === 'function' && spec.displayName) { + proto[name].displayName = spec.displayName + '_' + name; + } + } + } + } + } } } - 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; - } - } + function mixStaticSpecIntoComponent(Constructor, statics) { + if (!statics) { + return; + } + for (var name in statics) { + var property = statics[name]; + if (!statics.hasOwnProperty(name)) { + continue; + } - /** - * 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); + var isReserved = name in RESERVED_SPEC_KEYS; + _invariant( + !isReserved, + 'ReactClass: You are attempting to define a reserved ' + + 'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' + + 'as an instance property instead; it will still be accessible on the ' + + 'constructor.', + name + ); + + var isInherited = name in Constructor; + _invariant( + !isInherited, + 'ReactClass: You are attempting to define ' + + '`%s` on your component more than once. This conflict may be ' + + 'due to a mixin.', + name + ); + Constructor[name] = property; } } - 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); + /** + * Merge two objects, but throw if both contain the same key. + * + * @param {object} one The first object, which is mutated. + * @param {object} two The second object + * @return {object} one after it has been mutated to contain everything in two. + */ + function mergeIntoWithNoDuplicateKeys(one, two) { + _invariant( + one && two && typeof one === 'object' && typeof two === 'object', + 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.' + ); - while (++index < length) { - array[index] = args[start + index]; - } - index = -1; - var otherArgs = Array(start + 1); - while (++index < start) { - otherArgs[index] = args[index]; + for (var key in two) { + if (two.hasOwnProperty(key)) { + _invariant( + one[key] === undefined, + 'mergeIntoWithNoDuplicateKeys(): ' + + 'Tried to merge two objects with the same key: `%s`. This conflict ' + + 'may be due to a mixin; in particular, this may be caused by two ' + + 'getInitialState() or getDefaultProps() methods returning objects ' + + 'with clashing keys.', + key + ); + one[key] = two[key]; + } } - 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 = {}); + return one; + } - var index = -1, - length = props.length; + /** + * Creates a function that invokes two functions and merges their return values. + * + * @param {function} one Function to invoke first. + * @param {function} two Function to invoke second. + * @return {function} Function that invokes the two argument functions. + * @private + */ + function createMergedResultFunction(one, two) { + return function mergedResult() { + var a = one.apply(this, arguments); + var b = two.apply(this, arguments); + if (a == null) { + return b; + } else if (b == null) { + return a; + } + var c = {}; + mergeIntoWithNoDuplicateKeys(c, a); + mergeIntoWithNoDuplicateKeys(c, b); + return c; + }; + } - while (++index < length) { - var key = props[index]; + /** + * Creates a function that invokes two functions and ignores their return vales. + * + * @param {function} one Function to invoke first. + * @param {function} two Function to invoke second. + * @return {function} Function that invokes the two argument functions. + * @private + */ + function createChainedFunction(one, two) { + return function chainedFunction() { + one.apply(this, arguments); + two.apply(this, arguments); + }; + } - var newValue = customizer - ? customizer(object[key], source[key], key, object, source) - : undefined; + /** + * Binds a method to the component. + * + * @param {object} component Component whose method is going to be bound. + * @param {function} method Method to be bound. + * @return {function} The bound method. + */ + function bindAutoBindMethod(component, method) { + var boundMethod = method.bind(component); + if (process.env.NODE_ENV !== 'production') { + boundMethod.__reactBoundContext = component; + boundMethod.__reactBoundMethod = method; + boundMethod.__reactBoundArguments = null; + var componentName = component.constructor.displayName; + var _bind = boundMethod.bind; + boundMethod.bind = function(newThis) { + for ( + var _len = arguments.length, + args = Array(_len > 1 ? _len - 1 : 0), + _key = 1; + _key < _len; + _key++ + ) { + args[_key - 1] = arguments[_key]; + } + + // User is trying to bind() an autobound method; we effectively will + // ignore the value of "this" that the user is trying to use, so + // let's warn. + if (newThis !== component && newThis !== null) { + if (process.env.NODE_ENV !== 'production') { + warning( + false, + 'bind(): React component methods may only be bound to the ' + + 'component instance. See %s', + componentName + ); + } + } else if (!args.length) { + if (process.env.NODE_ENV !== 'production') { + warning( + false, + 'bind(): You are binding a component method to the component. ' + + 'React does this for you automatically in a high-performance ' + + 'way, so you can safely remove this call. See %s', + componentName + ); + } + return boundMethod; + } + var reboundMethod = _bind.apply(boundMethod, arguments); + reboundMethod.__reactBoundContext = component; + reboundMethod.__reactBoundMethod = method; + reboundMethod.__reactBoundArguments = args; + return reboundMethod; + }; + } + return boundMethod; + } - assignValue(object, key, newValue === undefined ? source[key] : newValue); + /** + * Binds all auto-bound methods in a component. + * + * @param {object} component Component whose method is going to be bound. + */ + function bindAutoBindMethods(component) { + var pairs = component.__reactAutoBindPairs; + for (var i = 0; i < pairs.length; i += 2) { + var autoBindKey = pairs[i]; + var method = pairs[i + 1]; + component[autoBindKey] = bindAutoBindMethod(component, method); + } } - 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; + var IsMountedPreMixin = { + componentDidMount: function() { + this.__isMounted = true; + } + }; - customizer = (assigner.length > 3 && typeof customizer == 'function') - ? (length--, customizer) - : undefined; + var IsMountedPostMixin = { + componentWillUnmount: function() { + this.__isMounted = false; + } + }; - if (guard && isIterateeCall(sources[0], sources[1], guard)) { - customizer = length < 3 ? undefined : customizer; - length = 1; + /** + * Add more to the ReactClass base class. These are all legacy features and + * therefore not already part of the modern ReactComponent. + */ + var ReactClassMixin = { + /** + * TODO: This will be deprecated because state should always keep a consistent + * type signature and the only use case for this, is to avoid that. + */ + replaceState: function(newState, callback) { + this.updater.enqueueReplaceState(this, newState, callback); + }, + + /** + * Checks whether or not this composite component is mounted. + * @return {boolean} True if mounted, false otherwise. + * @protected + * @final + */ + isMounted: function() { + if (process.env.NODE_ENV !== 'production') { + warning( + this.__didWarnIsMounted, + '%s: isMounted is deprecated. Instead, make sure to clean up ' + + 'subscriptions and pending requests in componentWillUnmount to ' + + 'prevent memory leaks.', + (this.constructor && this.constructor.displayName) || + this.name || + 'Component' + ); + this.__didWarnIsMounted = true; + } + return !!this.__isMounted; } - object = Object(object); - while (++index < length) { - var source = sources[index]; - if (source) { - assigner(object, source, index, customizer); + }; + + var ReactClassComponent = function() {}; + _assign( + ReactClassComponent.prototype, + ReactComponent.prototype, + ReactClassMixin + ); + + /** + * Creates a composite component class given a class specification. + * See https://facebook.github.io/react/docs/top-level-api.html#react.createclass + * + * @param {object} spec Class specification (which must define `render`). + * @return {function} Component constructor function. + * @public + */ + function createClass(spec) { + // To keep our warnings more understandable, we'll use a little hack here to + // ensure that Constructor.name !== 'Constructor'. This makes sure we don't + // unnecessarily identify a class without displayName as 'Constructor'. + var Constructor = identity(function(props, context, updater) { + // This constructor gets overridden by mocks. The argument is used + // by mocks to assert on what gets mounted. + + if (process.env.NODE_ENV !== 'production') { + warning( + this instanceof Constructor, + 'Something is calling a React component directly. Use a factory or ' + + 'JSX instead. See: https://fb.me/react-legacyfactory' + ); } - } - 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); - } + // Wire up auto-binding + if (this.__reactAutoBindPairs.length) { + bindAutoBindMethods(this); + } - /** - * 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; - } + this.props = props; + this.context = context; + this.refs = emptyObject; + this.updater = updater || ReactNoopUpdateQueue; - /** - * 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; + this.state = null; - return value === proto; - } + // ReactClasses doesn't have constructors. Instead, they use the + // getInitialState and componentWillMount methods for initialization. - /** - * 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); - } + var initialState = this.getInitialState ? this.getInitialState() : null; + if (process.env.NODE_ENV !== 'production') { + // We allow auto-mocks to proceed as if they're returning null. + if ( + initialState === undefined && + this.getInitialState._isMockFunction + ) { + // This is probably bad practice. Consider warning here and + // deprecating this convenience. + initialState = null; + } + } + _invariant( + typeof initialState === 'object' && !Array.isArray(initialState), + '%s.getInitialState(): must return an object or null', + Constructor.displayName || 'ReactCompositeComponent' + ); - /** - * 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); - } + this.state = initialState; + }); + Constructor.prototype = new ReactClassComponent(); + Constructor.prototype.constructor = Constructor; + Constructor.prototype.__reactAutoBindPairs = []; - /** - * 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; + injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor)); - /** - * 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); - } + mixSpecIntoComponent(Constructor, IsMountedPreMixin); + mixSpecIntoComponent(Constructor, spec); + mixSpecIntoComponent(Constructor, IsMountedPostMixin); - /** - * 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); - } + // Initialize the defaultProps property after all mixins have been merged. + if (Constructor.getDefaultProps) { + Constructor.defaultProps = Constructor.getDefaultProps(); + } - /** - * 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; - } + if (process.env.NODE_ENV !== 'production') { + // This is a tag to indicate that the use of these method names is ok, + // since it's used with createClass. If it's not, then it's likely a + // mistake so we'll warn you to use the static property, property + // initializer or constructor respectively. + if (Constructor.getDefaultProps) { + Constructor.getDefaultProps.isReactClassApproved = {}; + } + if (Constructor.prototype.getInitialState) { + Constructor.prototype.getInitialState.isReactClassApproved = {}; + } + } - /** - * 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; + _invariant( + Constructor.prototype.render, + 'createClass(...): Class specification must implement a `render` method.' + ); + + if (process.env.NODE_ENV !== 'production') { + warning( + !Constructor.prototype.componentShouldUpdate, + '%s has a method called ' + + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + + 'The name is phrased as a question because the function is ' + + 'expected to return a value.', + spec.displayName || 'A component' + ); + warning( + !Constructor.prototype.componentWillRecieveProps, + '%s has a method called ' + + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', + spec.displayName || 'A component' + ); + } + + // Reduce time spent doing lookups by setting these on the prototype. + for (var methodName in ReactClassInterface) { + if (!Constructor.prototype[methodName]) { + Constructor.prototype[methodName] = null; + } + } + + return Constructor; + } + + return createClass; } - /** - * 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'); + module.exports = factory; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4))) + +/***/ }), +/* 48 */ +/***/ (function(module, exports) { + + /* + object-assign + (c) Sindre Sorhus + @license MIT + */ + + 'use strict'; + /* eslint-disable no-unused-vars */ + var getOwnPropertySymbols = Object.getOwnPropertySymbols; + var hasOwnProperty = Object.prototype.hasOwnProperty; + var propIsEnumerable = Object.prototype.propertyIsEnumerable; + + function toObject(val) { + if (val === null || val === undefined) { + throw new TypeError('Object.assign cannot be called with null or undefined'); + } + + return Object(val); } - /** - * 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'; + function shouldUseNative() { + try { + if (!Object.assign) { + return false; + } + + // Detect buggy property enumeration order in older V8 versions. + + // https://bugs.chromium.org/p/v8/issues/detail?id=4118 + var test1 = new String('abc'); // eslint-disable-line no-new-wrappers + test1[5] = 'de'; + if (Object.getOwnPropertyNames(test1)[0] === '5') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test2 = {}; + for (var i = 0; i < 10; i++) { + test2['_' + String.fromCharCode(i)] = i; + } + var order2 = Object.getOwnPropertyNames(test2).map(function (n) { + return test2[n]; + }); + if (order2.join('') !== '0123456789') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test3 = {}; + 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { + test3[letter] = letter; + }); + if (Object.keys(Object.assign({}, test3)).join('') !== + 'abcdefghijklmnopqrst') { + return false; + } + + return true; + } catch (err) { + // We don't expect any of the above to throw, but better to be safe. + return false; + } } - /** - * 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]); - } - } - }); + module.exports = shouldUseNative() ? Object.assign : function (target, source) { + var from; + var to = toObject(target); + var symbols; - /** - * 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; + for (var s = 1; s < arguments.length; s++) { + from = Object(arguments[s]); + + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + + if (getOwnPropertySymbols) { + symbols = getOwnPropertySymbols(from); + for (var i = 0; i < symbols.length; i++) { + if (propIsEnumerable.call(from, symbols[i])) { + to[symbols[i]] = from[symbols[i]]; + } + } + } + } + + return to; + }; + + +/***/ }), +/* 49 */ +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright (c) 2013-present, Facebook, Inc. + * All rights reserved. * - * _.keys(new Foo); - * // => ['a', 'b'] (iteration order is not guaranteed) + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * - * _.keys('hi'); - * // => ['0', '1'] */ - function keys(object) { - return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); - } - module.exports = assign; + 'use strict'; + var emptyObject = {}; -/***/ }, -/* 44 */ -/***/ function(module, exports) { + if (process.env.NODE_ENV !== 'production') { + Object.freeze(emptyObject); + } + + module.exports = emptyObject; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4))) + +/***/ }), +/* 50 */ +/***/ (function(module, exports) { var _element = typeof document !== 'undefined' ? document.body : null; @@ -14553,9 +10732,34 @@ return /******/ (function(modules) { // webpackBootstrap exports.resetForTesting = resetForTesting; -/***/ }, -/* 45 */ -/***/ function(module, exports) { +/***/ }), +/* 51 */ +/***/ (function(module, exports) { + + var modals = []; + + module.exports = { + add: function (element) { + if (modals.indexOf(element) === -1) { + modals.push(element); + } + }, + remove: function (element) { + var index = modals.indexOf(element); + if (index === -1) { + return; + } + modals.splice(index, 1); + }, + count: function () { + return modals.length; + } + }; + + +/***/ }), +/* 52 */ +/***/ (function(module, exports) { module.exports = function(opts) { return new ElementClass(opts) @@ -14618,9 +10822,9 @@ return /******/ (function(modules) { // webpackBootstrap } -/***/ }, -/* 46 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 53 */ +/***/ (function(module, exports, __webpack_require__) { 'use strict'; @@ -14640,15 +10844,15 @@ return /******/ (function(modules) { // webpackBootstrap var _propTypes2 = _interopRequireDefault(_propTypes); - var _InsertModalHeader = __webpack_require__(47); + var _InsertModalHeader = __webpack_require__(54); var _InsertModalHeader2 = _interopRequireDefault(_InsertModalHeader); - var _InsertModalFooter = __webpack_require__(48); + var _InsertModalFooter = __webpack_require__(55); var _InsertModalFooter2 = _interopRequireDefault(_InsertModalFooter); - var _InsertModalBody = __webpack_require__(49); + var _InsertModalBody = __webpack_require__(56); var _InsertModalBody2 = _interopRequireDefault(_InsertModalBody); @@ -14805,9 +11009,9 @@ return /******/ (function(modules) { // webpackBootstrap ; -/***/ }, -/* 47 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 54 */ +/***/ (function(module, exports, __webpack_require__) { 'use strict'; @@ -14943,9 +11147,9 @@ return /******/ (function(modules) { // webpackBootstrap ; -/***/ }, -/* 48 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 55 */ +/***/ (function(module, exports, __webpack_require__) { 'use strict'; @@ -14963,7 +11167,7 @@ return /******/ (function(modules) { // webpackBootstrap var _propTypes2 = _interopRequireDefault(_propTypes); - var _Const = __webpack_require__(12); + var _Const = __webpack_require__(13); var _Const2 = _interopRequireDefault(_Const); @@ -15107,9 +11311,9 @@ return /******/ (function(modules) { // webpackBootstrap ; -/***/ }, -/* 49 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 56 */ +/***/ (function(module, exports, __webpack_require__) { 'use strict'; @@ -15127,7 +11331,7 @@ return /******/ (function(modules) { // webpackBootstrap var _propTypes2 = _interopRequireDefault(_propTypes); - var _Editor = __webpack_require__(22); + var _Editor = __webpack_require__(23); var _Editor2 = _interopRequireDefault(_Editor); @@ -15272,9 +11476,9 @@ return /******/ (function(modules) { // webpackBootstrap ; -/***/ }, -/* 50 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 57 */ +/***/ (function(module, exports, __webpack_require__) { 'use strict'; @@ -15294,7 +11498,7 @@ return /******/ (function(modules) { // webpackBootstrap var _propTypes2 = _interopRequireDefault(_propTypes); - var _Const = __webpack_require__(12); + var _Const = __webpack_require__(13); var _Const2 = _interopRequireDefault(_Const); @@ -15384,9 +11588,9 @@ return /******/ (function(modules) { // webpackBootstrap ; -/***/ }, -/* 51 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 58 */ +/***/ (function(module, exports, __webpack_require__) { 'use strict'; @@ -15406,7 +11610,7 @@ return /******/ (function(modules) { // webpackBootstrap var _propTypes2 = _interopRequireDefault(_propTypes); - var _Const = __webpack_require__(12); + var _Const = __webpack_require__(13); var _Const2 = _interopRequireDefault(_Const); @@ -15497,9 +11701,9 @@ return /******/ (function(modules) { // webpackBootstrap ; -/***/ }, -/* 52 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 59 */ +/***/ (function(module, exports, __webpack_require__) { 'use strict'; @@ -15519,7 +11723,7 @@ return /******/ (function(modules) { // webpackBootstrap var _propTypes2 = _interopRequireDefault(_propTypes); - var _Const = __webpack_require__(12); + var _Const = __webpack_require__(13); var _Const2 = _interopRequireDefault(_Const); @@ -15610,9 +11814,9 @@ return /******/ (function(modules) { // webpackBootstrap ; -/***/ }, -/* 53 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 60 */ +/***/ (function(module, exports, __webpack_require__) { 'use strict'; @@ -15632,7 +11836,7 @@ return /******/ (function(modules) { // webpackBootstrap var _propTypes2 = _interopRequireDefault(_propTypes); - var _Const = __webpack_require__(12); + var _Const = __webpack_require__(13); var _Const2 = _interopRequireDefault(_Const); @@ -15726,9 +11930,9 @@ return /******/ (function(modules) { // webpackBootstrap ; -/***/ }, -/* 54 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 61 */ +/***/ (function(module, exports, __webpack_require__) { 'use strict'; @@ -15748,7 +11952,7 @@ return /******/ (function(modules) { // webpackBootstrap var _propTypes2 = _interopRequireDefault(_propTypes); - var _reactDom = __webpack_require__(14); + var _reactDom = __webpack_require__(15); var _reactDom2 = _interopRequireDefault(_reactDom); @@ -15834,9 +12038,9 @@ return /******/ (function(modules) { // webpackBootstrap ; -/***/ }, -/* 55 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 62 */ +/***/ (function(module, exports, __webpack_require__) { 'use strict'; @@ -15939,9 +12143,9 @@ return /******/ (function(modules) { // webpackBootstrap ; -/***/ }, -/* 56 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 63 */ +/***/ (function(module, exports, __webpack_require__) { 'use strict'; @@ -15959,11 +12163,11 @@ return /******/ (function(modules) { // webpackBootstrap var _propTypes2 = _interopRequireDefault(_propTypes); - var _Const = __webpack_require__(12); + var _Const = __webpack_require__(13); var _Const2 = _interopRequireDefault(_Const); - var _classnames = __webpack_require__(11); + var _classnames = __webpack_require__(12); var _classnames2 = _interopRequireDefault(_classnames); @@ -16095,9 +12299,9 @@ return /******/ (function(modules) { // webpackBootstrap ; -/***/ }, -/* 57 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 64 */ +/***/ (function(module, exports, __webpack_require__) { 'use strict'; @@ -16115,7 +12319,7 @@ return /******/ (function(modules) { // webpackBootstrap /* eslint one-var: 0 */ - var _Const = __webpack_require__(12); + var _Const = __webpack_require__(13); var _Const2 = _interopRequireDefault(_Const); @@ -16939,9 +13143,9 @@ return /******/ (function(modules) { // webpackBootstrap ; -/***/ }, -/* 58 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 65 */ +/***/ (function(module, exports, __webpack_require__) { 'use strict'; @@ -16949,14 +13153,14 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _util = __webpack_require__(18); + var _util = __webpack_require__(19); var _util2 = _interopRequireDefault(_util); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } if (_util2.default.canUseDOM()) { - var filesaver = __webpack_require__(59); + var filesaver = __webpack_require__(66); var saveAs = filesaver.saveAs; } /* eslint block-scoped-var: 0 */ /* eslint vars-on-top: 0 */ @@ -17049,9 +13253,9 @@ return /******/ (function(modules) { // webpackBootstrap ; -/***/ }, -/* 59 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 66 */ +/***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__;"use strict"; @@ -17230,7 +13434,7 @@ return /******/ (function(modules) { // webpackBootstrap if (typeof module !== "undefined" && module.exports) { module.exports.saveAs = saveAs; - } else if ("function" !== "undefined" && __webpack_require__(60) !== null && __webpack_require__(61) !== null) { + } else if ("function" !== "undefined" && __webpack_require__(67) !== null && __webpack_require__(68) !== null) { !(__WEBPACK_AMD_DEFINE_RESULT__ = function () { return saveAs; }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); @@ -17247,24 +13451,24 @@ return /******/ (function(modules) { // webpackBootstrap ; -/***/ }, -/* 60 */ -/***/ function(module, exports) { +/***/ }), +/* 67 */ +/***/ (function(module, exports) { module.exports = function() { throw new Error("define cannot be used indirect"); }; -/***/ }, -/* 61 */ -/***/ function(module, exports) { +/***/ }), +/* 68 */ +/***/ (function(module, exports) { /* WEBPACK VAR INJECTION */(function(__webpack_amd_options__) {module.exports = __webpack_amd_options__; /* WEBPACK VAR INJECTION */}.call(exports, {})) -/***/ }, -/* 62 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 69 */ +/***/ (function(module, exports, __webpack_require__) { 'use strict'; @@ -17277,11 +13481,11 @@ return /******/ (function(modules) { // webpackBootstrap 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 _Const = __webpack_require__(12); + var _Const = __webpack_require__(13); var _Const2 = _interopRequireDefault(_Const); - var _events = __webpack_require__(63); + var _events = __webpack_require__(70); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -17351,9 +13555,9 @@ return /******/ (function(modules) { // webpackBootstrap ; -/***/ }, -/* 63 */ -/***/ function(module, exports) { +/***/ }), +/* 70 */ +/***/ (function(module, exports) { // Copyright Joyent, Inc. and other Node contributors. // @@ -17414,12 +13618,8 @@ return /******/ (function(modules) { // webpackBootstrap er = arguments[1]; if (er instanceof Error) { throw er; // Unhandled 'error' event - } else { - // At least give some kind of context to the user - var err = new Error('Uncaught, unspecified "error" event. (' + er + ')'); - err.context = er; - throw err; } + throw TypeError('Uncaught, unspecified "error" event.'); } } @@ -17442,11 +13642,18 @@ return /******/ (function(modules) { // webpackBootstrap break; // slower default: - args = Array.prototype.slice.call(arguments, 1); + len = arguments.length; + args = new Array(len - 1); + for (i = 1; i < len; i++) + args[i - 1] = arguments[i]; handler.apply(this, args); } } else if (isObject(handler)) { - args = Array.prototype.slice.call(arguments, 1); + len = arguments.length; + args = new Array(len - 1); + for (i = 1; i < len; i++) + args[i - 1] = arguments[i]; + listeners = handler.slice(); len = listeners.length; for (i = 0; i < len; i++) @@ -17484,6 +13691,7 @@ return /******/ (function(modules) { // webpackBootstrap // Check for listener leak if (isObject(this._events[type]) && !this._events[type].warned) { + var m; if (!isUndefined(this._maxListeners)) { m = this._maxListeners; } else { @@ -17605,7 +13813,7 @@ return /******/ (function(modules) { // webpackBootstrap if (isFunction(listeners)) { this.removeListener(type, listeners); - } else if (listeners) { + } else { // LIFO order while (listeners.length) this.removeListener(type, listeners[listeners.length - 1]); @@ -17626,20 +13834,15 @@ return /******/ (function(modules) { // webpackBootstrap return ret; }; - EventEmitter.prototype.listenerCount = function(type) { - if (this._events) { - var evlistener = this._events[type]; - - if (isFunction(evlistener)) - return 1; - else if (evlistener) - return evlistener.length; - } - return 0; - }; - EventEmitter.listenerCount = function(emitter, type) { - return emitter.listenerCount(type); + var ret; + if (!emitter._events || !emitter._events[type]) + ret = 0; + else if (isFunction(emitter._events[type])) + ret = 1; + else + ret = emitter._events[type].length; + return ret; }; function isFunction(arg) { @@ -17659,9 +13862,9 @@ return /******/ (function(modules) { // webpackBootstrap } -/***/ }, -/* 64 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 71 */ +/***/ (function(module, exports, __webpack_require__) { 'use strict'; @@ -17681,35 +13884,35 @@ return /******/ (function(modules) { // webpackBootstrap var _propTypes2 = _interopRequireDefault(_propTypes); - var _classnames = __webpack_require__(11); + var _classnames = __webpack_require__(12); var _classnames2 = _interopRequireDefault(_classnames); - var _Const = __webpack_require__(12); + var _Const = __webpack_require__(13); var _Const2 = _interopRequireDefault(_Const); - var _util = __webpack_require__(18); + var _util = __webpack_require__(19); var _util2 = _interopRequireDefault(_util); - var _Date = __webpack_require__(65); + var _Date = __webpack_require__(72); var _Date2 = _interopRequireDefault(_Date); - var _Text = __webpack_require__(66); + var _Text = __webpack_require__(73); var _Text2 = _interopRequireDefault(_Text); - var _Regex = __webpack_require__(67); + var _Regex = __webpack_require__(74); var _Regex2 = _interopRequireDefault(_Regex); - var _Select = __webpack_require__(68); + var _Select = __webpack_require__(75); var _Select2 = _interopRequireDefault(_Select); - var _Number = __webpack_require__(69); + var _Number = __webpack_require__(76); var _Number2 = _interopRequireDefault(_Number); @@ -18074,9 +14277,9 @@ return /******/ (function(modules) { // webpackBootstrap ; -/***/ }, -/* 65 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 72 */ +/***/ (function(module, exports, __webpack_require__) { 'use strict'; @@ -18094,7 +14297,7 @@ return /******/ (function(modules) { // webpackBootstrap var _propTypes2 = _interopRequireDefault(_propTypes); - var _Const = __webpack_require__(12); + var _Const = __webpack_require__(13); var _Const2 = _interopRequireDefault(_Const); @@ -18302,9 +14505,9 @@ return /******/ (function(modules) { // webpackBootstrap ; -/***/ }, -/* 66 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 73 */ +/***/ (function(module, exports, __webpack_require__) { 'use strict'; @@ -18322,7 +14525,7 @@ return /******/ (function(modules) { // webpackBootstrap var _propTypes2 = _interopRequireDefault(_propTypes); - var _Const = __webpack_require__(12); + var _Const = __webpack_require__(13); var _Const2 = _interopRequireDefault(_Const); @@ -18453,9 +14656,9 @@ return /******/ (function(modules) { // webpackBootstrap ; -/***/ }, -/* 67 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 74 */ +/***/ (function(module, exports, __webpack_require__) { 'use strict'; @@ -18473,7 +14676,7 @@ return /******/ (function(modules) { // webpackBootstrap var _propTypes2 = _interopRequireDefault(_propTypes); - var _Const = __webpack_require__(12); + var _Const = __webpack_require__(13); var _Const2 = _interopRequireDefault(_Const); @@ -18588,9 +14791,9 @@ return /******/ (function(modules) { // webpackBootstrap ; -/***/ }, -/* 68 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 75 */ +/***/ (function(module, exports, __webpack_require__) { 'use strict'; @@ -18608,11 +14811,11 @@ return /******/ (function(modules) { // webpackBootstrap var _propTypes2 = _interopRequireDefault(_propTypes); - var _classnames = __webpack_require__(11); + var _classnames = __webpack_require__(12); var _classnames2 = _interopRequireDefault(_classnames); - var _Const = __webpack_require__(12); + var _Const = __webpack_require__(13); var _Const2 = _interopRequireDefault(_Const); @@ -18787,9 +14990,9 @@ return /******/ (function(modules) { // webpackBootstrap ; -/***/ }, -/* 69 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 76 */ +/***/ (function(module, exports, __webpack_require__) { 'use strict'; @@ -18807,11 +15010,11 @@ return /******/ (function(modules) { // webpackBootstrap var _propTypes2 = _interopRequireDefault(_propTypes); - var _classnames = __webpack_require__(11); + var _classnames = __webpack_require__(12); var _classnames2 = _interopRequireDefault(_classnames); - var _Const = __webpack_require__(12); + var _Const = __webpack_require__(13); var _Const2 = _interopRequireDefault(_Const); @@ -19068,9 +15271,9 @@ return /******/ (function(modules) { // webpackBootstrap ; -/***/ }, -/* 70 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 77 */ +/***/ (function(module, exports, __webpack_require__) { 'use strict'; @@ -19154,7 +15357,7 @@ return /******/ (function(modules) { // webpackBootstrap ; -/***/ } +/***/ }) /******/ ]) }); ; diff --git a/dist/react-bootstrap-table.js.map b/dist/react-bootstrap-table.js.map index bd3b96dd3..dcea8b1b2 100644 --- a/dist/react-bootstrap-table.js.map +++ b/dist/react-bootstrap-table.js.map @@ -1,5 +1 @@ -<<<<<<< HEAD -{"version":3,"file":"react-bootstrap-table.js","sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 0a09106df3c2db7397eb","webpack:///src/index.js","webpack:///src/BootstrapTable.js","webpack:///external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}","webpack:///./~/prop-types/index.js","webpack:///./~/prop-types/factory.js","webpack:///(webpack)/~/node-libs-browser/~/process/browser.js","webpack:///./~/prop-types/~/fbjs/lib/emptyFunction.js","webpack:///./~/prop-types/~/fbjs/lib/invariant.js","webpack:///./~/prop-types/~/fbjs/lib/warning.js","webpack:///./~/prop-types/lib/ReactPropTypesSecret.js","webpack:///./~/prop-types/checkPropTypes.js","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/ExpandRowHeaderColumn.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:///./~/react-s-alert/index.js","webpack:///./~/react-s-alert/dist/SAlert.js","webpack:///./~/react-s-alert/dist/SAlertContent.js","webpack:///./~/react-s-alert/dist/s-alert-parts/s-alert-tools.js","webpack:///./~/react-s-alert/dist/s-alert-parts/s-alert-store.js","webpack:///./~/react-s-alert/dist/SAlertContentTmpl.js","webpack:///./~/react-s-alert/dist/s-alert-parts/s-alert-data-prep.js","webpack:///src/ExpandComponent.js","webpack:///src/pagination/PaginationList.js","webpack:///src/pagination/PageButton.js","webpack:///src/pagination/SizePerPageDropDown.js","webpack:///src/toolbar/ToolBar.js","webpack:///./~/react-modal/lib/index.js","webpack:///./~/react-modal/lib/components/Modal.js","webpack:///./~/react-modal/~/exenv/index.js","webpack:///./~/react-modal/lib/components/ModalPortal.js","webpack:///./~/react-modal/lib/helpers/focusManager.js","webpack:///./~/react-modal/lib/helpers/tabbable.js","webpack:///./~/react-modal/lib/helpers/scopeTab.js","webpack:///./~/react-modal/~/lodash.assign/index.js","webpack:///./~/react-modal/lib/helpers/ariaAppHider.js","webpack:///./~/react-modal/~/element-class/index.js","webpack:///src/toolbar/InsertModal.js","webpack:///src/toolbar/InsertModalHeader.js","webpack:///src/toolbar/InsertModalFooter.js","webpack:///src/toolbar/InsertModalBody.js","webpack:///src/toolbar/InsertButton.js","webpack:///src/toolbar/DeleteButton.js","webpack:///src/toolbar/ExportCSVButton.js","webpack:///src/toolbar/ShowSelectedOnlyButton.js","webpack:///src/toolbar/SearchField.js","webpack:///src/toolbar/ClearSearchButton.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","webpack:///src/toolbar/ButtonGroup.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_14__) {\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 0a09106df3c2db7397eb","import BootstrapTable from './BootstrapTable';\nimport TableHeaderColumn from './TableHeaderColumn';\nimport InsertModalHeader from './toolbar/InsertModalHeader';\nimport InsertModalBody from './toolbar/InsertModalBody';\nimport InsertModalFooter from './toolbar/InsertModalFooter';\nimport InsertButton from './toolbar/InsertButton';\nimport DeleteButton from './toolbar/DeleteButton';\nimport ExportCSVButton from './toolbar/ExportCSVButton';\nimport ShowSelectedOnlyButton from './toolbar/ShowSelectedOnlyButton';\nimport ClearSearchButton from './toolbar/ClearSearchButton';\nimport SearchField from './toolbar/SearchField';\nimport ButtonGroup from './toolbar/ButtonGroup';\nimport SizePerPageDropDown from './pagination/SizePerPageDropDown';\n\nif (typeof window !== 'undefined') {\n window.BootstrapTable = BootstrapTable;\n window.TableHeaderColumn = TableHeaderColumn;\n window.InsertModalHeader = InsertModalHeader;\n window.InsertModalBody = InsertModalBody;\n window.InsertModalFooter = InsertModalFooter;\n window.InsertButton = InsertButton;\n window.DeleteButton = DeleteButton;\n window.ShowSelectedOnlyButton = ShowSelectedOnlyButton;\n window.ExportCSVButton = ExportCSVButton;\n window.ClearSearchButton = ClearSearchButton;\n window.SearchField = SearchField;\n window.ButtonGroup = ButtonGroup;\n window.SizePerPageDropDown = SizePerPageDropDown;\n}\nexport {\n BootstrapTable,\n TableHeaderColumn,\n InsertModalHeader,\n InsertModalBody,\n InsertModalFooter,\n InsertButton,\n DeleteButton,\n ShowSelectedOnlyButton,\n ExportCSVButton,\n ClearSearchButton,\n SearchField,\n ButtonGroup,\n SizePerPageDropDown\n};\n\n\n\n// WEBPACK FOOTER //\n// src/index.js","/* eslint no-alert: 0 */\n/* eslint max-len: 0 */\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\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 exportCSVUtil from './csv_export_util';\nimport { Filter } from './Filter';\nimport Alert from 'react-s-alert';\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 ? this.props.data.slice() : []);\n this.isVerticalScroll = false;\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 x: this.props.keyBoardNav ? 0 : -1,\n y: this.props.keyBoardNav ? 0 : -1\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 === null || column === undefined) {\n // Skip null and undefined value\n return;\n }\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 strictSearch: props.strictSearch,\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\n if (sortName && sortOrder) {\n this.store.setSortInfo(sortOrder, sortName);\n if (!this.allowRemote(Const.REMOTE_SORT)) {\n this.store.sort();\n }\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 (column === null || column === undefined) {\n // Skip null and undefined value\n return;\n }\n\n if (Number(column.props.row) > rowCount) {\n rowCount = Number(column.props.row);\n }\n });\n return React.Children.map(children, (column, i) => {\n if (column === null || column === undefined) {\n // Return null for empty objects\n return null;\n }\n\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 const { pageStartIndex } = this.props.options;\n this.store.clean();\n this.setState(() => {\n return {\n data: this.getTableData(),\n currPage: Util.getFirstPage(pageStartIndex),\n expanding: [],\n sizePerPage: Const.SIZE_PER_PAGE_LIST[0],\n selectedRowKeys: this.store.getSelectedRowKeys(),\n reset: true\n };\n });\n }\n\n componentWillReceiveProps(nextProps) {\n this.initTable(nextProps);\n const { options, selectRow } = nextProps;\n let { replace } = nextProps;\n replace = replace || this.props.replace;\n\n this.store.setData(nextProps.data.slice());\n\n if (!replace) {\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 return {\n data,\n currPage: page,\n sizePerPage,\n reset: false\n };\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 return {\n data,\n currPage: page,\n sizePerPage,\n reset: false\n };\n });\n\n if (this.store.isSearching && options.afterSearch) {\n options.afterSearch(this.store.searchText, this.store.getDataIgnoringPagination());\n }\n\n if (this.store.isFiltering && options.afterColumnFilter) {\n options.afterColumnFilter(this.store.filterObj, this.store.getDataIgnoringPagination());\n }\n }\n\n // If setting the expanded rows is being handled externally\n // then overwrite the current expanded rows.\n if (this.props.options.expanding !== options.expanding) {\n this.setState(() => {\n return {\n expanding: options.expanding || []\n };\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 return {\n selectedRowKeys: copy,\n reset: false\n };\n });\n }\n } else {\n this.reset();\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 if (this.refs && this.refs.body && this.refs.body.refs) {\n this.refs.body.refs.container.removeEventListener('scroll', this._scrollHeader);\n }\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 || Util.isFunction(remote);\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 expandColumnOptions = this.props.expandColumnOptions;\n if (typeof expandColumnOptions.expandColumnBeforeSelectColumn === 'undefined') {\n expandColumnOptions.expandColumnBeforeSelectColumn = true;\n }\n const colGroups = Util.renderColGroup(columns, this.props.selectRow, expandColumnOptions);\n let sortIndicator = this.props.options.sortIndicator;\n if (typeof this.props.options.sortIndicator === 'undefined') sortIndicator = true;\n const { paginationPosition = Const.PAGINATION_POS_BOTTOM } = this.props.options;\n const showPaginationOnTop = paginationPosition !== Const.PAGINATION_POS_BOTTOM;\n const showPaginationOnBottom = paginationPosition !== Const.PAGINATION_POS_TOP;\n\n return (\n
\n { toolBar }\n { showPaginationOnTop ? pagination : null }\n
\n \n { this.props.children }\n \n \n
\n { tableFilter }\n { showPaginationOnBottom ? pagination : null }\n \n
\n );\n }\n\n isSelectAll() {\n if (this.store.isEmpty()) return false;\n const { selectRow: { unselectable, onlyUnselectVisible } } = this.props;\n const keyField = this.store.getKeyField();\n const allRowKeys = onlyUnselectVisible ?\n this.store.get().map(r => r[keyField]) :\n this.store.getAllRowkey();\n let defaultSelectRowKeys = this.store.getSelectedRowKeys();\n\n if (onlyUnselectVisible) {\n defaultSelectRowKeys = defaultSelectRowKeys.filter(x => x !== allRowKeys);\n }\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 return {\n selectedRowKeys: [],\n reset: false\n };\n });\n }\n\n cleanSort() {\n this.store.cleanSortInfo();\n this.setState(() => {\n return {\n reset: false\n };\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 return {\n data: result,\n reset: false\n };\n });\n }\n\n handleExpandRow = (expanding, rowKey, isRowExpanding) => {\n const { onExpand } = this.props.options;\n if (onExpand) {\n onExpand(rowKey, !isRowExpanding);\n }\n this.setState(() => { return { expanding, reset: false }; }, () => {\n this._adjustHeaderWidth();\n });\n }\n\n handlePaginationData = (page, sizePerPage) => {\n const { onPageChange, pageStartIndex } = this.props.options;\n const emptyTable = this.store.isEmpty();\n if (onPageChange) {\n onPageChange(page, sizePerPage);\n }\n\n const state = {\n sizePerPage,\n reset: false\n };\n if (!emptyTable) state.currPage = page;\n this.setState(() => state);\n\n if (this.allowRemote(Const.REMOTE_PAGE) || emptyTable) {\n return;\n }\n\n const result = this.store.page(Util.getNormalizedPage(pageStartIndex, page), sizePerPage).get();\n this.setState(() => { return { 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 handleNavigateCell = ({ x: offSetX, y: offSetY, lastEditCell }) => {\n const { pagination } = this.props;\n let { x, y, currPage } = this.state;\n x += offSetX;\n y += offSetY;\n\n const columns = this.store.getColInfos();\n const visibleRowSize = this.state.data.length;\n const visibleColumnSize = Object.keys(columns).filter(k => !columns[k].hidden).length;\n\n if (y >= visibleRowSize) {\n currPage++;\n const lastPage = pagination ? this.refs.pagination.getLastPage() : -1;\n if (currPage <= lastPage) {\n this.handlePaginationData(currPage, this.state.sizePerPage);\n } else {\n return;\n }\n y = 0;\n } else if (y < 0) {\n currPage--;\n if (currPage > 0) {\n this.handlePaginationData(currPage, this.state.sizePerPage);\n } else {\n return;\n }\n y = visibleRowSize - 1;\n } else if (x >= visibleColumnSize) {\n if ((y + 1) === visibleRowSize) {\n currPage++;\n const lastPage = pagination ? this.refs.pagination.getLastPage() : -1;\n if (currPage <= lastPage) {\n this.handlePaginationData(currPage, this.state.sizePerPage);\n } else {\n return;\n }\n y = 0;\n } else {\n y++;\n }\n x = lastEditCell ? 1 : 0;\n } else if (x < 0) {\n x = visibleColumnSize - 1;\n if (y === 0) {\n currPage--;\n if (currPage > 0) {\n this.handlePaginationData(currPage, this.state.sizePerPage);\n } else {\n return;\n }\n y = this.state.sizePerPage - 1;\n } else {\n y--;\n }\n }\n this.setState(() => {\n return {\n x, y, currPage, reset: false\n };\n });\n }\n\n handleRowClick = (row, rowIndex, columnIndex) => {\n const { options, keyBoardNav } = this.props;\n if (options.onRowClick) {\n options.onRowClick(row, columnIndex);\n }\n if (keyBoardNav) {\n let { clickToNav } = typeof keyBoardNav === 'object' ? keyBoardNav : {};\n clickToNav = clickToNav === false ? clickToNav : true;\n if (clickToNav) {\n this.setState(() => {\n return {\n x: columnIndex,\n y: rowIndex,\n reset: false\n };\n });\n }\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, onlyUnselectVisible } } = this.props;\n let selectedRowKeys = onlyUnselectVisible ? this.state.selectedRowKeys : [];\n let result = true;\n let rows = this.store.get();\n\n // onlyUnselectVisible default is false, #1276\n if (!isSelected && !onlyUnselectVisible) {\n rows = this.store.getRowByKey(this.state.selectedRowKeys);\n }\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 if (Array.isArray(result)) {\n selectedRowKeys = result;\n } else {\n const currentRowKeys = rows.map(r => r[keyField]);\n // onlyUnselectVisible default is false, #1276\n if (onlyUnselectVisible) {\n selectedRowKeys = selectedRowKeys.concat(currentRowKeys);\n } else {\n selectedRowKeys = currentRowKeys;\n }\n }\n } else {\n if (unselectable && selected) {\n selectedRowKeys = selected.filter(r => unselectable.indexOf(r) > -1);\n } else if (onlyUnselectVisible) {\n const currentRowKeys = rows.map(r => r[keyField]);\n selectedRowKeys = selectedRowKeys.filter(k => currentRowKeys.indexOf(k) === -1);\n }\n }\n\n this.store.setSelectedRowKey(selectedRowKeys);\n this.setState(() => { return { selectedRowKeys, reset: false }; });\n }\n }\n\n handleShowOnlySelected = () => {\n this.store.ignoreNonSelected();\n const { pageStartIndex } = this.props.options;\n let result;\n if (this.props.pagination) {\n result = this.store.page(Util.getNormalizedPage(pageStartIndex), this.state.sizePerPage).get();\n } else {\n result = this.store.get();\n }\n this.setState(() => {\n return {\n data: result,\n reset: false,\n currPage: Util.getFirstPage(pageStartIndex)\n };\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 return {\n selectedRowKeys: currSelected,\n reset: false\n };\n });\n }\n }\n\n handleEditCell(newVal, rowIndex, colIndex) {\n const { beforeSaveCell } = this.props.cellEdit;\n const columns = this.getColumnsDescription(this.props);\n const fieldName = columns[colIndex].name;\n\n const invalid = () => {\n this.setState(() => {\n return {\n data: this.store.get(),\n reset: false\n };\n });\n return;\n };\n\n if (beforeSaveCell) {\n const beforeSaveCellCB = result => {\n this.refs.body.cancelEditCell();\n if (result || result === undefined) {\n this.editCell(newVal, rowIndex, colIndex);\n } else {\n invalid();\n }\n };\n const isValid = beforeSaveCell(this.state.data[rowIndex], fieldName, newVal, beforeSaveCellCB);\n if (isValid === false && typeof isValid !== 'undefined') {\n return invalid();\n } else if (isValid === Const.AWAIT_BEFORE_CELL_EDIT) {\n /* eslint consistent-return: 0 */\n return isValid;\n }\n }\n this.editCell(newVal, rowIndex, colIndex);\n }\n\n editCell(newVal, rowIndex, colIndex) {\n const { onCellEdit } = this.props.options;\n const { afterSaveCell } = this.props.cellEdit;\n const columns = this.getColumnsDescription(this.props);\n const fieldName = columns[colIndex].name;\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 return {\n data: result,\n reset: false\n };\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 let isAsync = false;\n const { onAddRow } = this.props.options;\n\n const afterHandleAddRow = errMsg => {\n if (isAsync) {\n this.refs.toolbar.afterHandleSaveBtnClick(errMsg);\n } else {\n return errMsg;\n }\n };\n\n const afterAddRowCB = errMsg => {\n if (typeof errMsg !== 'undefined' && errMsg !== '') return afterHandleAddRow(errMsg);\n if (this.allowRemote(Const.REMOTE_INSERT_ROW)) {\n if (this.props.options.afterInsertRow) {\n this.props.options.afterInsertRow(newObj);\n }\n return afterHandleAddRow();\n }\n\n try {\n this.store.add(newObj);\n } catch (e) {\n return afterHandleAddRow(e.message);\n }\n this._handleAfterAddingRow(newObj, false);\n return afterHandleAddRow();\n };\n\n if (onAddRow) {\n const colInfos = this.store.getColInfos();\n const errMsg = onAddRow(newObj, colInfos, afterAddRowCB);\n\n if (errMsg !== '' && errMsg !== false) {\n return errMsg;\n } else if (typeof errMsg === 'undefined') {\n return afterAddRowCB();\n } else {\n isAsync = true;\n return !isAsync;\n }\n } else {\n return afterAddRowCB();\n }\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 dropRow = this.store.getRowByKey(dropRowKeys);\n const { onDeleteRow, afterDeleteRow } = this.props.options;\n\n if (onDeleteRow) {\n onDeleteRow(dropRowKeys, dropRow);\n }\n\n this.store.setSelectedRowKey([]); // clear selected row key\n\n if (this.allowRemote(Const.REMOTE_DROP_ROW) && afterDeleteRow) {\n afterDeleteRow(dropRowKeys, dropRow);\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(Util.getNormalizedPage(currPage), sizePerPage).get();\n this.setState(() => {\n return {\n data: result,\n selectedRowKeys: this.store.getSelectedRowKeys(),\n currPage,\n reset: false\n };\n });\n } else {\n result = this.store.get();\n this.setState(() => {\n return {\n data: result,\n reset: false,\n selectedRowKeys: this.store.getSelectedRowKeys()\n };\n });\n }\n if (afterDeleteRow) {\n afterDeleteRow(dropRowKeys, dropRow);\n }\n }\n\n handleFilterData = filterObj => {\n const { onFilterChange, pageStartIndex } = this.props.options;\n if (onFilterChange) {\n const colInfos = this.store.getColInfos();\n onFilterChange(filterObj, colInfos);\n }\n\n this.setState(() => {\n return {\n currPage: Util.getFirstPage(pageStartIndex),\n reset: false\n };\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(Util.getNormalizedPage(pageStartIndex), 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 return {\n data: result,\n reset: false\n };\n });\n }\n\n handleExportCSV = () => {\n let result = {};\n\n let { csvFileName } = this.props;\n const { onExportToCSV, exportCSVSeparator, noAutoBOM, excludeCSVHeader } = this.props.options;\n if (onExportToCSV) {\n result = onExportToCSV();\n } else {\n result = this.store.getDataIgnoringPagination();\n }\n const separator = exportCSVSeparator || Const.DEFAULT_CSV_SEPARATOR;\n const keys = [];\n this.props.children.filter(_ => _ != null).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 extraData: column.props.csvFormatExtraData,\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 (Util.isFunction(csvFileName)) {\n csvFileName = csvFileName();\n }\n\n exportCSVUtil(result, keys, csvFileName, separator, noAutoBOM || true, excludeCSVHeader);\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, pageStartIndex } = 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 return {\n currPage: Util.getFirstPage(pageStartIndex),\n reset: false\n };\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(Util.getNormalizedPage(pageStartIndex), 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 return {\n data: result,\n reset: false\n };\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 const withFirstAndLast = options.withFirstAndLast === undefined ? true : options.withFirstAndLast;\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 { exportCSV, selectRow, insertRow, deleteRow, search, children, keyField } = this.props;\n const enableShowOnlySelected = selectRow && selectRow.showOnlySelected;\n const print = typeof this.props.options.printToolBar === 'undefined' ?\n true : this.props.options.printToolBar;\n if (enableShowOnlySelected\n || insertRow\n || deleteRow\n || search\n || exportCSV\n || this.props.options.searchPanel\n || this.props.options.btnGroup\n || this.props.options.toolBar) {\n let columns;\n if (Array.isArray(children)) {\n columns = children.filter(_ => _ != null).map((column, r) => {\n if (!column) return;\n const { props } = column;\n const isKey = props.isKey || keyField === props.dataField;\n return {\n isKey,\n name: props.headerText || props.children,\n field: props.dataField,\n hiddenOnInsert: props.hiddenOnInsert,\n keyValidator: props.keyValidator,\n customInsertEditor: props.customInsertEditor,\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 && (Util.isFunction(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 customInsertEditor: children.props.customInsertEditor,\n hiddenOnInsert: children.props.hiddenOnInsert,\n keyValidator: children.props.keyValidator\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 || this.isVerticalScroll !== 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 for (const i in bodyHeader) {\n if (bodyHeader.hasOwnProperty(i)) {\n const child = bodyHeader[i];\n if (child.style) {\n if (child.style.width) {\n header[i].style.width = child.style.width;\n }\n if (child.style.minWidth) {\n header[i].style.minWidth = child.style.minWidth;\n }\n }\n }\n }\n }\n this.isVerticalScroll = isScroll;\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 { pageStartIndex } = this.props.options;\n result = this.store.page(Util.getNormalizedPage(pageStartIndex), sizePerPage).get();\n this.setState(() => {\n return {\n data: result,\n currPage: Util.getFirstPage(pageStartIndex),\n reset: false\n };\n });\n } else {\n const currLastPage = Math.ceil(this.store.getDataNum() / sizePerPage);\n result = this.store.page(currLastPage, sizePerPage).get();\n this.setState(() => {\n return {\n data: result,\n currPage: currLastPage,\n reset: false\n };\n });\n }\n } else {\n result = this.store.get();\n this.setState(() => {\n return {\n data: result,\n reset: false\n };\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 replace: PropTypes.oneOfType([ PropTypes.bool, PropTypes.func ]),\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 keyBoardNav: PropTypes.oneOfType([ PropTypes.bool, PropTypes.object ]),\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.oneOfType([ PropTypes.string, PropTypes.func ]),\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 onlyUnselectVisible: PropTypes.bool\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 multiColumnSearch: PropTypes.bool,\n strictSearch: 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 paginationPosition: PropTypes.oneOf([\n Const.PAGINATION_POS_TOP,\n Const.PAGINATION_POS_BOTTOM,\n Const.PAGINATION_POS_BOTH\n ]),\n hideSizePerPage: PropTypes.bool,\n hidePageListOnlyOnePage: PropTypes.bool,\n alwaysShowAllBtns: PropTypes.bool,\n withFirstAndLast: PropTypes.bool,\n keepSizePerPageState: PropTypes.bool,\n onSortChange: PropTypes.func,\n onPageChange: PropTypes.func,\n onSizePerPageList: PropTypes.func,\n onFilterChange: PropTypes.func,\n onSearchChange: PropTypes.func,\n onAddRow: PropTypes.func,\n onExportToCSV: PropTypes.func,\n onCellEdit: PropTypes.func,\n noDataText: PropTypes.oneOfType([ PropTypes.string, PropTypes.object ]),\n withoutNoDataText: PropTypes.bool,\n handleConfirmDeleteRow: PropTypes.func,\n prePage: PropTypes.any,\n nextPage: PropTypes.any,\n firstPage: PropTypes.any,\n lastPage: PropTypes.any,\n prePageTitle: PropTypes.string,\n nextPageTitle: PropTypes.string,\n firstPageTitle: PropTypes.string,\n lastPageTitle: PropTypes.string,\n searchDelayTime: PropTypes.number,\n excludeCSVHeader: PropTypes.bool,\n exportCSVText: PropTypes.string,\n exportCSVSeparator: 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 insertModalHeader: PropTypes.func,\n insertModalBody: PropTypes.func,\n insertModalFooter: PropTypes.func,\n insertModal: PropTypes.func,\n insertBtn: PropTypes.func,\n deleteBtn: PropTypes.func,\n showSelectedOnlyBtn: PropTypes.func,\n exportCSVBtn: PropTypes.func,\n clearSearchBtn: PropTypes.func,\n searchField: PropTypes.func,\n searchPanel: PropTypes.func,\n btnGroup: PropTypes.func,\n toolBar: PropTypes.func,\n sizePerPageDropDown: PropTypes.func,\n paginationPanel: PropTypes.func,\n searchPosition: PropTypes.string,\n expandRowBgColor: PropTypes.string,\n expandBy: PropTypes.string,\n expanding: PropTypes.array,\n onExpand: PropTypes.func,\n onlyOneExpanding: PropTypes.bool,\n expandBodyClass: PropTypes.oneOfType([ PropTypes.string, PropTypes.func ]),\n expandParentClass: PropTypes.oneOfType([ PropTypes.string, PropTypes.func ]),\n beforeShowError: PropTypes.func,\n printToolBar: PropTypes.bool,\n insertFailIndicator: PropTypes.string,\n noAutoBOM: PropTypes.bool\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 expandColumnOptions: PropTypes.shape({\n columnWidth: PropTypes.oneOfType([ PropTypes.number, PropTypes.string ]),\n expandColumnVisible: PropTypes.bool,\n expandColumnComponent: PropTypes.func,\n expandColumnBeforeSelectColumn: PropTypes.bool\n })\n};\nBootstrapTable.defaultProps = {\n replace: false,\n scrollTop: undefined,\n expandComponent: undefined,\n expandableRow: undefined,\n expandColumnOptions: {\n expandColumnVisible: false,\n expandColumnComponent: undefined,\n expandColumnBeforeSelectColumn: true\n },\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 keyBoardNav: 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 onlyUnselectVisible: false\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 strictSearch: undefined,\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 paginationPosition: Const.PAGINATION_POS_BOTTOM,\n hideSizePerPage: false,\n hidePageListOnlyOnePage: false,\n alwaysShowAllBtns: false,\n withFirstAndLast: true,\n keepSizePerPageState: 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 prePageTitle: Const.PRE_PAGE_TITLE,\n nextPageTitle: Const.NEXT_PAGE_TITLE,\n firstPageTitle: Const.FIRST_PAGE_TITLE,\n lastPageTitle: Const.LAST_PAGE_TITLE,\n pageStartIndex: 1,\n searchDelayTime: undefined,\n excludeCSVHeader: false,\n exportCSVText: Const.EXPORT_CSV_TEXT,\n exportCSVSeparator: Const.DEFAULT_CSV_SEPARATOR,\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 insertModalHeader: undefined,\n insertModalBody: undefined,\n insertModalFooter: undefined,\n insertModal: undefined,\n insertBtn: undefined,\n deleteBtn: undefined,\n showSelectedOnlyBtn: undefined,\n exportCSVBtn: undefined,\n clearSearchBtn: undefined,\n searchField: undefined,\n searchPanel: undefined,\n btnGroup: undefined,\n toolBar: undefined,\n sizePerPageDropDown: undefined,\n paginationPanel: undefined,\n searchPosition: 'right',\n expandRowBgColor: undefined,\n expandBy: Const.EXPAND_BY_ROW,\n expanding: [],\n onExpand: undefined,\n onlyOneExpanding: false,\n expandBodyClass: null,\n expandParentClass: null,\n beforeShowError: undefined,\n printToolBar: true,\n insertFailIndicator: Const.INSERT_FAIL_INDICATOR,\n noAutoBOM: true\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 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\nvar factory = require('./factory');\n\nvar REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&\n Symbol.for &&\n Symbol.for('react.element')) ||\n 0xeac7;\n\nfunction isValidElement(object) {\n return typeof object === 'object' &&\n object !== null &&\n object.$$typeof === REACT_ELEMENT_TYPE;\n}\n\nmodule.exports = factory(isValidElement);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/prop-types/index.js\n// module id = 3\n// module chunks = 0","/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n'use strict';\n\nvar emptyFunction = require('fbjs/lib/emptyFunction');\nvar invariant = require('fbjs/lib/invariant');\nvar warning = require('fbjs/lib/warning');\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\nvar checkPropTypes = require('./checkPropTypes');\n\nmodule.exports = function (isValidElement) {\n /* global Symbol */\n var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\n var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.\n\n /**\n * Returns the iterator method function contained on the iterable object.\n *\n * Be sure to invoke the function with the iterable as context:\n *\n * var iteratorFn = getIteratorFn(myIterable);\n * if (iteratorFn) {\n * var iterator = iteratorFn.call(myIterable);\n * ...\n * }\n *\n * @param {?object} maybeIterable\n * @return {?function}\n */\n function getIteratorFn(maybeIterable) {\n var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);\n if (typeof iteratorFn === 'function') {\n return iteratorFn;\n }\n }\n\n /**\n * Collection of methods that allow declaration and validation of props that are\n * supplied to React components. Example usage:\n *\n * var Props = require('ReactPropTypes');\n * var MyArticle = React.createClass({\n * propTypes: {\n * // An optional string prop named \"description\".\n * description: Props.string,\n *\n * // A required enum prop named \"category\".\n * category: Props.oneOf(['News','Photos']).isRequired,\n *\n * // A prop named \"dialog\" that requires an instance of Dialog.\n * dialog: Props.instanceOf(Dialog).isRequired\n * },\n * render: function() { ... }\n * });\n *\n * A more formal specification of how these methods are used:\n *\n * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)\n * decl := ReactPropTypes.{type}(.isRequired)?\n *\n * Each and every declaration produces a function with the same signature. This\n * allows the creation of custom validation functions. For example:\n *\n * var MyLink = React.createClass({\n * propTypes: {\n * // An optional string or URI prop named \"href\".\n * href: function(props, propName, componentName) {\n * var propValue = props[propName];\n * if (propValue != null && typeof propValue !== 'string' &&\n * !(propValue instanceof URI)) {\n * return new Error(\n * 'Expected a string or an URI for ' + propName + ' in ' +\n * componentName\n * );\n * }\n * }\n * },\n * render: function() {...}\n * });\n *\n * @internal\n */\n\n var ANONYMOUS = '<>';\n\n var ReactPropTypes;\n\n if (process.env.NODE_ENV !== 'production') {\n // Keep in sync with production version below\n ReactPropTypes = {\n array: createPrimitiveTypeChecker('array'),\n bool: createPrimitiveTypeChecker('boolean'),\n func: createPrimitiveTypeChecker('function'),\n number: createPrimitiveTypeChecker('number'),\n object: createPrimitiveTypeChecker('object'),\n string: createPrimitiveTypeChecker('string'),\n symbol: createPrimitiveTypeChecker('symbol'),\n\n any: createAnyTypeChecker(),\n arrayOf: createArrayOfTypeChecker,\n element: createElementTypeChecker(),\n instanceOf: createInstanceTypeChecker,\n node: createNodeChecker(),\n objectOf: createObjectOfTypeChecker,\n oneOf: createEnumTypeChecker,\n oneOfType: createUnionTypeChecker,\n shape: createShapeTypeChecker\n };\n } else {\n var productionTypeChecker = function () {\n invariant(false, 'React.PropTypes type checking code is stripped in production.');\n };\n productionTypeChecker.isRequired = productionTypeChecker;\n var getProductionTypeChecker = function () {\n return productionTypeChecker;\n };\n // Keep in sync with development version above\n ReactPropTypes = {\n array: productionTypeChecker,\n bool: productionTypeChecker,\n func: productionTypeChecker,\n number: productionTypeChecker,\n object: productionTypeChecker,\n string: productionTypeChecker,\n symbol: productionTypeChecker,\n\n any: productionTypeChecker,\n arrayOf: getProductionTypeChecker,\n element: productionTypeChecker,\n instanceOf: getProductionTypeChecker,\n node: productionTypeChecker,\n objectOf: getProductionTypeChecker,\n oneOf: getProductionTypeChecker,\n oneOfType: getProductionTypeChecker,\n shape: getProductionTypeChecker\n };\n }\n\n /**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\n /*eslint-disable no-self-compare*/\n function is(x, y) {\n // SameValue algorithm\n if (x === y) {\n // Steps 1-5, 7-10\n // Steps 6.b-6.e: +0 != -0\n return x !== 0 || 1 / x === 1 / y;\n } else {\n // Step 6.a: NaN == NaN\n return x !== x && y !== y;\n }\n }\n /*eslint-enable no-self-compare*/\n\n /**\n * We use an Error-like object for backward compatibility as people may call\n * PropTypes directly and inspect their output. However, we don't use real\n * Errors anymore. We don't inspect their stack anyway, and creating them\n * is prohibitively expensive if they are created too often, such as what\n * happens in oneOfType() for any type before the one that matched.\n */\n function PropTypeError(message) {\n this.message = message;\n this.stack = '';\n }\n // Make `instanceof Error` still work for returned errors.\n PropTypeError.prototype = Error.prototype;\n\n function createChainableTypeChecker(validate) {\n if (process.env.NODE_ENV !== 'production') {\n var manualPropTypeCallCache = {};\n }\n function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {\n componentName = componentName || ANONYMOUS;\n propFullName = propFullName || propName;\n if (process.env.NODE_ENV !== 'production') {\n if (secret !== ReactPropTypesSecret && typeof console !== 'undefined') {\n var cacheKey = componentName + ':' + propName;\n if (!manualPropTypeCallCache[cacheKey]) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'You are manually calling a React.PropTypes validation ' + 'function for the `%s` prop on `%s`. This is deprecated ' + 'and will not work in production with the next major version. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.', propFullName, componentName) : void 0;\n manualPropTypeCallCache[cacheKey] = true;\n }\n }\n }\n if (props[propName] == null) {\n if (isRequired) {\n if (props[propName] === null) {\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));\n }\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));\n }\n return null;\n } else {\n return validate(props, propName, componentName, location, propFullName);\n }\n }\n\n var chainedCheckType = checkType.bind(null, false);\n chainedCheckType.isRequired = checkType.bind(null, true);\n\n return chainedCheckType;\n }\n\n function createPrimitiveTypeChecker(expectedType) {\n function validate(props, propName, componentName, location, propFullName, secret) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== expectedType) {\n // `propValue` being instance of, say, date/regexp, pass the 'object'\n // check, but we can offer a more precise error message here rather than\n // 'of type `object`'.\n var preciseType = getPreciseType(propValue);\n\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createAnyTypeChecker() {\n return createChainableTypeChecker(emptyFunction.thatReturnsNull);\n }\n\n function createArrayOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');\n }\n var propValue = props[propName];\n if (!Array.isArray(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));\n }\n for (var i = 0; i < propValue.length; i++) {\n var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createElementTypeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n if (!isValidElement(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createInstanceTypeChecker(expectedClass) {\n function validate(props, propName, componentName, location, propFullName) {\n if (!(props[propName] instanceof expectedClass)) {\n var expectedClassName = expectedClass.name || ANONYMOUS;\n var actualClassName = getClassName(props[propName]);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createEnumTypeChecker(expectedValues) {\n if (!Array.isArray(expectedValues)) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0;\n return emptyFunction.thatReturnsNull;\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n for (var i = 0; i < expectedValues.length; i++) {\n if (is(propValue, expectedValues[i])) {\n return null;\n }\n }\n\n var valuesString = JSON.stringify(expectedValues);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));\n }\n return createChainableTypeChecker(validate);\n }\n\n function createObjectOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');\n }\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));\n }\n for (var key in propValue) {\n if (propValue.hasOwnProperty(key)) {\n var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createUnionTypeChecker(arrayOfTypeCheckers) {\n if (!Array.isArray(arrayOfTypeCheckers)) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;\n return emptyFunction.thatReturnsNull;\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {\n return null;\n }\n }\n\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));\n }\n return createChainableTypeChecker(validate);\n }\n\n function createNodeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n if (!isNode(props[propName])) {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createShapeTypeChecker(shapeTypes) {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n }\n for (var key in shapeTypes) {\n var checker = shapeTypes[key];\n if (!checker) {\n continue;\n }\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function isNode(propValue) {\n switch (typeof propValue) {\n case 'number':\n case 'string':\n case 'undefined':\n return true;\n case 'boolean':\n return !propValue;\n case 'object':\n if (Array.isArray(propValue)) {\n return propValue.every(isNode);\n }\n if (propValue === null || isValidElement(propValue)) {\n return true;\n }\n\n var iteratorFn = getIteratorFn(propValue);\n if (iteratorFn) {\n var iterator = iteratorFn.call(propValue);\n var step;\n if (iteratorFn !== propValue.entries) {\n while (!(step = iterator.next()).done) {\n if (!isNode(step.value)) {\n return false;\n }\n }\n } else {\n // Iterator will provide entry [k,v] tuples rather than values.\n while (!(step = iterator.next()).done) {\n var entry = step.value;\n if (entry) {\n if (!isNode(entry[1])) {\n return false;\n }\n }\n }\n }\n } else {\n return false;\n }\n\n return true;\n default:\n return false;\n }\n }\n\n function isSymbol(propType, propValue) {\n // Native Symbol.\n if (propType === 'symbol') {\n return true;\n }\n\n // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'\n if (propValue['@@toStringTag'] === 'Symbol') {\n return true;\n }\n\n // Fallback for non-spec compliant Symbols which are polyfilled.\n if (typeof Symbol === 'function' && propValue instanceof Symbol) {\n return true;\n }\n\n return false;\n }\n\n // Equivalent of `typeof` but with special handling for array and regexp.\n function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }\n\n // This handles more types than `getPropType`. Only used for error messages.\n // See `createPrimitiveTypeChecker`.\n function getPreciseType(propValue) {\n var propType = getPropType(propValue);\n if (propType === 'object') {\n if (propValue instanceof Date) {\n return 'date';\n } else if (propValue instanceof RegExp) {\n return 'regexp';\n }\n }\n return propType;\n }\n\n // Returns class name of the object, if any.\n function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }\n\n ReactPropTypes.checkPropTypes = checkPropTypes;\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/prop-types/factory.js\n// module id = 4\n// module chunks = 0","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// (webpack)/~/node-libs-browser/~/process/browser.js\n// module id = 5\n// module chunks = 0","\"use strict\";\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * \n */\n\nfunction makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}\n\n/**\n * This function accepts and discards inputs; it has no side effects. This is\n * primarily useful idiomatically for overridable function endpoints which\n * always need to be callable, since JS lacks a null-call idiom ala Cocoa.\n */\nvar emptyFunction = function emptyFunction() {};\n\nemptyFunction.thatReturns = makeEmptyFunction;\nemptyFunction.thatReturnsFalse = makeEmptyFunction(false);\nemptyFunction.thatReturnsTrue = makeEmptyFunction(true);\nemptyFunction.thatReturnsNull = makeEmptyFunction(null);\nemptyFunction.thatReturnsThis = function () {\n return this;\n};\nemptyFunction.thatReturnsArgument = function (arg) {\n return arg;\n};\n\nmodule.exports = emptyFunction;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/prop-types/~/fbjs/lib/emptyFunction.js\n// module id = 6\n// module chunks = 0","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n'use strict';\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar validateFormat = function validateFormat(format) {};\n\nif (process.env.NODE_ENV !== 'production') {\n validateFormat = function validateFormat(format) {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n };\n}\n\nfunction invariant(condition, format, a, b, c, d, e, f) {\n validateFormat(format);\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(format.replace(/%s/g, function () {\n return args[argIndex++];\n }));\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n}\n\nmodule.exports = invariant;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/prop-types/~/fbjs/lib/invariant.js\n// module id = 7\n// module chunks = 0","/**\n * Copyright 2014-2015, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n'use strict';\n\nvar emptyFunction = require('./emptyFunction');\n\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar warning = emptyFunction;\n\nif (process.env.NODE_ENV !== 'production') {\n (function () {\n var printWarning = function printWarning(format) {\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n var argIndex = 0;\n var message = 'Warning: ' + format.replace(/%s/g, function () {\n return args[argIndex++];\n });\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n };\n\n warning = function warning(condition, format) {\n if (format === undefined) {\n throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');\n }\n\n if (format.indexOf('Failed Composite propType: ') === 0) {\n return; // Ignore CompositeComponent proptype check.\n }\n\n if (!condition) {\n for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {\n args[_key2 - 2] = arguments[_key2];\n }\n\n printWarning.apply(undefined, [format].concat(args));\n }\n };\n })();\n}\n\nmodule.exports = warning;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/prop-types/~/fbjs/lib/warning.js\n// module id = 8\n// module chunks = 0","/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/prop-types/lib/ReactPropTypesSecret.js\n// module id = 9\n// module chunks = 0","/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n'use strict';\n\nvar invariant = require('fbjs/lib/invariant');\nvar warning = require('fbjs/lib/warning');\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nvar loggedTypeFailures = {};\n\n/**\n * Assert that the values match with the type specs.\n * Error messages are memorized and will only be shown once.\n *\n * @param {object} typeSpecs Map of name to a ReactPropType\n * @param {object} values Runtime values that need to be type-checked\n * @param {string} location e.g. \"prop\", \"context\", \"child context\"\n * @param {string} componentName Name of the component for error messages.\n * @param {?Function} getStack Returns the component stack.\n * @private\n */\nfunction checkPropTypes(typeSpecs, values, location, componentName, getStack) {\n if (process.env.NODE_ENV !== 'production') {\n for (var typeSpecName in typeSpecs) {\n if (typeSpecs.hasOwnProperty(typeSpecName)) {\n var error;\n // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', location, typeSpecName);\n error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);\n } catch (ex) {\n error = ex;\n }\n process.env.NODE_ENV !== 'production' ? warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error) : void 0;\n if (error instanceof Error && !(error.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error.message] = true;\n\n var stack = getStack ? getStack() : '';\n\n process.env.NODE_ENV !== 'production' ? warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '') : void 0;\n }\n }\n }\n }\n}\n\nmodule.exports = checkPropTypes;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/prop-types/checkPropTypes.js\n// module id = 10\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 = 11\n// module chunks = 0","const CONST_VAR = {\n SORT_DESC: 'desc',\n SORT_ASC: 'asc',\n AWAIT_BEFORE_CELL_EDIT: 1,\n SIZE_PER_PAGE: 10,\n NEXT_PAGE: '>',\n NEXT_PAGE_TITLE: 'next page',\n LAST_PAGE: '>>',\n LAST_PAGE_TITLE: 'last page',\n PRE_PAGE: '<',\n PRE_PAGE_TITLE: 'previous page',\n FIRST_PAGE: '<<',\n FIRST_PAGE_TITLE: '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 PAGINATION_POS_TOP: 'top',\n PAGINATION_POS_BOTTOM: 'bottom',\n PAGINATION_POS_BOTH: 'both',\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 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 INSERT_FAIL_INDICATOR: 'Validation errors, please check!',\n DEFAULT_CSV_SEPARATOR: ','\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 } from 'react';\nimport PropTypes from 'prop-types';\nimport ReactDOM from 'react-dom';\nimport Const from './Const';\nimport classSet from 'classnames';\nimport SelectRowHeaderColumn from './SelectRowHeaderColumn';\nimport ExpandRowHeaderColumn from './ExpandRowHeaderColumn';\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 && elm.props.row) ? Number(elm.props.row) : 0\n ));\n\n const rows = [];\n let rowKey = 0;\n\n rows[0] = [];\n rows[0].push( [\n this.props.expandColumnVisible &&\n this.props.expandColumnBeforeSelectColumn &&\n \n ], [\n this.renderSelectRowHeader(rowCount + 1, rowKey++)\n ], [\n this.props.expandColumnVisible &&\n !this.props.expandColumnBeforeSelectColumn &&\n \n ]);\n const { sortIndicator, sortList, onSort, reset } = this.props;\n\n React.Children.forEach(this.props.children, (elm) => {\n if (elm === null || elm === undefined) {\n // Skip null or undefined elements.\n return;\n }\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.hideSelectColumn) {\n return null;\n } else 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 expandColumnVisible: PropTypes.bool,\n expandColumnComponent: PropTypes.func,\n expandColumnBeforeSelectColumn: PropTypes.bool\n};\n\nexport default TableHeader;\n\n\n\n// WEBPACK FOOTER //\n// src/TableHeader.js","module.exports = __WEBPACK_EXTERNAL_MODULE_14__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"root\":\"ReactDOM\",\"commonjs2\":\"react-dom\",\"commonjs\":\"react-dom\",\"amd\":\"react-dom\"}\n// module id = 14\n// module chunks = 0","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\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';\n\nclass ExpandRowHeaderColumn extends Component {\n\n render() {\n return (\n \n { this.props.children }\n \n );\n }\n}\nExpandRowHeaderColumn.propTypes = {\n children: PropTypes.node,\n rowCount: PropTypes.number\n};\nexport default ExpandRowHeaderColumn;\n\n\n\n// WEBPACK FOOTER //\n// src/ExpandRowHeaderColumn.js","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\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\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, x, y, keyBoardNav } = 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,\n this.props.selectRow, this.props.expandColumnOptions);\n const inputType = this.props.selectRow.mode === Const.ROW_SELECT_SINGLE ? 'radio' : 'checkbox';\n const CustomComponent = this.props.selectRow.customComponent;\n const enableKeyBoardNav = (keyBoardNav === true || typeof keyBoardNav === 'object');\n const customEditAndNavStyle = typeof keyBoardNav === 'object' ?\n keyBoardNav.customStyleOnEditCell :\n null;\n const customNavStyle = typeof keyBoardNav === 'object' ?\n keyBoardNav.customStyle :\n null;\n const ExpandColumnCustomComponent = this.props.expandColumnOptions.expandColumnComponent;\n let expandColSpan = this.props.columns.filter(col => col && !col.hidden).length;\n if (isSelectRowDefined && !this.props.selectRow.hideSelectColumn) {\n expandColSpan += 1;\n }\n let tabIndex = 1;\n if (this.props.expandColumnOptions.expandColumnVisible) {\n expandColSpan += 1;\n }\n\n let tableRows = this.props.data.map(function(data, r) {\n const tableColumns = this.props.columns.filter(_ => _ != null).map(function(column, i) {\n const fieldValue = data[column.name];\n const isFocusCell = r === y && i === x;\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 column.editable.readOnly !== true &&\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 (Utils.isFunction(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 (Utils.isFunction(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 const expandedRowColumn = this.renderExpandRowColumn(\n this.props.expandableRow && this.props.expandableRow(data),\n this.props.expanding.indexOf(key) > -1,\n ExpandColumnCustomComponent, r, data\n );\n const haveExpandContent = this.props.expandableRow && this.props.expandableRow(data);\n const isExpanding = haveExpandContent && this.props.expanding.indexOf(key) > -1;\n\n // add by bluespring for className customize\n let trClassName = this.props.trClassName;\n if (Utils.isFunction(this.props.trClassName)) {\n trClassName = this.props.trClassName(data, r);\n }\n if (isExpanding && this.props.expandParentClass) {\n trClassName += Utils.isFunction(this.props.expandParentClass) ?\n this.props.expandParentClass(data, r) :\n this.props.expandParentClass;\n }\n const result = [ \n { this.props.expandColumnOptions.expandColumnVisible &&\n this.props.expandColumnOptions.expandColumnBeforeSelectColumn &&\n expandedRowColumn }\n { selectRowColumn }\n { this.props.expandColumnOptions.expandColumnVisible &&\n !this.props.expandColumnOptions.expandColumnBeforeSelectColumn &&\n expandedRowColumn }\n { tableColumns }\n ];\n\n if (haveExpandContent) {\n const expandBodyClass = Utils.isFunction(this.props.expandBodyClass) ?\n this.props.expandBodyClass(data, r, isExpanding) :\n this.props.expandBodyClass;\n result.push(\n