UNPKG

@alicloud/cloud-charts

Version:

![](https://img.shields.io/npm/v/@alicloud/cloud-charts?color=%23ff8200)

47 lines (45 loc) 1.88 kB
'use strict'; import _extends from "@babel/runtime/helpers/extends"; import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose"; import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose"; var _excluded = ["type", "size", "className", "status", "reverse"]; import * as React from 'react'; import classNames from 'classnames'; import { getStatusColorName } from '../common/common'; import chartLog from "../common/log"; import { FullCrossName, PrefixName } from '../constants'; import "./cdn.css"; var prefix = PrefixName + "-wicon"; var Wicon = /*#__PURE__*/function (_React$Component) { _inheritsLoose(Wicon, _React$Component); function Wicon(props) { var _this; _this = _React$Component.call(this, props) || this; // 图表初始化时记录日志 chartLog('Wicon', 'init'); return _this; } var _proto = Wicon.prototype; _proto.render = function render() { var _classNames; var _this$props = this.props, type = _this$props.type, size = _this$props.size, className = _this$props.className, status = _this$props.status, reverse = _this$props.reverse, other = _objectWithoutPropertiesLoose(_this$props, _excluded); var classes = classNames((_classNames = {}, _classNames[FullCrossName] = true, _classNames[prefix + "-" + type] = !!type, _classNames["" + prefix] = true, _classNames[prefix + "-" + size] = !!size, _classNames[prefix + "-" + getStatusColorName(status)] = !!status, _classNames[prefix + "-reverse"] = !!reverse, _classNames[className] = !!className, _classNames)); return /*#__PURE__*/React.createElement("i", _extends({ className: classes }, other)); }; return Wicon; }(React.Component); Wicon.displayName = 'Wicon'; Wicon.defaultProps = { size: 'big', type: 'monitor', status: 'none' }; export { Wicon as default };