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>

69 lines (68 loc) 1.8 kB
import { defineComponent as c, createVNode as a, Fragment as m } from "vue"; import { Plus as f, Minus as p } from "@element-plus/icons-vue"; import { ElButton as i, ElCard as s } from "element-plus"; import "../../../utils/index.mjs"; import { useNamespace as y } from "../../../hooks/useNamespace.mjs"; import { useFormSize as x } from "../../../hooks/useFormSize.mjs"; import { isFunction as u } from "../../../utils/is.mjs"; const F = /* @__PURE__ */ c({ name: "ZOperationCard", props: { showAdd: { type: Boolean, default: !0 }, showDelete: { type: Boolean, default: !0 }, action: { type: [Function, Boolean], default: !0 }, contentIndex: { type: Number, default: 0 } }, emits: ["add", "delete"], setup(e, { slots: t, emit: o }) { const r = y("array-form"), n = x(), d = () => u(t.action) ? t.action({ index: e.contentIndex }) : u(e.action) ? e.action({ index: e.contentIndex }) : a(m, null, [e.showAdd && a(i, { type: "primary", icon: f, circle: !0, plain: !0, class: r.be("operation", `add--${n.value}`), size: n.value === "small" ? "small" : "default", onClick: () => o("add") }, null), e.showDelete && a(i, { type: "danger", icon: p, circle: !0, plain: !0, class: r.be("operation", `delete--${n.value}`), size: n.value === "small" ? "small" : "default", onClick: () => o("delete") }, null)]); return () => a(s, { shadow: "never", class: r.b("item-card") }, { default: () => { var l; return [(l = t.default) == null ? void 0 : l.call(t), d()]; } }); } }); export { F as default }; //# sourceMappingURL=OperationCard.mjs.map