2020-06-19 23:06:33 +08:00
|
|
|
|
@namespace AntDesign
|
2021-09-02 12:34:30 +08:00
|
|
|
|
@using AntDesign.TableModels
|
2020-06-19 23:06:33 +08:00
|
|
|
|
@inherits ColumnBase
|
|
|
|
|
|
2021-01-09 23:57:31 +08:00
|
|
|
|
@if (IsInitialize)
|
|
|
|
|
{
|
2021-09-02 12:34:30 +08:00
|
|
|
|
return;
|
2021-01-09 23:57:31 +08:00
|
|
|
|
}
|
|
|
|
|
else if (IsPlaceholder)
|
2020-06-19 23:06:33 +08:00
|
|
|
|
{
|
2021-09-02 12:34:30 +08:00
|
|
|
|
<td style="padding: 0px; border: 0px; height: 0px;"></td>
|
2020-06-19 23:06:33 +08:00
|
|
|
|
}
|
2021-01-09 23:57:31 +08:00
|
|
|
|
else if (IsMeasure)
|
|
|
|
|
{
|
2021-09-02 12:34:30 +08:00
|
|
|
|
<td style="padding: 0px; border: 0px; height: 0px;"><div style="height: 0px; overflow: hidden;"> </div></td>
|
2021-01-09 23:57:31 +08:00
|
|
|
|
}
|
2020-06-19 23:06:33 +08:00
|
|
|
|
else if (IsColGroup)
|
|
|
|
|
{
|
2021-09-02 12:34:30 +08:00
|
|
|
|
@if (AppendExpandColumn)
|
|
|
|
|
{
|
|
|
|
|
<col class="ant-table-expand-icon-col">
|
|
|
|
|
}
|
2021-04-01 12:50:30 +08:00
|
|
|
|
|
2021-09-02 12:34:30 +08:00
|
|
|
|
if (Width != null)
|
|
|
|
|
{
|
|
|
|
|
<col style="width: @((CssSizeLength)Width); min-width: @((CssSizeLength)Width);">
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
<col />
|
|
|
|
|
}
|
2020-06-19 23:06:33 +08:00
|
|
|
|
}
|
2020-09-28 16:06:02 +08:00
|
|
|
|
else if (IsHeader && HeaderColSpan != 0)
|
2020-06-19 23:06:33 +08:00
|
|
|
|
{
|
2021-09-02 12:34:30 +08:00
|
|
|
|
@if (AppendExpandColumn)
|
|
|
|
|
{
|
|
|
|
|
<th class="ant-table-cell ant-table-row-expand-icon-cell"></th>
|
|
|
|
|
}
|
2021-04-01 12:50:30 +08:00
|
|
|
|
|
2021-09-02 12:34:30 +08:00
|
|
|
|
<th class="@ClassMapper.Class" style="@FixedStyle @HeaderStyle" colspan="@HeaderColSpan">
|
|
|
|
|
@if (TitleTemplate != null)
|
|
|
|
|
{
|
|
|
|
|
@TitleTemplate
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
@Title
|
|
|
|
|
}
|
|
|
|
|
</th>
|
2020-06-19 23:06:33 +08:00
|
|
|
|
}
|
2020-11-03 13:31:22 +08:00
|
|
|
|
else if (!IsHeader && RowSpan != 0 && ColSpan != 0)
|
2020-06-19 23:06:33 +08:00
|
|
|
|
{
|
2021-09-02 12:34:30 +08:00
|
|
|
|
@if (AppendExpandColumn)
|
|
|
|
|
{
|
|
|
|
|
<td class="ant-table-cell ant-table-row-expand-icon-cell">
|
|
|
|
|
@if (Table.RowExpandable(RowData) && (!Table.TreeMode || !RowData.HasChildren))
|
|
|
|
|
{
|
|
|
|
|
<button type="button" @onclick="ToggleTreeNode"
|
|
|
|
|
class="ant-table-row-expand-icon @(RowData.Expanded?"ant-table-row-expand-icon-expanded":"ant-table-row-expand-icon-collapsed")"
|
|
|
|
|
aria-label="@(RowData.Expanded?Table.Locale.Collapse:Table.Locale.Expand)"></button>
|
|
|
|
|
}
|
|
|
|
|
</td>
|
|
|
|
|
}
|
2021-04-01 12:50:30 +08:00
|
|
|
|
|
2021-09-13 23:58:41 +08:00
|
|
|
|
<td class="@ClassMapper.Class" style="@FixedStyle @Style" rowspan="@RowSpan" colspan="@ColSpan" data-label="@Context.HeaderColumns[ColIndex].Title">
|
2021-09-02 12:34:30 +08:00
|
|
|
|
@if (ColIndex == Table.TreeExpandIconColumnIndex && Table.TreeMode)
|
|
|
|
|
{
|
|
|
|
|
<span class="ant-table-row-indent indent-level-@RowData.Level" style="padding-left: @((CssSizeLength)(RowData.Level * Table.IndentSize));"></span>
|
|
|
|
|
@if (RowData.HasChildren)
|
|
|
|
|
{
|
|
|
|
|
<button type="button" @onclick="ToggleTreeNode" class="ant-table-row-expand-icon @(RowData?.Expanded==true?"ant-table-row-expand-icon-expanded":"ant-table-row-expand-icon-collapsed")" aria-label="@(RowData?.Expanded==true?Table.Locale.Collapse:Table.Locale.Expand)"></button>
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
<button type="button" class="ant-table-row-expand-icon ant-table-row-expand-icon-spaced" aria-label="@Table.Locale.Expand"></button>
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@if (CellRender != null)
|
|
|
|
|
{
|
|
|
|
|
var cellData = new CellData(RowData);
|
|
|
|
|
@CellRender(cellData)
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
@ChildContent
|
|
|
|
|
}
|
|
|
|
|
</td>
|
2020-06-19 23:06:33 +08:00
|
|
|
|
}
|