const require_runtime = require("../../../_virtual/_rolldown/runtime.js");
const require_objectSpread2 = require("../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
const require_rangeConverter = require("../utils/rangeConverter.js");
const require_percentFormatter = require("../utils/percentFormatter.js");
let react = require("react");
react = require_runtime.__toESM(react);
let antd = require("antd");
//#region src/components/pisellPercent/components/ReadOnlyView.tsx
/**
* PisellPercent 只读态视图组件
* 
* 根据 variant 渲染不同形式：
* - text: 纯文本（85.5%）
* - progress: 进度条
* - circle: 环形进度
* 
* @param props 组件 Props
*/
const ReadOnlyView = (props) => {
	const { value, variant = "text", showPercentSymbol = true, precision = 1, range = [0, 100], progressProps, circleProps, emptyText = "-", fontSize, fontWeight, color, textAlign = "left", className, style, "aria-label": ariaLabel } = props;
	if (variant === "progress" || variant === "circle") {
		const percentValue = require_rangeConverter.convertToPercent(value, range);
		if (percentValue === null) return /* @__PURE__ */ react.default.createElement("span", {
			className: `pisell-percent pisell-percent-read ${className || ""}`,
			style
		}, emptyText);
		if (variant === "progress") return /* @__PURE__ */ react.default.createElement("div", {
			className: `pisell-percent pisell-percent-progress ${className || ""}`,
			style
		}, /* @__PURE__ */ react.default.createElement(antd.Progress, require_objectSpread2._objectSpread2({ percent: percentValue }, progressProps)));
		return /* @__PURE__ */ react.default.createElement("div", {
			className: `pisell-percent pisell-percent-circle ${className || ""}`,
			style
		}, /* @__PURE__ */ react.default.createElement(antd.Progress, require_objectSpread2._objectSpread2({
			type: "circle",
			percent: percentValue
		}, circleProps)));
	}
	const displayValue = require_percentFormatter.formatPercent(value, {
		showPercentSymbol,
		precision,
		range
	});
	const text = displayValue !== null && displayValue !== void 0 ? displayValue : emptyText;
	const combinedStyle = require_objectSpread2._objectSpread2({
		fontSize,
		fontWeight,
		color,
		textAlign
	}, style);
	return /* @__PURE__ */ react.default.createElement("span", {
		className: `pisell-percent pisell-percent-read ${className || ""}`,
		style: combinedStyle,
		"aria-label": ariaLabel
	}, text);
};
//#endregion
exports.default = ReadOnlyView;
