@aplus-frontend/ui
Version:
46 lines (45 loc) • 1.34 kB
JavaScript
import { defineComponent as i, useSlots as s, createBlock as p, openBlock as c, mergeProps as m, unref as d, createSlots as f, renderList as u, withCtx as _, renderSlot as y, normalizeProps as A, guardReactiveProps as P } from "vue";
import { Modal as B } from "@aplus-frontend/antdv";
import { omit as k } from "lodash-unified";
import "../item/index.vue.mjs";
import x from "../item/index.vue2.mjs";
const z = /* @__PURE__ */ i({
name: "ApActionItemModal",
__name: "index",
props: {
text: {},
color: { default: "primary" },
disabled: { type: Boolean, default: !1 },
visible: { type: Boolean, default: !0 },
onAction: {},
onClick: {},
loading: { type: Boolean, default: !1 },
icon: {},
iconFirst: { type: Boolean },
tooltip: {},
modalProps: { default: () => ({}) }
},
setup(n) {
const r = s(), o = n;
async function a(e) {
B.confirm({
...o.modalProps,
zIndex: 1060,
onOk: async () => {
o.modalProps.onOk?.(), await o.onAction?.(e);
}
});
}
return (e, g) => (c(), p(x, m(d(k)(o, ["modalProps", "onAction"]), { onAction: a }), f({ _: 2 }, [
u(r, (h, t) => ({
name: t,
fn: _((l) => [
y(e.$slots, t, A(P(l || {})))
])
}))
]), 1040));
}
});
export {
z as default
};