UNPKG

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