Add export feature UI to EnvelopeSenderPage (placeholder)
Introduced a new export feature to the EnvelopeSenderPage, including a dropdown for selecting export formats (XLSX, CSV, PDF) and a checkbox to export only selected rows. Added a placeholder export button ("Exportieren") that is currently disabled, with export logic to be implemented in a future phase.
Added private fields `_selectedExportFormat` and `_exportSelectedRowsOnly` to manage the export state. Implemented `IsExportDisabled()` to control button availability and a placeholder method `ExportSelectedFormatPlaceholderAsync()`.
Updated `sender-page.css` to style the export feature, including the export button, dropdown, and checkbox. Added theme-specific styles for "purple" and "blazing-dark" themes. Adjusted toolbar element order to position the export group before the logout button.
This commit is contained in:
@@ -104,6 +104,31 @@
|
||||
Vorschau
|
||||
</button>
|
||||
|
||||
<div class="sender-export-group" title="Export der aktuellen Tabellenansicht">
|
||||
<label class="sender-export-label" for="sender-export-format">Format</label>
|
||||
<select id="sender-export-format" class="sender-export-format" @bind="_selectedExportFormat" aria-label="Exportformat auswählen">
|
||||
<option value="xlsx">XLSX</option>
|
||||
<option value="csv">CSV</option>
|
||||
<option value="pdf">PDF</option>
|
||||
</select>
|
||||
|
||||
<label class="sender-export-selected">
|
||||
<input type="checkbox" @bind="_exportSelectedRowsOnly" />
|
||||
<span>Nur ausgewählte</span>
|
||||
</label>
|
||||
|
||||
<button class="sender-btn sender-btn--export"
|
||||
@onclick="ExportSelectedFormatPlaceholderAsync"
|
||||
disabled="@IsExportDisabled()"
|
||||
title="Export wird in Phase 2 aktiviert">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
|
||||
<path d="M.5 9.9a.5.5 0 0 1 .5.5V13a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-2.6a.5.5 0 0 1 1 0V13a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-2.6a.5.5 0 0 1 .5-.5z" />
|
||||
<path d="M5.354 6.146a.5.5 0 0 1 .707 0L7.5 7.586V.5a.5.5 0 0 1 1 0v7.086l1.439-1.44a.5.5 0 0 1 .707.708l-2.293 2.293a.5.5 0 0 1-.707 0L5.354 6.854a.5.5 0 0 1 0-.708z" />
|
||||
</svg>
|
||||
Exportieren
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<button class="sender-btn sender-btn--logout" @onclick="LogoutAsync" disabled="@_isLoggingOut" title="Abmelden">
|
||||
@if (_isLoggingOut)
|
||||
{
|
||||
@@ -514,6 +539,10 @@
|
||||
private byte[]? _previewPdfBytes = null;
|
||||
private string? _previewErrorMessage = null;
|
||||
|
||||
// Phase 6e (step 1): UI state only. Export logic is added in step 2.
|
||||
private string _selectedExportFormat = "xlsx";
|
||||
private bool _exportSelectedRowsOnly = false;
|
||||
|
||||
// Stable keys used to store/restore each grid's layout in UserPreferences.GridLayouts
|
||||
private const string GridKeyActive = "sender.active-envelopes";
|
||||
private const string GridKeyCompleted = "sender.completed-envelopes";
|
||||
@@ -572,6 +601,19 @@
|
||||
await LoadEnvelopesAsync();
|
||||
}
|
||||
|
||||
bool IsExportDisabled()
|
||||
{
|
||||
if (_isLoading)
|
||||
return true;
|
||||
|
||||
return _exportSelectedRowsOnly && _selectedEnvelope is null;
|
||||
}
|
||||
|
||||
Task ExportSelectedFormatPlaceholderAsync()
|
||||
{
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
void CreateEnvelope()
|
||||
{
|
||||
Navigation.NavigateTo("/sender/editor");
|
||||
@@ -753,4 +795,4 @@
|
||||
var json = JsonSerializer.Serialize(e.Layout);
|
||||
await UserPreferencesService.SaveGridLayoutAsync(GridKeyCompleted, json);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user