[Menu] Pass through more parameters to region the menu is anchored to (#2579)

* Pass HorizintalViewportLock and HorizontalScaling through to AnchoredRegion

* Add new menu params to provider
This commit is contained in:
Vincent Baaij 2024-08-25 12:15:44 +02:00 коммит произвёл GitHub
Родитель 463dd05b7b
Коммит d0ce14d920
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
4 изменённых файлов: 39 добавлений и 13 удалений

Просмотреть файл

@ -5983,7 +5983,7 @@
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentMenu.HorizontalInset">
<summary>
Gets or sets a value indicating whether the region overlaps the anchor on the horizontal axis.
Gets or sets a value indicating whether the region overlaps the anchor on the horizontal axis.
Default is false which places the region adjacent to the anchor element.
</summary>
</member>
@ -6023,6 +6023,17 @@
Gets or sets how narrow the space allocated to the default position has to be before the widest area is selected for layout.
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentMenu.HorizontalViewportLock">
<summary>
Gets or sets the Horizontal viewport lock.
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentMenu.HorizontalScaling">
<summary>
Gets or sets the horizontal scaling mode.
</summary>
[Parameter]
</member>
<member name="M:Microsoft.FluentUI.AspNetCore.Components.FluentMenu.OnAfterRenderAsync(System.Boolean)">
<summary />
</member>

Просмотреть файл

@ -11,11 +11,12 @@
<FluentOverlay @bind-Visible="@Open" OnClose="@CloseAsync" Transparent="true" FullScreen="true" />
<FluentAnchoredRegion Anchor="@Anchor"
HorizontalDefaultPosition="@HorizontalPosition"
VerticalDefaultPosition="@VerticalPosition"
HorizontalInset="@HorizontalInset"
VerticalInset="@VerticalInset"
HorizontalViewportLock="true"
HorizontalScaling="@HorizontalScaling"
HorizontalThreshold="@HorizontalThreshold"
HorizontalViewportLock="@HorizontalViewportLock"
VerticalDefaultPosition="@VerticalPosition"
VerticalInset="@VerticalInset"
VerticalThreshold="@VerticalThreshold"
Shadow="@ElevationShadow.None"
Class="@ClassValue"

Просмотреть файл

@ -112,7 +112,7 @@ public partial class FluentMenu : FluentComponentBase, IDisposable
public HorizontalPosition HorizontalPosition { get; set; } = HorizontalPosition.Unset;
/// <summary>
/// Gets or sets a value indicating whether the region overlaps the anchor on the horizontal axis.
/// Gets or sets a value indicating whether the region overlaps the anchor on the horizontal axis.
/// Default is false which places the region adjacent to the anchor element.
/// </summary>
[Parameter]
@ -161,6 +161,18 @@ public partial class FluentMenu : FluentComponentBase, IDisposable
[Parameter]
public int HorizontalThreshold { get; set; } = 200;
/// <summary>
/// Gets or sets the Horizontal viewport lock.
/// </summary>
[Parameter]
public bool HorizontalViewportLock { get; set; }
/// <summary>
/// Gets or sets the horizontal scaling mode.
/// </summary>
/// [Parameter]
public AxisScalingMode? HorizontalScaling { get; set; }
protected override void OnInitialized()
{
if (Anchored && string.IsNullOrEmpty(Anchor))

Просмотреть файл

@ -7,26 +7,28 @@
@foreach (var item in Menus)
{
<FluentMenu UseMenuService="false"
Id="@item.Id"
Anchor="@item.Anchor"
Anchored="@item.Anchored"
Class="@Class"
Style="@Style"
Id="@item.Id"
Width="@item.Width"
Open="@item.Open"
OpenChanged="@item.OpenChanged"
VerticalThreshold="@item.VerticalThreshold"
HorizontalThreshold="@item.HorizontalThreshold"
AdditionalAttributes="@item.AdditionalAttributes"
Data="@item.Data"
HorizontalInset="@item.HorizontalInset"
HorizontalPosition="@item.HorizontalPosition"
ParentReference="@item.ParentReference"
Trigger="@item.Trigger"
HorizontalInset="@item.HorizontalInset"
HorizontalPosition="@item.HorizontalPosition"
HorizontalScaling="@item.HorizontalScaling"
HorizontalThreshold="@item.HorizontalThreshold"
HorizontalViewportLock="@item.HorizontalViewportLock"
VerticalInset="@item.VerticalInset"
VerticalPosition="@item.VerticalPosition"
Width="@item.Width">
VerticalThreshold="@item.VerticalThreshold"
AdditionalAttributes="@item.AdditionalAttributes">
@item.ChildContent
</FluentMenu>
</FluentMenu>
}
}
</div>