@nextcloud/vue
Version:
Nextcloud vue components
50 lines (49 loc) • 1.86 kB
JavaScript
import '../assets/NcHeaderButton.css';
import { defineComponent, openBlock, createElementBlock, createVNode, unref, withModifiers, withCtx, renderSlot, toDisplayString, createCommentVNode } from "vue";
import { c as createElementId } from "./createElementId.mjs";
import { N as NcButton } from "./NcButton.mjs";
import { _ as _export_sfc } from "./_plugin-vue_export-helper.mjs";
const _hoisted_1 = ["id"];
const _hoisted_2 = ["id"];
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "NcHeaderButton",
props: {
id: {},
ariaLabel: {},
description: {}
},
emits: ["click"],
setup(__props) {
const descriptionId = createElementId();
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", {
id: __props.id,
class: "header-menu"
}, [
createVNode(unref(NcButton), {
"aria-label": __props.ariaLabel,
"aria-describedby": unref(descriptionId),
class: "header-menu__trigger",
size: "large",
variant: "tertiary-no-background",
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => _ctx.$emit("click", $event), ["prevent"]))
}, {
icon: withCtx(() => [
renderSlot(_ctx.$slots, "icon", {}, void 0, true)
]),
_: 3
}, 8, ["aria-label", "aria-describedby"]),
__props.description ? (openBlock(), createElementBlock("span", {
key: 0,
id: unref(descriptionId),
class: "header-menu__description hidden-visually"
}, toDisplayString(__props.description), 9, _hoisted_2)) : createCommentVNode("", true)
], 8, _hoisted_1);
};
}
});
const NcHeaderButton = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-92fb182d"]]);
export {
NcHeaderButton as N
};
//# sourceMappingURL=NcHeaderButton.mjs.map