Skip to content

Commit

Permalink
Merge pull request Element-Blazor#61 from wzxinchen/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
wzxinchen1 authored Jan 3, 2020
2 parents 1f110a7 + 66f6acb commit 9e4986f
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/dotnetcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ jobs:
with:
token: ${{secrets.github_token}}
- name: pack nuget
run: dotnet pack src/Blazui.Component/Blazui.Component.csproj /p:PackageVersion=0.0.5.${BUILD_NUMBER} -c Release --no-build --no-restore
run: dotnet pack src/Blazui.Component/Blazui.Component.csproj /p:PackageVersion=0.0.6.1 -c Release --no-build --no-restore
- name: push nuget
run: dotnet nuget push src/Blazui.Component/bin/Release/Blazui.Component.0.0.5.${BUILD_NUMBER}.nupkg -s https://api.nuget.org/v3/index.json -k oy2d3zyey6htgrfuck7qs4ywlxl74acujgkpg4w5n4ljna
run: dotnet nuget push src/Blazui.Component/bin/Release/Blazui.Component.0.0.6.1.nupkg -s https://api.nuget.org/v3/index.json -k oy2d3zyey6htgrfuck7qs4ywlxl74acujgkpg4w5n4ljna
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Blazor 组件库 Blazui 开发入门 https://www.cnblogs.com/wzxinchen/p/1209609
| 下拉菜单 | http://blazui.com:9000/dropdown | [] 常规支持 | |
## 更新日志

### 版本 0.0.5.26,2020.01.02发布
### 版本 0.0.6.1,2020.01.03发布
1. 新增 [BDropDown 下拉菜单组件][2]
2. 修复 [Table控件中 日期的格式化不起作用][3]
3. 修复 [table 全选][4]
Expand All @@ -84,6 +84,7 @@ Blazor 组件库 Blazui 开发入门 https://www.cnblogs.com/wzxinchen/p/1209609
12. 修复 [表单下拉列表][13]
13. 添加 [组件可增加一个visible属性,用于隐藏或显示][14]
14. 添加 [弹窗-表单赋值的时候radio组件-枚举值无法绑定][15]
15. 修复 [tab标签页只能关闭当前的][16]

## 感谢

Expand All @@ -106,3 +107,4 @@ Blazor 组件库 Blazui 开发入门 https://www.cnblogs.com/wzxinchen/p/1209609
[13]: https://github.com/wzxinchen/Blazui/issues/28
[14]: https://github.com/wzxinchen/Blazui/issues/14
[15]: https://github.com/wzxinchen/Blazui/issues/13
[16]: https://github.com/wzxinchen/BlazAdmin/issues/22
24 changes: 22 additions & 2 deletions src/Blazui.Component/Button/BButtonBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ protected async Task OnButtonClickedAsync(MouseEventArgs e)
[Parameter]
public string Cls { get; set; }

/// <summary>
/// 是否将自定义的 CSS 类加入到已有 CSS 类,如果为 false,则替换掉默认 CSS 类,默认为 true
/// </summary>
[Parameter]
public bool AppendCustomCls { get; set; } = true;
[Parameter]
public EventCallback<MouseEventArgs> OnClick { get; set; }

