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("../../../../../date-picker/index.js");
let react = require("react");
react = require_runtime.__toESM(react);
let _pisell_utils = require("@pisell/utils");
let dayjs = require("dayjs");
dayjs = require_runtime.__toESM(dayjs);
//#region src/components/table/Table/fields/date/Edit/index.tsx
const _excluded = [
	"value",
	"onChange",
	"onPressEnter",
	"onBlur",
	"style",
	"bordered"
];
const Edit = (props, ref) => {
	const { value, onChange, onPressEnter, onBlur, style, bordered } = props, others = require_objectWithoutProperties._objectWithoutProperties(props, _excluded);
	const dayjsVal = (0, react.useMemo)(() => {
		if (value && (0, _pisell_utils.isString)(value)) return (0, dayjs.default)(value);
		return value;
	}, [value]);
	return /* @__PURE__ */ react.default.createElement(require_index.default, require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, others), {}, {
		controls: false,
		ref,
		value: dayjsVal,
		onChange: (date, dateStr) => {
			onChange === null || onChange === void 0 || onChange(dateStr);
		},
		onPressEnter,
		onBlur,
		style,
		bordered,
		onClick: (e) => e.stopPropagation(),
		panelRender: (dom) => {
			return /* @__PURE__ */ react.default.createElement("div", { onClick: (e) => e.stopPropagation() }, dom);
		}
	}));
};
var Edit_default = (0, react.forwardRef)(Edit);
//#endregion
exports.default = Edit_default;
