Skip to content
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
Expand Up @@ -102,6 +102,7 @@ internal override IEnumerable<NavItem> GetNavItems()
new (){ Id = "700", Text = "Breadcrumb Service", Href = DemoRouteConstants.Demos_URL_BreadcrumbService, IconName = IconName.SegmentedNav, ParentId = "7" },
new (){ Id = "701", Text = "Modal Service", Href = DemoRouteConstants.Demos_URL_ModalService, IconName = IconName.WindowStack, ParentId = "7" },
new (){ Id = "702", Text = "Preload Service", Href = DemoRouteConstants.Demos_URL_PreloadService, IconName = IconName.ArrowRepeat, ParentId = "7" },
new (){ Id = "703", Text = "Toast Service", Href = DemoRouteConstants.Demos_URL_ToastService, IconName = IconName.InfoCircleFill, ParentId = "7" },

new(){ Id = "19", Text = "Utilities", IconName = IconName.GearWideConnected, IconColor = IconColor.Info },
new (){ Id = "1900", Text = "Color Utility", Href = DemoRouteConstants.Demos_URL_ColorUtils, IconName = IconName.Palette2, ParentId = "19" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ internal override IEnumerable<NavItem> GetNavItems()
new (){ Id = "700", Text = "Breadcrumb Service", Href = DemoRouteConstants.Docs_URL_BreadcrumbService, IconName = IconName.SegmentedNav, ParentId = "7" },
new (){ Id = "701", Text = "Modal Service", Href = DemoRouteConstants.Docs_URL_ModalService, IconName = IconName.WindowStack, ParentId = "7" },
new (){ Id = "702", Text = "Preload Service", Href = DemoRouteConstants.Docs_URL_PreloadService, IconName = IconName.ArrowRepeat, ParentId = "7" },
new (){ Id = "703", Text = "Toast Service", Href = DemoRouteConstants.Docs_URL_ToastService, IconName = IconName.InfoCircleFill, ParentId = "7" },

//new(){ Id = "19", Text = "Utilities", IconName = IconName.GearWideConnected, IconColor = IconColor.Info },
//new (){ Id = "1900", Text = "Color Utility", Href = DemoRouteConstants.Docs_URL_ColorUtils, IconName = IconName.Palette2, ParentId = "19" },
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
@attribute [Route(pageUrl)]
@layout DocsMainLayout

<DocsPageHeadSection PageUrl="@pageUrl"
PageTitle="@pageTitle"
PageDescription="@pageDescription"
MetaTitle="@metaTitle"
MetaDescription="@metaDescription"
ImageUrl="@imageUrl" />

<DemoLink Href="@DemoRouteConstants.Demos_URL_PreloadService" />

<Section Class="p-0" Size="HeadingSize.H3" Name="Screenshot" PageUrl="@pageUrl" Link="screenshot">
<img src="@imageUrl" class="img-fluid" alt="@metaTitle" />
</Section>

<Section Class="p-0" Size="HeadingSize.H3" Name="ToastService Methods" PageUrl="@pageUrl" Link="toast-service-methods">
<DocxTable TItem="ToastService" DocType="DocType.Methods" />
</Section>

<Section Class="p-0" Size="HeadingSize.H3" Name="ToastMessage Properties" PageUrl="@pageUrl" Link="toast-message-properties">
<DocxTable TItem="ToastMessage" DocType="DocType.Properties" />
</Section>

<Section Class="p-0" Size="HeadingSize.H3" Name="ToastType Enum" PageUrl="@pageUrl" Link="toast-type-enum">
<DocxTable TItem="ToastType" DocType="DocType.Enum" />
</Section>

@code {
private const string componentName = nameof(ToastService);
private const string pageUrl = DemoRouteConstants.Docs_URL_ToastService;
private const string pageTitle = componentName;
private const string pageDescription = $"This documentation provides a comprehensive reference for the <code>{componentName}</code> component, guiding you through its configuration options.";
private const string metaTitle = $"Blazor {componentName} Component";
private const string metaDescription = $"This documentation provides a comprehensive reference for the {componentName} component, guiding you through its configuration options.";
private const string imageUrl = DemoScreenshotSrcConstants.Demos_URL_Toasts;
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,18 @@
<img src="@imageUrl" class="img-fluid" alt="@metaTitle" />
</Section>

<Section Class="p-0" Size="HeadingSize.H3" Name="Parameters" PageUrl="@pageUrl" Link="parameters">
<Section Class="p-0" Size="HeadingSize.H3" Name="Tooltip Parameters" PageUrl="@pageUrl" Link="tooltip-parameters">
<DocxTable TItem="Tooltip" DocType="DocType.Parameters" />
</Section>

<Section Class="p-0" Size="HeadingSize.H3" Name="TooltipColor Enum" PageUrl="@pageUrl" Link="tooltip-color-enum">
<DocxTable TItem="TooltipColor" DocType="DocType.Enum" />
</Section>

<Section Class="p-0" Size="HeadingSize.H3" Name="TooltipPlacement Enum" PageUrl="@pageUrl" Link="tooltip-placement-enum">
<DocxTable TItem="TooltipPlacement" DocType="DocType.Enum" />
</Section>

@code {
private const string componentName = nameof(Tooltip);
private const string pageUrl = DemoRouteConstants.Docs_URL_Tooltips;
Expand Down
2 changes: 2 additions & 0 deletions BlazorBootstrap.Demo.RCL/Constants/DemoRouteConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ public static class DemoRouteConstants
public const string Demos_URL_BreadcrumbService = Demos_URL_Services_Prefix + "/breadcrumb-service";
public const string Demos_URL_ModalService = Demos_URL_Services_Prefix + "/modal-service";
public const string Demos_URL_PreloadService = Demos_URL_Services_Prefix + "/preload-service";
public const string Demos_URL_ToastService = Demos_URL_Services_Prefix + "/toast-service";

// Utilities
public const string Demos_URL_Utils_Prefix = Demos_URL_Prefix + "/utils";
Expand Down Expand Up @@ -200,6 +201,7 @@ public static class DemoRouteConstants
public const string Docs_URL_BreadcrumbService = Docs_URL_Services_Prefix + "/breadcrumb-service";
public const string Docs_URL_ModalService = Docs_URL_Services_Prefix + "/modal-service";
public const string Docs_URL_PreloadService = Docs_URL_Services_Prefix + "/preload-service";
public const string Docs_URL_ToastService = Docs_URL_Services_Prefix + "/toast-service";

// Utilities
public const string Docs_URL_Utils_Prefix = Docs_URL_Prefix + "/utils";
Expand Down
51 changes: 33 additions & 18 deletions blazorbootstrap/Components/Tooltip/Tooltip.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,53 +81,68 @@ public async Task ShowAsync()

/// <summary>
/// Gets or sets the content to be rendered within the component.
/// <para>
/// Default value is <see langword="null"/>.
/// </para>
/// </summary>
/// <remarks>
/// Default value is null.
/// </remarks>
[AddedVersion("1.0.0")]
[DefaultValue(null)]
[Description("Gets or sets the content to be rendered within the component.")]
[Parameter]
public RenderFragment ChildContent { get; set; } = default!;
public RenderFragment? ChildContent { get; set; }

/// <summary>
/// Gets or sets the tooltip color.
/// </summary>
/// <remarks>
/// <para>
/// Default value is <see cref="TooltipColor.None" />.
/// </remarks>
/// </para>
/// </summary>
[AddedVersion("1.10.0")]
[DefaultValue(TooltipColor.None)]
[Description("Gets or sets the tooltip color.")]
[Parameter]
public TooltipColor Color { get; set; } = TooltipColor.None;

private string colorClass => Color.ToTooltipColorClass()!;

/// <summary>
/// Gets or sets a value indicating whether to display the content as HTML instead of text.
/// <para>
/// Default value is <see langword="false"/>.
/// </para>
/// </summary>
/// <remarks>
/// Default value is false.
/// </remarks>
[AddedVersion("2.1.0")]
[DefaultValue(false)]
[Description("Gets or sets a value indicating whether to display the content as HTML instead of text.")]
[Parameter]
public bool IsHtml { get; set; }

private string placement => Placement.ToTooltipPlacementName();

/// <summary>
/// Gets or sets the tooltip placement.
/// </summary>
/// <remarks>
/// <para>
/// Default value is <see cref="TooltipPlacement.Top" />.
/// </remarks>
/// </para>
/// </summary>
[AddedVersion("1.0.0")]
[DefaultValue(TooltipPlacement.Top)]
[Description("Gets or sets the tooltip placement.")]
[Parameter]
public TooltipPlacement Placement { get; set; } = TooltipPlacement.Top;

/// <summary>
/// Displays informative text when users hover, focus, or tap an element.
/// <para>
/// Default value is <see langword="null"/>.
/// </para>
/// </summary>
/// <remarks>
/// Default value is null.
/// </remarks>
[Parameter]
[AddedVersion("1.0.0")]
[DefaultValue(null)]
[Description("Displays informative text when users hover, focus, or tap an element.")]
[EditorRequired]
public string Title { get; set; } = default!;
[Parameter]
public string? Title { get; set; }

#endregion
}
5 changes: 5 additions & 0 deletions blazorbootstrap/Enums/ToastsPlacement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

public enum ToastsPlacement
{
/// <summary>
/// Top left
/// </summary>
[AddedVersion("1.0.0")]
[Description("Top left")]
TopLeft,

/// <summary>
Expand Down
8 changes: 8 additions & 0 deletions blazorbootstrap/Services/ToastService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ public class ToastService

#region Methods

/// <summary>
/// Notifies subscribers of a new toast message event.
/// </summary>
/// <remarks>If no subscribers are registered, this method has no effect. This method is typically used to
/// display transient notifications to users.</remarks>
/// <param name="toastMessage">The toast message to be delivered to all registered listeners. Cannot be null.</param>
[AddedVersion("1.0.0")]
[Description("Notifies subscribers of a new toast message event.")]
public void Notify(ToastMessage toastMessage) => OnNotify?.Invoke(toastMessage);

#endregion
Expand Down
Loading