@nextcloud/vue
Version:
Nextcloud vue components
64 lines (63 loc) • 1.84 kB
JavaScript
import '../assets/NcHeaderButton-BPkJ5wxD.css';
import { G as GenRandomId } from "../chunks/GenRandomId-CMooMQt0.mjs";
import NcButton from "./NcButton.mjs";
import { n as normalizeComponent } from "../chunks/_plugin-vue2_normalizer-DU4iP6Vu.mjs";
const _sfc_main = {
name: "NcHeaderButton",
components: {
NcButton
},
props: {
/**
* Unique id for this menu
*/
id: {
type: String,
required: true
},
/**
* `aria-label` attribute of the button
*/
ariaLabel: {
type: String,
required: true
},
/**
* Additional visually hidden description text for the button
*/
description: {
type: String,
default: null
}
},
emits: [
"click"
],
data() {
return {
descriptionId: GenRandomId()
};
}
};
var _sfc_render = function render() {
var _vm = this, _c = _vm._self._c;
return _c("div", { staticClass: "header-menu", attrs: { "id": _vm.id } }, [_c("NcButton", { staticClass: "header-menu__trigger", attrs: { "type": "tertiary-no-background", "aria-label": _vm.ariaLabel, "aria-describedby": _vm.descriptionId, "size": "large" }, on: { "click": function($event) {
$event.preventDefault();
return _vm.$emit("click", $event);
} }, scopedSlots: _vm._u([{ key: "icon", fn: function() {
return [_vm._t("icon")];
}, proxy: true }], null, true) }), _vm.description ? _c("span", { staticClass: "header-menu__description hidden-visually", attrs: { "id": _vm.descriptionId } }, [_vm._v(" " + _vm._s(_vm.description) + " ")]) : _vm._e()], 1);
};
var _sfc_staticRenderFns = [];
var __component__ = /* @__PURE__ */ normalizeComponent(
_sfc_main,
_sfc_render,
_sfc_staticRenderFns,
false,
null,
"6be13bb0"
);
const NcHeaderButton = __component__.exports;
export {
NcHeaderButton as default
};