diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Toasts/Toasts_Doc_01_Documentation.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Toasts/Toasts_Doc_01_Documentation.razor index 5bbc9d535..bc68c190b 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Toasts/Toasts_Doc_01_Documentation.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Toasts/Toasts_Doc_01_Documentation.razor @@ -18,10 +18,18 @@ +
+ +
+
+
+ +
+ @code { private const string componentName = nameof(Toasts); private const string pageUrl = DemoRouteConstants.Docs_URL_Toasts; diff --git a/blazorbootstrap/Components/ThemeSwitcher/ThemeSwitcher.razor.cs b/blazorbootstrap/Components/ThemeSwitcher/ThemeSwitcher.razor.cs index 051c7272e..429be2d4f 100644 --- a/blazorbootstrap/Components/ThemeSwitcher/ThemeSwitcher.razor.cs +++ b/blazorbootstrap/Components/ThemeSwitcher/ThemeSwitcher.razor.cs @@ -53,19 +53,25 @@ public async Task OnThemeChangedJS(string themeName) /// /// Fired when the theme is changed. /// + [AddedVersion("3.2.0")] + [Description("Fired when the theme is changed.")] [Parameter] public EventCallback OnThemeChanged { get; set; } /// /// Gets or sets the dropdown menu position. - /// - /// + /// /// Default value is . - /// + /// + /// + [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 } diff --git a/blazorbootstrap/Components/Toasts/SimpleToast.razor.cs b/blazorbootstrap/Components/Toasts/SimpleToast.razor.cs index 18367df74..6bce92ce9 100644 --- a/blazorbootstrap/Components/Toasts/SimpleToast.razor.cs +++ b/blazorbootstrap/Components/Toasts/SimpleToast.razor.cs @@ -71,10 +71,10 @@ protected override async Task OnInitializedAsync() /// /// Gets or sets the auto hide state. + /// + /// Default value is . + /// /// - /// - /// Default value is true. - /// [Parameter] public bool AutoHide { get; set; } = true; @@ -82,10 +82,10 @@ protected override async Task OnInitializedAsync() /// /// Gets or sets the delay in milliseconds before hiding the toast. - /// - /// + /// /// Default value is 5000. - /// + /// + /// [Parameter] public int Delay { get; set; } = 5000; @@ -103,10 +103,10 @@ protected override async Task OnInitializedAsync() /// /// If , shows the close button. + /// + /// Default value is . + /// /// - /// - /// Default value is true. - /// [Parameter] public bool ShowCloseButton { get; set; } = true; @@ -124,10 +124,10 @@ protected override async Task OnInitializedAsync() /// /// Gets or sets the toast message. + /// + /// Default value is . + /// /// - /// - /// Default value is null. - /// [Parameter] public ToastMessage? ToastMessage { get; set; } diff --git a/blazorbootstrap/Components/Toasts/Toast.razor.cs b/blazorbootstrap/Components/Toasts/Toast.razor.cs index c013f7979..58f33c8cc 100644 --- a/blazorbootstrap/Components/Toasts/Toast.razor.cs +++ b/blazorbootstrap/Components/Toasts/Toast.razor.cs @@ -153,19 +153,19 @@ private IconName GetToastIconName() => /// /// Gets or sets the auto hide state. + /// + /// Default value is . + /// /// - /// - /// Default value is false. - /// [Parameter] public bool AutoHide { get; set; } /// /// Gets or sets the delay in milliseconds before hiding the toast. - /// - /// + /// /// Default value is 5000. - /// + /// + /// [Parameter] public int Delay { get; set; } = 5000; @@ -189,10 +189,10 @@ private IconName GetToastIconName() => /// /// If , shows the close button. + /// + /// Default value is . + /// /// - /// - /// Default value is true. - /// [Parameter] public bool ShowCloseButton { get; set; } = true; @@ -210,10 +210,10 @@ private IconName GetToastIconName() => /// /// Gets or sets the toast message. + /// + /// Default value is . + /// /// - /// - /// Default value is null. - /// [Parameter] public ToastMessage ToastMessage { get; set; } = default!; diff --git a/blazorbootstrap/Components/Toasts/Toasts.razor.cs b/blazorbootstrap/Components/Toasts/Toasts.razor.cs index f3d96dc78..7cc1eb7e1 100644 --- a/blazorbootstrap/Components/Toasts/Toasts.razor.cs +++ b/blazorbootstrap/Components/Toasts/Toasts.razor.cs @@ -90,59 +90,78 @@ private async Task OnToastShownAsync(ToastEventArgs args) /// /// Gets or sets the auto hide state. + /// + /// Default value is . + /// /// - /// - /// Default value is false. - /// + [AddedVersion("1.0.0")] + [DefaultValue(false)] + [Description("Gets or sets the auto hide state.")] [Parameter] public bool AutoHide { get; set; } /// /// Gets or sets the delay in milliseconds before hiding the toast. - /// - /// + /// /// Default value is 5000. - /// + /// + /// + [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; /// /// Gets or sets the toast messages. + /// + /// Default value is . + /// /// - /// - /// Default value is null. - /// + [AddedVersion("1.0.0")] + [DefaultValue(null)] + [Description("Gets or sets the toast messages.")] [Parameter] - public List? Messages { get; set; } = default!; + public List? Messages { get; set; } /// /// Gets or sets the toast placement. - /// - /// + /// /// Default value is . - /// + /// + /// + [AddedVersion("1.0.0")] + [DefaultValue(ToastsPlacement.TopRight)] + [Description("Gets or sets the toast placement.")] [Parameter] public ToastsPlacement Placement { get; set; } = ToastsPlacement.TopRight; /// /// If , shows the close button. + /// + /// Default value is . + /// /// - /// - /// Default value is true. - /// + [AddedVersion("1.0.0")] + [DefaultValue(true)] + [Description("If true, shows the close button.")] [Parameter] public bool ShowCloseButton { get; set; } = true; /// /// Gets or sets the toast container maximum capacity. - /// - /// + /// /// Default value is 5. - /// + /// + /// + [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 } diff --git a/blazorbootstrap/Enums/ToastType.cs b/blazorbootstrap/Enums/ToastType.cs index 9f4363c33..5c0ea69a1 100644 --- a/blazorbootstrap/Enums/ToastType.cs +++ b/blazorbootstrap/Enums/ToastType.cs @@ -3,43 +3,59 @@ public enum ToastType { /// - /// Primary background color. + /// Sets the primary background color to the toast. /// + [AddedVersion("1.0.0")] + [Description("Sets the primary background color to the toast.")] Primary = 1, /// - /// Secondary background color. + /// Sets the secondary background color to the toast. /// + [AddedVersion("1.0.0")] + [Description("Sets the secondary background color to the toast.")] Secondary, /// - /// Success background color. + /// Sets the success background color to the toast. /// + [AddedVersion("1.0.0")] + [Description("Sets the success background color to the toast.")] Success, /// - /// Danger background color. + /// Sets the danger background color to the toast. /// + [AddedVersion("1.0.0")] + [Description("Sets the danger background color to the toast.")] Danger, /// - /// Warning background color. + /// Sets the warning background color to the toast. /// + [AddedVersion("1.0.0")] + [Description("Sets the warning background color to the toast.")] Warning, /// - /// Info background color. + /// Sets the info background color to the toast. /// + [AddedVersion("1.0.0")] + [Description("Sets the info background color to the toast.")] Info, /// - /// Light background color. + /// Sets the light background color to the toast. /// + [AddedVersion("1.0.0")] + [Description("Sets the light background color to the toast.")] Light, /// - /// Dark background color. + /// Sets the dark background color to the toast. /// + [AddedVersion("1.0.0")] + [Description("Sets the dark background color to the toast.")] Dark // TODO: Review diff --git a/blazorbootstrap/Enums/ToastsPlacement.cs b/blazorbootstrap/Enums/ToastsPlacement.cs index 86b49dfdd..d1757e636 100644 --- a/blazorbootstrap/Enums/ToastsPlacement.cs +++ b/blazorbootstrap/Enums/ToastsPlacement.cs @@ -7,40 +7,56 @@ public enum ToastsPlacement /// /// Top center /// + [AddedVersion("1.0.0")] + [Description("Top center")] TopCenter, /// /// Top right /// + [AddedVersion("1.0.0")] + [Description("Top right")] TopRight, /// /// Middle left /// + [AddedVersion("1.0.0")] + [Description("Middle left")] MiddleLeft, /// /// Middle center /// + [AddedVersion("1.0.0")] + [Description("Middle center")] MiddleCenter, /// /// Middle right /// + [AddedVersion("1.0.0")] + [Description("Middle right")] MiddleRight, /// /// Bottom left /// + [AddedVersion("1.0.0")] + [Description("Bottom left")] BottomLeft, /// /// Bottom center /// + [AddedVersion("1.0.0")] + [Description("Bottom center")] BottomCenter, /// /// Bottom right /// + [AddedVersion("1.0.0")] + [Description("Bottom right")] BottomRight } diff --git a/blazorbootstrap/Models/ToastMessage.cs b/blazorbootstrap/Models/ToastMessage.cs index 316d516c9..9d8f0a873 100644 --- a/blazorbootstrap/Models/ToastMessage.cs +++ b/blazorbootstrap/Models/ToastMessage.cs @@ -85,28 +85,97 @@ public ToastMessage(ToastType type, string customIconName, string title, string #region Properties, Indexers + /// + /// Gets or sets a value indicating whether the Toast should automatically hide. + /// + /// Default value is . + /// + /// + [AddedVersion("1.0.0")] + [DefaultValue(false)] + [Description("Gets or sets a value indicating whether the Toast should automatically hide.")] public bool AutoHide { get; set; } + /// + /// Gets or sets the UI content to be rendered within the component. + /// + /// Default value is . + /// + /// + [AddedVersion("1.0.0")] + [DefaultValue(null)] + [Description("Gets or sets the UI content to be rendered within the component.")] + public RenderFragment? Content { get; set; } + /// /// Specify custom icons of your own, like fontawesome. Example: 'fas fa-alarm-clock' + /// + /// Default value is . + /// /// + [AddedVersion("1.0.0")] + [DefaultValue(null)] + [Description("Specify custom icons of your own, like fontawesome. Example: 'fas fa-alarm-clock'")] public string? CustomIconName { get; set; } internal string? ElementId { get; private set; } + /// + /// Gets or sets the help text associated with this element. + /// + /// Default value is . + /// + /// + [AddedVersion("1.0.0")] + [DefaultValue(null)] + [Description("Gets or sets the help text associated with this element.")] public string? HelpText { get; set; } - public IconName IconName { get; set; } + /// + /// Gets or sets the icon to display for the associated element. + /// + /// Default value is . + /// + /// + [AddedVersion("1.0.0")] + [DefaultValue(IconName.None)] + [Description("Gets or sets the icon to display for the associated element.")] + public IconName IconName { get; set; } = IconName.None; internal Guid Id { get; } + /// + /// Gets or sets the message content associated with this instance. + /// + /// Default value is . + /// + /// + [AddedVersion("1.0.0")] + [DefaultValue(null)] + [Description("Gets or sets the message content associated with this instance.")] public string? Message { get; set; } - public RenderFragment? Content { get; set; } - + /// + /// Gets or sets the title associated with the object. + /// + /// Default value is . + /// + /// + [AddedVersion("1.0.0")] + [DefaultValue(null)] + [Description("Gets or sets the title associated with the object.")] public string? Title { get; set; } - public ToastType Type { get; set; } + /// + /// Gets or sets the type of toast notification to display. + /// + /// Default value is . + /// + /// + [AddedVersion("1.0.0")] + [DefaultValue(ToastType.Primary)] + [Description("Gets or sets the type of toast notification to display.")] + public ToastType Type { get; set; } = ToastType.Primary; #endregion }