2020-05-31 22:26:33 +08:00
|
|
|
|
@namespace AntDesign
|
|
|
|
|
@inherits AntDesign.AntDomComponentBase
|
|
|
|
|
|
2021-01-21 17:20:10 +08:00
|
|
|
|
@{
|
2020-05-31 22:26:33 +08:00
|
|
|
|
RenderFragment<RateItem> template = item =>
|
2021-01-21 17:20:10 +08:00
|
|
|
|
@<div role="radio" aria-checked="true" aria-posinset="@(item.IndexOfGroup + 1)" aria-setsize="5" tabindex="@item.IndexOfGroup">
|
|
|
|
|
<div class="ant-rate-star-first" @onclick="@(async e => await item.OnClick(true))" @onmouseover="@(async e => await item.OnHover(true))">
|
|
|
|
|
@if (@item.Character != null)
|
|
|
|
|
{
|
|
|
|
|
@item.Character.Invoke(new RateItemRenderContext());
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
<Icon Type="star" Theme="fill"></Icon>
|
|
|
|
|
}
|
2020-05-31 22:26:33 +08:00
|
|
|
|
</div>
|
2021-01-21 17:20:10 +08:00
|
|
|
|
<div class="ant-rate-star-second" @onclick="@(async e => await item.OnClick(false))" @onmouseover="@(async e => await item.OnHover(false))">
|
|
|
|
|
@if (@item.Character != null)
|
|
|
|
|
{
|
|
|
|
|
@item.Character.Invoke(new RateItemRenderContext());
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
<Icon Type="star" Theme="fill"></Icon>
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
</div>;
|
2020-05-31 22:26:33 +08:00
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@if (string.IsNullOrWhiteSpace(Tooltip))
|
|
|
|
|
{
|
2021-01-21 17:20:10 +08:00
|
|
|
|
<li class="@_starClassMapper.Class" @ref="Ref">
|
|
|
|
|
@template(this)
|
|
|
|
|
</li>
|
2020-05-31 22:26:33 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
<Tooltip Title="@Tooltip">
|
2021-01-21 17:20:10 +08:00
|
|
|
|
<Unbound>
|
|
|
|
|
<li class="@_starClassMapper.Class" @ref="@context.Current">
|
|
|
|
|
|
|
|
|
|
@template(this)
|
|
|
|
|
</li>
|
|
|
|
|
</Unbound>
|
2020-05-31 22:26:33 +08:00
|
|
|
|
</Tooltip>
|
2021-01-21 17:20:10 +08:00
|
|
|
|
}
|