mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-05 13:37:35 +08:00
95c4f13aa4
* fix(module: form): validation status styles * fix validation change for input * fix count * add test
67 lines
2.9 KiB
C#
67 lines
2.9 KiB
C#
@namespace AntDesign
|
|
@inherits Input<string>
|
|
|
|
@{
|
|
Dictionary<string, object> attributes =
|
|
new Dictionary<string, object>()
|
|
{
|
|
//{ "onchange", EventUtil.AsNonRenderingEventHandler<ChangeEventArgs>(e => OnChangeAsync(e)) },
|
|
//{ "onblur", EventUtil.AsNonRenderingEventHandler<FocusEventArgs>(e => OnBlurAsync(e)) },
|
|
//{ "oninput", EventUtil.AsNonRenderingEventHandler<ChangeEventArgs>(e => OnInputAsync(e)) },
|
|
//{ "onkeypress", EventUtil.AsNonRenderingEventHandler<KeyboardEventArgs>(e => OnKeyPressAsync(e)) },
|
|
//{ "onkeyup", EventUtil.AsNonRenderingEventHandler<KeyboardEventArgs>(e => OnKeyUpAsync(e)) },
|
|
//{ "onkeydown", EventUtil.AsNonRenderingEventHandler<KeyboardEventArgs>(e => OnkeyDownAsync(e)) },
|
|
//{ "onfocus", EventUtil.AsNonRenderingEventHandler<FocusEventArgs>(e => OnFocusAsync(e)) },
|
|
{ "onchange", CallbackFactory.Create(this, OnChangeAsync) },
|
|
{ "onblur", CallbackFactory.Create(this, OnBlurAsync) },
|
|
{ "oninput", CallbackFactory.Create(this, OnInputAsync) },
|
|
{ "onkeypress", CallbackFactory.Create(this, OnKeyPressAsync) },
|
|
{ "onkeyup", CallbackFactory.Create(this, OnKeyUpAsync) },
|
|
{ "onkeydown", CallbackFactory.Create(this, OnkeyDownAsync) },
|
|
{ "onfocus", CallbackFactory.Create(this, OnFocusAsync) },
|
|
{ "value", CurrentValueAsString },
|
|
{ "placeholder", Placeholder },
|
|
{ "id", Id },
|
|
//{ "style", Style },
|
|
//{ "class", ClassMapper.Class },
|
|
{ "disabled", Disabled },
|
|
{ "readonly", ReadOnly },
|
|
};
|
|
|
|
if (AutoSize == false)
|
|
{
|
|
attributes.Add("style", _heightStyle + Style);
|
|
}
|
|
|
|
if (Attributes != null)
|
|
{
|
|
Attributes.Keys.ForEach(key => { attributes[key] = Attributes[key]; });
|
|
}
|
|
}
|
|
|
|
<div class="@ClassMapper.Class" style="@Style" @ref="Ref" data-count="@(Count)">
|
|
@if (Suffix != null || AllowClear || FormItem?.FeedbackIcon != null)
|
|
{
|
|
<span class="@_warpperClassMapper.Class">
|
|
<textarea @ref="_textareaRef" class="@_textareaClassMapper.Class" @attributes="attributes" @onchange:stopPropagation="@StopPropagation" @onblur:stopPropagation="@StopPropagation" />
|
|
<span class="ant-input-textarea-suffix">
|
|
@if (AllowClear)
|
|
{
|
|
@ClearIcon
|
|
}
|
|
@if (Suffix != null)
|
|
{
|
|
@Suffix
|
|
}
|
|
@if (FormItem?.FeedbackIcon != null)
|
|
{
|
|
@FormItem.FeedbackIcon
|
|
}
|
|
</span>
|
|
</span>
|
|
}
|
|
else
|
|
{
|
|
<textarea @ref="_textareaRef" class="@_textareaClassMapper.Class" @attributes="attributes" @onchange:stopPropagation="@StopPropagation" @onblur:stopPropagation="@StopPropagation" />
|
|
}
|
|
</div> |