@nextcloud/vue
Version:
Nextcloud vue components
129 lines (128 loc) • 4.73 kB
JavaScript
require('../assets/NcAppNavigationToggle-DgwbZOWc.css');
;
const _pluginVue2_normalizer = require("./_plugin-vue2_normalizer-V0q-tHlQ.cjs");
const _l10n = require("./_l10n-DM-VRK9x.cjs");
const NcButton = require("./NcButton-DOsCAjiE.cjs");
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__ */ _pluginVue2_normalizer.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__ */ _pluginVue2_normalizer.normalizeComponent(
_sfc_main$1,
_sfc_render$1,
_sfc_staticRenderFns$1,
false,
null,
null
);
const MenuOpenIcon = __component__$1.exports;
_l10n.register(_l10n.t19);
const disableKeyboardShortcuts = window.OCP?.Accessibility?.disableKeyboardShortcuts?.();
const _sfc_main = {
name: "NcAppNavigationToggle",
components: {
NcButton: NcButton.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 ? _l10n.t("Close navigation") : _l10n.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__ */ _pluginVue2_normalizer.normalizeComponent(
_sfc_main,
_sfc_render,
_sfc_staticRenderFns,
false,
null,
"a3e8b54b"
);
const NcAppNavigationToggle = __component__.exports;
exports.NcAppNavigationToggle = NcAppNavigationToggle;
//# sourceMappingURL=NcAppNavigationToggle-C2vtZ3uV.cjs.map