@nextcloud/vue
Version:
Nextcloud vue components
63 lines (62 loc) • 1.91 kB
JavaScript
require('../assets/NcHeaderButton-BybvB5sC.css');
;
const GenRandomId = require("../chunks/GenRandomId-BQDud3d4.cjs");
const Components_NcButton = require("./NcButton.cjs");
const _pluginVue2_normalizer = require("../chunks/_plugin-vue2_normalizer-V0q-tHlQ.cjs");
const _sfc_main = {
name: "NcHeaderButton",
components: {
NcButton: 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.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__ */ _pluginVue2_normalizer.normalizeComponent(
_sfc_main,
_sfc_render,
_sfc_staticRenderFns,
false,
null,
"aacc997d"
);
const NcHeaderButton = __component__.exports;
module.exports = NcHeaderButton;