mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-03-02 07:20:38 +00:00
57 lines
2.0 KiB
JavaScript
57 lines
2.0 KiB
JavaScript
import _extends from 'babel-runtime/helpers/extends';
|
|
import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
|
|
import ConfigProvider from '../config-provider';
|
|
import Balloon from './balloon';
|
|
import Tooltip from './tooltip';
|
|
import Inner from './inner';
|
|
|
|
Balloon.Tooltip = ConfigProvider.config(Tooltip, {
|
|
transform: /* istanbul ignore next */function transform(props, deprecated) {
|
|
if ('text' in props) {
|
|
deprecated('text', 'children', 'Tooltip');
|
|
|
|
var _props = props,
|
|
text = _props.text,
|
|
others = _objectWithoutProperties(_props, ['text']);
|
|
|
|
props = _extends({ children: text }, others);
|
|
}
|
|
|
|
return props;
|
|
}
|
|
});
|
|
Balloon.Inner = Inner;
|
|
|
|
export default ConfigProvider.config(Balloon, {
|
|
transform: /* istanbul ignore next */function transform(props, deprecated) {
|
|
if (props.alignment) {
|
|
deprecated('alignment', 'alignEdge', 'Balloon');
|
|
|
|
var _props2 = props,
|
|
alignment = _props2.alignment,
|
|
others = _objectWithoutProperties(_props2, ['alignment']);
|
|
|
|
props = _extends({ alignEdge: alignment === 'edge' }, others);
|
|
}
|
|
if (props.onCloseClick) {
|
|
deprecated('onCloseClick', 'onVisibleChange(visible, [type = "closeClick"])', 'Balloon');
|
|
|
|
var _props3 = props,
|
|
onCloseClick = _props3.onCloseClick,
|
|
onVisibleChange = _props3.onVisibleChange,
|
|
_others = _objectWithoutProperties(_props3, ['onCloseClick', 'onVisibleChange']);
|
|
|
|
var newOnVisibleChange = function newOnVisibleChange(visible, type) {
|
|
if (type === 'closeClick') {
|
|
onCloseClick();
|
|
}
|
|
if (onVisibleChange) {
|
|
onVisibleChange(visible, type);
|
|
}
|
|
};
|
|
props = _extends({ onVisibleChange: newOnVisibleChange }, _others);
|
|
}
|
|
|
|
return props;
|
|
}
|
|
}); |