1236 lines
		
	
	
		
			39 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			1236 lines
		
	
	
		
			39 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
import { inject as T, toRefs as Z, computed as b, ref as D, renderSlot as E, defineComponent as k, createVNode as c, mergeProps as g, h as me, createApp as ce, nextTick as ie, isVNode as te, Fragment as w, provide as se } from "vue";
 | 
						|
import { h as s, d as M, a as h, b as de, c as ne, F as Y, e as fe, P as ge, A as ve, f as F, C as Ve, g as O, D as _, T as G, j as L, k as he, l as ye, R as be, m as Ae, S as Ce, n as ke, o as Te, p as Se, q as Ye, r as Pe, s as Ie } from "./vendor-BuMp2M9h.js";
 | 
						|
import { X as J } from "./datetime-picker-BvBgc-bC.js";
 | 
						|
import { u as z } from "./hooks-BDiJ55M7.js";
 | 
						|
import { c as De, w as xe } from "./utils-BjwmJovq.js";
 | 
						|
const S = {
 | 
						|
  formValue: {
 | 
						|
    type: Object
 | 
						|
  },
 | 
						|
  type: {
 | 
						|
    type: String,
 | 
						|
    required: !0
 | 
						|
  },
 | 
						|
  label: {
 | 
						|
    type: String
 | 
						|
  },
 | 
						|
  name: {
 | 
						|
    type: String,
 | 
						|
    required: !0
 | 
						|
  },
 | 
						|
  options: {
 | 
						|
    type: Array,
 | 
						|
    default: () => []
 | 
						|
  },
 | 
						|
  required: {
 | 
						|
    type: Boolean,
 | 
						|
    default: !1
 | 
						|
  },
 | 
						|
  readonly: {
 | 
						|
    type: Boolean,
 | 
						|
    default: !1
 | 
						|
  },
 | 
						|
  popup: {
 | 
						|
    type: Object,
 | 
						|
    default: () => ({})
 | 
						|
  },
 | 
						|
  itemAttrs: {
 | 
						|
    type: Object,
 | 
						|
    default: () => ({})
 | 
						|
  },
 | 
						|
  orgAttrs: {
 | 
						|
    type: Object,
 | 
						|
    default: () => ({})
 | 
						|
  },
 | 
						|
  config: {
 | 
						|
    type: Object,
 | 
						|
    default: () => ({})
 | 
						|
  },
 | 
						|
  size: {
 | 
						|
    type: String,
 | 
						|
    default: "normal"
 | 
						|
  }
 | 
						|
}, $e = ["input", "picker", "cascader", "area", "radio", "checkbox", "date-picker", "time-picker", "datetime-picker", "date-range-picker", "time-range-picker", "datetime-range-picker", "switch", "rate", "slider", "stepper", "text", "html", "slot", "input-slot"], K = ["picker", "cascader", "area", "date-picker", "time-picker", "datetime-picker", "date-range-picker", "time-range-picker", "datetime-range-picker"], B = {
 | 
						|
  change: ["rate", "switch", "stepper", "slider", "radio", "checkbox"],
 | 
						|
  blur: ["input", "stepper"],
 | 
						|
  focus: ["input", "stepper"],
 | 
						|
  click: ["input", "switch"],
 | 
						|
  confirm: [],
 | 
						|
  cancel: [],
 | 
						|
  "drag-end": ["slider"],
 | 
						|
  "drag-start": ["slider"],
 | 
						|
  plus: ["stepper"],
 | 
						|
  minus: ["stepper"]
 | 
						|
}, ee = ["submit", "failed"], Re = ["change", "blur", "focus", "click"], je = ["click-option", "change-option"], Me = ["change", "plus", "minus", "overlimit", "focus", "blur"], Ee = ["change", "drag-start", "drag-end"], He = ["confirm", "cancel", "click-option", "scroll-into"], we = ["click-tab", "close", "finish"], Oe = ["confirm", "cancel", "open", "opened", "closed", "click-overlay"], Ue = [...new Set(ee.concat(ee, Re, je, Me, Ee, Oe, He, we))], R = (e = "") => `请选择${e}`, qe = (e, n, u) => {
 | 
						|
  const t = ["picker", "area", "cascader", "date-picker", "time-picker", "datetime-picker", "date-range-picker", "time-range-picker", "datetime-range-picker"].includes(e), a = ["input"].includes(e);
 | 
						|
  if (t) return u || `请选择${n}`;
 | 
						|
  if (a) return u || `请输入${n}`;
 | 
						|
  if (u) return u;
 | 
						|
}, Fe = (e, n = [], u) => {
 | 
						|
  let t = [];
 | 
						|
  const a = { required: !0, message: `${u}不能为空`, trigger: ["onBlur", "onChange", "onSubmit"] };
 | 
						|
  if (n && h(n)) {
 | 
						|
    const r = n.find((l) => s(l, "required"));
 | 
						|
    e && !r && t.push(a), t = t.concat(n);
 | 
						|
  }
 | 
						|
  return t;
 | 
						|
}, Be = (e) => K.includes(e) ? "arrow" : "", x = (e) => s(e, "slots") ? e.slots : {}, Ne = (e, n) => {
 | 
						|
  const { onEvents: u } = T("x-form");
 | 
						|
  let t = {};
 | 
						|
  return B.change.includes(e) && (t.onChange = (...a) => u("change", n, ...a)), B.blur.includes(e) && (t.onBlur = (a) => u("blur", n, a)), B.focus.includes(e) && (t.onFocus = (a) => u("focus", n, a)), B.click.includes(e) && (t.onClick = (a) => u("click", n, a)), t;
 | 
						|
};
 | 
						|
function $(e, n = M()) {
 | 
						|
  const u = {
 | 
						|
    year: n.format("YYYY"),
 | 
						|
    month: n.format("MM"),
 | 
						|
    day: n.format("DD"),
 | 
						|
    hour: n.format("HH"),
 | 
						|
    minute: n.format("mm"),
 | 
						|
    second: n.format("ss")
 | 
						|
  };
 | 
						|
  return e.map((t) => u[t]);
 | 
						|
}
 | 
						|
