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>

35 lines (34 loc) 1.43 kB
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 { useButton as u } from "./useButton.mjs"; import { ref as i, computed as s } from "vue"; import C from "../../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/omit.mjs"; import { isFunction as a } from "../../../../utils/is.mjs"; const y = (n, e) => { const l = i(), t = i(!1), { confirmBtnProps: c, cancelBtnProps: f, isConfirmBtnLoading: r, isCancelBtnLoading: d } = u(n), m = s(() => C({ ...n, width: n.type !== "normal" ? 420 : n.width }, ["cancelButtonProps", "confirmButtonProps", "title"])), o = () => { t.value = !1, e("update:modelValue", !1); }; return { dialogConfig: m, dialogRef: l, isShowDialog: t, confirmBtnProps: c, cancelBtnProps: f, done: o, handleCancel: () => { if (a(n.beforeClose)) { n.beforeClose(o); return; } if (a(n.onCancel)) { e("cancel", { done: o, cancelButtonLoading: d }); return; } if (n.extend) { o(); return; } e("update:modelValue", !1); }, handleConfirm: () => { n.type === "info" && !n.onConfirm && o(), e("confirm", { done: o, confirmButtonLoading: r }); }, handleClosed: () => { n.extend && e("vanish"); } }; }; export { y as useDialog }; //# sourceMappingURL=useDialog.mjs.map