2020-05-29 00:33:49 +08:00
|
|
|
|
@namespace AntDesign
|
2020-05-03 21:46:21 +08:00
|
|
|
|
@inherits AntDomComponentBase
|
|
|
|
|
|
2020-05-21 14:49:07 +08:00
|
|
|
|
@if (Grid == null)
|
|
|
|
|
{
|
2021-01-21 17:20:10 +08:00
|
|
|
|
<li class="@ClassMapper.Class" style="@Style" Id="@Id" @onclick="HandleClick" @onclick:stopPropagation @ref="Ref">
|
2020-05-21 14:49:07 +08:00
|
|
|
|
@itemChildren(this)
|
|
|
|
|
</li>
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2020-12-24 11:02:22 +08:00
|
|
|
|
<AntDesign.Col Flex="1" Style="@ColStyle">
|
2021-01-21 17:20:10 +08:00
|
|
|
|
<div class="@ClassMapper.Class" style="@Style" Id="@Id" @onclick="HandleClick" @onclick:stopPropagation @ref="Ref">
|
2020-06-28 12:44:43 +08:00
|
|
|
|
@itemChildren(this)
|
|
|
|
|
</div>
|
2020-09-17 10:09:20 +08:00
|
|
|
|
</AntDesign.Col>
|
2020-05-21 14:49:07 +08:00
|
|
|
|
}
|
|
|
|
|
@code{
|
2020-09-17 10:09:20 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RenderFragment<ListItem> itemChildren = content =>
|
2020-05-21 14:49:07 +08:00
|
|
|
|
@<Template>
|
2020-09-18 00:03:44 +08:00
|
|
|
|
@if (content.ItemLayout == ListItemLayout.Vertical && content.Extra != null)
|
2020-05-21 14:49:07 +08:00
|
|
|
|
{
|
2020-06-28 12:44:43 +08:00
|
|
|
|
<div class="@content.PrefixName-main">
|
2020-05-21 14:49:07 +08:00
|
|
|
|
@content.ChildContent
|
|
|
|
|
@content.actionsContent(content)
|
|
|
|
|
</div>
|
2020-06-28 12:44:43 +08:00
|
|
|
|
<div class="@content.PrefixName-extra">@content.Extra</div>
|
2020-05-21 14:49:07 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
@content.ChildContent
|
|
|
|
|
@content.actionsContent(content)
|
2020-06-28 12:44:43 +08:00
|
|
|
|
@if (content.Extra != null)
|
|
|
|
|
{
|
|
|
|
|
@content.Extra
|
|
|
|
|
}
|
2020-05-21 14:49:07 +08:00
|
|
|
|
}
|
|
|
|
|
</Template>;
|
|
|
|
|
|
2020-09-17 10:09:20 +08:00
|
|
|
|
RenderFragment<ListItem> actionsContent = content =>
|
|
|
|
|
@<Template>
|
|
|
|
|
@if (content.Actions != null && content.Actions.Length > 0)
|
|
|
|
|
{
|
|
|
|
|
<ul class="@content.PrefixName-action" key="actions">
|
|
|
|
|
@for (int i = 0; i < content.Actions.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
<li key="@content.PrefixName-action-@i">
|
|
|
|
|
@content.Actions[i]
|
|
|
|
|
@if (i != (content.Actions.Length - 1))
|
|
|
|
|
{
|
|
|
|
|
<em class="@content.PrefixName-action-split" />
|
|
|
|
|
}
|
|
|
|
|
</li>
|
|
|
|
|
}
|
|
|
|
|
</ul>
|
|
|
|
|
}
|
|
|
|
|
</Template>;
|
|
|
|
|
|
|
|
|
|
|
2020-05-21 14:49:07 +08:00
|
|
|
|
}
|