2020-10-17 13:12:00 +02:00
|
|
|
<template>
|
2023-04-08 02:01:42 +02:00
|
|
|
<MkModal
|
|
|
|
ref="modal"
|
|
|
|
v-slot="{ type, maxHeight }"
|
|
|
|
:z-priority="'high'"
|
|
|
|
:src="src"
|
|
|
|
:transparent-bg="true"
|
|
|
|
@click="modal.close()"
|
|
|
|
@closed="emit('closed')"
|
2023-04-29 01:06:21 +02:00
|
|
|
tabindex="-1"
|
2023-04-08 02:01:42 +02:00
|
|
|
>
|
|
|
|
<MkMenu
|
|
|
|
:items="items"
|
|
|
|
:align="align"
|
|
|
|
:width="width"
|
|
|
|
:max-height="maxHeight"
|
|
|
|
:as-drawer="type === 'drawer'"
|
|
|
|
class="sfhdhdhq"
|
2023-05-07 20:38:39 +02:00
|
|
|
:class="{ drawer: type === 'drawer' }"
|
2023-06-08 19:01:51 +02:00
|
|
|
:no-return-focus="noReturnFocus"
|
2023-04-08 02:01:42 +02:00
|
|
|
@close="modal.close()"
|
|
|
|
/>
|
|
|
|
</MkModal>
|
2020-10-17 13:12:00 +02:00
|
|
|
</template>
|
|
|
|
|
2022-01-30 06:11:52 +01:00
|
|
|
<script lang="ts" setup>
|
2023-05-07 20:38:39 +02:00
|
|
|
import {} from "vue";
|
2023-04-08 02:01:42 +02:00
|
|
|
import MkModal from "./MkModal.vue";
|
|
|
|
import MkMenu from "./MkMenu.vue";
|
2023-05-07 20:38:39 +02:00
|
|
|
import { MenuItem } from "@/types/menu";
|
2020-10-17 13:12:00 +02:00
|
|
|
|
2022-01-30 06:11:52 +01:00
|
|
|
defineProps<{
|
|
|
|
items: MenuItem[];
|
2023-04-08 02:01:42 +02:00
|
|
|
align?: "center" | string;
|
2022-01-30 06:11:52 +01:00
|
|
|
width?: number;
|
|
|
|
viaKeyboard?: boolean;
|
|
|
|
src?: any;
|
2023-06-08 19:01:51 +02:00
|
|
|
noReturnFocus?;
|
2022-01-30 06:11:52 +01:00
|
|
|
}>();
|
2021-08-08 05:19:10 +02:00
|
|
|
|
2022-01-30 06:11:52 +01:00
|
|
|
const emit = defineEmits<{
|
2023-04-08 02:01:42 +02:00
|
|
|
(ev: "closed"): void;
|
2022-01-30 06:11:52 +01:00
|
|
|
}>();
|
2021-08-08 05:19:10 +02:00
|
|
|
|
2022-01-30 06:11:52 +01:00
|
|
|
let modal = $ref<InstanceType<typeof MkModal>>();
|
2020-10-17 13:12:00 +02:00
|
|
|
</script>
|
2021-12-16 18:14:40 +01:00
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.sfhdhdhq {
|
|
|
|
&.drawer {
|
|
|
|
border-radius: 24px;
|
|
|
|
border-bottom-right-radius: 0;
|
|
|
|
border-bottom-left-radius: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|