2020-05-29 00:33:49 +08:00
|
|
|
|
@namespace AntDesign
|
2020-05-19 17:54:16 +08:00
|
|
|
|
@inherits AntDomComponentBase
|
|
|
|
|
|
2021-03-11 23:26:49 +08:00
|
|
|
|
@{
|
|
|
|
|
var prefixCls = $"{RootPrefixCls}-options";
|
|
|
|
|
RenderFragment changeSelect = null;
|
|
|
|
|
RenderFragment goInput = null;
|
|
|
|
|
RenderFragment gotoButton = null;
|
|
|
|
|
|
|
|
|
|
if (!ChangeSize.HasDelegate && !QuickGo.HasDelegate)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var pageSizeOptions = GetPageSizeOptions();
|
|
|
|
|
|
|
|
|
|
if (ChangeSize.HasDelegate)
|
|
|
|
|
{
|
|
|
|
|
changeSelect =
|
|
|
|
|
@<Select
|
|
|
|
|
TItem="int"
|
|
|
|
|
TItemValue="int"
|
|
|
|
|
Disabled="@Disabled"
|
|
|
|
|
Style="width: auto"
|
|
|
|
|
Size="@(IsSmall ? "small" : "default")"
|
|
|
|
|
Class="@($"{prefixCls}-size-changer")"
|
|
|
|
|
DefaultValue="@(PageSize > 0 ? PageSize : pageSizeOptions[0])"
|
|
|
|
|
OnSelectedItemChanged="@(i => {if (ChangeSize.HasDelegate)ChangeSize.InvokeAsync(i);})">
|
|
|
|
|
<SelectOptions>
|
|
|
|
|
@foreach(var opt in pageSizeOptions)
|
|
|
|
|
{
|
|
|
|
|
<SelectOption TItem="int" TItemValue="int" Label="@BuildOptionText(opt)" Value="@opt" />
|
|
|
|
|
}
|
|
|
|
|
</SelectOptions>
|
|
|
|
|
</Select>;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (QuickGo.HasDelegate)
|
|
|
|
|
{
|
|
|
|
|
if (GoButton.HasValue)
|
|
|
|
|
{
|
|
|
|
|
var goBtn = GoButton.Value;
|
|
|
|
|
if (goBtn.IsT0 && goBtn.AsT0 == true)
|
|
|
|
|
{
|
|
|
|
|
gotoButton =
|
|
|
|
|
@<button
|
|
|
|
|
type="button"
|
|
|
|
|
@onclick="Go"
|
|
|
|
|
@onkeyup="Go"
|
|
|
|
|
disabled="@Disabled"
|
|
|
|
|
class="@prefixCls-quick-jumper-button">
|
|
|
|
|
@Locale.JumpToConfirm
|
|
|
|
|
</button>;
|
|
|
|
|
}
|
|
|
|
|
else if (goBtn.IsT1)
|
|
|
|
|
{
|
|
|
|
|
gotoButton =
|
|
|
|
|
@<span @onclick="Go" @onkeyup="Go">
|
|
|
|
|
@goBtn.AsT1
|
|
|
|
|
</span>;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
goInput =
|
|
|
|
|
@<div class="@prefixCls-quick-jumper">
|
|
|
|
|
@Locale.JumpTo
|
|
|
|
|
<input
|
|
|
|
|
disabled="@Disabled"
|
|
|
|
|
type="text"
|
|
|
|
|
value="@_goInputText"
|
|
|
|
|
@onchange="HandleChange"
|
|
|
|
|
@onkeyup="Go"
|
|
|
|
|
@onblur="HandleBlur"/>
|
|
|
|
|
@Locale.Page
|
|
|
|
|
@gotoButton
|
|
|
|
|
</div>;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
<li class="@prefixCls">
|
|
|
|
|
@changeSelect
|
|
|
|
|
@goInput
|
|
|
|
|
</li>
|
|
|
|
|
|
2020-05-19 17:54:16 +08:00
|
|
|
|
}
|