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:
@@ -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)
|
||||
|
||||
@@ -1105,12 +1105,20 @@
|
||||
|
||||
.sender-create-wizard__body-layout {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) minmax(240px, 280px);
|
||||
gap: 0.85rem;
|
||||
--sender-upload-panel-width: 280px;
|
||||
--sender-upload-panel-max-width: 50%;
|
||||
grid-template-columns: minmax(0, 1fr) 5px minmax(240px, min(var(--sender-upload-panel-width), var(--sender-upload-panel-max-width)));
|
||||
gap: 0;
|
||||
align-items: stretch;
|
||||
transition: grid-template-columns 220ms ease 0.2s, gap 220ms ease 0.2s;
|
||||
}
|
||||
|
||||
.sender-create-wizard__body-layout--resizing {
|
||||
user-select: none;
|
||||
cursor: col-resize;
|
||||
transition: none;
|
||||
}
|
||||
|
||||
.sender-create-wizard-popup.dxbl-modal-root,
|
||||
.sender-create-wizard-popup .dxbl-modal-root,
|
||||
.sender-create-wizard-popup .dxbl-modal,
|
||||
@@ -1199,9 +1207,9 @@
|
||||
|
||||
.sender-create-wizard__stepper-shell {
|
||||
border: 1px solid rgba(126, 34, 206, 0.12);
|
||||
border-radius: 10px;
|
||||
border-radius: 10px 0 0 10px;
|
||||
background: rgba(126, 34, 206, 0.04);
|
||||
padding: 0.75rem;
|
||||
padding: 0.75rem 0 0.75rem 0.75rem;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
@@ -1305,12 +1313,13 @@
|
||||
}
|
||||
|
||||
.sender-create-wizard__wizard-side {
|
||||
min-width: 0;
|
||||
max-width: 280px;
|
||||
min-width: 240px;
|
||||
width: 100%;
|
||||
max-width: none;
|
||||
border: 1px solid rgba(126, 34, 206, 0.12);
|
||||
border-radius: 10px;
|
||||
border-radius: 0 10px 10px 0;
|
||||
background: rgba(126, 34, 206, 0.04);
|
||||
padding: 0.75rem;
|
||||
padding: 0.75rem 0.75rem 0.75rem 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: stretch;
|
||||
@@ -1318,9 +1327,31 @@
|
||||
transition: opacity 220ms ease 0.2s, transform 220ms ease 0.2s;
|
||||
}
|
||||
|
||||
.sender-create-wizard__splitter {
|
||||
width: 5px;
|
||||
align-self: stretch;
|
||||
border-radius: 0;
|
||||
background: linear-gradient(180deg, rgba(126, 34, 206, 0.18), rgba(14, 116, 144, 0.2));
|
||||
cursor: col-resize;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.sender-create-wizard__splitter::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
width: 2px;
|
||||
height: 44px;
|
||||
transform: translate(-50%, -50%);
|
||||
border-radius: 999px;
|
||||
background: rgba(71, 85, 105, 0.45);
|
||||
}
|
||||
|
||||
.sender-create-wizard__wizard-side .sender-pdf-dropzone {
|
||||
height: 100%;
|
||||
min-height: 100%;
|
||||
margin-left: 0.75rem;
|
||||
}
|
||||
|
||||
.sender-create-wizard__meta {
|
||||
@@ -1914,6 +1945,10 @@
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.sender-create-wizard__splitter {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.sender-create-wizard__wizard-side {
|
||||
max-width: none;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user