2020-06-01 14:09:28 +08:00
|
|
|
|
@namespace AntDesign
|
2020-08-14 12:43:48 +08:00
|
|
|
|
@inherits DatePickerBase<TValue>
|
2020-07-11 23:03:13 +08:00
|
|
|
|
@typeparam TValue
|
2020-06-01 14:09:28 +08:00
|
|
|
|
@using AntDesign.Internal;
|
|
|
|
|
|
2021-04-06 20:02:53 +08:00
|
|
|
|
<CascadingValue Value='$"{PrefixCls}-dropdown"' Name="PrefixCls">
|
2020-06-01 14:09:28 +08:00
|
|
|
|
<OverlayTrigger @ref="_dropDown"
|
|
|
|
|
Visible="Open"
|
|
|
|
|
IsButton="@true"
|
2021-06-19 00:13:18 +08:00
|
|
|
|
Disabled="IsDisabled()"
|
2020-06-01 14:09:28 +08:00
|
|
|
|
PopupContainerSelector="@PopupContainerSelector"
|
2021-09-10 19:06:50 +08:00
|
|
|
|
BoundaryAdjustMode="@BoundaryAdjustMode"
|
2021-07-15 22:34:05 +08:00
|
|
|
|
OnVisibleChange="OverlayVisibleChange"
|
2021-06-19 00:13:18 +08:00
|
|
|
|
OverlayClassName="ant-picker-dropdown-range"
|
2021-05-07 15:31:13 +08:00
|
|
|
|
OverlayEnterCls="ant-slide-up-enter ant-slide-up-enter-active ant-slide-up"
|
|
|
|
|
OverlayLeaveCls="ant-slide-up-leave ant-slide-up-leave-active ant-slide-up"
|
2021-09-10 19:06:50 +08:00
|
|
|
|
Trigger="new[] { Trigger.Click }">
|
2020-06-01 14:09:28 +08:00
|
|
|
|
<Overlay>
|
2021-06-19 00:13:18 +08:00
|
|
|
|
<div class="@(PrefixCls)-range-arrow" style="@_rangeArrowStyle" />
|
2021-06-28 11:28:18 +08:00
|
|
|
|
<div class="@(PrefixCls)-panel-container" @onclick="@PickerClicked">
|
2020-08-14 12:43:48 +08:00
|
|
|
|
<div class="@(PrefixCls)-panels">
|
2022-09-14 22:16:30 +08:00
|
|
|
|
<div class="@_panelClassMapper.Class" style="@(Picker == DatePickerType.Date && IsShowTime && GetOnFocusPickerIndex() == (RTL ? 0 : 1) ? "display: none;": "")">
|
2022-06-29 20:56:27 +08:00
|
|
|
|
<DatePickerPanelChooser TValue="TValue" DatePicker="@this" PickerIndex="@(RTL ? 1 : 0)" OnSelect="async (date, index) => await OnSelect(date, index)" />
|
2020-06-01 14:09:28 +08:00
|
|
|
|
</div>
|
2021-03-12 17:02:11 +08:00
|
|
|
|
<div class="@_panelClassMapper.Class">
|
2022-06-29 20:56:27 +08:00
|
|
|
|
<DatePickerPanelChooser TValue="TValue" DatePicker="@this" PickerIndex="@(RTL ? 0 : 1)" OnSelect="async (date, index) => await OnSelect(date, index)" />
|
2020-06-01 14:09:28 +08:00
|
|
|
|
</div>
|
2020-08-14 12:43:48 +08:00
|
|
|
|
</div>
|
2022-07-21 14:36:24 +08:00
|
|
|
|
@if (ShowFooter)
|
2020-10-19 12:04:24 +08:00
|
|
|
|
{
|
2022-07-21 14:36:24 +08:00
|
|
|
|
<div class="@(PrefixCls)-footer">
|
|
|
|
|
@if (RenderExtraFooter != null)
|
|
|
|
|
{
|
|
|
|
|
<div class="@(PrefixCls)-footer-extra">
|
|
|
|
|
@RenderExtraFooter
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@if (ShowRanges)
|
|
|
|
|
{
|
|
|
|
|
<ul class="@(PrefixCls)-ranges">
|
|
|
|
|
@foreach (var range in Ranges)
|
|
|
|
|
{
|
|
|
|
|
<li class="ant-picker-preset" @onmouseout="()=>OnRangeItemOut(range.Value)" @onmouseover="()=>OnRangeItemOver(range.Value)">
|
|
|
|
|
<span class="ant-tag ant-tag-blue" @onclick="()=>OnRangeItemClicked(range.Value)">@range.Key</span>
|
|
|
|
|
</li>
|
|
|
|
|
}
|
|
|
|
|
</ul>
|
|
|
|
|
}
|
|
|
|
|
</div>
|
2020-10-19 12:04:24 +08:00
|
|
|
|
}
|
2020-06-01 14:09:28 +08:00
|
|
|
|
</div>
|
|
|
|
|
</Overlay>
|
2021-01-21 17:20:10 +08:00
|
|
|
|
<Unbound>
|
2020-06-01 14:09:28 +08:00
|
|
|
|
<div class="@ClassMapper.Class"
|
2021-01-21 17:20:10 +08:00
|
|
|
|
@ref="@context.Current"
|
2020-07-05 00:06:34 +08:00
|
|
|
|
style="@Style"
|
|
|
|
|
Id="@Id">
|
2020-06-01 14:09:28 +08:00
|
|
|
|
<DatePickerInput @ref="_inputStart"
|
2020-07-05 00:06:34 +08:00
|
|
|
|
PrefixCls="@PrefixCls"
|
|
|
|
|
Size="@Size"
|
2021-06-19 00:13:18 +08:00
|
|
|
|
Disabled="IsDisabled(0)"
|
2020-07-05 00:06:34 +08:00
|
|
|
|
Value="@GetInputValue(0)"
|
|
|
|
|
Placeholder="@_placeholders[0]"
|
|
|
|
|
ReadOnly="@InputReadOnly"
|
|
|
|
|
AutoFocus="@AutoFocus"
|
2022-06-29 20:56:27 +08:00
|
|
|
|
OnClick="async e => await OnInputClick(0)"
|
2020-07-05 00:06:34 +08:00
|
|
|
|
OnInput="e => OnInput(e, 0)"
|
2021-04-28 11:54:19 +08:00
|
|
|
|
OnKeyDown="e => OnKeyDown(e, 0)"
|
2021-02-20 17:54:12 +08:00
|
|
|
|
Onfocus="() => OnFocus(0)"
|
2021-04-28 11:54:19 +08:00
|
|
|
|
OnBlur="e => OnBlur(0)"
|
2020-10-19 12:04:24 +08:00
|
|
|
|
ShowTime="@(Picker == DatePickerType.Time)"
|
2020-07-06 19:09:01 +08:00
|
|
|
|
ShowSuffixIcon="false"
|
|
|
|
|
IsRange="@IsRange"
|
|
|
|
|
AllowClear="@AllowClear"
|
2021-06-30 18:34:19 +08:00
|
|
|
|
HtmlInputSize="@HtmlInputSize"
|
2021-04-28 11:54:19 +08:00
|
|
|
|
OnClickClear="e => ClearValue(-1)" />
|
2020-06-01 14:09:28 +08:00
|
|
|
|
|
2020-08-14 12:43:48 +08:00
|
|
|
|
<div class="@(PrefixCls)-range-separator">
|
|
|
|
|
<span aria-label="to" class="@(PrefixCls)-separator">
|
2020-10-19 12:04:24 +08:00
|
|
|
|
<Icon Type="swap-right" Theme="outline" />
|
2020-08-14 12:43:48 +08:00
|
|
|
|
</span>
|
|
|
|
|
</div>
|
2020-06-01 14:09:28 +08:00
|
|
|
|
|
2020-08-14 12:43:48 +08:00
|
|
|
|
<DatePickerInput @ref="_inputEnd"
|
2020-10-19 12:04:24 +08:00
|
|
|
|
PrefixCls="@PrefixCls"
|
|
|
|
|
Size="@Size"
|
2021-06-19 00:13:18 +08:00
|
|
|
|
Disabled="IsDisabled(1)"
|
2020-10-19 12:04:24 +08:00
|
|
|
|
Value="@GetInputValue(1)"
|
|
|
|
|
Placeholder="@_placeholders[1]"
|
|
|
|
|
ReadOnly="@InputReadOnly"
|
|
|
|
|
AutoFocus="@AutoFocus"
|
2022-06-29 20:56:27 +08:00
|
|
|
|
OnClick="async e => await OnInputClick(1)"
|
|
|
|
|
OnSuffixIconClick="OnSuffixIconClick"
|
2021-02-20 17:54:12 +08:00
|
|
|
|
OnInput="e => OnInput(e, 1)"
|
2021-04-28 11:54:19 +08:00
|
|
|
|
OnKeyDown="e => OnKeyDown(e, 1)"
|
2021-02-20 17:54:12 +08:00
|
|
|
|
Onfocus="() => OnFocus(1)"
|
2021-04-28 11:54:19 +08:00
|
|
|
|
OnBlur="e => OnBlur(1)"
|
2020-10-19 12:04:24 +08:00
|
|
|
|
ShowTime="@(Picker == DatePickerType.Time)"
|
|
|
|
|
IsRange="@IsRange"
|
|
|
|
|
AllowClear="@AllowClear"
|
2021-06-30 18:34:19 +08:00
|
|
|
|
HtmlInputSize="@HtmlInputSize"
|
2022-12-16 00:49:34 +08:00
|
|
|
|
SuffixIcon="@SuffixIcon"
|
2021-04-28 11:54:19 +08:00
|
|
|
|
OnClickClear="e => ClearValue(-1)" />
|
2020-08-14 12:43:48 +08:00
|
|
|
|
<div class="@(PrefixCls)-active-bar" style="@_activeBarStyle"></div>
|
2020-06-01 14:09:28 +08:00
|
|
|
|
</div>
|
2021-01-21 17:20:10 +08:00
|
|
|
|
</Unbound>
|
2020-06-01 14:09:28 +08:00
|
|
|
|
</OverlayTrigger>
|
2020-07-06 19:09:01 +08:00
|
|
|
|
</CascadingValue>
|