2020-10-17 13:12:00 +02:00
|
|
|
<template>
|
2023-04-30 17:58:36 +02:00
|
|
|
<FocusTrap :active="false" ref="focusTrap">
|
|
|
|
<div tabindex="-1">
|
2023-04-29 01:57:19 +02:00
|
|
|
<div
|
|
|
|
ref="itemsEl"
|
|
|
|
class="rrevdjwt _popup _shadow"
|
|
|
|
:class="{ center: align === 'center', asDrawer }"
|
|
|
|
:style="{
|
|
|
|
width: width && !asDrawer ? width + 'px' : '',
|
|
|
|
maxHeight: maxHeight ? maxHeight + 'px' : '',
|
|
|
|
}"
|
|
|
|
@contextmenu.self="(e) => e.preventDefault()"
|
|
|
|
>
|
|
|
|
<template v-for="(item, i) in items2">
|
|
|
|
<div v-if="item === null" class="divider"></div>
|
2023-05-07 03:52:18 +02:00
|
|
|
<template
|
|
|
|
v-else-if="
|
|
|
|
item.hidden ||
|
|
|
|
(item.visible !== undefined && !item.visible)
|
|
|
|
"
|
|
|
|
/>
|
2023-04-29 01:57:19 +02:00
|
|
|
<span v-else-if="item.type === 'label'" class="label item">
|
2023-04-30 22:27:27 +02:00
|
|
|
<span :style="item.textStyle || ''">{{
|
|
|
|
item.text
|
|
|
|
}}</span>
|
2023-04-29 01:57:19 +02:00
|
|
|
</span>
|
|
|
|
<span
|
|
|
|
v-else-if="item.type === 'pending'"
|
|
|
|
class="pending item"
|
2023-05-07 01:26:24 +02:00
|
|
|
:class="classMap(item.classes)"
|
2023-04-29 01:57:19 +02:00
|
|
|
>
|
|
|
|
<span><MkEllipsis /></span>
|
|
|
|
</span>
|
|
|
|
<MkA
|
|
|
|
v-else-if="item.type === 'link'"
|
|
|
|
:to="item.to"
|
|
|
|
class="_button item"
|
2023-05-07 01:26:24 +02:00
|
|
|
:class="classMap(item.classes)"
|
2023-04-29 01:57:19 +02:00
|
|
|
@click.passive="close(true)"
|
|
|
|
@mouseenter.passive="onItemMouseEnter(item)"
|
|
|
|
@mouseleave.passive="onItemMouseLeave(item)"
|
|
|
|
>
|
2023-04-08 02:01:42 +02:00
|
|
|
<i
|
2023-04-29 01:57:19 +02:00
|
|
|
v-if="item.icon"
|
2023-04-08 02:01:42 +02:00
|
|
|
class="ph-fw ph-lg"
|
2023-04-29 01:57:19 +02:00
|
|
|
:class="item.icon"
|
2023-04-08 02:01:42 +02:00
|
|
|
></i>
|
2023-04-29 01:57:19 +02:00
|
|
|
<MkAvatar
|
|
|
|
v-if="item.avatar"
|
|
|
|
:user="item.avatar"
|
|
|
|
class="avatar"
|
2023-04-29 03:39:48 +02:00
|
|
|
disableLink
|
2023-04-29 01:57:19 +02:00
|
|
|
/>
|
2023-04-30 22:27:27 +02:00
|
|
|
<span :style="item.textStyle || ''">{{
|
|
|
|
item.text
|
|
|
|
}}</span>
|
2023-04-29 01:57:19 +02:00
|
|
|
<span v-if="item.indicate" class="indicator"
|
|
|
|
><i class="ph-circle ph-fill"></i
|
|
|
|
></span>
|
|
|
|
</MkA>
|
|
|
|
<a
|
|
|
|
v-else-if="item.type === 'a'"
|
|
|
|
:href="item.href"
|
|
|
|
:target="item.target"
|
|
|
|
:download="item.download"
|
|
|
|
class="_button item"
|
2023-05-07 01:26:24 +02:00
|
|
|
:class="classMap(item.classes)"
|
2023-04-29 01:57:19 +02:00
|
|
|
@click="close(true)"
|
|
|
|
@mouseenter.passive="onItemMouseEnter(item)"
|
|
|
|
@mouseleave.passive="onItemMouseLeave(item)"
|
|
|
|
>
|
2023-04-08 02:01:42 +02:00
|
|
|
<i
|
2023-04-29 01:57:19 +02:00
|
|
|
v-if="item.icon"
|
2023-04-08 02:01:42 +02:00
|
|
|
class="ph-fw ph-lg"
|
2023-04-29 01:57:19 +02:00
|
|
|
:class="item.icon"
|
2023-04-08 02:01:42 +02:00
|
|
|
></i>
|
2023-04-30 22:27:27 +02:00
|
|
|
<span :style="item.textStyle || ''">{{
|
|
|
|
item.text
|
|
|
|
}}</span>
|
2023-04-29 01:57:19 +02:00
|
|
|
<span v-if="item.indicate" class="indicator"
|
|
|
|
><i class="ph-circle ph-fill"></i
|
|
|
|
></span>
|
|
|
|
</a>
|
|
|
|
<button
|
2023-05-07 01:26:24 +02:00
|
|
|
v-else-if="item.type === 'user'"
|
2023-04-29 01:57:19 +02:00
|
|
|
class="_button item"
|
2023-05-07 03:52:18 +02:00
|
|
|
:class="{
|
|
|
|
active: item.active,
|
|
|
|
...classMap(item.classes),
|
|
|
|
}"
|
2023-04-29 01:57:19 +02:00
|
|
|
:disabled="item.active"
|
|
|
|
@click="clicked(item.action, $event)"
|
|
|
|
@mouseenter.passive="onItemMouseEnter(item)"
|
|
|
|
@mouseleave.passive="onItemMouseLeave(item)"
|
|
|
|
>
|
2023-04-30 22:27:27 +02:00
|
|
|
<MkAvatar
|
2023-04-29 01:57:19 +02:00
|
|
|
:user="item.user"
|
2023-04-30 22:27:27 +02:00
|
|
|
class="avatar"
|
|
|
|
disableLink
|
|
|
|
/><MkUserName :user="item.user" />
|
2023-04-29 01:57:19 +02:00
|
|
|
<span v-if="item.indicate" class="indicator"
|
|
|
|
><i class="ph-circle ph-fill"></i
|
|
|
|
></span>
|
|
|
|
</button>
|
|
|
|
<span
|
|
|
|
v-else-if="item.type === 'switch'"
|
|
|
|
class="item"
|
2023-05-07 01:26:24 +02:00
|
|
|
:class="classMap(item.classes)"
|
2023-04-29 01:57:19 +02:00
|
|
|
@mouseenter.passive="onItemMouseEnter(item)"
|
|
|
|
@mouseleave.passive="onItemMouseLeave(item)"
|
|
|
|
>
|
|
|
|
<FormSwitch
|
|
|
|
v-model="item.ref"
|
|
|
|
:disabled="item.disabled"
|
|
|
|
class="form-switch"
|
|
|
|
:style="item.textStyle || ''"
|
|
|
|
>{{ item.text }}</FormSwitch
|
|
|
|
>
|
2023-04-08 02:01:42 +02:00
|
|
|
</span>
|
2023-05-07 01:26:24 +02:00
|
|
|
<span
|
|
|
|
v-else-if="item.type === 'input'"
|
|
|
|
:tabindex="i"
|
|
|
|
class="item"
|
|
|
|
:class="classMap(item.classes)"
|
|
|
|
@mouseenter.passive="onItemMouseEnter(item)"
|
|
|
|
@mouseleave.passive="onItemMouseLeave(item)"
|
|
|
|
>
|
|
|
|
<FormInput
|
|
|
|
v-model="item.ref"
|
|
|
|
:disabled="item.disabled"
|
|
|
|
class="form-input"
|
|
|
|
:required="item.required"
|
|
|
|
:placeholder="item.placeholder"
|
|
|
|
/>
|
|
|
|
</span>
|
2023-04-29 01:57:19 +02:00
|
|
|
<button
|
|
|
|
v-else-if="item.type === 'parent'"
|
|
|
|
class="_button item parent"
|
2023-05-07 03:52:18 +02:00
|
|
|
:class="{
|
|
|
|
childShowing: childShowingItem === item,
|
|
|
|
...classMap(item.classes),
|
|
|
|
}"
|
2023-04-29 01:57:19 +02:00
|
|
|
@mouseenter="showChildren(item, $event)"
|
2023-04-29 04:24:40 +02:00
|
|
|
@click="showChildren(item, $event)"
|
2023-04-08 02:01:42 +02:00
|
|
|
>
|
|
|
|
<i
|
2023-04-29 01:57:19 +02:00
|
|
|
v-if="item.icon"
|
2023-04-08 02:01:42 +02:00
|
|
|
class="ph-fw ph-lg"
|
2023-04-29 01:57:19 +02:00
|
|
|
:class="item.icon"
|
2023-04-08 02:01:42 +02:00
|
|
|
></i>
|
2023-04-30 22:27:27 +02:00
|
|
|
<span :style="item.textStyle || ''">{{
|
|
|
|
item.text
|
|
|
|
}}</span>
|
2023-04-29 01:57:19 +02:00
|
|
|
<span class="caret"
|
2023-04-30 22:27:27 +02:00
|
|
|
><i
|
|
|
|
class="ph-caret-right ph-bold ph-lg ph-fw ph-lg"
|
|
|
|
></i
|
2023-04-29 01:57:19 +02:00
|
|
|
></span>
|
|
|
|
</button>
|
|
|
|
<button
|
2023-05-07 01:26:24 +02:00
|
|
|
v-else
|
2023-04-29 01:57:19 +02:00
|
|
|
class="_button item"
|
2023-05-07 03:52:18 +02:00
|
|
|
:class="{
|
|
|
|
danger: item.danger,
|
|
|
|
active: item.active,
|
|
|
|
...classMap(item.classes),
|
|
|
|
}"
|
2023-04-29 01:57:19 +02:00
|
|
|
:disabled="item.active"
|
|
|
|
@click="clicked(item.action, $event)"
|
|
|
|
@mouseenter.passive="onItemMouseEnter(item)"
|
|
|
|
@mouseleave.passive="onItemMouseLeave(item)"
|
|
|
|
>
|
2023-04-08 02:01:42 +02:00
|
|
|
<i
|
2023-04-29 01:57:19 +02:00
|
|
|
v-if="item.icon"
|
2023-04-08 02:01:42 +02:00
|
|
|
class="ph-fw ph-lg"
|
2023-04-29 01:57:19 +02:00
|
|
|
:class="item.icon"
|
2023-04-08 02:01:42 +02:00
|
|
|
></i>
|
2023-04-29 01:57:19 +02:00
|
|
|
<MkAvatar
|
|
|
|
v-if="item.avatar"
|
|
|
|
:user="item.avatar"
|
|
|
|
class="avatar"
|
2023-04-29 03:39:48 +02:00
|
|
|
disableLink
|
2023-04-29 01:57:19 +02:00
|
|
|
/>
|
2023-04-30 22:27:27 +02:00
|
|
|
<span :style="item.textStyle || ''">{{
|
|
|
|
item.text
|
|
|
|
}}</span>
|
2023-04-29 01:57:19 +02:00
|
|
|
<span v-if="item.indicate" class="indicator"
|
|
|
|
><i class="ph-circle ph-fill"></i
|
|
|
|
></span>
|
|
|
|
</button>
|
|
|
|
</template>
|
|
|
|
<span v-if="items2.length === 0" class="none item">
|
|
|
|
<span>{{ i18n.ts.none }}</span>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<div v-if="childMenu" class="child">
|
|
|
|
<XChild
|
|
|
|
ref="child"
|
|
|
|
:items="childMenu"
|
|
|
|
:target-element="childTarget"
|
|
|
|
:root-element="itemsEl"
|
|
|
|
showing
|
|
|
|
@actioned="childActioned"
|
|
|
|
/>
|
|
|
|
</div>
|
2023-02-13 04:31:55 +01:00
|
|
|
</div>
|
2023-04-29 01:57:19 +02:00
|
|
|
</FocusTrap>
|
2020-10-17 13:12:00 +02:00
|
|
|
</template>
|
|
|
|
|
2022-01-30 06:11:52 +01:00
|
|
|
<script lang="ts" setup>
|
2023-04-08 02:01:42 +02:00
|
|
|
import {
|
|
|
|
computed,
|
|
|
|
menu,
|
|
|
|
defineAsyncComponent,
|
|
|
|
nextTick,
|
|
|
|
onBeforeUnmount,
|
|
|
|
onMounted,
|
|
|
|
onUnmounted,
|
|
|
|
Ref,
|
|
|
|
ref,
|
|
|
|
watch,
|
|
|
|
} from "vue";
|
|
|
|
import { focusPrev, focusNext } from "@/scripts/focus";
|
|
|
|
import FormSwitch from "@/components/form/switch.vue";
|
2023-05-07 01:26:24 +02:00
|
|
|
import FormInput from "@/components/form/input.vue";
|
2023-05-07 03:52:18 +02:00
|
|
|
import {
|
|
|
|
MenuItem,
|
|
|
|
InnerMenuItem,
|
|
|
|
MenuPending,
|
|
|
|
MenuAction,
|
|
|
|
MenuClasses,
|
|
|
|
} from "@/types/menu";
|
2023-04-08 02:01:42 +02:00
|
|
|
import * as os from "@/os";
|
|
|
|
import { i18n } from "@/i18n";
|
2023-04-30 22:27:27 +02:00
|
|
|
import { FocusTrap } from "focus-trap-vue";
|
2022-07-20 15:24:26 +02:00
|
|
|
|
2023-04-08 02:01:42 +02:00
|
|
|
const XChild = defineAsyncComponent(() => import("./MkMenu.child.vue"));
|
2023-04-30 17:58:36 +02:00
|
|
|
const focusTrap = ref();
|
2022-01-30 06:11:52 +01:00
|
|
|
|
|
|
|
const props = defineProps<{
|
|
|
|
items: MenuItem[];
|
|
|
|
viaKeyboard?: boolean;
|
|
|
|
asDrawer?: boolean;
|
2023-04-08 02:01:42 +02:00
|
|
|
align?: "center" | string;
|
2022-01-30 06:11:52 +01:00
|
|
|
width?: number;
|
|
|
|
maxHeight?: number;
|
|
|
|
}>();
|
|
|
|
|
|
|
|
const emit = defineEmits<{
|
2023-04-08 02:01:42 +02:00
|
|
|
(ev: "close", actioned?: boolean): void;
|
2022-01-30 06:11:52 +01:00
|
|
|
}>();
|
|
|
|
|
|
|
|
let itemsEl = $ref<HTMLDivElement>();
|
|
|
|
|
|
|
|
let items2: InnerMenuItem[] = $ref([]);
|
|
|
|
|
2022-07-17 14:06:33 +02:00
|
|
|
let child = $ref<InstanceType<typeof XChild>>();
|
|
|
|
|
|
|
|
let childShowingItem = $ref<MenuItem | null>();
|
|
|
|
|
2023-04-08 02:01:42 +02:00
|
|
|
watch(
|
|
|
|
() => props.items,
|
|
|
|
() => {
|
|
|
|
const items: (MenuItem | MenuPending)[] = [...props.items].filter(
|
|
|
|
(item) => item !== undefined
|
|
|
|
);
|
2022-01-30 06:11:52 +01:00
|
|
|
|
2023-04-08 02:01:42 +02:00
|
|
|
for (let i = 0; i < items.length; i++) {
|
|
|
|
const item = items[i];
|
2022-01-30 06:11:52 +01:00
|
|
|
|
2023-04-08 02:01:42 +02:00
|
|
|
if (item && "then" in item) {
|
|
|
|
// if item is Promise
|
|
|
|
items[i] = { type: "pending" };
|
|
|
|
item.then((actualItem) => {
|
|
|
|
items2[i] = actualItem;
|
|
|
|
});
|
|
|
|
}
|
2020-10-17 13:12:00 +02:00
|
|
|
}
|
|
|
|
|
2023-04-08 02:01:42 +02:00
|
|
|
items2 = items as InnerMenuItem[];
|
|
|
|
},
|
|
|
|
{
|
|
|
|
immediate: true,
|
|
|
|
}
|
|
|
|
);
|
2020-10-17 13:12:00 +02:00
|
|
|
|
2022-07-17 14:06:33 +02:00
|
|
|
let childMenu = $ref<MenuItem[] | null>();
|
|
|
|
let childTarget = $ref<HTMLElement | null>();
|
|
|
|
|
2023-05-07 01:26:24 +02:00
|
|
|
function classMap(classes?: MenuClasses) {
|
|
|
|
if (!classes) return {};
|
|
|
|
|
2023-05-07 03:52:18 +02:00
|
|
|
return (Array.isArray(classes) ? classes : classes.value).reduce(
|
|
|
|
(acc, cls) => {
|
|
|
|
acc[cls] = true;
|
|
|
|
return acc;
|
|
|
|
},
|
|
|
|
{}
|
|
|
|
);
|
2023-05-07 01:26:24 +02:00
|
|
|
}
|
|
|
|
|
2022-07-17 14:06:33 +02:00
|
|
|
function closeChild() {
|
|
|
|
childMenu = null;
|
|
|
|
childShowingItem = null;
|
|
|
|
}
|
|
|
|
|
|
|
|
function childActioned() {
|
|
|
|
closeChild();
|
|
|
|
close(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
function onGlobalMousedown(event: MouseEvent) {
|
2023-04-08 02:01:42 +02:00
|
|
|
if (
|
|
|
|
childTarget &&
|
|
|
|
(event.target === childTarget || childTarget.contains(event.target))
|
|
|
|
)
|
|
|
|
return;
|
2022-07-17 14:06:33 +02:00
|
|
|
if (child && child.checkHit(event)) return;
|
|
|
|
closeChild();
|
|
|
|
}
|
|
|
|
|
|
|
|
let childCloseTimer: null | number = null;
|
|
|
|
function onItemMouseEnter(item) {
|
|
|
|
childCloseTimer = window.setTimeout(() => {
|
|
|
|
closeChild();
|
|
|
|
}, 300);
|
|
|
|
}
|
|
|
|
function onItemMouseLeave(item) {
|
|
|
|
if (childCloseTimer) window.clearTimeout(childCloseTimer);
|
|
|
|
}
|
|
|
|
|
|
|
|
async function showChildren(item: MenuItem, ev: MouseEvent) {
|
|
|
|
if (props.asDrawer) {
|
|
|
|
os.popupMenu(item.children, ev.currentTarget ?? ev.target);
|
|
|
|
close();
|
|
|
|
} else {
|
|
|
|
childTarget = ev.currentTarget ?? ev.target;
|
|
|
|
childMenu = item.children;
|
|
|
|
childShowingItem = item;
|
2020-10-17 13:12:00 +02:00
|
|
|
}
|
2022-07-17 14:06:33 +02:00
|
|
|
}
|
2022-01-30 06:11:52 +01:00
|
|
|
|
|
|
|
function clicked(fn: MenuAction, ev: MouseEvent) {
|
|
|
|
fn(ev);
|
2022-07-17 14:06:33 +02:00
|
|
|
close(true);
|
2022-01-30 06:11:52 +01:00
|
|
|
}
|
|
|
|
|
2022-07-17 14:06:33 +02:00
|
|
|
function close(actioned = false) {
|
2023-04-08 02:01:42 +02:00
|
|
|
emit("close", actioned);
|
2022-01-30 06:11:52 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
function focusUp() {
|
|
|
|
focusPrev(document.activeElement);
|
|
|
|
}
|
|
|
|
|
|
|
|
function focusDown() {
|
|
|
|
focusNext(document.activeElement);
|
|
|
|
}
|
2022-07-17 14:06:33 +02:00
|
|
|
|
|
|
|
onMounted(() => {
|
2023-04-30 17:58:36 +02:00
|
|
|
focusTrap.value.activate();
|
|
|
|
|
2022-07-17 14:06:33 +02:00
|
|
|
if (props.viaKeyboard) {
|
|
|
|
nextTick(() => {
|
|
|
|
focusNext(itemsEl.children[0], true, false);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2023-04-08 02:01:42 +02:00
|
|
|
document.addEventListener("mousedown", onGlobalMousedown, {
|
|
|
|
passive: true,
|
|
|
|
});
|
2022-07-17 14:06:33 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
onBeforeUnmount(() => {
|
2023-04-08 02:01:42 +02:00
|
|
|
document.removeEventListener("mousedown", onGlobalMousedown);
|
2022-07-17 14:06:33 +02:00
|
|
|
});
|
2020-10-17 13:12:00 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.rrevdjwt {
|
|
|
|
padding: 8px 0;
|
2021-11-28 12:07:37 +01:00
|
|
|
box-sizing: border-box;
|
2021-10-03 08:39:39 +02:00
|
|
|
min-width: 200px;
|
2021-11-05 02:48:37 +01:00
|
|
|
overflow: auto;
|
2021-12-03 04:00:11 +01:00
|
|
|
overscroll-behavior: contain;
|
2020-10-17 13:12:00 +02:00
|
|
|
|
2021-10-03 08:39:39 +02:00
|
|
|
&.center {
|
2020-10-17 13:12:00 +02:00
|
|
|
> .item {
|
2021-10-03 08:39:39 +02:00
|
|
|
text-align: center;
|
2020-10-17 13:12:00 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
> .item {
|
|
|
|
display: block;
|
|
|
|
position: relative;
|
2022-07-06 11:20:32 +02:00
|
|
|
padding: 6px 16px;
|
2020-10-17 13:12:00 +02:00
|
|
|
width: 100%;
|
|
|
|
box-sizing: border-box;
|
|
|
|
white-space: nowrap;
|
2022-07-15 10:01:13 +02:00
|
|
|
font-size: 0.9em;
|
2020-10-17 13:12:00 +02:00
|
|
|
line-height: 20px;
|
2021-10-03 08:39:39 +02:00
|
|
|
text-align: left;
|
2023-02-09 03:19:37 +01:00
|
|
|
outline: none;
|
2020-10-17 13:12:00 +02:00
|
|
|
|
2021-10-03 08:39:39 +02:00
|
|
|
&:before {
|
|
|
|
content: "";
|
|
|
|
display: block;
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
right: 0;
|
|
|
|
margin: auto;
|
2021-10-15 16:33:27 +02:00
|
|
|
width: calc(100% - 16px);
|
2022-07-24 09:00:24 +02:00
|
|
|
margin-bottom: 0.2rem;
|
2021-10-03 08:39:39 +02:00
|
|
|
height: 100%;
|
2021-10-15 16:33:27 +02:00
|
|
|
border-radius: 6px;
|
2021-10-03 08:39:39 +02:00
|
|
|
}
|
|
|
|
|
2021-10-09 06:12:41 +02:00
|
|
|
> * {
|
|
|
|
position: relative;
|
|
|
|
}
|
|
|
|
|
2022-11-07 04:42:01 +01:00
|
|
|
> &.icon {
|
|
|
|
transform: translateY(0em);
|
|
|
|
}
|
|
|
|
|
2023-04-30 22:27:27 +02:00
|
|
|
&:not(:disabled):hover,
|
|
|
|
&:focus-visible {
|
2022-06-05 05:23:57 +02:00
|
|
|
color: var(--accent);
|
|
|
|
text-decoration: none;
|
|
|
|
|
|
|
|
&:before {
|
|
|
|
background: var(--accentedBg);
|
|
|
|
}
|
|
|
|
}
|
2023-02-09 03:19:37 +01:00
|
|
|
&:focus-visible:before {
|
|
|
|
outline: auto;
|
|
|
|
}
|
2022-06-05 05:23:57 +02:00
|
|
|
|
2020-10-17 13:12:00 +02:00
|
|
|
&.danger {
|
2022-07-24 08:46:13 +02:00
|
|
|
color: #eb6f92;
|
2020-10-17 13:12:00 +02:00
|
|
|
|
|
|
|
&:hover {
|
2022-07-24 08:46:13 +02:00
|
|
|
color: #e0def4;
|
2021-10-03 08:39:39 +02:00
|
|
|
|
|
|
|
&:before {
|
2022-07-24 08:46:13 +02:00
|
|
|
background: #eb6f92;
|
2021-10-03 08:39:39 +02:00
|
|
|
}
|
2020-10-17 13:12:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
&:active {
|
2022-07-24 08:46:13 +02:00
|
|
|
color: #e0def4;
|
2021-10-03 08:39:39 +02:00
|
|
|
|
|
|
|
&:before {
|
2022-07-24 08:46:13 +02:00
|
|
|
background: #b4637a;
|
2021-10-03 08:39:39 +02:00
|
|
|
}
|
2020-10-17 13:12:00 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-10-09 06:12:41 +02:00
|
|
|
&.active {
|
|
|
|
color: var(--fgOnAccent);
|
|
|
|
opacity: 1;
|
|
|
|
|
|
|
|
&:before {
|
|
|
|
background: var(--accent);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-10-02 19:46:58 +02:00
|
|
|
&:not(:active):focus-visible {
|
2020-10-17 13:12:00 +02:00
|
|
|
box-shadow: 0 0 0 2px var(--focus) inset;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.label {
|
|
|
|
pointer-events: none;
|
|
|
|
font-size: 0.7em;
|
|
|
|
padding-bottom: 4px;
|
|
|
|
|
|
|
|
> span {
|
|
|
|
opacity: 0.7;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&.pending {
|
|
|
|
pointer-events: none;
|
|
|
|
opacity: 0.7;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.none {
|
|
|
|
pointer-events: none;
|
|
|
|
opacity: 0.7;
|
|
|
|
}
|
|
|
|
|
2022-07-17 14:06:33 +02:00
|
|
|
&.parent {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
cursor: default;
|
|
|
|
|
|
|
|
> .caret {
|
|
|
|
margin-left: auto;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.childShowing {
|
|
|
|
color: var(--accent);
|
|
|
|
text-decoration: none;
|
|
|
|
|
|
|
|
&:before {
|
|
|
|
background: var(--accentedBg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-20 16:22:59 +02:00
|
|
|
> i {
|
2021-10-15 16:35:28 +02:00
|
|
|
margin-right: 5px;
|
2020-10-17 13:12:00 +02:00
|
|
|
width: 20px;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .avatar {
|
2021-10-15 16:35:28 +02:00
|
|
|
margin-right: 5px;
|
2020-10-17 13:12:00 +02:00
|
|
|
width: 20px;
|
|
|
|
height: 20px;
|
|
|
|
}
|
|
|
|
|
2021-04-20 16:22:59 +02:00
|
|
|
> .indicator {
|
2020-10-17 13:12:00 +02:00
|
|
|
position: absolute;
|
|
|
|
top: 5px;
|
|
|
|
left: 13px;
|
|
|
|
color: var(--indicator);
|
|
|
|
font-size: 12px;
|
|
|
|
animation: blink 1s infinite;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
> .divider {
|
|
|
|
margin: 8px 0;
|
2021-12-18 07:00:29 +01:00
|
|
|
border-top: solid 0.5px var(--divider);
|
2020-10-17 13:12:00 +02:00
|
|
|
}
|
2021-12-16 18:14:40 +01:00
|
|
|
|
|
|
|
&.asDrawer {
|
2021-12-24 15:25:23 +01:00
|
|
|
padding: 12px 0 calc(env(safe-area-inset-bottom, 0px) + 12px) 0;
|
2021-12-16 18:14:40 +01:00
|
|
|
width: 100%;
|
2022-07-21 15:22:13 +02:00
|
|
|
border-radius: 24px;
|
|
|
|
border-bottom-right-radius: 0;
|
|
|
|
border-bottom-left-radius: 0;
|
2021-12-16 18:14:40 +01:00
|
|
|
|
|
|
|
> .item {
|
|
|
|
font-size: 1em;
|
|
|
|
padding: 12px 24px;
|
|
|
|
|
|
|
|
&:before {
|
|
|
|
width: calc(100% - 24px);
|
|
|
|
border-radius: 12px;
|
|
|
|
}
|
|
|
|
|
|
|
|
> i {
|
|
|
|
margin-right: 14px;
|
|
|
|
width: 24px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
> .divider {
|
|
|
|
margin: 12px 0;
|
|
|
|
}
|
|
|
|
}
|
2020-10-17 13:12:00 +02:00
|
|
|
}
|
|
|
|
</style>
|