Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

【新增】进度条组件 #105

Merged
merged 32 commits into from
Oct 8, 2022
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
f704f78
Add:TProgress Component
wuxinheng Sep 21, 2022
842fa9b
优化:可以在线形内展示进度信息
wuxinheng Sep 21, 2022
0d3820d
优化:
wuxinheng Sep 22, 2022
3b53a9c
上传
wuxinheng Sep 22, 2022
b75aa10
优化部分代码
wuxinheng Sep 22, 2022
518d965
优化:
wuxinheng Sep 22, 2022
0413460
优化
wuxinheng Sep 22, 2022
06e0e6d
新增
wuxinheng Sep 22, 2022
55ac32c
更新:
wuxinheng Sep 22, 2022
5e0f175
新增:
wuxinheng Sep 23, 2022
a75c5f5
新增:
wuxinheng Sep 23, 2022
feb2064
合并master 冲突文件优先使用传入文件
wuxinheng Sep 23, 2022
1e22df6
修改进度条命名空间
wuxinheng Sep 23, 2022
07f70a8
优化:
wuxinheng Sep 23, 2022
e035f91
合并master分支,使用传入项
wuxinheng Sep 24, 2022
b95d609
拆分原有的进度条组件
wuxinheng Sep 25, 2022
69701d8
修改环形进度条逻辑和默认SIze
wuxinheng Sep 26, 2022
fbc6ec0
移动代码文件
wuxinheng Sep 26, 2022
4a74724
完善环形进度条百分比
wuxinheng Sep 26, 2022
9aea2fd
优化进度条代码
wuxinheng Sep 26, 2022
99818e2
删除多余的属性
wuxinheng Sep 26, 2022
e41dae4
删除拓展方法及其使用
wuxinheng Sep 26, 2022
c7acb90
更新文档进度条 Space使用,未完
wuxinheng Sep 26, 2022
9658e25
使用ComponentBuilder 优化代码
wuxinheng Sep 27, 2022
89b9ab0
Merge branch 'feature/component/progress' of https://github.com/Achie…
wuxinheng Sep 27, 2022
709b20b
优化进度条拆分过度组件
wuxinheng Sep 27, 2022
44a6a07
优化文档Space 使用
wuxinheng Sep 27, 2022
9946089
解决从master合并的冲突
teacher-zhou Oct 7, 2022
f278f09
【更新】进度条的实现方式
teacher-zhou Oct 8, 2022
e8459ea
修复 icon 显示不正确的问题
teacher-zhou Oct 8, 2022
4193882
修改迁入代码的自动化编译脚本
teacher-zhou Oct 8, 2022
fcb2e49
删除多余的类
teacher-zhou Oct 8, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions doc/TDesignBlazor.Docs.Shared/Components/Example.razor
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<h2>@Title</h2>
@if (Description is not null)
{
<p>@Description</p>
<p>@Description</p>
}

@*<Tab Position="TDesignBlazor.Position.Top" >
Expand All @@ -18,11 +18,11 @@

<Div AdditionalCssClass="demo-wrapper">
<Div AdditionalCssClass="content" AdditionalStyle="@RunStyle">
@RunContent
@RunContent
</Div>
<Div class="footer">
<Div class="btn">
<Icon AdditionalCssClass="@BtnClass" Name="IconName.Code" Size="24px" @onclick="e=>ToogleCode()" />
<Icon AdditionalCssClass="@BtnClass" Name="IconName.Code" Size="24px" @onclick="e=>ToogleCode()" />
</Div>
</Div>
<Div class="@CodeClass" style="@GetStyle()">
Expand All @@ -37,11 +37,11 @@
[Parameter] public RenderFragment Description { get; set; }
[Parameter] public RenderFragment CodeContent { get; set; }
[Parameter] public RenderFragment RunContent { get; set; }
[Parameter]public string? RunStyle{ get; set; }
[Parameter] public string? RunStyle { get; set; }

bool Active = false;

string GetStyle() =>Active?"": "display:none";
string GetStyle() => Active ? "" : "display:none";
string CodeClass => HtmlHelper.CreateCssBuilder().Append("content code")
//.Append(Active, "code-collapse", "code-expand")
.ToString()
Expand All @@ -55,3 +55,4 @@
StateHasChanged();
}
}