const P = (e) => {
 | 
						|
  const { rules: n } = T("x-form"), { type: u, required: t, name: a, itemAttrs: r, label: l, config: o } = Z(e), m = b(() => {
 | 
						|
    const v = s(r.value, "rules") && h(r.value.rules) ? r.value.rules : [], V = s(o.value, "rules") ? o.value.rules : [], y = s(n, a.value) ? n[a.value] : [];
 | 
						|
    return Fe(t.value, [...v, ...V, ...y], l.value);
 | 
						|
  }), i = b(() => {
 | 
						|
    var V;
 | 
						|
    let v = {
 | 
						|
      placeholder: qe(u.value, l.value, (V = r.value) == null ? void 0 : V.placeholder),
 | 
						|
      required: t.value,
 | 
						|
      clearable: !!(e.type == "input" || K.includes(e.type)),
 | 
						|
      ...r.value,
 | 
						|
      label: l.value,
 | 
						|
      name: a.value,
 | 
						|
      rules: m.value
 | 
						|
    };
 | 
						|
    return s(o, "hiddenLabel") && de(o.value.hiddenLabel) && o.hiddenLabel && (v.class = "xform-hidden-label"), K.includes(e.type) && (v["right-icon"] = Be(e.type), v.readonly = !0), v;
 | 
						|
  }), d = b(() => e.orgAttrs);
 | 
						|
  return {
 | 
						|
    baseAttrs: i,
 | 
						|
    compAttrs: d
 | 
						|
  };
 | 
						|
}, I = (e) => {
 | 
						|
  const { formSlots: n } = T("x-form"), { name: u, itemAttrs: t, label: a } = Z(e), r = D({}), l = (m) => {
 | 
						|
    var i;
 | 
						|
    return t.value && s(t.value, "slots") && s((i = t.value) == null ? void 0 : i.slots, m);
 | 
						|
  }, o = (m, i) => {
 | 
						|
    if (ne(t.value.slots[m]))
 | 
						|
      return t.value.slots[m](i);
 | 
						|
    throw new Error(`slots.${m} is not a function`);
 | 
						|
  };
 | 
						|
  return (a.value || s(n, `${u.value}.label`) || l("label")) && (r.value.label = () => s(n, `${u.value}.label`) ? E(n, `${u.value}.label`) : l("label") ? o("label") : a.value), (s(n, `${u.value}.left-icon`) || l("left-icon")) && (r.value["left-icon"] = () => s(n, `${u.value}.left-icon`) ? E(n, `${u.value}.left-icon`) : o("left-icon")), (s(n, `${u.value}.right-icon`) || l("right-icon")) && (r.value["right-icon"] = () => s(n, `${u.value}.right-icon`) ? E(n, `${u.value}.right-icon`) : o("right-icon")), (s(n, `${u.value}.error-message`) || l("error-message")) && (r.value["error-message"] = ({ message: m }) => s(n, `${u.value}.error-message`) ? E(n, `${u.value}.error-message`, { message: m }) : o("error-message", { message: m })), (s(n, `${u.value}.button`) || l("button")) && (r.value.button = () => s(n, `${u.value}.button`) ? E(n, `${u.value}.button`) : o("button")), (s(n, `${u.value}.extra`) || l("extra")) && (r.value.extra = () => s(n, `${u.value}.extra`) ? E(n, `${u.value}.extra`) : o("extra")), {
 | 
						|
    itemSlots: r
 | 
						|
  };
 | 
						|
}, _e = /* @__PURE__ */ k({
 | 
						|
  name: "IInput",
 | 
						|
  props: S,
 | 
						|
  setup(e) {
 | 
						|
    const {
 | 
						|
      itemSlots: n
 | 
						|
    } = I(e), {
 | 
						|
      baseAttrs: u
 | 
						|
    } = P(e);
 | 
						|
    return () => c(Y, g({
 | 
						|
      modelValue: e.formValue[e.name],
 | 
						|
      "onUpdate:modelValue": (t) => e.formValue[e.name] = t
 | 
						|
    }, u.value, Ne(e.type, e.name)), n.value);
 | 
						|
  }
 | 
						|
}), j = (e) => {
 | 
						|
  const { content: n, position: u } = e;
 | 
						|
  let t = null;
 | 
						|
  const a = D(!1), r = document.createElement("div");
 | 
						|
  document.body.appendChild(r);
 | 
						|
  const l = () => {
 | 
						|
    a.value = !1;
 | 
						|
  }, o = () => {
 | 
						|
    t == null || t.unmount(), r.remove();
 | 
						|
  }, m = k({
 | 
						|
    setup() {
 | 
						|
      return () => me(fe, {
 | 
						|
        show: a.value,
 | 
						|
        "onUpdate:show": (i) => {
 | 
						|
          a.value = i;
 | 
						|
        },
 | 
						|
        round: !0,
 | 
						|
        position: u || "bottom",
 | 
						|
        onClose: l,
 | 
						|
        onClosed: o
 | 
						|
      }, {
 | 
						|
        default: n
 | 
						|
      });
 | 
						|
    }
 | 
						|
  });
 | 
						|
  return t = ce(m), t.mount(r), ie(() => {
 | 
						|
    a.value = !0;
 | 
						|
  }), {
 | 
						|
    onClose: l,
 | 
						|
    onUnmount: o
 | 
						|
  };
 | 
						|
}, Ge = /* @__PURE__ */ k({
 | 
						|
  props: S,
 | 
						|
  setup(e) {
 | 
						|
    const {
 | 
						|
      itemSlots: n
 | 
						|
    } = I(e), {
 | 
						|
      baseAttrs: u
 | 
						|
    } = P(e), {
 | 
						|
      options: t
 | 
						|
    } = z(e.options), {
 | 
						|
      onEvents: a
 | 
						|
    } = T("x-form"), r = b(() => t.value), l = b(() => {
 | 
						|
      const m = e.formValue[e.name] && h(e.formValue[e.name]) ? e.formValue[e.name] : [];
 | 
						|
      return r.value.filter((i) => m.includes(i.value)).map((i) => i.text).join("、");
 | 
						|
    }), o = () => {
 | 
						|
      const m = D(e.formValue[e.name] && h(e.formValue[e.name]) ? e.formValue[e.name] : []), {
 | 
						|
        onClose: i
 | 
						|
      } = j({
 | 
						|
        content: c(ge, g({
 | 
						|
          modelValue: m.value,
 | 
						|
          "onUpdate:modelValue": (d) => m.value = d,
 | 
						|
          title: R(e.label)
 | 
						|
        }, e.orgAttrs, {
 | 
						|
          columns: r.value,
 | 
						|
          onConfirm: (...d) => {
 | 
						|
            e.formValue[e.name] = m.value, i(), a("confirm", e.name, ...d);
 | 
						|
          },
 | 
						|
          onChange: (...d) => a("change", e.name, ...d),
 | 
						|
          onCancel: () => {
 | 
						|
            i(), a("cancel", e.name);
 | 
						|
          },
 | 
						|
          onClickOption: (...d) => a("click-option", e.name, ...d),
 | 
						|
          onScrollInto: (...d) => a("scroll-into", e.name, ...d)
 | 
						|
        }), {
 | 
						|
          ...x(e.orgAttrs),
 | 
						|
          default: () => s(x(e.orgAttrs), "default") ? x(e.orgAttrs).default() : void 0
 | 
						|
        })
 | 
						|
      });
 | 
						|
    };
 | 
						|
    return () => c(Y, g({
 | 
						|
      modelValue: l.value,
 | 
						|
      "onUpdate:modelValue": (m) => l.value = m
 | 
						|
    }, u.value, {
 | 
						|
      clearable: !0,
 | 
						|
      onClickRightIcon: o,
 | 
						|
      onClickInput: o
 | 
						|
    }), n.value);
 | 
						|
  }
 | 
						|
}), Le = /* @__PURE__ */ k({
 | 
						|
  name: "IArea",
 | 
						|
  props: S,
 | 
						|
  setup(e) {
 | 
						|
    const {
 | 
						|
      itemSlots: n
 | 
						|
    } = I(e), {
 | 
						|
      baseAttrs: u
 | 
						|
    } = P(e), {
 | 
						|
      onEvents: t
 | 
						|
    } = T("x-form"), a = b(() => {
 | 
						|
      const l = e.formValue[e.name];
 | 
						|
      if (l) {
 | 
						|
        let o = [];
 | 
						|
        const m = ze(l), i = F.province_list[m];
 | 
						|
        i && o.push(i);
 | 
						|
        const d = Xe(l), v = F.city_list[d];
 | 
						|
        v && o.push(v);
 | 
						|
        const V = F.county_list[l];
 | 
						|
        return V && o.push(V), o.join("/");
 | 
						|
      }
 | 
						|
      return l;
 | 
						|
    }), r = () => {
 | 
						|
      const l = D(e.formValue[e.name] || ""), {
 | 
						|
        onClose: o
 | 
						|
      } = j({
 | 
						|
        content: c(ve, g({
 | 
						|
          modelValue: l.value,
 | 
						|
          "onUpdate:modelValue": (m) => l.value = m,
 | 
						|
          title: R(e.label),
 | 
						|
          areaList: F
 | 
						|
        }, e.orgAttrs, {
 | 
						|
          onConfirm: (...m) => {
 | 
						|
            e.formValue[e.name] = l.value, o(), t("confirm", e.name, ...m);
 | 
						|
          },
 | 
						|
          onChange: (...m) => t("change", e.name, ...m),
 | 
						|
          onCancel: () => {
 | 
						|
            o(), t("cancel", e.name);
 | 
						|
          }
 | 
						|
        }), null)
 | 
						|
      });
 | 
						|
    };
 | 
						|
    return () => c(Y, g({
 | 
						|
      modelValue: a.value,
 | 
						|
      "onUpdate:modelValue": (l) => a.value = l
 | 
						|
    }, u.value, {
 | 
						|
      clearable: !0,
 | 
						|
      onClickRightIcon: r,
 | 
						|
      onClickInput: r
 | 
						|
    }), n.value);
 | 
						|
  }
 | 
						|
});
 | 
						|
function ze(e) {
 | 
						|
  return String(e).padStart(6, "0").substring(0, 2) + "0000";
 | 
						|
}
 | 
						|
function Xe(e) {
 | 
						|
  return String(e).padStart(6, "0").substring(0, 4) + "00";
 | 
						|
}
 | 
						|
