var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/components/pisellStatisticList/index.tsx
var pisellStatisticList_exports = {};
__export(pisellStatisticList_exports, {
  default: () => pisellStatisticList_default
});
module.exports = __toCommonJS(pisellStatisticList_exports);
var import_react = __toESM(require("react"));
var import_antd = require("antd");
var import_pisellTooltip = __toESM(require("../pisellTooltip"));
var import_iconfont = __toESM(require("../iconfont"));
var import_index = require("./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 = (props) => {
  const {
    isHasBorder = true,
    backgroundColors = defaultColors,
    labelColor = "#fff",
    valueColor = "#fff",
    data,
    ...others
  } = props;
  return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-statistic-list-wrap", ...others }, data.map((item, index) => {
    var _a;
    const { isLink = false, link = "", onClick } = item;
    return /* @__PURE__ */ import_react.default.createElement(
      "div",
      {
        className: "pisell-lowcode-statistic-list-item",
        style: {
          background: backgroundColors[index % backgroundColors.length],
          border: isHasBorder ? "border: 1px solid var(--Gray-600, #475467)" : "none"
        }
      },
      /* @__PURE__ */ import_react.default.createElement(
        "div",
        {
          className: "pisell-lowcode-statistic-list-item-label",
          style: { color: labelColor }
        },
        item.label,
        item.tip && /* @__PURE__ */ import_react.default.createElement(import_pisellTooltip.default, { title: item.tip }, /* @__PURE__ */ import_react.default.createElement(
          import_iconfont.default,
          {
            style: { color: labelColor },
            type: "pisell2-help-circle",
            className: "pisell-lowcode-statistic-list-item-label-tip-icon"
          }
        ))
      ),
      /* @__PURE__ */ import_react.default.createElement(
        "div",
        {
          className: "pisell-lowcode-statistic-list-item-value",
          style: { color: valueColor },
          onClick
        },
        isLink && link ? /* @__PURE__ */ import_react.default.createElement(
          "a",
          {
            href: "javascript:void(0);",
            onClick: () => {
              if (onClick) return;
              location.replace(item.link);
            }
          },
          item.value || "-"
        ) : item.value || "-"
      ),
      !!((_a = item.children) == null ? void 0 : _a.length) && /* @__PURE__ */ import_react.default.createElement(import_antd.Row, { className: "pisell-lowcode-statistic-list-item-children-wrap" }, item.children.map((child) => {
        return /* @__PURE__ */ import_react.default.createElement(
          import_antd.Col,
          {
            span: 12,
            className: "pisell-lowcode-statistic-list-item-children-item"
          },
          /* @__PURE__ */ import_react.default.createElement(
            "span",
            {
              className: "pisell-lowcode-statistic-list-item-children-label",
              style: { color: labelColor }
            },
            child.label
          ),
          /* @__PURE__ */ import_react.default.createElement(
            "span",
            {
              className: "pisell-lowcode-statistic-list-item-children-value",
              style: { color: valueColor }
            },
            child.value || ""
          )
        );
      }))
    );
  }));
};
var pisellStatisticList_default = PisellStatisticList;
