Revert "refactor(module: steps): Add steps constants (#4267)"

This reverts commit 2ea81fc38c.
This commit is contained in:
James Yeung 2024-10-18 09:25:09 +08:00 коммит произвёл GitHub
Родитель 5bc763172b
Коммит 079bebcf9a
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
18 изменённых файлов: 50 добавлений и 109 удалений

Просмотреть файл

@ -14,7 +14,7 @@
{
<div class="ant-steps-progress-icon">
<Progress Percent="@((double) Percent)"
Width=@(Size == StepsSize.Small ? 32 : 40)
Width=@(Size == "small" ? 32 : 40)
Type=ProgressType.Circle
StrokeWidth="4"
Format=@((p) => "") />
@ -22,22 +22,22 @@
@if (string.IsNullOrEmpty(Icon))
{
if (Status == StepsStatus.Finish)
if (Status == "finish")
{
<Icon Type="check"></Icon>
}
else if (Status == StepsStatus.Error)
else if (Status == "error")
{
<Icon Type="close"></Icon>
}
else if (Status == StepsStatus.Process || Status == StepsStatus.Wait)
else if (Status == "process" || Status == "wait")
{
@(Index + 1)
}
}
else
{
if (Status == StepsStatus.Error)
if (Status == "error")
{
<Icon Type="close"></Icon>
}
@ -55,22 +55,22 @@
@if (string.IsNullOrEmpty(Icon))
{
if (Status == StepsStatus.Finish)
if (Status == "finish")
{
<Icon Type="check"></Icon>
}
else if (Status == StepsStatus.Error)
else if (Status == "error")
{
<Icon Type="close"></Icon>
}
else if (Status == StepsStatus.Process || Status == StepsStatus.Wait)
else if (Status == "process" || Status == "wait")
{
@(Index + 1)
}
}
else
{
if (Status == StepsStatus.Error)
if (Status == "error")
{
<Icon Type="close"></Icon>
}

Просмотреть файл

@ -13,7 +13,7 @@ namespace AntDesign
/// </summary>
public partial class Step : AntDomComponentBase
{
private string _status = StepsStatus.Wait;
private string _status = "wait";
private bool _isCustomStatus;
private int _groupCurrent;
@ -35,7 +35,7 @@ namespace AntDesign
_groupCurrent = value;
if (!_isCustomStatus)
{
this._status = value > this.Index ? StepsStatus.Finish : value == this.Index ? GroupStatus ?? string.Empty : StepsStatus.Wait;
this._status = value > this.Index ? "finish" : value == this.Index ? GroupStatus ?? string.Empty : "wait";
}
InvokeStateHasChanged();
}
@ -43,9 +43,9 @@ namespace AntDesign
internal int Index { get; set; }
internal double? Percent { get; set; }
internal string Size { get; set; } = StepsSize.Default;
internal string Size { get; set; } = "default";
internal RenderFragment ProgressDot { get; set; }
internal string Direction { get; set; } = StepsDirection.Horizontal;
internal string Direction { get; set; } = "horizontal";
[CascadingParameter]
public Steps Parent { get; set; }
@ -158,7 +158,7 @@ namespace AntDesign
.If($"{prefixName}-active", () => Parent.Current == Index)
.If($"{prefixName}-disabled", () => Disabled)
.If($"{prefixName}-custom", () => !string.IsNullOrEmpty(Icon))
.If($"ant-steps-next-error", () => GroupStatus == StepsStatus.Error && Parent.Current == Index + 1)
.If($"ant-steps-next-error", () => GroupStatus == "error" && Parent.Current == Index + 1)
.If($"{prefixName}-rtl", () => RTL)
;
}

Просмотреть файл

@ -75,28 +75,28 @@ namespace AntDesign
/// </summary>
/// <default value="horizontal" />
[Parameter]
public string Direction { get; set; } = StepsDirection.Horizontal;
public string Direction { get; set; } = "horizontal";
/// <summary>
/// Place title and description horizontal or vertical
/// </summary>
/// <default value="horizontal" />
[Parameter]
public string LabelPlacement { get; set; } = StepsLabelPlacement.Horizontal;
public string LabelPlacement { get; set; } = "horizontal";
/// <summary>
/// Type of steps. Possible Values: default, navigation
/// </summary>
/// <default value="default" />
[Parameter]
public string Type { get; set; } = StepsType.Navigation;
public string Type { get; set; } = "default";
/// <summary>
/// Size of steps. Possible Values: default, small
/// </summary>
/// <default value="default" />
[Parameter]
public string Size { get; set; } = StepsSize.Default;
public string Size { get; set; } = "default";
/// <summary>
/// Starting step index
@ -110,7 +110,7 @@ namespace AntDesign
/// </summary>
/// <default value="process" />
[Parameter]
public string Status { get; set; } = StepsStatus.Process;
public string Status { get; set; } = "process";
/// <summary>
/// Child content should contain Step elements
@ -198,13 +198,14 @@ namespace AntDesign
ClassMapper.Clear()
.Add(prefixName)
.GetIf(() => $"{prefixName}-{Direction}", () => !string.IsNullOrEmpty(Direction))
.If($"{prefixName}-label-horizontal", () => Direction == StepsDirection.Horizontal)
.If($"{prefixName}-label-vertical", () => (_showProgressDot || LabelPlacement == StepsLabelPlacement.Vertical) && Direction == StepsDirection.Horizontal)
.If($"{prefixName}-label-horizontal", () => Direction == "horizontal")
.If($"{prefixName}-label-vertical", () => (_showProgressDot || LabelPlacement == "vertical") && Direction == "horizontal")
.If($"{prefixName}-dot", () => _showProgressDot)
.If($"{prefixName}-small", () => Size == StepsSize.Small)
.If($"{prefixName}-navigation", () => Type == StepsType.Navigation)
.If($"{prefixName}-small", () => Size == "small")
.If($"{prefixName}-navigation", () => Type == "navigation")
.If($"{prefixName}-with-progress", () => Percent != null)
.If($"{prefixName}-rtl", () => RTL);
.If($"{prefixName}-rtl", () => RTL)
;
}
}
}

