Commit 16469d7
[dev-v5] Convert the Calendar and DatePicker components to a generic type (#4153)
* Refactor FluentCalendar components to support generic TValue type for enhanced flexibility
* Refactoring CalendarTValue convert methods
* Refacroring to extension methods
* Refactored `FluentCalendar.razor.cs` to use generic type `TValue` for selected dates, improving type safety and flexibility.
* Converted `PickerDay`, `PickerMonth`, and `PickerYear` to nullable types in `CalendarDefault.razor`.
* Refactor calendar components for nullable date handling
Updated calendar components to support nullable DateTime values and generic date representations. Key changes include:
- Modified `DisabledDate` methods to accept `DateTime?`.
- Changed `SelectedDay` in `CalendarSelection.razor` to a non-nullable `DateTime`.
- Updated `DisabledDateFunc` in `FluentCalendarBase.cs` to use a generic type `TValue`.
- Refactored `OnSelectedDateHandlerAsync` to accept `TValue`.
- Implemented conversions to `TValue` in various methods for consistency.
- Enhanced `PickerMonthChanged` to handle nullable month values in `FluentDatePicker.razor`.
- Streamlined `OnSelectedDateAsync` to directly use `TValue`.
These changes improve the flexibility and robustness of the calendar components.
* Fix Unit Tests
* Refactoring
* Refactoring
* Remove "where TValue : struct, IComparable"
* Update example
* Refactoring
* Refactoring
* Refactoring
* Refactoring
* Refactoring
* Refactoring
* Refactoring
* refactoring and add CalendarTypes example
* Refactoring
* Refactoring
* Refactoring
* Fix Unit Tests
* add comments
* Rename IsNull to IsNullOrDefault and update usage
* Add Unit Tests
* Refactoring
* Fix some Unit Tests
* Fix Unit Tests
* Update Unit Tests
* Update parsing logic to handle invalid date inputs and adjust validation error messaging
* Update Demo
* Update doc
* Add TValue Unit Tests
* Add Unit Tests
---------
Co-authored-by: Vincent Baaij <[email protected]>1 parent 2342430 commit 16469d7
File tree
42 files changed
+1815
-746
lines changed- examples
- Demo/FluentUI.Demo.Client/Documentation/Components/DateTime
- Calendar
- Examples
- DatePicker
- Examples
- Tools/FluentUI.Demo.DocViewer/Models
- src/Core
- Components/DateTime
- Enums
- Localization
- tests/Core/Components
- Base
- DateTimes
- Utilities
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
42 files changed
+1815
-746
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
307 | 307 | | |
308 | 308 | | |
309 | 309 | | |
310 | | - | |
| 310 | + | |
311 | 311 | | |
312 | 312 | | |
313 | 313 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
Lines changed: 5 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
Lines changed: 13 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
41 | 44 | | |
42 | 45 | | |
43 | 46 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
| |||
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
50 | 57 | | |
51 | 58 | | |
52 | 59 | | |
53 | | - | |
| 60 | + | |
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| 8 | + | |
0 commit comments