Merge branch 'master' of github.com:tinper-bee/bee-table
This commit is contained in:
commit
a6f9f561f3
|
@ -99,13 +99,17 @@ function multiSelect(Table, Checkbox) {
|
|||
if (!this.isArray(data)) return false;
|
||||
if (data.length == 0) return false;
|
||||
var count = 0;
|
||||
var disabledCount = 0;
|
||||
data.forEach(function (da) {
|
||||
if (da._checked) {
|
||||
count++;
|
||||
}
|
||||
if (da._disabled) {
|
||||
disabledCount++;
|
||||
}
|
||||
});
|
||||
|
||||
if (data.length == count) {
|
||||
if (data.length == count + disabledCount) {
|
||||
return "all";
|
||||
}
|
||||
return count == 0 ? false : "indeter";
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -7237,7 +7237,7 @@
|
|||
duration: _propTypes2["default"].number,
|
||||
onClose: _propTypes2["default"].func,
|
||||
children: _propTypes2["default"].any,
|
||||
color: _propTypes2["default"].oneOf(['info', 'success', 'danger', 'warning', 'light', 'dark', 'news', 'infolight', 'successlight', 'dangerlight', 'warninglight']),
|
||||
color: _propTypes2["default"].oneOf(['light']),
|
||||
title: _propTypes2["default"].any
|
||||
};
|
||||
|
||||
|
@ -7336,7 +7336,7 @@
|
|||
|
||||
;
|
||||
|
||||
Notice.propTypes = propTypes;
|
||||
Notice.PropTypes = _propTypes2["default"];
|
||||
Notice.defaultProps = defaultProps;
|
||||
|
||||
exports["default"] = Notice;
|
||||
|
@ -21693,15 +21693,15 @@
|
|||
InputNumber.prototype.ComponentWillMount = function ComponentWillMount() {};
|
||||
|
||||
InputNumber.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
|
||||
if (!nextProps.hasOwnProperty('precision')) {
|
||||
var data = judgeValue(nextProps);
|
||||
this.setState({
|
||||
value: data.value,
|
||||
minusDisabled: data.minusDisabled,
|
||||
plusDisabled: data.plusDisabled
|
||||
});
|
||||
this.tempStorage = data.value;
|
||||
}
|
||||
// if(!nextProps.hasOwnProperty('precision')){//如果没有 precision
|
||||
var data = judgeValue(nextProps);
|
||||
this.setState({
|
||||
value: data.value,
|
||||
minusDisabled: data.minusDisabled,
|
||||
plusDisabled: data.plusDisabled
|
||||
});
|
||||
this.tempStorage = data.value;
|
||||
// }
|
||||
};
|
||||
|
||||
InputNumber.prototype.ComponentWillUnMount = function ComponentWillUnMount() {
|
||||
|
@ -53663,13 +53663,17 @@
|
|||
if (!this.isArray(data)) return false;
|
||||
if (data.length == 0) return false;
|
||||
var count = 0;
|
||||
var disabledCount = 0;
|
||||
data.forEach(function (da) {
|
||||
if (da._checked) {
|
||||
count++;
|
||||
}
|
||||
if (da._disabled) {
|
||||
disabledCount++;
|
||||
}
|
||||
});
|
||||
|
||||
if (data.length == count) {
|
||||
if (data.length == count + disabledCount) {
|
||||
return "all";
|
||||
}
|
||||
return count == 0 ? false : "indeter";
|
||||
|
@ -59506,18 +59510,18 @@
|
|||
}
|
||||
};
|
||||
|
||||
Popconfirm.prototype.handleClose = function handleClose(e) {
|
||||
Popconfirm.prototype.handleClose = function handleClose() {
|
||||
var onClose = this.props.onClose;
|
||||
|
||||
this.hide();
|
||||
onClose && onClose(e);
|
||||
onClose && onClose();
|
||||
};
|
||||
|
||||
Popconfirm.prototype.handleCancel = function handleCancel(e) {
|
||||
Popconfirm.prototype.handleCancel = function handleCancel() {
|
||||
var onCancel = this.props.onCancel;
|
||||
|
||||
this.hide();
|
||||
onCancel && onCancel(e);
|
||||
onCancel && onCancel();
|
||||
};
|
||||
|
||||
Popconfirm.prototype.handleHide = function handleHide() {
|
||||
|
@ -59553,8 +59557,7 @@
|
|||
content = _props.content,
|
||||
children = _props.children,
|
||||
onClick = _props.onClick,
|
||||
stopbubble = _props.stopbubble,
|
||||
props = _objectWithoutProperties(_props, ['content', 'children', 'onClick', 'stopbubble']);
|
||||
props = _objectWithoutProperties(_props, ['content', 'children', 'onClick']);
|
||||
|
||||
delete props.defaultOverlayShown;
|
||||
|
||||
|
@ -59571,7 +59574,6 @@
|
|||
_extends({}, confirmProps, {
|
||||
onClose: this.handleClose,
|
||||
onCancel: this.handleCancel,
|
||||
stopbubble: stopbubble,
|
||||
placement: props.placement }),
|
||||
content
|
||||
);
|
||||
|
@ -59686,11 +59688,6 @@
|
|||
*/
|
||||
arrowOffsetLeft: _propTypes2["default"].oneOfType([_propTypes2["default"].number, _propTypes2["default"].string]),
|
||||
|
||||
/**
|
||||
* 阻止冒泡
|
||||
*/
|
||||
stopbubble: _propTypes2["default"].number,
|
||||
|
||||
/**
|
||||
* Title content
|
||||
*/
|
||||
|
@ -59701,7 +59698,6 @@
|
|||
};
|
||||
|
||||
var defaultProps = {
|
||||
stopbubble: 0,
|
||||
placement: 'right',
|
||||
clsPrefix: 'u-popconfirm',
|
||||
locale: {}
|
||||
|
@ -59713,27 +59709,7 @@
|
|||
function Confirm(props) {
|
||||
_classCallCheck(this, Confirm);
|
||||
|
||||
var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));
|
||||
|
||||
_this.cancel = function (e) {
|
||||
var _this$props = _this.props,
|
||||
stopbubble = _this$props.stopbubble,
|
||||
onCancel = _this$props.onCancel;
|
||||
|
||||
stopbubble && e.stopPropagation();
|
||||
onCancel(e);
|
||||
};
|
||||
|
||||
_this.close = function (e) {
|
||||
var _this$props2 = _this.props,
|
||||
stopbubble = _this$props2.stopbubble,
|
||||
onClose = _this$props2.onClose;
|
||||
|
||||
stopbubble && e.stopPropagation();
|
||||
onClose(e);
|
||||
};
|
||||
|
||||
return _this;
|
||||
return _possibleConstructorReturn(this, _React$Component.call(this, props));
|
||||
}
|
||||
|
||||
Confirm.prototype.render = function render() {
|
||||
|
@ -59755,8 +59731,7 @@
|
|||
onClose = _props.onClose,
|
||||
color = _props.color,
|
||||
onCancel = _props.onCancel,
|
||||
stopbubble = _props.stopbubble,
|
||||
props = _objectWithoutProperties(_props, ['placement', 'positionTop', 'positionLeft', 'arrowOffsetTop', 'arrowOffsetLeft', 'clsPrefix', 'trigger', 'title', 'className', 'style', 'children', 'locale', 'onClose', 'color', 'onCancel', 'stopbubble']);
|
||||
props = _objectWithoutProperties(_props, ['placement', 'positionTop', 'positionLeft', 'arrowOffsetTop', 'arrowOffsetLeft', 'clsPrefix', 'trigger', 'title', 'className', 'style', 'children', 'locale', 'onClose', 'color', 'onCancel']);
|
||||
|
||||
var local = (0, _tool.getComponentLocale)(this.props, this.context, 'Popconfirm', function () {
|
||||
return _i18n2["default"];
|
||||
|
@ -59782,10 +59757,7 @@
|
|||
_extends({}, props, {
|
||||
role: 'tooltip',
|
||||
className: (0, _classnames2["default"])(className, classes),
|
||||
style: outerStyle,
|
||||
onClick: function onClick(e) {
|
||||
return stopbubble && e.stopPropagation();
|
||||
}
|
||||
style: outerStyle
|
||||
}),
|
||||
_react2["default"].createElement('div', { className: 'arrow', style: arrowStyle }),
|
||||
_react2["default"].createElement(
|
||||
|
@ -59798,13 +59770,13 @@
|
|||
{ className: (0, _classnames2["default"])(clsPrefix + '-confirm') },
|
||||
_react2["default"].createElement(
|
||||
_beeButton2["default"],
|
||||
{ onClick: this.cancel, size: 'sm', style: { minWidth: 50 },
|
||||
{ onClick: onCancel, size: 'sm', style: { minWidth: 50 },
|
||||
shape: 'border' },
|
||||
local['cancel']
|
||||
),
|
||||
_react2["default"].createElement(
|
||||
_beeButton2["default"],
|
||||
{ onClick: this.close, size: 'sm', style: { minWidth: 50 }, colors: 'primary' },
|
||||
{ onClick: onClose, size: 'sm', style: { minWidth: 50 }, colors: 'primary' },
|
||||
local['ok']
|
||||
)
|
||||
)
|
||||
|
@ -64058,13 +64030,17 @@
|
|||
if (!this.isArray(data)) return false;
|
||||
if (data.length == 0) return false;
|
||||
var count = 0;
|
||||
var disabledCount = 0;
|
||||
data.forEach(function (da) {
|
||||
if (da._checked) {
|
||||
count++;
|
||||
}
|
||||
if (da._disabled) {
|
||||
disabledCount++;
|
||||
}
|
||||
});
|
||||
|
||||
if (data.length == count) {
|
||||
if (data.length == count + disabledCount) {
|
||||
return "all";
|
||||
}
|
||||
return count == 0 ? false : "indeter";
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -17,7 +17,8 @@ class FilterDropDown extends Component {
|
|||
constructor() {
|
||||
super();
|
||||
this.state = {
|
||||
selectValue: []//选择的条件的值
|
||||
selectValue: ['LIKE'],
|
||||
selectNumberValue: ['EQ']
|
||||
}
|
||||
}
|
||||
/**
|
||||
|
@ -26,14 +27,24 @@ class FilterDropDown extends Component {
|
|||
* @param {*} s 选中的selectRecord
|
||||
*/
|
||||
onSelectDropdown = (item) => {
|
||||
let { onSelectDropdown, dataText } = this.props;
|
||||
let { onSelectDropdown, dataText, filterDropdownType } = this.props;
|
||||
if (onSelectDropdown) {
|
||||
if (dataText != "") {
|
||||
this.setState({
|
||||
selectValue: [item.key]
|
||||
}, () => {
|
||||
onSelectDropdown(item);
|
||||
});
|
||||
if (filterDropdownType == 'string') {
|
||||
this.setState({
|
||||
selectValue: [item.key]
|
||||
}, () => {
|
||||
onSelectDropdown(item);
|
||||
});
|
||||
}
|
||||
if (filterDropdownType == 'number') {
|
||||
this.setState({
|
||||
selectNumberValue: [item.key]
|
||||
}, () => {
|
||||
onSelectDropdown(item);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -46,7 +57,8 @@ class FilterDropDown extends Component {
|
|||
let { onClickClear } = this.props;
|
||||
if (onClickClear) {
|
||||
this.setState({
|
||||
selectValue: []
|
||||
selectValue: [],
|
||||
selectNumberValue: []
|
||||
}, () => {
|
||||
onClickClear();
|
||||
});
|
||||
|
@ -59,7 +71,7 @@ class FilterDropDown extends Component {
|
|||
* @returns JSX Menu
|
||||
*/
|
||||
getMenu = () => {
|
||||
let { selectValue } = this.state;
|
||||
let { selectValue, selectNumberValue } = this.state;
|
||||
let { filterDropdownType } = this.props;
|
||||
let locale = getComponentLocale(this.props, this.context, 'Table', () => i18n);
|
||||
switch (filterDropdownType) {
|
||||
|
@ -78,7 +90,7 @@ class FilterDropDown extends Component {
|
|||
case 'number':
|
||||
return <Menu
|
||||
onSelect={this.onSelectDropdown}
|
||||
selectedKeys={selectValue}
|
||||
selectedKeys={selectNumberValue}
|
||||
>
|
||||
<Item key="GT">{locale['greater_than']}</Item>
|
||||
<Item key="GTEQ">{locale['great_than_equal_to']}</Item>
|
||||
|
|
|
@ -65,13 +65,17 @@ export default function multiSelect(Table, Checkbox) {
|
|||
if(!this.isArray(data))return false;
|
||||
if(data.length == 0)return false;
|
||||
let count = 0;
|
||||
let disabledCount = 0;
|
||||
data.forEach(da=>{
|
||||
if(da._checked){
|
||||
count ++;
|
||||
}
|
||||
if(da._disabled){
|
||||
disabledCount ++;
|
||||
}
|
||||
})
|
||||
|
||||
if(data.length == count){
|
||||
if(data.length == count + disabledCount){
|
||||
return "all";
|
||||
}
|
||||
return count == 0?false:"indeter";
|
||||
|
|
Loading…
Reference in New Issue