UNPKG

ucc-ui

Version:

ucc-ui components library

56 lines (55 loc) 1.77 kB
import { defineComponent as p, inject as c, computed as u, openBlock as i, createElementBlock as l, Fragment as f, createCommentVNode as r, createElementVNode as a, normalizeClass as v, renderSlot as s, createBlock as C, unref as b, mergeProps as k, createTextVNode as w, toDisplayString as _ } from "vue"; import { C as h } from "./Dropdown-CUViBCZx.js"; import { u as y } from "./hooks-Dj9Dthmd.js"; import "./utils-BzE2Aob-.js"; import "./ConfigProvider-C-6nRyrn.js"; import { U as B } from "./Button-DOc5qANu.js"; const I = { key: 0, role: "separator", class: "u-dropdown-item__divider" }, D = { class: "u-dropdown-item__label" }, S = /* @__PURE__ */ p({ name: "UDropdownItem", __name: "DropdownItem", props: { label: {}, command: { default: y().value }, disabled: { type: Boolean, default: !1 }, divided: { type: Boolean, default: !1 }, icon: {}, iconProps: {} }, setup(t) { const n = t, o = c(h), d = u(() => o == null ? void 0 : o.size.value); function m() { n.disabled || o == null || o.handleItemClick(n); } return (e, g) => (i(), l(f, null, [ e.divided ? (i(), l("li", I)) : r("", !0), a("li", { class: v({ "u-dropdown-item": !0, ["u-dropdown-item--" + d.value]: d.value, "is-disabled": e.disabled, "is-divided": e.divided }), onClick: m }, [ s(e.$slots, "icon", {}, () => [ e.icon ? (i(), C(b(B), k({ key: 0, icon: e.icon }, e.iconProps ?? void 0), null, 16, ["icon"])) : r("", !0) ]), a("span", D, [ s(e.$slots, "label", {}, () => [ w(_(e.label), 1) ]) ]) ], 2) ], 64)); } }); export { S as _ };