const We = /* @__PURE__ */ k({
 | 
						|
  name: "ICascader",
 | 
						|
  props: S,
 | 
						|
  setup(e) {
 | 
						|
    const {
 | 
						|
      itemSlots: n
 | 
						|
    } = I(e), {
 | 
						|
      baseAttrs: u
 | 
						|
    } = P(e), {
 | 
						|
      options: t
 | 
						|
    } = z(e.config.options), {
 | 
						|
      onEvents: a
 | 
						|
    } = T("x-form"), r = b(() => {
 | 
						|
      const m = ae(t.value, e.formValue[e.name]);
 | 
						|
      return m ? h(m) ? m.join("/") : e.formValue[`${e.name}Text`] : e.formValue[`${e.name}Text`];
 | 
						|
    }), l = D(e.formValue[e.name] || ""), o = () => {
 | 
						|
      const {
 | 
						|
        onClose: m
 | 
						|
      } = j({
 | 
						|
        content: c(Ve, g({
 | 
						|
          modelValue: l.value,
 | 
						|
          "onUpdate:modelValue": (i) => l.value = i,
 | 
						|
          title: R(e.label)
 | 
						|
        }, e.orgAttrs, {
 | 
						|
          options: t.value,
 | 
						|
          onChange: (...i) => a("change", e.name, ...i),
 | 
						|
          onFinish: (...i) => {
 | 
						|
            e.formValue[e.name] = l.value, m(), a("finish", e.name, ...i);
 | 
						|
          },
 | 
						|
          onClose: () => {
 | 
						|
            m(), a("close", e.name);
 | 
						|
          },
 | 
						|
          onClickTab: (...i) => a("click-tab", name, ...i)
 | 
						|
        }), x(e.orgAttrs))
 | 
						|
      });
 | 
						|
    };
 | 
						|
    return () => c(Y, g({
 | 
						|
      modelValue: r.value,
 | 
						|
      "onUpdate:modelValue": (m) => r.value = m
 | 
						|
    }, u.value, {
 | 
						|
      clearable: !0,
 | 
						|
      onClickRightIcon: o,
 | 
						|
      onClickInput: o
 | 
						|
    }), {
 | 
						|
      ...n.value
 | 
						|
    });
 | 
						|
  }
 | 
						|
});
 | 
						|
function ae(e, n, u = []) {
 | 
						|
  for (const t of e) {
 | 
						|
    const a = [...u, t.text];
 | 
						|
    if (t.value === n)
 | 
						|
      return a;
 | 
						|
    if (t.children && t.children.length > 0) {
 | 
						|
      const r = ae(t.children, n, a);
 | 
						|
      if (r) return r;
 | 
						|
    }
 | 
						|
  }
 | 
						|
  return null;
 | 
						|
}
 | 
						|
const Je = /* @__PURE__ */ k({
 | 
						|
  props: S,
 | 
						|
  setup(e, {}) {
 | 
						|
    const {
 | 
						|
      itemSlots: n
 | 
						|
    } = I(e), {
 | 
						|
      baseAttrs: u
 | 
						|
    } = P(e), {
 | 
						|
      onEvents: t
 | 
						|
    } = T("x-form"), a = s(e.orgAttrs, "columnsType") && h(e.orgAttrs.columnsType) ? e.orgAttrs.columnsType : ["year", "month", "day"], r = $(a), l = b(() => {
 | 
						|
      if (e.formValue[e.name]) {
 | 
						|
        if (h(e.formValue[e.name]))
 | 
						|
          return e.formValue[e.name];
 | 
						|
        if (O(e.formValue[e.name])) {
 | 
						|
          const d = M(e.formValue[e.name]);
 | 
						|
          return $(a, d);
 | 
						|
        } else
 | 
						|
          return e.formValue[e.name];
 | 
						|
      } else
 | 
						|
        return r;
 | 
						|
    }), o = D(l.value || r), m = b(() => e.formValue[e.name] && h(e.formValue[e.name]) ? e.formValue[e.name].join("-") : e.formValue[e.name]), i = () => {
 | 
						|
      const {
 | 
						|
        onClose: d
 | 
						|
      } = j({
 | 
						|
        content: c(_, g({
 | 
						|
          modelValue: o.value,
 | 
						|
          "onUpdate:modelValue": (v) => o.value = v,
 | 
						|
          title: R(e.label)
 | 
						|
        }, e.orgAttrs, {
 | 
						|
          columnsType: a,
 | 
						|
          onConfirm: (...v) => {
 | 
						|
            e.formValue[e.name] = o.value, d(), t("confirm", e.name, ...v);
 | 
						|
          },
 | 
						|
          onChange: (...v) => t("change", e.name, ...v),
 | 
						|
          onCancel: () => {
 | 
						|
            d(), t("cancel", e.name);
 | 
						|
          }
 | 
						|
        }), {
 | 
						|
          ...x(e.orgAttrs),
 | 
						|
          default: () => s(x(e.orgAttrs), "default") ? x(e.orgAttrs).default() : void 0
 | 
						|
        })
 | 
						|
      });
 | 
						|
    };
 | 
						|
    return () => c(Y, g({
 | 
						|
      modelValue: m.value,
 | 
						|
      "onUpdate:modelValue": (d) => m.value = d
 | 
						|
    }, u.value, {
 | 
						|
      clearable: !0,
 | 
						|
      onClickRightIcon: i,
 | 
						|
      onClickInput: i
 | 
						|
    }), n.value);
 | 
						|
  }
 | 
						|
}), Ke = /* @__PURE__ */ k({
 | 
						|
  props: S,
 | 
						|
  setup(e) {
 | 
						|
    const {
 | 
						|
      itemSlots: n
 | 
						|
    } = I(e), {
 | 
						|
      baseAttrs: u
 | 
						|
    } = P(e), {
 | 
						|
      onEvents: t
 | 
						|
    } = T("x-form"), a = s(e.orgAttrs, "columnsType") && h(e.orgAttrs.columnsType) ? e.orgAttrs.columnsType : ["hour", "minute", "second"], r = $(a), l = b(() => e.formValue[e.name] ? h(e.formValue[e.name]) ? e.formValue[e.name] : O(e.formValue[e.name]) ? e.formValue[e.name].split(":") : r : r), o = b(() => e.formValue[e.name] && h(e.formValue[e.name]) ? e.formValue[e.name].join(":") : e.formValue[e.name]), m = () => {
 | 
						|
      const i = D(l.value || r), {
 | 
						|
        onClose: d
 | 
						|
      } = j({
 | 
						|
        content: c(G, g({
 | 
						|
          modelValue: i.value,
 | 
						|
          "onUpdate:modelValue": (v) => i.value = v,
 | 
						|
          title: R(e.label)
 | 
						|
        }, e.orgAttrs, {
 | 
						|
          columnsType: a,
 | 
						|
          onConfirm: (...v) => {
 | 
						|
            e.formValue[e.name] = i.value, d(), t("confirm", e.name, ...v);
 | 
						|
          },
 | 
						|
          onChange: (...v) => t("change", e.name, ...v),
 | 
						|
          onCancel: () => {
 | 
						|
            d(), t("cancel", e.name);
 | 
						|
          }
 | 
						|
        }), {
 | 
						|
          ...x(e.orgAttrs),
 | 
						|
          default: () => s(x(e.orgAttrs), "default") ? x(e.orgAttrs).default : void 0
 | 
						|
        })
 | 
						|
      });
 | 
						|
    };
 | 
						|
    return () => c(Y, g({
 | 
						|
      modelValue: o.value,
 | 
						|
      "onUpdate:modelValue": (i) => o.value = i
 | 
						|
    }, u.value, {
 | 
						|
      clearable: !0,
 | 
						|
      onClickRightIcon: m,
 | 
						|
      onClickInput: m
 | 
						|
    }), n.value);
 | 
						|
  }
 | 
						|
});
 | 
						|
function U(e) {
 | 
						|
  return typeof e != "string" ? !1 : /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])( (0\d|1\d|2[0-3])(:[0-5]\d)?(:[0-5]\d)?)?$/.test(e);
 | 
						|
}
 | 
						|
function X(e) {
 | 
						|
  return Array.isArray(e) ? e.every((n) => U(n)) : !1;
 | 
						|
}
 | 
						|
function N(e) {
 | 
						|
  if (!Array.isArray(e) || e.length !== 2) return !1;
 | 
						|
  const [n, u] = e;
 | 
						|
  if (!Array.isArray(n) || n.length !== 3 || !(typeof n[0] == "string" && /^\d{4}$/.test(n[0]) && typeof n[1] == "string" && /^(0[1-9]|1[0-2])$/.test(n[1]) && typeof n[2] == "string" && /^(0[1-9]|[12]\d|3[01])$/.test(n[2])) || !Array.isArray(u) || u.length > 3) return !1;
 | 
						|
  const a = [
 | 
						|
    /^(0\d|1\d|2[0-3])$/,
 | 
						|
    // HH
 | 
						|
    /^[0-5]\d$/,
 | 
						|
    // mm
 | 
						|
    /^[0-5]\d$/
 | 
						|
    // ss
 | 
						|
  ];
 | 
						|
  return u.every(
 | 
						|
    (r, l) => typeof r == "string" && a[l].test(r)
 | 
						|
  );
 | 
						|
}
 | 
						|
