fix(documents): repair inline add-item modal on invoice/estimate create

Render a single shared ItemModal (was one per row, so stacked dialogs closed each other), validate the modal's own local form (vuelidate did not track the shared store object in the persistent modal), surface save errors, and carry the typed item name into the new-item form.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Darko Gjorgjijoski
2026-06-14 23:42:12 +02:00
parent 9e496102d4
commit 3ca4027871
4 changed files with 134 additions and 83 deletions

View File

@@ -1,5 +1,9 @@
<template>
<div class="rounded-xl border border-line-light shadow bg-surface">
<!-- Single shared item-create modal for the whole table (one instance, not one
per row stacked HeadlessUI dialogs would otherwise close each other). -->
<ItemModal />
<!-- Tax Included Toggle -->
<div
v-if="taxIncludedSetting === 'YES'"
@@ -109,6 +113,7 @@
import { computed } from 'vue'
import draggable from 'vuedraggable'
import DocumentItemRow from './DocumentItemRow.vue'
import ItemModal from '@/scripts/features/company/items/components/ItemModal.vue'
import type { Currency } from '../../../types/domain/currency'
import type { DocumentFormData } from './use-document-calculations'