var _excluded = ["backgroundColors", "labelColor", "valueColor", "data"];
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
import React from 'react';
import { Col, Row } from 'antd';
import PisellTooltip from "../pisellTooltip";
import Iconfont from "../iconfont";
import "./index.less";
var defaultColors = ['rgba(224, 79, 22, 0.20)', 'rgba(202, 133, 4, 0.20)', 'rgba(127, 86, 217, 0.22)', 'rgba(7, 148, 85, 0.20)', 'rgba(21, 112, 239, 0.23)'];
var PisellStatisticList = function PisellStatisticList(props) {
  var _props$backgroundColo = props.backgroundColors,
    backgroundColors = _props$backgroundColo === void 0 ? defaultColors : _props$backgroundColo,
    _props$labelColor = props.labelColor,
    labelColor = _props$labelColor === void 0 ? '#fff' : _props$labelColor,
    _props$valueColor = props.valueColor,
    valueColor = _props$valueColor === void 0 ? '#fff' : _props$valueColor,
    data = props.data,
    others = _objectWithoutProperties(props, _excluded);
  return /*#__PURE__*/React.createElement("div", _extends({
    className: "pisell-lowcode-statistic-list-wrap"
  }, others), data.map(function (item, index) {
    var _item$children;
    return /*#__PURE__*/React.createElement("div", {
      className: "pisell-lowcode-statistic-list-item",
      style: {
        background: backgroundColors[index % backgroundColors.length]
      }
    }, /*#__PURE__*/React.createElement("div", {
      className: "pisell-lowcode-statistic-list-item-label",
      style: {
        color: labelColor
      }
    }, item.label, item.tip && /*#__PURE__*/React.createElement(PisellTooltip, {
      title: item.tip
    }, /*#__PURE__*/React.createElement(Iconfont, {
      style: {
        color: labelColor
      },
      type: "pisell2-help-circle",
      className: "pisell-lowcode-statistic-list-item-label-tip-icon"
    }))), /*#__PURE__*/React.createElement("div", {
      className: "pisell-lowcode-statistic-list-item-value",
      style: {
        color: valueColor
      }
    }, item.value), !!((_item$children = item.children) !== null && _item$children !== void 0 && _item$children.length) && /*#__PURE__*/React.createElement(Row, {
      className: "pisell-lowcode-statistic-list-item-children-wrap"
    }, item.children.map(function (child) {
      return /*#__PURE__*/React.createElement(Col, {
        span: 12,
        className: "pisell-lowcode-statistic-list-item-children-item"
      }, /*#__PURE__*/React.createElement("span", {
        className: "pisell-lowcode-statistic-list-item-children-label",
        style: {
          color: labelColor
        }
      }, child.label), /*#__PURE__*/React.createElement("span", {
        className: "pisell-lowcode-statistic-list-item-children-value",
        style: {
          color: valueColor
        }
      }, child.value));
    })));
  }));
};
export default PisellStatisticList;