import "./rolldown-runtime-CdpVaAjv.js";
import { n as e } from "./utils-DJ3DjJ60.js";
import { c as t } from "./DatePicker-DHA3FreS.js";
import { i as n } from "./Button-CG0BbgfC.js";
import { computed as r, createElementBlock as i, createSlots as a, createVNode as o, defineComponent as s, guardReactiveProps as c, mergeModels as l, mergeProps as u, normalizeClass as d, normalizeProps as f, normalizeStyle as p, openBlock as m, renderList as h, renderSlot as g, unref as _, useAttrs as v, useModel as y, useSlots as b, withCtx as x } from "vue";
//#endregion
//#region ../components/Input/index.ts
var S = e(/* @__PURE__ */ n(/* @__PURE__ */ s({
	name: "zh-input",
	__name: "Input",
	props: /* @__PURE__ */ l({
		style: {},
		class: { default: "zh-default-input" },
		size: { default: "default" },
		className: {}
	}, {
		modelValue: {},
		modelModifiers: {}
	}),
	emits: ["update:modelValue"],
	setup(e) {
		let n = v(), s = r(() => Object.keys(b())), l = e, p = y(e, "modelValue"), S = () => {
			(n.max || Number(n.max) === 0) && Number(p.value) >= n.max && (p.value = n.max.toString()), (n.min || Number(n.min) === 0) && Number(p.value) <= n.min && (p.value = n.min.toString());
		};
		return (n, r) => (m(), i("div", { class: d(l.class) }, [o(_(t), u(n.$attrs, {
			modelValue: p.value,
			"onUpdate:modelValue": r[0] ||= (e) => p.value = e,
			size: e.size,
			onBlur: S
		}), a({ _: 2 }, [h(s.value, (e) => ({
			name: e,
			fn: x((t) => [g(n.$slots, e, f(c(t)), void 0, !0)])
		}))]), 1040, ["modelValue", "size"])], 2));
	}
}), [["__scopeId", "data-v-13061cee"]])), C = /* @__PURE__ */ n(/* @__PURE__ */ s({
	name: "zh-input-number",
	__name: "InputNumber",
	props: {
		style: {},
		class: {},
		modelValue: {}
	},
	emits: ["update:modelValue", "change"],
	setup(e, { emit: n }) {
		let s = r(() => Object.keys(b())), l = e, y = n, S = v(), C = (e, t = 0, n = 0, r = 0) => {
			let i = e?.toString() ?? "", a, o, s;
			return n === 0 ? (i = i.replace(/[^\d]/g, ""), i = i.replace(/^0\d+/g, "0"), t !== 0 && (i = i.slice(0, t))) : (i = i.replace(/[^\-\d.]/g, ""), i = i.replace(/^[^\-\d]/g, ""), i = i.replace(/\.{2}/g, "."), i = i.replace(/^0(\d+)/g, "$1"), a = i.split(".") || [], a.length > 1 ? (o = t === 0 ? a[0] : a[0].slice(0, t), s = a[1].slice(0, n), i = o + "." + s) : t !== 0 && (i = i.slice(0, t))), r !== 0 && (i = i.slice(0, r)), i;
		}, w = () => {
			l.modelValue === "" || l.modelValue === void 0 || (S.max && Number(l.modelValue) > S.max && y("update:modelValue", S.max.toString()), S.min && Number(l.modelValue) < S.min && y("update:modelValue", S.min.toString()));
		}, T = (e) => e ? C(e, S.integer, S.precision, S.maxLength) : "", E = (e) => {
			let t = T(e);
			if (e === "" || t === "") {
				y("update:modelValue", t);
				return;
			}
			String(e).includes(".") || String(t).includes(".") ? y("update:modelValue", t) : y("update:modelValue", Number(t));
		}, D = (e) => {
			y("change", T(e));
		};
		return (e, n) => (m(), i("div", {
			class: d(["input-number", l.class]),
			style: p(l.style)
		}, [o(_(t), u(e.$attrs, {
			"model-value": l.modelValue,
			"onUpdate:modelValue": E,
			onBlur: w,
			style: { width: "100%" },
			formatter: T,
			onChange: D
		}), a({ _: 2 }, [h(s.value, (t) => ({
			name: t,
			fn: x((n) => [g(e.$slots, t, f(c(n)), void 0, !0)])
		}))]), 1040, ["model-value"])], 6));
	}
}), [["__scopeId", "data-v-39fdefdf"]]), w = e(C);
//#endregion
export { C as n, S as r, w as t };
