-
-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[HxMultiSelect] Adds Floating Label type to MultiSelect component (#899)
* Adds Floating label type to MultiSelect * Adds floating label type to MultiSelect * reverted basic demo + separate testing page * CSS class moved to outermost element, CssClassHelper usage * RenderOrder override consolidation * HxFormValueComponentRenderer_Label usage (instead of direct <label> rendering) * doc - add HxMultiSelect to list of components supporting floating labels --------- Co-authored-by: Robert Haken <[email protected]>
- Loading branch information
1 parent
8aa6521
commit 0c99e76
Showing
7 changed files
with
108 additions
and
15 deletions.
There are no files selected for viewing
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
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
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
45 changes: 45 additions & 0 deletions
45
...App/Havit.Blazor.TestApp.Client/HxMultiSelectTests/HxMultiSelect_FloatingLabel_Test.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,45 @@ | ||
@page "/HxMultiSelect_FloatingLabel" | ||
@rendermode InteractiveServer | ||
@inject IDemoDataService DemoDataService | ||
|
||
<div class="m-3"> | ||
|
||
<HxMultiSelect Label="HxMultiSelect" | ||
TItem="EmployeeDto" | ||
TValue="int" | ||
Data="@employees" | ||
LabelType="LabelType.Floating" | ||
@bind-Value="selectedEmployeeIds" | ||
TextSelector="@(p => p.Name)" | ||
ValueSelector="@(p => p.Id)" | ||
NullDataText="Loading employees..." | ||
EmptyText="-select employees-" /> | ||
|
||
For visual reference: | ||
<HxSelect TItem="EmployeeDto" | ||
TValue="int?" | ||
Label="HxSelect" | ||
LabelType="LabelType.Floating" | ||
Data="employees" | ||
@bind-Value="selectedEmployeeId" | ||
TextSelector="@(employee => employee.Name)" | ||
ValueSelector="@(employee => employee.Id)" | ||
Nullable="true" | ||
NullText="-select employee-" | ||
NullDataText="Loading employees..." /> | ||
|
||
</div> | ||
|
||
|
||
<p class="mt-3">Selected employees (IDs): @String.Join(", ", selectedEmployeeIds.Select(e => e.ToString()))</p> | ||
|
||
@code { | ||
private IEnumerable<EmployeeDto> employees; | ||
private List<int> selectedEmployeeIds = new(); | ||
private int? selectedEmployeeId; | ||
|
||
protected override async Task OnInitializedAsync() | ||
{ | ||
employees = await DemoDataService.GetAllEmployeesAsync(); | ||
} | ||
} |