!2839 feat(#I5A1Z0): update divider style

* refactor: 更改文件名
* refactor: 更改文件名
* doc: 更新示例
* refactor: 移除 wrap 节点
* Merge branch 'main' into feat-linkbutton
* chore: bump version to 6.6.20
* style: 微调垂直布局样式
* test: 增加 Zip 单元测试
* chore: 更新打包脚本文件
* feat: 更新分割线默认颜色
* doc: 更新示例文档
* feat: 更改继承父类为 ButtonBase 支持禁用等功能
* feat: 增加垂直布局样式
pull/2840/MERGE
Argo 3 years ago
parent 4befa09173
commit 65d45563c0

@ -2320,7 +2320,7 @@
"LinkButtonText": "LinkButton",
"LinkButtonUrlTitle": "Navigation Url",
"LinkButtonUrlIntro": "Set <code>Url</code> for navigation Url",
"LinkButtonTitleTitle": "Navigation Url",
"LinkButtonTitleTitle": "Tooltip",
"LinkButtonTitleTooltip": "this is Tooltip title",
"LinkButtonTitleIntro": "Set <code>Title</code> for tooltip",
"LinkButtonTitleDetail": "show <code>Tooltip</code> when hover on this button",

@ -2325,7 +2325,7 @@
"LinkButtonText": "链接按钮",
"LinkButtonUrlTitle": "导航地址",
"LinkButtonUrlIntro": "通过 <code>Url</code> 值设置导航地址",
"LinkButtonTitleTitle": "导航地址",
"LinkButtonTitleTitle": "提示信息",
"LinkButtonTitleTooltip": "我是提示信息条",
"LinkButtonTitleIntro": "通过 <code>Title</code> 值设置链接按钮 <code>Tooltip</code>",
"LinkButtonTitleDetail": "鼠标悬停到按钮上时显示 <code>Tooltip</code>",

@ -40,20 +40,20 @@
<span>@Localizer["S3"]</span>
</div>
<Divider Text="@Localizer["D5"]"></Divider>
<div class="d-flex">
<div class="border border-primary" style="width:100px; height:100px;"></div>
<div class="d-flex" style="height: 100px;">
<div class="border border-primary" style="width:100px; height:100%;"></div>
<Divider IsVertical="true"></Divider>
<div class="border border-success" style="width:100px; height:100px;"></div>
<div class="border border-success" style="width:100px; height:100%;"></div>
<Divider IsVertical="true"></Divider>
<div class="border border-info" style="width:100px; height:100px;"></div>
<div class="border border-info" style="width:100px; height:100%;"></div>
</div>
<Divider Text="@Localizer["D5"]"></Divider>
<div class="d-flex">
<div class="border border-primary" style="width:100px; height:200px;"></div>
<div class="d-flex" style="height: 200px;">
<div class="border border-primary" style="width:100px; height:100%;"></div>
<Divider IsVertical="true" Text="@Localizer["D5"]"></Divider>
<div class="border border-success" style="width:100px; height:200px;"></div>
<div class="border border-success" style="width:100px; height:100%;"></div>
<Divider IsVertical="true" Text="@Localizer["D5"]"></Divider>
<div class="border border-info" style="width:100px; height:200px;"></div>
<div class="border border-info" style="width:100px; height:100%;"></div>
</div>
</DemoBlock>

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<Version>6.6.19</Version>
<Version>6.6.20</Version>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">

@ -1,7 +1,11 @@
/*divider*/
.divider {
background-color: transparent;
background-color: #dcdfe6;
position: relative;
margin: 1rem 0;
display: block;
height: 1px;
width: 100%;
}
.divider .divider-text {
@ -13,34 +17,24 @@
font-size: 14px;
}
.divider.divider-horizontal {
display: block;
width: 100%;
}
.divider.divider-horizontal .divider-text.is-left {
.divider .divider-text.is-left {
left: 20px;
transform: translateY(-50%);
}
.divider.divider-horizontal .divider-text.is-center {
.divider .divider-text.is-center {
left: 50%;
transform: translateX(-50%) translateY(-50%);
}
.divider.divider-horizontal .divider-text.is-right {
.divider .divider-text.is-right {
right: 20px;
transform: translateY(-50%);
}
.divider .divider-wrap {
height: 1px;
margin: 1rem 0;
background-color: #dcdfe6;
}
.divider-vertical {
width: 1px;
height: 100%;
margin: 0 1rem;
}

@ -2,17 +2,15 @@
@inherits BootstrapComponentBase
<div @attributes="@AdditionalAttributes" class="@ClassString">
<div class="divider-wrap">
<div class="@TextClassString">
@if (!string.IsNullOrEmpty(Icon))
{
<i class="@Icon"></i>
}
@if (!string.IsNullOrEmpty(Text))
{
<span>@Text</span>
}
@ChildContent
</div>
<div class="@TextClassString">
@if (!string.IsNullOrEmpty(Icon))
{
<i class="@Icon"></i>
}
@if (!string.IsNullOrEmpty(Text))
{
<span>@Text</span>
}
@ChildContent
</div>
</div>

@ -15,7 +15,6 @@ public partial class Divider
/// 获得 class 样式集合
/// </summary>
protected virtual string? ClassString => CssBuilder.Default("divider")
.AddClass("divider-horizontal", !IsVertical)
.AddClass("divider-vertical", IsVertical)
.AddClassFromAttributes(AdditionalAttributes)
.Build();

File diff suppressed because one or more lines are too long

@ -0,0 +1,66 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Website: https://www.blazor.zone or https://argozhang.github.io/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace UnitTest.Utils;
public class LinqTest
{
[Fact]
public void Union_Ok()
{
var foo1 = new Dummy[]
{
new Dummy()
{
Name = "Test1",
Items = new List<string>() { "Test_Item_1" }
},
new Dummy()
{
Name = "Test2",
Items = new List<string>() { "Test_Item_4" }
}
};
var foo2 = new Dummy[]
{
new Dummy()
{
Name = "Test1",
Items = new List<string>() { "Test_Item_2", "Test_Item_3" }
},
new Dummy()
{
Name = "Test2",
Items = new List<string>() { "Test_Item_5", "Test_Item_6" }
}
};
var foo3 = foo1.Zip(foo2, (f1, f2) =>
{
var items = new List<string>();
items.AddRange(f1.Items);
items.AddRange(f2.Items);
return new Dummy()
{
Name = f1.Name,
Items = items
};
});
Assert.Equal(2, foo3.Count());
Assert.Equal(new List<string>() { "Test_Item_1", "Test_Item_2", "Test_Item_3" }, foo3.First().Items);
}
private class Dummy
{
public string? Name { get; set; }
public List<string> Items { get; set; } = new List<string>();
}
}
Loading…
Cancel
Save