function q(e) {
 | 
						|
  if (!Array.isArray(e) || e.length < 3 || e.length > 6) return !1;
 | 
						|
  const [n, u, t] = e;
 | 
						|
  if (!(typeof n == "string" && /^\d{4}$/.test(n) && typeof u == "string" && /^(0[1-9]|1[0-2])$/.test(u) && typeof t == "string" && /^(0[1-9]|[12]\d|3[01])$/.test(t))) return !1;
 | 
						|
  const r = e.slice(3), l = [
 | 
						|
    /^(0\d|1\d|2[0-3])$/,
 | 
						|
    // HH
 | 
						|
    /^[0-5]\d$/,
 | 
						|
    // mm
 | 
						|
    /^[0-5]\d$/
 | 
						|
    // ss
 | 
						|
  ];
 | 
						|
  return r.every(
 | 
						|
    (o, m) => typeof o == "string" && l[m].test(o)
 | 
						|
  );
 | 
						|
}
 | 
						|
function W(e) {
 | 
						|
  return Array.isArray(e) ? e.every((n) => q(n)) : !1;
 | 
						|
}
 | 
						|
function Qe(e) {
 | 
						|
  return U(e) || N(e) || q(e);
 | 
						|
}
 | 
						|
function Q(e) {
 | 
						|
  const n = /^(\d{4})-(\d{2})-(\d{2})(?: (\d{2})(?::(\d{2})(?::(\d{2}))?)?)?$/, u = e.match(n);
 | 
						|
  if (!u)
 | 
						|
    throw new Error("Invalid date-time format. Expected YYYY-MM-DD[ HH[:mm[:ss]]]");
 | 
						|
  return u.slice(1).filter((t) => t !== void 0);
 | 
						|
}
 | 
						|
function le(e) {
 | 
						|
  const [n, u, t, a, r, l] = e;
 | 
						|
  let o = `${n}-${u}-${t}`;
 | 
						|
  return a !== void 0 && (o += ` ${a}`, r !== void 0 && (o += `:${r}`, l !== void 0 && (o += `:${l}`))), o;
 | 
						|
}
 | 
						|
