Skip to content

Commit

Permalink
BarLink: add missing CustomMatch parameter (#5579)
Browse files Browse the repository at this point in the history
  • Loading branch information
stsrki authored Jun 20, 2024
1 parent e94fa3d commit 1b85253
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@
<DocsAttributesItem Name="Match" Type="Match" Default="Prefix">
URL matching behavior for a link.
</DocsAttributesItem>
<DocsAttributesItem Name="CustomMatch" Type="Func<string, bool>" Default="null">
A callback function that is used to compare current uri with the user defined uri. Must enable <Code>Match="Match.Custom"</Code> to be used.
</DocsAttributesItem>
<DocsAttributesItem Name="CustomMatch" Type="Func<string, bool>" Default="null">
A callback function that is used to compare current uri with the user defined uri. Must enable <Code>Match.Custom</Code> to be used.
</DocsAttributesItem>
Expand Down
2 changes: 1 addition & 1 deletion Source/Blazorise.AntDesign/Components/BarLink.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@inherits Blazorise.BarLink
<Anchor ElementId="@ElementId" Class="@ClassNames" Style="@StyleNames" To="@To" Clicked="@ClickHandler" Target="@Target" Title="@Title" Match="@Match" Attributes="@Attributes">
<Anchor ElementId="@ElementId" Class="@ClassNames" Style="@StyleNames" To="@To" Clicked="@ClickHandler" Target="@Target" Title="@Title" Match="@Match" CustomMatch="@CustomMatch" Attributes="@Attributes">
<span>@ChildContent</span>
</Anchor>
2 changes: 1 addition & 1 deletion Source/Blazorise.Tailwind/Components/BarLink.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@inherits Blazorise.BarLink
<_BarOnlyLink ElementId="@ElementId" Class="@ClassNames" Style="@StyleNames" To="@To" Target="@Target" Title="@Title" Match="@Match" Mode="@ParentBar?.Mode" InsideDropdown="false" Clicked="@ClickHandler" Attributes="@Attributes">
<_BarOnlyLink ElementId="@ElementId" Class="@ClassNames" Style="@StyleNames" To="@To" Target="@Target" Title="@Title" Match="@Match" CustomMatch="@CustomMatch" Mode="@ParentBar?.Mode" InsideDropdown="false" Clicked="@ClickHandler" Attributes="@Attributes">
@ChildContent
</_BarOnlyLink>
@code {
Expand Down
2 changes: 1 addition & 1 deletion Source/Blazorise/Components/Bar/BarLink.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@namespace Blazorise
@inherits BaseComponent
<Anchor ElementId="@ElementId" Class="@ClassNames" Style="@StyleNames" To="@To" Target="@Target" Title="@Title" Match="@Match" Clicked="@ClickHandler" Attributes="@Attributes">
<Anchor ElementId="@ElementId" Class="@ClassNames" Style="@StyleNames" To="@To" Target="@Target" Title="@Title" Match="@Match" CustomMatch="@CustomMatch" Clicked="@ClickHandler" Attributes="@Attributes">
@ChildContent
</Anchor>
6 changes: 6 additions & 0 deletions Source/Blazorise/Components/Bar/BarLink.razor.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#region Using directives
using System;
using System.Threading.Tasks;
using Blazorise.States;
using Blazorise.Utilities;
Expand Down Expand Up @@ -72,6 +73,11 @@ protected Task ClickHandler( MouseEventArgs eventArgs )
/// </summary>
[Parameter] public Match Match { get; set; } = Match.All;

/// <summary>
/// A callback function that is used to compare current uri with the user defined uri. Must enable <see cref="Match.Custom"/> to be used.
/// </summary>
[Parameter] public Func<string, bool> CustomMatch { get; set; }

/// <summary>
/// Specify extra information about the element.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion Source/Extensions/Blazorise.Sidebar/SidebarLink.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@inherits BaseComponent
<Anchor Class="@ClassNames" Style="@StyleNames" To="@To" Target="@Target" Title="@Title" Match="@Match" Clicked="@ClickHandler" Attributes="@LinkAttributes">
<Anchor Class="@ClassNames" Style="@StyleNames" To="@To" Target="@Target" Title="@Title" Match="@Match" CustomMatch="@CustomMatch" Clicked="@ClickHandler" Attributes="@LinkAttributes">
@ChildContent
</Anchor>
6 changes: 6 additions & 0 deletions Source/Extensions/Blazorise.Sidebar/SidebarLink.razor.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#region Using directives
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
Expand Down Expand Up @@ -105,6 +106,11 @@ public bool Visible
/// </summary>
[Parameter] public Match Match { get; set; } = Match.All;

/// <summary>
/// A callback function that is used to compare current uri with the user defined uri. Must enable <see cref="Match.Custom"/> to be used.
/// </summary>
[Parameter] public Func<string, bool> CustomMatch { get; set; }

/// <summary>
/// Specify extra information about the element.
/// </summary>
Expand Down

0 comments on commit 1b85253

Please sign in to comment.