2020-04-28 15:56:56 +08:00
|
|
|
|
@namespace AntBlazor.Internal
|
2020-05-18 14:46:42 +08:00
|
|
|
|
@inherits DatePickerPanelBase
|
2020-04-28 15:56:56 +08:00
|
|
|
|
|
|
|
|
|
<div class="@(DatePicker.PrefixCls)-header">
|
|
|
|
|
@if (ShowSuperPreChange)
|
|
|
|
|
{
|
|
|
|
|
<button tabindex="-1" class="@(DatePicker.PrefixCls)-header-super-prev-btn" @onclick="e => ChangePickerYearValue(-SuperChangeDateInterval)">
|
|
|
|
|
<span class="@(DatePicker.PrefixCls)-super-prev-icon"></span>
|
|
|
|
|
</button>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@if (ShowPreChange)
|
|
|
|
|
{
|
|
|
|
|
<button tabindex="-1" class="@(DatePicker.PrefixCls)-header-prev-btn" @onclick="e => ChangePickerMonthValue(-ChangeDateInterval)">
|
|
|
|
|
<span class="@(DatePicker.PrefixCls)-prev-icon"></span>
|
|
|
|
|
</button>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
<div class="@(DatePicker.PrefixCls)-header-view">
|
2020-05-18 14:46:42 +08:00
|
|
|
|
@if (Picker.IsIn(DatePickerType.Date, DatePickerType.Month, DatePickerType.Quarter, DatePickerType.Week))
|
2020-04-28 15:56:56 +08:00
|
|
|
|
{
|
2020-05-18 14:46:42 +08:00
|
|
|
|
<button type="button" tabindex="-1" class="@(DatePicker.PrefixCls)-year-btn" @onclick="e => PopUpPicker(DatePickerType.Year)">
|
2020-04-28 15:56:56 +08:00
|
|
|
|
@(PickerValue.Year)年
|
|
|
|
|
</button>
|
|
|
|
|
}
|
2020-05-18 14:46:42 +08:00
|
|
|
|
@if (Picker.IsIn(DatePickerType.Date, DatePickerType.Week))
|
2020-04-28 15:56:56 +08:00
|
|
|
|
{
|
2020-05-18 14:46:42 +08:00
|
|
|
|
<button type="button" tabindex="-1" class="@(DatePicker.PrefixCls)-month-btn" @onclick="e => PopUpPicker(DatePickerType.Month)">
|
2020-04-28 15:56:56 +08:00
|
|
|
|
@(PickerValue.Month)月
|
|
|
|
|
</button>
|
|
|
|
|
}
|
2020-05-18 14:46:42 +08:00
|
|
|
|
@if (Picker.IsIn(DatePickerType.Year))
|
2020-04-28 15:56:56 +08:00
|
|
|
|
{
|
|
|
|
|
int startYear = PickerValue.Year / 10 * 10;
|
|
|
|
|
|
2020-05-18 14:46:42 +08:00
|
|
|
|
<button type="button" class="@(DatePicker.PrefixCls)-decade-btn" @onclick="e => PopUpPicker(DatePickerType.Decade)">
|
2020-04-28 15:56:56 +08:00
|
|
|
|
@(startYear)-@(startYear + 9)
|
|
|
|
|
</button>
|
|
|
|
|
}
|
2020-05-18 14:46:42 +08:00
|
|
|
|
@if (Picker.IsIn(DatePickerType.Decade))
|
2020-04-28 15:56:56 +08:00
|
|
|
|
{
|
|
|
|
|
int startYear = PickerValue.Year / 100 * 100;
|
|
|
|
|
|
|
|
|
|
<button type="button" class="@(DatePicker.PrefixCls)-decade-btn">
|
|
|
|
|
@(startYear)-@(startYear + 99)
|
|
|
|
|
</button>
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
@if (ShowNextChange)
|
|
|
|
|
{
|
|
|
|
|
<button tabindex="-1" class="@(DatePicker.PrefixCls)-header-next-btn" @onclick="e => ChangePickerMonthValue(ChangeDateInterval)">
|
|
|
|
|
<span class="@(DatePicker.PrefixCls)-next-icon"></span>
|
|
|
|
|
</button>
|
|
|
|
|
}
|
|
|
|
|
@if (ShowSuperNextChange)
|
|
|
|
|
{
|
|
|
|
|
<button tabindex="-1" class="@(DatePicker.PrefixCls)-header-super-next-btn" @onclick="e => ChangePickerYearValue(SuperChangeDateInterval)">
|
|
|
|
|
<span class="@(DatePicker.PrefixCls)-super-next-icon"></span>
|
|
|
|
|
</button>
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
@code {
|
|
|
|
|
[Parameter]
|
|
|
|
|
public int SuperChangeDateInterval { get; set; } = 1;
|
|
|
|
|
[Parameter]
|
|
|
|
|
public int ChangeDateInterval { get; set; } = 1;
|
|
|
|
|
[Parameter]
|
|
|
|
|
public bool ShowSuperPreChange { get; set; } = true;
|
|
|
|
|
[Parameter]
|
|
|
|
|
public bool ShowPreChange { get; set; } = true;
|
|
|
|
|
[Parameter]
|
|
|
|
|
public bool ShowNextChange { get; set; } = true;
|
|
|
|
|
[Parameter]
|
|
|
|
|
public bool ShowSuperNextChange { get; set; } = true;
|
|
|
|
|
}
|