Skip to content

Commit fe3d8a4

Browse files
committed
2 parents b233b0c + f896db7 commit fe3d8a4

File tree

11 files changed

+119
-67
lines changed

11 files changed

+119
-67
lines changed

src/BootstrapBlazor.Server/Components/Pages/Index.razor

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
@Localizer["Support"]
1313
</span>
1414
</a>
15-
<img src="./favicon.png" alt="bootstrap-blazor" class="bb-logo d-sm-block mx-auto my-5">
15+
<div class="bb-logo d-sm-block mx-auto my-5">
16+
<img src="./favicon.png" alt="bootstrap-blazor">
17+
</div>
1618
<h1 class="mb-3 fw-semibold">@Localizer["Title"]</h1>
1719
<p class="lead mb-4">
1820
@Localizer["SubTitle"]

src/BootstrapBlazor.Server/Components/Pages/Index.razor.css

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,53 @@
3030
}
3131

3232
.bd-masthead .bb-logo {
33+
--bb-btn-space: 4px;
3334
width: 200px;
3435
height: 200px;
36+
position: relative;
37+
overflow: hidden;
38+
border-radius: 30px;
3539
}
3640

41+
.bd-masthead .bb-logo img {
42+
width: calc(100% - 2 * var(--bb-btn-space));
43+
height: calc(100% - 2 * var(--bb-btn-space));
44+
position: absolute;
45+
left: var(--bb-btn-space);
46+
top: var(--bb-btn-space);
47+
}
48+
49+
.bb-logo:before {
50+
content: '';
51+
position: absolute;
52+
inset: 0;
53+
background-color: #5a23c8;
54+
z-index: -2;
55+
}
56+
57+
.bb-logo:after {
58+
content: '';
59+
position: absolute;
60+
left: 50%;
61+
top: 50%;
62+
width: 68%;
63+
height: 68%;
64+
background-image: linear-gradient(to bottom, #3f51b1 0%, #5a55ae 13%, #7b5fac 25%, #8f6aae 38%, #a86aa4 50%, #cc6b8e 62%, #f18271 75%, #f3a469 87%, #f7c978 100%);
65+
transform-origin: left top;
66+
animation: rotate 5s linear infinite;
67+
z-index: -1;
68+
}
69+
70+
@keyframes rotate {
71+
0% {
72+
transform: rotate(0deg);
73+
}
74+
75+
100% {
76+
transform: rotate(360deg);
77+
}
78+
}
79+
3780
.bd-gutter {
3881
--bs-gutter-x: 3rem;
3982
}

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.2-beta03</Version>
4+
<Version>9.9.2-beta05</Version>
55
</PropertyGroup>
66

77
<ItemGroup>

src/BootstrapBlazor/Components/Button/Button.razor.cs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -65,24 +65,4 @@ protected virtual async Task OnClickButton()
6565
/// </summary>
6666
/// <returns></returns>
6767
public ValueTask FocusAsync() => ButtonElement.FocusAsync();
68-
69-
/// <summary>
70-
/// 处理点击方法
71-
/// </summary>
72-
/// <returns></returns>
73-
protected virtual async Task HandlerClick()
74-
{
75-
if (OnClickWithoutRender != null)
76-
{
77-
if (!IsAsync)
78-
{
79-
IsNotRender = true;
80-
}
81-
await OnClickWithoutRender();
82-
}
83-
if (OnClick.HasDelegate)
84-
{
85-
await OnClick.InvokeAsync();
86-
}
87-
}
8868
}

src/BootstrapBlazor/Components/Button/ButtonBase.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,26 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
231231
}
232232
}
233233

234+
/// <summary>
235+
/// 处理点击方法
236+
/// </summary>
237+
/// <returns></returns>
238+
protected virtual async Task HandlerClick()
239+
{
240+
if (OnClickWithoutRender != null)
241+
{
242+
if (!IsAsync)
243+
{
244+
IsNotRender = true;
245+
}
246+
await OnClickWithoutRender();
247+
}
248+
if (OnClick.HasDelegate)
249+
{
250+
await OnClick.InvokeAsync();
251+
}
252+
}
253+
234254
/// <summary>
235255
/// 设置按钮是否可用状态
236256
/// </summary>

src/BootstrapBlazor/Components/Button/LinkButton.cs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@
55

66
using Microsoft.AspNetCore.Components.Rendering;
77
using Microsoft.AspNetCore.Components.Web;
8-
using System;
98

109
namespace BootstrapBlazor.Components;
1110

