const require_runtime = require("../../_virtual/_rolldown/runtime.js");
const require_objectSpread2 = require("../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
const require_objectWithoutProperties = require("../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectWithoutProperties.js");
const require_index = require("./index.js");
let react = require("react");
react = require_runtime.__toESM(react);
let antd = require("antd");
//#region src/components/pisellAdjustPrice/PisellAdjustPriceInputNumber.tsx
const _excluded = [
	"value",
	"onChange",
	"originValue",
	"size",
	"prefix",
	"disabled"
];
const PisellAdjustPriceInputNumber = (props) => {
	const { value, onChange, originValue, size, prefix, disabled } = props, others = require_objectWithoutProperties._objectWithoutProperties(props, _excluded);
	const [open, setOpen] = (0, react.useState)(false);
	const handleChange = (val) => {
		setOpen(false);
		onChange === null || onChange === void 0 || onChange(Number(val.toFixed(2)));
	};
	const content = (0, react.useMemo)(() => {
		return /* @__PURE__ */ react.default.createElement(require_index.default, {
			key: `${open}`,
			originValue,
			defaultValue: value,
			value,
			onChange: handleChange
		});
	}, [
		originValue,
		value,
		open
	]);
	return /* @__PURE__ */ react.default.createElement(antd.Popover, {
		open,
		content,
		trigger: ["click"],
		overlayInnerStyle: { padding: 0 },
		onOpenChange: (val) => setOpen(val),
		destroyTooltipOnHide: true,
		arrow: false,
		align: { offset: [0, 20] }
	}, /* @__PURE__ */ react.default.createElement("span", null, /* @__PURE__ */ react.default.createElement(antd.InputNumber, require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, others), {}, {
		disabled,
		prefix,
		size: size || "large",
		value,
		readOnly: true
	}))));
};
//#endregion
exports.default = PisellAdjustPriceInputNumber;
