Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
@namespace MudExtensions.UnitTests.TestComponents
<MudPopoverProvider></MudPopoverProvider>

<MudComboBox T="string" @bind-Value="value" Highlight="@Highlight" HighlightClass="@HighlightClass" Required="@Required" RequiredError="Value is required"
Label="@Label" Placeholder="@Placeholder" HelperText="@HelperText" Bordered="@Bordered" Class="@ComboClass" Disabled="@Disabled">
<MudComboBoxItem Value="@("apple")" Text="Apple" />
<MudComboBoxItem Value="@("banana")" Text="Banana" />
<MudComboBoxItem Value="@("cherry")" Text="Cherry" Disabled="true" />
</MudComboBox>

@code {
string? value = null;

[Parameter] public bool Highlight { get; set; }

[Parameter] public string? HighlightClass { get; set; }

[Parameter] public bool Required { get; set; }

[Parameter] public string? Label { get; set; }

[Parameter] public string? Placeholder { get; set; }

[Parameter] public string? HelperText { get; set; }

[Parameter] public bool Bordered { get; set; }

[Parameter] public string? ComboClass { get; set; }

[Parameter] public bool Disabled { get; set; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@namespace MudExtensions.UnitTests.TestComponents
<MudPopoverProvider></MudPopoverProvider>

<MudComboBox T="string" @bind-Value="value" Editable="true" EnableFilter="false">
<MudComboBoxItem Value="@("apple")">apple</MudComboBoxItem>
<MudComboBoxItem Value="@("banana")">banana</MudComboBoxItem>
</MudComboBox>

@code {
string? value = null;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@namespace MudExtensions.UnitTests.TestComponents
<MudPopoverProvider></MudPopoverProvider>

<MudComboBox T="string" @bind-Value="value" ItemPresenter="ValuePresenter.ItemContent" InputPresenter="ValuePresenter.ItemContent">
<ItemTemplate Context="item">
<span class="item-template-marker">@item.Value</span>
</ItemTemplate>
<ChildContent>
<MudComboBoxItem Value="@("apple")"><span class="item-content-marker">apple content</span></MudComboBoxItem>
<MudComboBoxItem Value="@("banana")"><span class="item-content-marker">banana content</span></MudComboBoxItem>
</ChildContent>
</MudComboBox>

@code {
string? value = null;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
@namespace MudExtensions.UnitTests.TestComponents
<MudPopoverProvider></MudPopoverProvider>

<MudComboBox T="string" @bind-Value="value" Editable="@Editable" MultiSelection="@MultiSelection" ShowCheckbox="@ShowCheckbox" Bordered="@Bordered"
SearchFunc="@SearchFunc" HighlightClass="@HighlightClass" Highlight="@Highlight">
<MudComboBoxItem Value="@("apple")" Text="Apple" OnClick="@(() => ClickCount++)" Class="item-apple" />
<MudComboBoxItem Value="@("banana")" Class="item-banana" Ripple="false" />
<MudComboBoxItem Value="@("cherry")" Text="Cherry" Disabled="true" Class="item-cherry" />
<MudComboBoxItem Value="@("date")" Class="item-date" TextColor="Color.Error">
<span class="item-child-marker">date content</span>
</MudComboBoxItem>
</MudComboBox>

@code {
string? value = null;

public int ClickCount { get; set; }

[Parameter] public bool Editable { get; set; }

[Parameter] public bool MultiSelection { get; set; }

[Parameter] public bool ShowCheckbox { get; set; } = true;

[Parameter] public bool Bordered { get; set; }

[Parameter] public bool Highlight { get; set; }

[Parameter] public string? HighlightClass { get; set; }

[Parameter] public Func<string?, string?, string?, bool>? SearchFunc { get; set; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@namespace MudExtensions.UnitTests.TestComponents
<MudPopoverProvider></MudPopoverProvider>

<MudComboBox T="string" @bind-SelectedValues="values" MultiSelection="true" Editable="true" EnableFilter="@EnableFilter">
<NoItemsContent><span class="no-items-marker">Nothing here</span></NoItemsContent>
<ChildContent>
<MudComboBoxItem Value="@("apple")">apple</MudComboBoxItem>
<MudComboBoxItem Value="@("banana")">banana</MudComboBoxItem>
</ChildContent>
</MudComboBox>

@code {
IEnumerable<string> values = new HashSet<string>();

[Parameter]
public bool EnableFilter { get; set; } = true;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@namespace MudExtensions.UnitTests.TestComponents
<MudPopoverProvider></MudPopoverProvider>

<MudComboBox @bind-Value="value" OnOpen="@(() => OpenCount++)" OnClose="@(() => CloseCount++)" Editable="true">
<NoItemsContent><span class="no-items-marker">Nothing here</span></NoItemsContent>
<ChildContent>
<MudComboBoxItem Value="@("apple")">apple</MudComboBoxItem>
<MudComboBoxItem Value="@("banana")">banana</MudComboBoxItem>
</ChildContent>
</MudComboBox>

@code {
string? value = null;

public int OpenCount { get; set; }

public int CloseCount { get; set; }
}
Loading
Loading