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
87 changes: 62 additions & 25 deletions blazorbootstrap/Components/Carousel/Carousel.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ public async Task bslide(CarouselEventArgs args)
/// Shows <see cref="CarouselItem" /> by index.
/// </summary>
/// <param name="index"></param>
[AddedVersion("3.0.0")]
[Description("Shows <b>CarouselItem</b> by index.")]
public ValueTask ShowItemByIndexAsync(int index)
{
if (!isDefaultActiveCarouselItemSet)
Expand All @@ -99,11 +101,15 @@ internal void AddItem(CarouselItem carouselItem)
/// <summary>
/// Shows next <see cref="CarouselItem" />.
/// </summary>
[AddedVersion("3.0.0")]
[Description("Shows next <b>CarouselItem</b>.")]
public ValueTask PauseCarouselAsync() => JSRuntime.InvokeVoidAsync(CarouselInterop.Pause, Id);

/// <summary>
/// Shows next <see cref="CarouselItem" />.
/// </summary>
[AddedVersion("3.0.0")]
[Description("Shows next <b>CarouselItem</b>.")]
public ValueTask ShowNextItemAsync()
{
var nextIndex = activeIndex + 1;
Expand All @@ -115,6 +121,8 @@ public ValueTask ShowNextItemAsync()
/// <summary>
/// Shows previous <see cref="CarouselItem" />.
/// </summary>
[AddedVersion("3.0.0")]
[Description("Shows previous <b>CarouselItem</b>.")]
public ValueTask ShowPreviousItemAsync()
{
var previousIndex = activeIndex - 1;
Expand All @@ -137,90 +145,119 @@ public ValueTask ShowPreviousItemAsync()

/// <summary>
/// Controls the autoplay behavior of the carousel.
/// </summary>
/// <remarks>
/// <para>
/// Default value is <see cref="CarouselAutoPlay.None" />.
/// </remarks>
/// </para>
/// </summary>
[AddedVersion("3.0.0")]
[DefaultValue(CarouselAutoPlay.None)]
[Description("Controls the autoplay behavior of the carousel.")]
[Parameter]
public CarouselAutoPlay Autoplay { get; set; } = CarouselAutoPlay.None;

/// <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("3.0.0")]
[DefaultValue(null)]
[Description("Gets or sets the content to be rendered within the component.")]
[ParameterTypeName("RenderFragment?")]
[Parameter]
public RenderFragment? ChildContent { get; set; }

/// <summary>
/// Determines whether to use a crossfade effect when transitioning between slides.
/// </summary>
/// <remarks>
/// <para>
/// Default value is <see langword="false" />.
/// </remarks>
/// </para>
/// </summary>
[AddedVersion("3.0.0")]
[DefaultValue(false)]
[Description("Determines whether to use a crossfade effect when transitioning between slides.")]
[Parameter]
public bool Crossfade { get; set; }

private bool HasItems => items.Any();

/// <summary>
/// The amount of time to delay between automatically cycling an item.
/// </summary>
/// <remarks>
/// <para>
/// Default value is 5000 milliseconds.
/// </remarks>
/// </para>
/// </summary>
[AddedVersion("3.0.0")]
[DefaultValue(5000)]
[Description("The amount of time to delay between automatically cycling an item.")]
[Parameter]
public int? Interval { get; set; } = 5000;
public int Interval { get; set; } = 5000;

private int ItemCount => items.Count;

/// <summary>
/// Whether the carousel should react to keyboard events.
/// </summary>
/// <remarks>
/// <para>
/// Default value is <see langword="true" />.
/// </remarks>
/// </para>
/// </summary>
[AddedVersion("3.0.0")]
[DefaultValue(true)]
[Description("Whether the carousel should react to keyboard events.")]
[Parameter]
public bool Keyboard { get; set; } = true;

/// <summary>
/// Fired when the carousel has completed its slide transition.
/// </summary>
[AddedVersion("3.0.0")]
[Description("Fired when the carousel has completed its slide transition.")]
[Parameter]
public EventCallback<CarouselEventArgs> Onslid { get; set; }

/// <summary>
/// Fires immediately when the slide instance method is invoked.
/// </summary>
[AddedVersion("3.0.0")]
[Description("Fires immediately when the slide instance method is invoked.")]
[Parameter]
public EventCallback<CarouselEventArgs> Onslide { get; set; }

/// <summary>
/// Indicates whether to show indicators (dots) below the carousel to navigate between slides.
/// </summary>
/// <remarks>
/// <para>
/// Default value is <see langword="false" />.
/// </remarks>
/// </para>
/// </summary>
[AddedVersion("3.0.0")]
[DefaultValue(false)]
[Description("Indicates whether to show indicators (dots) below the carousel to navigate between slides.")]
[Parameter]
public bool ShowIndicators { get; set; }

/// <summary>
/// Specifies whether to display the previous and next controls (arrows) for navigating slides.
/// </summary>
/// <remarks>
/// <para>
/// Default value is <see langword="true" />.
/// </remarks>
/// </para>
/// </summary>
[AddedVersion("3.0.0")]
[DefaultValue(true)]
[Description("Specifies whether to display the previous and next controls (arrows) for navigating slides.")]
[Parameter]
public bool ShowPreviousNextControls { get; set; } = true;

/// <summary>
/// Carousels support swiping left/right on touchscreen devices to move between slides.
/// This can be disabled by setting the <see cref="Touch" /> parameter to <see langword="false" />.
/// </summary>
/// <remarks>
/// <para>
/// Default value is <see langword="true" />.
/// </remarks>
/// </para>
/// </summary>
[AddedVersion("3.0.0")]
[DefaultValue(true)]
[Description("Carousels support swiping left/right on touchscreen devices to move between slides. This can be disabled by setting the <b>Touch</b> parameter to <b>false</b>.")]
[Parameter]
public bool Touch { get; set; } = true;

Expand Down
10 changes: 7 additions & 3 deletions blazorbootstrap/Components/Carousel/CarouselCaption.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@ public partial class CarouselCaption : BlazorBootstrapComponentBase

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

Expand Down
37 changes: 27 additions & 10 deletions blazorbootstrap/Components/Carousel/CarouselItem.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,34 +24,51 @@ protected override async Task OnInitializedAsync()

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

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

/// <summary>
/// The amount of time to delay between automatically cycling an item.
/// <para>
/// Default value is 5000 milliseconds.
/// </para>
/// </summary>
/// <remarks>
/// Default value is 5000.
/// </remarks>
[AddedVersion("3.0.0")]
[DefaultValue(5000)]
[Description("The amount of time to delay between automatically cycling an item.")]
[Parameter]
public int? Interval { get; set; } = 5000;
public int Interval { get; set; } = 5000;

/// <summary>
/// Gets or sets the aria-label.
/// <para>
/// Default value is <see langword="null" />.
/// </para>
/// </summary>
[AddedVersion("3.0.0")]
[DefaultValue(null)]
[Description("Gets or sets the aria-label.")]
[ParameterTypeName("string?")]
[Parameter]
public string? Label { get; set; }

Expand Down
59 changes: 44 additions & 15 deletions blazorbootstrap/Components/Collapse/Collapse.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,22 @@ protected override async Task OnInitializedAsync()
/// <summary>
/// Hides a collapsible element.
/// </summary>
[AddedVersion("1.7.0")]
[Description("Hides a collapsible element.")]
public async Task HideAsync() => await JSRuntime.InvokeVoidAsync("window.blazorBootstrap.collapse.hide", Id);

/// <summary>
/// Shows a collapsible element.
/// </summary>
[AddedVersion("1.7.0")]
[Description("Shows a collapsible element.")]
public async Task ShowAsync() => await JSRuntime.InvokeVoidAsync("window.blazorBootstrap.collapse.show", Id);

/// <summary>
/// Toggles a collapsible element to shown or hidden.
/// </summary>
[AddedVersion("1.7.0")]
[Description("Toggles a collapsible element to shown or hidden.")]
public async Task ToggleAsync() => await JSRuntime.InvokeVoidAsync("window.blazorBootstrap.collapse.toggle", Id);

#endregion
Expand All @@ -84,45 +90,59 @@ protected override async Task OnInitializedAsync()

/// <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>
[Parameter]
[AddedVersion("1.7.0")]
[DefaultValue(null)]
[Description("Gets or sets the content to be rendered within the component.")]
[EditorRequired]
public RenderFragment ChildContent { get; set; } = default!;
[ParameterTypeName("RenderFragment?")]
[Parameter]
public RenderFragment? ChildContent { get; set; }

/// <summary>
/// Gets or sets the horizontal collapsing.
/// <para>
/// Default value is <see langword="false"/>.
/// </para>
/// </summary>
/// <remarks>
/// Default value is false.
/// </remarks>
[AddedVersion("1.7.0")]
[DefaultValue(false)]
[Description("Gets or sets the horizontal collapsing.")]
[Parameter]
public bool Horizontal { get; set; }

/// <summary>
/// This event is fired when a collapse element has been hidden from the user (will wait for CSS transitions to complete).
/// </summary>
[AddedVersion("1.7.0")]
[Description("This event is fired when a collapse element has been hidden from the user (will wait for CSS transitions to complete).")]
[Parameter]
public EventCallback OnHidden { get; set; }

/// <summary>
/// This event is fired immediately when the hide method has been called.
/// </summary>
[AddedVersion("1.7.0")]
[Description("This event is fired immediately when the hide method has been called.")]
[Parameter]
public EventCallback OnHiding { get; set; }

/// <summary>
/// This event fires immediately when the show instance method is called.
/// </summary>
[AddedVersion("1.7.0")]
[Description("This event fires immediately when the show instance method is called.")]
[Parameter]
public EventCallback OnShowing { get; set; }

/// <summary>
/// This event is fired when a collapse element has been made visible to the user (will wait for CSS transitions to
/// complete).
/// This event is fired when a collapse element has been made visible to the user (will wait for CSS transitions to complete).
/// </summary>
[AddedVersion("1.7.0")]
[Description("This event is fired when a collapse element has been made visible to the user (will wait for CSS transitions to complete).")]
[Parameter]
public EventCallback OnShown { get; set; }

Expand All @@ -131,18 +151,27 @@ protected override async Task OnInitializedAsync()
/// If parent is provided, then all collapsible elements under the specified parent will be closed when this collapsible
/// item is shown. (similar to traditional accordion behavior - this is dependent on the card class).
/// The attribute has to be set on the target collapsible area.
/// <para>
/// Default value is <see langword="null" />.
/// </para>
/// </summary>
[AddedVersion("1.7.0")]
[DefaultValue(null)]
[Description("Gets or sets the parent selector, DOM element. If parent is provided, then all collapsible elements under the specified parent will be closed when this collapsible item is shown. (similar to traditional accordion behavior - this is dependent on the card class). The attribute has to be set on the target collapsible area.")]
[Parameter]
public object Parent { get; set; } = default!;
public object? Parent { get; set; }

/// <summary>
/// Toggles the collapsible element on invocation.
/// <para>
/// Default value is <see langword="false" />.
/// </para>
/// </summary>
/// <remarks>
/// Default value is false.
/// </remarks>
[AddedVersion("1.7.0")]
[DefaultValue(false)]
[Description("Toggles the collapsible element on invocation.")]
[Parameter]
public bool Toggle { get; set; } = false;
public bool Toggle { get; set; }

#endregion
}
Loading
Loading