@aplus-frontend/ui
Version:
60 lines (59 loc) • 2.16 kB
JavaScript
import { defineComponent as o, toRaw as x, createVNode as n } from "vue";
import { ApSizeInputProps as f } from "./constans.mjs";
import "../../ap-field/number/index.vue2.mjs";
import { Form as g, Space as r } from "@aplus-frontend/antdv";
import "../../config-provider/index.mjs";
import { useNamespace as I } from "../../config-provider/hooks/use-namespace.mjs";
import { useLocale as C } from "../../config-provider/hooks/use-locale.mjs";
import m from "../../ap-field/number/index.vue.mjs";
const N = /* @__PURE__ */ o({
name: "ApSizeInput",
props: f(),
setup(e, {
emit: c
}) {
const {
b: d
} = I("ap-size-input"), {
t
} = C(), u = g.useInjectFormItemContext(), i = (a, h) => {
const l = e.value;
l[a] = h, c("update:value", l), c("SizeInputChange", x(l)), u.onFieldChange();
};
return () => n(r, {
class: [d()]
}, {
default: () => [n(m, {
mode: e.editable ? "edit" : "read",
value: e.value?.[0],
placeholder: e.placeholder && e.placeholder.length >= 3 ? e.placeholder[0] : t("ap.apSizeInput.length"),
precision: e.precision ? e.precision : 2,
min: e.min ? e.min : 1,
max: e.max ? e.max : 999.99,
onChange: (a) => i(0, a),
step: e.step ? e.step : 1
}, null), e.perfix, n(m, {
mode: e.editable ? "edit" : "read",
value: e.value?.[1],
placeholder: e.placeholder && e.placeholder.length >= 3 ? e.placeholder[1] : t("ap.apSizeInput.width"),
precision: e.precision ? e.precision : 2,
min: e.min ? e.min : 1,
max: e.max ? e.max : 999.99,
onChange: (a) => i(1, a),
step: e.step ? e.step : 1
}, null), e.perfix, n(m, {
mode: e.editable ? "edit" : "read",
value: e.value?.[2],
placeholder: e.placeholder && e.placeholder.length >= 3 ? e.placeholder[2] : t("ap.apSizeInput.height"),
precision: e.precision ? e.precision : 2,
min: e.min ? e.min : 1,
max: e.max ? e.max : 999.99,
onChange: (a) => i(2, a),
step: e.step ? e.step : 1
}, null)]
});
}
});
export {
N as default
};