@nextcloud/vue
Version:
Nextcloud vue components
81 lines (80 loc) • 2.64 kB
JavaScript
require('../assets/NcAppNavigationCaption-C7GtQb_y.css');
;
const NcActions = require("./NcActions-B7oXbiVt.cjs");
const _pluginVue2_normalizer = require("./_plugin-vue2_normalizer-V0q-tHlQ.cjs");
const _sfc_main = {
name: "NcAppNavigationCaption",
components: {
NcActions: NcActions.NcActions
},
inheritAttrs: false,
props: {
/**
* The text of the caption
*/
name: {
type: String,
required: true
},
/**
* `id` to set on the inner caption
* Can be used for connecting the `NcActionCaption` with `NcActionList` using `aria-labelledby`.
*/
headingId: {
type: String,
default: null
},
/**
* Enable when used as a heading
* e.g. Before NcAppNavigationList
*/
isHeading: {
type: Boolean,
default: false
},
/**
* If `isHeading` is set, this defines the heading level that should be used
*/
headingLevel: {
type: Number,
default: 2
},
/**
* Any [NcActions](#/Components/NcActions?id=ncactions-1) prop
*/
// Not an actual prop but needed to show in vue-styleguidist docs
// eslint-disable-next-line
" ": {}
},
computed: {
wrapperTag() {
return this.isHeading ? "div" : "li";
},
captionTag() {
const headingLevel = Math.max(2, this.headingLevel);
return this.isHeading ? `h${headingLevel}` : "span";
},
// Check if the actions slot is populated
hasActions() {
return !!this.$slots.actions;
}
}
};
var _sfc_render = function render() {
var _vm = this, _c = _vm._self._c;
return _c(_vm.wrapperTag, { tag: "component", staticClass: "app-navigation-caption", class: { "app-navigation-caption--heading": _vm.isHeading } }, [_c(_vm.captionTag, { tag: "component", staticClass: "app-navigation-caption__name", attrs: { "id": _vm.headingId } }, [_vm._v(" " + _vm._s(_vm.name) + " ")]), _vm.hasActions ? _c("div", { staticClass: "app-navigation-caption__actions" }, [_c("NcActions", _vm._g(_vm._b({ scopedSlots: _vm._u([{ key: "icon", fn: function() {
return [_vm._t("actionsTriggerIcon")];
}, proxy: true }], null, true) }, "NcActions", _vm.$attrs, false), _vm.$listeners), [_vm._t("actions")], 2)], 1) : _vm._e()], 1);
};
var _sfc_staticRenderFns = [];
var __component__ = /* @__PURE__ */ _pluginVue2_normalizer.normalizeComponent(
_sfc_main,
_sfc_render,
_sfc_staticRenderFns,
false,
null,
"fac69d4a"
);
const NcAppNavigationCaption = __component__.exports;
exports.NcAppNavigationCaption = NcAppNavigationCaption;
//# sourceMappingURL=NcAppNavigationCaption-D4-hEmCi.cjs.map