UNPKG

choerodon-ui

Version:

An enterprise-class UI design language and React-based implementation

93 lines (75 loc) 2.86 kB
import _extends from "@babel/runtime/helpers/extends"; import _defineProperty from "@babel/runtime/helpers/defineProperty"; import _classCallCheck from "@babel/runtime/helpers/classCallCheck"; import _createClass from "@babel/runtime/helpers/createClass"; import _inherits from "@babel/runtime/helpers/inherits"; import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn"; import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf"; function _createSuper(Derived) { function isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } return function () { var Super = _getPrototypeOf(Derived), result; if (isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } import * as React from 'react'; import omit from 'lodash/omit'; import classNames from 'classnames'; import { getPrefixCls } from '../configure'; import Element from './Element'; // eslint-disable-next-line react/prefer-stateless-function var SkeletonAvatar = /*#__PURE__*/ function (_React$Component) { _inherits(SkeletonAvatar, _React$Component); var _super = _createSuper(SkeletonAvatar); function SkeletonAvatar() { var _this; _classCallCheck(this, SkeletonAvatar); _this = _super.apply(this, arguments); _this.renderSkeletonAvatar = function () { var _this$props = _this.props, customizePrefixCls = _this$props.prefixCls, className = _this$props.className, active = _this$props.active; var prefixCls = getPrefixCls('skeleton', customizePrefixCls); var otherProps = omit(_this.props, ['prefixCls']); var cls = classNames(prefixCls, className, "".concat(prefixCls, "-element"), _defineProperty({}, "".concat(prefixCls, "-active"), active)); return React.createElement("div", { className: cls }, React.createElement(Element, _extends({ prefixCls: "".concat(prefixCls, "-avatar") }, otherProps))); }; return _this; } _createClass(SkeletonAvatar, [{ key: "render", value: function render() { return React.createElement(React.Fragment, null, this.renderSkeletonAvatar()); } }]); return SkeletonAvatar; }(React.Component); SkeletonAvatar.defaultProps = { size: 'default', shape: 'circle' }; export default SkeletonAvatar; //# sourceMappingURL=Avatar.js.map