feat(ui): modals close only via Esc/X/cancel; standard 3:1 form cover processing

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-07 15:23:14 +03:30
co-authored by Cursor
parent f5b6a47f3c
commit 2f3646d085
19 changed files with 366 additions and 117 deletions
@@ -1,5 +1,6 @@
<script setup lang="ts">
import { computed, onMounted, onUnmounted, ref, watch } from 'vue';
import { computed, onUnmounted, ref, watch } from 'vue';
import { useEscClose } from '@/lib/modal-stack';
import type { MessageAutomationDelayUnit } from '@mento/shared';
import { toFaDigits } from '@/lib/jalali';
import UiIcon from '@/components/UiIcon.vue';
@@ -92,17 +93,13 @@ function pickImmediate() {
open.value = false;
}
function onKey(event: KeyboardEvent) {
if (event.key === 'Escape') open.value = false;
}
useEscClose(() => open.value, () => { open.value = false; });
watch(open, (isOpen) => {
document.body.style.overflow = isOpen ? 'hidden' : '';
});
onMounted(() => window.addEventListener('keydown', onKey));
onUnmounted(() => {
window.removeEventListener('keydown', onKey);
document.body.style.overflow = '';
});
</script>
@@ -116,7 +113,7 @@ onUnmounted(() => {
<Teleport to="body">
<div v-if="open" class="layer">
<button class="dim" type="button" aria-label="بستن" @click="open = false" />
<div class="dim" aria-hidden="true" />
<section class="sheet" role="dialog" aria-modal="true" aria-label="انتخاب فاصله زمانی">
<header>
<div>