"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;

var _noop = _interopRequireDefault(require("lodash/noop"));

var _en_US = _interopRequireDefault(require("../locale/en_US"));

var _default = {
  getDefaultProps: function getDefaultProps() {
    return {
      locale: _en_US["default"],
      style: {},
      visible: true,
      prefixCls: 'rc-calendar',
      className: '',
      onSelect: _noop["default"],
      onChange: _noop["default"],
      onClear: _noop["default"],
      renderFooter: function renderFooter() {
        return null;
      },
      renderSidebar: function renderSidebar() {
        return null;
      }
    };
  },
  shouldComponentUpdate: function shouldComponentUpdate(nextProps) {
    return this.props.visible || nextProps.visible;
  },
  getFormat: function getFormat() {
    var format = this.props.format;
    var _this$props = this.props,
        locale = _this$props.locale,
        timePicker = _this$props.timePicker;

    if (!format) {
      if (timePicker) {
        format = locale.dateTimeFormat;
      } else {
        format = locale.dateFormat;
      }
    }

    return format;
  },
  focus: function focus() {
    if (this.rootInstance) {
      this.rootInstance.focus();
    }
  },
  saveRoot: function saveRoot(root) {
    this.rootInstance = root;
  }
};
exports["default"] = _default;
//# sourceMappingURL=CommonMixin.js.map
