feat: edit print templates on the printer page and store them on presets
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
<MudDialog>
|
||||
<DialogContent>
|
||||
<MudTextField @bind-Value="_name"
|
||||
Label="Preset name"
|
||||
Variant="Variant.Outlined"
|
||||
Immediate="true"
|
||||
MaxLength="100"
|
||||
Autofocus="true" />
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<MudButton OnClick="Cancel">Cancel</MudButton>
|
||||
<MudButton Color="Color.Primary"
|
||||
Variant="Variant.Filled"
|
||||
OnClick="Save"
|
||||
Disabled="@string.IsNullOrWhiteSpace(_name)">
|
||||
Save
|
||||
</MudButton>
|
||||
</DialogActions>
|
||||
</MudDialog>
|
||||
|
||||
@code {
|
||||
[CascadingParameter]
|
||||
IMudDialogInstance MudDialog { get; set; } = null!;
|
||||
|
||||
private string _name = string.Empty;
|
||||
|
||||
private void Save()
|
||||
{
|
||||
var name = _name.Trim();
|
||||
if (string.IsNullOrWhiteSpace(name))
|
||||
return;
|
||||
|
||||
MudDialog.Close(DialogResult.Ok(name));
|
||||
}
|
||||
|
||||
private void Cancel() => MudDialog.Cancel();
|
||||
}
|
||||
Reference in New Issue
Block a user