@nextcloud/vue
Version:
Nextcloud vue components
99 lines (98 loc) • 3.92 kB
JavaScript
import '../assets/NcAppNavigationSettings-Bt0dnsjR.css';
import { defineComponent, ref, useTemplateRef, computed, createElementBlock, openBlock, normalizeClass, createElementVNode, createVNode, unref, withCtx, createTextVNode, toDisplayString, Transition, withDirectives, renderSlot, vShow } from "vue";
import { A as mdiCog, B as mdiCogOutline } from "./mdi-XFJRiRqJ.mjs";
import { onClickOutside } from "@vueuse/core";
import { N as NcButton } from "./NcButton-Dc8V4Urj.mjs";
import { N as NcIconSvgWrapper } from "./NcIconSvgWrapper-BvLanNaW.mjs";
import { r as register, a as t } from "./_l10n-DrTiip5c.mjs";
import { c as createElementId } from "./createElementId-DhjFt1I9.mjs";
import { i as isLegacy } from "./legacy-DcjXBL_t.mjs";
import { _ as _export_sfc } from "./_plugin-vue_export-helper-1tPrXgE0.mjs";
register();
const _hoisted_1 = ["id"];
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "NcAppNavigationSettings",
props: {
excludeClickOutsideSelectors: { default: () => [] },
name: { default: () => t("Settings") }
},
setup(__props) {
const contentId = createElementId();
const open = ref(false);
const container2 = useTemplateRef("wrapperElement");
const ignore = computed(() => Array.isArray(__props.excludeClickOutsideSelectors) ? __props.excludeClickOutsideSelectors : __props.excludeClickOutsideSelectors.split(" "));
onClickOutside(container2, () => {
open.value = false;
}, { ignore });
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", {
ref: "wrapperElement",
class: normalizeClass(_ctx.$style.container)
}, [
createElementVNode("div", {
class: normalizeClass(_ctx.$style.header)
}, [
createVNode(NcButton, {
"aria-controls": unref(contentId),
"aria-expanded": open.value ? "true" : "false",
class: normalizeClass(_ctx.$style.button),
alignment: "start",
variant: "tertiary",
wide: "",
onClick: _cache[0] || (_cache[0] = ($event) => open.value = !open.value)
}, {
icon: withCtx(() => [
createVNode(NcIconSvgWrapper, {
path: unref(isLegacy) ? unref(mdiCog) : unref(mdiCogOutline)
}, null, 8, ["path"])
]),
default: withCtx(() => [
createTextVNode(" " + toDisplayString(_ctx.name), 1)
]),
_: 1
}, 8, ["aria-controls", "aria-expanded", "class"])
], 2),
createVNode(Transition, {
"enter-active-class": _ctx.$style.animationActive,
"leave-active-class": _ctx.$style.animationActive,
"enter-from-class": _ctx.$style.animationStop,
"leave-to-class": _ctx.$style.animationStop
}, {
default: withCtx(() => [
withDirectives(createElementVNode("div", {
id: unref(contentId),
class: normalizeClass(_ctx.$style.content)
}, [
renderSlot(_ctx.$slots, "default")
], 10, _hoisted_1), [
[vShow, open.value]
])
]),
_: 3
}, 8, ["enter-active-class", "leave-active-class", "enter-from-class", "leave-to-class"])
], 2);
};
}
});
const container = "_container_fpy51_2";
const header = "_header_fpy51_7";
const button = "_button_fpy51_13";
const content = "_content_fpy51_21";
const animationActive = "_animationActive_fpy51_33";
const animationStop = "_animationStop_fpy51_39";
const style0 = {
container,
header,
button,
content,
animationActive,
animationStop
};
const cssModules = {
"$style": style0
};
const NcAppNavigationSettings = /* @__PURE__ */ _export_sfc(_sfc_main, [["__cssModules", cssModules]]);
export {
NcAppNavigationSettings as N
};
//# sourceMappingURL=NcAppNavigationSettings-T04pqKfn.mjs.map