Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add BitLinkTarget (#7966) #7973

Merged
merged 3 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
namespace Bit.BlazorUI;

public class BitLinkTarget
{
/// <summary>
/// The current browsing context. (Default)
/// </summary>
public const string Self = "_self";

/// <summary>
/// Usually a new tab, but users can configure browsers to open a new window instead.
/// </summary>
public const string Blank = "_blank";

/// <summary>
/// The parent browsing context of the current one. If no parent, behaves as _self.
/// </summary>
public const string Parent = "_parent";

/// <summary>
/// The topmost browsing context. To be specific, this means the 'highest' context that's an ancestor of the current one. If no ancestors, behaves as _self.
/// </summary>
public const string Top = "_top";

/// <summary>
/// Allows embedded fenced frames to navigate the top-level frame.
/// </summary>
public const string UnfencedTop = "_unfencedTop";
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

<ComponentDemo ComponentName="Link"
ComponentDescription="Links lead to another part of an app, other pages, or help articles. They can also be used to initiate commands."
ComponentParameters="componentParameters">
ComponentParameters="componentParameters"
ComponentSubClasses="componentSubClasses">
<ComponentExampleBox Title="Basic" RazorCode="@example1RazorCode" Id="example1">
<ExamplePreview>
<div class="example-box">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ public partial class BitLinkDemo
new()
{
Name = "Href",
Type = "string",
DefaultValue = "string.Empty",
Type = "string?",
DefaultValue = "null",
Description = "URL the link points to.",
},
new()
Expand All @@ -40,6 +40,50 @@ public partial class BitLinkDemo
Type = "string?",
DefaultValue = "null",
Description = "If Href provided, specifies how to open the link.",
LinkType = LinkType.Link,
Href = "#link-target",
}
];

private readonly List<ComponentSubClass> componentSubClasses =
[
new()
{
Id = "link-target",
Title = "BitLinkTarget",
Parameters =
[
new()
{
Name = "Self",
Description = "The current browsing context. (Default)",
DefaultValue = "_self",
},
new()
{
Name = "Blank",
Description = "Usually a new tab, but users can configure browsers to open a new window instead.",
DefaultValue = "_blank",
},
new()
{
Name = "Parent",
Description = "The parent browsing context of the current one. If no parent, behaves as _self.",
DefaultValue = "_parent",
},
new()
{
Name = "Top",
Description = "The topmost browsing context. To be specific, this means the 'highest' context that's an ancestor of the current one. If no ancestors, behaves as _self.",
DefaultValue = "_top",
},
new()
{
Name = "UnfencedTop",
Description = "Allows embedded fenced frames to navigate the top-level frame.",
DefaultValue = "_unfencedTop",
}
]
}
];

Expand Down
Loading