features/refactor
stm 2 years ago
parent 3ea88592ce
commit 46c396e33f

@ -2,7 +2,25 @@
@typeparam T
@inherits InputBase<T>
<div class="@CompiledWrapperClass.Build()">
<CascadingValue Name="SubscribeToParentForm" Value="@base.SubscribeToParentForm" IsFixed="true">
<div class="@CompiledWrapperClass.Build()">
<InputControl Label="@Label"
Variant="@Variant"
HelperText="@HelperText"
HelperTextOnFocus="@HelperTextOnFocus"
CounterText="@CounterText"
FullWidth="@FullWidth"
class="@CompiledHelperContainerClassList.Build()"
Error="@HasErrors"
ErrorText="@GetErrorText()"
ErrorId="@ErrorId"
Disabled="@Disabled"
Margin="@Margin"
Required="@Required"
ForId="@FieldId">
<InputContent>
<CascadingValue Name="SubscribeToParentForm" Value="false" IsFixed="true">
@if (Adornment == Adornment.Start)
{
<InputAdornment Class="@CompiledAdornmentClass.Build()"
@ -21,7 +39,6 @@
<textarea class="@CompiledInputClass.Build()"
@ref="ElementReference"
rows="@NumberOfLines"
style="@Style"
@attributes="@Attributes"
type="@InputTypeString"
placeholder="@Placeholder"
@ -53,7 +70,6 @@
else
{
<input class="@CompiledInputClass.Build()"
style="@Style"
@ref="ElementReference"
@attributes="@Attributes"
step="@Step"
@ -143,6 +159,11 @@
</Button>
</div>
}
</div>
</CascadingValue>
</InputContent>
</InputControl>
</div>
</CascadingValue>

@ -310,7 +310,6 @@ public partial class Input<T> : InputBase<T>
#endregion
#region Content placeholders
/// <summary>
@ -390,8 +389,24 @@ public partial class Input<T> : InputBase<T>
private bool _showClearable;
private string _internalText;
#endregion
/// <summary>
/// Sets the input text from outside programmatically
/// </summary>
/// <param name="text"></param>
/// <returns></returns>
public Task SetText(string text)
{
_internalText = text;
return SetTextAsync(text);
}
private bool HasNativeHtmlPlaceholder()
{
return GetInputType() is InputType.Color or InputType.Date or InputType.DateTimeLocal or InputType.Month
or InputType.Time or InputType.Week;
}
#endregion
#region Lifecycle events
@ -431,11 +446,4 @@ public partial class Input<T> : InputBase<T>
#endregion
}

Loading…
Cancel
Save