const Ze = /* @__PURE__ */ k({
 | 
						|
  name: "IDateTimePicker",
 | 
						|
  props: S,
 | 
						|
  setup(e) {
 | 
						|
    const {
 | 
						|
      itemSlots: n
 | 
						|
    } = I(e), {
 | 
						|
      baseAttrs: u
 | 
						|
    } = P(e), {
 | 
						|
      onEvents: t
 | 
						|
    } = T("x-form"), a = b(() => {
 | 
						|
      if (e.formValue[e.name]) {
 | 
						|
        if (U(e.formValue[e.name]))
 | 
						|
          return e.formValue[e.name];
 | 
						|
        if (N(e.formValue[e.name]))
 | 
						|
          return e.formValue[e.name][0].join("-") + "  " + e.formValue[e.name][1].join(":");
 | 
						|
        if (q(e.formValue[e.name]))
 | 
						|
          return le(e.formValue[e.name]);
 | 
						|
        throw new Error(`${e.name} 默认值 格式不正确,时间格式只能是: 'YYYY-MM-DD HH:mm:ss' or [['YYYY', 'MM', 'DD'], ['HH', 'mm', 'ss']] or ['YYYY', 'MM', 'DD', 'HH', 'mm', 'ss']`);
 | 
						|
      }
 | 
						|
      return e.formValue[e.name];
 | 
						|
    }), r = () => {
 | 
						|
      if (e.formValue[e.name] && !Qe(e.formValue[e.name]))
 | 
						|
        throw new Error(`${e.name} 默认值 格式不正确,时间格式只能是: 'YYYY-MM-DD HH:mm:ss' or [['YYYY', 'MM', 'DD'], ['HH', 'mm', 'ss']] or ['YYYY', 'MM', 'DD', 'HH', 'mm', 'ss']`);
 | 
						|
      let m = s(e.orgAttrs, "showType") && ["group", "single"].includes(e.orgAttrs.showType) ? e.orgAttrs.showType : "group";
 | 
						|
      console.log("curShowType :>> ", m), m === "group" ? l() : o();
 | 
						|
    }, l = () => {
 | 
						|
      const m = s(e.orgAttrs, "startProps") ? s(e.orgAttrs.startProps, "columnsType") ? e.orgAttrs.startProps.columnsType : ["year", "month", "day"] : ["year", "month", "day"], i = s(e.orgAttrs, "endProps") ? s(e.orgAttrs.endProps, "columnsType") ? e.orgAttrs.endProps.columnsType : ["hour", "minute", "second"] : ["hour", "minute", "second"], d = b(() => {
 | 
						|
        let C = Object.assign({}, e.orgAttrs);
 | 
						|
        return s(e.orgAttrs, "startProps") && Object.assign(C, e.orgAttrs.startProps), C;
 | 
						|
      }), v = b(() => {
 | 
						|
        let C = Object.assign({}, e.orgAttrs);
 | 
						|
        return s(e.orgAttrs, "endProps") && Object.assign(C, e.orgAttrs.endProps), C;
 | 
						|
      }), [V, y] = M().format("YYYY-MM-DD HH:mm:ss").split(" "), A = D({
 | 
						|
        date: V.split("-").slice(0, m.length),
 | 
						|
        time: y.split(":").slice(0, i.length)
 | 
						|
      });
 | 
						|
      if (e.formValue[e.name]) {
 | 
						|
        if (U(e.formValue[e.name])) {
 | 
						|
          const [C, H] = e.formValue[e.name].split(" ");
 | 
						|
          A.value.date = C.split("-"), A.value.time = H ? C.split(":") : [];
 | 
						|
        }
 | 
						|
        if (N(e.formValue[e.name])) {
 | 
						|
          const [C, H] = e.formValue[e.name];
 | 
						|
          A.value.date = C, A.value.time = H;
 | 
						|
        }
 | 
						|
        q(e.formValue[e.name]) && (A.value.date = e.formValue[e.name].slice(0, 3), A.value.time = e.formValue[e.name].slice(3));
 | 
						|
      }
 | 
						|
      console.log("dateTimeValue.value :>> ", A.value);
 | 
						|
      const {
 | 
						|
        onClose: f
 | 
						|
      } = j({
 | 
						|
        content: c(L, g({
 | 
						|
          title: R(e.label)
 | 
						|
        }, e.orgAttrs, {
 | 
						|
          tabs: ["选择日期", "选择时间"],
 | 
						|
          onConfirm: (...C) => {
 | 
						|
            e.formValue[e.name] = A.value, f(), t("confirm", e.name, ...C);
 | 
						|
          },
 | 
						|
          onChange: (...C) => t("change", e.name, ...C),
 | 
						|
          onCancel: () => {
 | 
						|
            f(), t("cancel", e.name);
 | 
						|
          }
 | 
						|
        }), {
 | 
						|
          default: () => [c(_, g({
 | 
						|
            modelValue: A.value.date,
 | 
						|
            "onUpdate:modelValue": (C) => A.value.date = C,
 | 
						|
            columnsType: m
 | 
						|
          }, d.value), null), c(G, g({
 | 
						|
            modelValue: A.value.time,
 | 
						|
            "onUpdate:modelValue": (C) => A.value.time = C,
 | 
						|
            columnsType: i
 | 
						|
          }, v.value), null)]
 | 
						|
        })
 | 
						|
      });
 | 
						|
    }, o = () => {
 | 
						|
      const m = s(e.orgAttrs, "columnsType") && h(e.orgAttrs.columnsType) ? e.orgAttrs.columnsType : ["year", "month", "day", "hour", "minute", "second"], i = $(m), d = D(i);
 | 
						|
      e.formValue[e.name] && (U(e.formValue[e.name]) && (d.value = Q(e.formValue[e.name])), N(e.formValue[e.name]) && (d.value = e.formValue[e.name].flat()), q(e.formValue[e.name]) && (d.value = e.formValue[e.name]));
 | 
						|
      const v = j({
 | 
						|
        content: c(J, g({
 | 
						|
          modelValue: d.value,
 | 
						|
          "onUpdate:modelValue": (V) => d.value = V,
 | 
						|
          title: R(e.label)
 | 
						|
        }, e.orgAttrs, {
 | 
						|
          columnsType: m,
 | 
						|
          onConfirm: (...V) => {
 | 
						|
            e.formValue[e.name] = d.value, v.onClose(), t("confirm", e.name, ...V);
 | 
						|
          },
 | 
						|
          onChange: (...V) => t("change", e.name, ...V),
 | 
						|
          onCancel: () => {
 | 
						|
            v.onClose(), t("cancel", e.name);
 | 
						|
          }
 | 
						|
        }), null)
 | 
						|
      });
 | 
						|
    };
 | 
						|
    return () => c(Y, g({
 | 
						|
      modelValue: a.value,
 | 
						|
      "onUpdate:modelValue": (m) => a.value = m
 | 
						|
    }, u.value, {
 | 
						|
      clearable: !0,
 | 
						|
      onClickRightIcon: r,
 | 
						|
      onClickInput: r
 | 
						|
    }), n.value);
 | 
						|
  }
 | 
						|
}), pe = /* @__PURE__ */ k({
 | 
						|
  name: "IDateRangePicker",
 | 
						|
  props: S,
 | 
						|
  setup(e) {
 | 
						|
    const {
 | 
						|
      itemSlots: n
 | 
						|
    } = I(e), {
 | 
						|
      baseAttrs: u
 | 
						|
    } = P(e), {
 | 
						|
      onEvents: t
 | 
						|
    } = T("x-form"), a = b(() => e.formValue[e.name] && h(e.formValue[e.name]) ? e.formValue[e.name].map((l) => h(l) ? l.join("-") : l).join(" 至 ") : e.formValue[e.name]), r = () => {
 | 
						|
      const l = s(e.orgAttrs, "columnsType") && h(e.orgAttrs.columnsType) ? e.orgAttrs.columnsType : ["year", "month", "day"], o = $(l), m = b(() => {
 | 
						|
        let f = Object.assign({}, e.orgAttrs);
 | 
						|
        return s(e.orgAttrs, "startProps") && Object.assign(f, e.orgAttrs.startProps), f;
 | 
						|
      }), i = b(() => {
 | 
						|
        let f = Object.assign({}, e.orgAttrs);
 | 
						|
        return s(e.orgAttrs, "endProps") && Object.assign(f, e.orgAttrs.endProps), f;
 | 
						|
      }), d = b(() => {
 | 
						|
        if (e.formValue[e.name] && h(e.formValue[e.name]) && e.formValue[e.name].length > 0) {
 | 
						|
          if (!e.formValue[e.name][0])
 | 
						|
            return o;
 | 
						|
          const f = e.formValue[e.name][0];
 | 
						|
          return h(f) ? f : O(f) ? $(l, M(f)) : o;
 | 
						|
        } else
 | 
						|
          return o;
 | 
						|
      }), v = b(() => {
 | 
						|
        if (e.formValue[e.name] && h(e.formValue[e.name]) && e.formValue[e.name].length > 1) {
 | 
						|
          if (!e.formValue[e.name][1])
 | 
						|
            return o;
 | 
						|
          const f = e.formValue[e.name][1];
 | 
						|
          return h(f) ? f : O(f) ? $(l, M(f)) : o;
 | 
						|
        } else
 | 
						|
          return o;
 | 
						|
      }), V = D({
 | 
						|
        start: d.value,
 | 
						|
        end: v.value
 | 
						|
      }), y = e.orgAttrs, {
 | 
						|
        onClose: A
 | 
						|
      } = j({
 | 
						|
        content: c(L, g({
 | 
						|
          title: R(e.label)
 | 
						|
        }, y, {
 | 
						|
          tabs: s(y, "tabs") ? y.tabs : ["开始日期", "结束日期"],
 | 
						|
          onConfirm: (...f) => {
 | 
						|
            e.formValue[e.name] = [V.value.start, V.value.end], A(), t("confirm", e.name, ...f);
 | 
						|
          },
 | 
						|
          onChange: (...f) => t("change", e.name, ...f),
 | 
						|
          onCancel: () => {
 | 
						|
            A(), t("cancel", e.name);
 | 
						|
          }
 | 
						|
        }), {
 | 
						|
          default: () => [c(_, g({
 | 
						|
            modelValue: V.value.start,
 | 
						|
            "onUpdate:modelValue": (f) => V.value.start = f
 | 
						|
          }, m.value, {
 | 
						|
            columnsType: l
 | 
						|
          }), null), c(_, g({
 | 
						|
            modelValue: V.value.end,
 | 
						|
            "onUpdate:modelValue": (f) => V.value.end = f
 | 
						|
          }, i.value, {
 | 
						|
            columnsType: l
 | 
						|
          }), null)]
 | 
						|
        })
 | 
						|
      });
 | 
						|
    };
 | 
						|
    return () => c(Y, g({
 | 
						|
      modelValue: a.value,
 | 
						|
      "onUpdate:modelValue": (l) => a.value = l
 | 
						|
    }, u.value, {
 | 
						|
      clearable: !0,
 | 
						|
      onClickRightIcon: r,
 | 
						|
      onClickInput: r
 | 
						|
    }), n.value);
 | 
						|
  }
 | 
						|
}), et = /* @__PURE__ */ k({
 | 
						|
  name: "ITimeRangePicker",
 | 
						|
  props: S,
 | 
						|
  setup(e) {
 | 
						|
    const {
 | 
						|
      itemSlots: n
 | 
						|
    } = I(e), {
 | 
						|
      baseAttrs: u
 | 
						|
    } = P(e), {
 | 
						|
      onEvents: t
 | 
						|
    } = T("x-form"), a = b(() => e.formValue[e.name] && h(e.formValue[e.name]) ? e.formValue[e.name].map((l) => h(l) ? l.join(":") : l).join(" 至 ") : e.formValue[e.name]), r = () => {
 | 
						|
      const l = s(e.orgAttrs, "columnsType") && h(e.orgAttrs.columnsType) ? e.orgAttrs.columnsType : ["hour", "minute", "second"], o = $(l), m = b(() => {
 | 
						|
        if (e.formValue[e.name] && h(e.formValue[e.name]) && e.formValue[e.name].length > 0) {
 | 
						|
          if (!e.formValue[e.name][0])
 | 
						|
            return o;
 | 
						|
          const f = e.formValue[e.name][0];
 | 
						|
          return h(f) ? f : O(f) ? $(l, M(`${M().format("YYYY-MM-DD")} ${f}`)) : o;
 | 
						|
        } else
 | 
						|
          return o;
 | 
						|
      }), i = b(() => {
 | 
						|
        if (e.formValue[e.name] && h(e.formValue[e.name]) && e.formValue[e.name].length > 1) {
 | 
						|
          if (!e.formValue[e.name][1])
 | 
						|
            return o;
 | 
						|
          const f = e.formValue[e.name][1];
 | 
						|
          return h(f) ? f : O(f) ? $(l, M(`${M().format("YYYY-MM-DD")} ${f}`)) : o;
 | 
						|
        } else
 | 
						|
          return o;
 | 
						|
      }), d = D({
 | 
						|
        start: m.value,
 | 
						|
        end: i.value
 | 
						|
      }), v = e.orgAttrs, V = b(() => {
 | 
						|
        let f = Object.assign({}, e.orgAttrs);
 | 
						|
        return s(e.orgAttrs, "startProps") && Object.assign(f, e.orgAttrs.startProps), f;
 | 
						|
      }), y = b(() => {
 | 
						|
        let f = Object.assign({}, e.orgAttrs);
 | 
						|
        return s(e.orgAttrs, "endProps") && Object.assign(f, e.orgAttrs.endProps), f;
 | 
						|
      }), {
 | 
						|
        onClose: A
 | 
						|
      } = j({
 | 
						|
        content: c(L, g({
 | 
						|
          title: R(e.label)
 | 
						|
        }, e.orgAttrs, {
 | 
						|
          tabs: s(v, "tabs") ? v.tabs : ["开始时间", "结束时间"],
 | 
						|
          onConfirm: (...f) => {
 | 
						|
            e.formValue[e.name] = [d.value.start, d.value.end], A(), t("confirm", e.name, ...f);
 | 
						|
          },
 | 
						|
          onChange: (...f) => t("change", e.name, ...f),
 | 
						|
          onCancel: () => {
 | 
						|
            A(), t("cancel", e.name);
 | 
						|
          }
 | 
						|
        }), {
 | 
						|
          default: () => [c(G, g({
 | 
						|
            modelValue: d.value.start,
 | 
						|
            "onUpdate:modelValue": (f) => d.value.start = f
 | 
						|
          }, V.value, {
 | 
						|
            columnsType: l
 | 
						|
          }), null), c(G, g({
 | 
						|
            modelValue: d.value.end,
 | 
						|
            "onUpdate:modelValue": (f) => d.value.end = f
 | 
						|
          }, y.value, {
 | 
						|
            columnsType: l
 | 
						|
          }), null)]
 | 
						|
        })
 | 
						|
      });
 | 
						|
    };
 | 
						|
    return () => c(Y, g({
 | 
						|
      modelValue: a.value,
 | 
						|
      "onUpdate:modelValue": (l) => a.value = l
 | 
						|
    }, u.value, {
 | 
						|
      clearable: !0,
 | 
						|
      onClickRightIcon: r,
 | 
						|
      onClickInput: r
 | 
						|
    }), n.value);
 | 
						|
  }
 | 
						|
}), tt = /* @__PURE__ */ k({
 | 
						|
  name: "IDatetimeRangePicker",
 | 
						|
  props: S,
 | 
						|
  setup(e, {}) {
 | 
						|
    const {
 | 
						|
      itemSlots: n
 | 
						|
    } = I(e), {
 | 
						|
      baseAttrs: u
 | 
						|
    } = P(e), {
 | 
						|
      onEvents: t
 | 
						|
    } = T("x-form"), a = b(() => {
 | 
						|
      if (e.formValue[e.name] && h(e.formValue[e.name])) {
 | 
						|
        if (X(e.formValue[e.name]))
 | 
						|
          return e.formValue[e.name].join(" 至 ");
 | 
						|
        if (W(e.formValue[e.name]))
 | 
						|
          return e.formValue[e.name].map((l) => le(l)).join(" 至 ");
 | 
						|
        throw new Error(`${e.name} 默认值 格式不正确,时间格式只能是:["YYYY-MM-DD HH:mm:ss","YYYY-MM-DD HH:mm:ss"] 或 [ [ "YYYY", "MM", "DD", "HH", "mm", "ss" ], [ "YYYY", "MM", "DD", "HH", "mm", "ss" ] ]`);
 | 
						|
      }
 | 
						|
      return e.formValue[e.name];
 | 
						|
    }), r = () => {
 | 
						|
      const l = s(e.orgAttrs, "columnsType") && h(e.orgAttrs.columnsType) ? e.orgAttrs.columnsType : ["year", "month", "day", "hour", "minute", "second"], o = $(l);
 | 
						|
      if (e.formValue[e.name] && !(X(e.formValue[e.name]) || W(e.formValue[e.name])))
 | 
						|
        throw new Error(`${e.name} 默认值 格式不正确,时间格式只能是:["YYYY-MM-DD HH:mm:ss","YYYY-MM-DD HH:mm:ss"] 或 [ [ "YYYY", "MM", "DD", "HH", "mm", "ss" ], [ "YYYY", "MM", "DD", "HH", "mm", "ss" ] ]`);
 | 
						|
      const m = D({
 | 
						|
        start: o,
 | 
						|
        end: o
 | 
						|
      });
 | 
						|
      e.formValue[e.name] && (X(e.formValue[e.name]) && (m.value.start = Q(e.formValue[e.name][0]), m.value.end = Q(e.formValue[e.name][1])), W(e.formValue[e.name]) && (m.value.start = e.formValue[e.name][0], m.value.end = e.formValue[e.name][1]));
 | 
						|
      const i = e.orgAttrs, d = b(() => {
 | 
						|
        let y = Object.assign({}, e.orgAttrs);
 | 
						|
        return s(e.orgAttrs, "startProps") && Object.assign(y, e.orgAttrs.startProps), y;
 | 
						|
      }), v = b(() => {
 | 
						|
        let y = Object.assign({}, e.orgAttrs);
 | 
						|
        return s(e.orgAttrs, "endProps") && Object.assign(y, e.orgAttrs.endProps), y;
 | 
						|
      }), {
 | 
						|
        onClose: V
 | 
						|
      } = j({
 | 
						|
        content: c(L, g({
 | 
						|
          title: R(e.label)
 | 
						|
        }, i, {
 | 
						|
          tabs: s(i, "tabs") ? i.tabs : ["开始时间", "结束时间"],
 | 
						|
          onConfirm: (...y) => {
 | 
						|
            e.formValue[e.name] = [m.value.start, m.value.end], V(), t("confirm", e.name, ...y);
 | 
						|
          },
 | 
						|
          onChange: (...y) => t("change", e.name, ...y),
 | 
						|
          onCancel: () => {
 | 
						|
            V(), t("cancel", e.name);
 | 
						|
          }
 | 
						|
        }), {
 | 
						|
          default: () => [c(J, g({
 | 
						|
            modelValue: m.value.start,
 | 
						|
            "onUpdate:modelValue": (y) => m.value.start = y
 | 
						|
          }, d.value, {
 | 
						|
            columnsType: l
 | 
						|
          }), null), c(J, g({
 | 
						|
            modelValue: m.value.end,
 | 
						|
            "onUpdate:modelValue": (y) => m.value.end = y
 | 
						|
          }, v.value, {
 | 
						|
            columnsType: l
 | 
						|
          }), null)]
 | 
						|
        })
 | 
						|
      });
 | 
						|
    };
 | 
						|
    return () => c(Y, g({
 | 
						|
      modelValue: a.value,
 | 
						|
      "onUpdate:modelValue": (l) => a.value = l
 | 
						|
    }, u.value, {
 | 
						|
      clearable: !0,
 | 
						|
      onClickRightIcon: r,
 | 
						|
      onClickInput: r
 | 
						|
    }), n.value);
 | 
						|
  }
 | 
						|
}), nt = /* @__PURE__ */ k({
 | 
						|
  name: "ICheckbox",
 | 
						|
  props: S,
 | 
						|
  setup(e) {
 | 
						|
    const {
 | 
						|
      itemSlots: n
 | 
						|
    } = I(e), {
 | 
						|
      baseAttrs: u
 | 
						|
    } = P(e), {
 | 
						|
      onEvents: t
 | 
						|
    } = T("x-form"), {
 | 
						|
      options: a
 | 
						|
    } = z(e.options);
 | 
						|
    return () => c(Y, u.value, {
 | 
						|
      ...n.value,
 | 
						|
      input: () => c(he, g({
 | 
						|
        modelValue: e.formValue[e.name],
 | 
						|
        "onUpdate:modelValue": (r) => e.formValue[e.name] = r
 | 
						|
      }, e.orgAttrs, {
 | 
						|
        class: {
 | 
						|
          "readonly-checkbox": e.readonly
 | 
						|
        },
 | 
						|
        disabled: e.readonly || s(e.orgAttrs, "disabled") && !!e.orgAttrs.disabled,
 | 
						|
        onChange: (...r) => t("change", e.name, ...r)
 | 
						|
      }), {
 | 
						|
        default: () => {
 | 
						|
          var r;
 | 
						|
          return [(r = a.value) == null ? void 0 : r.map((l) => c(ye, g({
 | 
						|
            key: l.value
 | 
						|
          }, l.attrs, {
 | 
						|
            name: l.value,
 | 
						|
            onClick: (...o) => {
 | 
						|
              t("click-option", e.name, ...o);
 | 
						|
            },
 | 
						|
            onChange: (...o) => {
 | 
						|
              t("change-option", e.name, ...o);
 | 
						|
            }
 | 
						|
          }), {
 | 
						|
            default: () => [l.text]
 | 
						|
          }))];
 | 
						|
        }
 | 
						|
      })
 | 
						|
    });
 | 
						|
  }
 | 
						|
});
 | 
						|
