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>

30 lines (29 loc) 1.04 kB
import "../../../../utils/index.mjs"; import { computed as m } from "vue"; import { isObject as s, isArray as a } from "../../../../utils/is.mjs"; function g(r) { const e = (o) => { var n, f; return s(r.form) && a(r.form.columns) && !((n = r[o]) != null && n.columns) && r[o] !== !1 ? r.form.columns || [] : s(r[o]) && a(r[o].columns) ? r[o].columns || [] : ((f = r.columns) == null ? void 0 : f.filter((t) => t[o] || t.form && t[o] !== !1 && r[o] !== !1).map((t) => { const l = { field: t.prop, component: t.type, label: t.label, clearable: !0, filterable: !0 }; return t[o] !== !1 && t.form ? { ...l, ...t.form } : { ...l, ...t[o] }; })) || []; }, i = m(() => e("add")), u = m(() => e("edit")), c = m(() => e("search")), d = m(() => e("detail")); return { addFormColumns: i, editFormColumns: u, searchFormColumns: c, detailColumns: d }; } export { g as useFormColumns }; //# sourceMappingURL=useFormColumns.mjs.map