"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports["default"] = void 0;
var _tabs = _interopRequireDefault(require("antd/lib/tabs"));
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
var _react = _interopRequireWildcard(require("react"));
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
var Tabs = /*#__PURE__*/function (_Component) {
  (0, _inheritsLoose2["default"])(Tabs, _Component);
  function Tabs() {
    var _this$props$activeKey;
    var _this;
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _Component.call.apply(_Component, [this].concat(args)) || this;
    _this.state = {
      activeKey: (_this$props$activeKey = _this.props.activeKey) !== null && _this$props$activeKey !== void 0 ? _this$props$activeKey : _this.props.defaultActiveKey
    };
    _this._handleChange = function (key) {
      _this.setActiveKey(key);
    };
    _this.setActiveKey = function (key) {
      var _this$props$onChange = _this.props.onChange,
        onChange = _this$props$onChange === void 0 ? function () {} : _this$props$onChange;
      _this.setState({
        activeKey: key
      });
      onChange(key);
    };
    _this.getActiveKey = function () {
      return _this.state.activeKey;
    };
    return _this;
  }
  var _proto = Tabs.prototype;
  _proto.render = function render() {
    var props = this.props;
    var activeKey = this.state.activeKey;
    return /*#__PURE__*/_react["default"].createElement(_tabs["default"], (0, _extends2["default"])({}, props, {
      activeKey: activeKey,
      onChange: this._handleChange
    }));
  };
  return Tabs;
}(_react.Component);
Tabs.TabPane = _tabs["default"].TabPane;
var _default = Tabs;
exports["default"] = _default;