"use strict";

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

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

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));

var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));

var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));

var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));

var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));

var _tslib = require("tslib");

var _skeleton = _interopRequireDefault(require("../../../lib/skeleton"));

var _mobxReact = require("mobx-react");

var _react = _interopRequireDefault(require("react"));

var _omit = _interopRequireDefault(require("lodash/omit"));

var _enum = require("../data-set/enum");

var _DataSetComponent2 = _interopRequireDefault(require("../data-set/DataSetComponent"));

var _Button = _interopRequireDefault(require("./Button"));

var _Input = _interopRequireDefault(require("./Input"));

var _Avatar = _interopRequireDefault(require("./Avatar"));

var _excluded = ["dataSet", "skeletonTitle"];

var Skeleton = /*#__PURE__*/function (_DataSetComponent) {
  (0, _inherits2["default"])(Skeleton, _DataSetComponent);

  var _super = (0, _createSuper2["default"])(Skeleton);

  function Skeleton() {
    (0, _classCallCheck2["default"])(this, Skeleton);
    return _super.apply(this, arguments);
  }

  (0, _createClass2["default"])(Skeleton, [{
    key: "getOmitPropsKeys",
    value: function getOmitPropsKeys() {
      return (0, _get2["default"])((0, _getPrototypeOf2["default"])(Skeleton.prototype), "getOmitPropsKeys", this).call(this).concat(['skeletonTitle']);
    }
  }, {
    key: "render",
    value: function render() {
      var _this$props = this.props,
          dataSet = _this$props.dataSet,
          skeletonTitle = _this$props.skeletonTitle,
          otherProps = (0, _objectWithoutProperties2["default"])(_this$props, _excluded);
      var props = {
        title: skeletonTitle
      };
      var omitProps = (0, _omit["default"])(otherProps, 'title');

      if (dataSet) {
        props.loading = dataSet.status !== _enum.DataSetStatus.ready;
      }

      return /*#__PURE__*/_react["default"].createElement(_skeleton["default"], (0, _extends2["default"])({}, omitProps, props));
    }
  }]);
  return Skeleton;
}(_DataSetComponent2["default"]);

Skeleton.displayName = 'Skeletions';
Skeleton.Button = _Button["default"];
Skeleton.Input = _Input["default"];
Skeleton.Avatar = _Avatar["default"];
Skeleton.defaultProps = {
  skeletonTitle: true
};
Skeleton = (0, _tslib.__decorate)([_mobxReact.observer], Skeleton);
var _default = Skeleton;
exports["default"] = _default;
//# sourceMappingURL=Skeleton.js.map
