UNPKG

ideaz-element

Version:

<p align="center"> <a href="" target="_blank" rel="noopener noreferrer"> <img src="./docs/public/logo.svg" alt="Ideaz Element" width="180" style="width: 180px;" /> </a> </p>

68 lines (67 loc) 1.89 kB
import { defineComponent as S, createVNode as f, mergeProps as g } from "vue"; import "../../../utils/index.mjs"; import { QuestionFilled as y } from "@element-plus/icons-vue"; import { ElIcon as I, ElTooltip as j } from "element-plus"; import { useNamespace as E } from "../../../hooks/useNamespace.mjs"; import { isObject as i, isFunction as a, isSlot as m, isString as l } from "../../../utils/is.mjs"; const B = /* @__PURE__ */ S({ name: "FormItemLabel", props: { label: { type: [String, Function], default: "" }, tooltip: { type: [String, Function, Object], default: "" }, colon: { type: Boolean, default: !1 } }, setup(p, { slots: r }) { const d = E("form-item"), b = (n) => { var o, e; return i(n) && a(n.reference) ? (o = n.reference) == null ? void 0 : o.call(n) : m(n.reference) ? (e = r[n.reference]) == null ? void 0 : e.call(r) : n && f(I, { class: d.be("label", "icon") }, { default: () => [f(y, null, null)] }); }; return () => { const { label: n, colon: o, tooltip: e } = p, F = i(e) ? { content: l(e.content) ? e.content : "" } : { content: l(e) ? e : "" }, c = {}; if (i(e)) { const t = e.content; a(t) && (c.content = () => t()), m(t) && (c.content = () => { var u; return (u = r[t]) == null ? void 0 : u.call(r); }); } return a(e) && (c.content = () => e()), m(e) && (c.content = () => { var t; return (t = r[e]) == null ? void 0 : t.call(r); }), f("span", null, [n, f(j, g({ effect: "dark", placement: "top" }, F), { default: () => [b(e)], ...c }), o ? ":" : null]); }; } }); export { B as default }; //# sourceMappingURL=FormItemLabel.mjs.map