2020-04-28 15:56:56 +08:00
|
|
|
|
using System;
|
|
|
|
|
using Microsoft.AspNetCore.Components;
|
|
|
|
|
|
2020-05-29 00:33:49 +08:00
|
|
|
|
namespace AntDesign.Internal
|
2020-04-28 15:56:56 +08:00
|
|
|
|
{
|
2020-06-01 14:09:28 +08:00
|
|
|
|
public partial class DatePickerPanelChooser<TValue> : AntDomComponentBase
|
2020-04-28 15:56:56 +08:00
|
|
|
|
{
|
|
|
|
|
[Parameter]
|
2020-06-01 14:09:28 +08:00
|
|
|
|
public DatePickerBase<TValue> DatePicker { get; set; }
|
2020-04-28 15:56:56 +08:00
|
|
|
|
|
|
|
|
|
[Parameter]
|
|
|
|
|
public Action<DateTime, int> OnSelect { get; set; }
|
|
|
|
|
|
|
|
|
|
[Parameter]
|
|
|
|
|
public int PickerIndex { get; set; }
|
|
|
|
|
|
|
|
|
|
private bool IsShowDatePanel()
|
|
|
|
|
{
|
|
|
|
|
if (DatePicker.IsShowTime && PickerIndex != DatePicker.GetOnFocusPickerIndex())
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2020-05-18 14:46:42 +08:00
|
|
|
|
return DatePicker.Picker == DatePickerType.Date;
|
2020-04-28 15:56:56 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private bool IsShowQuarterPanel()
|
|
|
|
|
{
|
2020-05-18 14:46:42 +08:00
|
|
|
|
return DatePicker.Picker == DatePickerType.Quarter;
|
2020-04-28 15:56:56 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private bool IsShowWeekPanel()
|
|
|
|
|
{
|
2020-05-18 14:46:42 +08:00
|
|
|
|
return DatePicker.Picker == DatePickerType.Week;
|
2020-04-28 15:56:56 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private bool IsShowMonthPanel()
|
|
|
|
|
{
|
2020-05-18 14:46:42 +08:00
|
|
|
|
return DatePicker.Picker == DatePickerType.Month;
|
2020-04-28 15:56:56 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private bool IsShowYearPanel()
|
|
|
|
|
{
|
2020-05-18 14:46:42 +08:00
|
|
|
|
return DatePicker.Picker == DatePickerType.Year;
|
2020-04-28 15:56:56 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private bool IsShowDecadePanel()
|
|
|
|
|
{
|
2020-05-18 14:46:42 +08:00
|
|
|
|
return DatePicker.Picker == DatePickerType.Decade;
|
2020-04-28 15:56:56 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private bool IsShowTimePanel()
|
|
|
|
|
{
|
2020-05-18 14:46:42 +08:00
|
|
|
|
return DatePicker.Picker == DatePickerType.Time;
|
2020-04-28 15:56:56 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|