还原设置增加回调函数

This commit is contained in:
wanghaoo 2018-11-06 13:49:43 +08:00
parent 4db54a1ba7
commit 2420ce36b0
7 changed files with 28 additions and 57 deletions

View File

@ -232,7 +232,10 @@ function filterColumn(Table, Popover) {
da.checked = true; da.checked = true;
da.ifshow = true; da.ifshow = true;
}); });
_this2.setState(_extends({}, _this2.state)); _this2.setState({
columns: columns
});
_this2.props.afterFilter(_this2.state.columns, _this2.state.columns);
}; };
this.getCloumnsScroll = function (columns) { this.getCloumnsScroll = function (columns) {

3
dist/demo.css vendored
View File

@ -2420,6 +2420,9 @@ i.uf {
/* /*
* 选择时删除文本阴影及设置默认选中颜色 * 选择时删除文本阴影及设置默认选中颜色
*/ */
::-moz-selection {
background: rgb(187,222,251);
text-shadow: none; }
::selection { ::selection {
background: rgb(187,222,251); background: rgb(187,222,251);
text-shadow: none; } text-shadow: none; }

2
dist/demo.css.map vendored

File diff suppressed because one or more lines are too long

68
dist/demo.js vendored
View File

@ -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;
@ -58629,18 +58629,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() {
@ -58676,8 +58676,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;
@ -58694,7 +58693,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
); );
@ -58809,11 +58807,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
*/ */
@ -58824,7 +58817,6 @@
}; };
var defaultProps = { var defaultProps = {
stopbubble: 0,
placement: 'right', placement: 'right',
clsPrefix: 'u-popconfirm', clsPrefix: 'u-popconfirm',
locale: {} locale: {}
@ -58836,27 +58828,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() {
@ -58878,8 +58850,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"];
@ -58905,10 +58876,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(
@ -58921,13 +58889,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']
) )
) )
@ -59451,7 +59419,10 @@
da.checked = true; da.checked = true;
da.ifshow = true; da.ifshow = true;
}); });
_this2.setState(_extends({}, _this2.state)); _this2.setState({
columns: columns
});
afterFilter(_this2.state.columns, _this2.state.columns);
}; };
this.getCloumnsScroll = function (columns) { this.getCloumnsScroll = function (columns) {
@ -63041,13 +63012,6 @@
'show': 'page', 'show': 'page',
'goto': 'goto', 'goto': 'goto',
'ok': 'ok' 'ok': 'ok'
},
'zh-tw': {
'total': '共',
'items': '條',
'show': '顯示',
'goto': '跳至',
'ok': '確認'
} }
}; };

2
dist/demo.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -92,4 +92,4 @@
"react-addons-test-utils": "^15.5.0", "react-addons-test-utils": "^15.5.0",
"react-dom": "^15.5.0" "react-dom": "^15.5.0"
} }
} }

View File

@ -105,8 +105,9 @@ export default function filterColumn(Table,Popover) {
da.ifshow = true; da.ifshow = true;
}); });
this.setState({ this.setState({
...this.state columns
}) })
this.props.afterFilter(this.state.columns,this.state.columns);
} }
getCloumnsScroll=(columns)=>{ getCloumnsScroll=(columns)=>{