@extclp/vexip-ui
Version:
A Vue 3 UI library, Highly customizability, full TypeScript, performance pretty good
41 lines (40 loc) • 1.29 kB
JavaScript
import { defineComponent as a, computed as n, createElementBlock as s, openBlock as d, unref as m, normalizeClass as p, renderSlot as c, createTextVNode as u, toDisplayString as b } from "vue";
import { useNameHelper as f, emitEvent as v } from "@vexip-ui/config";
import { toAttrValue as h } from "@vexip-ui/utils";
import { optionProps as S } from "./props.mjs";
const g = ["title", "aria-disabled", "aria-selected"], H = /* @__PURE__ */ a({
name: "Option",
__name: "option",
props: S,
setup(i) {
const e = i, t = f("option"), r = n(() => ({
[t.b()]: !0,
[t.bs("vars")]: !0,
[t.bm("disabled")]: e.disabled,
[t.bm("selected")]: !e.disabled && e.selected,
[t.bm("divided")]: e.divided,
[t.bm("hitting")]: e.hitting,
[t.bm("no-hover")]: e.noHover
}));
function l() {
e.disabled || v(e.onSelect);
}
return (o, k) => (d(), s("li", {
ref: "wrapper",
class: p(r.value),
title: o.title || void 0,
role: "option",
"aria-disabled": m(h)(o.disabled),
"aria-selected": o.selected,
onClick: l
}, [
c(o.$slots, "default", {}, () => [
u(b(o.label || o.value), 1)
])
], 10, g));
}
});
export {
H as default
};
//# sourceMappingURL=option.vue2.mjs.map