UNPKG

1.35 kBJavaScriptView Raw
1import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
2import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
3import _inherits from 'babel-runtime/helpers/inherits';
4import _extends from 'babel-runtime/helpers/extends';
5import React from 'react';
6import PropTypes from 'prop-types';
7
8import TabContainer from './TabContainer';
9import TabContent from './TabContent';
10import TabPane from './TabPane';
11
12var propTypes = _extends({}, TabPane.propTypes, {
13
14 disabled: PropTypes.bool,
15
16 title: PropTypes.node,
17
18 /**
19 * tabClassName is used as className for the associated NavItem
20 */
21 tabClassName: PropTypes.string
22});
23
24var Tab = function (_React$Component) {
25 _inherits(Tab, _React$Component);
26
27 function Tab() {
28 _classCallCheck(this, Tab);
29
30 return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
31 }
32
33 Tab.prototype.render = function render() {
34 var props = _extends({}, this.props);
35
36 // These props are for the parent `<Tabs>` rather than the `<TabPane>`.
37 delete props.title;
38 delete props.disabled;
39 delete props.tabClassName;
40
41 return React.createElement(TabPane, props);
42 };
43
44 return Tab;
45}(React.Component);
46
47Tab.propTypes = propTypes;
48
49Tab.Container = TabContainer;
50Tab.Content = TabContent;
51Tab.Pane = TabPane;
52
53export default Tab;
\No newline at end of file