Skip to content

Commit 4508245

Browse files
committed
2 parents 34b8118 + 69ce39e commit 4508245

File tree

16 files changed

+149
-94
lines changed

16 files changed

+149
-94
lines changed

src/BootstrapBlazor.Server/Components/Samples/CheckboxLists.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
<BootstrapInput @bind-Value="@Model.Name" />
129129
</div>
130130
<div class="col-12 col-sm-6">
131-
<CheckboxList @bind-Value="@SelectedItems" IsButton="true" Items="FooItems" />
131+
<CheckboxList @bind-Value="@SelectedItems" IsButton="true" Items="FooItems" ShowLabel="true" DisplayText="Hobby" />
132132
</div>
133133
</div>
134134
</ValidateForm>

src/BootstrapBlazor.Server/Components/Samples/SortableLists.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@
187187
Introduction="@Localizer["SortableListTableIntro"]"
188188
Name="Table">
189189
<SortableList Option="_optionTable" OnUpdate="OnUpdateTable">
190-
<Table TItem="Foo" Items="@Items" IsStriped="true" ShowLineNo="true">
190+
<Table TItem="Foo" Items="@Items" IsStriped="true" ShowLineNo="true" RenderMode="TableRenderMode.Table">
191191
<TableColumns>
192192
<TableColumn @bind-Field="@context.DateTime" Width="180" />
193193
<TableColumn @bind-Field="@context.Name" />

src/BootstrapBlazor/BootstrapBlazor.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

33
<PropertyGroup>
4-
<Version>9.9.1-beta02</Version>
4+
<Version>9.9.1-beta04</Version>
55
</PropertyGroup>
66

77
<ItemGroup>

src/BootstrapBlazor/Components/Checkbox/CheckboxList.razor

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
<div class="@ButtonGroupClassString" role="group">
1414
@foreach (var item in Items)
1515
{
16-
<DynamicElement TagName="span" TriggerClick="!IsDisabled" OnClick="() => OnClick(item)" class="@GetButtonItemClassString(item)">
16+
<DynamicElement TagName="span" TriggerClick="!IsDisabled" OnClick="() => OnClick(item)"
17+
class="@GetButtonItemClassString(item)">
1718
@item.Text
1819
</DynamicElement>
1920
}

src/BootstrapBlazor/Components/Checkbox/CheckboxList.razor.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ public partial class CheckboxList<TValue> : ValidateBase<TValue>
3838
.Build();
3939

4040
private string? GetButtonItemClassString(SelectedItem item) => CssBuilder.Default("btn")
41-
.AddClass($"active bg-{Color.ToDescriptionString()}", CurrentValueAsString.Split(',', StringSplitOptions.RemoveEmptyEntries).Contains(item.Value))
41+
.AddClass($"btn-outline-{Color.ToDescriptionString()}")
42+
.AddClass($"active", CurrentValueAsString.Split(',', StringSplitOptions.RemoveEmptyEntries).Contains(item.Value))
4243
.Build();
4344

4445
/// <summary>

src/BootstrapBlazor/Components/Checkbox/CheckboxList.razor.scss

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.checkbox-list {
1+
.checkbox-list {
22
--bb-checkbox-item-width: #{$bb-checkbox-item-width};
33
min-height: var(--bb-height);
44
height: auto;
@@ -38,7 +38,6 @@
3838
}
3939

4040
.btn-group {
41-
border: var(--bs-border-width) solid var(--bs-border-color);
4241
display: inline-flex;
4342
flex: 0 !important;
4443
flex-wrap: nowrap;
@@ -54,13 +53,19 @@
5453

5554
&.disabled {
5655
> span {
56+
--bs-btn-hover-color: var(--bs-btn-color);
57+
--bs-btn-active-color: var(--bs-btn-color);
5758
opacity: var(--bs-btn-disabled-opacity);
5859

5960
&:not(.active) {
6061
background-color: var(--bs-secondary-bg);
6162
}
6263
}
6364
}
65+
66+
.btn-outline-info {
67+
--bs-btn-active-color: #fff;
68+
}
6469
}
6570
}
6671

src/BootstrapBlazor/Components/Collapse/Collapse.razor

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,16 @@
1919
@item.HeaderTemplate
2020
</div>
2121
}
22-
else if(!string.IsNullOrEmpty(item.Icon))
23-
{
24-
<i class="@GetItemIconString(item)"></i>
25-
}
2622
else
2723
{
28-
<span>@item.Text</span>
24+
if (!string.IsNullOrEmpty(item.Icon))
25+
{
26+
<i class="@GetItemIconString(item)"></i>
27+
}
28+
if (!string.IsNullOrEmpty(item.Text))
29+
{
30+
<span>@item.Text</span>
31+
}
2932
}
3033
</div>
3134
</div>

src/BootstrapBlazor/Components/Radio/RadioList.razor.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ public partial class RadioList<TValue>
4646
.Build();
4747

4848
private string? GetButtonItemClassString(SelectedItem item) => CssBuilder.Default("btn")
49-
.AddClass($"active bg-{Color.ToDescriptionString()}", CurrentValueAsString == item.Value)
49+
.AddClass($"btn-outline-{Color.ToDescriptionString()}")
50+
.AddClass("active", CurrentValueAsString == item.Value)
5051
.Build();
5152

5253
/// <summary>

src/BootstrapBlazor/Components/Radio/RadioList.razor.scss

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.radio-list {
1+
.radio-list {
22
--bb-radio-item-width: #{$bb-radio-item-width};
33
--bb-radio-item-padding: #{$bb-radio-item-padding};
44
--bb-radio-group-item-active-color: #{$bb-radio-group-item-active-color};
@@ -24,7 +24,6 @@
2424
}
2525

2626
&.btn-group {
27-
border: var(--bs-border-width) solid var(--bs-border-color);
2827
display: inline-flex;
2928
flex: 0 !important;
3029
flex-wrap: nowrap;
@@ -39,12 +38,18 @@
3938
}
4039

4140
&.disabled > span {
41+
--bs-btn-hover-color: var(--bs-btn-color);
42+
--bs-btn-active-color: var(--bs-btn-color);
4243
opacity: var(--bs-btn-disabled-opacity);
4344

4445
&:not(.active) {
4546
background-color: var(--bs-secondary-bg);
4647
}
4748
}
49+
50+
.btn-outline-info {
51+
--bs-btn-active-color: var(--bb-radio-group-item-active-color);
52+
}
4853
}
4954

5055
&.btn-group-vertical {
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the Apache 2.0 License
3+
// See the LICENSE file in the project root for more information.
4+
// Maintainer: Argo Zhang([email protected]) Website: https://www.blazor.zone
5+
6+
namespace BootstrapBlazor.Components;
7+
8+
/// <summary>
9+
/// SortableList 组件接口
10+
/// </summary>
11+
public interface ISortableList
12+
{
13+
14+
}

0 commit comments

Comments
 (0)