ant-design-blazor/components/table/Table.razor

56 lines
2.3 KiB
C#
Raw Normal View History

@namespace AntDesign
@inherits AntDomComponentBase
@typeparam TItem
<div class="ant-table-wrapper">
<Spin Spinning="Loading">
@if (ShowPagination && PaginationPosition.Contains("top"))
{
<Pagination Class="@PaginationClass" Total="_total" PageSize="_pageSize" @bind-Current="_current" />
}
<div class="ant-table">
<div class="ant-table-container">
<div class="ant-table-content">
<table style="table-layout: auto;">
<colgroup></colgroup>
<thead class="ant-table-thead">
<tr>
<CascadingValue Value="@this" TValue="ITable">
<CascadingValue Name="IsHeader" Value="true">
@if (_fieldModel != null)
{
@ChildContent(_fieldModel)
}
</CascadingValue>
</CascadingValue>
</tr>
</thead>
<tbody class="ant-table-tbody">
@if (!ShowItems.Any())
{
<tr class="ant-table-placeholder">
<td colspan="6" class="ant-table-cell">
<Empty Simple />
</td>
</tr>
}
@if (_columns.Count > 0)
{
@foreach (var data in ShowItems)
{
<tr class="ant-table-row ant-table-row-level-0">
@ChildContent(data)
</tr>
}
}
</tbody>
</table>
</div>
</div>
</div>
@if (ShowPagination && PaginationPosition.Contains("bottom"))
{
<Pagination Class="@PaginationClass" Total="_total" PageSize="_pageSize" @bind-Current="_current" />
}
</Spin>
</div>