-
Notifications
You must be signed in to change notification settings - Fork 363
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FluentNavMenu binding support (#522)
* two way binding on Expanded * Events not propagating, but click not toggling group expansion * WIP * Complete * Completed * Nearly working * Merge from upstream * WIP * WIP * Remove FindElementById * Remove SetExpanded * Change ParentElement to Owner * Get rid of AutoExpandOnGroupExpanded * Works in demos, but not in nav menu * Only select a single item * All working * Working all round, just not expanding groups * Finally fixed!!!! * Remove .orig files * It works!!! * Possibly working * WIP * WIP * Nearly there (new approach) * Undo CSS changes * WIP * Frozen * Tree fixed Fully working! * Working! * No need for custom event * Code formatting --------- Co-authored-by: Vincent Baaij <[email protected]>
- Loading branch information
Showing
17 changed files
with
498 additions
and
325 deletions.
There are no files selected for viewing
60 changes: 60 additions & 0 deletions
60
examples/Demo/Shared/Pages/NavMenu/Examples/NavMenuDataBound.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,60 @@ | ||
@namespace FluentUI.Demo.Shared | ||
|
||
@inject ILogger<NavMenuDefault> logger; | ||
|
||
<h2>Navigation Examples</h2> | ||
|
||
<FluentStack Orientation="Orientation.Horizontal"> | ||
<!-- Menu with sub-items and icons --> | ||
<FluentNavMenu @bind-Expanded=MenuExpanded> | ||
<FluentNavMenuGroup Id="Group1" Text="Item 1" @bind-Expanded=Item1Expanded Icon="@(new Icons.Regular.Size24.LeafOne())"> | ||
<FluentNavMenuLink Text="Item 1.1" Icon="@(new Icons.Regular.Size24.LeafOne())" @bind-Selected=Item1Point1Selected /> | ||
<FluentNavMenuLink Text="Item 1.2" Icon="@(new Icons.Regular.Size24.LeafTwo())" @bind-Selected=Item1Point2Selected /> | ||
</FluentNavMenuGroup> | ||
<FluentNavMenuGroup Id="Group2" Text="Item 2" @bind-Expanded=Item2Expanded Icon="@(new Icons.Regular.Size24.LeafTwo())"> | ||
<FluentNavMenuLink Text="Item 2.1" Icon="@(new Icons.Regular.Size24.LeafOne())" @bind-Selected=Item2Point1Selected /> | ||
<FluentNavMenuLink Text="Item 2.2" Icon="@(new Icons.Regular.Size24.LeafTwo())" @bind-Selected=Item2Point2Selected /> | ||
</FluentNavMenuGroup> | ||
</FluentNavMenu> | ||
<FluentStack Orientation="Orientation.Vertical"> | ||
|
||
<h2>Expanded elements</h2> | ||
<FluentCheckbox @bind-Value=MenuExpanded> | ||
<span aria-label="Menu expanded">Menu</span> | ||
</FluentCheckbox> | ||
<FluentCheckbox @bind-Value=Item1Expanded> | ||
<span aria-label="Item 1 expanded">Item 1</span> | ||
</FluentCheckbox> | ||
<FluentCheckbox @bind-Value=Item2Expanded> | ||
<span aria-label="Item 2 expanded">Item 2</span> | ||
</FluentCheckbox> | ||
|
||
<h2>Selected elements</h2> | ||
<FluentCheckbox @bind-Value=Item1Point1Selected> | ||
<span aria-label="Item 1.1 selected">Item 1.1</span> | ||
</FluentCheckbox> | ||
<FluentCheckbox @bind-Value=Item1Point2Selected> | ||
<span aria-label="Item 1.2 selected">Item 1.2</span> | ||
</FluentCheckbox> | ||
<FluentCheckbox @bind-Value=Item2Point1Selected> | ||
<span aria-label="Item 2.1 selected">Item 2.1</span> | ||
</FluentCheckbox> | ||
<FluentCheckbox @bind-Value=Item2Point2Selected> | ||
<span aria-label="Item 2.2 selected">Item 2.2</span> | ||
</FluentCheckbox> | ||
|
||
</FluentStack> | ||
</FluentStack> | ||
|
||
@code { | ||
bool MenuExpanded = true; | ||
bool Item1Expanded = true; | ||
bool Item2Expanded = true; | ||
|
||
bool Item1Point1Selected = false; | ||
bool Item1Point2Selected = false; | ||
bool Item2Point1Selected = false; | ||
bool Item2Point2Selected = false; | ||
} | ||
|
||
|
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
4 changes: 2 additions & 2 deletions
4
examples/Demo/Shared/Pages/TreeView/Examples/TreeViewDisabledItem.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
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
60 changes: 60 additions & 0 deletions
60
examples/FluentUI.Demo.Shared/wwwroot/sources/NavMenuDataBound.razor.txt
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,60 @@ | ||
@namespace FluentUI.Demo.Shared | ||
|
||
@inject ILogger<NavMenuDefault> logger; | ||
|
||
<h2>Navigation Examples</h2> | ||
|
||
<FluentStack Orientation="Orientation.Horizontal"> | ||
<!-- Menu with sub-items and icons --> | ||
<FluentNavMenu @bind-Expanded=MenuExpanded> | ||
<FluentNavMenuGroup Id="Group1" Text="Item 1" @bind-Expanded=Item1Expanded Icon="@(new Icons.Regular.Size24.LeafOne())"> | ||
<FluentNavMenuLink Text="Item 1.1" Icon="@(new Icons.Regular.Size24.LeafOne())" @bind-Selected=Item1Point1Selected /> | ||
<FluentNavMenuLink Text="Item 1.2" Icon="@(new Icons.Regular.Size24.LeafTwo())" @bind-Selected=Item1Point2Selected /> | ||
</FluentNavMenuGroup> | ||
<FluentNavMenuGroup Id="Group2" Text="Item 2" @bind-Expanded=Item2Expanded Icon="@(new Icons.Regular.Size24.LeafTwo())"> | ||
<FluentNavMenuLink Text="Item 2.1" Icon="@(new Icons.Regular.Size24.LeafOne())" @bind-Selected=Item2Point1Selected /> | ||
<FluentNavMenuLink Text="Item 2.2" Icon="@(new Icons.Regular.Size24.LeafTwo())" @bind-Selected=Item2Point2Selected /> | ||
</FluentNavMenuGroup> | ||
</FluentNavMenu> | ||
<FluentStack Orientation="Orientation.Vertical"> | ||
|
||
<h2>Expanded elements</h2> | ||
<FluentCheckbox @bind-Value=MenuExpanded> | ||
<span aria-label="Menu expanded">Menu</span> | ||
</FluentCheckbox> | ||
<FluentCheckbox @bind-Value=Item1Expanded> | ||
<span aria-label="Item 1 expanded">Item 1</span> | ||
</FluentCheckbox> | ||
<FluentCheckbox @bind-Value=Item2Expanded> | ||
<span aria-label="Item 2 expanded">Item 2</span> | ||
</FluentCheckbox> | ||
|
||
<h2>Selected elements</h2> | ||
<FluentCheckbox @bind-Value=Item1Point1Selected> | ||
<span aria-label="Item 1.1 selected">Item 1.1</span> | ||
</FluentCheckbox> | ||
<FluentCheckbox @bind-Value=Item1Point2Selected> | ||
<span aria-label="Item 1.2 selected">Item 1.2</span> | ||
</FluentCheckbox> | ||
<FluentCheckbox @bind-Value=Item2Point1Selected> | ||
<span aria-label="Item 2.1 selected">Item 2.1</span> | ||
</FluentCheckbox> | ||
<FluentCheckbox @bind-Value=Item2Point2Selected> | ||
<span aria-label="Item 2.2 selected">Item 2.2</span> | ||
</FluentCheckbox> | ||
|
||
</FluentStack> | ||
</FluentStack> | ||
|
||
@code { | ||
bool MenuExpanded = true; | ||
bool Item1Expanded = true; | ||
bool Item2Expanded = true; | ||
|
||
bool Item1Point1Selected = false; | ||
bool Item1Point2Selected = false; | ||
bool Item2Point1Selected = false; | ||
bool Item2Point2Selected = false; | ||
} | ||
|
||
|
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
Oops, something went wrong.