@@ -3801,19 +3801,21 @@ return /******/ (function(modules) { // webpackBootstrap
3801
3801
_createClass(TableEditColumn, [{
3802
3802
key: '__handleKeyPress__REACT_HOT_LOADER__',
3803
3803
value: function __handleKeyPress__REACT_HOT_LOADER__(e) {
3804
- if (e.keyCode === 13) {
3804
+ if (e.keyCode === 13 || e.keyCode === 9 ) {
3805
3805
// Pressed ENTER
3806
3806
var value = e.currentTarget.type === 'checkbox' ? this._getCheckBoxValue(e) : e.currentTarget.value;
3807
3807
3808
3808
if (!this.validator(value)) {
3809
3809
return;
3810
3810
}
3811
- this.props.completeEdit(value, this.props.rowIndex, this.props.colIndex);
3811
+ if (e.keyCode === 13) {
3812
+ this.props.completeEdit(value, this.props.rowIndex, this.props.colIndex);
3813
+ } else {
3814
+ this.props.onTab(this.props.rowIndex + 1, this.props.colIndex + 1, 'tab', e);
3815
+ e.preventDefault();
3816
+ }
3812
3817
} else if (e.keyCode === 27) {
3813
3818
this.props.completeEdit(null, this.props.rowIndex, this.props.colIndex);
3814
- } else if (e.keyCode === 9) {
3815
- this.props.onTab(this.props.rowIndex + 1, this.props.colIndex + 1, 'tab', e);
3816
- e.preventDefault();
3817
3819
} else if (e.type === 'click' && !this.props.blurToSave) {
3818
3820
// textarea click save button
3819
3821
var _value = e.target.parentElement.firstChild.value;
@@ -3830,7 +3832,7 @@ return /******/ (function(modules) { // webpackBootstrap
3830
3832
if (this.props.blurToSave) {
3831
3833
var value = e.currentTarget.type === 'checkbox' ? this._getCheckBoxValue(e) : e.currentTarget.value;
3832
3834
if (!this.validator(value)) {
3833
- return;
3835
+ return false ;
3834
3836
}
3835
3837
this.props.completeEdit(value, this.props.rowIndex, this.props.colIndex);
3836
3838
}
@@ -16099,7 +16101,9 @@ return /******/ (function(modules) { // webpackBootstrap
16099
16101
key: '__handleColumnClick__REACT_HOT_LOADER__',
16100
16102
value: function __handleColumnClick__REACT_HOT_LOADER__() {
16101
16103
if (this.props.isOnlyHead || !this.props.dataSort) return;
16102
- var order = this.props.sort === _Const2.default.SORT_DESC ? _Const2.default.SORT_ASC : _Const2.default.SORT_DESC;
16104
+ var order = this.props.sort;
16105
+
16106
+ if (!order && this.props.defaultASC) order = _Const2.default.SORT_ASC;else order = this.props.sort === _Const2.default.SORT_DESC ? _Const2.default.SORT_ASC : _Const2.default.SORT_DESC;
16103
16107
this.props.onSort(order, this.props.dataField);
16104
16108
}
16105
16109
}, {
@@ -16365,7 +16369,8 @@ return /******/ (function(modules) { // webpackBootstrap
16365
16369
tdAttr: _react.PropTypes.object,
16366
16370
tdStyle: _react.PropTypes.object,
16367
16371
thStyle: _react.PropTypes.object,
16368
- keyValidator: _react.PropTypes.bool
16372
+ keyValidator: _react.PropTypes.bool,
16373
+ defaultASC: _react.PropTypes.bool
16369
16374
};
16370
16375
16371
16376
TableHeaderColumn.defaultProps = {
@@ -16400,7 +16405,8 @@ return /******/ (function(modules) { // webpackBootstrap
16400
16405
tdAttr: undefined,
16401
16406
tdStyle: undefined,
16402
16407
thStyle: undefined,
16403
- keyValidator: false
16408
+ keyValidator: false,
16409
+ defaultASC: false
16404
16410
};
16405
16411
16406
16412
var _default = TableHeaderColumn;
@@ -16983,14 +16989,17 @@ return /******/ (function(modules) { // webpackBootstrap
16983
16989
options = _props.options,
16984
16990
placeholder = _props.placeholder,
16985
16991
columnName = _props.columnName,
16986
- selectText = _props.selectText;
16992
+ selectText = _props.selectText,
16993
+ withoutEmptyOption = _props.withoutEmptyOption;
16987
16994
16988
16995
var selectTextValue = selectText !== undefined ? selectText : 'Select';
16989
- optionTags.push(_react2.default.createElement(
16990
- 'option',
16991
- { key: '-1', value: '' },
16992
- placeholder || selectTextValue + ' ' + columnName + '...'
16993
- ));
16996
+ if (!withoutEmptyOption) {
16997
+ optionTags.push(_react2.default.createElement(
16998
+ 'option',
16999
+ { key: '-1', value: '' },
17000
+ placeholder || selectTextValue + ' ' + columnName + '...'
17001
+ ));
17002
+ }
16994
17003
Object.keys(options).map(function (key) {
16995
17004
optionTags.push(_react2.default.createElement(
16996
17005
'option',
@@ -17167,7 +17176,11 @@ return /******/ (function(modules) { // webpackBootstrap
17167
17176
key: 'getComparatorOptions',
17168
17177
value: function getComparatorOptions() {
17169
17178
var optionTags = [];
17170
- optionTags.push(_react2.default.createElement('option', { key: '-1' }));
17179
+ var withoutEmptyComparatorOption = this.props.withoutEmptyComparatorOption;
17180
+
17181
+ if (!withoutEmptyComparatorOption) {
17182
+ optionTags.push(_react2.default.createElement('option', { key: '-1' }));
17183
+ }
17171
17184
for (var i = 0; i < this.numberComparators.length; i++) {
17172
17185
optionTags.push(_react2.default.createElement(
17173
17186
'option',
@@ -17181,14 +17194,17 @@ return /******/ (function(modules) { // webpackBootstrap
17181
17194
key: 'getNumberOptions',
17182
17195
value: function getNumberOptions() {
17183
17196
var optionTags = [];
17184
- var options = this.props.options;
17185
-
17197
+ var _props = this.props,
17198
+ options = _props.options,
17199
+ withoutEmptyNumberOption = _props.withoutEmptyNumberOption;
17186
17200
17187
- optionTags.push(_react2.default.createElement(
17188
- 'option',
17189
- { key: '-1', value: '' },
17190
- this.props.placeholder || 'Select ' + this.props.columnName + '...'
17191
- ));
17201
+ if (!withoutEmptyNumberOption) {
17202
+ optionTags.push(_react2.default.createElement(
17203
+ 'option',
17204
+ { key: '-1', value: '' },
17205
+ this.props.placeholder || 'Select ' + this.props.columnName + '...'
17206
+ ));
17207
+ }
17192
17208
for (var i = 0; i < options.length; i++) {
17193
17209
optionTags.push(_react2.default.createElement(
17194
17210
'option',
@@ -17275,11 +17291,15 @@ return /******/ (function(modules) { // webpackBootstrap
17275
17291
}
17276
17292
},
17277
17293
placeholder: _react.PropTypes.string,
17278
- columnName: _react.PropTypes.string
17294
+ columnName: _react.PropTypes.string,
17295
+ withoutEmptyComparatorOption: _react.PropTypes.bool,
17296
+ withoutEmptyNumberOption: _react.PropTypes.bool
17279
17297
};
17280
17298
17281
17299
NumberFilter.defaultProps = {
17282
- delay: _Const2.default.FILTER_DELAY
17300
+ delay: _Const2.default.FILTER_DELAY,
17301
+ withoutEmptyComparatorOption: false,
17302
+ withoutEmptyNumberOption: false
17283
17303
};
17284
17304
17285
17305
var _default = NumberFilter;
0 commit comments