Просмотреть файл

@ -1,12 +0,0 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
namespace AntDesign
{
public static class StepsDirection
{
public const string Horizontal = "horizontal";
public const string Vertical = "vertical";
}
}

Просмотреть файл

@ -1,12 +0,0 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
namespace AntDesign
{
public static class StepsLabelPlacement
{
public const string Horizontal = "horizontal";
public const string Vertical = "vertical";
}
}

Просмотреть файл

@ -1,12 +0,0 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
namespace AntDesign
{
public static class StepsSize
{
public const string Default = "default";
public const string Small = "small";
}
}

Просмотреть файл

@ -1,14 +0,0 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
namespace AntDesign
{
public static class StepsStatus
{
public const string Wait = "wait";
public const string Process = "process";
public const string Finish = "finish";
public const string Error = "error";
}
}

Просмотреть файл

@ -1,12 +0,0 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
namespace AntDesign
{
public static class StepsType
{
public const string Default = "default";
public const string Navigation = "navigation";
}
}

Просмотреть файл

@ -1,5 +1,5 @@
<div>
<Steps Current="current" OnChange="onChange">
<Steps Current=current OnChange=onChange>
<Step Title="Step 1" Description="This is a description." />
<Step Title="Step 2" Description="This is a description." />
<Step Title="Step 3" Description="This is a description." />
@ -7,7 +7,7 @@
<Divider />
<Steps Current="current" OnChange="onChange" Direction="@StepsDirection.Vertical">
<Steps Current=current OnChange=onChange Direction="vertical">
<Step Title="Step 1" Description="This is a description." />
<Step Title="Step 2" Description="This is a description." />
<Step Title="Step 3" Description="This is a description." />

Просмотреть файл

@ -1,4 +1,4 @@
<Steps Current="1" ProgressDot="@customDot">
<Steps Current=1 ProgressDot=@customDot>
<Step Title="Finished" Description="You can hover on the dot." />
<Step Title="In Progress" Description="You can hover on the dot." />
<Step Title="Waiting" Description="You can hover on the dot." />

Просмотреть файл

@ -1,5 +1,5 @@
<div>
<Steps Current="1" Status="@StepsStatus.Error">
<Steps Current="1" Status="error">
<Step Title="Finished" Description="This is a description." />
<Step Title="In Progress" Description="This is a description." />
<Step Title="Waiting" Description="This is a description." />

