import { _objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
import { _objectWithoutProperties } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectWithoutProperties.js";
import PisellTooltip from "../pisellTooltip/index.js";
import IconFont from "../iconfont/index.js";
import React from "react";
import { Col, Row } from "antd";
import "./index.less";
//#region src/components/pisellStatisticList/index.tsx
const _excluded = [
	"isHasBorder",
	"backgroundColors",
	"labelColor",
	"valueColor",
	"data"
];
const 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)"
];
const PisellStatisticList = (props) => {
	const { isHasBorder = true, backgroundColors = defaultColors, labelColor = "#fff", valueColor = "#fff", data } = props, others = _objectWithoutProperties(props, _excluded);
	return /* @__PURE__ */ React.createElement("div", _objectSpread2({ className: "pisell-lowcode-statistic-list-wrap" }, others), data.map((item, index) => {
		var _item$children;
		const { isLink = false, link = "", onClick } = item;
		return /* @__PURE__ */ React.createElement("div", {
			key: index,
			className: "pisell-lowcode-statistic-list-item",
			style: {
				background: backgroundColors[index % backgroundColors.length],
				border: isHasBorder ? "border: 1px solid var(--Gray-600, #475467)" : "none"
			}
		}, /* @__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 },
			onClick
		}, isLink && link ? /* @__PURE__ */ React.createElement("a", {
			href: "javascript:void(0);",
			onClick: () => {
				if (onClick) return;
				location.replace(item.link);
			}
		}, item.value || "-") : item.value || "-"), !!((_item$children = item.children) === null || _item$children === void 0 ? void 0 : _item$children.length) && /* @__PURE__ */ React.createElement(Row, { className: "pisell-lowcode-statistic-list-item-children-wrap" }, item.children.map((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 || ""));
		})));
	}));
};
//#endregion
export { PisellStatisticList as default };
