Add resizable upload panel to CreateEnvelopeWizardPopup

Introduced a resizable upload panel feature in the
`CreateEnvelopeWizardPopup` component, allowing users to adjust
the panel's width dynamically.

- Added a draggable splitter (`sender-create-wizard__splitter`)
  with mouse event handling for resizing.
- Updated `sender-create-wizard__body-layout` to support dynamic
  grid column definitions using `--sender-upload-panel-width`.
- Added Razor methods (`StartUploadPanelResize`,
  `OnBodyLayoutMouseMove`, `StopUploadPanelResize`) to handle
  resizing logic.
- Defined constants for min/max panel widths.
- Enhanced CSS for resizing behavior, including transitions,
  cursor changes, and visual improvements for the splitter.
- Adjusted layout and padding for better alignment with the
  resizable design.

These changes improve user experience by enabling dynamic
adjustment of the upload panel's width.
This commit is contained in:
2026-11-18 11:37:04 +01:00
parent 5853868de2
commit 2feebf264b
2 changed files with 87 additions and 9 deletions

View File

@@ -31,7 +31,11 @@
<div class="sender-create-wizard"
tabindex="0"
@onkeydown="OnWizardKeyDownAsync">
<div class="sender-create-wizard__body-layout">
<div class="sender-create-wizard__body-layout @(_isUploadPanelResizing ? "sender-create-wizard__body-layout--resizing" : string.Empty)"
style="@($"--sender-upload-panel-width: {_uploadPanelWidthPx}px;")"
@onmousemove="OnBodyLayoutMouseMove"
@onmouseup="StopUploadPanelResize"
@onmouseleave="StopUploadPanelResize">
<MudPaper Class="sender-create-wizard__stepper-shell" Elevation="0">
<MudStepper Vertical="true"
NonLinear="false"
@@ -376,6 +380,13 @@
</MudStepper>
</MudPaper>
<div class="sender-create-wizard__splitter"
role="separator"
aria-orientation="vertical"
aria-label='@L("SenderWizard_UploadPanelResizer", "Upload-Bereich groesse aendern")'
@onmousedown="StartUploadPanelResize"
@onmousedown:preventDefault="true"></div>
<aside class="sender-create-wizard__wizard-side">
<PdfFileDropZone Disabled="@IsActionLocked"
HasDocument="@(_documentBytes is { Length: > 0 })"
@@ -502,6 +513,13 @@
private bool _isStepActionRunning;
private bool _isFinishing;
private const double UploadPanelMinWidthPx = 240;
private const double UploadPanelMaxWidthPx = 1400;
private double _uploadPanelWidthPx = 280;
private bool _isUploadPanelResizing;
private double _uploadPanelResizeStartX;
private double _uploadPanelResizeStartWidthPx;
private string? _validationMessage;
private bool IsActionLocked => _isDocumentUploading || _isStepActionRunning || _isFinishing;
@@ -731,6 +749,31 @@
}
}
private Task StartUploadPanelResize(MouseEventArgs args)
{
_isUploadPanelResizing = true;
_uploadPanelResizeStartX = args.ClientX;
_uploadPanelResizeStartWidthPx = _uploadPanelWidthPx;
return Task.CompletedTask;
}
private Task OnBodyLayoutMouseMove(MouseEventArgs args)
{
if (!_isUploadPanelResizing)
return Task.CompletedTask;
var delta = _uploadPanelResizeStartX - args.ClientX;
var nextWidth = _uploadPanelResizeStartWidthPx + delta;
_uploadPanelWidthPx = Math.Clamp(nextWidth, UploadPanelMinWidthPx, UploadPanelMaxWidthPx);
return Task.CompletedTask;
}
private Task StopUploadPanelResize()
{
_isUploadPanelResizing = false;
return Task.CompletedTask;
}
private Task MoveBack()
{
if (IsActionLocked)