mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-02 12:07:44 +08:00
9c69ef4061
* feat(module: mentions): Add ability to customize the rendering of the textarea. This allows using the TextArea component if you want its extended functionality. Add tests. Update demos. * fix test * fix test --------- Co-authored-by: James Yeung <shunjiey@hotmail.com>
56 lines
2.0 KiB
C#
56 lines
2.0 KiB
C#
@namespace AntDesign
|
|
@using AntDesign.Internal
|
|
@inherits AntDomComponentBase
|
|
<CascadingValue Value='$"ant-mentions-dropdown"' Name="PrefixCls" IsFixed>
|
|
<OverlayTrigger @ref="_overlayTrigger"
|
|
Trigger="new[] { Trigger.None }"
|
|
OverlayLeaveCls=""
|
|
OverlayEnterCls=""
|
|
HiddenMode=true
|
|
InlineFlexMode=false>
|
|
<Overlay>
|
|
<CascadingValue Value=this>
|
|
@if (OriginalOptions.Count > 0)
|
|
{
|
|
<ul class="ant-mentions-dropdown-menu ant-mentions-dropdown-menu-root ant-mentions-dropdown-menu-vertical">
|
|
@foreach (var item in ShowOptions)
|
|
{
|
|
<MentionsOption Value="@item.Value">@item.ChildContent</MentionsOption>
|
|
}
|
|
</ul>
|
|
}
|
|
else
|
|
{
|
|
@ChildContent
|
|
}
|
|
</CascadingValue>
|
|
</Overlay>
|
|
|
|
<Unbound>
|
|
<div class="@ClassMapper.Class">
|
|
@if (TextareaTemplate == null)
|
|
{
|
|
<textarea value="@Value"
|
|
@ref="context.Current"
|
|
@attributes="@Attributes"
|
|
@onkeydown="OnKeyDown"
|
|
@oninput="OnInput"
|
|
style="@Style"
|
|
class="rc-textarea"
|
|
placeholder="@Placeholder"
|
|
rows="@Rows" />
|
|
}
|
|
else
|
|
{
|
|
@TextareaTemplate(new MentionsTextareaTemplateOptions{
|
|
Value = Value,
|
|
OnInput = OnInput,
|
|
OnKeyDown = OnKeyDown,
|
|
RefBack = context
|
|
});
|
|
}
|
|
</div>
|
|
</Unbound>
|
|
</OverlayTrigger>
|
|
</CascadingValue>
|