Просмотреть файл

@ -1,8 +1,8 @@
<div>
<Steps>
<Step Status="@StepsStatus.Finish" Title="Login" Icon="user" />
<Step Status="@StepsStatus.Finish" Title="Verification" Icon="solution" />
<Step Status="@StepsStatus.Process" Title="Pay" Icon="loading" />
<Step Status="@StepsStatus.Wait" Title="Done" Icon="smile"/>
<Step Status="finish" Title="Login" Icon="user" />
<Step Status="finish" Title="Verification" Icon="solution" />
<Step Status="process" Title="Pay" Icon="loading" />
<Step Status="wait" Title="Done" Icon="smile"/>
</Steps>
</div>

Просмотреть файл

@ -1,23 +1,24 @@
<div>
<Steps Type="@StepsType.Navigation" Size="@StepsSize.Small" Current="@current" Class="site-navigation-steps">
<Steps Type="navigation" Size="small" Current=@current Class="site-navigation-steps">
<Step Title="Step 1" Subtitle="00:00:05" Status="finish" Description="This is a description." />
<Step Title="Step 2" Subtitle="00:01:02" Status="process" Description="This is a description." />
<Step Title="Step 3" Subtitle="waiting for longlong time" Status="wait" Description="This is a description." />
</Steps>
<Steps Type="@StepsType.Navigation" Current="@current" Class="site-navigation-steps">
<Step Status="@StepsStatus.Finish" Title="Step 1" />
<Step Status="@StepsStatus.Process" Title="Step 2" />
<Step Status="@StepsStatus.Wait" Title="Step 3" />
<Step Status="@StepsStatus.Wait" Title="Step 4" />
<Steps Type="navigation" Current="@current" Class="site-navigation-steps">
<Step Status="finish" Title="Step 1" />
<Step Status="process" Title="Step 2" />
<Step Status="wait" Title="Step 3" />
<Step Status="wait" Title="Step 4" />
</Steps>
<Steps Type="@StepsType.Navigation" Size="@StepsSize.Small" Current="@current" Class="site-navigation-steps">
<Step Status="@StepsStatus.Finish" Title="Finish 1" />
<Step Status="@StepsStatus.Finish" Title="Finish 2" />
<Step Status="@StepsStatus.Process" Title="Current Process" />
<Step Status="@StepsStatus.Wait" Title="Wait" Disabled />
<Steps Type="navigation" Size="small" Current="@current" Class="site-navigation-steps">
<Step Status="finish" Title="finish 1" />
<Step Status="finish" Title="finish 2" />
<Step Status="process" Title="current process" />
<Step Status="wait" Title="wait" Disabled />
</Steps>
</div>
@code {
int current;
}

Просмотреть файл

@ -5,7 +5,7 @@
<Step Title="Waiting" Description="This is a description." />
</Steps>
<Divider />
<Steps ShowProgressDot Current="1" Direction="@StepsDirection.Vertical">
<Steps ShowProgressDot Current="1" Direction="vertical">
<Step Title="Finished" Description="This is a description. This is a description." />
<Step Title="Finished" Description="This is a description. This is a description." />
<Step Title="In Progress" Description="This is a description. This is a description." />

Просмотреть файл

@ -1,5 +1,5 @@
<div>
<Steps Size="@StepsSize.Small" Current=1>
<Steps Size="small" Current=1>
<Step Title="Finished" />
<Step Title="In Progress" />
<Step Title="Waiting" />

Просмотреть файл

@ -24,6 +24,7 @@
Done
</Button>
}
</div>
</div>

Просмотреть файл

@ -1,5 +1,5 @@
<div>
<Steps Direction="@StepsDirection.Vertical" Current="1">
<Steps Direction="vertical" Current="1">
<Step Title="Finished" Description="This is a description." />
<Step Title="In Progress" Description="This is a description." />
<Step Title="Waiting" Description="This is a description." />

Просмотреть файл

@ -1,5 +1,5 @@
<div>
<Steps Direction="@StepsDirection.Vertical" Size="@StepsSize.Small" Current="1">
<Steps Direction="vertical" Size="small" Current="1">
<Step Title="Finished" Description="This is a description." />
<Step Title="In Progress" Description="This is a description." />
<Step Title="Waiting" Description="This is a description." />