Skip to content

Commit b9ca508

Browse files
committed
Add to search box example
1 parent 6e47553 commit b9ca508

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

CodeBeam.MudBlazor.Extensions.Docs/Pages/Components/ListExtended/Examples/ListExtendedExample2.razor

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44
<MudItem xs="12" sm="8" Class="d-flex gap-8 align-top justify-center" Style="height: 500px">
55
<MudPaper Width="300px" Elevation="0">
66
<MudText Class="ma-4">Array List</MudText>
7-
<MudListExtended ItemCollection="_states" Clickable="true" MaxItems="_maxItems" SearchBox="_searchBox" SearchFunc="@(new Func<string, string, bool>(SearchItems))" @bind-SelectedValue="_selectedState" />
7+
<MudListExtended ItemCollection="_states" Clickable="true" MaxItems="_maxItems" SearchBox="_searchBox" @bind-SearchString="@_searchString" SearchFunc="@(new Func<string, string, bool>(SearchItems))" @bind-SelectedValue="_selectedState" />
88
</MudPaper>
99

1010
<MudPaper Width="300px" Elevation="0">
1111
<MudText Class="ma-4">Enum List</MudText>
12-
<MudListExtended T="Continent" ItemCollection="(ICollection<Continent>)Enum.GetValues<Continent>()" Clickable="true" MaxItems="_maxItems" SearchBox="_searchBox" />
12+
<MudListExtended T="Continent" ItemCollection="(ICollection<Continent>)Enum.GetValues<Continent>()" Clickable="true" MaxItems="_maxItems" SearchBox="_searchBox" @bind-SearchString="@_searchString" />
1313
</MudPaper>
1414

1515
<MudPaper Width="300px" Elevation="0">
1616
<MudText Class="ma-4">Complex Type List</MudText>
17-
<MudListExtended T="ComplexTypes" ItemCollection="_complexTypeCollection" Clickable="true" MaxItems="_maxItems" SearchBox="_searchBox"
17+
<MudListExtended T="ComplexTypes" ItemCollection="_complexTypeCollection" Clickable="true" MaxItems="_maxItems" SearchBox="_searchBox" @bind-SearchString="@_searchString"
1818
ToStringFunc="@(e => e?.Name + " " + e?.SurName)" />
1919
</MudPaper>
2020
</MudItem>
@@ -24,6 +24,7 @@
2424
<MudText>Selected State: @_selectedState</MudText>
2525
<MudNumericField @bind-Value="_maxItems" Label="Max Items" Min="0" Max="16" HelperText="Between 0 - 16" HelperTextOnFocus="true" />
2626
<MudSwitchM3 @bind-Value="_searchBox" Color="Color.Primary" Label="SearchBox" />
27+
<MudTextField Disabled="@(!_searchBox)" Immediate @bind-Value="_searchString" Label="Search String" HelperText="The string used for searching items"/>
2728
</MudStack>
2829
</MudItem>
2930
</MudGrid>
@@ -33,6 +34,7 @@
3334
int _maxItems = 8;
3435
bool _searchBox = false;
3536
string? _selectedState;
37+
string? _searchString;
3638
ICollection<ComplexTypes> _complexTypeCollection = new List<ComplexTypes>()
3739
{
3840
new ComplexTypes() { Name = "John", SurName = "Star" },

CodeBeam.MudBlazor.Extensions.Docs/Pages/Components/ListExtended/Examples/ListExtendedExampleIntro.razor

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@
1111
<MudAlert Class="mud-width-full" Severity="Severity.Success"><b>Feature:</b> Enhanced Keyboard Navigation</MudAlert>
1212
<MudAlert Class="mud-width-full" Severity="Severity.Success"><b>Feature:</b> SearchBox</MudAlert>
1313
<MudAlert Class="mud-width-full" Severity="Severity.Success"><b>Feature:</b> <CodeBlock>MaxItems</CodeBlock> for determining how many items will show</MudAlert>
14+
<MudAlert Class="mud-width-full" Severity="Severity.Success"><b>Feature:</b> <CodeBlock>SearchString</CodeBlock> is now a Parameter</MudAlert>
1415
</MudGrid>

0 commit comments

Comments
 (0)