UNPKG

choerodon-ui

Version:

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

92 lines (74 loc) 2.83 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 Element from './Element'; import { getPrefixCls } from '../configure'; // eslint-disable-next-line react/prefer-stateless-function var SkeletonInput = /*#__PURE__*/ function (_React$Component) { _inherits(SkeletonInput, _React$Component); var _super = _createSuper(SkeletonInput); function SkeletonInput() { var _this; _classCallCheck(this, SkeletonInput); _this = _super.apply(this, arguments); _this.renderSkeletonInput = 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, "-input") }, otherProps))); }; return _this; } _createClass(SkeletonInput, [{ key: "render", value: function render() { return React.createElement(React.Fragment, null, this.renderSkeletonInput()); } }]); return SkeletonInput; }(React.Component); SkeletonInput.defaultProps = { size: 'default' }; export default SkeletonInput; //# sourceMappingURL=Input.js.map