function at(e) {
 | 
						|
  return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !te(e);
 | 
						|
}
 | 
						|
const lt = /* @__PURE__ */ k({
 | 
						|
  name: "IRadio",
 | 
						|
  props: S,
 | 
						|
  setup(e) {
 | 
						|
    const {
 | 
						|
      itemSlots: n
 | 
						|
    } = I(e), {
 | 
						|
      baseAttrs: u
 | 
						|
    } = P(e), {
 | 
						|
      onEvents: t
 | 
						|
    } = T("x-form"), {
 | 
						|
      options: a
 | 
						|
    } = z(e.options), r = () => {
 | 
						|
      var l;
 | 
						|
      return (l = a.value) == null ? void 0 : l.map((o) => c(Ae, g({
 | 
						|
        key: o.value
 | 
						|
      }, o.attrs, {
 | 
						|
        name: o.value,
 | 
						|
        onClick: (...m) => {
 | 
						|
          t("click-option", e.name, ...m);
 | 
						|
        }
 | 
						|
      }), {
 | 
						|
        default: () => [o.text]
 | 
						|
      }));
 | 
						|
    };
 | 
						|
    return () => c(Y, u.value, {
 | 
						|
      ...n.value,
 | 
						|
      input: () => {
 | 
						|
        let l;
 | 
						|
        return c(be, g({
 | 
						|
          modelValue: e.formValue[e.name],
 | 
						|
          "onUpdate:modelValue": (o) => e.formValue[e.name] = o
 | 
						|
        }, e.orgAttrs, {
 | 
						|
          class: {
 | 
						|
            "readonly-radio": e.readonly
 | 
						|
          },
 | 
						|
          disabled: e.readonly || s(e.orgAttrs, "disabled") && !!e.orgAttrs.disabled,
 | 
						|
          onChange: (...o) => t("change", e.name, ...o)
 | 
						|
        }), at(l = r()) ? l : {
 | 
						|
          default: () => [l]
 | 
						|
        });
 | 
						|
      }
 | 
						|
    });
 | 
						|
  }
 | 
						|
}), ut = /* @__PURE__ */ k({
 | 
						|
  name: "ISwitch",
 | 
						|
  props: S,
 | 
						|
  setup(e) {
 | 
						|
    const {
 | 
						|
      itemSlots: n
 | 
						|
    } = I(e), {
 | 
						|
      baseAttrs: u
 | 
						|
    } = P(e), {
 | 
						|
      onEvents: t
 | 
						|
    } = T("x-form"), a = x(e.orgAttrs);
 | 
						|
    return () => c(Y, u.value, {
 | 
						|
      ...n.value,
 | 
						|
      input: () => c(Ce, g({
 | 
						|
        modelValue: e.formValue[e.name],
 | 
						|
        "onUpdate:modelValue": (r) => e.formValue[e.name] = r
 | 
						|
      }, e.orgAttrs, {
 | 
						|
        class: {
 | 
						|
          "readonly-switch": e.readonly
 | 
						|
        },
 | 
						|
        disabled: e.readonly || s(e.orgAttrs, "disabled") && !!e.orgAttrs.disabled,
 | 
						|
        onChange: (...r) => t("change", e.name, ...r),
 | 
						|
        onClick: (...r) => t("click", e.name, ...r)
 | 
						|
      }), {
 | 
						|
        node: () => s(a, "node") ? a.node() : void 0,
 | 
						|
        background: () => s(a, "background") ? a.background() : void 0
 | 
						|
      })
 | 
						|
    });
 | 
						|
  }
 | 
						|
}), rt = /* @__PURE__ */ k({
 | 
						|
  name: "IRate",
 | 
						|
  props: S,
 | 
						|
  setup(e) {
 | 
						|
    const {
 | 
						|
      itemSlots: n
 | 
						|
    } = I(e), {
 | 
						|
      baseAttrs: u
 | 
						|
    } = P(e), {
 | 
						|
      onEvents: t
 | 
						|
    } = T("x-form");
 | 
						|
    return () => c(Y, u.value, {
 | 
						|
      ...n.value,
 | 
						|
      input: () => c(ke, g({
 | 
						|
        modelValue: e.formValue[e.name],
 | 
						|
        "onUpdate:modelValue": (a) => e.formValue[e.name] = a
 | 
						|
      }, e.orgAttrs, {
 | 
						|
        readonly: e.readonly || s(e.orgAttrs, "readonly") && !!e.orgAttrs.readonly,
 | 
						|
        onChange: (...a) => t("change", e.name, ...a)
 | 
						|
      }), null)
 | 
						|
    });
 | 
						|
  }
 | 
						|
}), ot = /* @__PURE__ */ k({
 | 
						|
  name: "ISlider",
 | 
						|
  props: S,
 | 
						|
  setup(e) {
 | 
						|
    const {
 | 
						|
      itemSlots: n
 | 
						|
    } = I(e), {
 | 
						|
      baseAttrs: u
 | 
						|
    } = P(e), {
 | 
						|
      onEvents: t
 | 
						|
    } = T("x-form"), a = x(e.orgAttrs);
 | 
						|
    return () => c(Y, u.value, {
 | 
						|
      ...n.value,
 | 
						|
      input: () => c(Te, g({
 | 
						|
        modelValue: e.formValue[e.name],
 | 
						|
        "onUpdate:modelValue": (r) => e.formValue[e.name] = r
 | 
						|
      }, e.orgAttrs, {
 | 
						|
        class: {
 | 
						|
          "readonly-slider": e.readonly
 | 
						|
        },
 | 
						|
        disabled: e.readonly || s(e.orgAttrs, "disabled") && !!e.orgAttrs.disabled,
 | 
						|
        onDragStart: (...r) => {
 | 
						|
          t("drag-start", e.name, ...r);
 | 
						|
        },
 | 
						|
        onDragEnd: (...r) => {
 | 
						|
          t("drag-end", e.name, ...r);
 | 
						|
        },
 | 
						|
        onChange: (...r) => t("change", e.name, ...r)
 | 
						|
      }), {
 | 
						|
        // button: () => has(compSlots, 'button') ? compSlots.button() : undefined,
 | 
						|
        "left-button": () => s(a, "left-button") ? a["left-button"]() : void 0,
 | 
						|
        "right-button": () => s(a, "right-button") ? a["right-button"]() : void 0
 | 
						|
      })
 | 
						|
    });
 | 
						|
  }
 | 
						|
}), mt = /* @__PURE__ */ k({
 | 
						|
  name: "IStepper",
 | 
						|
  props: S,
 | 
						|
  setup(e) {
 | 
						|
    const {
 | 
						|
      itemSlots: n
 | 
						|
    } = I(e), {
 | 
						|
      baseAttrs: u
 | 
						|
    } = P(e), {
 | 
						|
      onEvents: t
 | 
						|
    } = T("x-form");
 | 
						|
    return () => c(Y, u.value, {
 | 
						|
      ...n.value,
 | 
						|
      input: () => c(Se, g({
 | 
						|
        modelValue: e.formValue[e.name],
 | 
						|
        "onUpdate:modelValue": (a) => e.formValue[e.name] = a
 | 
						|
      }, e.orgAttrs, {
 | 
						|
        class: {
 | 
						|
          "readonly-stepper": e.readonly
 | 
						|
        },
 | 
						|
        disabled: e.readonly || s(e.orgAttrs, "disabled") && !!e.orgAttrs.disabled,
 | 
						|
        onChange: (...a) => t("change", e.name, ...a),
 | 
						|
        onFocus: (...a) => t("focus", e.name, ...a),
 | 
						|
        onBlur: (...a) => t("blur", e.name, ...a),
 | 
						|
        onPlus: (...a) => {
 | 
						|
          t("plus", e.name, ...a);
 | 
						|
        },
 | 
						|
        onMinus: (...a) => {
 | 
						|
          t("minus", e.name, ...a);
 | 
						|
        },
 | 
						|
        onOverlimit: (...a) => {
 | 
						|
          t("overlimit", e.name, ...a);
 | 
						|
        }
 | 
						|
      }), null)
 | 
						|
    });
 | 
						|
  }
 | 
						|
}), ct = /* @__PURE__ */ k({
 | 
						|
  name: "IText",
 | 
						|
  props: S,
 | 
						|
  setup(e) {
 | 
						|
    const {
 | 
						|
      itemSlots: n
 | 
						|
    } = I(e), {
 | 
						|
      baseAttrs: u
 | 
						|
    } = P(e);
 | 
						|
    return () => c(Y, u.value, {
 | 
						|
      ...n.value,
 | 
						|
      input: () => c(w, null, [e.formValue[e.name]])
 | 
						|
    });
 | 
						|
  }
 | 
						|
}), it = /* @__PURE__ */ k({
 | 
						|
  name: "IHtml",
 | 
						|
  props: S,
 | 
						|
  setup(e) {
 | 
						|
    const {
 | 
						|
      itemSlots: n
 | 
						|
    } = I(e), {
 | 
						|
      baseAttrs: u
 | 
						|
    } = P(e);
 | 
						|
    return () => c(Y, u.value, {
 | 
						|
      ...n.value,
 | 
						|
      input: () => c("div", g({
 | 
						|
        innerHTML: e.formValue[e.name]
 | 
						|
      }, e.orgAttrs), null)
 | 
						|
    });
 | 
						|
  }
 | 
						|
}), st = /* @__PURE__ */ k({
 | 
						|
  name: "IInputSlot",
 | 
						|
  props: S,
 | 
						|
  setup(e) {
 | 
						|
    const {
 | 
						|
      itemSlots: n
 | 
						|
    } = I(e), {
 | 
						|
      baseAttrs: u
 | 
						|
    } = P(e), {
 | 
						|
      formSlots: t
 | 
						|
    } = T("x-form");
 | 
						|
    return () => c(Y, g({
 | 
						|
      modelValue: e.formValue[e.name],
 | 
						|
      "onUpdate:modelValue": (a) => e.formValue[e.name] = a
 | 
						|
    }, u.value), {
 | 
						|
      ...n.value,
 | 
						|
      input: () => c(w, null, [s(t, e.name) ? E(t, e.name) : c(w, null, null)])
 | 
						|
    });
 | 
						|
  }
 | 
						|
}), dt = /* @__PURE__ */ k({
 | 
						|
  props: S,
 | 
						|
  setup(e, {}) {
 | 
						|
    const {
 | 
						|
      formSlots: n
 | 
						|
    } = T("x-form"), u = {
 | 
						|
      input: () => c(_e, e, null),
 | 
						|
      picker: () => c(Ge, e, null),
 | 
						|
      radio: () => c(lt, e, null),
 | 
						|
      checkbox: () => c(nt, e, null),
 | 
						|
      switch: () => c(ut, e, null),
 | 
						|
      rate: () => c(rt, e, null),
 | 
						|
      slider: () => c(ot, e, null),
 | 
						|
      stepper: () => c(mt, e, null),
 | 
						|
      area: () => c(Le, e, null),
 | 
						|
      cascader: () => c(We, e, null),
 | 
						|
      /* 暂不支持异步加载 */
 | 
						|
      "date-picker": () => c(Je, e, null),
 | 
						|
      "date-range-picker": () => c(pe, e, null),
 | 
						|
      "time-picker": () => c(Ke, e, null),
 | 
						|
      "time-range-picker": () => c(et, e, null),
 | 
						|
      "datetime-picker": () => c(Ze, e, null),
 | 
						|
      "datetime-range-picker": () => c(tt, e, null),
 | 
						|
      text: () => c(ct, e, null),
 | 
						|
      html: () => c(it, e, null),
 | 
						|
      "input-slot": () => c(st, e, null),
 | 
						|
      slot: () => c(w, null, [s(n, e.name) ? E(n, e.name) : c(w, null, null)])
 | 
						|
      // 'calendar': () => <ICalendar {...props} />,
 | 
						|
    };
 | 
						|
    return () => c(w, null, [u[e.type]()]);
 | 
						|
  }
 | 
						|
});
 | 
						|
