mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-11-23 10:50:21 +00:00
Add "Clear file list" button to AttachDocuments component
This commit is contained in:
parent
1f82155b13
commit
45ab5338b4
@ -12,4 +12,7 @@
|
|||||||
}
|
}
|
||||||
</MudPaper>
|
</MudPaper>
|
||||||
</MudLink>
|
</MudLink>
|
||||||
|
<MudButton OnClick="@(async () => await this.ClearAllFiles())" Variant="Variant.Filled" Color="Color.Info" Class="mt-2" StartIcon="@Icons.Material.Filled.Delete">
|
||||||
|
@T("Clear file list")
|
||||||
|
</MudButton>
|
||||||
</div>
|
</div>
|
||||||
@ -100,6 +100,13 @@ public partial class AttachDocuments : MSGComponentBase
|
|||||||
await this.OnChange(this.DocumentPaths);
|
await this.OnChange(this.DocumentPaths);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async Task ClearAllFiles()
|
||||||
|
{
|
||||||
|
this.DocumentPaths.Clear();
|
||||||
|
await this.DocumentPathsChanged.InvokeAsync(this.DocumentPaths);
|
||||||
|
await this.OnChange(this.DocumentPaths);
|
||||||
|
}
|
||||||
|
|
||||||
private void SetDragClass() => this.dragClass = $"{DEFAULT_DRAG_CLASS} mud-border-primary border-4";
|
private void SetDragClass() => this.dragClass = $"{DEFAULT_DRAG_CLASS} mud-border-primary border-4";
|
||||||
|
|
||||||
private void ClearDragClass() => this.dragClass = DEFAULT_DRAG_CLASS;
|
private void ClearDragClass() => this.dragClass = DEFAULT_DRAG_CLASS;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user