@namespace Connected.Components
@inherits UIComponent
@typeparam T

<Column T="T" Tag="@("select-column")" Sortable="false" Resizable="false" ShowColumnOptions="false" HeaderStyle="width:0%" FieldType="@typeof(object)"
    Filterable="false">
    <HeaderTemplate>
        @if (ShowInHeader)
        {
            <CheckBox T="bool" Size="@Size" Checked="@context.IsAllSelected" CheckedChanged="@context.Actions.SetSelectAll" />
        }
    </HeaderTemplate>
    <CellTemplate>
        <CheckBox T="bool" Size="@Size" Checked="@context.IsSelected" CheckedChanged="@context.Actions.SetSelectedItem" />
    </CellTemplate>
    <FooterTemplate>
        @if (ShowInFooter)
        {
            <CheckBox T="bool" Size="@Size" Checked="@context.IsAllSelected" CheckedChanged="@context.Actions.SetSelectAll" />
        }
    </FooterTemplate>
</Column>

@code {
    [Parameter] public bool ShowInHeader { get; set; } = true;
    [Parameter] public bool ShowInFooter { get; set; } = true;
    [Parameter] public Size Size { get; set; } = Size.Medium;
}