import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
import _createClass from "@babel/runtime/helpers/createClass";
import _get from "@babel/runtime/helpers/get";
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
import _inherits from "@babel/runtime/helpers/inherits";
import _createSuper from "@babel/runtime/helpers/createSuper";
var _excluded = ["dataSet", "skeletonTitle"];
import { __decorate } from "tslib";
import C7nSkeleton from '../../../es/skeleton';
import { observer } from 'mobx-react';
import React from 'react';
import omit from 'lodash/omit';
import { DataSetStatus } from '../data-set/enum';
import DataSetComponent from '../data-set/DataSetComponent';
import SkeletonButton from './Button';
import SkeletonInput from './Input';
import Avatar from './Avatar';

var Skeleton = /*#__PURE__*/function (_DataSetComponent) {
  _inherits(Skeleton, _DataSetComponent);

  var _super = _createSuper(Skeleton);

  function Skeleton() {
    _classCallCheck(this, Skeleton);

    return _super.apply(this, arguments);
  }

  _createClass(Skeleton, [{
    key: "getOmitPropsKeys",
    value: function getOmitPropsKeys() {
      return _get(_getPrototypeOf(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 = _objectWithoutProperties(_this$props, _excluded);

      var props = {
        title: skeletonTitle
      };
      var omitProps = omit(otherProps, 'title');

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

      return /*#__PURE__*/React.createElement(C7nSkeleton, _extends({}, omitProps, props));
    }
  }]);

  return Skeleton;
}(DataSetComponent);

Skeleton.displayName = 'Skeletions';
Skeleton.Button = SkeletonButton;
Skeleton.Input = SkeletonInput;
Skeleton.Avatar = Avatar;
Skeleton.defaultProps = {
  skeletonTitle: true
};
Skeleton = __decorate([observer], Skeleton);
export default Skeleton;
//# sourceMappingURL=Skeleton.js.map
