Skip to content

Commit

Permalink
feat(Table): add FixedLineNoColumn on table (#922)
Browse files Browse the repository at this point in the history
* feat: 增加 FixedLineNoColumn 参数

* doc: 格式化文档

* doc: foramt document

* test: update unit test

* feat: 增加固定列判断逻辑

* test: 增加固定列单元测试

* chore: bump version 7.4.5
  • Loading branch information
ArgoZhang authored Mar 30, 2023
1 parent e4cdeca commit 75de8a2
Show file tree
Hide file tree
Showing 73 changed files with 1,058 additions and 1,087 deletions.
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
@inject IStringLocalizer<Foo> LocalizerFoo
@inject IStringLocalizer<TablesAutoRefreshControl> Localizer

<div>
<p>
<div>@Localizer["TablesAutoRefreshControlDescription"]</div>
<Button Text="@Localizer["TablesAutoRefreshControlToggleAuto"]" OnClick="@ToggleAuto" /> <span><code>IsAutoRefresh</code> @Localizer["TablesAutoRefreshControlIsAutoRefresh"]:<code>@IsAutoRefresh</code></span>
</p>
<Table TItem="Foo"
IsPagination="true" PageItemsSource="@(new int[] { 2, 4 })"
IsStriped="true" IsBordered="true" IsMultipleSelect="true"
IsAutoRefresh="@IsAutoRefresh" AutoRefreshInterval="2000"
OnQueryAsync="@OnManualQueryAsync">
<TableColumns>
<TableColumn @bind-Field="@context.DateTime" Width="180" />
<TableColumn @bind-Field="@context.Name" Width="100" />
<TableColumn @bind-Field="@context.Address" />
<TableColumn @bind-Field="@context.Count" />
<TableColumn @bind-Field="@context.Complete" />
</TableColumns>
</Table>
</div>
<p>
<div>@Localizer["TablesAutoRefreshControlDescription"]</div>
<Button Text="@Localizer["TablesAutoRefreshControlToggleAuto"]" OnClick="@ToggleAuto" /> <span><code>IsAutoRefresh</code> @Localizer["TablesAutoRefreshControlIsAutoRefresh"]:<code>@IsAutoRefresh</code></span>
</p
<Table TItem="Foo"
IsPagination="true" PageItemsSource="@(new int[] { 2, 4 })"
IsStriped="true" IsBordered="true" IsMultipleSelect="true"
IsAutoRefresh="@IsAutoRefresh" AutoRefreshInterval="2000"
OnQueryAsync="@OnManualQueryAsync">
<TableColumns>
<TableColumn @bind-Field="@context.DateTime" Width="180" />
<TableColumn @bind-Field="@context.Name" Width="100" />
<TableColumn @bind-Field="@context.Address" />
<TableColumn @bind-Field="@context.Count" />
<TableColumn @bind-Field="@context.Complete" />
</TableColumns>
</Table>

@code {
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
@inject IStringLocalizer<Foo> LocalizerFoo

<div>
<Table TItem="Foo"
IsPagination="true" PageItemsSource="@(new int[] { 2, 4 })"
IsStriped="true" IsBordered="true" IsMultipleSelect="true"
IsAutoRefresh="true" AutoRefreshInterval="2000"
OnQueryAsync="@OnAutoQueryAsync">
<TableColumns>
<TableColumn @bind-Field="@context.DateTime" Width="180" />
<TableColumn @bind-Field="@context.Name" Width="100" />
<TableColumn @bind-Field="@context.Address" />
<TableColumn @bind-Field="@context.Count" />
<TableColumn @bind-Field="@context.Complete" />
</TableColumns>
</Table>
</div>
<Table TItem="Foo"
IsPagination="true" PageItemsSource="@(new int[] { 2, 4 })"
IsStriped="true" IsBordered="true" IsMultipleSelect="true"
IsAutoRefresh="true" AutoRefreshInterval="2000"
OnQueryAsync="@OnAutoQueryAsync">
<TableColumns>
<TableColumn @bind-Field="@context.DateTime" Width="180" />
<TableColumn @bind-Field="@context.Name" Width="100" />
<TableColumn @bind-Field="@context.Address" />
<TableColumn @bind-Field="@context.Count" />
<TableColumn @bind-Field="@context.Complete" />
</TableColumns>
</Table>

@code {
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
@inject IStringLocalizer<Foo> Localizer

<div>
<Table TItem="Foo" Items="@Items.Take(3)" IsBordered="true">
<TableColumns>
<TableColumn @bind-Field="@context.DateTime" Width="180" />
<TableColumn @bind-Field="@context.Name" />
<TableColumn @bind-Field="@context.Address" />
</TableColumns>
</Table>
</div>
<Table TItem="Foo" Items="@Items.Take(3)" IsBordered="true">
<TableColumns>
<TableColumn @bind-Field="@context.DateTime" Width="180" />
<TableColumn @bind-Field="@context.Name" />
<TableColumn @bind-Field="@context.Address" />
</TableColumns>
</Table>

@code {
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
@inject IStringLocalizer<Foo> Localizer
@inject IStringLocalizer<TableBaseHeaderStyle> TablesLocalizer

<div>
<div class="code-label"><code>Light</code> @TablesLocalizer["TableBaseHeaderStyleMode"]</div>
<Table TItem="Foo" Items="@Items.Take(3)" HeaderStyle="TableHeaderStyle.Light" IsBordered="true">
<TableColumns>
<TableColumn @bind-Field="@context.DateTime" Width="180" />
<TableColumn @bind-Field="@context.Name" />
<TableColumn @bind-Field="@context.Address" />
</TableColumns>
</Table>
<div class="code-label mt-3"><code>Dark</code> @TablesLocalizer["TableBaseHeaderStyleMode"]</div>
<Table TItem="Foo" Items="@Items.Take(3)" HeaderStyle="TableHeaderStyle.Dark" IsBordered="true">
<TableColumns>
<TableColumn @bind-Field="@context.DateTime" Width="180" />
<TableColumn @bind-Field="@context.Name" />
<TableColumn @bind-Field="@context.Address" />
</TableColumns>
</Table>
</div>
<div class="code-label"><code>Light</code> @TablesLocalizer["TableBaseHeaderStyleMode"]</div>
<Table TItem="Foo" Items="@Items.Take(3)" HeaderStyle="TableHeaderStyle.Light" IsBordered="true">
<TableColumns>
<TableColumn @bind-Field="@context.DateTime" Width="180" />
<TableColumn @bind-Field="@context.Name" />
<TableColumn @bind-Field="@context.Address" />
</TableColumns>
</Table>

<div class="code-label mt-3"><code>Dark</code> @TablesLocalizer["TableBaseHeaderStyleMode"]</div>
<Table TItem="Foo" Items="@Items.Take(3)" HeaderStyle="TableHeaderStyle.Dark" IsBordered="true">
<TableColumns>
<TableColumn @bind-Field="@context.DateTime" Width="180" />
<TableColumn @bind-Field="@context.Name" />
<TableColumn @bind-Field="@context.Address" />
</TableColumns>
</Table>

@code {
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
@inject IStringLocalizer<Foo> Localizer
@inject IStringLocalizer<TableBaseNormal> TablesLocalizer

<div>
<Button Icon="fa-solid fa-arrows-rotate" Text="@RefreshText" OnClick="OnClick" class="my-2" />
<Table TItem="Foo" Items="@Items.Take(3)">
<TableColumns>
<TableColumn @bind-Field="@context.DateTime" Width="180" />
<TableColumn @bind-Field="@context.Name" />
<TableColumn @bind-Field="@context.Address" />
</TableColumns>
</Table>
</div>
<Button Icon="fa-solid fa-arrows-rotate" Text="@RefreshText" OnClick="OnClick" class="my-2" />

<Table TItem="Foo" Items="@Items.Take(3)">
<TableColumns>
<TableColumn @bind-Field="@context.DateTime" Width="180" />
<TableColumn @bind-Field="@context.Name" />
<TableColumn @bind-Field="@context.Address" />
</TableColumns>
</Table>

@code {
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
@inject IStringLocalizer<Foo> Localizer

<div>
<Table TItem="Foo" Items="@Items.Take(3)" IsBordered="true" IsStriped="true" TableSize="TableSize.Compact">
<TableColumns>
<TableColumn @bind-Field="@context.DateTime" Width="180" Filterable="true" Sortable="true" />
<TableColumn @bind-Field="@context.Name" Filterable="true" />
<TableColumn @bind-Field="@context.Address" Sortable="true" />
</TableColumns>
</Table>
</div>
<Table TItem="Foo" Items="@Items.Take(3)" IsBordered="true" IsStriped="true" TableSize="TableSize.Compact">
<TableColumns>
<TableColumn @bind-Field="@context.DateTime" Width="180" Filterable="true" Sortable="true" />
<TableColumn @bind-Field="@context.Name" Filterable="true" />
<TableColumn @bind-Field="@context.Address" Sortable="true" />
</TableColumns>
</Table>

@code {
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
@inject IStringLocalizer<Foo> Localizer

<div>
<Table TItem="Foo" Items="@Items.Take(3)" IsStriped="true">
<TableColumns>
<TableColumn @bind-Field="@context.DateTime" Width="180" />
<TableColumn @bind-Field="@context.Name" />
<TableColumn @bind-Field="@context.Address" />
</TableColumns>
</Table>
</div>
<Table TItem="Foo" Items="@Items.Take(3)" IsStriped="true">
<TableColumns>
<TableColumn @bind-Field="@context.DateTime" Width="180" />
<TableColumn @bind-Field="@context.Name" />
<TableColumn @bind-Field="@context.Address" />
</TableColumns>
</Table>

@code {
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
@inject IStringLocalizer<Foo> Localizer

<div>
<Table TItem="Foo" Items="@Items.Take(3)">
<TableColumns>
<TableColumn @bind-Field="@context.DateTime" Width="140" />
<TableColumn @bind-Field="@context.Name" OnCellRender="@OnCellRenderHandler" />
<TableColumn @bind-Field="@context.Address" />
</TableColumns>
</Table>
</div>
<Table TItem="Foo" Items="@Items.Take(3)">
<TableColumns>
<TableColumn @bind-Field="@context.DateTime" Width="140" />
<TableColumn @bind-Field="@context.Name" OnCellRender="@OnCellRenderHandler" />
<TableColumn @bind-Field="@context.Address" />
</TableColumns>
</Table>

@code {
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@
@inject IStringLocalizer<Foo> FooLocalizer
@inject IStringLocalizer<TableCellOnDoubleClickCell> Localizer

<div>
<Table TItem="Foo" Items="@Items.Take(3)" IsBordered="true" OnDoubleClickCellCallback="@OnDoubleClickCellCallback">
<TableColumns>
<TableColumn @bind-Field="@context.DateTime" Width="180" />
<TableColumn @bind-Field="@context.Name" />
<TableColumn @bind-Field="@context.Address" />
<TableColumn @bind-Field="@context.Complete" />
</TableColumns>
</Table>
</div>
<Table TItem="Foo" Items="@Items.Take(3)" IsBordered="true" OnDoubleClickCellCallback="@OnDoubleClickCellCallback">
<TableColumns>
<TableColumn @bind-Field="@context.DateTime" Width="180" />
<TableColumn @bind-Field="@context.Name" />
<TableColumn @bind-Field="@context.Address" />
<TableColumn @bind-Field="@context.Complete" />
</TableColumns>
</Table>

@code {
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,36 +1,34 @@
@inject IStringLocalizer<Foo> FooLocalizer

<div>
<Table TItem="Foo" IsPagination="true" PageItemsSource="@PageItemsSource" RenderMode="TableRenderMode.Table"
IsStriped="true" IsBordered="true" OnQueryAsync="OnQueryAsync">
<TableColumns>
<TableColumn @bind-Field="@context.Name" Width="220">
<Template Context="value">
<div class="d-flex">
<div>
<img src="@Foo.GetAvatarUrl(value.Row.Id)" class="bb-avatar" />
</div>
<div class="ps-2">
<div>@value.Value</div>
<div class="bb-sub">@value.Row.Address</div>
</div>
<Table TItem="Foo" IsPagination="true" PageItemsSource="@PageItemsSource" RenderMode="TableRenderMode.Table"
IsStriped="true" IsBordered="true" OnQueryAsync="OnQueryAsync">
<TableColumns>
<TableColumn @bind-Field="@context.Name" Width="220">
<Template Context="value">
<div class="d-flex">
<div>
<img src="@Foo.GetAvatarUrl(value.Row.Id)" class="bb-avatar" />
</div>
</Template>
</TableColumn>
<TableColumn @bind-Field="@context.Address" />
<TableColumn @bind-Field="@context.Education" Align="Alignment.Center" Width="80" />
<TableColumn @bind-Field="@context.Count" Width="160">
<Template Context="value">
<div class="w-100">
<div>@value.Value %</div>
<Progress Value="@value.Value" Color="@Foo.GetProgressColor(value.Value)"></Progress>
<div class="ps-2">
<div>@value.Value</div>
<div class="bb-sub">@value.Row.Address</div>
</div>
</Template>
</TableColumn>
<TableColumn @bind-Field="@context.Complete" Align="Alignment.Center" Width="80" />
</TableColumns>
</Table>
</div>
</div>
</Template>
</TableColumn>
<TableColumn @bind-Field="@context.Address" />
<TableColumn @bind-Field="@context.Education" Align="Alignment.Center" Width="80" />
<TableColumn @bind-Field="@context.Count" Width="160">
<Template Context="value">
<div class="w-100">
<div>@value.Value %</div>
<Progress Value="@value.Value" Color="@Foo.GetProgressColor(value.Value)"></Progress>
</div>
</Template>
</TableColumn>
<TableColumn @bind-Field="@context.Complete" Align="Alignment.Center" Width="80" />
</TableColumns>
</Table>

@code {
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
@inject IStringLocalizer<Foo> FooLocalizer

<div>
<Table TItem="Foo"
IsPagination="true" PageItemsSource="@PageItemsSource"
IsStriped="true" IsBordered="true"
ShowToolbar="false" IsMultipleSelect="true" ShowExtendButtons="false"
OnQueryAsync="@OnQueryAsync">
<TableColumns>
<TableColumn @bind-Field="@context.DateTime" Width="120" FormatString="yyyy-MM-dd" Align="Alignment.Center" />
<TableColumn @bind-Field="@context.Name" Width="100" />
<TableColumn @bind-Field="@context.Address" />
<TableColumn @bind-Field="@context.Count" Formatter="@IntFormatter" Width="60" Align="Alignment.Right" />
</TableColumns>
</Table>
</div>
<Table TItem="Foo"
IsPagination="true" PageItemsSource="@PageItemsSource"
IsStriped="true" IsBordered="true"
ShowToolbar="false" IsMultipleSelect="true" ShowExtendButtons="false"
OnQueryAsync="@OnQueryAsync">
<TableColumns>
<TableColumn @bind-Field="@context.DateTime" Width="120" FormatString="yyyy-MM-dd" Align="Alignment.Center" />
<TableColumn @bind-Field="@context.Name" Width="100" />
<TableColumn @bind-Field="@context.Address" />
<TableColumn @bind-Field="@context.Count" Formatter="@IntFormatter" Width="60" Align="Alignment.Right" />
</TableColumns>
</Table>

@code {
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
@inject IStringLocalizer<Foo> FooLocalizer

<div>
<Table TItem="Foo"
IsPagination="true" PageItemsSource="@PageItemsSource" AllowResizing="true"
IsStriped="true" IsBordered="true"
ShowToolbar="false" IsMultipleSelect="true" ShowExtendButtons="false"
OnQueryAsync="@OnQueryAsync">
<TableColumns>
<TableColumn @bind-Field="@context.DateTime" Width="120" FormatString="yyyy-MM-dd" />
<TableColumn @bind-Field="@context.Name" Width="100" />
<TableColumn @bind-Field="@context.Address" />
<TableColumn @bind-Field="@context.Count" />
</TableColumns>
</Table>
</div>
<Table TItem="Foo"
IsPagination="true" PageItemsSource="@PageItemsSource" AllowResizing="true"
IsStriped="true" IsBordered="true"
ShowToolbar="false" IsMultipleSelect="true" ShowExtendButtons="false"
OnQueryAsync="@OnQueryAsync">
<TableColumns>
<TableColumn @bind-Field="@context.DateTime" Width="120" FormatString="yyyy-MM-dd" />
<TableColumn @bind-Field="@context.Name" Width="100" />
<TableColumn @bind-Field="@context.Address" />
<TableColumn @bind-Field="@context.Count" />
</TableColumns>
</Table>

@code {
/// <summary>
Expand Down
Loading

0 comments on commit 75de8a2

Please sign in to comment.