const require_runtime = require("../../_virtual/_rolldown/runtime.js");
const require_ReadOnlyView = require("./components/ReadOnlyView.js");
const require_EditView = require("./components/EditView.js");
const require_DisabledView = require("./components/DisabledView.js");
const require_pisell_components = require("../../theme/pisell-components.js");
let react = require("react");
react = require_runtime.__toESM(react);
let _pisell_utils = require("@pisell/utils");
let antd = require("antd");
require("./PisellSingleLineText.less");
//#region src/components/pisellSingleLineText/PisellSingleLineText.tsx
/**
* PisellSingleLineText 单行文本组件
*
* 通用的单行文本输入/展示组件，支持只读、编辑、禁用三种状态。
* 基于 Ant Design Input 组件开发，提供完整的校验框架。
*
* @param props 组件 Props
*
* @example
* // 受控模式
* const [value, setValue] = useState('');
* <PisellSingleLineText
*   value={value}
*   onChange={(v) => setValue(v)}
*   placeholder="请输入"
* />
*
* @example
* // 非受控模式
* <PisellSingleLineText
*   defaultValue="初始值"
*   required
*   minLength={3}
* />
*
* @example
* // 只读态
* <PisellSingleLineText
*   mode="read"
*   value="这是一段很长的文本内容"
*   ellipsis
*   showTooltip
* />
*/
const PisellSingleLineText = (props) => {
	const { mode = "edit", disabled = false } = props;
	const displayState = (0, _pisell_utils.getDisplayState)(mode, disabled);
	const render = () => {
		switch (displayState) {
			case "read": return /* @__PURE__ */ react.default.createElement(require_ReadOnlyView.default, props);
			case "edit": return /* @__PURE__ */ react.default.createElement(require_EditView.default, props);
			case "disabled": return /* @__PURE__ */ react.default.createElement(require_DisabledView.default, props);
			default: return null;
		}
	};
	const theme = require_pisell_components.getPisellComponentsThemeConfig();
	return /* @__PURE__ */ react.default.createElement(antd.ConfigProvider, { theme }, render());
};
var PisellSingleLineText_default = react.default.memo(PisellSingleLineText, (prevProps, nextProps) => {
	return prevProps.value === nextProps.value && prevProps.mode === nextProps.mode && prevProps.disabled === nextProps.disabled;
});
//#endregion
exports.default = PisellSingleLineText_default;