6 changes: 3 additions & 3 deletions doc/TDesignBlazor.Docs.Shared/Layouts/MainLayout.razor
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<LogoContent>
<img alt="TDesignBlazor Logo" width="200" src="https://tdesign.gtimg.com/site/TDesignBlazor.png">
&nbsp;&nbsp;
<h2><i>基于 TDesignBlazor 的 Blazor 企业级组件库</i></h2>
<h2><i>基于 TDesign 的 Blazor 企业级组件库</i></h2>
</LogoContent>
<OperationContent>
<a href="https://github.com/AchievedOwner/TDesignBlazor" title="源码" target="_blank">
Expand All @@ -17,7 +17,7 @@
</HeaderContent>
<LeftSideContent>
<div style="overflow-y:auto;height:95vh;overflow-x:hidden">
<NavMenu />
<NavMenu />
</div>
</LeftSideContent>
<ChildContent>
Expand All @@ -30,4 +30,4 @@
TDesignBlazor © William 2022 当前版本 v0.1
</div>
</FooterContent>
</Layout>
</Layout>
1 change: 1 addition & 0 deletions doc/TDesignBlazor.Docs.Shared/Layouts/NavMenu.razor
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
<MenuItem Link="components/loading">Loading 加载</MenuItem>
<MenuItem Link="components/table">Table 表格</MenuItem>
<MenuItem Link="components/tag">Tag 标签</MenuItem>
<MenuItem Link="components/progress">Progress 进度条</MenuItem>
</MenuItemGroup>
<MenuItemGroup Title="消息提醒">
<MenuItem Link="components/alert">Alert 警告消息</MenuItem>
Expand Down
216 changes: 216 additions & 0 deletions doc/TDesignBlazor.Docs.Shared/Pages/Components/ProgressPage.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
@page "/components/progress"

<PageHeader Title="Progress 进度条">定义:展示操作的当前进度。</PageHeader>

<Example Title="线形进度条">
<Description>以线形表示进度的组件,可以选择性地配有文字或图标补充显示进度和状态。多用于信息量较为丰富的情况。</Description>
<RunContent >
<Space Vertical style="width:500px" >
<SpaceItem>
<div class="Progress-domo-margin">默认样式</div>
<Progress Theme="ProgressThemeType.Line" Percentage="30"></Progress>
</SpaceItem>
<SpaceItem>
<div class="Progress-domo-margin">100%</div>
<Progress Theme="ProgressThemeType.Line" Percentage="100"></Progress>
</SpaceItem>
<SpaceItem>
<div class="Progress-domo-margin">进度完成</div>
<Progress Theme="ProgressThemeType.Line" Status="Status.Success" Percentage="60"></Progress>
</SpaceItem>
<SpaceItem>
<div class="Progress-domo-margin">进度状态发生重大错误</div>
<Progress Theme="ProgressThemeType.Line" Status="Status.Error" Percentage="60"></Progress>
</SpaceItem>
<SpaceItem>
<div class="Progress-domo-margin">进度被中断</div>
<Progress Theme="ProgressThemeType.Line" Status="Status.Warning" Percentage="60"></Progress>
</SpaceItem>
<SpaceItem>
<div class="Progress-domo-margin">渐变色</div>
@{
LinearGradient linearGradient = new LinearGradient() { From = "#0052D9", To = "#00A870" };
}
<Progress Theme="ProgressThemeType.Line" Color="@linearGradient" Percentage="60"></Progress>
</SpaceItem>
<SpaceItem>
<h3>可以在线形内展示进度信息</h3>
<div class="Progress-domo-margin">默认样式</div>
<Progress Theme="ProgressThemeType.Plump" Percentage="30" />

</SpaceItem>
<SpaceItem>
<div class="Progress-domo-margin">进度0-10%时数字位置出现在目前进度的右边区域</div>
<Progress Theme="ProgressThemeType.Plump" Percentage="5" />
</SpaceItem>


