forked from alibaba-fusion/next
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.jsx
More file actions
46 lines (42 loc) · 1.49 KB
/
Copy pathindex.jsx
File metadata and controls
46 lines (42 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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;
},
});