const require_runtime = require("../../_virtual/_rolldown/runtime.js");
const require_pisell_components = require("../../theme/pisell-components.js");
const require_ReadOnlyView = require("./components/ReadOnlyView.js");
const require_EditView = require("./components/EditView.js");
const require_DisabledView = require("./components/DisabledView.js");
let react = require("react");
react = require_runtime.__toESM(react);
let _pisell_utils = require("@pisell/utils");
let antd = require("antd");
require("./PisellNumber.less");
//#region src/components/pisellNumber/PisellNumber.tsx
/**
* PisellNumber 数值组件
* 
* 通用的数值输入/展示组件，支持只读、编辑、禁用三种状态。
* 基于 Ant Design InputNumber 组件开发，提供完整的校验框架。
* 
* @param props 组件 Props
* 
* @example
* // 受控模式
* const [value, setValue] = useState(0);
* <PisellNumber 
*   value={value}
*   onChange={setValue}
*   min={0}
*   max={100}
* />
* 
* @example
* // 非受控模式
* <PisellNumber 
*   defaultValue={10}
*   min={0}
*   max={999}
*   step={10}
* />
* 
* @example
* // 只读态
* <PisellNumber 
*   mode="read"
*   value={1234.567}
*   precision={2}
*   useGrouping
* />
*/
const PisellNumber = (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());
};
const MemoizedPisellNumber = react.default.memo(PisellNumber, (prevProps, nextProps) => {
	return prevProps.value === nextProps.value && prevProps.mode === nextProps.mode && prevProps.disabled === nextProps.disabled;
});
//#endregion
exports.default = MemoizedPisellNumber;