</Space>
</RunContent>
<CodeContent>
@Code.Create(@"
teacher-zhou marked this conversation as resolved.
Show resolved Hide resolved
```html
<Space Vertical>
<SpaceItem>
<div class=""Progress-domo-margin"">默认样式</div>
<Progress Theme=""ProgressTheme.line"" Percentage=""30""></Progress>
</SpaceItem>
<SpaceItem>
<div class=""Progress-domo-margin"">100%</div>
<Progress Theme=""ProgressTheme.line"" Percentage=""100""></Progress>
</SpaceItem>
<SpaceItem>
<div class=""Progress-domo-margin"">进度完成</div>
<Progress Theme=""ProgressTheme.line"" Status=""Status.Success"" Percentage=""60""></Progress>
</SpaceItem>
<SpaceItem>
<div class=""Progress-domo-margin"">进度状态发生重大错误</div>
<Progress Theme=""ProgressTheme.line"" Status=""Status.Error"" Percentage=""60""></Progress>
</SpaceItem>
<SpaceItem>
<div class=""Progress-domo-margin"">进度被中断</div>
<Progress Theme=""ProgressTheme.line"" Status=""Status.Warning"" Percentage=""60""></Progress>
</SpaceItem>
<SpaceItem>
<div class=""Progress-domo-margin"">渐变色</div>
@{
LinearGradient linearGradient = new LinearGradient() { From = ""#0052D9"", To = ""#00A870"" };
}
<Progress Theme=""ProgressTheme.line"" Color=""@linearGradient"" Percentage=""60""></Progress>
</SpaceItem>
<SpaceItem>
<h3>可以在线形内展示进度信息</h3>
<div class=""Progress-domo-margin"">默认样式</div>
<Progress Theme=""ProgressTheme.plump"" Percentage=""30"" />
</SpaceItem>
<SpaceItem>
<div class=""Progress-domo-margin"">进度0-10%时数字位置出现在目前进度的右边区域</div>
<Progress Theme=""ProgressTheme.plump"" Percentage=""5"" />
</SpaceItem>
</Space>
```
")
</CodeContent>
</Example>
<Example Title="带图标的标签">
<Description>设置 <code>Icon</code> 图标名称会在前面加图标。</Description>
<RunContent>
<Space Vertical>
<div>默认</div>
<!-- 重要:strokeWidth 大小不能超过 size 的一半,否则无法渲染出环形 -->
<Space>
<Space Vertical>
<div>默认样式</div>
<Progress Theme="ProgressThemeType.Circle" Percentage="30"></Progress>
</Space>
<Space Vertical>
<div>不显示数字</div>
<Progress Theme="ProgressThemeType.Circle" Label="false" Percentage="100" Status="Status.Success"></Progress>
</Space>
<Space Vertical>
<div>自定义内容</div>
@{
var _label = "75day";
}
<Progress Theme="ProgressThemeType.Circle" Label="@_label" Percentage="50" Status="Status.Success"></Progress>
</Space>
</Space>

<Space>
<Space Vertical>
<div>进度完成</div>
<Progress Theme="ProgressThemeType.Circle" Percentage="100" Status="Status.Success"></Progress>
</Space>
<Space Vertical>
<div>进度状态发生错误</div>
<Progress Theme="ProgressThemeType.Circle" Percentage="75" Status="Status.Error"></Progress>
</Space>
<Space Vertical>
<div>进度被中断</div>
<Progress Theme="ProgressThemeType.Circle" Percentage="50" Status="Status.Warning"></Progress>
</Space>
</Space>

<div>默认不同尺寸</div>
<Space>
<Space Vertical>
<div>小尺寸</div>
<Progress Theme="ProgressThemeType.Circle" Percentage="30" Size="Size.Small"></Progress>
</Space>
<Space Vertical>
<div>默认尺寸</div>
<Progress Theme="ProgressThemeType.Circle" Percentage="30" Size="Size.Medium"></Progress>
</Space>
<Space Vertical>
<div>大尺寸</div>
<Progress Theme="ProgressThemeType.Circle" Percentage="75" Size="Size.Large"></Progress>
</Space>
</Space>
</Space>
</RunContent>
<CodeContent>
@Code.Create(@"
```html
<Space Vertical>
<div>默认</div>
<!-- 重要:strokeWidth 大小不能超过 size 的一半,否则无法渲染出环形 -->
<Space>
<Space Vertical>
<div>默认样式</div>
<Progress Theme=""ProgressTheme.circle"" Percentage=""30""></Progress>
</Space>
<Space Vertical>
<div>不显示数字</div>
<Progress Theme=""ProgressTheme.circle"" Label=""false"" Percentage=""100"" Status=""Status.Success""></Progress>
</Space>
<Space Vertical>
<div>自定义内容</div>
@{
var _label = ""75day"";
}
<Progress Theme=""ProgressTheme.circle"" Label=""@_label"" Percentage=""50"" Status=""Status.Success""></Progress>
</Space>
</Space>

<Space>
<Space Vertical>
<div>进度完成</div>
<Progress Theme=""ProgressTheme.circle"" Percentage=""100"" Status=""Status.Success""></Progress>
</Space>
<Space Vertical>
<div>进度状态发生错误</div>
<Progress Theme=""ProgressTheme.circle"" Percentage=""75"" Status=""Status.Error""></Progress>
</Space>
<Space Vertical>
<div>进度被中断</div>
<Progress Theme=""ProgressTheme.circle"" Percentage=""50"" Status=""Status.Warning""></Progress>
</Space>
</Space>

<div>默认不同尺寸</div>
<Space>
<Space Vertical>
<div>小尺寸</div>
<Progress Theme=""ProgressTheme.circle"" Percentage=""30"" Size=""Size.Small""></Progress>
</Space>
<Space Vertical>
<div>默认尺寸</div>
<Progress Theme=""ProgressTheme.circle"" Percentage=""30"" Size=""Size.Medium""></Progress>
</Space>
<Space Vertical>
<div>大尺寸</div>
<Progress Theme=""ProgressTheme.circle"" Percentage=""75"" Size=""Size.Large""></Progress>
</Space>
</Space>
</Space>
```
")
</CodeContent>
</Example>


@inject IJSRuntime JS
@code {
bool Checked1;
}

Loading