2020-05-29 00:33:49 +08:00
|
|
|
|
@namespace AntDesign
|
2020-06-27 01:20:52 +08:00
|
|
|
|
@inherits Input<string>
|
2020-03-23 09:31:08 +08:00
|
|
|
|
<!--TODO: minheight, maxheight, onResize-->
|
|
|
|
|
|
2020-07-07 12:44:10 +08:00
|
|
|
|
@{
|
|
|
|
|
Dictionary<string, object> attributes =
|
|
|
|
|
new Dictionary<string, object>()
|
|
|
|
|
{
|
|
|
|
|
{ "onchange", CallbackFactory.Create(this, OnChangeAsync) },
|
2020-08-26 22:37:08 +08:00
|
|
|
|
{ "onblur", CallbackFactory.Create(this, OnBlurAsync) },
|
2020-07-07 12:44:10 +08:00
|
|
|
|
{ "oninput", CallbackFactory.Create(this, OnInputAsync) },
|
2020-07-30 09:06:56 +08:00
|
|
|
|
{ "onkeypress", CallbackFactory.Create(this, OnKeyPressAsync) },
|
|
|
|
|
{ "onkeyup", CallbackFactory.Create(this, OnKeyUpAsync) },
|
2020-08-26 22:37:08 +08:00
|
|
|
|
{ "onkeydown", CallbackFactory.Create(this, OnkeyDownAsync) },
|
|
|
|
|
{ "onfocus", CallbackFactory.Create(this, OnFocusAsync) },
|
2020-07-07 12:44:10 +08:00
|
|
|
|
{ "value", CurrentValueAsString },
|
|
|
|
|
{ "placeholder", Placeholder },
|
|
|
|
|
{ "id", Id },
|
|
|
|
|
{ "style", Style },
|
|
|
|
|
{ "class", ClassMapper.Class },
|
2021-01-27 13:42:04 +08:00
|
|
|
|
{ "disabled", Disabled },
|
2021-05-27 18:13:26 +08:00
|
|
|
|
{ "readonly", ReadOnly },
|
2021-03-12 17:02:11 +08:00
|
|
|
|
};
|
2020-07-07 12:44:10 +08:00
|
|
|
|
|
|
|
|
|
if (Attributes != null)
|
|
|
|
|
{
|
|
|
|
|
Attributes.Keys.ForEach(key => { attributes[key] = Attributes[key]; });
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-27 18:13:26 +08:00
|
|
|
|
@if (ShowCount)
|
2020-07-07 12:44:10 +08:00
|
|
|
|
{
|
2021-05-27 18:13:26 +08:00
|
|
|
|
<div class="ant-input=textarea ant-input-textarea-show-count" data-count="@(Value?.Length ?? 0)">
|
|
|
|
|
@if (Suffix != null)
|
|
|
|
|
{
|
|
|
|
|
<span class="@_warpperClassMapper.Class">
|
|
|
|
|
<textarea @ref="Ref" @attributes="attributes"/>
|
|
|
|
|
@Suffix
|
|
|
|
|
</span>
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
<textarea @ref="Ref" @attributes="attributes"/>
|
|
|
|
|
}
|
|
|
|
|
<AntDesign.Text Style="float: right; pointer-events: none; white-space: nowrap; color: rgba(0, 0, 0, 0.45)"> @($"/ {MaxLength}")</AntDesign.Text>
|
|
|
|
|
</div>
|
2020-07-07 12:44:10 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2021-05-27 18:13:26 +08:00
|
|
|
|
@if (Suffix != null)
|
|
|
|
|
{
|
|
|
|
|
<span class="@_warpperClassMapper.Class">
|
|
|
|
|
<textarea @ref="Ref" @attributes="attributes"/>
|
|
|
|
|
@Suffix
|
|
|
|
|
</span>
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
<textarea @ref="Ref" @attributes="attributes"/>
|
|
|
|
|
}
|
|
|
|
|
}
|