import { withFormItem } from "../../dataSourceForm/utils.js";
import DatePickerWithMode from "./WithMode.js";
import dayjs from "dayjs";
//#region src/components/dataSourceComponents/fields/DatePicker/index.tsx
/**
* @title: 数据源日期选择器组件
* @description: 支持表单项包装的日期选择器组件
*/
const DatePicker = withFormItem(DatePickerWithMode, {
	innerProps: { style: { width: "100%" } },
	otherFormItemProps: (props) => {
		return {
			normalize: (value) => value && dayjs(value).format(props.submitFormat || "YYYY-MM-DD"),
			getValueProps: (value) => ({ value: value && dayjs(value) })
		};
	}
});
//#endregion
export { DatePicker as default };
