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>
33 lines (32 loc) • 1.37 kB
JavaScript
import "../../../../node_modules/.pnpm/lodash-unified@1.0.3_@types_lodash-es@4.17.12_lodash-es@4.17.21_lodash@4.17.21/node_modules/lodash-unified/import.mjs";
import "../../../../utils/index.mjs";
import { ref as m, computed as w } from "vue";
import { useLocale as v } from "../../../../hooks/useLocale.mjs";
import { isFunction as o, isString as D } from "../../../../utils/is.mjs";
import g from "../../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/get.mjs";
function P(e) {
const i = m({}), n = m(!1), { t: f } = v();
return { drawerProps: w(() => ({
title: f("common.view"),
size: 520,
...e.drawer
})), isDescLoading: n, viewData: i, handleDrawerOpen: async (r) => {
var c, d, l, s, u;
const t = (d = (c = e.request) == null ? void 0 : c.alias) == null ? void 0 : d.detail;
if ((l = e.request) != null && l.detailApi) {
n.value = !0;
try {
const a = await ((s = e.request) == null ? void 0 : s.detailApi({ [e.dataKey]: r[e.dataKey], row: r }));
i.value = o(t) ? t(a) : D(t) ? g(a, t) : a == null ? void 0 : a.data;
} catch {
}
n.value = !1;
} else
i.value = o(t) ? t({ ...r }) : { ...r };
o((u = e.drawer) == null ? void 0 : u.onOpen) && e.drawer.onOpen({ row: r });
} };
}
export {
P as useDrawerConfig
};
//# sourceMappingURL=useDrawerConfig.mjs.map