From 15d3bf62b37301a4240ce7e32925da99ce5b6b8b Mon Sep 17 00:00:00 2001 From: Rhys Koedijk Date: Wed, 4 Nov 2020 23:09:21 +1300 Subject: [PATCH] Added missing Popover passthrough parameters to Menu to allow location anchoring --- Menu/src/Menu/Menu.cs | 37 ++++++++++++++++++++++++++++++++++ Menu/src/Menu/Menu.razor | 5 +++++ Popover/src/Popover/Popover.cs | 2 +- 3 files changed, 43 insertions(+), 1 deletion(-) diff --git a/Menu/src/Menu/Menu.cs b/Menu/src/Menu/Menu.cs index 19c3957..31dcc4c 100644 --- a/Menu/src/Menu/Menu.cs +++ b/Menu/src/Menu/Menu.cs @@ -5,6 +5,7 @@ using Microsoft.AspNetCore.Components.Web; using Skclusive.Core.Component; using Skclusive.Material.Core; +using Skclusive.Material.Popover; namespace Skclusive.Material.Menu { @@ -157,6 +158,42 @@ public MenuComponent() : base("Menu") [Parameter] public VerticalOrigin TransformVerticalOrigin { set; get; } = VerticalOrigin.Top; + /// + /// This is the point on the menu which will attach to the anchor's horizontal origin. + /// + [Parameter] + public double? TransformHorizontalOriginValue { set; get; } + + /// + /// This is the point on the menu which will attach to the anchor's vertical origin. + /// + [Parameter] + public double? TransformVerticalOriginValue { set; get; } + + /// + /// This is the position that may be used + /// to set the left position of the menu. + /// The coordinates are relative to + /// the application's client area. + /// + [Parameter] + public double AnchorLeft { set; get; } + + /// + /// This is the position that may be used + /// to set the top position of the menu. + /// The coordinates are relative to + /// the application's client area. + /// + [Parameter] + public double AnchorTop { set; get; } + + /// + /// This determines which anchor prop to refer to when setting the position of the menu. + /// + [Parameter] + public AnchorType AnchorType { set; get; } = AnchorType.Element; + /// /// Callback fired before the Menu enters. /// diff --git a/Menu/src/Menu/Menu.razor b/Menu/src/Menu/Menu.razor index 541abd3..a45bff5 100644 --- a/Menu/src/Menu/Menu.razor +++ b/Menu/src/Menu/Menu.razor @@ -16,6 +16,11 @@ AnchorHorizontalOrigin="@AnchorHorizontalOrigin" TransformVerticalOrigin="@TransformVerticalOrigin" TransformHorizontalOrigin="@TransformHorizontalOrigin" + TransformHorizontalOriginValue="@TransformHorizontalOriginValue" + TransformVerticalOriginValue="@TransformVerticalOriginValue" + AnchorLeft="@AnchorLeft" + AnchorTop="@AnchorTop" + AnchorType="@AnchorType" TransitionDuration="@TransitionDuration" AppearTimeout="@AppearTimeout" EnterTimeout="@EnterTimeout" diff --git a/Popover/src/Popover/Popover.cs b/Popover/src/Popover/Popover.cs index 0201994..ee9b5a4 100644 --- a/Popover/src/Popover/Popover.cs +++ b/Popover/src/Popover/Popover.cs @@ -255,7 +255,7 @@ public PopoverComponent() : base("Popover") public double AnchorTop { set; get; } /// - /// This determines which anchor prop to refer to to setvthe position of the popover. + /// This determines which anchor prop to refer to when setting the position of the popover. /// [Parameter] public AnchorType AnchorType { set; get; } = AnchorType.Element;