@nextcloud/vue
Version:
Nextcloud vue components
62 lines (61 loc) • 2.17 kB
JavaScript
import '../assets/NcHotkey-4yi1Hobg.css';
import { defineComponent, computed, createElementBlock, openBlock, normalizeClass, createElementVNode, renderSlot, Fragment, renderList, createBlock, createTextVNode, toDisplayString } from "vue";
import { N as NcKbd } from "./NcKbd-D3YSTteg.mjs";
import { _ as _export_sfc } from "./_plugin-vue_export-helper-1tPrXgE0.mjs";
const NO_LABEL_WARNING = "⚠️ NcHotKey must have a label or slot content";
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "NcHotkey",
props: {
label: { default: () => void 0 },
hotkey: { default: () => void 0 }
},
setup(__props) {
const symbols = computed(() => {
return __props.hotkey?.split(/\s+/).map((s) => s.trim());
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("li", {
class: normalizeClass(_ctx.$style.hotkey)
}, [
createElementVNode("span", {
role: "term",
class: normalizeClass(_ctx.$style.hotkey__keys)
}, [
renderSlot(_ctx.$slots, "hotkey", {}, () => [
(openBlock(true), createElementBlock(Fragment, null, renderList(symbols.value, (symbol, index) => {
return openBlock(), createBlock(NcKbd, {
key: index,
symbol
}, null, 8, ["symbol"]);
}), 128))
])
], 2),
createElementVNode("span", {
role: "definition",
class: normalizeClass(_ctx.$style.hotkey__label)
}, [
renderSlot(_ctx.$slots, "default", {}, () => [
createTextVNode(toDisplayString(_ctx.label || NO_LABEL_WARNING), 1)
])
], 2)
], 2);
};
}
});
const hotkey = "_hotkey_1s86g_20";
const hotkey__label = "_hotkey__label_1s86g_27";
const hotkey__keys = "_hotkey__keys_1s86g_28";
const style0 = {
"material-design-icon": "_material-design-icon_1s86g_12",
hotkey,
hotkey__label,
hotkey__keys
};
const cssModules = {
"$style": style0
};
const NcHotkey = /* @__PURE__ */ _export_sfc(_sfc_main, [["__cssModules", cssModules]]);
export {
NcHotkey as N
};
//# sourceMappingURL=NcHotkey-KGHPzHBJ.mjs.map