Expand Down Expand Up @@ -67,14 +72,29 @@ protected override void OnParametersSet()
{
IsDisabled = true;
}
cssClassBuilder = HtmlPropertyBuilder.CreateCssClassBuilder()
.Add($"el-button", $"el-button--{Type.ToString().ToLower()}", Cls)
cssClassBuilder = HtmlPropertyBuilder.CreateCssClassBuilder();
if (string.IsNullOrWhiteSpace(Cls) || AppendCustomCls)
{
cssClassBuilder.Add($"el-button", $"el-button--{Type.ToString().ToLower()}", Cls)
.AddIf(Size != ButtonSize.Default, $"el-button--{Size.ToString().ToLower()}")
.AddIf(IsPlain, "is-plain")
.AddIf(IsRound, "is-round")
.AddIf(IsDisabled, "is-disabled")
.AddIf(IsLoading, "is-loading")
.AddIf(IsCircle, "is-circle");
return;
}
cssClassBuilder.AddIf(!string.IsNullOrWhiteSpace(Cls), Cls);
if (string.IsNullOrWhiteSpace(Cls))
{
cssClassBuilder.Add($"el-button", $"el-button--{Type.ToString().ToLower()}")
.AddIf(Size != ButtonSize.Default, $"el-button--{Size.ToString().ToLower()}")
.AddIf(IsPlain, "is-plain")
.AddIf(IsRound, "is-round")
.AddIf(IsDisabled, "is-disabled")
.AddIf(IsLoading, "is-loading")
.AddIf(IsCircle, "is-circle");
}
}
}
}
10 changes: 8 additions & 2 deletions src/Blazui.Component/Container/BTabBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,17 @@ private TabOption ResetActiveTab(BTabPanelBase tab)
return null;
}
var activeOption = DataSource.FirstOrDefault(x => x.IsActive);
var activeIndex = DataSource.IndexOf(activeOption);
if (activeOption.Title != tab.Title)
{
return null;
var removingIndex = DataSource.IndexOf(DataSource.FirstOrDefault(x => x.Name == tab.Name));
DataSource.RemoveAt(removingIndex);
if (activeIndex > removingIndex)
{
activeIndex--;
}
return activeOption;
}
var activeIndex = DataSource.IndexOf(activeOption);
DataSource.RemoveAt(activeIndex);
var newActiveIndex = activeIndex;
if (newActiveIndex >= DataSource.Count - 1)
Expand Down
2 changes: 1 addition & 1 deletion src/Blazui.Component/Input/BInputBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ protected override void OnParametersSet()
}
if (FormItem.OriginValueHasRendered)
{
SetFieldValue(Value, false);
SetFieldValue(Value ?? FormItem.Value, false);
return;
}
FormItem.OriginValueHasRendered = true;
Expand Down
4 changes: 4 additions & 0 deletions src/Blazui.Component/NavMenu/BMenuItemBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ protected override void OnInitialized()
{
matchFunc = route =>
{
if (string.IsNullOrWhiteSpace(Route))
{
return false;
}
var uri = new Uri(NavigationManager.Uri);
var paths = uri.LocalPath.Split('/').Where(x => !string.IsNullOrWhiteSpace(x)).ToArray();
var menuPaths = route.Split('/').Where(x => !string.IsNullOrWhiteSpace(x)).ToArray();
Expand Down
12 changes: 6 additions & 6 deletions src/Blazui.Component/Popup/BPopup.razor
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<div role="dialog" aria-modal="true" @ref="option.Element" aria-label="@option.Title" class="el-dialog" style="margin-top:15vh;opacity:0;@width">
<div class="el-dialog__header">
<span class="el-dialog__title">@option.Title</span>
<BButton Icon="el-dialog__close el-icon el-icon-close" Cls="el-dialog__headerbtn" OnClick="(e=>CloseDialogAsync(option,
<BButton Icon="el-dialog__close el-icon el-icon-close" Cls="el-dialog__headerbtn" AppendCustomCls="false" OnClick="(e=>CloseDialogAsync(option,
new DialogResult() {
}))">
</BButton>
Expand Down Expand Up @@ -77,7 +77,7 @@
<!---->
<span>@option.Title</span>
</div>
<BButton Icon="el-message-box__close el-icon-close" Cls="el-message-box__headerbtn" OnClick="(e=>CloseDialogAsync(option, new DialogResult() {
<BButton Icon="el-message-box__close el-icon-close" Cls="el-message-box__headerbtn" AppendCustomCls="false" OnClick="(e=>CloseDialogAsync(option, new DialogResult() {
Result= MessageBoxResult.Close
}))">
</BButton>
Expand Down Expand Up @@ -144,10 +144,10 @@
<div class="el-picker-panel__body-wrapper">
<div class="el-picker-panel__body">
<div class="el-date-picker__header">
<BButton Cls="el-picker-panel__icon-btn el-date-picker__prev-btn el-icon-d-arrow-left" OnClick="e=>GoPrevYear(option)"></BButton>
<BButton Cls="el-picker-panel__icon-btn el-date-picker__prev-btn el-icon-d-arrow-left" AppendCustomCls="false" OnClick="e=>GoPrevYear(option)"></BButton>
@if (option.ShowYear == 0 && option.ShowMonth == 0)
{
<BButton Cls="el-picker-panel__icon-btn el-date-picker__prev-btn el-icon-arrow-left" OnClick="e => option.CurrentMonth = option.CurrentMonth.AddMonths(-1)"></BButton>
<BButton Cls="el-picker-panel__icon-btn el-date-picker__prev-btn el-icon-arrow-left" AppendCustomCls="false" OnClick="e => option.CurrentMonth = option.CurrentMonth.AddMonths(-1)"></BButton>
}
@if (option.ShowYear == 0 && option.ShowMonth == 0)
{
Expand All @@ -164,9 +164,9 @@
}
@if (option.ShowYear == 0 && option.ShowMonth == 0)
{
<BButton Cls="el-picker-panel__icon-btn el-date-picker__next-btn el-icon-arrow-right" OnClick="e => option.CurrentMonth = option.CurrentMonth.AddMonths(1)"></BButton>
<BButton Cls="el-picker-panel__icon-btn el-date-picker__next-btn el-icon-arrow-right" AppendCustomCls="false" OnClick="e => option.CurrentMonth = option.CurrentMonth.AddMonths(1)"></BButton>
}
<BButton Cls="el-picker-panel__icon-btn el-date-picker__next-btn el-icon-d-arrow-right" OnClick="e=>GoNextYear(option)"></BButton>
<BButton Cls="el-picker-panel__icon-btn el-date-picker__next-btn el-icon-d-arrow-right" AppendCustomCls="false" OnClick="e=>GoNextYear(option)"></BButton>
</div>
<div class="el-picker-panel__content">
@if (option.ShowMonth > 0)
Expand Down

0 comments on commit 9e4986f

Please sign in to comment.