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"
|
|
|
|
|
Disabled="Disabled"
|
|
|
|
|
PopupContainerSelector="@PopupContainerSelector"
|
2020-10-29 18:18:48 +08:00
|
|
|
|
OnVisibleChange="visible => { AutoFocus = visible; OnOpenChange.InvokeAsync(visible); }"
|
2021-03-12 15:46:48 +08:00
|
|
|
|
OverlayEnterCls="ant-slide-up-enter ant-slide-up-enter-active ant-slide-up ant-picker-dropdown-range"
|
|
|
|
|
OverlayLeaveCls="ant-slide-up-leave ant-slide-up-leave-active ant-slide-up ant-picker-dropdown-range"
|
2020-06-01 14:09:28 +08:00
|
|
|
|
Trigger="new TriggerType[] { TriggerType.Click }">
|
|
|
|
|
<Overlay>
|
2020-08-14 12:43:48 +08:00
|
|
|
|
<div class="@(PrefixCls)-range-arrow" style="@_rangeArrowStyle"/>
|
2020-06-01 14:09:28 +08:00
|
|
|
|
<div class="@(PrefixCls)-panel-container">
|
2020-08-14 12:43:48 +08:00
|
|
|
|
<div class="@(PrefixCls)-panels">
|
2021-03-12 17:02:11 +08:00
|
|
|
|
<div class="@_panelClassMapper.Class">
|
2021-04-06 20:02:53 +08:00
|
|
|
|
<DatePickerPanelChooser TValue="TValue" DatePicker="@this" PickerIndex="@(RTL ? 1 : 0)" OnSelect="async (date, index) => await OnSelect(date)" />
|
2020-06-01 14:09:28 +08:00
|
|
|
|
</div>
|
2021-03-12 17:02:11 +08:00
|
|
|
|
<div class="@_panelClassMapper.Class">
|
2021-04-06 20:02:53 +08:00
|
|
|
|
<DatePickerPanelChooser TValue="TValue" DatePicker="@this" PickerIndex="@(RTL ? 0 : 1)" OnSelect="async (date, index) => await OnSelect(date)" />
|
2020-06-01 14:09:28 +08:00
|
|
|
|
</div>
|
2020-08-14 12:43:48 +08:00
|
|
|
|
</div>
|
2020-10-29 18:18:48 +08:00
|
|
|
|
@if (RenderExtraFooter != null && !IsShowTime)
|
2020-10-19 12:04:24 +08:00
|
|
|
|
{
|
|
|
|
|
<div class="@(PrefixCls)-footer">
|
|
|
|
|
<div class="@(PrefixCls)-footer-extra">
|
|
|
|
|
@RenderExtraFooter
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
}
|
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"
|
|
|
|
|
Disabled="@Disabled"
|
|
|
|
|
Value="@GetInputValue(0)"
|
|
|
|
|
Placeholder="@_placeholders[0]"
|
|
|
|
|
ReadOnly="@InputReadOnly"
|
|
|
|
|
AutoFocus="@AutoFocus"
|
|
|
|
|
OnClick="async e => { await OnInputClick(0); }"
|
|
|
|
|
OnInput="e => OnInput(e, 0)"
|
2021-02-20 17:54:12 +08:00
|
|
|
|
OnKeyUp="e => OnKeyUp(e, 0)"
|
|
|
|
|
Onfocus="() => OnFocus(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"
|
2020-10-19 12:04:24 +08:00
|
|
|
|
OnClickClear="e => ClearValue(0)" />
|
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"
|
|
|
|
|
Disabled="@Disabled"
|
|
|
|
|
Value="@GetInputValue(1)"
|
|
|
|
|
Placeholder="@_placeholders[1]"
|
|
|
|
|
ReadOnly="@InputReadOnly"
|
|
|
|
|
AutoFocus="@AutoFocus"
|
|
|
|
|
OnClick="async e => { await OnInputClick(1); }"
|
2021-02-20 17:54:12 +08:00
|
|
|
|
OnInput="e => OnInput(e, 1)"
|
|
|
|
|
OnKeyUp="e => OnKeyUp(e, 1)"
|
|
|
|
|
Onfocus="() => OnFocus(1)"
|
2020-10-19 12:04:24 +08:00
|
|
|
|
ShowTime="@(Picker == DatePickerType.Time)"
|
|
|
|
|
IsRange="@IsRange"
|
|
|
|
|
AllowClear="@AllowClear"
|
|
|
|
|
OnClickClear="e => ClearValue(0)" />
|
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>
|