@nextcloud/vue
Version:
Nextcloud vue components
130 lines (129 loc) • 4.62 kB
JavaScript
import '../assets/NcAppNavigationToggle-DgwbZOWc.css';
import { n as normalizeComponent } from "./_plugin-vue2_normalizer-DU4iP6Vu.mjs";
import { r as register, E as t19, a as t } from "./_l10n-BEfeU7gr.mjs";
import { N as NcButton } from "./NcButton-CWPBzbcC.mjs";
const _sfc_main$2 = {
name: "MenuIcon",
emits: ["click"],
props: {
title: {
type: String
},
fillColor: {
type: String,
default: "currentColor"
},
size: {
type: Number,
default: 24
}
}
};
var _sfc_render$2 = function render() {
var _vm = this, _c = _vm._self._c;
return _c("span", _vm._b({ staticClass: "material-design-icon menu-icon", attrs: { "aria-hidden": _vm.title ? null : "true", "aria-label": _vm.title, "role": "img" }, on: { "click": function($event) {
return _vm.$emit("click", $event);
} } }, "span", _vm.$attrs, false), [_c("svg", { staticClass: "material-design-icon__svg", attrs: { "fill": _vm.fillColor, "width": _vm.size, "height": _vm.size, "viewBox": "0 0 24 24" } }, [_c("path", { attrs: { "d": "M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z" } }, [_vm.title ? _c("title", [_vm._v(_vm._s(_vm.title))]) : _vm._e()])])]);
};
var _sfc_staticRenderFns$2 = [];
var __component__$2 = /* @__PURE__ */ normalizeComponent(
_sfc_main$2,
_sfc_render$2,
_sfc_staticRenderFns$2,
false,
null,
null
);
const MenuIcon = __component__$2.exports;
const _sfc_main$1 = {
name: "MenuOpenIcon",
emits: ["click"],
props: {
title: {
type: String
},
fillColor: {
type: String,
default: "currentColor"
},
size: {
type: Number,
default: 24
}
}
};
var _sfc_render$1 = function render2() {
var _vm = this, _c = _vm._self._c;
return _c("span", _vm._b({ staticClass: "material-design-icon menu-open-icon", attrs: { "aria-hidden": _vm.title ? null : "true", "aria-label": _vm.title, "role": "img" }, on: { "click": function($event) {
return _vm.$emit("click", $event);
} } }, "span", _vm.$attrs, false), [_c("svg", { staticClass: "material-design-icon__svg", attrs: { "fill": _vm.fillColor, "width": _vm.size, "height": _vm.size, "viewBox": "0 0 24 24" } }, [_c("path", { attrs: { "d": "M21,15.61L19.59,17L14.58,12L19.59,7L21,8.39L17.44,12L21,15.61M3,6H16V8H3V6M3,13V11H13V13H3M3,18V16H16V18H3Z" } }, [_vm.title ? _c("title", [_vm._v(_vm._s(_vm.title))]) : _vm._e()])])]);
};
var _sfc_staticRenderFns$1 = [];
var __component__$1 = /* @__PURE__ */ normalizeComponent(
_sfc_main$1,
_sfc_render$1,
_sfc_staticRenderFns$1,
false,
null,
null
);
const MenuOpenIcon = __component__$1.exports;
register(t19);
const disableKeyboardShortcuts = window.OCP?.Accessibility?.disableKeyboardShortcuts?.();
const _sfc_main = {
name: "NcAppNavigationToggle",
components: {
NcButton,
MenuIcon,
MenuOpenIcon
},
props: {
/**
* Tracks whether the toggle has been clicked or not.
* If it has been clicked, switches between the different MenuIcons
* and emits a boolean indicating its opened status
*/
open: {
type: Boolean,
required: true
}
},
emits: ["update:open"],
setup() {
return { disableKeyboardShortcuts };
},
computed: {
label() {
return this.open ? t("Close navigation") : t("Open navigation {shortcut}", { shortcut: disableKeyboardShortcuts ? "" : "[n]" }).trim();
}
},
methods: {
/**
* Once the toggle has been clicked, emits the toggle status
* so parent components can gauge the status of the navigation button
*/
toggleNavigation() {
this.$emit("update:open", !this.open);
}
}
};
var _sfc_render = function render3() {
var _vm = this, _c = _vm._self._c;
return _c("div", { staticClass: "app-navigation-toggle-wrapper" }, [_c("NcButton", { staticClass: "app-navigation-toggle", attrs: { "aria-controls": "app-navigation-vue", "aria-expanded": _vm.open ? "true" : "false", "aria-keyshortcuts": _vm.disableKeyboardShortcuts ? "" : "n", "aria-label": _vm.label, "title": _vm.label, "variant": "tertiary" }, on: { "click": _vm.toggleNavigation }, scopedSlots: _vm._u([{ key: "icon", fn: function() {
return [_vm.open ? _c("MenuOpenIcon", { attrs: { "size": 20 } }) : _c("MenuIcon", { attrs: { "size": 20 } })];
}, proxy: true }]) })], 1);
};
var _sfc_staticRenderFns = [];
var __component__ = /* @__PURE__ */ normalizeComponent(
_sfc_main,
_sfc_render,
_sfc_staticRenderFns,
false,
null,
"a3e8b54b"
);
const NcAppNavigationToggle = __component__.exports;
export {
NcAppNavigationToggle as N
};
//# sourceMappingURL=NcAppNavigationToggle-DlWpnYdz.mjs.map