@aplus-frontend/ui
Version:
102 lines (101 loc) • 2.73 kB
JavaScript
import { defineComponent as B, useSlots as x, shallowRef as S, computed as _, createBlock as F, openBlock as R, normalizeProps as s, guardReactiveProps as n, unref as l, createSlots as u, withCtx as p, createVNode as k, mergeProps as C, renderList as f, renderSlot as c } from "vue";
import { omit as m, pick as P } from "lodash-unified";
import { ApField as w } from "../../../ap-field/index.mjs";
import { apFormItemSlotNames as v } from "../../constant.mjs";
import "../../item/index.vue2.mjs";
import A from "../../item/index.vue.mjs";
const E = /* @__PURE__ */ B({
name: "ApFormItemText",
__name: "index",
props: {
htmlFor: {},
prefixCls: {},
label: {},
help: {},
extra: {},
labelCol: {},
wrapperCol: {},
hasFeedback: { type: Boolean, default: !1 },
colon: { type: Boolean, default: void 0 },
labelAlign: {},
prop: {},
name: {},
rules: {},
autoLink: { type: Boolean, default: !0 },
required: { type: Boolean, default: void 0 },
validateFirst: { type: Boolean, default: void 0 },
validateStatus: {},
validateTrigger: {},
messageVariables: {},
hidden: { type: Boolean },
noStyle: { type: Boolean },
tooltip: {},
span: {},
order: {},
offset: {},
push: {},
pull: {},
xs: {},
sm: {},
md: {},
lg: {},
xl: {},
xxl: {},
flex: {},
bordered: { type: Boolean },
valuePropName: {},
initialValue: {},
_signal: {},
transform: {},
description: {},
customFilled: {},
disabled: { type: Boolean, default: void 0 },
field: { default: () => ({}) },
placeholder: {}
},
setup(b, { expose: h }) {
const { Text: g } = w, i = x(), y = b, o = S();
return h({
focus: (e) => {
o.value?.focus(e);
},
blur: () => {
o.value?.blur();
},
setSelectionRange: (e, d, a) => {
o.value?.setSelectionRange(e, d, a);
},
select: () => {
o.value?.select();
},
input: _(() => o.value?.input)
}), (e, d) => (R(), F(A, s(n(l(m)(y, ["field", "placeholder"]))), u({
default: p(() => [
k(l(g), C({
ref_key: "inputRef",
ref: o,
disabled: e.disabled,
placeholder: e.placeholder
}, e.field), u({ _: 2 }, [
f(l(m)(i, l(v)), (a, t) => ({
name: t,
fn: p((r) => [
c(e.$slots, t, s(n(r || {})))
])
}))
]), 1040, ["disabled", "placeholder"])
]),
_: 2
}, [
f(l(P)(i, l(v)), (a, t) => ({
name: t,
fn: p((r) => [
c(e.$slots, t, s(n(r || {})))
])
}))
]), 1040));
}
});
export {
E as default
};