Skip to content

Commit

Permalink
feat(blazorui): add non-interactive items to BitBreadcrumb #9040 (#9070)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyrus-Sushiant authored Nov 1, 2024
1 parent 9554007 commit 0ac5f8d
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
}
</a>
}
else
else if (OnItemClick.HasDelegate)
{
<button type="button"
aria-current="@(GetIsSelected(item) ? "page" : null)"
Expand All @@ -93,6 +93,30 @@
}
</button>
}
else
{
<span aria-current="@(GetIsSelected(item) ? "page" : null)"
style="@GetStyles(item, false)"
class="bit-brc-nii @GetClasses(item, false)">
@if (template is not null)
{
@template(item)
}
else if (ItemTemplate is not null)
{
@ItemTemplate(item)
}
else
{
var iconName = GetIconName(item);
@if (iconName.HasValue())
{
<i style="@Styles?.ItemIcon" class="bit-icon bit-icon--@iconName @Classes?.ItemIcon" />
}
<span style="@Styles?.ItemText" class="@Classes?.ItemText">@GetItemText(item)</span>
}
</span>
}
}
</li>

Expand Down Expand Up @@ -148,7 +172,7 @@
}
</a>
}
else
else if (OnItemClick.HasDelegate)
{
<button type="button"
aria-current="@(GetIsSelected(item) ? "page" : null)"
Expand All @@ -174,6 +198,30 @@
}
</button>
}
else
{
<span aria-current="@(GetIsSelected(item) ? "page" : null)"
style="@GetStyles(item, true)"
class="bit-brc-ofn @GetClasses(item, true)">
@if (overflowTemplate is not null)
{
@overflowTemplate(item)
}
else if (OverflowTemplate is not null)
{
@OverflowTemplate(item)
}
else
{
var iconName = GetIconName(item);
@if (iconName.HasValue())
{
<i style="@Styles?.OverflowItemIcon" class="bit-icon bit-icon--@iconName @Classes?.OverflowItemIcon" />
}
<span style="@Styles?.OverflowItemText" class="@Classes?.OverflowItemText">@GetItemText(item)</span>
}
</span>
}
</li>
}
</ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ private async Task HandleOnItemClick(TItem item)
{
if (IsEnabled is false) return;
if (GetIsEnabled(item) is false) return;
if (OnItemClick.HasDelegate is false) return;

await OnItemClick.InvokeAsync(item);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,19 @@
}
}

.bit-brc-itm {
.bit-brc-itm,
.bit-brc-nii {
display: flex;
gap: spacing(1);
cursor: pointer;
font-weight: 400;
color: $clr-fg-pri;
padding: 0 spacing(1);
font-size: spacing(2.5);
line-height: spacing(4.5);
}

.bit-brc-itm {
cursor: pointer;

@media (hover: hover) {
&:hover {
Expand Down Expand Up @@ -113,11 +117,11 @@
max-height: spacing(88.875);
}

.bit-brc-ofi {
.bit-brc-ofi,
.bit-brc-ofn {
width: 100%;
display: flex;
gap: spacing(1);
cursor: pointer;
overflow: hidden;
text-align: left;
font-weight: 400;
Expand All @@ -137,6 +141,10 @@
line-height: spacing(2.5);
background-color: transparent;
border: $shp-border-width $shp-border-style transparent;
}

.bit-brc-ofi {
cursor: pointer;

@media (hover: hover) {
&:hover {
Expand Down

0 comments on commit 0ac5f8d

Please sign in to comment.