@nextcloud/vue
Version:
Nextcloud vue components
83 lines (82 loc) • 3.19 kB
JavaScript
import '../assets/NcActionRouter-DeYzeM5W.css';
import { A as ActionTextMixin } from "./actionText-DYzDdbVe.mjs";
import { a as NC_ACTIONS_IS_SEMANTIC_MENU } from "./useNcActions-CiGWxAJE.mjs";
import { resolveComponent, createElementBlock, openBlock, createVNode, withCtx, renderSlot, createCommentVNode, createElementVNode, normalizeStyle, normalizeClass, toDisplayString } from "vue";
import { _ as _export_sfc } from "./_plugin-vue_export-helper-1tPrXgE0.mjs";
const _sfc_main = {
name: "NcActionRouter",
mixins: [ActionTextMixin],
inject: {
isInSemanticMenu: {
from: NC_ACTIONS_IS_SEMANTIC_MENU,
default: false
}
},
props: {
/**
* router-link to prop [https://router.vuejs.org/api/#to](https://router.vuejs.org/api/#to)
*/
to: {
type: [String, Object],
required: true
}
}
};
const _hoisted_1 = ["role"];
const _hoisted_2 = {
key: 0,
class: "action-router__longtext-wrapper"
};
const _hoisted_3 = { class: "action-router__name" };
const _hoisted_4 = ["textContent"];
const _hoisted_5 = ["textContent"];
const _hoisted_6 = {
key: 2,
class: "action-router__text"
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
const _component_RouterLink = resolveComponent("RouterLink");
return openBlock(), createElementBlock("li", {
class: "action",
role: $options.isInSemanticMenu && "presentation"
}, [
createVNode(_component_RouterLink, {
"aria-label": _ctx.ariaLabel,
class: "action-router focusable",
rel: "nofollow noreferrer noopener",
role: $options.isInSemanticMenu && "menuitem",
title: _ctx.title,
to: $props.to,
onClick: _ctx.onClick
}, {
default: withCtx(() => [
renderSlot(_ctx.$slots, "icon", {}, () => [
createElementVNode("span", {
"aria-hidden": "true",
class: normalizeClass(["action-router__icon", [_ctx.isIconUrl ? "action-router__icon--url" : _ctx.icon]]),
style: normalizeStyle({ backgroundImage: _ctx.isIconUrl ? `url(${_ctx.icon})` : null })
}, null, 6)
], true),
_ctx.name ? (openBlock(), createElementBlock("span", _hoisted_2, [
createElementVNode("strong", _hoisted_3, toDisplayString(_ctx.name), 1),
_cache[0] || (_cache[0] = createElementVNode("br", null, null, -1)),
createElementVNode("span", {
class: "action-router__longtext",
textContent: toDisplayString(_ctx.text)
}, null, 8, _hoisted_4)
])) : _ctx.isLongText ? (openBlock(), createElementBlock("span", {
key: 1,
class: "action-router__longtext",
textContent: toDisplayString(_ctx.text)
}, null, 8, _hoisted_5)) : (openBlock(), createElementBlock("span", _hoisted_6, toDisplayString(_ctx.text), 1)),
createCommentVNode("", true)
]),
_: 3
}, 8, ["aria-label", "role", "title", "to", "onClick"])
], 8, _hoisted_1);
}
const NcActionRouter = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-87267750"]]);
export {
NcActionRouter as N
};
//# sourceMappingURL=NcActionRouter-oT-YU_jf.mjs.map