import { getPisellComponentsThemeConfig } from "../../theme/pisell-components.js";
import ReadOnlyView from "./components/ReadOnlyView.js";
import EditView from "./components/EditView.js";
import DisabledView from "./components/DisabledView.js";
import React from "react";
import { getDisplayState } from "@pisell/utils";
import { ConfigProvider } from "antd";
import "./PisellLongText.less";
//#region src/components/pisellLongText/PisellLongText.tsx
/**
* PisellLongText 长文本/多行文本组件
* 
* 多行文本输入/展示组件，支持只读、编辑、禁用三种状态。
* 基于 Ant Design TextArea 组件开发，提供展开/折叠功能和完整的校验框架。
* 
* @param props 组件 Props
* 
* @example
* // 编辑态
* <PisellLongText 
*   placeholder="请输入内容"
*   rows={3}
*   maxLength={500}
*   showCount
* />
* 
* @example
* // 只读态（展开折叠）
* <PisellLongText 
*   mode="read"
*   value={longText}
*   maxLines={3}
*   enableExpand
* />
* 
* @example
* // 自动高度
* <PisellLongText 
*   autoSize={{ minRows: 3, maxRows: 10 }}
*   placeholder="自动调整高度"
* />
*/
const PisellLongText = (props) => {
	const { mode = "edit", disabled = false } = props;
	const displayState = getDisplayState(mode, disabled);
	const render = () => {
		switch (displayState) {
			case "read": return /* @__PURE__ */ React.createElement(ReadOnlyView, props);
			case "edit": return /* @__PURE__ */ React.createElement(EditView, props);
			case "disabled": return /* @__PURE__ */ React.createElement(DisabledView, props);
			default: return null;
		}
	};
	const theme = getPisellComponentsThemeConfig();
	return /* @__PURE__ */ React.createElement(ConfigProvider, { theme }, render());
};
var PisellLongText_default = React.memo(PisellLongText, (prevProps, nextProps) => {
	return prevProps.value === nextProps.value && prevProps.mode === nextProps.mode && prevProps.disabled === nextProps.disabled;
});
//#endregion
export { PisellLongText_default as default };
