import { ElDatePicker as m } from "element-plus/es";
import { defineComponent as D, createElementBlock as c, openBlock as p, createVNode as r } from "vue";
const f = { class: "CiCommonListStartEndDatePicker" }, V = {
  name: "CiCommonListStartEndDatePicker",
  inheritAttrs: !1
  // 禁止继承外部传递给组件的属性（例如 class、style 等）
}, T = /* @__PURE__ */ D({
  ...V,
  props: {
    startPlaceholder: { default: "开始日期" },
    endPlaceholder: { default: "结束日期" },
    startDateValue: { default: "" },
    endDateValue: { default: "" },
    requireEndDateBeforeToday: { type: Boolean, default: !1 }
  },
  emits: ["update:startDateValue", "update:endDateValue"],
  setup(n, { emit: s }) {
    const o = s, a = n, u = (e) => a.endDateValue ? e.getTime() > new Date(a.endDateValue).getTime() : !1, i = (e) => {
      const t = a.startDateValue ? e.getTime() < new Date(a.startDateValue).getTime() - 864e5 : !1, l = /* @__PURE__ */ new Date();
      l.setHours(0, 0, 0, 0);
      const d = a.requireEndDateBeforeToday ? e.getTime() > l.getTime() : !1;
      return t || d;
    };
    return (e, t) => {
      const l = m;
      return p(), c("div", f, [
        r(l, {
          class: "startDatePicker",
          "value-format": "YYYY-MM-DD",
          type: "date",
          placeholder: e.startPlaceholder,
          "model-value": e.startDateValue,
          "onUpdate:modelValue": t[0] || (t[0] = (d) => o("update:startDateValue", d)),
          "disabled-date": u
        }, null, 8, ["placeholder", "model-value"]),
        r(l, {
          class: "endDatePicker",
          "value-format": "YYYY-MM-DD",
          type: "date",
          placeholder: e.endPlaceholder,
          "model-value": e.endDateValue,
          "onUpdate:modelValue": t[1] || (t[1] = (d) => o("update:endDateValue", d)),
          "disabled-date": i
        }, null, 8, ["placeholder", "model-value"])
      ]);
    };
  }
});
export {
  T as default
};
