|
2 | 2 | @inherits FluentCalendarBase |
3 | 3 |
|
4 | 4 | <FluentInputLabel ForId="@Id" Label="@Label" AriaLabel="@AriaLabel" ChildContent="@LabelTemplate" Required="@Required" /> |
5 | | -<FluentTextField Id="@Id" |
6 | | - Embedded="true" |
7 | | - Class="@ClassValue" |
8 | | - Style="@StyleValue" |
9 | | - AutoComplete="off" |
10 | | - Autofocus="@Autofocus" |
11 | | - Appearance="@Appearance" |
12 | | - @bind-Value="@CurrentValueAsString" |
13 | | - @onclick="@OnCalendarOpenHandlerAsync" |
14 | | - @ondblclick="@OnDoubleClickHandlerAsync" |
15 | | - @onkeydown="(e => KeyDown.SimulateClickAsync(e, OnCalendarOpenHandlerAsync))" |
16 | | - ReadOnly="@ReadOnly" |
17 | | - Disabled="@Disabled" |
18 | | - Required="@Required" |
19 | | - Placeholder="@(Placeholder ?? PlaceholderAccordingToView())" |
20 | | - Name="@Name" |
21 | | - @attributes="@AdditionalAttributes"> |
22 | | - @((MarkupString)CalendarIcon) |
| 5 | +<FluentTextField @ref="TextField" |
| 6 | + Id="@Id" |
| 7 | + Embedded="true" |
| 8 | + Class="@ClassValue" |
| 9 | + Style="@StyleValue" |
| 10 | + AutoComplete="off" |
| 11 | + Autofocus="@Autofocus" |
| 12 | + Appearance="@Appearance" |
| 13 | + @bind-Value="@CurrentValueAsString" |
| 14 | + @onclick="@OnCalendarOpenHandlerAsync" |
| 15 | + @ondblclick="@OnDoubleClickHandlerAsync" |
| 16 | + @onkeydown="(e => KeyDown.SimulateClickAsync(e, OnCalendarOpenHandlerAsync))" |
| 17 | + ReadOnly="@ReadOnly" |
| 18 | + Disabled="@Disabled" |
| 19 | + Required="@Required" |
| 20 | + Placeholder="@(Placeholder ?? PlaceholderAccordingToView())" |
| 21 | + Name="@Name" |
| 22 | + @attributes="@AdditionalAttributes"> |
| 23 | + @((MarkupString)CalendarIcon) |
23 | 24 | </FluentTextField> |
24 | 25 |
|
25 | 26 | @if (Opened) |
26 | 27 | { |
27 | | - <FluentOverlay @bind-Visible="@Opened" Dismissable="true" FullScreen="true" Interactive="true" InteractiveExceptId="@PopupId" /> |
28 | | - <FluentAnchoredRegion Anchor="@Id" |
29 | | - Id="@PopupId" |
30 | | - HorizontalDefaultPosition="@(PopupHorizontalPosition ?? (System.Globalization.CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft ? HorizontalPosition.Left : HorizontalPosition.Right))" |
31 | | - HorizontalInset="true" |
32 | | - VerticalDefaultPosition="@VerticalPosition.Unset" |
33 | | - Shadow="ElevationShadow.Flyout" |
34 | | - Class="fluent-datepicker-popup" |
35 | | - Style="@($"z-index: {ZIndex.DatePickerPopup}; border-radius: calc(var(--control-corner-radius) * 1px); padding: 12px;")"> |
36 | | - <FluentCalendar Culture="@Culture" |
37 | | - View="@View" |
38 | | - DayFormat="@DayFormat" |
39 | | - DisabledDateFunc="@DisabledDateFunc" |
40 | | - DisabledCheckAllDaysOfMonthYear="@DisabledCheckAllDaysOfMonthYear" |
41 | | - DisabledSelectable="@DisabledSelectable" |
42 | | - Value="@Value" |
43 | | - ValueChanged="@OnSelectedDateAsync" |
44 | | - DaysTemplate="@DaysTemplate" |
45 | | - PickerMonthChanged="@PickerMonthChanged" /> |
46 | | - </FluentAnchoredRegion> |
| 28 | + <FluentOverlay @bind-Visible="@Opened" Dismissable="true" FullScreen="true" Interactive="true" InteractiveExceptId="@PopupId" /> |
| 29 | + <FluentAnchoredRegion Anchor="@Id" |
| 30 | + Id="@PopupId" |
| 31 | + HorizontalDefaultPosition="@(PopupHorizontalPosition ?? (System.Globalization.CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft ? HorizontalPosition.Left : HorizontalPosition.Right))" |
| 32 | + HorizontalInset="true" |
| 33 | + VerticalDefaultPosition="@VerticalPosition.Unset" |
| 34 | + Shadow="ElevationShadow.Flyout" |
| 35 | + Class="fluent-datepicker-popup" |
| 36 | + Style="@($"z-index: {ZIndex.DatePickerPopup}; border-radius: calc(var(--control-corner-radius) * 1px); padding: 12px;")"> |
| 37 | + <FluentCalendar Culture="@Culture" |
| 38 | + View="@View" |
| 39 | + DayFormat="@DayFormat" |
| 40 | + DisabledDateFunc="@DisabledDateFunc" |
| 41 | + DisabledCheckAllDaysOfMonthYear="@DisabledCheckAllDaysOfMonthYear" |
| 42 | + DisabledSelectable="@DisabledSelectable" |
| 43 | + Value="@Value" |
| 44 | + ValueChanged="@OnSelectedDateAsync" |
| 45 | + DaysTemplate="@DaysTemplate" |
| 46 | + PickerMonthChanged="@PickerMonthChanged" /> |
| 47 | + </FluentAnchoredRegion> |
47 | 48 | } |
0 commit comments