2020-06-03 10:24:16 +08:00
|
|
|
|
@namespace AntDesign.Internal
|
|
|
|
|
@inherits AntDomComponentBase
|
|
|
|
|
|
|
|
|
|
@{
|
|
|
|
|
Action ClosePanel = () => { };
|
2021-01-19 20:50:23 +08:00
|
|
|
|
Action<DateTime, int?> ChangePickerValue = async (date, index) => { await Calendar.ChangeValue(date); };
|
2020-06-03 10:24:16 +08:00
|
|
|
|
Action<DateTime, int> ChangeValue = async (date, index) => { await Calendar.ChangeValue(date); };
|
|
|
|
|
Action<string, int> ChangePickerType = (type, index) => { Calendar.ChangePickerType(type, index); };
|
|
|
|
|
Func<int, DateTime> GetIndexPickerValue = (index) => Calendar.Value;
|
|
|
|
|
Func<int, DateTime?> GetIndexValue = (index) => Calendar.Value;
|
|
|
|
|
|
|
|
|
|
Dictionary<string, object> attributes =
|
|
|
|
|
new Dictionary<string, object>()
|
|
|
|
|
{
|
|
|
|
|
{ "PrefixCls", "ant-picker" },
|
|
|
|
|
{ "Picker", Calendar.Picker },
|
2020-11-25 11:08:12 +08:00
|
|
|
|
{ "Locale", Calendar.Locale },
|
|
|
|
|
{ "CultureInfo", Calendar.CultureInfo },
|
2020-06-03 10:24:16 +08:00
|
|
|
|
{ "ClosePanel", ClosePanel },
|
|
|
|
|
{ "ChangePickerValue", ChangePickerValue },
|
|
|
|
|
{ "ChangeValue", ChangeValue },
|
|
|
|
|
{ "ChangePickerType", ChangePickerType },
|
|
|
|
|
{ "GetIndexPickerValue", GetIndexPickerValue },
|
|
|
|
|
{ "GetIndexValue", GetIndexValue },
|
|
|
|
|
{ "DisabledDate", Calendar.DisabledDate },
|
|
|
|
|
{ "DateRender", Calendar.DateFullCellRender },
|
|
|
|
|
{ "MonthCellRender", Calendar.MonthFullCellRender },
|
|
|
|
|
{ "CalendarDateRender", Calendar.DateCellRender },
|
|
|
|
|
{ "CalendarMonthCellRender", Calendar.MonthCellRender },
|
|
|
|
|
{ "OnSelect", OnSelect },
|
|
|
|
|
{ "PickerIndex", 0 },
|
|
|
|
|
{ "IsCalendar", true },
|
|
|
|
|
{ "IsShowHeader", false },
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Dictionary<string, object> dateAttributes = new Dictionary<string, object>(attributes);
|
|
|
|
|
dateAttributes.Add("ShowToday", false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
<CascadingValue Value=@Calendar>
|
|
|
|
|
@if (IsShowDatePanel())
|
|
|
|
|
{
|
|
|
|
|
<DatePickerDatePanel TValue="DateTime" @attributes="dateAttributes" />
|
|
|
|
|
}
|
|
|
|
|
else if (IsShowQuarterPanel())
|
|
|
|
|
{
|
|
|
|
|
<DatePickerQuarterPanel TValue="DateTime" @attributes="attributes" />
|
|
|
|
|
}
|
|
|
|
|
else if (IsShowWeekPanel())
|
|
|
|
|
{
|
|
|
|
|
<DatePickerDatePanel TValue="DateTime" @attributes="dateAttributes" IsWeek="@true" />
|
|
|
|
|
}
|
|
|
|
|
else if (IsShowMonthPanel())
|
|
|
|
|
{
|
|
|
|
|
<DatePickerMonthPanel TValue="DateTime" @attributes="attributes" />
|
|
|
|
|
}
|
|
|
|
|
else if (IsShowYearPanel())
|
|
|
|
|
{
|
|
|
|
|
<DatePickerYearPanel TValue="DateTime" @attributes="attributes" />
|
|
|
|
|
}
|
|
|
|
|
else if (IsShowDecadePanel())
|
|
|
|
|
{
|
|
|
|
|
<DatePickerDecadePanel TValue="DateTime" @attributes="attributes" />
|
|
|
|
|
}
|
|
|
|
|
</CascadingValue>
|