diff --git a/BlazorFluentUI/Components/Layout/NavMenu.razor b/BlazorFluentUI/Components/Layout/NavMenu.razor index 6112cd7..e04c768 100644 --- a/BlazorFluentUI/Components/Layout/NavMenu.razor +++ b/BlazorFluentUI/Components/Layout/NavMenu.razor @@ -27,6 +27,7 @@ InputFile Combobox + List diff --git a/BlazorFluentUI/Components/Pages/FormInputs/FormInputCombobox.razor b/BlazorFluentUI/Components/Pages/FormInputs/FormInputCombobox.razor index 2d3d686..afd6ca2 100644 --- a/BlazorFluentUI/Components/Pages/FormInputs/FormInputCombobox.razor +++ b/BlazorFluentUI/Components/Pages/FormInputs/FormInputCombobox.razor @@ -76,7 +76,7 @@ @bind-Value="selectedEmployValue" @bind-SelectedOption="selectedEmployee"> - + @context.FirstName (@context.LastName) diff --git a/BlazorFluentUI/Components/Pages/FormInputs/FormInputList.razor b/BlazorFluentUI/Components/Pages/FormInputs/FormInputList.razor new file mode 100644 index 0000000..392e4d8 --- /dev/null +++ b/BlazorFluentUI/Components/Pages/FormInputs/FormInputList.razor @@ -0,0 +1,135 @@ +@page "/forminputlist" + +@inject EmployeeService employeeService; + +@rendermode RenderMode.InteractiveServer + +Listbox + + + The FluentListbox wrap a web component of a listbox. + + +Manual Example + + + This option has no value + This option is disabled + This option has a value + + + This option has an icon + + +
+ This option is selected by default +
+
+
+ +

Selected: @manualListboxValue

+
+ +Default Example + + +

+ Selected value: @defaultSelectedValue
+ Selected item: @defaultSelectedItem?.ToString(); +

+
+ +From a list of Option<T> + +

From Option<string> items

+ +

+ Selected Value: @stringValue
+ Selected Item
+ Value: @selectedStringOption?.Value (Type: @(selectedStringOption?.GetType()))
+ Text: @selectedStringOption?.Text
+

+ +

From Option<int> items

+ +

+ Selected Value: @intValue
+ Selected Item
+ Value: @selectedIntOption?.Value (Type: @(selectedIntOption?.GetType()))
+ Text: @selectedIntOption?.Text
+

+
+ +Option template + + + + + @context.FirstName (@context.LastName) + + +

+ Selected option: @selectedEmployee?.FirstName @selectedEmployee?.LastName + @if (selectedEmployee != null && selectedEmployee.BirthDate != null) + { + + (@selectedEmployee.BirthDate.ToString("yyyy-MM-dd")) + + } +
+ Selected value: @selectedEmployValue
+ Message: @message; +

+
+ +@code { + string? manualListboxValue; + + Employee? defaultSelectedItem; + string? defaultSelectedValue; + + Option selectedStringOption = default; + string? stringValue; + Option selectedIntOption = default; + string? intValue; + + List> stringOptions = new() + { + { new Option { Value = "1", Text = "One" } }, + { new Option { Value = "2", Text = "Two", Selected = true } }, + { new Option { Value = "3", Text = "Three" } }, + }; + + List> intOptions = new() + { + { new Option { Value = 3, Text = "1", Disabled = true } }, + { new Option { Value = 2, Text = "2" } }, + { new Option { Value = 1, Text = "3" } }, + }; + + Employee selectedEmployee = default!; + string? selectedEmployValue; + string? message; +} diff --git a/BlazorFluentUI/wwwroot/images/korean_flag_64.png b/BlazorFluentUI/wwwroot/images/korean_flag_64.png new file mode 100644 index 0000000..977ee37 Binary files /dev/null and b/BlazorFluentUI/wwwroot/images/korean_flag_64.png differ