mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-03-10 18:06:02 +00:00
47 lines
1.5 KiB
JavaScript
47 lines
1.5 KiB
JavaScript
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 */ (props, deprecated) => {
|
|
if ('text' in props) {
|
|
deprecated('text', 'children', 'Tooltip');
|
|
const { text, ...others } = props;
|
|
props = { children: text, ...others };
|
|
}
|
|
|
|
return props;
|
|
},
|
|
});
|
|
Balloon.Inner = Inner;
|
|
|
|
export default ConfigProvider.config(Balloon, {
|
|
transform: /* istanbul ignore next */ (props, deprecated) => {
|
|
if (props.alignment) {
|
|
deprecated('alignment', 'alignEdge', 'Balloon');
|
|
const { alignment, ...others } = props;
|
|
props = { alignEdge: alignment === 'edge', ...others };
|
|
}
|
|
if (props.onCloseClick) {
|
|
deprecated(
|
|
'onCloseClick',
|
|
'onVisibleChange(visible, [type = "closeClick"])',
|
|
'Balloon'
|
|
);
|
|
const { onCloseClick, onVisibleChange, ...others } = props;
|
|
const newOnVisibleChange = (visible, type) => {
|
|
if (type === 'closeClick') {
|
|
onCloseClick();
|
|
}
|
|
if (onVisibleChange) {
|
|
onVisibleChange(visible, type);
|
|
}
|
|
};
|
|
props = { onVisibleChange: newOnVisibleChange, ...others };
|
|
}
|
|
|
|
return props;
|
|
},
|
|
});
|