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 @@ -18,10 +18,18 @@
<DocxTable TItem="Toasts" DocType="DocType.Parameters" />
</Section>

<Section Class="p-0" Size="HeadingSize.H3" Name="ToastsPlacement Enum" PageUrl="@pageUrl" Link="toasts-placement-enum">
<DocxTable TItem="ToastsPlacement" DocType="DocType.Enum" />
</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(Toasts);
private const string pageUrl = DemoRouteConstants.Docs_URL_Toasts;
Expand Down
14 changes: 10 additions & 4 deletions blazorbootstrap/Components/ThemeSwitcher/ThemeSwitcher.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,25 @@ public async Task OnThemeChangedJS(string themeName)
/// <summary>
/// Fired when the theme is changed.
/// </summary>
[AddedVersion("3.2.0")]
[Description("Fired when the theme is changed.")]
[Parameter]
public EventCallback<string> OnThemeChanged { get; set; }

/// <summary>
/// Gets or sets the dropdown menu position.
/// </summary>
/// <remarks>
/// <para>
/// Default value is <see cref="DropdownMenuPosition.Start" />.
/// </remarks>
/// </para>
/// </summary>
[AddedVersion("3.2.0")]
[DefaultValue(DropdownMenuPosition.Start)]
[Description("Gets or sets the dropdown menu position.")]
[Parameter]
public DropdownMenuPosition Position { get; set; } = DropdownMenuPosition.Start;

[Inject] private ThemeSwitcherJsInterop ThemeSwitcherJsInterop { get; set; } = default!;
[Inject]
private ThemeSwitcherJsInterop ThemeSwitcherJsInterop { get; set; } = default!;

#endregion
}
24 changes: 12 additions & 12 deletions blazorbootstrap/Components/Toasts/SimpleToast.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,21 @@ protected override async Task OnInitializedAsync()

/// <summary>
/// Gets or sets the auto hide state.
/// <para>
/// Default value is <see langword="true"/>.
/// </para>
/// </summary>
/// <remarks>
/// Default value is true.
/// </remarks>
[Parameter]
public bool AutoHide { get; set; } = true;

private string CloseButtonClass => $"btn-close-{ToastMessage!.Type.ToToastTextColorClass()}";

/// <summary>
/// Gets or sets the delay in milliseconds before hiding the toast.
/// </summary>
/// <remarks>
/// <para>
/// Default value is 5000.
/// </remarks>
/// </para>
/// </summary>
[Parameter]
public int Delay { get; set; } = 5000;

Expand All @@ -103,10 +103,10 @@ protected override async Task OnInitializedAsync()

/// <summary>
/// If <see langword="true" />, shows the close button.
/// <para>
/// Default value is <see langword="true"/>.
/// </para>
/// </summary>
/// <remarks>
/// Default value is true.
/// </remarks>
[Parameter]
public bool ShowCloseButton { get; set; } = true;

Expand All @@ -124,10 +124,10 @@ protected override async Task OnInitializedAsync()

/// <summary>
/// Gets or sets the toast message.
/// <para>
/// Default value is <see langword="null"/>.
/// </para>
/// </summary>
/// <remarks>
/// Default value is null.
/// </remarks>
[Parameter]
public ToastMessage? ToastMessage { get; set; }

Expand Down
24 changes: 12 additions & 12 deletions blazorbootstrap/Components/Toasts/Toast.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,19 +153,19 @@ private IconName GetToastIconName() =>

/// <summary>
/// Gets or sets the auto hide state.
/// <para>
/// Default value is <see langword="false"/>.
/// </para>
/// </summary>
/// <remarks>
/// Default value is false.
/// </remarks>
[Parameter]
public bool AutoHide { get; set; }

/// <summary>
/// Gets or sets the delay in milliseconds before hiding the toast.
/// </summary>
/// <remarks>
/// <para>
/// Default value is 5000.
/// </remarks>
/// </para>
/// </summary>
[Parameter]
public int Delay { get; set; } = 5000;

Expand All @@ -189,10 +189,10 @@ private IconName GetToastIconName() =>

/// <summary>
/// If <see langword="true" />, shows the close button.
/// <para>
/// Default value is <see langword="true"/>.
/// </para>
/// </summary>
/// <remarks>
/// Default value is true.
/// </remarks>
[Parameter]
public bool ShowCloseButton { get; set; } = true;

Expand All @@ -210,10 +210,10 @@ private IconName GetToastIconName() =>

/// <summary>
/// Gets or sets the toast message.
/// <para>
/// Default value is <see langword="null"/>.
/// </para>
/// </summary>
/// <remarks>
/// Default value is null.
/// </remarks>
[Parameter]
public ToastMessage ToastMessage { get; set; } = default!;

Expand Down
59 changes: 39 additions & 20 deletions blazorbootstrap/Components/Toasts/Toasts.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,59 +90,78 @@ private async Task OnToastShownAsync(ToastEventArgs args)

