-
-
Notifications
You must be signed in to change notification settings - Fork 533
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DropdownToggle. fix toggle icon visibility on Tailwind
- Loading branch information
Showing
1 changed file
with
27 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,29 @@ | ||
@inherits Blazorise.DropdownToggle | ||
@using System.Text | ||
@inherits Blazorise.DropdownToggle | ||
<button @ref="@ElementRef" id="@ElementId" type="button" class="@ClassNames" style="@StyleNames" data-boundary="@DataBoundary" disabled="@IsDisabled" tabindex="@TabIndex" aria-expanded="@(ParentDropdownState?.Visible.ToString().ToLowerInvariant())" @onclick="@ClickHandler" @attributes="@Attributes"> | ||
<span>@ChildContent</span> | ||
<svg class="b-dropdown-toggle-arrow ml-2 w-4 h-4" aria-hidden="true" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path></svg> | ||
</button> | ||
<svg class="@DropdownToggleArrowClassNames" aria-hidden="true" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path></svg> | ||
</button> | ||
@code { | ||
string DropdownToggleArrowClassNames | ||
{ | ||
get | ||
{ | ||
var sb = new StringBuilder( "b-dropdown-toggle-arrow" ); | ||
|
||
if ( !IsToggleIconVisible ) | ||
{ | ||
sb.Append( " hidden" ); | ||
} | ||
|
||
sb.Append( " w-4 h-4 ml-1" ); | ||
|
||
return sb.ToString(); | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Gets or sets the reference to the parent <see cref="Bar"/> component. | ||
/// </summary> | ||
[CascadingParameter] protected Bar ParentBar { get; set; } | ||
} |