Added various icons to use for input prefixes. Updated pagination cocmponent.
This commit is contained in:
@@ -1,15 +1,23 @@
|
||||
<div class="pagination">
|
||||
@using JSMR.UI.Blazor.Enums
|
||||
|
||||
<div class="pagination">
|
||||
<div>
|
||||
<label>@IndexInfo</label>
|
||||
</div>
|
||||
<MudPagination class="pager" ShowFirstButton="true" ShowLastButton="true" Count="@((int)Math.Ceiling((decimal)TotalItems / (decimal)PageSize))" Selected="@PageNumber" SelectedChanged="OnSelectedChanged" />
|
||||
<div class="page-sizes">
|
||||
<MudSelect T="int" Value="PageSize" ValueChanged="OnPageSizeChanged" Dense="true" Variant="MudBlazor.Variant.Outlined" Margin="Margin.Dense">
|
||||
@foreach (int value in PageSizes)
|
||||
{
|
||||
<MudSelectItem Value="@value">@value</MudSelectItem>
|
||||
}
|
||||
</MudSelect>
|
||||
@RightContent
|
||||
<BitDropdown Items="PageSizes2"
|
||||
Style="min-width: 7rem"
|
||||
Placeholder="Select..."
|
||||
TItem="BitDropdownItem<int>"
|
||||
TValue="int"
|
||||
Value="PageSize"
|
||||
ValueChanged="OnPageSizeChanged">
|
||||
<PrefixTemplate>
|
||||
<InputPrefix Graphic="Graphic.Grid" Tooltip="Page Size"></InputPrefix>
|
||||
</PrefixTemplate>
|
||||
</BitDropdown>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -23,6 +31,8 @@
|
||||
[Parameter]
|
||||
public int[] PageSizes { get; set; } = [5, 10, 25, 50, 100];
|
||||
|
||||
List<BitDropdownItem<int>> PageSizes2 => [.. PageSizes.Select(x => new BitDropdownItem<int>() { Text = x.ToString(), Value = x })];
|
||||
|
||||
[Parameter]
|
||||
public int PageSize { get; set; }
|
||||
|
||||
@@ -35,6 +45,9 @@
|
||||
[Parameter]
|
||||
public EventCallback<int> TotalItemsChanged { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public RenderFragment? RightContent { get; set; }
|
||||
|
||||
public string IndexInfo => TotalItems == 0 ? "No items" : $"{StartIndex.ToString("n0")} - {EndIndex.ToString("n0")} of {TotalItems.ToString("n0")} items";
|
||||
|
||||
public int StartIndex => (PageNumber - 1) * PageSize + 1;
|
||||
|
||||
Reference in New Issue
Block a user