UNPKG

ant-design-x-vue

Version:
122 lines (121 loc) 2.69 kB
import { defineComponent as c, toRef as f, useSlots as p, computed as a, createVNode as y, mergeProps as m } from "vue"; import { c as q, _ as b } from "../../../chunks/helper-chunk.mjs"; import { Button as g } from "ant-design-vue"; import { useActionButtonContextInject as x } from "./context.mjs"; import { b as C } from "../../../chunks/module-chunk.mjs"; const v = /* @__PURE__ */ c({ name: "AXSenderActionButton", __name: "index", props: { action: { type: String, required: !0 }, prefixCls: { type: String, required: !1 }, type: { type: null, required: !1, default: "text" }, htmlType: { type: null, required: !1 }, shape: { type: null, required: !1 }, size: { type: null, required: !1 }, loading: { type: [Boolean, Object], required: !1 }, disabled: { type: Boolean, required: !1, default: void 0 }, ghost: { type: Boolean, required: !1 }, block: { type: Boolean, required: !1 }, danger: { type: Boolean, required: !1 }, icon: { type: null, required: !1 }, href: { type: String, required: !1 }, target: { type: String, required: !1 }, title: { type: String, required: !1 }, onClick: { type: null, required: !1 }, onMousedown: { type: null, required: !1 }, audioIcon: { type: [null, Object], required: !1 }, audioDisabledIcon: { type: [null, Object], required: !1 }, audioRecordingIcon: { type: [null, Object], required: !1 } }, setup(e, { expose: s }) { s(); const u = q(e, ["action", "type", "disabled", "onClick"]); f(e, "disabled"); const d = p(), r = x(), i = a(() => { var n; const l = r.value.disabled, t = (n = r.value) == null ? void 0 : n[`${e.action}Disabled`]; return e.disabled ?? l ?? t; }), o = a(() => r.value.prefixCls); return () => y(g, m({ type: e.type }, u, { onClick: (l) => { var t, n; i.value || ((n = (t = r.value) == null ? void 0 : t[e.action]) == null || n.call(t), e.onClick && !Array.isArray(e.onClick) && e.onClick(l)); }, class: C(o.value, { [`${o.value}-disabled`]: i.value }) }), { icon: () => d.default() }); } }), j = /* @__PURE__ */ b(v, [["__file", "/Users/wangzhichao/办公/code/github/ant-design-x-vue-pure/ant-design-x-vue/src/sender/components/ActionButton/index.vue"]]); export { j as default };