import '@das-fed/ui/packages/components/date-picker/style.css';
import { withInstall as ie } from "@das-fed/utils/with-install/index";
import { defineComponent as de, useCssVars as pe, computed as p, ref as n, watch as Q, createElementBlock as I, openBlock as v, normalizeStyle as U, normalizeClass as ye, unref as a, createVNode as C, createCommentVNode as w, withCtx as c, withDirectives as ce, createBlock as q, mergeProps as ae, isRef as Se, createSlots as Pe, renderSlot as $, normalizeProps as be, guardReactiveProps as ke, createElementVNode as E, toDisplayString as x, Fragment as te, nextTick as X, useAttrs as Be, renderList as Me, withModifiers as Ne, createTextVNode as Le } from "vue";
import { ConfigProvider as ge, DatePicker as Re, RangePicker as xe, Dropdown as Fe, Menu as We, MenuItem as Ze, TimePicker as Ae, TimeRangePicker as qe } from "ant-design-vue";
import { DasAutoRegisterIcon as ze, DasIcon as J } from "@das-fed/ui/packages/components/icon/index";
import { DasTooltip as we } from "@das-fed/ui/packages/components/tooltip/index";
import { DasErrorOverlayModel as ve } from "@das-fed/ui/packages/components/error-overlay-model/index";
import { useModelValue as Y } from "@das-fed/utils/vue";
import { vHoverInside as fe } from "@das-fed/utils/directive/hoverInside/index";
import { useZIndex as Te } from "@das-fed/utils/hooks/popup-manager/use-zindex";
import { getVarValue as me, getVar as Oe, setThemeRule as He } from "@das-fed/web/packages/theme/index";
import { currentLang as G, t as ne, setI18nRule as _e } from "@das-fed/web/packages/i18n/index";
import { calcTextWidth as Ie } from "@das-fed/utils/common-tools";
import "ant-design-vue/es/date-picker/style/css";
import "ant-design-vue/es/config-provider/style/css";
import Ce from "ant-design-vue/es/locale/zh_CN";
import $e from "ant-design-vue/es/locale/en_GB";
import "dayjs/locale/zh-cn";
import "dayjs/locale/en";
import { DasDatePicker as De } from "@das-fed/ui/packages/components/date-picker/index";
import Ve from "dayjs";
import "ant-design-vue/es/dropdown/style/css";
import "ant-design-vue/es/menu/style/css";
import { DasIconDengdai as Ue } from "@das-fed/ui/packages/icons/dengdai/index";
import "ant-design-vue/es/time-picker/style/css";
const Ye = { class: "ant-picker-cell-inner" }, je = {
  key: 0,
  class: "das-date-picker-error-label-content"
}, Ke = {
  name: "DasDatePicker"
}, Xe = /* @__PURE__ */ de({
  ...Ke,
  props: {
    modelValue: {},
    borderType: { default: "underline" },
    size: { default: "middle" },
    width: { default: "230px" },
    height: {},
    showToday: { type: Boolean, default: !1 },
    disabled: { type: Boolean, default: !1 },
    isView: { type: Boolean, default: !1 },
    error: { type: Boolean, default: !1 },
    errorLabel: {},
    errorMode: { default: "default" },
    dropdownClassName: { default: "" },
    placeholder: { default: "" },
    teleported: { type: Boolean, default: !0 },
    errorModelZIndex: { default: 2e3 },
    noSetDefaultVal: { type: Boolean, default: !1 },
    isTooltip: { type: Boolean, default: !0 }
  },
  emits: ["change", "openChange", "update:model-value", "update:error"],
  setup(F, { expose: A, emit: s }) {
    pe((r) => ({
      a0cc796a: N.value,
      "29cfac42": P.value
    }));
    const o = F, f = s;
    ze({
      right: import("@das-fed/ui/packages/icons/right"),
      left: import("@das-fed/ui/packages/icons/left"),
      "double-arrow-left": import("@das-fed/ui/packages/icons/double-arrow-left"),
      "double-arrow-right": import("@das-fed/ui/packages/icons/double-arrow-right"),
      riqixuanze: import("@das-fed/ui/packages/icons/riqixuanze")
    });
    const O = p(() => G.value === "zh-CN" ? Ce : $e), t = n(null), V = n(null), d = Y(o, "modelValue"), L = Y(o, "error"), W = p(() => o.isView ? o.noSetDefaultVal ? "" : "-" : o.placeholder || ne("请选择日期")), H = p(() => ({
      width: o.width
    })), N = p(() => o.width ? o.width : "230px"), P = p(() => o.height ? o.height : "auto"), B = n(3e3), Z = p(() => ({
      "z-index": B.value
    })), M = n(!1), _ = n({
      display: "block",
      color: me("--das-ui-date-picker-overlay-error-color").value,
      "white-space": "break-spaces"
    }), b = n(!1), T = n(""), R = p(() => d.value ? T.value : W.value), j = () => {
      const r = o.size === "table" ? 12 : 14;
      return Ie(W.value, r);
    }, k = () => {
      var l;
      const r = (l = t.value) == null ? void 0 : l.$el.querySelector(".ant-picker-input>input");
      return d.value ? r == null ? void 0 : r.scrollWidth : j();
    }, m = () => {
      var e;
      const r = (e = t.value) == null ? void 0 : e.$el.querySelector(".ant-picker-input>input");
      return r ? (T.value = r.getAttribute("value"), console.log("currValueFmt.value===", T.value), r.removeAttribute("title"), (r == null ? void 0 : r.offsetWidth) ?? 0) : 0;
    }, D = n(0), u = n(0);
    Q(() => [W.value, d.value], () => {
      X(() => {
        D.value = m(), u.value = k(), (D.value === u.value || u.value - D.value < 1) && (b.value = !1);
      });
    });
    const S = n();
    Q(
      () => {
        var r;
        return (r = V.value) == null ? void 0 : r.$tooltipRef.popperRef.contentRef;
      },
      (r) => {
        r && (r.addEventListener("mouseenter", function() {
          console.log("进入tooltip"), b.value = !0, S.value && clearTimeout(S.value);
        }), r.addEventListener("mouseleave", function() {
          console.log("离开toolTip"), S.value = setTimeout(() => {
            b.value = !1;
          }, 200);
        }));
      }
    );
    const g = (r) => {
      r && (B.value = Te().nextZIndex()), f("openChange", r), G.value === "en" && X(() => {
        const l = document == null ? void 0 : document.querySelectorAll(".ant-picker-ok > .ant-btn > span");
        for (let e of l)
          e && (e.innerText = "OK");
      });
    }, ee = () => {
      D.value = m(), u.value = k(), D.value === u.value || u.value - D.value < 1 ? b.value = !1 : (b.value = !0, S.value && clearTimeout(S.value)), M.value = !0;
    }, re = () => {
      S.value = setTimeout(() => {
        b.value = !1;
      }, 200), M.value = !1;
    }, le = (r, l) => {
      r ? ee() : re();
    }, oe = (r, l) => {
      L.value = !1, f("update:error", L.value), f("update:model-value", r), f("change", r, l);
    };
    return A({
      $datePicker: t,
      blur: () => {
        t.value.blur();
      },
      focus: () => {
        t.value.focus();
      }
    }), (r, l) => (v(), I(
      "div",
      {
        class: ye(["das-ui-date-picker", [r.borderType, o.isView ? "readonly" : "", a(L) ? "is-error" : ""]]),
        style: U(H.value)
      },
      [
        C(a(ge), { locale: O.value }, {
          default: c(() => [
            C(a(we), {
              ref_key: "inputTooltipRef",
              ref: V,
              placement: "top",
              trigger: "hover",
              visible: b.value,
              disabled: !r.isTooltip,
              content: R.value
            }, {
              default: c(() => [
                ce((v(), q(a(Re), ae({
                  ref_key: "$datePicker",
                  ref: t
                }, r.$attrs, {
                  value: a(d),
                  "onUpdate:value": l[0] || (l[0] = (e) => Se(d) ? d.value = e : null),
                  size: o.size,
                  dropdownClassName: "das-ui-date-picker-dropdown " + r.dropdownClassName,
                  placeholder: W.value,
                  showToday: r.showToday,
                  bordered: r.borderType === "bordered",
                  disabled: o.disabled || o.isView,
                  style: H.value,
                  popupStyle: Z.value,
                  onChange: oe,
                  onOpenChange: g
                }), Pe({
                  dateRender: c((e) => [
                    $(r.$slots, "dateRender", be(ke(e)), () => [
                      E(
                        "div",
                        Ye,
                        x(e.current.date()),
                        1
                        /* TEXT */
                      )
                    ], !0)
                  ]),
                  nextIcon: c(() => [
                    $(r.$slots, "nextIcon", {}, () => [
                      C(a(J), {
                        icon: "right",
                        size: "medium"
                      })
                    ], !0)
                  ]),
                  prevIcon: c(() => [
                    $(r.$slots, "prevIcon", {}, () => [
                      C(a(J), {
                        icon: "left",
                        size: "medium"
                      })
                    ], !0)
                  ]),
                  superNextIcon: c(() => [
                    $(r.$slots, "superNextIcon", {}, () => [
                      C(a(J), {
                        icon: "double-arrow-right",
                        size: "medium"
                      })
                    ], !0)
                  ]),
                  superPrevIcon: c(() => [
                    $(r.$slots, "superPrevIcon", {}, () => [
                      C(a(J), {
                        icon: "double-arrow-left",
                        size: "medium"
                      })
                    ], !0)
                  ]),
                  suffixIcon: c(() => [
                    $(r.$slots, "suffixIcon", {}, () => [
                      C(a(J), {
                        class: "das-suffix-icon",
                        icon: "riqixuanze",
                        size: "medium"
                      })
                    ], !0)
                  ]),
                  _: 2
                  /* DYNAMIC */
                }, [
                  r.$slots.renderExtraFooter ? {
                    name: "renderExtraFooter",
                    fn: c(() => [
                      $(r.$slots, "renderExtraFooter", {}, void 0, !0)
                    ]),
                    key: "0"
                  } : void 0
                ]), 1040, ["value", "size", "dropdownClassName", "placeholder", "showToday", "bordered", "disabled", "style", "popupStyle"])), [
                  [a(fe), le]
                ])
              ]),
              _: 3
              /* FORWARDED */
            }, 8, ["visible", "disabled", "content"])
          ]),
          _: 3
          /* FORWARDED */
        }, 8, ["locale"]),
        r.error && r.errorLabel ? (v(), I(
          te,
          { key: 0 },
          [
            r.errorMode === "default" ? (v(), I("div", je, [
              E(
                "span",
                {
                  style: U(_.value)
                },
                x(r.errorLabel),
                5
                /* TEXT, STYLE */
              )
            ])) : w("v-if", !0),
            r.errorMode === "overlay" && M.value ? (v(), q(a(ve), {
              key: 1,
              errorLabel: r.errorLabel,
              getEl: () => {
                var e;
                return (e = t.value) == null ? void 0 : e.$el;
              },
              errorModelZIndex: r.errorModelZIndex
            }, null, 8, ["errorLabel", "getEl", "errorModelZIndex"])) : w("v-if", !0)
          ],
          64
          /* STABLE_FRAGMENT */
        )) : w("v-if", !0)
      ],
      6
      /* CLASS, STYLE */
    ));
  }
}), he = (F, A) => {
  const s = F.__vccOpts || F;
  for (const [o, f] of A)
    s[o] = f;
  return s;
}, Ge = /* @__PURE__ */ he(Xe, [["__scopeId", "data-v-32d994b8"]]), Je = { class: "date-range-separator" }, Qe = {
  key: 0,
  class: "das-date-picker-error-label-content"
}, er = {
  name: "DasDateRangePicker"
}, rr = /* @__PURE__ */ de({
  ...er,
  props: {
    modelValue: {},
    borderType: { default: "bordered" },
    size: {},
    width: { default: "428px" },
    height: {},
    itemWidth: { default: "200px" },
    format: { default: "YYYY/MM/DD HH:mm:ss" },
    valueFormat: {},
    showToday: { type: Boolean, default: !1 },
    separator: { default: "~" },
    disabledDate: {},
    placeholder: { default: void 0 },
    error: { type: Boolean },
    errorLabel: {},
    errorMode: { default: "default" },
    teleported: { type: Boolean, default: !0 },
    errorModelZIndex: { default: 2e3 },
    noSetDefaultVal: { type: Boolean },
    prevAttrs: {},
    nextAttrs: {},
    disabledUnit: {}
  },
  emits: ["change", "openChange", "update:model-value", "update:error"],
  setup(F, { emit: A }) {
    pe((u) => ({
      "09130af1": L.value,
      "222852bc": d.value
    }));
    const s = F, o = A, f = Be(), O = p(() => s.placeholder ?? [ne("开始日期"), ne("结束日期")]), t = Y(s, "modelValue"), V = Y(s, "error"), d = p(() => s.width ? s.width : "230px"), L = p(() => s.height ? s.height : "auto"), W = p(() => ({ ...f, ...s.prevAttrs })), H = p(() => ({ ...f, ...s.nextAttrs })), N = n(), P = n(!1), B = n({
      display: "block",
      color: me("--das-ui-date-picker-overlay-error-color").value,
      "white-space": "break-spaces"
    }), Z = () => {
      P.value = !0;
    }, M = () => {
      P.value = !1;
    }, _ = (u, h) => {
      u ? Z() : M();
    }, b = (u, h) => {
      o("openChange", u, h), G.value === "en" && X(() => {
        const S = document == null ? void 0 : document.querySelectorAll(".ant-picker-ok > .ant-btn > span");
        for (let g of S)
          g && (g.innerText = "OK");
      });
    }, T = p(() => {
      let u = s.valueFormat ? s.valueFormat : s.format;
      return [
        t.value[0] ? Ve.isDayjs(t.value[0]) ? t.value[0].format(u) : t.value[0] : "",
        t.value[1] ? Ve.isDayjs(t.value[1]) ? t.value[1].format(u) : t.value[1] : ""
      ];
    }), R = (u) => s.disabledDate && s.disabledDate(u) === !0 ? !0 : !!(t.value[1] && u.isAfter(t.value[1], s.disabledUnit || void 0)), j = (u) => s.disabledDate && s.disabledDate(u) === !0 ? !0 : !!(t.value[0] && u.isBefore(t.value[0], s.disabledUnit || void 0)), k = p(() => ({
      width: s.width
    })), m = (u, h) => {
      V.value = !1, console.log("currValue", t.value), o("update:model-value", t.value), o("change", t.value, T.value);
    }, D = (u, h) => {
      V.value = !1, console.log("currValue", t.value, T.value), o("update:model-value", t.value), o("change", t.value, T.value);
    };
    return (u, h) => ce((v(), I(
      "div",
      {
        class: "das-ui-date-range-picker",
        style: U(k.value),
        ref_key: "$dateRange",
        ref: N
      },
      [
        C(a(De), ae(W.value, {
          modelValue: a(t)[0],
          "onUpdate:modelValue": h[0] || (h[0] = (S) => a(t)[0] = S),
          format: s.format,
          size: s.size,
          valueFormat: s.valueFormat,
          borderType: s.borderType,
          error: a(V),
          width: s.itemWidth,
          "disabled-date": R,
          placeholder: O.value[0],
          onChange: m,
          onOpenChange: h[1] || (h[1] = (S) => b(S, "before"))
        }), null, 16, ["modelValue", "format", "size", "valueFormat", "borderType", "error", "width", "placeholder"]),
        $(u.$slots, "separator", {}, () => [
          E(
            "span",
            Je,
            x(s.separator),
            1
            /* TEXT */
          )
        ], !0),
        C(a(De), ae(H.value, {
          modelValue: a(t)[1],
          "onUpdate:modelValue": h[2] || (h[2] = (S) => a(t)[1] = S),
          format: s.format,
          size: s.size,
          valueFormat: s.valueFormat,
          borderType: s.borderType,
          error: a(V),
          width: s.itemWidth,
          "disabled-date": j,
          placeholder: O.value[1],
          onChange: D,
          onOpenChange: h[3] || (h[3] = (S) => b(S, "after"))
        }), null, 16, ["modelValue", "format", "size", "valueFormat", "borderType", "error", "width", "placeholder"]),
        u.error && u.errorLabel ? (v(), I(
          te,
          { key: 0 },
          [
            u.errorMode === "default" ? (v(), I("div", Qe, [
              E(
                "span",
                {
                  style: U(B.value)
                },
                x(u.errorLabel),
                5
                /* TEXT, STYLE */
              )
            ])) : w("v-if", !0),
            u.errorMode === "overlay" && P.value ? (v(), q(a(ve), {
              key: 1,
              errorLabel: u.errorLabel,
              getEl: () => N.value,
              errorModelZIndex: u.errorModelZIndex
            }, null, 8, ["errorLabel", "getEl", "errorModelZIndex"])) : w("v-if", !0)
          ],
          64
          /* STABLE_FRAGMENT */
        )) : w("v-if", !0)
      ],
      4
      /* STYLE */
    )), [
      [a(fe), _]
    ]);
  }
}), lr = /* @__PURE__ */ he(rr, [["__scopeId", "data-v-ba0b3b1e"]]), or = { class: "ant-picker-cell-inner" }, tr = { class: "das-picker-footer-extra" }, ar = {
  key: 0,
  class: "das-picker-ranges"
}, nr = { class: "das-picker-preset-span" }, ur = ["onClick"], sr = {
  key: 0,
  class: "das-date-picker-error-label-content"
}, ir = {
  name: "DasRangePicker"
}, dr = /* @__PURE__ */ de({
  ...ir,
  props: {
    modelValue: {},
    borderType: { default: "underline" },
    size: { default: "middle" },
    width: { default: "230px" },
    height: {},
    format: { default: "YYYY/MM/DD HH:mm:ss" },
    showToday: { type: Boolean, default: !1 },
    ranges: { default: [] },
    disabled: { type: Boolean, default: !1 },
    isView: { type: Boolean, default: !1 },
    error: { type: Boolean, default: !1 },
    errorLabel: {},
    errorMode: { default: "default" },
    showTime: {},
    dropdownClassName: { default: "" },
    placeholder: { default: ["开始日期", "结束日期"] },
    teleported: { type: Boolean, default: !0 },
    errorModelZIndex: { default: 2e3 },
    noSetDefaultVal: { type: Boolean },
    isTooltip: { type: Boolean, default: !0 }
  },
  emits: ["change", "openChange", "update:model-value", "update:error"],
  setup(F, { expose: A, emit: s }) {
    pe((e) => ({
      "5a859b9a": W.value,
      "4742445a": H.value
    }));
    const o = F, f = s;
    ze({
      fold: import("@das-fed/ui/packages/icons/fold"),
      riqixuanze: import("@das-fed/ui/packages/icons/riqixuanze")
    });
    const O = p(() => G.value === "zh-CN" ? Ce : $e), t = n(null), V = n(null), d = Y(o, "modelValue"), L = Y(o, "error"), W = p(() => o.width ? o.width : "230px"), H = p(() => o.height ? o.height : "auto"), N = n(3e3), P = p(() => ({
      "z-index": N.value
    })), B = n(!1), Z = n({
      display: "block",
      color: me("--das-ui-date-picker-overlay-error-color").value,
      "white-space": "break-spaces"
    }), M = p(() => {
      var e;
      return o.isView ? o.noSetDefaultVal ? ["", ""] : ["-", "-"] : (e = o.placeholder) == null ? void 0 : e.map((i) => ne(i));
    }), _ = p(() => ({
      width: o.width
    })), b = n(!1), T = n(["", ""]), R = n("~"), j = p(() => {
      var e;
      return (e = d.value) != null && e.length && d.value[0] && d.value[1] ? T.value.join(" " + R.value + " ") : M.value.join(" " + R.value + " ");
    }), k = n([0, 0]), m = n([0, 0]), D = () => {
      var z;
      let e = [];
      const i = (z = t.value) == null ? void 0 : z.$el.querySelectorAll(".ant-picker-input>input");
      if (!i)
        return e = [0, 0], e;
      let y = [];
      for (let K of i) {
        y.push(K.getAttribute("value") || "");
        let Ee = (K == null ? void 0 : K.offsetWidth) ?? 0;
        e.push(Ee);
      }
      return T.value = y, console.log("currValueFmt.value===", T.value), e;
    }, u = (e) => {
      const i = o.size === "table" ? 12 : 14;
      return Ie(e, i);
    }, h = () => {
      var y;
      let e = [];
      return ((y = t.value) == null ? void 0 : y.$el.querySelectorAll(".ant-picker-input>input")).forEach((z, K) => {
        d.value.length && d.value[0] && d.value[0] ? e.push(z == null ? void 0 : z.scrollWidth) : e.push(u(M.value[K]));
      }), e;
    };
    Q(() => [M.value, d.value], () => {
      X(() => {
        k.value = D(), m.value = h(), (k.value[0] === m.value[0] || m.value[0] - k.value[0] < 1) && (k.value[1] === m.value[1] || m.value[1] - k.value[1] < 1) && (b.value = !1);
      });
    });
    const g = n();
    Q(
      () => {
        var e;
        return (e = V.value) == null ? void 0 : e.$tooltipRef.popperRef.contentRef;
      },
      (e) => {
        e && (e.addEventListener("mouseenter", function() {
          console.log("进入tooltip"), b.value = !0, g.value && clearTimeout(g.value);
        }), e.addEventListener("mouseleave", function() {
          console.log("离开toolTip"), g.value = setTimeout(() => {
            b.value = !1;
          }, 200);
        }));
      }
    );
    const ee = (e) => {
      e && (N.value = Te().nextZIndex()), f("openChange", e), G.value === "en" && X(() => {
        const i = document == null ? void 0 : document.querySelectorAll(".ant-picker-ok > .ant-btn > span");
        for (let y of i)
          y && (y.innerText = "OK");
      });
    }, re = () => {
      k.value = D(), m.value = h(), (k.value[0] === m.value[0] || m.value[0] - k.value[0] < 1) && (k.value[1] === m.value[1] || m.value[1] - k.value[1] < 1) ? b.value = !1 : (b.value = !0, g.value && clearTimeout(g.value)), B.value = !0;
    }, le = () => {
      g.value = setTimeout(() => {
        b.value = !1;
      }, 200), B.value = !1;
    }, oe = (e, i) => {
      e ? re() : le();
    }, ue = (e, i) => {
      if (console.log("pickerChange", e), L.value = !1, e === null) {
        f("update:model-value", [null, null]), f("change", [null, null], i);
        return;
      }
      f("update:error", L.value), f("update:model-value", e), f("change", e, i);
    }, se = (e) => {
      f("update:model-value", e.value), f("change", e.value, [e.value[0].format(o.format), e.value[1].format(o.format)]), t.value.blur();
    };
    return A({
      $rangePicker: t,
      blur: () => {
        t.value.blur();
      },
      focus: () => {
        t.value.focus();
      }
    }), (e, i) => (v(), I(
      "div",
      {
        class: ye(["das-ui-range-picker", [e.borderType, o.isView ? "readonly" : "", a(L) ? "is-error" : ""]]),
        style: U(_.value)
      },
      [
        C(a(ge), { locale: O.value }, {
          default: c(() => [
            C(a(we), {
              ref_key: "inputTooltipRef",
              ref: V,
              placement: "top",
              trigger: "hover",
              visible: b.value,
              disabled: !e.isTooltip,
              content: j.value
            }, {
              default: c(() => [
                ce((v(), q(a(xe), ae({
                  ref_key: "$rangePicker",
                  ref: t
                }, e.$attrs, {
                  value: a(d),
                  format: e.format,
                  size: o.size,
                  dropdownClassName: "das-ui-range-picker-dropdown " + e.dropdownClassName,
                  placeholder: M.value,
                  showToday: e.showToday,
                  showTime: e.showTime,
                  bordered: e.borderType === "bordered",
                  disabled: o.disabled || o.isView,
                  style: _.value,
                  popupStyle: P.value,
                  onChange: ue,
                  onOpenChange: ee
                }), {
                  dateRender: c((y) => [
                    $(e.$slots, "dateRender", be(ke(y)), () => [
                      E(
                        "div",
                        or,
                        x(y.current.date()),
                        1
                        /* TEXT */
                      )
                    ], !0)
                  ]),
                  nextIcon: c(() => [
                    w(' <slot name="nextIcon"> '),
                    i[1] || (i[1] = Le(
                      " XX ",
                      -1
                      /* CACHED */
                    )),
                    w(" </slot> ")
                  ]),
                  prevIcon: c(() => [
                    $(e.$slots, "prevIcon", {}, () => [
                      w(' <das-icon icon="left"></das-icon> ')
                    ], !0)
                  ]),
                  superNextIcon: c(() => [
                    $(e.$slots, "superNextIcon", {}, () => [
                      w(' <das-icon icon="double-arrow-right"></das-icon> ')
                    ], !0)
                  ]),
                  superPrevIcon: c(() => [
                    $(e.$slots, "superPrevIcon", {}, () => [
                      w(' <das-icon icon="double-arrow-left"></das-icon> ')
                    ], !0)
                  ]),
                  suffixIcon: c(() => [
                    $(e.$slots, "suffixIcon", {}, () => [
                      C(a(J), {
                        class: "das-suffix-icon",
                        icon: "riqixuanze",
                        size: "medium"
                      })
                    ], !0)
                  ]),
                  separator: c(() => [
                    $(e.$slots, "separator", {}, () => [
                      i[2] || (i[2] = E(
                        "div",
                        { style: { padding: "0 8px" } },
                        "~",
                        -1
                        /* CACHED */
                      ))
                    ], !0)
                  ]),
                  renderExtraFooter: c(() => [
                    E("div", tr, [
                      $(e.$slots, "renderExtraFooter", {}, void 0, !0)
                    ]),
                    e.showTime || e.ranges && e.ranges.length ? (v(), I("div", ar, [
                      (v(!0), I(
                        te,
                        null,
                        Me(e.ranges, (y) => (v(), I("div", {
                          class: "das-picker-preset",
                          key: y.key
                        }, [
                          w(` <el-dropdown v-if="item.type==='dropdown' && item.children.length" trigger="click" :teleported="false" placement='bottom-end'>\r
                 \r
                    <span class="das-picker-preset-span" >\r
                        {{ item.key }}<das-icon icon="fold" size='mini'></das-icon>\r
                    </span>\r
                \r
                  <template #dropdown>\r
\r
                    <el-dropdown-menu>\r
                      <el-dropdown-item v-for="child in item.children" :key="child.key" :command="child" >\r
                        <div class="das-picker-preset-item">\r
                          {{ child.key }}\r
                        </div>\r
                      </el-dropdown-item>\r
                    </el-dropdown-menu>\r
                  </template>\r
                </el-dropdown> `),
                          y.type === "dropdown" && y.children.length ? (v(), q(
                            a(Fe),
                            {
                              key: 0,
                              trigger: ["click"]
                            },
                            {
                              overlay: c(() => [
                                C(
                                  a(We),
                                  null,
                                  {
                                    default: c(() => [
                                      (v(!0), I(
                                        te,
                                        null,
                                        Me(y.children, (z) => (v(), q(a(Ze), {
                                          key: z.key,
                                          onClick: (K) => se(z)
                                        }, {
                                          default: c(() => [
                                            (v(), I(
                                              "span",
                                              { key: z },
                                              x(z.key),
                                              1
                                              /* TEXT */
                                            ))
                                          ]),
                                          _: 2
                                          /* DYNAMIC */
                                        }, 1032, ["onClick"]))),
                                        128
                                        /* KEYED_FRAGMENT */
                                      ))
                                    ]),
                                    _: 2
                                    /* DYNAMIC */
                                  },
                                  1024
                                  /* DYNAMIC_SLOTS */
                                )
                              ]),
                              default: c(() => [
                                E("a", {
                                  class: "ant-dropdown-link",
                                  onClick: i[0] || (i[0] = Ne(() => {
                                  }, ["prevent"]))
                                }, [
                                  E("span", nr, [
                                    Le(
                                      x(y.key) + " ",
                                      1
                                      /* TEXT */
                                    ),
                                    C(a(J), {
                                      icon: "fold",
                                      size: "mini",
                                      style: { display: "inline-block" }
                                    })
                                  ])
                                ])
                              ]),
                              _: 2
                              /* DYNAMIC */
                            },
                            1024
                            /* DYNAMIC_SLOTS */
                          )) : (v(), I("span", {
                            key: 1,
                            class: "das-picker-preset-span",
                            onClick: (z) => se(y)
                          }, x(y.key), 9, ur))
                        ]))),
                        128
                        /* KEYED_FRAGMENT */
                      )),
                      w(` <div class="das-picker-ok">\r
                <das-button btnType="primary" size="middle">Ok</das-button>\r
              </div> `)
                    ])) : w("v-if", !0)
                  ]),
                  _: 3
                  /* FORWARDED */
                }, 16, ["value", "format", "size", "dropdownClassName", "placeholder", "showToday", "showTime", "bordered", "disabled", "style", "popupStyle"])), [
                  [a(fe), oe]
                ])
              ]),
              _: 3
              /* FORWARDED */
            }, 8, ["visible", "disabled", "content"])
          ]),
          _: 3
          /* FORWARDED */
        }, 8, ["locale"]),
        w(` <div\r
      :class="[errorMode === 'default' ? 'das-date-picker-error-label-content' : 'das-date-picker-overlay-error-label-content', 'das-picker-label-content']"\r
      v-if="(errorMode === 'default' || (errorMode === 'overlay' && isHoverInInput)) && currError && !!errorLabel"\r
    >\r
      <span v-if="currError" class="das-picker-error-label label" :title="errorLabel">{{ errorLabel }}</span>\r
    </div> `),
        e.error && e.errorLabel ? (v(), I(
          te,
          { key: 0 },
          [
            e.errorMode === "default" ? (v(), I("div", sr, [
              E(
                "span",
                {
                  style: U(Z.value)
                },
                x(e.errorLabel),
                5
                /* TEXT, STYLE */
              )
            ])) : w("v-if", !0),
            e.errorMode === "overlay" && B.value ? (v(), q(a(ve), {
              key: 1,
              errorLabel: e.errorLabel,
              getEl: () => {
                var y;
                return (y = t.value) == null ? void 0 : y.$el;
              },
              errorModelZIndex: e.errorModelZIndex
            }, null, 8, ["errorLabel", "getEl", "errorModelZIndex"])) : w("v-if", !0)
          ],
          64
          /* STABLE_FRAGMENT */
        )) : w("v-if", !0)
      ],
      6
      /* CLASS, STYLE */
    ));
  }
}), pr = /* @__PURE__ */ he(dr, [["__scopeId", "data-v-438b962b"]]), cr = { class: "ant-picker-cell-inner" }, vr = {
  key: 0,
  class: "das-date-picker-error-label-content"
}, fr = {
  name: "DasDatePicker"
}, mr = /* @__PURE__ */ de({
  ...fr,
  props: {
    modelValue: {},
    borderType: { default: "underline" },
    size: { default: "middle" },
    width: { default: "230px" },
    height: {},
    showNow: { type: Boolean, default: !1 },
    disabled: { type: Boolean, default: !1 },
    isView: { type: Boolean, default: !1 },
    error: { type: Boolean, default: !1 },
    errorLabel: {},
    errorMode: { default: "default" },
    dropdownClassName: { default: "" },
    placeholder: { default: "请选择时间" },
    teleported: { type: Boolean, default: !0 },
    errorModelZIndex: { default: 2e3 },
    noSetDefaultVal: { type: Boolean },
    isTooltip: { type: Boolean, default: !0 }
  },
  emits: ["change", "openChange", "update:model-value", "update:error"],
  setup(F, { expose: A, emit: s }) {
    pe((r) => ({
      d189e57e: W.value,
      "3657a10c": H.value
    }));
    const o = F, f = s, O = p(() => G.value === "zh-CN" ? Ce : $e), t = n(null), V = n(null), d = Y(o, "modelValue"), L = Y(o, "error"), W = p(() => o.width ? o.width : "230px"), H = p(() => o.height ? o.height : "auto"), N = p(() => ({
      width: o.width
    })), P = p(() => o.isView ? o.noSetDefaultVal ? "" : "-" : ne(o.placeholder)), B = n(3e3), Z = p(() => ({
      "z-index": B.value
    })), M = n(!1), _ = n({
      display: "block",
      color: me("--das-ui-date-picker-overlay-error-color").value,
      "white-space": "break-spaces"
    }), b = (r) => {
      r && (B.value = Te().nextZIndex()), f("openChange", r), G.value === "en" && X(() => {
        const l = document == null ? void 0 : document.querySelectorAll(".ant-picker-ok > .ant-btn > span");
        for (let e of l)
          e && (e.innerText = "OK");
      });
    }, T = n(!1), R = n(""), j = p(() => d.value ? R.value : P.value), k = () => {
      const r = o.size === "table" ? 12 : 14;
      return Ie(P.value, r);
    }, m = () => {
      var l;
      const r = (l = t.value) == null ? void 0 : l.$el.querySelector(".ant-picker-input>input");
      return d.value ? r == null ? void 0 : r.scrollWidth : k();
    }, D = () => {
      var e;
      const r = (e = t.value) == null ? void 0 : e.$el.querySelector(".ant-picker-input>input");
      return r ? (R.value = r.getAttribute("value"), console.log("currValueFmt.value===", R.value), r.removeAttribute("title"), (r == null ? void 0 : r.offsetWidth) ?? 0) : 0;
    }, u = n(0), h = n(0);
    Q(() => [P.value, d.value], () => {
      X(() => {
        u.value = D(), h.value = m(), (u.value === h.value || h.value - u.value < 1) && (T.value = !1);
      });
    });
    const g = n();
    Q(
      () => {
        var r;
        return (r = V.value) == null ? void 0 : r.$tooltipRef.popperRef.contentRef;
      },
      (r) => {
        r && (r.addEventListener("mouseenter", function() {
          console.log("进入tooltip"), T.value = !0, g.value && clearTimeout(g.value);
        }), r.addEventListener("mouseleave", function() {
          console.log("离开toolTip"), g.value = setTimeout(() => {
            T.value = !1;
          }, 200);
        }));
      }
    );
    const ee = () => {
      u.value = D(), h.value = m(), u.value === h.value || h.value - u.value < 1 ? T.value = !1 : (T.value = !0, g.value && clearTimeout(g.value)), M.value = !0;
    }, re = () => {
      g.value = setTimeout(() => {
        T.value = !1;
      }, 200), M.value = !1;
    }, le = (r, l) => {
      r ? ee() : re();
    }, oe = (r, l) => {
      L.value = !1, f("update:error", L.value), f("update:model-value", r), f("change", r, l);
    };
    return A({
      $timePicker: t,
      blur: () => {
        t.value.blur();
      },
      focus: () => {
        t.value.focus();
      }
    }), (r, l) => (v(), I(
      "div",
      {
        class: ye(["das-ui-time-picker", [r.borderType, o.isView ? "readonly" : "", a(L) ? "is-error" : ""]]),
        style: U(N.value)
      },
      [
        C(a(ge), { locale: O.value }, {
          default: c(() => [
            C(a(we), {
              ref_key: "inputTooltipRef",
              ref: V,
              placement: "top",
              trigger: "hover",
              visible: T.value,
              disabled: !r.isTooltip,
              content: j.value
            }, {
              default: c(() => [
                ce((v(), q(a(Ae), ae({
                  ref_key: "$timePicker",
                  ref: t
                }, r.$attrs, {
                  value: a(d),
                  "onUpdate:value": l[0] || (l[0] = (e) => Se(d) ? d.value = e : null),
                  size: o.size,
                  popupClassName: "das-ui-time-picker-dropdown " + r.dropdownClassName,
                  showNow: r.showNow,
                  bordered: r.borderType === "bordered",
                  placeholder: P.value,
                  disabled: o.disabled || o.isView,
                  style: N.value,
                  popupStyle: Z.value,
                  onChange: oe,
                  onOpenChange: b
                }), {
                  dateRender: c((e) => [
                    $(r.$slots, "dateRender", be(ke(e)), () => [
                      E(
                        "div",
                        cr,
                        x(e.current.date()),
                        1
                        /* TEXT */
                      )
                    ], !0)
                  ]),
                  suffixIcon: c(() => [
                    $(r.$slots, "suffixIcon", {}, () => [
                      C(a(Ue), {
                        class: "das-suffix-icon",
                        size: "medium"
                      })
                    ], !0)
                  ]),
                  _: 3
                  /* FORWARDED */
                }, 16, ["value", "size", "popupClassName", "showNow", "bordered", "placeholder", "disabled", "style", "popupStyle"])), [
                  [a(fe), le]
                ])
              ]),
              _: 3
              /* FORWARDED */
            }, 8, ["visible", "disabled", "content"])
          ]),
          _: 3
          /* FORWARDED */
        }, 8, ["locale"]),
        r.error && r.errorLabel ? (v(), I(
          te,
          { key: 0 },
          [
            r.errorMode === "default" ? (v(), I("div", vr, [
              E(
                "span",
                {
                  style: U(_.value)
                },
                x(r.errorLabel),
                5
                /* TEXT, STYLE */
              )
            ])) : w("v-if", !0),
            r.errorMode === "overlay" && M.value ? (v(), q(a(ve), {
              key: 1,
              errorLabel: r.errorLabel,
              getEl: () => {
                var e;
                return (e = t.value) == null ? void 0 : e.$el;
              },
              errorModelZIndex: r.errorModelZIndex
            }, null, 8, ["errorLabel", "getEl", "errorModelZIndex"])) : w("v-if", !0),
            w(` <template v-else-if="errorMode === 'overlay' && isHoverInInput">\r
        <teleport to="body" v-if="teleported">\r
          <div ref="$errorModel" :style="errorModelStyle">\r
            <span :style="errorLabelStyle">{{ errorLabel }}</span>\r
          </div>\r
        </teleport>\r
\r
        <div :style="errorModalBaseSyle" class="das-picker-error-label label" v-else>\r
          <span :style="errorLabelStyle">{{ errorLabel }}</span>\r
        </div>\r
      </template> `)
          ],
          64
          /* STABLE_FRAGMENT */
        )) : w("v-if", !0)
      ],
      6
      /* CLASS, STYLE */
    ));
  }
}), hr = /* @__PURE__ */ he(mr, [["__scopeId", "data-v-8e245fe4"]]), yr = { class: "ant-picker-cell-inner" }, br = {
  key: 0,
  class: "das-date-picker-error-label-content"
}, kr = {
  name: "DasDatePicker"
}, gr = /* @__PURE__ */ de({
  ...kr,
  props: {
    modelValue: {},
    borderType: { default: "underline" },
    size: { default: "middle" },
    width: { default: "230px" },
    height: {},
    showNow: { type: Boolean, default: !1 },
    disabled: { type: Boolean, default: !1 },
    isView: { type: Boolean, default: !1 },
    error: { type: Boolean, default: !1 },
    errorLabel: {},
    errorMode: { default: "default" },
    dropdownClassName: { default: "" },
    placeholder: { default: ["开始时间", "结束时间"] },
    teleported: { type: Boolean, default: !0 },
    errorModelZIndex: { default: 2e3 },
    noSetDefaultVal: { type: Boolean },
    isTooltip: { type: Boolean, default: !0 }
  },
  emits: ["change", "openChange", "update:model-value", "update:error"],
  setup(F, { expose: A, emit: s }) {
    pe((l) => ({
      "22ea7478": W.value,
      "6e020e2e": H.value
    })), ze({
      dengdai: import("@das-fed/ui/packages/icons/dengdai")
    });
    const o = F, f = s, O = p(() => G.value === "zh-CN" ? Ce : $e), t = n(null), V = n(null), d = Y(o, "modelValue"), L = Y(o, "error"), W = p(() => o.width ? o.width : "230px"), H = p(() => o.height ? o.height : "auto"), N = n(3e3), P = p(() => ({
      "z-index": N.value
    })), B = p(() => ({
      width: o.width
    })), Z = p(() => {
      var l;
      return o.isView ? o.noSetDefaultVal ? ["", ""] : ["-", "-"] : (l = o.placeholder) == null ? void 0 : l.map((e) => ne(e));
    }), M = n(!1), _ = n({
      display: "block",
      color: me("--das-ui-date-picker-overlay-error-color").value,
      "white-space": "break-spaces"
    }), b = n(!1), T = n(["", ""]), R = n("~"), j = p(() => {
      var l;
      return (l = d.value) != null && l.length && d.value[0] && d.value[1] ? T.value.join(" " + R.value + " ") : Z.value.join(" " + R.value + " ");
    }), k = n([0, 0]), m = n([0, 0]), D = () => {
      var y;
      let l = [];
      const e = (y = t.value) == null ? void 0 : y.$el.querySelectorAll(".ant-picker-input>input");
      if (!e)
        return l = [0, 0], l;
      let i = [];
      for (let z of e) {
        i.push(z.getAttribute("value") || "");
        let K = (z == null ? void 0 : z.offsetWidth) ?? 0;
        l.push(K);
      }
      return T.value = i, console.log("currValueFmt.value===", T.value), l;
    }, u = (l) => {
      const e = o.size === "table" ? 12 : 14;
      return Ie(l, e);
    }, h = () => {
      var i;
      let l = [];
      return ((i = t.value) == null ? void 0 : i.$el.querySelectorAll(".ant-picker-input>input")).forEach((y, z) => {
        d.value.length && d.value[0] && d.value[0] ? l.push(y == null ? void 0 : y.scrollWidth) : l.push(u(Z.value[z]));
      }), l;
    };
    Q(() => [Z.value, d.value], () => {
      X(() => {
        k.value = D(), m.value = h(), (k.value[0] === m.value[0] || m.value[0] - k.value[0] < 1) && (k.value[1] === m.value[1] || m.value[1] - k.value[1] < 1) && (b.value = !1);
      });
    });
    const g = n();
    Q(
      () => {
        var l;
        return (l = V.value) == null ? void 0 : l.$tooltipRef.popperRef.contentRef;
      },
      (l) => {
        l && (l.addEventListener("mouseenter", function() {
          console.log("进入tooltip"), b.value = !0, g.value && clearTimeout(g.value);
        }), l.addEventListener("mouseleave", function() {
          console.log("离开toolTip"), g.value = setTimeout(() => {
            b.value = !1;
          }, 200);
        }));
      }
    );
    const ee = (l) => {
      l && (N.value = Te().nextZIndex()), f("openChange", l), G.value === "en" && X(() => {
        const e = document == null ? void 0 : document.querySelectorAll(".ant-picker-ok > .ant-btn > span");
        for (let i of e)
          i && (i.innerText = "OK");
      });
    }, re = () => {
      k.value = D(), m.value = h(), (k.value[0] === m.value[0] || m.value[0] - k.value[0] < 1) && (k.value[1] === m.value[1] || m.value[1] - k.value[1] < 1) ? b.value = !1 : (b.value = !0, g.value && clearTimeout(g.value)), M.value = !0;
    }, le = () => {
      g.value = setTimeout(() => {
        b.value = !1;
      }, 200), M.value = !1;
    }, oe = (l, e) => {
      l ? re() : le();
    }, ue = (l, e) => {
      if (L.value = !1, l === null) {
        f("update:model-value", [null, null]), f("change", [null, null], e);
        return;
      }
      f("update:error", L.value), f("update:model-value", l), f("change", l, e);
    };
    return A({
      $timeRangePicker: t,
      blur: () => {
        t.value.blur();
      },
      focus: () => {
        t.value.focus();
      }
    }), (l, e) => (v(), I(
      "div",
      {
        class: ye(["das-ui-time-range-picker", [l.borderType, o.isView ? "readonly" : "", a(L) ? "is-error" : ""]]),
        style: U(B.value)
      },
      [
        C(a(ge), { locale: O.value }, {
          default: c(() => [
            C(a(we), {
              ref_key: "inputTooltipRef",
              ref: V,
              placement: "top",
              trigger: "hover",
              visible: b.value,
              disabled: !l.isTooltip,
              content: j.value
            }, {
              default: c(() => [
                ce((v(), q(a(qe), ae({
                  ref_key: "$timeRangePicker",
                  ref: t
                }, l.$attrs, {
                  value: a(d),
                  "onUpdate:value": e[0] || (e[0] = (i) => Se(d) ? d.value = i : null),
                  size: o.size,
                  popupClassName: "das-ui-time-range-picker-dropdown " + l.dropdownClassName,
                  showNow: l.showNow,
                  bordered: l.borderType === "bordered",
                  placeholder: Z.value,
                  disabled: o.disabled || o.isView,
                  style: B.value,
                  popupStyle: P.value,
                  onChange: ue,
                  onOpenChange: ee
                }), {
                  dateRender: c((i) => [
                    $(l.$slots, "dateRender", be(ke(i)), () => [
                      E(
                        "div",
                        yr,
                        x(i.current.date()),
                        1
                        /* TEXT */
                      )
                    ], !0)
                  ]),
                  suffixIcon: c(() => [
                    $(l.$slots, "suffixIcon", {}, () => [
                      C(a(J), {
                        class: "das-suffix-icon",
                        icon: "dengdai",
                        size: "medium"
                      })
                    ], !0)
                  ]),
                  separator: c(() => [
                    $(l.$slots, "separator", {}, () => [
                      e[1] || (e[1] = E(
                        "div",
                        { style: { padding: "0 8px" } },
                        "~",
                        -1
                        /* CACHED */
                      ))
                    ], !0)
                  ]),
                  _: 3
                  /* FORWARDED */
                }, 16, ["value", "size", "popupClassName", "showNow", "bordered", "placeholder", "disabled", "style", "popupStyle"])), [
                  [a(fe), oe]
                ])
              ]),
              _: 3
              /* FORWARDED */
            }, 8, ["visible", "disabled", "content"])
          ]),
          _: 3
          /* FORWARDED */
        }, 8, ["locale"]),
        l.error && l.errorLabel ? (v(), I(
          te,
          { key: 0 },
          [
            l.errorMode === "default" ? (v(), I("div", br, [
              E(
                "span",
                {
                  style: U(_.value)
                },
                x(l.errorLabel),
                5
                /* TEXT, STYLE */
              )
            ])) : w("v-if", !0),
            l.errorMode === "overlay" && M.value ? (v(), q(a(ve), {
              key: 1,
              errorLabel: l.errorLabel,
              getEl: () => {
                var i;
                return (i = t.value) == null ? void 0 : i.$el;
              },
              errorModelZIndex: l.errorModelZIndex
            }, null, 8, ["errorLabel", "getEl", "errorModelZIndex"])) : w("v-if", !0)
          ],
          64
          /* STABLE_FRAGMENT */
        )) : w("v-if", !0)
      ],
      6
      /* CLASS, STYLE */
    ));
  }
}), wr = /* @__PURE__ */ he(gr, [["__scopeId", "data-v-9f079d4a"]]), Tr = {
  "--das-ui-date-picker-color-defalut-text": "#212121",
  // 默认字体色
  "--das-ui-date-picker-color-primary": "#5582F3",
  // 主题色
  "--das-ui-date-picker-color-underline": Oe("--das-ui-color-help"),
  // 下划线基础色
  "--das-ui-date-picker-color-error": "#FB2323",
  // 错误边框色
  "--das-ui-date-picker-color-disabled": "#e5e5e5",
  // 禁用边框色
  "--das-ui-date-picker-color-disabled-bg": "#f5f5f5",
  // 禁用背景色
  "--das-ui-date-picker-color-hover": "#F2F6FF",
  // rangePicker组件选择悬浮背景色
  "--das-ui-date-picker-font-size-mini": "12px",
  // 字体大小-mini
  "--das-ui-date-picker-font-size-small": "14px",
  // 字体大小-small
  "--das-ui-date-picker-font-size-middle": "14px",
  // 字体大小-middle
  "--das-ui-date-picker-font-size-large": "16px",
  // 字体大小-large
  "--das-ui-date-picker-overlay-error-color": "#FB2323",
  "--das-ui-date-picker-overlay-error-bg-color": "#FFDBE0"
}, Ir = {
  开始日期: { "zh-CN": "开始日期", en: "Start Date", _appCode: "framework" },
  结束日期: { "zh-CN": "结束日期", en: "End Date", _appCode: "framework" },
  开始时间: { "zh-CN": "开始时间", en: "Start Time", _appCode: "framework" },
  结束时间: { "zh-CN": "结束时间", en: "End Time", _appCode: "framework" },
  请选择日期: { "zh-CN": "请选择日期", en: "Please select a date", _appCode: "framework" },
  请选择时间: { "zh-CN": "请选择时间", en: "Please select the time", _appCode: "framework" }
};
_e(Ir);
He(Tr);
const jr = ie(Ge), Kr = ie(lr), Xr = ie(pr), Gr = ie(hr), Jr = ie(wr), Qr = { name: "datePicker 日期时间选择器" };
export {
  jr as DasDatePicker,
  Kr as DasDateRangePicker,
  Xr as DasRangePicker,
  Gr as DasTimePicker,
  Jr as DasTimeRangePicker,
  Qr as default
};
