@aplus-frontend/ui
Version:
84 lines (83 loc) • 2.35 kB
JavaScript
import { defineComponent as d, unref as e, createElementBlock as p, createBlock as a, openBlock as t, Fragment as s, createTextVNode as f, toDisplayString as i, withCtx as y, createElementVNode as r } from "vue";
import { EyeOutlined as c, EyeInvisibleOutlined as m } from "@ant-design/icons-vue";
import { Space as B } from "@aplus-frontend/antdv";
const g = /* @__PURE__ */ d({
name: "ApFieldTextPasswordRead",
__name: "read-password",
props: {
mode: { default: "edit" },
class: {},
style: {},
variant: {},
size: {},
value: {},
name: {},
type: { default: "text" },
onCompositionend: {},
onCompositionstart: {},
onFocus: {},
onBlur: {},
onChange: {},
onInput: {},
onKeydown: {},
onKeyup: {},
onMousedown: {},
focused: { type: Boolean },
hidden: { type: Boolean },
disabled: { type: Boolean, default: void 0 },
prefixCls: {},
id: {},
readonly: { type: Boolean },
autofocus: { type: Boolean },
autocomplete: {},
placeholder: {},
lazy: { type: Boolean, default: !0 },
maxlength: {},
loading: { type: Boolean },
bordered: { type: Boolean, default: !0 },
showCount: { type: [Boolean, Object] },
htmlSize: {},
onPressEnter: {},
onMouseUp: {},
onRawInput: {},
"onUpdate:value": {},
valueModifiers: {},
status: {},
defaultValue: {},
inputElement: {},
triggerFocus: {},
handleReset: {},
addonBefore: {},
addonAfter: {},
prefix: {},
suffix: {},
clearIcon: {},
allowClear: { type: Boolean, default: !0 },
inputPrefixCls: {},
action: { default: "click" },
visibilityToggle: { type: Boolean, default: !0 },
visible: { type: Boolean, default: void 0 },
"onUpdate:visible": {},
emptyText: { default: "--" }
},
setup(u) {
const o = e(u.visible);
return (n, l) => n.value ? (t(), a(e(B), { key: 1 }, {
default: y(() => [
r("span", null, i(e(o) ? n.value : "********"), 1),
r("span", {
style: { cursor: "pointer" },
onClick: l[0] || (l[0] = () => o.value = !e(o))
}, [
e(o) ? (t(), a(e(c), { key: 0 })) : (t(), a(e(m), { key: 1 }))
])
]),
_: 1
})) : (t(), p(s, { key: 0 }, [
f(i(n.emptyText), 1)
], 64));
}
});
export {
g as default
};