forked from alibaba-fusion/next
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.jsx
52 lines (45 loc) · 1.53 KB
/
index.jsx
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
47
48
49
50
51
52
import ConfigProvider from '../config-provider';
import Tab from './tab';
import Item from './tabs/tab-item';
Tab.Item = Item;
Tab.TabPane = ConfigProvider.config(Item, {
transform: (props, deprecated) => {
deprecated('Tab.TabPane', 'Tab.Item', 'Tab');
return props;
},
});
export default ConfigProvider.config(Tab, {
transform: /* istanbul ignore next */ (props, deprecated) => {
if ('type' in props) {
deprecated('type', 'shape', 'Tab');
const { type, ...others } = props;
props = { shape: type, ...others };
}
if ('resDirection' in props) {
const { resDirection, ...others } = props;
let excessMode;
if (resDirection === 'horizontal') {
deprecated(
'resDirection=horizontal',
'excessMode=slide',
'Tab'
);
excessMode = 'slide';
} else if (resDirection === 'vertical') {
deprecated(
'resDirection=vertical',
'excessMode=dropdown',
'Tab'
);
excessMode = 'dropdown';
}
props = { excessMode, ...others };
}
if ('tabBarExtraContent' in props) {
deprecated('tabBarExtraContent', 'extra', 'Tab');
const { tabBarExtraContent, ...others } = props;
props = { extra: tabBarExtraContent, ...others };
}
return props;
},
});