1211
/// <summary>
1312
/// LinkButton 组件
1413
/// </summary>
15-
public sealed class LinkButton : ButtonBase
14+
public class LinkButton : ButtonBase
1615
{
1716
/// <summary>
1817
/// 获得/设置 Url 默认为 #
@@ -120,14 +119,19 @@ private RenderFragment AddImage() => builder =>
120119

121120
private async Task OnClickButton()
122121
{
123-
if (OnClickWithoutRender != null)
122+
if (IsAsync)
124123
{
125-
await OnClickWithoutRender();
124+
IsAsyncLoading = true;
125+
IsDisabled = true;
126126
}
127127

128-
if (OnClick.HasDelegate)
128+
await HandlerClick();
129+
130+
// 恢复按钮
131+
if (IsAsync)
129132
{
130-
await OnClick.InvokeAsync();
133+
IsDisabled = IsKeepDisabled;
134+
IsAsyncLoading = false;
131135
}
132136
}
133137
}

src/BootstrapBlazor/Components/EditorForm/EditorForm.razor

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,43 @@
22
@typeparam TModel
33
@inherits BootstrapComponentBase
44

5-
<div class="@ClassString">
5+
<div @attributes="AdditionalAttributes" class="@ClassString">
66
<CascadingValue Value="@_editorItems" IsFixed="false">
77
@FieldItems?.Invoke(Model)
88
</CascadingValue>
99
<CascadingValue Value="this" Name="EditorForm">
10-
@if (ShowUnsetGroupItemsOnTop)
11-
{
12-
if (UnsetGroupItems.Any())
10+
<div class="form-body">
11+
@if (ShowUnsetGroupItemsOnTop)
1312
{
14-
@RenderUnsetGroupItems
13+
if (UnsetGroupItems.Any())
14+
{
15+
@RenderUnsetGroupItems
16+
}
17+
@foreach (var g in GroupItems)
18+
{
19+
@RenderGroupItems(g)
20+
}
1521
}
16-
@foreach (var g in GroupItems)
22+
else
1723
{
18-
@RenderGroupItems(g)
24+
@foreach (var g in GroupItems)
25+
{
26+
@RenderGroupItems(g)
27+
}
28+
if (UnsetGroupItems.Any())
29+
{
30+
@RenderUnsetGroupItems
31+
}
1932
}
20-
}
21-
else
33+
</div>
34+
35+
@if (Buttons != null)
2236
{
23-
@foreach (var g in GroupItems)
24-
{
25-
@RenderGroupItems(g)
26-
}
27-
if (UnsetGroupItems.Any())
28-
{
29-
@RenderUnsetGroupItems
30-
}
37+
<div class="bb-editor-footer form-footer">
38+
@Buttons
39+
</div>
3140
}
3241
</CascadingValue>
33-
34-
@if (Buttons != null)
35-
{
36-
<div class="bb-editor-footer form-footer">
37-
@Buttons
38-
</div>
39-
}
4042
</div>
4143

4244
@code

src/BootstrapBlazor/Components/EditorForm/EditorForm.razor.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,10 @@ namespace BootstrapBlazor.Components;
1111
/// <summary>
1212
/// 编辑表单基类
1313
/// </summary>
14-
#if NET6_0_OR_GREATER
1514
[CascadingTypeParameter(nameof(TModel))]
16-
#endif
1715
public partial class EditorForm<TModel> : IShowLabel
1816
{
19-
private string? ClassString => CssBuilder.Default("bb-editor form-body")
17+
private string? ClassString => CssBuilder.Default("bb-editor")
2018
.AddClassFromAttributes(AdditionalAttributes)
2119
.Build();
2220

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.bb-editor {
1+
.bb-editor {
22
position: relative;
33

44
.ef-loading {
@@ -9,8 +9,4 @@
99
bottom: 0;
1010
background-color: var(--bs-body-bg);
1111
}
12-
13-
.bb-editor-footer {
14-
margin-block-start: 1rem;
15-
}
1612
}

src/BootstrapBlazor/Components/Table/Table.razor.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -921,11 +921,12 @@ form .table .table-cell > textarea {
921921
overflow-y: auto;
922922
overflow-x: hidden;
923923
padding: 1rem;
924+
max-height: calc(100vh - 133px);
924925
}
925926

926927
.modal-dialog-table.modal-dialog-scrollable .modal-body .form-footer {
927928
margin: 0;
928-
padding: 1rem;
929+
padding: 0.5rem 1rem;
929930
}
930931

931932
.table-wrap thead th .table-cell .table-text {

0 commit comments

Comments
 (0)