Add conditional field removal and overlay improvements

Updated `SenderPdfImageEditor` to conditionally display the "Remove" button using a new `ShowFieldRemoveButton` parameter. Integrated dynamic field overlays in `ReceiverPage` and `ReceiverSignedPage` using `SenderPdfFieldOverlay`. Removed `DrawSignaturePlaceholders` method and simplified `_displayPdfBytes` assignment. Added a guard clause in `OnFieldMouseDownAsync` to prevent unnecessary execution.
This commit is contained in:
2026-11-20 13:38:59 +01:00
parent d2e8a01068
commit e43386ef4f
3 changed files with 29 additions and 78 deletions

View File

@@ -93,16 +93,19 @@
@onmousedown:preventDefault="true"
@onclick:stopPropagation="true">
<span class="sender-image-editor__field-label">@field.ReceiverName</span>
<button type="button"
class="sender-image-editor__field-remove"
title='@L("Delete", "Löschen")'
draggable="false"
@onclick:stopPropagation="true"
@onclick="() => RemoveField.InvokeAsync(field.Index)">
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 16 16" fill="none" aria-hidden="true">
<path d="M4 4L12 12M12 4L4 12" stroke="currentColor" stroke-width="2" stroke-linecap="round" />
</svg>
</button>
@if (ShowFieldRemoveButton)
{
<button type="button"
class="sender-image-editor__field-remove"
title='@L("Delete", "Löschen")'
draggable="false"
@onclick:stopPropagation="true"
@onclick="() => RemoveField.InvokeAsync(field.Index)">
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 16 16" fill="none" aria-hidden="true">
<path d="M4 4L12 12M12 4L4 12" stroke="currentColor" stroke-width="2" stroke-linecap="round" />
</svg>
</button>
}
</div>
}
</div>
@@ -132,6 +135,9 @@
[Parameter]
public IReadOnlyList<SenderPdfFieldOverlay> Fields { get; set; } = Array.Empty<SenderPdfFieldOverlay>();
[Parameter]
public bool ShowFieldRemoveButton { get; set; } = true;
[Parameter]
public EventCallback<MouseEventArgs> EditorClick { get; set; }
@@ -235,6 +241,9 @@
private async Task OnFieldMouseDownAsync(MouseEventArgs args, SenderPdfFieldOverlay field)
{
if (!MoveField.HasDelegate)
return;
var coords = await JSRuntime.InvokeAsync<EditorCoords?>(
"envelopeEditor.getClickCoordsOnPdfPage",
"sender-editor-pdf-viewer",