Completely updated React, fixed #11, (hopefully)

This commit is contained in:
2018-03-04 19:11:49 -05:00
parent 6e0afd6e2a
commit 34e5f5139a
13674 changed files with 333464 additions and 473223 deletions

View File

@@ -55,7 +55,7 @@ var ClearSearchButton = function (_Component) {
);
return _react2.default.createElement(
'button',
_extends({ ref: 'btn',
_extends({
className: 'btn ' + btnContextual + ' ' + className + ' ' + clearBtnDefaultClass,
type: 'button',
onClick: onClick

View File

@@ -67,9 +67,8 @@ var InsertModal = function (_Component) {
}, {
key: '__handleSave__REACT_HOT_LOADER__',
value: function __handleSave__REACT_HOT_LOADER__() {
var bodyRefs = this.refs.body;
if (bodyRefs.getFieldValue) {
this.props.onSave(bodyRefs.getFieldValue());
if (this.body.getFieldValue) {
this.props.onSave(this.body.getFieldValue());
} else {
console.error('Custom InsertModalBody should implement getFieldValue function\n and should return an object presented as the new row that user input.');
}
@@ -77,6 +76,8 @@ var InsertModal = function (_Component) {
}, {
key: 'render',
value: function render() {
var _this3 = this;
var _props = this.props,
headerComponent = _props.headerComponent,
footerComponent = _props.footerComponent,
@@ -96,7 +97,9 @@ var InsertModal = function (_Component) {
footerComponent = footerComponent && footerComponent(onModalClose, this.handleSave);
if (bodyComponent) {
bodyComponent = _react2.default.cloneElement(bodyComponent, { ref: 'body' });
bodyComponent = _react2.default.cloneElement(bodyComponent, { ref: function ref(node) {
return _this3.body = node;
} });
}
if (headerComponent && headerComponent.type.name === _InsertModalHeader2.default.name) {
@@ -144,7 +147,9 @@ var InsertModal = function (_Component) {
version: this.props.version,
className: 'react-bs-table-inser-modal-header',
onModalClose: onModalClose }),
bodyComponent || _react2.default.createElement(_InsertModalBody2.default, _extends({ ref: 'body' }, bodyAttr)),
bodyComponent || _react2.default.createElement(_InsertModalBody2.default, _extends({ ref: function ref(node) {
return _this3.body = node;
} }, bodyAttr)),
footerComponent || _react2.default.createElement(_InsertModalFooter2.default, {
className: 'react-bs-table-inser-modal-footer',
onModalClose: onModalClose,

View File

@@ -217,9 +217,7 @@ var ToolBar = function (_Component) {
var delay = this.props.searchDelayTime ? this.props.searchDelayTime : 0;
this.debounceCallback = this.handleDebounce(function () {
var seachInput = _this3.refs.seachInput;
seachInput && _this3.props.onSearch(seachInput.getValue());
_this3.seachInput && _this3.props.onSearch(_this3.seachInput.getValue());
}, delay);
}
}, {
@@ -237,10 +235,8 @@ var ToolBar = function (_Component) {
}, {
key: 'setSearchInput',
value: function setSearchInput(text) {
var seachInput = this.refs.seachInput;
if (seachInput && seachInput.value !== text) {
seachInput.value = text;
if (this.seachInput && this.seachInput.value !== text) {
this.seachInput.value = text;
}
}
}, {
@@ -392,11 +388,6 @@ var ToolBar = function (_Component) {
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) {
@@ -411,9 +402,7 @@ var ToolBar = function (_Component) {
}, {
key: '__handleClearBtnClick__REACT_HOT_LOADER__',
value: function __handleClearBtnClick__REACT_HOT_LOADER__() {
var seachInput = this.refs.seachInput;
seachInput && seachInput.setValue('');
this.seachInput && this.seachInput.setValue('');
this.props.onSearch('');
}
}, {
@@ -532,6 +521,8 @@ var ToolBar = function (_Component) {
}, {
key: 'renderSearchPanel',
value: function renderSearchPanel() {
var _this7 = this;
if (this.props.enableSearch) {
var classNames = 'form-group form-group-sm react-bs-table-search-form';
var clearBtn = null;
@@ -554,16 +545,22 @@ var ToolBar = function (_Component) {
});
if (searchField.type.name === _SearchField2.default.name) {
searchField = _react2.default.cloneElement(searchField, {
ref: 'seachInput',
ref: function ref(node) {
return _this7.seachInput = node;
},
onKeyUp: this.handleKeyUp
});
} else {
searchField = _react2.default.cloneElement(searchField, {
ref: 'seachInput'
ref: function ref(node) {
return _this7.seachInput = node;
}
});
}
} else {
searchField = _react2.default.createElement(_SearchField2.default, { ref: 'seachInput',
searchField = _react2.default.createElement(_SearchField2.default, { ref: function ref(node) {
return _this7.seachInput = node;
},
defaultValue: this.props.defaultSearch,
placeholder: this.props.searchPlaceholder,
onKeyUp: this.handleKeyUp });
@@ -627,6 +624,7 @@ var ToolBar = function (_Component) {
_reactModal2.default,
{ className: 'react-bs-insert-modal modal-dialog',
isOpen: this.state.isInsertModalOpen,
ariaHideApp: false,
onRequestClose: this.handleModalClose,
contentLabel: 'Modal' },
modal