2020-05-29 00:33:49 +08:00
|
|
|
|
@namespace AntDesign
|
2020-05-26 15:21:47 +08:00
|
|
|
|
@inherits AntDomComponentBase
|
|
|
|
|
|
2021-01-21 17:20:10 +08:00
|
|
|
|
<div class="@ClassMapper.Class" @ref="Ref">
|
2020-09-16 13:58:16 +08:00
|
|
|
|
<div class="ant-transfer-list @((FooterTemplate != null || Footer != null)?FooterClass:"")" @onscroll="@(e=>HandleScroll(TransferDirection.Left,e))" style="@Style">
|
2020-05-26 15:21:47 +08:00
|
|
|
|
<div class="ant-transfer-list-header">
|
|
|
|
|
@if (ShowSelectAll)
|
|
|
|
|
{
|
2020-05-28 16:56:52 +08:00
|
|
|
|
<Checkbox Checked="_leftCheckAllState" Indeterminate="_leftCheckAllIndeterminate" Disabled="@Disabled" CheckedChange="@(checkedState => SelectAll(checkedState, TransferDirection.Left))" />
|
2020-05-26 15:21:47 +08:00
|
|
|
|
}
|
|
|
|
|
<span class="ant-transfer-list-header-selected">
|
2020-10-24 13:39:02 +08:00
|
|
|
|
@_leftCountText
|
2020-05-26 15:21:47 +08:00
|
|
|
|
</span>
|
2020-10-24 13:39:02 +08:00
|
|
|
|
@if (Titles[0] != "")
|
|
|
|
|
{
|
|
|
|
|
<span class="ant-transfer-list-header-title">@Titles[0]</span>
|
|
|
|
|
}
|
2020-05-26 15:21:47 +08:00
|
|
|
|
</div>
|
2020-10-24 13:39:02 +08:00
|
|
|
|
<div class="ant-transfer-list-body @(ShowSearch ? "ant-transfer-list-body-with-search" : "")">
|
2020-05-26 15:21:47 +08:00
|
|
|
|
@if (ShowSearch)
|
|
|
|
|
{
|
|
|
|
|
<div class="ant-transfer-list-body-search-wrapper">
|
|
|
|
|
<div>
|
2020-10-24 13:39:02 +08:00
|
|
|
|
<Input Class="ant-transfer-list-search" Value="@_leftFilterValue" Placeholder="@Locale.SearchPlaceholder" OnInput="@(e => HandleSearch(e, TransferDirection.Left))" TValue="string"/>
|
|
|
|
|
<a class="ant-transfer-list-search-action">
|
|
|
|
|
@if (string.IsNullOrEmpty(_leftFilterValue))
|
|
|
|
|
{
|
|
|
|
|
<span role="img" aria-label="search" class="anticon anticon-search">
|
|
|
|
|
<svg viewBox="64 64 896 896" focusable="false" class="" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true">
|
|
|
|
|
<path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path>
|
|
|
|
|
</svg>
|
|
|
|
|
</span>
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
<span role="img" aria-label="close-circle" class="anticon anticon-close-circle" @onclick="@(() => ClearFilterValueAsync(TransferDirection.Left))">
|
|
|
|
|
<svg viewBox="64 64 896 896" focusable="false" class="" data-icon="close-circle" width="1em" height="1em" fill="currentColor" aria-hidden="true">
|
|
|
|
|
<path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"></path>
|
|
|
|
|
</svg>
|
|
|
|
|
</span>
|
|
|
|
|
}
|
|
|
|
|
</a>
|
2020-05-26 15:21:47 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
}
|
2020-10-24 13:39:02 +08:00
|
|
|
|
@if (!_leftDataSource.Any())
|
|
|
|
|
{
|
|
|
|
|
<div class="ant-transfer-list-body-not-found">
|
|
|
|
|
<Empty Simple Small/>
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
<ul class="ant-transfer-list-content ng-star-inserted">
|
|
|
|
|
@foreach (var item in _leftDataSource)
|
2020-05-26 15:21:47 +08:00
|
|
|
|
{
|
|
|
|
|
<li @key="item" class="ant-transfer-list-content-item ng-star-inserted @(item.Disabled || Disabled ? DisabledClass : "")">
|
2020-06-02 20:27:53 +08:00
|
|
|
|
<Checkbox Label="@item.Key" Checked="_sourceSelectedKeys.Contains(item.Key)" CheckedChange="@(checkedState => SelectItem(checkedState, TransferDirection.Left, item.Key))" Disabled="@(item.Disabled || Disabled)">
|
2020-05-26 15:21:47 +08:00
|
|
|
|
@if (Render == null)
|
|
|
|
|
{
|
|
|
|
|
@item.Title
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2020-10-24 13:39:02 +08:00
|
|
|
|
var text = Render(item);
|
|
|
|
|
@if (text.IsT0)
|
2020-05-26 15:21:47 +08:00
|
|
|
|
{
|
2020-10-24 13:39:02 +08:00
|
|
|
|
@text.AsT0
|
2020-05-26 15:21:47 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2020-10-24 13:39:02 +08:00
|
|
|
|
@text.AsT1
|
2020-05-26 15:21:47 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2020-05-28 16:56:52 +08:00
|
|
|
|
</Checkbox>
|
2020-05-26 15:21:47 +08:00
|
|
|
|
</li>
|
|
|
|
|
}
|
2020-10-24 13:39:02 +08:00
|
|
|
|
</ul>
|
|
|
|
|
}
|
2020-05-26 15:21:47 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div class="ant-transfer-list-footer">
|
2020-10-24 13:39:02 +08:00
|
|
|
|
@if (FooterTemplate != null){@FooterTemplate} else {@Footer}
|
2020-05-26 15:21:47 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="ant-transfer-operation">
|
2020-05-29 12:55:15 +08:00
|
|
|
|
<Button Disabled="@(_leftButtonDisabled||Disabled)" Size="@AntSizeLDSType.Small" Icon="left" Type="@ButtonType.Primary" OnClick="@(e=>MoveItem(e,TransferDirection.Left))">@Operations[0]</Button>
|
|
|
|
|
<Button Disabled="@(_rightButtonDisabled||Disabled)" Size="@AntSizeLDSType.Small" Icon="right" Type="@ButtonType.Primary" OnClick="@(e=>MoveItem(e,TransferDirection.Right))">@Operations[1]</Button>
|
2020-05-26 15:21:47 +08:00
|
|
|
|
</div>
|
2020-09-16 13:58:16 +08:00
|
|
|
|
<div class="ant-transfer-list @((FooterTemplate != null || Footer != null)?FooterClass:"")" @onscroll="@(e => HandleScroll(TransferDirection.Right, e))" style="@Style">
|
2020-05-26 15:21:47 +08:00
|
|
|
|
<div class="ant-transfer-list-header">
|
|
|
|
|
@if (ShowSelectAll)
|
|
|
|
|
{
|
2020-05-28 16:56:52 +08:00
|
|
|
|
<Checkbox Checked="_rightCheckAllState" Indeterminate="_rightCheckAllIndeterminate " Disabled="@Disabled" CheckedChange="@(checkedState => SelectAll(checkedState, TransferDirection.Right))" />
|
2020-05-26 15:21:47 +08:00
|
|
|
|
}
|
|
|
|
|
<span class="ant-transfer-list-header-selected">
|
2020-10-24 13:39:02 +08:00
|
|
|
|
@_rightCountText
|
2020-05-26 15:21:47 +08:00
|
|
|
|
</span>
|
2020-10-24 13:39:02 +08:00
|
|
|
|
@if (Titles[1] != "")
|
|
|
|
|
{
|
|
|
|
|
<span class="ant-transfer-list-header-title">@Titles[1]</span>
|
|
|
|
|
}
|
2020-05-26 15:21:47 +08:00
|
|
|
|
</div>
|
2020-10-24 13:39:02 +08:00
|
|
|
|
<div class="ant-transfer-list-body @(ShowSearch ? "ant-transfer-list-body-with-search" : "")">
|
2020-05-26 15:21:47 +08:00
|
|
|
|
@if (ShowSearch)
|
|
|
|
|
{
|
|
|
|
|
<div class="ant-transfer-list-body-search-wrapper">
|
|
|
|
|
<div>
|
2020-10-24 13:39:02 +08:00
|
|
|
|
<Input Class="ant-transfer-list-search" Value="@_rightFilterValue" Placeholder="@Locale.SearchPlaceholder" OnInput="@(e => HandleSearch(e, TransferDirection.Right))" TValue="string"/>
|
|
|
|
|
<a class="ant-transfer-list-search-action">
|
|
|
|
|
@if (string.IsNullOrEmpty(_rightFilterValue))
|
|
|
|
|
{
|
|
|
|
|
<span role="img" aria-label="search" class="anticon anticon-search">
|
|
|
|
|
<svg viewBox="64 64 896 896" focusable="false" class="" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true">
|
|
|
|
|
<path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path>
|
|
|
|
|
</svg>
|
|
|
|
|
</span>
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
<span role="img" aria-label="close-circle" class="anticon anticon-close-circle" @onclick="@(() => ClearFilterValueAsync(TransferDirection.Right))">
|
|
|
|
|
<svg viewBox="64 64 896 896" focusable="false" class="" data-icon="close-circle" width="1em" height="1em" fill="currentColor" aria-hidden="true">
|
|
|
|
|
<path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"></path>
|
|
|
|
|
</svg>
|
|
|
|
|
</span>
|
|
|
|
|
}
|
|
|
|
|
</a>
|
2020-05-26 15:21:47 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
}
|
2020-10-24 13:39:02 +08:00
|
|
|
|
@if (!_rightDataSource.Any())
|
|
|
|
|
{
|
|
|
|
|
<div class="ant-transfer-list-body-not-found">
|
|
|
|
|
<Empty Simple Small/>
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
<ul class="ant-transfer-list-content">
|
|
|
|
|
@foreach (var item in _rightDataSource)
|
2020-05-26 15:21:47 +08:00
|
|
|
|
{
|
2020-10-24 13:39:02 +08:00
|
|
|
|
<li @key="item" class="ant-transfer-list-content-item @(item.Disabled || Disabled ? DisabledClass : "")">
|
2020-06-02 20:27:53 +08:00
|
|
|
|
<Checkbox Label="@item.Key" Checked="_targetSelectedKeys.Contains(item.Key)" CheckedChange="@(checkedState => SelectItem(checkedState, TransferDirection.Right, item.Key))" Disabled="@(item.Disabled || Disabled)">
|
2020-05-26 15:21:47 +08:00
|
|
|
|
@if (Render == null)
|
|
|
|
|
{
|
|
|
|
|
@item.Title
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2020-10-24 13:39:02 +08:00
|
|
|
|
var text = Render(item);
|
|
|
|
|
@if (text.IsT0)
|
2020-05-26 15:21:47 +08:00
|
|
|
|
{
|
2020-10-24 13:39:02 +08:00
|
|
|
|
@text.AsT0
|
2020-05-26 15:21:47 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2020-10-24 13:39:02 +08:00
|
|
|
|
@text.AsT1
|
2020-05-26 15:21:47 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2020-05-28 16:56:52 +08:00
|
|
|
|
</Checkbox>
|
2020-05-26 15:21:47 +08:00
|
|
|
|
</li>
|
|
|
|
|
}
|
2020-10-24 13:39:02 +08:00
|
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
|
}
|
2020-05-26 15:21:47 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div class="ant-transfer-list-footer">
|
2020-10-24 13:39:02 +08:00
|
|
|
|
@if (FooterTemplate != null){@FooterTemplate} else {@Footer}
|
2020-05-26 15:21:47 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|