/// <summary>
/// Gets or sets the auto hide state.
/// <para>
/// Default value is <see langword="false"/>.
/// </para>
/// </summary>
/// <remarks>
/// Default value is false.
/// </remarks>
[AddedVersion("1.0.0")]
[DefaultValue(false)]
[Description("Gets or sets the auto hide state.")]
[Parameter]
public bool AutoHide { get; set; }

/// <summary>
/// Gets or sets the delay in milliseconds before hiding the toast.
/// </summary>
/// <remarks>
/// <para>
/// Default value is 5000.
/// </remarks>
/// </para>
/// </summary>
[AddedVersion("1.0.0")]
[DefaultValue(5000)]
[Description("Gets or sets the delay in milliseconds before hiding the toast.")]
[Parameter]
public int Delay { get; set; } = 5000;

/// <summary>
/// Gets or sets the toast messages.
/// <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 toast messages.")]
[Parameter]
public List<ToastMessage>? Messages { get; set; } = default!;
public List<ToastMessage>? Messages { get; set; }

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

/// <summary>
/// If <see langword="true" />, shows the close button.
/// <para>
/// Default value is <see langword="true"/>.
/// </para>
/// </summary>
/// <remarks>
/// Default value is true.
/// </remarks>
[AddedVersion("1.0.0")]
[DefaultValue(true)]
[Description("If <b>true</b>, shows the close button.")]
[Parameter]
public bool ShowCloseButton { get; set; } = true;

/// <summary>
/// Gets or sets the toast container maximum capacity.
/// </summary>
/// <remarks>
/// <para>
/// Default value is 5.
/// </remarks>
/// </para>
/// </summary>
[AddedVersion("1.0.0")]
[DefaultValue(5)]
[Description("Gets or sets the toast container maximum capacity.")]
[Parameter]
public int StackLength { get; set; } = 5;

[Inject] public ToastService ToastService { get; set; } = default!;
[Inject]
public ToastService ToastService { get; set; } = default!;

#endregion
}
32 changes: 24 additions & 8 deletions blazorbootstrap/Enums/ToastType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,59 @@
public enum ToastType
{
/// <summary>
/// Primary background color.
/// Sets the primary background color to the toast.
/// </summary>
[AddedVersion("1.0.0")]
[Description("Sets the primary background color to the toast.")]
Primary = 1,

/// <summary>
/// Secondary background color.
/// Sets the secondary background color to the toast.
/// </summary>
[AddedVersion("1.0.0")]
[Description("Sets the secondary background color to the toast.")]
Secondary,

/// <summary>
/// Success background color.
/// Sets the success background color to the toast.
/// </summary>
[AddedVersion("1.0.0")]
[Description("Sets the success background color to the toast.")]
Success,

/// <summary>
/// Danger background color.
/// Sets the danger background color to the toast.
/// </summary>
[AddedVersion("1.0.0")]
[Description("Sets the danger background color to the toast.")]
Danger,

/// <summary>
/// Warning background color.
/// Sets the warning background color to the toast.
/// </summary>
[AddedVersion("1.0.0")]
[Description("Sets the warning background color to the toast.")]
Warning,

/// <summary>
/// Info background color.
/// Sets the info background color to the toast.
/// </summary>
[AddedVersion("1.0.0")]
[Description("Sets the info background color to the toast.")]
Info,

/// <summary>
/// Light background color.
/// Sets the light background color to the toast.
/// </summary>
[AddedVersion("1.0.0")]
[Description("Sets the light background color to the toast.")]
Light,

/// <summary>
/// Dark background color.
/// Sets the dark background color to the toast.
/// </summary>
[AddedVersion("1.0.0")]
[Description("Sets the dark background color to the toast.")]
Dark

// TODO: Review
Expand Down
16 changes: 16 additions & 0 deletions blazorbootstrap/Enums/ToastsPlacement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,56 @@ public enum ToastsPlacement
/// <summary>
/// Top center
/// </summary>
[AddedVersion("1.0.0")]
[Description("Top center")]
TopCenter,

/// <summary>
/// Top right
/// </summary>
[AddedVersion("1.0.0")]
[Description("Top right")]
TopRight,

/// <summary>
/// Middle left
/// </summary>
[AddedVersion("1.0.0")]
[Description("Middle left")]
MiddleLeft,

/// <summary>
/// Middle center
/// </summary>
[AddedVersion("1.0.0")]
[Description("Middle center")]
MiddleCenter,

/// <summary>
/// Middle right
/// </summary>
[AddedVersion("1.0.0")]
[Description("Middle right")]
MiddleRight,

/// <summary>
/// Bottom left
/// </summary>
[AddedVersion("1.0.0")]
[Description("Bottom left")]
BottomLeft,

/// <summary>
/// Bottom center
/// </summary>
[AddedVersion("1.0.0")]
[Description("Bottom center")]
BottomCenter,

/// <summary>
/// Bottom right
/// </summary>
[AddedVersion("1.0.0")]
[Description("Bottom right")]
BottomRight
}
Loading
Loading