UNPKG

@nextcloud/vue

Version:
54 lines (53 loc) 1.79 kB
import '../assets/NcKbd.css'; import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, renderSlot, createTextVNode, toDisplayString } from "vue"; import { r as register, p as t7, a as t } from "./_l10n.mjs"; import { i as isMac } from "./platform.mjs"; import { _ as _export_sfc } from "./_plugin-vue_export-helper.mjs"; register(t7); const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "NcKbd", props: { symbol: { default: () => void 0 }, mac: { type: Boolean, default: () => isMac } }, setup(__props) { const labels = computed(() => ({ ArrowUp: "↑", ArrowDown: "↓", ArrowLeft: "←", ArrowRight: "→", Control: !__props.mac ? t("Ctrl") : "⌘", Alt: !__props.mac ? t("Alt") : "⌥", Shift: !__props.mac ? t("Shift") : "⇧", Enter: !__props.mac ? t("Enter") : "⏎", Tab: !__props.mac ? t("Tab") : "⇥", Delete: !__props.mac ? t("Delete") : "⌫", Escape: !__props.mac ? t("Escape") : "⎋", Space: t("Space") // TRANSLATORS: Space key on keyboard })); const label = computed(() => __props.symbol && labels.value[__props.symbol] || __props.symbol); return (_ctx, _cache) => { return openBlock(), createElementBlock("kbd", { class: normalizeClass(_ctx.$style.kbd) }, [ renderSlot(_ctx.$slots, "default", {}, () => [ createTextVNode(toDisplayString(label.value), 1) ]) ], 2); }; } }); const kbd = "_kbd_rjhff"; const style0 = { "material-design-icon": "_material-design-icon_X6X6f", kbd }; const cssModules = { "$style": style0 }; const NcKbd = /* @__PURE__ */ _export_sfc(_sfc_main, [["__cssModules", cssModules]]); export { NcKbd as N }; //# sourceMappingURL=NcKbd.mjs.map