-
Notifications
You must be signed in to change notification settings - Fork 401
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add OptionTemplate parameter for list components + examples (#1045)
- Loading branch information
Showing
14 changed files
with
138 additions
and
30 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
17 changes: 17 additions & 0 deletions
17
examples/Demo/Shared/Pages/Combobox/Examples/ComboboxWithOptionTemplate.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,17 @@ | ||
@inject DataSource Data | ||
|
||
<FluentCombobox Items="@Data.People" | ||
OptionValue="@(i => i.PersonId.ToString())" | ||
@bind-SelectedOption=@Person> | ||
<OptionTemplate> | ||
<FluentIcon Value="@(new Icons.Regular.Size16.Person())" Slot="end" OnClick="@(() => DemoLogger.WriteLine($"Icon for {@context.LastName} selected"))" /> | ||
@context.FirstName (@context.LastName) | ||
</OptionTemplate> | ||
</FluentCombobox> | ||
<p> | ||
Selected: @Person?.FirstName (@Person?.LastName) | ||
</p> | ||
|
||
@code { | ||
public Person Person { get; set; } = default!; | ||
} |
17 changes: 17 additions & 0 deletions
17
examples/Demo/Shared/Pages/Listbox/Examples/ListboxWithOptionTemplate.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,17 @@ | ||
@inject DataSource Data | ||
|
||
<FluentListbox Items="@Data.People" | ||
OptionValue="@(i => i.PersonId.ToString())" | ||
@bind-SelectedOption=@Person> | ||
<OptionTemplate> | ||
<FluentIcon Icon="Icons.Regular.Size16.Person" Slot="end" OnClick="@(() => DemoLogger.WriteLine($"Icon for {@context.LastName} selected"))" /> | ||
@context.FirstName (@context.LastName) | ||
</OptionTemplate> | ||
</FluentListbox> | ||
<p> | ||
Selected: @Person?.FirstName (@Person?.LastName) | ||
</p> | ||
|
||
@code { | ||
public Person Person { get; set; } = default!; | ||
} |
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
19 changes: 19 additions & 0 deletions
19
examples/Demo/Shared/Pages/Select/Examples/SelectWithOptionTemplate.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,19 @@ | ||
@using FluentUI.Demo.Shared.SampleData | ||
@inject DataSource Data | ||
|
||
<FluentSelect Items="@Data.People" | ||
OptionValue="@(i => i.PersonId.ToString())" | ||
@bind-SelectedOption=@Person> | ||
<OptionTemplate> | ||
<FluentIcon Icon="Icons.Regular.Size16.Person" Slot="end" OnClick="@(() => DemoLogger.WriteLine($"Icon for {@context.LastName} selected"))" /> | ||
@context.FirstName (@context.LastName) | ||
</OptionTemplate> | ||
</FluentSelect> | ||
|
||
<p> | ||
Selected: @Person?.FirstName (@Person?.LastName) | ||
</p> | ||
|
||
@code { | ||
public Person Person { get; set; } = default!; | ||
} |
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
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