2020-05-29 00:33:49 +08:00
|
|
|
|
@namespace AntDesign.Internal
|
2020-06-01 14:09:28 +08:00
|
|
|
|
@typeparam TValue
|
|
|
|
|
@inherits DatePickerPanelBase<TValue>
|
2020-04-28 15:56:56 +08:00
|
|
|
|
|
2020-06-03 10:24:16 +08:00
|
|
|
|
<div class="@(PrefixCls)-header">
|
2020-04-28 15:56:56 +08:00
|
|
|
|
@if (ShowSuperPreChange)
|
|
|
|
|
{
|
2020-06-03 10:24:16 +08:00
|
|
|
|
<button tabindex="-1" class="@(PrefixCls)-header-super-prev-btn" @onclick="e => ChangePickerYearValue(-SuperChangeDateInterval)">
|
|
|
|
|
<span class="@(PrefixCls)-super-prev-icon"></span>
|
2020-04-28 15:56:56 +08:00
|
|
|
|
</button>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@if (ShowPreChange)
|
|
|
|
|
{
|
2020-06-03 10:24:16 +08:00
|
|
|
|
<button tabindex="-1" class="@(PrefixCls)-header-prev-btn" @onclick="e => ChangePickerMonthValue(-ChangeDateInterval)">
|
|
|
|
|
<span class="@(PrefixCls)-prev-icon"></span>
|
2020-04-28 15:56:56 +08:00
|
|
|
|
</button>
|
|
|
|
|
}
|
|
|
|
|
|
2020-06-16 12:31:46 +08:00
|
|
|
|
<div class="@(PrefixCls)-header-view">
|
|
|
|
|
@if (this.DatePicker.CultureInfo.GetDateLocale().MonthBeforeYear)
|
|
|
|
|
{
|
|
|
|
|
@if (Picker.IsIn(DatePickerType.Date, DatePickerType.Week))
|
2020-04-28 15:56:56 +08:00
|
|
|
|
{
|
2020-06-16 12:31:46 +08:00
|
|
|
|
<button type="button" tabindex="-1" class="@(PrefixCls)-month-btn" @onclick="e => PopUpPicker(DatePickerType.Month)">
|
|
|
|
|
@(PickerValue.ToString(this.DatePicker.CultureInfo.GetDateLocale().MonthFormat, this.DatePicker.CultureInfo))
|
2020-04-28 15:56:56 +08:00
|
|
|
|
</button>
|
|
|
|
|
}
|
2020-06-16 12:31:46 +08:00
|
|
|
|
@if (Picker.IsIn(DatePickerType.Date, DatePickerType.Month, DatePickerType.Quarter, DatePickerType.Week))
|
2020-04-28 15:56:56 +08:00
|
|
|
|
{
|
2020-06-16 12:31:46 +08:00
|
|
|
|
<button type="button" tabindex="-1" class="@(PrefixCls)-year-btn" @onclick="e => PopUpPicker(DatePickerType.Year)">
|
|
|
|
|
@(PickerValue.ToString(this.DatePicker.CultureInfo.GetDateLocale().YearFormat, this.DatePicker.CultureInfo))
|
2020-04-28 15:56:56 +08:00
|
|
|
|
</button>
|
|
|
|
|
}
|
2020-06-16 12:31:46 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
@if (Picker.IsIn(DatePickerType.Date, DatePickerType.Month, DatePickerType.Quarter, DatePickerType.Week))
|
2020-04-28 15:56:56 +08:00
|
|
|
|
{
|
2020-06-16 12:31:46 +08:00
|
|
|
|
<button type="button" tabindex="-1" class="@(PrefixCls)-year-btn" @onclick="e => PopUpPicker(DatePickerType.Year)">
|
|
|
|
|
@(PickerValue.ToString(this.DatePicker.CultureInfo.GetDateLocale().YearFormat, this.DatePicker.CultureInfo))
|
2020-04-28 15:56:56 +08:00
|
|
|
|
</button>
|
|
|
|
|
}
|
2020-06-16 12:31:46 +08:00
|
|
|
|
@if (Picker.IsIn(DatePickerType.Date, DatePickerType.Week))
|
2020-04-28 15:56:56 +08:00
|
|
|
|
{
|
2020-06-16 12:31:46 +08:00
|
|
|
|
<button type="button" tabindex="-1" class="@(PrefixCls)-month-btn" @onclick="e => PopUpPicker(DatePickerType.Month)">
|
|
|
|
|
@(PickerValue.ToString(this.DatePicker.CultureInfo.GetDateLocale().MonthFormat, this.DatePicker.CultureInfo))
|
2020-04-28 15:56:56 +08:00
|
|
|
|
</button>
|
|
|
|
|
}
|
2020-06-16 12:31:46 +08:00
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@if (Picker.IsIn(DatePickerType.Year))
|
|
|
|
|
{
|
|
|
|
|
int startYear = PickerValue.Year / 10 * 10;
|
|
|
|
|
|
|
|
|
|
<button type="button" class="@(PrefixCls)-decade-btn" @onclick="e => PopUpPicker(DatePickerType.Decade)">
|
|
|
|
|
@(startYear)-@(startYear + 9)
|
|
|
|
|
</button>
|
|
|
|
|
}
|
|
|
|
|
@if (Picker.IsIn(DatePickerType.Decade))
|
|
|
|
|
{
|
|
|
|
|
int startYear = PickerValue.Year / 100 * 100;
|
|
|
|
|
|
|
|
|
|
<button type="button" class="@(PrefixCls)-decade-btn">
|
|
|
|
|
@(startYear)-@(startYear + 99)
|
|
|
|
|
</button>
|
|
|
|
|
}
|
|
|
|
|
</div>
|
2020-04-28 15:56:56 +08:00
|
|
|
|
|
|
|
|
|
@if (ShowNextChange)
|
|
|
|
|
{
|
2020-06-03 10:24:16 +08:00
|
|
|
|
<button tabindex="-1" class="@(PrefixCls)-header-next-btn" @onclick="e => ChangePickerMonthValue(ChangeDateInterval)">
|
|
|
|
|
<span class="@(PrefixCls)-next-icon"></span>
|
2020-04-28 15:56:56 +08:00
|
|
|
|
</button>
|
|
|
|
|
}
|
|
|
|
|
@if (ShowSuperNextChange)
|
|
|
|
|
{
|
2020-06-03 10:24:16 +08:00
|
|
|
|
<button tabindex="-1" class="@(PrefixCls)-header-super-next-btn" @onclick="e => ChangePickerYearValue(SuperChangeDateInterval)">
|
|
|
|
|
<span class="@(PrefixCls)-super-next-icon"></span>
|
2020-04-28 15:56:56 +08:00
|
|
|
|
</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;
|
|
|
|
|
}
|