Skip to content

Commit 30c9761

Browse files
authored
重构 STextField 组件并优化样式 (#783)
1 parent 5e3cc29 commit 30c9761

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

src/Masa.Stack.Components/Shared/IntegrationComponents/STextField.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
namespace Masa.Stack.Components;
1+
using Masa.Stack.Components.Standalone;
2+
3+
namespace Masa.Stack.Components;
24

35
public class STextField<TValue> : MTextField<TValue>
46
{
@@ -29,7 +31,7 @@ public class STextField<TValue> : MTextField<TValue>
2931
private RenderFragment? _tooltipContent;
3032
private RenderFragment? _actionContent;
3133
private string? _fieldName;
32-
34+
3335
public override async Task SetParametersAsync(ParameterView parameters)
3436
{
3537
Dense = true;
@@ -42,7 +44,7 @@ public override async Task SetParametersAsync(ParameterView parameters)
4244
protected override void OnParametersSet()
4345
{
4446
base.OnParametersSet();
45-
47+
4648
// TODO: refactor the following code about css
4749
Class ??= "";
4850
if (Large is false && Small is false) Medium = true;
@@ -77,14 +79,14 @@ protected override void OnParametersSet()
7779
if (Action is not null)
7880
{
7981
Action.Invoke(InternalAction);
80-
82+
8183
_actionContent ??= builder =>
8284
{
8385
builder.OpenComponent<MDivider>(0);
8486
builder.AddAttribute(1, "Vertical", true);
8587
builder.CloseComponent();
86-
87-
builder.OpenComponent<SAutoLoadingButton>(2);
88+
89+
builder.OpenComponent<SBtn>(2);
8890
builder.AddAttribute(3, "Text", InternalAction.Text);
8991
builder.AddAttribute(4, "Disabled", InternalAction.Disabled);
9092
builder.AddAttribute(5, "Color", InternalAction.Color);
@@ -94,7 +96,7 @@ protected override void OnParametersSet()
9496
builder.AddAttribute(9, "ChildContent", (RenderFragment)(cb => cb.AddContent(9, InternalAction.Content)));
9597
builder.CloseComponent();
9698
};
97-
99+
98100
AppendContent = _actionContent;
99101
}
100102

src/Masa.Stack.Components/wwwroot/css/app.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,8 @@ h1:focus {
506506

507507
.masa-stack-components .m-text-field--outlined.m-input--dense.m-input--dense-48 .m-input__append-inner {
508508
margin-top: 12px;
509+
height: 48px;
510+
margin-right: -12px;
509511
}
510512

511513
.masa-stack-components .m-text-field--outlined.m-input--dense.m-input--dense-40 .m-label {

0 commit comments

Comments
 (0)