Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* SelectAll fix * Method has been renamed after review
- Loading branch information
Showing
4 changed files
with
119 additions
and
13 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
src/MudBlazor.UnitTests.Viewer/TestComponents/Select/MultiSelectTest3.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
@namespace MudBlazor.UnitTests.TestComponents | ||
|
||
<MudGrid> | ||
<MudItem xs="12" md="12"> | ||
<MudSelect T="string" Label="Felines" HelperText="Pick your favorite feline" | ||
MultiSelection="true" OffsetY="true" DelimitedStringSeparator="^" SelectAll="true" SelectAllText="Select all felines" | ||
@bind-Value="value" @bind-SelectedValues="options" AdornmentIcon="@Icons.Material.Filled.Search" | ||
MultiSelectionTextFunc="@(new Func<List<string>, string>(GetMultiSelectionText))"> | ||
@foreach (var feline in felines) | ||
{ | ||
<MudSelectItem T="string" Value="@feline">@feline</MudSelectItem> | ||
} | ||
</MudSelect> | ||
</MudItem> | ||
<MudItem xs="12" md="6"> | ||
<MudText Typo="Typo.body2">MudSelect.Value: "@value"</MudText> | ||
</MudItem> | ||
</MudGrid> | ||
|
||
@code { | ||
private string value { get; set; } = "Nothing selected"; | ||
private HashSet<string> options { get; set; } = new HashSet<string>() { "Jaguar", "Leopard", "Lion", "Lynx", "Panther", "Puma", "Tiger"}; | ||
|
||
private string[] felines = | ||
{ | ||
"Jaguar", "Leopard", "Lion", "Lynx", "Panther", "Puma", "Tiger" | ||
}; | ||
|
||
private string GetMultiSelectionText(List<string> selectedValues) | ||
{ | ||
return $"{selectedValues.Count} feline{(selectedValues.Count > 1 ? "s have" : " has")} been selected"; | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
src/MudBlazor.UnitTests.Viewer/TestComponents/Select/MultiSelectTest4.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
@namespace MudBlazor.UnitTests.TestComponents | ||
|
||
<MudGrid> | ||
<MudItem xs="12" md="12"> | ||
<MudSelect T="string" Label="Felines" HelperText="Pick your favorite feline" | ||
MultiSelection="true" OffsetY="true" DelimitedStringSeparator="^" SelectAll="true" SelectAllText="Select all felines" | ||
@bind-Value="value" @bind-SelectedValues="options" AdornmentIcon="@Icons.Material.Filled.Search" | ||
MultiSelectionTextFunc="@(new Func<List<string>, string>(GetMultiSelectionText))"> | ||
@foreach (var feline in felines) | ||
{ | ||
<MudSelectItem T="string" Value="@feline">@feline</MudSelectItem> | ||
} | ||
</MudSelect> | ||
</MudItem> | ||
<MudItem xs="12" md="6"> | ||
<MudText Typo="Typo.body2">MudSelect.Value: "@value"</MudText> | ||
</MudItem> | ||
</MudGrid> | ||
|
||
@code { | ||
private string value { get; set; } = "Nothing selected"; | ||
private HashSet<string> options { get; set; } | ||
|
||
private string[] felines = | ||
{ | ||
"Jaguar", "Leopard", "Lion", "Lynx", "Panther", "Puma", "Tiger" | ||
}; | ||
|
||
private string GetMultiSelectionText(List<string> selectedValues) | ||
{ | ||
return $"{selectedValues.Count} feline{(selectedValues.Count > 1 ? "s have" : " has")} been selected"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters