AI-Studio/app/MindWork AI Studio/Components/DynamicAssistantDropdown.razor
2026-03-13 02:01:44 +01:00

54 lines
1.8 KiB
Plaintext

@using AIStudio.Tools.PluginSystem.Assistants.DataModel
<MudStack Row="true" Class='@this.MergeClasses(this.Class, "mb-3")' Style="@this.Style">
@if (this.IsMultiselect)
{
<MudSelect
T="string"
SelectedValues="@this.SelectedValues"
SelectedValuesChanged="@this.OnSelectedValuesChanged"
MultiSelectionTextFunc="@this.GetMultiSelectionText"
Label="@this.Label"
HelperText="@this.HelperText"
Placeholder="@this.Default.Display"
OpenIcon="@this.OpenIcon"
CloseIcon="@this.CloseIcon"
Adornment="@this.IconPosition"
AdornmentColor="@this.IconColor"
Variant="@this.Variant"
Margin="Margin.Normal"
MultiSelection="@true"
SelectAll="@this.HasSelectAll"
SelectAllText="@this.SelectAllText">
@foreach (var item in this.GetRenderedItems())
{
<MudSelectItem Value="@item.Value">
@item.Display
</MudSelectItem>
}
</MudSelect>
}
else
{
<MudSelect
T="string"
Value="@this.Value"
ValueChanged="@(val => this.OnValueChanged(val))"
Label="@this.Label"
HelperText="@this.HelperText"
Placeholder="@this.Default.Display"
OpenIcon="@this.OpenIcon"
CloseIcon="@this.CloseIcon"
Adornment="@this.IconPosition"
AdornmentColor="@this.IconColor"
Variant="@this.Variant"
Margin="Margin.Normal">
@foreach (var item in this.GetRenderedItems())
{
<MudSelectItem Value="@item.Value">
@item.Display
</MudSelectItem>
}
</MudSelect>
}
</MudStack>