forked from CodeBeamOrg/CodeBeam.MudBlazor.Extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMudWheel.razor
More file actions
57 lines (50 loc) · 2.49 KB
/
MudWheel.razor
File metadata and controls
57 lines (50 loc) · 2.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
@namespace MudExtensions
@typeparam T
@inherits MudBaseInput<T>
@using MudExtensions.Utilities
<div class="@Classname" @onmouseenter="@(() => ScrollManager.LockScrollAsync() )" @onmouseleave="@(() => ScrollManager.UnlockScrollAsync())" @onclick:stopPropagation>
@if (!string.IsNullOrEmpty(Label))
{
<MudText Align="Align.Center" Color="@Color">@Label</MudText>
}
<MudSwipeArea Class="@InnerClassname" Style="@GetStylename()" Sensitivity="@Sensitivity" OnSwipeEnd="HandleOnSwipe" @onwheel="HandleOnWheel" PreventDefault="true">
@if (true)
{
int index = GetIndex();
for (int i = WheelLevel + 1; 0 < i; i--)
{
int a = i;
if (0 <= index - a)
{
<div class="@OuterItemClassname(index - a)" @onclick="@(async() => await ChangeWheel(-a))">
<MudText Typo="@(Dense ? Typo.body1 : Typo.h6)">@(ToStringFunc != null ? ToStringFunc(ItemCollection[index - a]) : ConvertSet(ItemCollection[index - a]))</MudText>
</div>
}
else
{
<div class="@EmptyItemClassname" />
}
}
<span class="@BorderClassname" />
<div class="@MiddleItemClassname">
<MudText Class="@($"mud-wheel-ani-{_animateGuid} my-2)")" Typo="@(Dense ? Typo.body1 : Typo.h6)" Color="@Color" Style="font-weight: 900">@(ToStringFunc != null ? ToStringFunc(ItemCollection[index]) : ConvertSet(ItemCollection[index]))</MudText>
</div>
<div class="@BorderClassname" />
for (int i = 1; i < WheelLevel + 2; i++)
{
int a = i;
if (index + a < ItemCollection?.Count)
{
<div class="@OuterItemClassname(index + a)" @onclick="@(async() => await ChangeWheel(a))">
<MudText Typo="@(Dense ? Typo.body1 : Typo.h6)">@(ToStringFunc != null ? ToStringFunc(ItemCollection[index + a]) : ConvertSet(ItemCollection[index + a]))</MudText>
</div>
}
else
{
<div class="@EmptyItemClassname" />
}
}
}
</MudSwipeArea>
</div>
<MudAnimate @ref="_animate" Selector="@($".mud-wheel-ani-{_animateGuid}")" AnimationType="AnimationType.SlideY" Duration="0.3" Value="0" ValueSecondary="_animateValue" AnimationTiming="AnimationTiming.Ease" />