Skip to content

Commit

Permalink
Merge pull request #417 from chanan/BaseClasssRemoved
Browse files Browse the repository at this point in the history
Removes all dated base classes from components
  • Loading branch information
jbomhold3 authored Dec 14, 2020
2 parents 930f45c + 5fcc058 commit 10a484b
Show file tree
Hide file tree
Showing 156 changed files with 259 additions and 218 deletions.
1 change: 0 additions & 1 deletion src/BlazorStrap/Components/BSAlert.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@namespace BlazorStrap
@inherits BSAlertBase

@if (IsOpen)
{
Expand Down
2 changes: 1 addition & 1 deletion src/BlazorStrap/Components/BSAlert.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace BlazorStrap
{
public abstract class BSAlertBase : ComponentBase
public partial class BSAlert : ComponentBase
{
[Parameter] public RenderFragment ChildContent { get; set; }
[Parameter] public string Class { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/BlazorStrap/Components/BSAlertEvent.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
{
public class BSAlertEvent
{
public BSAlertBase Target { get; set; }
public BSAlert Target { get; set; }
}
}
1 change: 0 additions & 1 deletion src/BlazorStrap/Components/BSBadge.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@namespace BlazorStrap
@inherits BSBadgeBase

<DynamicElement TagName="@Tag" class="@Classname" href="@Href" @onclick="MyOnClick" @attributes="@UnknownParameters">
@ChildContent
Expand Down
2 changes: 1 addition & 1 deletion src/BlazorStrap/Components/BSBadge.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace BlazorStrap
{
public abstract class BSBadgeBase : ComponentBase
public partial class BSBadge : ComponentBase
{
[Parameter(CaptureUnmatchedValues = true)] public IDictionary<string, object> UnknownParameters { get; set; }
protected string Classname =>
Expand Down
1 change: 0 additions & 1 deletion src/BlazorStrap/Components/BSCustomizer.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@namespace BlazorStrap
@inherits BSCustomizerBase
<style>
:root {
@foreach (var prop in Config.GetType().GetProperties())
Expand Down
2 changes: 1 addition & 1 deletion src/BlazorStrap/Components/BSCustomizer.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace BlazorStrap
{
public abstract class BSCustomizerBase : ComponentBase
public partial class BSCustomizer : ComponentBase
{
[Parameter] public BSCustomizerConfig Config { get; set; } = new BSCustomizerConfig();
}
Expand Down
5 changes: 2 additions & 3 deletions src/BlazorStrap/Components/BSProgress.razor
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
@namespace BlazorStrap
@inherits BSProgressBase

@if (!IsMulti && !IsBar)
{
<DynamicElement style="@Style" @attributes="@UnknownParameters" TagName="div" class="progress">
<div class="@Classname" style="@styles" role="progressbar" aria-valuenow="@Value" aria-valuemin="0" aria-valuemax="@Max">@ChildContent</div>
<div class="@Classname" style="@Styles" role="progressbar" aria-valuenow="@Value" aria-valuemin="0" aria-valuemax="@Max">@ChildContent</div>
</DynamicElement>
}
@if (IsMulti && !IsBar)
Expand All @@ -15,7 +14,7 @@
}
@if (!IsMulti && IsBar)
{
<DynamicElement style="@styles" @attributes="@UnknownParameters" TagName="div" class="@Classname" role="progressbar" aria-valuenow="@Value" aria-valuemin="0" aria-valuemax="@Max">
<DynamicElement style="@Styles" @attributes="@UnknownParameters" TagName="div" class="@Classname" role="progressbar" aria-valuenow="@Value" aria-valuemin="0" aria-valuemax="@Max">
@ChildContent
</DynamicElement>
}
4 changes: 2 additions & 2 deletions src/BlazorStrap/Components/BSProgress.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace BlazorStrap
{
public abstract class BSProgressBase : ComponentBase
public partial class BSProgress : ComponentBase
{
[Parameter(CaptureUnmatchedValues = true)] public IDictionary<string, object> UnknownParameters { get; set; }
protected string Classname =>
Expand All @@ -24,7 +24,7 @@ public abstract class BSProgressBase : ComponentBase

[Parameter] public int Value { get; set; }
[Parameter] public int Max { get; set; } = 100;
protected string styles
protected string Styles
{
get
{
Expand Down
1 change: 0 additions & 1 deletion src/BlazorStrap/Components/BSToast.Razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@namespace BlazorStrap
@inherits BSToastBase

@*
Use With:
Expand Down
2 changes: 1 addition & 1 deletion src/BlazorStrap/Components/BSToast.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace BlazorStrap
{
public abstract class BSToastBase : ComponentBase
public partial class BSToast : ComponentBase
{
[Parameter(CaptureUnmatchedValues = true)] public IDictionary<string, object> UnknownParameters { get; set; }
protected string Classname =>
Expand Down
1 change: 0 additions & 1 deletion src/BlazorStrap/Components/BSTooltip.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@namespace BlazorStrap
@inherits BSTooltipBase

<div @ref="Tooltip" class="tooltip d-none" role="tooltip">
<div @ref="Arrow" class="arrow"></div>
Expand Down
2 changes: 1 addition & 1 deletion src/BlazorStrap/Components/BSTooltip.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace BlazorStrap
{
public abstract class BSTooltipBase : ComponentBase
public partial class BSTooltip : ComponentBase
{
[Parameter(CaptureUnmatchedValues = true)] public IDictionary<string, object> UnknownParameters { get; set; }
[Inject] public BlazorStrapInterop BlazorStrapInterop { get; set; }
Expand Down
1 change: 0 additions & 1 deletion src/BlazorStrap/Components/Carousel/BSCarousel.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@namespace BlazorStrap
@inherits BSCarouselBase

<CascadingValue Value="this">
<DynamicElement @attributes="@UnknownParameters" TagName="div" class="@Classname" @onmouseenter="OnMouseEnter" @onmouseleave="OnMouseLeave" @onkeypress="OnKeyPress">
Expand Down
8 changes: 4 additions & 4 deletions src/BlazorStrap/Components/Carousel/BSCarousel.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace BlazorStrap
{
public abstract class BSCarouselBase : ComponentBase, IDisposable
public partial class BSCarousel : ComponentBase, IDisposable
{
private const string _carouselFade = "carousel-fade";

Expand All @@ -22,8 +22,8 @@ public int ActiveIndex

private bool _timerEnabled { get; set; } = true;
public bool AnimationRunning { get; set; } = false;
public List<BSCarouselIndicatorItemBase> CarouselIndicatorItems { get; } = new List<BSCarouselIndicatorItemBase>();
public List<BSCarouselItemBase> CarouselItems { get; } = new List<BSCarouselItemBase>();
public List<BSCarouselIndicatorItem> CarouselIndicatorItems { get; } = new List<BSCarouselIndicatorItem>();
public List<BSCarouselItem> CarouselItems { get; } = new List<BSCarouselItem>();
[Parameter] public RenderFragment ChildContent { get; set; }
[Parameter] public string Class { get; set; }
[Parameter] public bool Fade { get; set; } = false;
Expand Down Expand Up @@ -173,7 +173,7 @@ private async Task DoAnimations()
}
}

public async Task AnimationEnd(BSCarouselItemBase sender)
public async Task AnimationEnd(BSCarouselItem sender)
{
if (sender == CarouselItems[ActiveIndex])
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@namespace BlazorStrap
@inherits BSCarouselCaptionBase

<DynamicElement @attributes="@UnknownParameters" TagName="div" class="@Classname">
@if (HeaderText != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace BlazorStrap
{
public abstract class BSCarouselCaptionBase : ComponentBase
public partial class BSCarouselCaption : ComponentBase
{
[Parameter(CaptureUnmatchedValues = true)] public IDictionary<string, object> UnknownParameters { get; set; }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@namespace BlazorStrap
@inherits BSCarouselControlBase

<DynamicElement @attributes="@UnknownParameters" TagName="a" class="@Classname" role="button" @onclick="OnClick" href="javascript:void(0)">
<span class="@IconClassname" aria-hidden="true"></span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace BlazorStrap
{
public abstract class BSCarouselControlBase : ComponentBase
public partial class BSCarouselControl : ComponentBase
{
[Parameter(CaptureUnmatchedValues = true)] public IDictionary<string, object> UnknownParameters { get; set; }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@namespace BlazorStrap
@inherits BSCarouselIndicatorItemBase

<DynamicElement @attributes="@UnknownParameters" TagName="li" class="@Classname" @onclick="OnClick" />
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace BlazorStrap
{
public abstract class BSCarouselIndicatorItemBase : ComponentBase
public partial class BSCarouselIndicatorItem : ComponentBase
{
[Parameter(CaptureUnmatchedValues = true)] public IDictionary<string, object> UnknownParameters { get; set; }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@namespace BlazorStrap
@inherits BSCarouselIndicatorsBase

<DynamicElement @attributes="@UnknownParameters" TagName="ol" class="@Classname">
@for (var i = 0; i < NumberOfItems; i++)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace BlazorStrap
{
public abstract class BSCarouselIndicatorsBase : ComponentBase
public partial class BSCarouselIndicators : ComponentBase
{
[Parameter(CaptureUnmatchedValues = true)] public IDictionary<string, object> UnknownParameters { get; set; }

Expand Down
1 change: 0 additions & 1 deletion src/BlazorStrap/Components/Carousel/BSCarouselItem.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@namespace BlazorStrap
@inherits BSCarouselItemBase

<DynamicElement @attributes="@UnknownParameters" TagName="div" class="@Classname" @ontransitionend="AnimationEnd">
@if (AddActionLink)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace BlazorStrap
{
public abstract class BSCarouselItemBase : ComponentBase
public partial class BSCarouselItem : ComponentBase
{
[Parameter(CaptureUnmatchedValues = true)] public IDictionary<string, object> UnknownParameters { get; set; }
[CascadingParameter] protected BSCarousel Parent { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/BlazorStrap/Components/Dropdown/BSDropdown.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@namespace BlazorStrap
@inherits BSDropdownBase
@inherits ToggleableComponentBase

<CascadingValue Value="@this">
<CascadingValue Value="@DropDownMenu">
Expand Down
21 changes: 16 additions & 5 deletions src/BlazorStrap/Components/Dropdown/BSDropdown.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace BlazorStrap
{
public abstract class BSDropdownBase : ToggleableComponentBase, IDisposable
public partial class BSDropdown : ToggleableComponentBase, IDisposable
{
[Parameter(CaptureUnmatchedValues = true)] public IDictionary<string, object> UnknownParameters { get; set; }
[Parameter] public EventCallback<BSDropdownEvent> ShowEvent { get; set; }
Expand All @@ -22,13 +22,13 @@ public abstract class BSDropdownBase : ToggleableComponentBase, IDisposable
internal List<EventCallback<BSDropdownEvent>> EventQue { get; set; } = new List<EventCallback<BSDropdownEvent>>();

// Prevents rogue closing
private BSDropdownMenuBase _selected;
private BSDropdownMenu _selected;

private BSDropdownMenuBase _dropDownMenu { get; set; } = new BSDropdownMenu();
private BSDropdownMenu _dropDownMenu { get; set; } = new BSDropdownMenu();
public bool Active { get; set; } = false;
private bool _shouldClose { get; set; } = false;

internal BSDropdownMenuBase DropDownMenu
internal BSDropdownMenu DropDownMenu
{
get => _dropDownMenu;
set
Expand All @@ -38,13 +38,24 @@ internal BSDropdownMenuBase DropDownMenu
}
}

public BSDropdownMenuBase Selected
public BSDropdownMenu Selected
{
get => _selected;
set
{
_selected = value;
if (_selected != null) _selected.Changed(true);
if(_selected == null)
{
if(Dropdown != null)
{
Dropdown.Selected = _selected;
}
else if(NavItem != null)
{
NavItem.Selected = _selected;
}
}
InvokeAsync(StateHasChanged);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/BlazorStrap/Components/Dropdown/BSDropdownEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
{
public class BSDropdownEvent
{
public BSDropdownBase Target { get; set; }
public BSDropdown Target { get; set; }
}
}
1 change: 0 additions & 1 deletion src/BlazorStrap/Components/Dropdown/BSDropdownHeader.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@namespace BlazorStrap
@inherits BSDropdownHeaderBase

<DynamicElement @attributes="@UnknownParameters" TagName="h6" class="@Classname">
@ChildContent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace BlazorStrap
{
public abstract class BSDropdownHeaderBase : ComponentBase
public partial class BSDropdownHeader : ComponentBase
{
[Parameter(CaptureUnmatchedValues = true)] public IDictionary<string, object> UnknownParameters { get; set; }

Expand Down
1 change: 0 additions & 1 deletion src/BlazorStrap/Components/Dropdown/BSDropdownItem.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@namespace BlazorStrap
@inherits BSDropdownItemBase

<CascadingValue Value="@this">
<DynamicElement @attributes="@UnknownParameters" TagName="@Tag" class="@Classname" type="@Type" @onclick="OnClickEvent" href="@Href">
Expand Down
8 changes: 6 additions & 2 deletions src/BlazorStrap/Components/Dropdown/BSDropdownItem.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace BlazorStrap
{
public abstract class BSDropdownItemBase : ComponentBase, IDisposable
public partial class BSDropdownItem : ComponentBase, IDisposable
{
[Inject] protected NavigationManager UriHelper { get; set; }

Expand Down Expand Up @@ -45,10 +45,14 @@ protected void OnClickEvent(MouseEventArgs e)
{
OnClick.InvokeAsync(e);
}
if (!StayOpen && DropDown?.IsSubmenu == false && !HasSubMenu)
// Not Sure why I had this here commented out. Will remove after full testing.
// if (!StayOpen && DropDown?.IsSubmenu == false && !HasSubMenu)
// {
if (!StayOpen)
{
DropDown.Selected = null;
}
// }
}

protected override void OnInitialized()
Expand Down
3 changes: 1 addition & 2 deletions src/BlazorStrap/Components/Dropdown/BSDropdownMenu.razor
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
@namespace BlazorStrap
@inherits BSDropdownMenuBase

@inherits ToggleableComponentBase
<DynamicElement @attributes="@UnknownParameters" TagName="div" class="@Classname" @onmouseleave="MouseOut" @bind-ElementRef="MyRef">
@ChildContent
</DynamicElement>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace BlazorStrap
{
public abstract class BSDropdownMenuBase : ToggleableComponentBase
public partial class BSDropdownMenu : ToggleableComponentBase
{
[Inject] protected IJSRuntime JSRuntime { get; set; }
[Parameter(CaptureUnmatchedValues = true)] public IDictionary<string, object> UnknownParameters { get; set; }
Expand Down
1 change: 0 additions & 1 deletion src/BlazorStrap/Components/Dropdown/BSDropdownToggle.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@namespace BlazorStrap
@inherits BSDropdownToggleBase

<DynamicElement @attributes="@UnknownParameters" TagName="@Tag" class="@Classname" href="@Href" type="@Type" aria-haspopup="true" @onclick="OnClickEvent" @onkeydown="Escape">
@ChildContent
Expand Down
4 changes: 2 additions & 2 deletions src/BlazorStrap/Components/Dropdown/BSDropdownToggle.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace BlazorStrap
{
public abstract class BSDropdownToggleBase : ComponentBase
public partial class BSDropdownToggle : ComponentBase
{
[Parameter(CaptureUnmatchedValues = true)] public IDictionary<string, object> UnknownParameters { get; set; }

Expand Down Expand Up @@ -43,7 +43,7 @@ public abstract class BSDropdownToggleBase : ComponentBase
[Parameter] public EventCallback<MouseEventArgs> OnClick { get; set; }
[Parameter] public string Class { get; set; }
[Parameter] public RenderFragment ChildContent { get; set; }
[CascadingParameter] internal BSDropdownMenuBase Dropdown { get; set; }
[CascadingParameter] internal BSDropdownMenu Dropdown { get; set; }

protected void Escape(KeyboardEventArgs e)
{
Expand Down
1 change: 0 additions & 1 deletion src/BlazorStrap/Components/Figure/BSFigureCaption.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@namespace BlazorStrap
@inherits BSFigureCaptionBase

<DynamicElement TagName="figcaption" class="@Classname" style="@Style" @attributes="@UnknownParameters">
@ChildContent
Expand Down
Loading

0 comments on commit 10a484b

Please sign in to comment.