import { defineComponent as p, toRaw as f, createVNode as a, mergeProps as m } from "vue";
import { Form as s } from "@aplus-frontend/antdv";
import "../../ap-field/number/index.vue2.mjs";
import "../../config-provider/index.mjs";
import { ApSizeInputProps as g } from "./constans.mjs";
import I from "./style/index.mjs";
import { useNamespace as v } from "../../config-provider/hooks/use-namespace.mjs";
import { useLocale as z } from "../../config-provider/hooks/use-locale.mjs";
import u from "../../ap-field/number/index.vue.mjs";
const _ = /* @__PURE__ */ p({
  name: "ApSizeInput",
  props: g(),
  setup(e, {
    emit: c
  }) {
    const {
      b: d
    } = v("ap-size-input"), h = I("ap-size-input"), {
      t: n
    } = z(), r = s.useInjectFormItemContext(), o = (t, l) => {
      const i = e.value || [];
      i[t] = l, c("update:value", i), c("SizeInputChange", f(i)), r.onFieldChange();
    };
    return () => {
      const t = {
        style: {
          flex: 1
        },
        precision: e.precision ?? 2,
        min: e.min ?? 1,
        max: e.max,
        step: e.step ?? 1,
        mode: e.editable ? "edit" : "read",
        disabled: e.disabled
      };
      return a("div", {
        class: [d(), h.value],
        style: e.style
      }, [a(u, m({
        value: e.value?.[0],
        placeholder: e.placeholder && e.placeholder.length >= 3 ? e.placeholder[0] : n("ap.apSizeInput.length"),
        onChange: (l) => o(0, l)
      }, t), null), e.perfix, a(u, m({
        value: e.value?.[1],
        placeholder: e.placeholder && e.placeholder.length >= 3 ? e.placeholder[1] : n("ap.apSizeInput.width"),
        onChange: (l) => o(1, l)
      }, t), null), e.perfix, a(u, m({
        value: e.value?.[2],
        placeholder: e.placeholder && e.placeholder.length >= 3 ? e.placeholder[2] : n("ap.apSizeInput.height"),
        onChange: (l) => o(2, l)
      }, t), null)]);
    };
  }
});
export {
  _ as default
};
