mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-15 01:11:52 +08:00
65 lines
2.5 KiB
C#
65 lines
2.5 KiB
C#
@namespace AntDesign.Internal
|
|
@inherits AntDomComponentBase
|
|
|
|
@{
|
|
Action ClosePanel = () => { };
|
|
Action<DateTime, int?> ChangePickerValue = async (date, index) => { await Calendar.ChangeValue(date); };
|
|
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 },
|
|
{ "Locale", Calendar.Locale },
|
|
{ "CultureInfo", Calendar.CultureInfo },
|
|
{ "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> |