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

@ -2,7 +2,25 @@
@typeparam T @typeparam T
@inherits InputBase<T> @inherits InputBase<T>
<CascadingValue Name="SubscribeToParentForm" Value="@base.SubscribeToParentForm" IsFixed="true">
<div class="@CompiledWrapperClass.Build()"> <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) @if (Adornment == Adornment.Start)
{ {
<InputAdornment Class="@CompiledAdornmentClass.Build()" <InputAdornment Class="@CompiledAdornmentClass.Build()"
@ -21,7 +39,6 @@
<textarea class="@CompiledInputClass.Build()" <textarea class="@CompiledInputClass.Build()"
@ref="ElementReference" @ref="ElementReference"
rows="@NumberOfLines" rows="@NumberOfLines"
style="@Style"
@attributes="@Attributes" @attributes="@Attributes"
type="@InputTypeString" type="@InputTypeString"
placeholder="@Placeholder" placeholder="@Placeholder"
@ -53,7 +70,6 @@
else else
{ {
<input class="@CompiledInputClass.Build()" <input class="@CompiledInputClass.Build()"
style="@Style"
@ref="ElementReference" @ref="ElementReference"
@attributes="@Attributes" @attributes="@Attributes"
step="@Step" step="@Step"
@ -143,6 +159,11 @@
</Button> </Button>
</div> </div>
} }
</CascadingValue>
</InputContent>
</InputControl>
</div> </div>
</CascadingValue>

@ -310,7 +310,6 @@ public partial class Input<T> : InputBase<T>
#endregion #endregion
#region Content placeholders #region Content placeholders
/// <summary> /// <summary>
@ -390,8 +389,24 @@ public partial class Input<T> : InputBase<T>
private bool _showClearable; private bool _showClearable;
private string _internalText; 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 #region Lifecycle events
@ -431,11 +446,4 @@ public partial class Input<T> : InputBase<T>
#endregion #endregion
} }

Loading…
Cancel
Save