function ft(e) {
 | 
						|
  return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !te(e);
 | 
						|
}
 | 
						|
const [gt] = De("form"), vt = Object.assign({}, Ye, {
 | 
						|
  model: {
 | 
						|
    type: Object,
 | 
						|
    required: !0,
 | 
						|
    default: () => ({})
 | 
						|
  },
 | 
						|
  items: {
 | 
						|
    type: Array,
 | 
						|
    required: !0,
 | 
						|
    default: () => []
 | 
						|
  },
 | 
						|
  rules: {
 | 
						|
    type: Object,
 | 
						|
    default: () => ({})
 | 
						|
  },
 | 
						|
  inset: {
 | 
						|
    type: Boolean,
 | 
						|
    default: !1
 | 
						|
  },
 | 
						|
  size: {
 | 
						|
    type: String,
 | 
						|
    default: "normal"
 | 
						|
  }
 | 
						|
}), Vt = /* @__PURE__ */ k({
 | 
						|
  name: gt,
 | 
						|
  props: vt,
 | 
						|
  emits: Ue,
 | 
						|
  setup(e, {
 | 
						|
    slots: n,
 | 
						|
    attrs: u,
 | 
						|
    emit: t,
 | 
						|
    expose: a
 | 
						|
  }) {
 | 
						|
    const r = D(), l = (...i) => t("submit", ...i), o = (...i) => t("failed", ...i);
 | 
						|
    se("x-form", {
 | 
						|
      formSlots: n,
 | 
						|
      rules: e.rules,
 | 
						|
      onEvents: (i, ...d) => {
 | 
						|
        t(i, ...d);
 | 
						|
      }
 | 
						|
    }), a({
 | 
						|
      submit: () => r.value.submit(),
 | 
						|
      getValues: () => r.value.getValues(),
 | 
						|
      validate: async (i) => {
 | 
						|
        var d;
 | 
						|
        return await ((d = r.value) == null ? void 0 : d.validate(i));
 | 
						|
      },
 | 
						|
      resetValidation: (i) => r.value.resetValidation(i),
 | 
						|
      getValidationStatus: () => r.value.getValidationStatus(),
 | 
						|
      scrollToField: (i, d) => r.value.scrollToField(i, d)
 | 
						|
    });
 | 
						|
    const m = (i) => {
 | 
						|
      const {
 | 
						|
        itemProps: d,
 | 
						|
        name: v
 | 
						|
      } = i, V = s(e.rules, v) ? !!e.rules[v].find((f) => s(f, "required") && f.required) : !1, y = s(i, "required") ? !!i.required : !1;
 | 
						|
      return (d && s(d, "required") ? !!d.required : !1) || y || V || !!e.required;
 | 
						|
    };
 | 
						|
    return {
 | 
						|
      formRef: r,
 | 
						|
      ...Z(e),
 | 
						|
      attrs: u,
 | 
						|
      getRequired: m,
 | 
						|
      onSubmit: l,
 | 
						|
      onFailed: o
 | 
						|
    };
 | 
						|
  },
 | 
						|
  render() {
 | 
						|
    let e;
 | 
						|
    const {
 | 
						|
      formRef: n,
 | 
						|
      items: u,
 | 
						|
      model: t,
 | 
						|
      size: a,
 | 
						|
      rules: r,
 | 
						|
      required: l,
 | 
						|
      readonly: o,
 | 
						|
      onSubmit: m,
 | 
						|
      onFailed: i,
 | 
						|
      attrs: d,
 | 
						|
      inset: v,
 | 
						|
      getRequired: V,
 | 
						|
      ...y
 | 
						|
    } = this;
 | 
						|
    return c(Pe, g({
 | 
						|
      ref: "formRef",
 | 
						|
      onSubmit: m,
 | 
						|
      onFailed: i,
 | 
						|
      required: l,
 | 
						|
      readonly: o
 | 
						|
    }, y, d), {
 | 
						|
      default: () => [c(Ie, {
 | 
						|
        inset: v
 | 
						|
      }, ft(e = u.map((A, f) => {
 | 
						|
        const {
 | 
						|
          vif: C,
 | 
						|
          type: H,
 | 
						|
          name: p,
 | 
						|
          label: ue,
 | 
						|
          itemProps: re,
 | 
						|
          popup: oe
 | 
						|
        } = A;
 | 
						|
        if (!$e.includes(H))
 | 
						|
          throw new Error(`${H} 类型组件暂不支持`);
 | 
						|
        return (s(A, "vif") ? ne(C) ? C(t) : C : !0) ? c(dt, {
 | 
						|
          key: p + f,
 | 
						|
          formValue: t,
 | 
						|
          type: H,
 | 
						|
          name: p,
 | 
						|
          label: ue,
 | 
						|
          options: A.options,
 | 
						|
          config: A,
 | 
						|
          required: V(A),
 | 
						|
          readonly: o,
 | 
						|
          popup: oe,
 | 
						|
          itemAttrs: re,
 | 
						|
          size: a,
 | 
						|
          orgAttrs: A.attrs
 | 
						|
        }, null) : null;
 | 
						|
      })) ? e : {
 | 
						|
        default: () => [e]
 | 
						|
      })]
 | 
						|
    });
 | 
						|
  }
 | 
						|
}), Tt = xe(Vt);
 | 
						|
export {
 | 
						|
  Tt as X
 | 
						|
};
 |