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