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, nextTick, onMounted, onUnmounted, ref, watch } from 'vue';
import { useEscClose } from '@/lib/modal-stack';
import { matchesSearch } from '@/lib/search';
import TableColumnsMenu from '@/components/TableColumnsMenu.vue';
import axios from 'axios';
@@ -290,6 +291,9 @@ function askRemove(row: MessageAutomationRuleDto) {
pendingDelete.value = row;
}
useEscClose(() => fieldsSheet.value, () => { fieldsSheet.value = false; });
useEscClose(() => pendingDelete.value, () => cancelRemove());
function cancelRemove() {
pendingDelete.value = null;
}
@@ -1050,7 +1054,7 @@ onUnmounted(() => {
</form>
<div v-if="fieldsSheet" class="sheet-layer">
<button class="dim" type="button" aria-label="بستن" @click="fieldsSheet = false" />
<div class="dim" aria-hidden="true" />
<section class="sheet" role="dialog" aria-modal="true" aria-label="فهرست فیلدها">
<header>
<h3>فهرست فیلدهای پویا</h3>
@@ -1158,7 +1162,7 @@ onUnmounted(() => {
</div>
<div v-if="pendingDelete" class="sheet-layer">
<button class="dim" type="button" aria-label="انصراف" @click="cancelRemove" />
<div class="dim" aria-hidden="true" />
<section class="confirm-box" role="dialog" aria-modal="true" aria-labelledby="delete-confirm-title">
<h3 id="delete-confirm-title">حذف قانون</h3>
<p>آیا از حذف مطمئن هستید؟</p>