@lazerlen/legend-calendar 1.4.1 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +9 -9
- package/.turbo/turbo-test.log +91 -91
- package/dist/index.d.mts +58 -13
- package/dist/index.d.ts +58 -13
- package/dist/index.js +592 -317
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +588 -314
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
- package/src/components/Calendar.tsx +14 -16
- package/src/components/CalendarItemDay.tsx +6 -8
- package/src/components/CalendarItemEmpty.tsx +2 -3
- package/src/components/CalendarItemWeekName.tsx +2 -3
- package/src/components/CalendarList.tsx +279 -92
- package/src/components/CalendarListConfigContext.tsx +29 -0
- package/src/components/CalendarRowMonth.tsx +2 -3
- package/src/components/CalendarRowWeek.tsx +2 -3
- package/src/components/index.ts +4 -0
- package/src/developer/decorators.tsx +4 -4
package/.turbo/turbo-build.log
CHANGED
|
@@ -9,12 +9,12 @@
|
|
|
9
9
|
[34mCJS[39m Build start
|
|
10
10
|
[34mESM[39m Build start
|
|
11
11
|
DTS Build start
|
|
12
|
-
[32mCJS[39m [1mdist/index.js [22m[
|
|
13
|
-
[32mCJS[39m [1mdist/index.js.map [22m[
|
|
14
|
-
[32mCJS[39m ⚡️ Build success in
|
|
15
|
-
[32mESM[39m [1mdist/index.mjs [22m[
|
|
16
|
-
[32mESM[39m [1mdist/index.mjs.map [22m[
|
|
17
|
-
[32mESM[39m ⚡️ Build success in
|
|
18
|
-
DTS ⚡️ Build success in
|
|
19
|
-
DTS dist/index.d.ts
|
|
20
|
-
DTS dist/index.d.mts
|
|
12
|
+
[32mCJS[39m [1mdist/index.js [22m[32m86.17 KB[39m
|
|
13
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m159.21 KB[39m
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 1201ms
|
|
15
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m83.12 KB[39m
|
|
16
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m158.68 KB[39m
|
|
17
|
+
[32mESM[39m ⚡️ Build success in 1202ms
|
|
18
|
+
DTS ⚡️ Build success in 1191ms
|
|
19
|
+
DTS dist/index.d.ts 27.19 KB
|
|
20
|
+
DTS dist/index.d.mts 27.19 KB
|
package/.turbo/turbo-test.log
CHANGED
|
@@ -5,213 +5,213 @@
|
|
|
5
5
|
src/hooks/useDateRange.test.ts:
|
|
6
6
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
7
7
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
8
|
-
[0m[32m✓[0m [0museDateRange[2m >[0m[1m should initialize with correct default values[0m [0m[2m[
|
|
8
|
+
[0m[32m✓[0m [0museDateRange[2m >[0m[1m should initialize with correct default values[0m [0m[2m[4.31ms[0m[2m][0m
|
|
9
9
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
10
10
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
11
11
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
12
12
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
13
13
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
14
14
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
15
|
-
[0m[32m✓[0m [0museDateRange[2m >[0m[1m should update dateRange correctly on onCalendarDayPress[0m [0m[2m[
|
|
15
|
+
[0m[32m✓[0m [0museDateRange[2m >[0m[1m should update dateRange correctly on onCalendarDayPress[0m [0m[2m[0.72ms[0m[2m][0m
|
|
16
16
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
17
17
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
18
18
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
19
19
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
20
20
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
21
|
-
[0m[32m✓[0m [0museDateRange[2m >[0m[1m should clear dateRange on onClearDateRange[0m [0m[2m[
|
|
21
|
+
[0m[32m✓[0m [0museDateRange[2m >[0m[1m should clear dateRange on onClearDateRange[0m [0m[2m[0.30ms[0m[2m][0m
|
|
22
22
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
23
23
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
24
24
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
25
25
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
26
26
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
27
|
-
[0m[32m✓[0m [0museDateRange[2m >[0m[1m should update isDateRangeValid correctly[0m [0m[2m[0.
|
|
27
|
+
[0m[32m✓[0m [0museDateRange[2m >[0m[1m should update isDateRangeValid correctly[0m [0m[2m[0.23ms[0m[2m][0m
|
|
28
28
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
29
29
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
30
|
-
[0m[32m✓[0m [0museDateRange[2m >[0m[1m can initialize a date range[0m [0m[2m[0.
|
|
30
|
+
[0m[32m✓[0m [0museDateRange[2m >[0m[1m can initialize a date range[0m [0m[2m[0.07ms[0m[2m][0m
|
|
31
31
|
[0m
|
|
32
32
|
src/hooks/useCalendarList.test.ts:
|
|
33
|
-
[0m[32m✓[0m [0mgetHeightForMonth[2m >[0m[1m Measures months with 5 weeks (no calendar spacing)[0m
|
|
34
|
-
[0m[32m✓[0m [0mgetHeightForMonth[2m >[0m[1m Measures months with 5 weeks (with calendar spacing)[0m
|
|
33
|
+
[0m[32m✓[0m [0mgetHeightForMonth[2m >[0m[1m Measures months with 5 weeks (no calendar spacing)[0m
|
|
34
|
+
[0m[32m✓[0m [0mgetHeightForMonth[2m >[0m[1m Measures months with 5 weeks (with calendar spacing)[0m
|
|
35
35
|
[0m[32m✓[0m [0mgetHeightForMonth[2m >[0m[1m Accounts for additional height[0m
|
|
36
36
|
[0m[32m✓[0m [0mgetHeightForMonth[2m >[0m[1m Measures months with 6 weeks[0m
|
|
37
|
-
[0m[32m✓[0m [0mgetHeightForMonth[2m >[0m[1m February 24 has the right height with base options[0m [0m[2m[0.
|
|
37
|
+
[0m[32m✓[0m [0mgetHeightForMonth[2m >[0m[1m February 24 has the right height with base options[0m [0m[2m[0.29ms[0m[2m][0m
|
|
38
38
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
39
39
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
40
40
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
41
41
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
42
|
-
[0m[32m✓[0m [0museCalendarList[2m > [0mMin/Max dates[2m >[0m[1m Max: virtualization still works as expected[0m [0m[2m[
|
|
42
|
+
[0m[32m✓[0m [0museCalendarList[2m > [0mMin/Max dates[2m >[0m[1m Max: virtualization still works as expected[0m [0m[2m[0.56ms[0m[2m][0m
|
|
43
43
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
44
44
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
45
45
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
46
46
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
47
|
-
[0m[32m✓[0m [0museCalendarList[2m > [0mMin/Max dates[2m >[0m[1m Min: virtualization still works as expected[0m [0m[2m[0.
|
|
47
|
+
[0m[32m✓[0m [0museCalendarList[2m > [0mMin/Max dates[2m >[0m[1m Min: virtualization still works as expected[0m [0m[2m[0.22ms[0m[2m][0m
|
|
48
48
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
49
49
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
50
|
-
[0m[32m✓[0m [0museCalendarList[2m > [0mMin/Max dates[2m >[0m[1m Returns a single month when min and max are in the same month[0m [0m[2m[0.
|
|
50
|
+
[0m[32m✓[0m [0museCalendarList[2m > [0mMin/Max dates[2m >[0m[1m Returns a single month when min and max are in the same month[0m [0m[2m[0.09ms[0m[2m][0m
|
|
51
51
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
52
52
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
53
|
-
[0m[32m✓[0m [0museCalendarList[2m > [0mMin/Max dates[2m >[0m[1m Returns a range of months bounded by the min and max dates[0m [0m[2m[0.
|
|
53
|
+
[0m[32m✓[0m [0museCalendarList[2m > [0mMin/Max dates[2m >[0m[1m Returns a range of months bounded by the min and max dates[0m [0m[2m[0.09ms[0m[2m][0m
|
|
54
54
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
55
55
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
56
|
-
[0m[32m✓[0m [0museCalendarList[2m > [0mMin/Max dates[2m >[0m[1m Ignores past/future scroll ranges when min/max dates are used[0m [0m[2m[0.
|
|
56
|
+
[0m[32m✓[0m [0museCalendarList[2m > [0mMin/Max dates[2m >[0m[1m Ignores past/future scroll ranges when min/max dates are used[0m [0m[2m[0.05ms[0m[2m][0m
|
|
57
57
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
58
58
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
59
|
-
[0m[32m✓[0m [0museCalendarList[2m > [0mMin/Max dates[2m >[0m[1m Append/Prepend are no-op if min/max are reached[0m [0m[2m[0.
|
|
59
|
+
[0m[32m✓[0m [0museCalendarList[2m > [0mMin/Max dates[2m >[0m[1m Append/Prepend are no-op if min/max are reached[0m [0m[2m[0.15ms[0m[2m][0m
|
|
60
60
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
61
61
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
62
62
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
63
63
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
64
|
-
[0m[32m✓[0m [0museCalendarList[2m > [0mMin/Max dates[2m >[0m[1m Prepend does not trigger a state update when starting month is already present[0m [0m[2m[0.
|
|
64
|
+
[0m[32m✓[0m [0museCalendarList[2m > [0mMin/Max dates[2m >[0m[1m Prepend does not trigger a state update when starting month is already present[0m [0m[2m[0.18ms[0m[2m][0m
|
|
65
65
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
66
66
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
67
|
-
[0m[32m✓[0m [0museCalendarList[2m > [0mgithub issues[2m >[0m[1m #16: Incorrect scroll position when setting calendarMinDateId[0m [0m[2m[0.
|
|
67
|
+
[0m[32m✓[0m [0museCalendarList[2m > [0mgithub issues[2m >[0m[1m #16: Incorrect scroll position when setting calendarMinDateId[0m [0m[2m[0.07ms[0m[2m][0m
|
|
68
68
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
69
69
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
70
|
-
[0m[32m✓[0m [0museCalendarList[2m >[0m[1m Data is correctly built when future/past ranges are 0[0m [0m[2m[0.
|
|
70
|
+
[0m[32m✓[0m [0museCalendarList[2m >[0m[1m Data is correctly built when future/past ranges are 0[0m [0m[2m[0.04ms[0m[2m][0m
|
|
71
71
|
[0m
|
|
72
72
|
src/hooks/useCalendar.test.ts:
|
|
73
|
-
[0m[32m✓[0m [0mbuildCalendar[2m > [0misLastDayOfWeek[2m >[0m[1m isLastDayOfWeek respects "sunday" as last day of week[0m [0m[2m[
|
|
74
|
-
[0m[32m✓[0m [0mbuildCalendar[2m > [0misLastDayOfWeek[2m >[0m[1m isLastDayOfWeek respects "monday" as last day of week[0m [0m[2m[
|
|
75
|
-
[0m[32m✓[0m [0mbuildCalendar[2m > [0misWeekend[2m >[0m[1m starting on sunday[0m [0m[2m[
|
|
76
|
-
[0m[32m✓[0m [0mbuildCalendar[2m > [0misWeekend[2m >[0m[1m starting on monday[0m [0m[2m[1.
|
|
77
|
-
[0m[32m✓[0m [0mbuildCalendar[2m > [0mstate[2m >[0m[1m active: supersedes today[0m [0m[2m[1.
|
|
78
|
-
[0m[32m✓[0m [0mbuildCalendar[2m > [0mstate[2m >[0m[1m active: supersedes disabled (with calendarDisabledDateIds)[0m [0m[2m[1.
|
|
79
|
-
[0m[32m✓[0m [0mbuildCalendar[2m > [0mstate[2m >[0m[1m active: supersedes disabled (with min)[0m [0m[2m[1.
|
|
80
|
-
[0m[32m✓[0m [0mbuildCalendar[2m > [0mstate[2m >[0m[1m active: supersedes disabled (with max)[0m [0m[2m[1.
|
|
81
|
-
[0m[32m✓[0m [0mbuildCalendar[2m > [0mstate[2m >[0m[1m active: supersedes idle[0m [0m[2m[1.
|
|
82
|
-
[0m[32m✓[0m [0mbuildCalendar[2m > [0mstate[2m >[0m[1m disabled: supersedes idle[0m [0m[2m[1.
|
|
83
|
-
[0m[32m✓[0m [0mbuildCalendar[2m > [0mstate[2m >[0m[1m today: supersedes idle[0m [0m[2m[1.
|
|
84
|
-
[0m[32m✓[0m [0mbuildCalendar[2m > [0mstate[2m >[0m[1m idle: serves as the base state[0m [0m[2m[1.
|
|
85
|
-
[0m[32m✓[0m [0mbuildCalendar[2m >[0m[1m builds the month row[0m [0m[2m[
|
|
86
|
-
[0m[32m✓[0m [0mbuildCalendar[2m >[0m[1m build the month row with custom formatting[0m [0m[2m[
|
|
87
|
-
[0m[32m✓[0m [0mbuildCalendar[2m >[0m[1m builds the week days row starting on sunday[0m [0m[2m[1.
|
|
88
|
-
[0m[32m✓[0m [0mbuildCalendar[2m >[0m[1m builds the week days row starting on monday[0m [0m[2m[
|
|
89
|
-
[0m[32m✓[0m [0mbuildCalendar[2m >[0m[1m builds the weeks row[0m [0m[2m[
|
|
90
|
-
[0m[32m✓[0m [0mbuildCalendar[2m >[0m[1m build the weeks row with custom formatting[0m [0m[2m[
|
|
91
|
-
[0m[32m✓[0m [0mbuildCalendar[2m >[0m[1m handles the expected range[0m [0m[2m[1.
|
|
92
|
-
[0m[32m✓[0m [0mbuildCalendar[2m >[0m[1m calendarMinDate[0m [0m[2m[1.
|
|
93
|
-
[0m[32m✓[0m [0mbuildCalendar[2m >[0m[1m calendarMaxDate[0m [0m[2m[1.
|
|
73
|
+
[0m[32m✓[0m [0mbuildCalendar[2m > [0misLastDayOfWeek[2m >[0m[1m isLastDayOfWeek respects "sunday" as last day of week[0m [0m[2m[7.74ms[0m[2m][0m
|
|
74
|
+
[0m[32m✓[0m [0mbuildCalendar[2m > [0misLastDayOfWeek[2m >[0m[1m isLastDayOfWeek respects "monday" as last day of week[0m [0m[2m[0.85ms[0m[2m][0m
|
|
75
|
+
[0m[32m✓[0m [0mbuildCalendar[2m > [0misWeekend[2m >[0m[1m starting on sunday[0m [0m[2m[0.78ms[0m[2m][0m
|
|
76
|
+
[0m[32m✓[0m [0mbuildCalendar[2m > [0misWeekend[2m >[0m[1m starting on monday[0m [0m[2m[1.02ms[0m[2m][0m
|
|
77
|
+
[0m[32m✓[0m [0mbuildCalendar[2m > [0mstate[2m >[0m[1m active: supersedes today[0m [0m[2m[1.05ms[0m[2m][0m
|
|
78
|
+
[0m[32m✓[0m [0mbuildCalendar[2m > [0mstate[2m >[0m[1m active: supersedes disabled (with calendarDisabledDateIds)[0m [0m[2m[1.03ms[0m[2m][0m
|
|
79
|
+
[0m[32m✓[0m [0mbuildCalendar[2m > [0mstate[2m >[0m[1m active: supersedes disabled (with min)[0m [0m[2m[1.20ms[0m[2m][0m
|
|
80
|
+
[0m[32m✓[0m [0mbuildCalendar[2m > [0mstate[2m >[0m[1m active: supersedes disabled (with max)[0m [0m[2m[1.25ms[0m[2m][0m
|
|
81
|
+
[0m[32m✓[0m [0mbuildCalendar[2m > [0mstate[2m >[0m[1m active: supersedes idle[0m [0m[2m[1.17ms[0m[2m][0m
|
|
82
|
+
[0m[32m✓[0m [0mbuildCalendar[2m > [0mstate[2m >[0m[1m disabled: supersedes idle[0m [0m[2m[1.05ms[0m[2m][0m
|
|
83
|
+
[0m[32m✓[0m [0mbuildCalendar[2m > [0mstate[2m >[0m[1m today: supersedes idle[0m [0m[2m[1.14ms[0m[2m][0m
|
|
84
|
+
[0m[32m✓[0m [0mbuildCalendar[2m > [0mstate[2m >[0m[1m idle: serves as the base state[0m [0m[2m[1.27ms[0m[2m][0m
|
|
85
|
+
[0m[32m✓[0m [0mbuildCalendar[2m >[0m[1m builds the month row[0m [0m[2m[0.97ms[0m[2m][0m
|
|
86
|
+
[0m[32m✓[0m [0mbuildCalendar[2m >[0m[1m build the month row with custom formatting[0m [0m[2m[1.22ms[0m[2m][0m
|
|
87
|
+
[0m[32m✓[0m [0mbuildCalendar[2m >[0m[1m builds the week days row starting on sunday[0m [0m[2m[1.17ms[0m[2m][0m
|
|
88
|
+
[0m[32m✓[0m [0mbuildCalendar[2m >[0m[1m builds the week days row starting on monday[0m [0m[2m[0.84ms[0m[2m][0m
|
|
89
|
+
[0m[32m✓[0m [0mbuildCalendar[2m >[0m[1m builds the weeks row[0m [0m[2m[1.18ms[0m[2m][0m
|
|
90
|
+
[0m[32m✓[0m [0mbuildCalendar[2m >[0m[1m build the weeks row with custom formatting[0m [0m[2m[0.63ms[0m[2m][0m
|
|
91
|
+
[0m[32m✓[0m [0mbuildCalendar[2m >[0m[1m handles the expected range[0m [0m[2m[1.60ms[0m[2m][0m
|
|
92
|
+
[0m[32m✓[0m [0mbuildCalendar[2m >[0m[1m calendarMinDate[0m [0m[2m[1.17ms[0m[2m][0m
|
|
93
|
+
[0m[32m✓[0m [0mbuildCalendar[2m >[0m[1m calendarMaxDate[0m [0m[2m[1.09ms[0m[2m][0m
|
|
94
94
|
[0m
|
|
95
95
|
src/hooks/useOptimizedDayMetadata.test.ts:
|
|
96
96
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
97
97
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
98
|
-
[0m[32m✓[0m [0museOptimizedDayMetadata[2m >[0m[1m return the base metadata as the initial value[0m [0m[2m[0.
|
|
98
|
+
[0m[32m✓[0m [0museOptimizedDayMetadata[2m >[0m[1m return the base metadata as the initial value[0m [0m[2m[0.44ms[0m[2m][0m
|
|
99
99
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
100
100
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
101
101
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
102
|
-
[0m[32m✓[0m [0museOptimizedDayMetadata[2m >[0m[1m if the base changes, the returned value should match it.[0m [0m[2m[0.
|
|
102
|
+
[0m[32m✓[0m [0museOptimizedDayMetadata[2m >[0m[1m if the base changes, the returned value should match it.[0m [0m[2m[0.40ms[0m[2m][0m
|
|
103
103
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
104
104
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
105
105
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
106
|
-
[0m[32m✓[0m [0museOptimizedDayMetadata[2m >[0m[1m endOfRange: returns the updated metadata once an event is emitted[0m [0m[2m[0.
|
|
106
|
+
[0m[32m✓[0m [0museOptimizedDayMetadata[2m >[0m[1m endOfRange: returns the updated metadata once an event is emitted[0m [0m[2m[0.30ms[0m[2m][0m
|
|
107
107
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
108
108
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
109
109
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
110
|
-
[0m[32m✓[0m [0museOptimizedDayMetadata[2m >[0m[1m startOfRange: returns the updated metadata once an event is emitted[0m [0m[2m[0.
|
|
110
|
+
[0m[32m✓[0m [0museOptimizedDayMetadata[2m >[0m[1m startOfRange: returns the updated metadata once an event is emitted[0m [0m[2m[0.43ms[0m[2m][0m
|
|
111
111
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
112
112
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
113
113
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
114
|
-
[0m[32m✓[0m [0museOptimizedDayMetadata[2m >[0m[1m startOfRange|endOfRange: returns the updated metadata once an event is emitted[0m [0m[2m[0.
|
|
114
|
+
[0m[32m✓[0m [0museOptimizedDayMetadata[2m >[0m[1m startOfRange|endOfRange: returns the updated metadata once an event is emitted[0m [0m[2m[0.19ms[0m[2m][0m
|
|
115
115
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
116
116
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
117
117
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
118
|
-
[0m[32m✓[0m [0museOptimizedDayMetadata[2m >[0m[1m doesn't re-render if the active dates don't overlap[0m [0m[2m[0.
|
|
118
|
+
[0m[32m✓[0m [0museOptimizedDayMetadata[2m >[0m[1m doesn't re-render if the active dates don't overlap[0m [0m[2m[0.21ms[0m[2m][0m
|
|
119
119
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
120
120
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
121
121
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
122
122
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
123
|
-
[0m[32m✓[0m [0museOptimizedDayMetadata[2m >[0m[1m resets the state once a new range is selected[0m [0m[2m[0.
|
|
123
|
+
[0m[32m✓[0m [0museOptimizedDayMetadata[2m >[0m[1m resets the state once a new range is selected[0m [0m[2m[0.16ms[0m[2m][0m
|
|
124
124
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
125
125
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
126
126
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
127
|
-
[0m[32m✓[0m [0museOptimizedDayMetadata with calendarInstanceId[2m >[0m[1m uses the default instance ID when not provided[0m [0m[2m[0.
|
|
127
|
+
[0m[32m✓[0m [0museOptimizedDayMetadata with calendarInstanceId[2m >[0m[1m uses the default instance ID when not provided[0m [0m[2m[0.12ms[0m[2m][0m
|
|
128
128
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
129
129
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
130
130
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
131
131
|
[0m[32m✓[0m [0museOptimizedDayMetadata with calendarInstanceId[2m >[0m[1m responds to events for the correct instance ID[0m [0m[2m[0.09ms[0m[2m][0m
|
|
132
132
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
133
133
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
134
|
-
[0m[32m✓[0m [0museOptimizedDayMetadata with calendarInstanceId[2m >[0m[1m ignores events for different instance IDs[0m [0m[2m[0.
|
|
134
|
+
[0m[32m✓[0m [0museOptimizedDayMetadata with calendarInstanceId[2m >[0m[1m ignores events for different instance IDs[0m [0m[2m[0.07ms[0m[2m][0m
|
|
135
135
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
136
136
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
137
137
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
138
138
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
139
139
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
140
140
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
141
|
-
[0m[32m✓[0m [0museOptimizedDayMetadata with calendarInstanceId[2m >[0m[1m handles multiple instances correctly[0m [0m[2m[0.
|
|
141
|
+
[0m[32m✓[0m [0museOptimizedDayMetadata with calendarInstanceId[2m >[0m[1m handles multiple instances correctly[0m [0m[2m[0.89ms[0m[2m][0m
|
|
142
142
|
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
143
143
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
144
144
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
145
145
|
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
146
|
-
[0m[32m✓[0m [0museOptimizedDayMetadata with calendarInstanceId[2m >[0m[1m resets state for the correct instance when a new range is selected[0m [0m[2m[0.
|
|
146
|
+
[0m[32m✓[0m [0museOptimizedDayMetadata with calendarInstanceId[2m >[0m[1m resets state for the correct instance when a new range is selected[0m [0m[2m[0.17ms[0m[2m][0m
|
|
147
147
|
[0m
|
|
148
148
|
src/helpers/dates.test.ts:
|
|
149
149
|
[0m[32m✓[0m [0mtoDateId: UTC time zone[2m >[0m[1m January 1st, 2024[0m
|
|
150
150
|
[0m[32m✓[0m [0mtoDateId: UTC time zone[2m >[0m[1m January 31th, 2024[0m
|
|
151
151
|
[0m[32m✓[0m [0mtoDateId: UTC time zone[2m >[0m[1m February 1st, 2024[0m
|
|
152
|
-
[0m[32m✓[0m [0mtoDateId: UTC time zone[2m >[0m[1m February 10th, 2024[0m
|
|
153
|
-
[0m[32m✓[0m [0mtoDateId: UTC time zone[2m >[0m[1m convert between ID -> Date -> ID returns the original result[0m
|
|
154
|
-
[0m[32m✓[0m [0mtoDateId: Brasilia time zone [2m >[0m[1m January 1st, 2024[0m
|
|
155
|
-
[0m[32m✓[0m [0mtoDateId: Brasilia time zone [2m >[0m[1m January 31th, 2024[0m
|
|
156
|
-
[0m[32m✓[0m [0mtoDateId: Brasilia time zone [2m >[0m[1m February 1st, 2024[0m
|
|
157
|
-
[0m[32m✓[0m [0mtoDateId: Brasilia time zone [2m >[0m[1m February 10th, 2024[0m
|
|
158
|
-
[0m[32m✓[0m [0mtoDateId: Brasilia time zone [2m >[0m[1m February 29th, 2024[0m [0m[2m[0.
|
|
159
|
-
[0m[32m✓[0m [0mtoDateId: Brasilia time zone [2m >[0m[1m convert between ID -> Date -> ID returns the original result[0m [0m[2m[0.
|
|
152
|
+
[0m[32m✓[0m [0mtoDateId: UTC time zone[2m >[0m[1m February 10th, 2024[0m
|
|
153
|
+
[0m[32m✓[0m [0mtoDateId: UTC time zone[2m >[0m[1m convert between ID -> Date -> ID returns the original result[0m
|
|
154
|
+
[0m[32m✓[0m [0mtoDateId: Brasilia time zone [2m >[0m[1m January 1st, 2024[0m
|
|
155
|
+
[0m[32m✓[0m [0mtoDateId: Brasilia time zone [2m >[0m[1m January 31th, 2024[0m
|
|
156
|
+
[0m[32m✓[0m [0mtoDateId: Brasilia time zone [2m >[0m[1m February 1st, 2024[0m
|
|
157
|
+
[0m[32m✓[0m [0mtoDateId: Brasilia time zone [2m >[0m[1m February 10th, 2024[0m [0m[2m[0.02ms[0m[2m][0m
|
|
158
|
+
[0m[32m✓[0m [0mtoDateId: Brasilia time zone [2m >[0m[1m February 29th, 2024[0m [0m[2m[0.02ms[0m[2m][0m
|
|
159
|
+
[0m[32m✓[0m [0mtoDateId: Brasilia time zone [2m >[0m[1m convert between ID -> Date -> ID returns the original result[0m [0m[2m[0.02ms[0m[2m][0m
|
|
160
160
|
[0m[32m✓[0m [0mfromDateId: UTC time zone[2m >[0m[1m parse Jan 1st[0m [0m[2m[0.02ms[0m[2m][0m
|
|
161
161
|
[0m[32m✓[0m [0mfromDateId: UTC time zone[2m >[0m[1m parses March 1st[0m
|
|
162
|
-
[0m[32m✓[0m [0mfromDateId: Brasilia time zone[2m >[0m[1m parse Jan 1st[0m
|
|
163
|
-
[0m[32m✓[0m [0mfromDateId: Brasilia time zone[2m >[0m[1m parses March 1st[0m
|
|
164
|
-
[0m[32m✓[0m [0mstartOfMonth[2m >[0m[1m January[0m [0m[2m[0.
|
|
162
|
+
[0m[32m✓[0m [0mfromDateId: Brasilia time zone[2m >[0m[1m parse Jan 1st[0m
|
|
163
|
+
[0m[32m✓[0m [0mfromDateId: Brasilia time zone[2m >[0m[1m parses March 1st[0m [0m[2m[0.01ms[0m[2m][0m
|
|
164
|
+
[0m[32m✓[0m [0mstartOfMonth[2m >[0m[1m January[0m [0m[2m[0.02ms[0m[2m][0m
|
|
165
165
|
[0m[32m✓[0m [0mstartOfMonth[2m >[0m[1m February[0m
|
|
166
|
-
[0m[32m✓[0m [0mstartOfMonth[2m >[0m[1m matches date-fns[0m [0m[2m[1.
|
|
167
|
-
[0m[32m✓[0m [0mendOfMonth[2m >[0m[1m January[0m [0m[2m[0.
|
|
166
|
+
[0m[32m✓[0m [0mstartOfMonth[2m >[0m[1m matches date-fns[0m [0m[2m[1.13ms[0m[2m][0m
|
|
167
|
+
[0m[32m✓[0m [0mendOfMonth[2m >[0m[1m January[0m [0m[2m[0.01ms[0m[2m][0m
|
|
168
168
|
[0m[32m✓[0m [0mendOfMonth[2m >[0m[1m February[0m
|
|
169
|
-
[0m[32m✓[0m [0mendOfMonth[2m >[0m[1m matches date-fns[0m [0m[2m[1.
|
|
170
|
-
[0m[32m✓[0m [0mstartOfWeek[2m >[0m[1m sunday: week of February 17th[0m [0m[2m[0.
|
|
171
|
-
[0m[32m✓[0m [0mstartOfWeek[2m >[0m[1m sunday: week of February 11th[0m
|
|
172
|
-
[0m[32m✓[0m [0mstartOfWeek[2m >[0m[1m monday: week of February 17th[0m
|
|
173
|
-
[0m[32m✓[0m [0mstartOfWeek[2m >[0m[1m monday: week of February 11th[0m
|
|
174
|
-
[0m[32m✓[0m [0mstartOfWeek[2m >[0m[1m matches date-fns[0m [0m[2m[1.
|
|
175
|
-
[0m[32m✓[0m [0maddMonths[2m >[0m[1m add 1 month[0m [0m[2m[0.
|
|
169
|
+
[0m[32m✓[0m [0mendOfMonth[2m >[0m[1m matches date-fns[0m [0m[2m[1.14ms[0m[2m][0m
|
|
170
|
+
[0m[32m✓[0m [0mstartOfWeek[2m >[0m[1m sunday: week of February 17th[0m [0m[2m[0.01ms[0m[2m][0m
|
|
171
|
+
[0m[32m✓[0m [0mstartOfWeek[2m >[0m[1m sunday: week of February 11th[0m
|
|
172
|
+
[0m[32m✓[0m [0mstartOfWeek[2m >[0m[1m monday: week of February 17th[0m
|
|
173
|
+
[0m[32m✓[0m [0mstartOfWeek[2m >[0m[1m monday: week of February 11th[0m
|
|
174
|
+
[0m[32m✓[0m [0mstartOfWeek[2m >[0m[1m matches date-fns[0m [0m[2m[1.04ms[0m[2m][0m
|
|
175
|
+
[0m[32m✓[0m [0maddMonths[2m >[0m[1m add 1 month[0m [0m[2m[0.05ms[0m[2m][0m
|
|
176
176
|
[0m[32m✓[0m [0maddMonths[2m >[0m[1m add 10 months[0m [0m[2m[0.01ms[0m[2m][0m
|
|
177
|
-
[0m[32m✓[0m [0maddMonths[2m >[0m[1m matches date-fns[0m [0m[2m[0.
|
|
178
|
-
[0m[32m✓[0m [0msubMonths[2m >[0m[1m sub 1 month[0m [0m[2m[0.
|
|
179
|
-
[0m[32m✓[0m [0msubMonths[2m >[0m[1m sub 10 months[0m
|
|
180
|
-
[0m[32m✓[0m [0msubMonths[2m >[0m[1m matches date-fns[0m [0m[2m[0.
|
|
181
|
-
[0m[32m✓[0m [0maddDays[2m >[0m[1m add 1 day[0m [0m[2m[0.
|
|
177
|
+
[0m[32m✓[0m [0maddMonths[2m >[0m[1m matches date-fns[0m [0m[2m[0.20ms[0m[2m][0m
|
|
178
|
+
[0m[32m✓[0m [0msubMonths[2m >[0m[1m sub 1 month[0m [0m[2m[0.02ms[0m[2m][0m
|
|
179
|
+
[0m[32m✓[0m [0msubMonths[2m >[0m[1m sub 10 months[0m
|
|
180
|
+
[0m[32m✓[0m [0msubMonths[2m >[0m[1m matches date-fns[0m [0m[2m[0.12ms[0m[2m][0m
|
|
181
|
+
[0m[32m✓[0m [0maddDays[2m >[0m[1m add 1 day[0m [0m[2m[0.01ms[0m[2m][0m
|
|
182
182
|
[0m[32m✓[0m [0maddDays[2m >[0m[1m add 10 days[0m
|
|
183
|
-
[0m[32m✓[0m [0maddDays[2m >[0m[1m matches date-fns[0m [0m[2m[0.
|
|
183
|
+
[0m[32m✓[0m [0maddDays[2m >[0m[1m matches date-fns[0m [0m[2m[0.07ms[0m[2m][0m
|
|
184
184
|
[0m[32m✓[0m [0msubDays[2m >[0m[1m sub 1 day[0m
|
|
185
185
|
[0m[32m✓[0m [0msubDays[2m >[0m[1m sub 10 days[0m
|
|
186
|
-
[0m[32m✓[0m [0msubDays[2m >[0m[1m matches date-fns[0m [0m[2m[0.
|
|
187
|
-
[0m[32m✓[0m [0misWeekend[2m >[0m[1m Friday[0m
|
|
186
|
+
[0m[32m✓[0m [0msubDays[2m >[0m[1m matches date-fns[0m [0m[2m[0.06ms[0m[2m][0m
|
|
187
|
+
[0m[32m✓[0m [0misWeekend[2m >[0m[1m Friday[0m
|
|
188
188
|
[0m[32m✓[0m [0misWeekend[2m >[0m[1m Saturday[0m
|
|
189
189
|
[0m[32m✓[0m [0misWeekend[2m >[0m[1m Sunday[0m
|
|
190
190
|
[0m[32m✓[0m [0misWeekend[2m >[0m[1m Monday[0m
|
|
191
191
|
[0m[32m✓[0m [0mdifferenceInMonths [2m > [0medge cases[2m >[0m[1m it returns diff of 1 month between Feb 28 2021 and Jan 30 2021[0m [0m[2m[0.01ms[0m[2m][0m
|
|
192
|
-
[0m[32m✓[0m [0mdifferenceInMonths [2m > [0medge cases[2m >[0m[1m it returns diff of 1 month between Feb 28 2021 and Jan 31 2021[0m
|
|
192
|
+
[0m[32m✓[0m [0mdifferenceInMonths [2m > [0medge cases[2m >[0m[1m it returns diff of 1 month between Feb 28 2021 and Jan 31 2021[0m
|
|
193
193
|
[0m[32m✓[0m [0mdifferenceInMonths [2m > [0medge cases[2m >[0m[1m it returns diff of 1 month between Nov, 30 2021 and Oct, 31 2021[0m
|
|
194
194
|
[0m[32m✓[0m [0mdifferenceInMonths [2m > [0medge cases[2m >[0m[1m it returns diff of 1 month between Oct, 31 2021 and Sep, 30 2021[0m
|
|
195
195
|
[0m[32m✓[0m [0mdifferenceInMonths [2m > [0medge cases[2m >[0m[1m it returns diff of 6 month between Oct, 31 2021 and Apr, 30 2021[0m
|
|
196
|
-
[0m[32m✓[0m [0mdifferenceInMonths [2m > [0medge cases[2m >[0m[1m it returns diff of -1 month between Sep, 30 2021 and Oct, 31 2021[0m
|
|
197
|
-
[0m[32m✓[0m [0mdifferenceInMonths [2m > [0medge cases[2m >[0m[1m the days of months of the given dates are the same[0m
|
|
198
|
-
[0m[32m✓[0m [0mdifferenceInMonths [2m > [0medge cases[2m >[0m[1m the given dates are the same[0m
|
|
196
|
+
[0m[32m✓[0m [0mdifferenceInMonths [2m > [0medge cases[2m >[0m[1m it returns diff of -1 month between Sep, 30 2021 and Oct, 31 2021[0m
|
|
197
|
+
[0m[32m✓[0m [0mdifferenceInMonths [2m > [0medge cases[2m >[0m[1m the days of months of the given dates are the same[0m
|
|
198
|
+
[0m[32m✓[0m [0mdifferenceInMonths [2m > [0medge cases[2m >[0m[1m the given dates are the same[0m
|
|
199
199
|
[0m[32m✓[0m [0mdifferenceInMonths [2m > [0medge cases[2m >[0m[1m does not return -0 when the given dates are the same[0m [0m[2m[0.02ms[0m[2m][0m
|
|
200
|
-
[0m[32m✓[0m [0mdifferenceInMonths [2m > [0medge cases[2m >[0m[1m returns the number of full months between the given dates - end of Feb[0m
|
|
200
|
+
[0m[32m✓[0m [0mdifferenceInMonths [2m > [0medge cases[2m >[0m[1m returns the number of full months between the given dates - end of Feb[0m
|
|
201
201
|
[0m[32m✓[0m [0mdifferenceInMonths [2m >[0m[1m returns the number of full months between the given dates[0m
|
|
202
202
|
[0m[32m✓[0m [0mdifferenceInMonths [2m >[0m[1m returns a negative number if the time value of the first date is smaller[0m
|
|
203
|
-
[0m[32m✓[0m [0mdifferenceInMonths [2m >[0m[1m returns NaN if the first date is `Invalid Date`[0m
|
|
203
|
+
[0m[32m✓[0m [0mdifferenceInMonths [2m >[0m[1m returns NaN if the first date is `Invalid Date`[0m
|
|
204
204
|
[0m[32m✓[0m [0mdifferenceInMonths [2m >[0m[1m returns NaN if the second date is `Invalid Date`[0m
|
|
205
205
|
[0m[32m✓[0m [0mdifferenceInMonths [2m >[0m[1m returns NaN if the both dates are `Invalid Date`[0m
|
|
206
|
-
[0m[32m✓[0m [0mgetWeeksInMonth[2m >[0m[1m sunday: Month with 5 weeks[0m
|
|
207
|
-
[0m[32m✓[0m [0mgetWeeksInMonth[2m >[0m[1m sunday: Month with 6 weeks[0m
|
|
208
|
-
[0m[32m✓[0m [0mgetWeeksInMonth[2m >[0m[1m monday: Month with 5 weeks[0m
|
|
209
|
-
[0m[32m✓[0m [0mgetWeeksInMonth[2m >[0m[1m matches date-fns[0m [0m[2m[
|
|
210
|
-
[0m[32m✓[0m [0mgetWeekOfMonth[2m >[0m[1m sunday: June[0m [0m[2m[0.
|
|
211
|
-
[0m[32m✓[0m [0mgetWeekOfMonth[2m >[0m[1m monday: June[0m [0m[2m[0.
|
|
212
|
-
[0m[32m✓[0m [0mgetWeekOfMonth[2m >[0m[1m matches date-fns[0m [0m[2m[0.
|
|
206
|
+
[0m[32m✓[0m [0mgetWeeksInMonth[2m >[0m[1m sunday: Month with 5 weeks[0m
|
|
207
|
+
[0m[32m✓[0m [0mgetWeeksInMonth[2m >[0m[1m sunday: Month with 6 weeks[0m
|
|
208
|
+
[0m[32m✓[0m [0mgetWeeksInMonth[2m >[0m[1m monday: Month with 5 weeks[0m
|
|
209
|
+
[0m[32m✓[0m [0mgetWeeksInMonth[2m >[0m[1m matches date-fns[0m [0m[2m[2.16ms[0m[2m][0m
|
|
210
|
+
[0m[32m✓[0m [0mgetWeekOfMonth[2m >[0m[1m sunday: June[0m [0m[2m[0.09ms[0m[2m][0m
|
|
211
|
+
[0m[32m✓[0m [0mgetWeekOfMonth[2m >[0m[1m monday: June[0m [0m[2m[0.01ms[0m[2m][0m
|
|
212
|
+
[0m[32m✓[0m [0mgetWeekOfMonth[2m >[0m[1m matches date-fns[0m [0m[2m[0.62ms[0m[2m][0m
|
|
213
213
|
|
|
214
214
|
[0m[32m 116 pass[0m
|
|
215
215
|
[0m[2m 0 fail[0m
|
|
216
216
|
8696 expect() calls
|
|
217
|
-
Ran 116 tests across 5 files. [0m[2m[[
|
|
217
|
+
Ran 116 tests across 5 files. [0m[2m[[1m108.00ms[0m[2m][0m
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import * as react from 'react';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
import { TextProps, ViewStyle, TextStyle, PressableProps, ColorSchemeName } from 'react-native';
|
|
4
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { TextProps, ViewStyle, TextStyle, PressableProps, ColorSchemeName } from 'react-native';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
5
4
|
import { LegendListProps } from '@legendapp/list/react-native';
|
|
6
5
|
|
|
7
6
|
type CalendarTextProps = Omit<TextProps, "onPress" | "onLongPress" | "onPressIn" | "onPressOut">;
|
|
@@ -158,7 +157,7 @@ interface CalendarItemDayProps {
|
|
|
158
157
|
* `CalendarItemDayWithContainer`, since it also includes the spacing between
|
|
159
158
|
* each day.
|
|
160
159
|
*/
|
|
161
|
-
declare const CalendarItemDay:
|
|
160
|
+
declare const CalendarItemDay: ({ onPress, children, theme, height, metadata, textProps, CalendarPressableComponent, }: CalendarItemDayProps) => react_jsx_runtime.JSX.Element;
|
|
162
161
|
interface CalendarItemDayContainerTheme {
|
|
163
162
|
/** An empty view that acts as a spacer between each day. The spacing is
|
|
164
163
|
* controlled by the `daySpacing` prop. */
|
|
@@ -189,7 +188,7 @@ interface CalendarItemDayContainerProps {
|
|
|
189
188
|
/** The metadata for the day, extracted from the calendar's state. */
|
|
190
189
|
metadata?: CalendarDayMetadata;
|
|
191
190
|
}
|
|
192
|
-
declare const CalendarItemDayContainer:
|
|
191
|
+
declare const CalendarItemDayContainer: ({ children, isStartOfWeek, shouldShowActiveDayFiller, theme, daySpacing, dayHeight, metadata, }: CalendarItemDayContainerProps) => react_jsx_runtime.JSX.Element;
|
|
193
192
|
interface CalendarItemDayWithContainerProps extends Omit<CalendarItemDayProps, "height">, Pick<CalendarItemDayContainerProps, "daySpacing" | "dayHeight"> {
|
|
194
193
|
containerTheme?: CalendarItemDayContainerTheme;
|
|
195
194
|
/**
|
|
@@ -205,7 +204,7 @@ interface CalendarItemDayWithContainerProps extends Omit<CalendarItemDayProps, "
|
|
|
205
204
|
*/
|
|
206
205
|
calendarInstanceId?: string;
|
|
207
206
|
}
|
|
208
|
-
declare const CalendarItemDayWithContainer:
|
|
207
|
+
declare const CalendarItemDayWithContainer: ({ children, metadata: baseMetadata, onPress, theme, dayHeight, daySpacing, containerTheme, calendarInstanceId, CalendarPressableComponent, }: CalendarItemDayWithContainerProps) => react_jsx_runtime.JSX.Element;
|
|
209
208
|
|
|
210
209
|
interface CalendarItemEmptyProps {
|
|
211
210
|
/** The height of the cell. Should be the same as `CalendarItemDay`. */
|
|
@@ -215,7 +214,7 @@ interface CalendarItemEmptyProps {
|
|
|
215
214
|
container?: ViewStyle;
|
|
216
215
|
};
|
|
217
216
|
}
|
|
218
|
-
declare const CalendarItemEmpty:
|
|
217
|
+
declare const CalendarItemEmpty: (props: CalendarItemEmptyProps) => react_jsx_runtime.JSX.Element;
|
|
219
218
|
|
|
220
219
|
interface CalendarItemWeekNameTheme {
|
|
221
220
|
container?: ViewStyle;
|
|
@@ -232,7 +231,7 @@ interface CalendarItemWeekNameProps {
|
|
|
232
231
|
/** Optional TextProps to spread to the <Text> component. */
|
|
233
232
|
textProps?: Omit<CalendarTextProps, "children">;
|
|
234
233
|
}
|
|
235
|
-
declare const CalendarItemWeekName:
|
|
234
|
+
declare const CalendarItemWeekName: ({ children, height, theme, textProps, }: CalendarItemWeekNameProps) => react_jsx_runtime.JSX.Element;
|
|
236
235
|
|
|
237
236
|
interface CalendarRowMonthTheme {
|
|
238
237
|
container?: ViewStyle;
|
|
@@ -248,7 +247,7 @@ interface CalendarRowMonthProps {
|
|
|
248
247
|
/** The theme of the month row, useful for customizing the component. */
|
|
249
248
|
theme?: CalendarRowMonthTheme;
|
|
250
249
|
}
|
|
251
|
-
declare const CalendarRowMonth:
|
|
250
|
+
declare const CalendarRowMonth: ({ children, height, theme, }: CalendarRowMonthProps) => react_jsx_runtime.JSX.Element;
|
|
252
251
|
|
|
253
252
|
/**
|
|
254
253
|
* Minimal theme for the Legend Calendar component.
|
|
@@ -334,7 +333,7 @@ interface CalendarRowWeekProps {
|
|
|
334
333
|
interface CalendarRowWeekTheme {
|
|
335
334
|
container?: ViewStyle;
|
|
336
335
|
}
|
|
337
|
-
declare const CalendarRowWeek:
|
|
336
|
+
declare const CalendarRowWeek: ({ children, spacing, theme, }: CalendarRowWeekProps) => react_jsx_runtime.JSX.Element;
|
|
338
337
|
|
|
339
338
|
type PressableLike = React.ComponentType<Pick<PressableProps, "children" | "style" | "disabled"> & {
|
|
340
339
|
onPress: () => void;
|
|
@@ -410,7 +409,7 @@ interface CalendarProps extends UseCalendarParams {
|
|
|
410
409
|
/** Optional component to replace the default <Pressable> component. */
|
|
411
410
|
CalendarPressableComponent?: PressableLike;
|
|
412
411
|
}
|
|
413
|
-
declare const Calendar$1:
|
|
412
|
+
declare const Calendar$1: (props: CalendarProps) => react_jsx_runtime.JSX.Element;
|
|
414
413
|
|
|
415
414
|
interface CalendarMonth {
|
|
416
415
|
id: string;
|
|
@@ -480,6 +479,29 @@ declare const getHeightForMonth: ({ calendarRowVerticalSpacing: vSpacing, calend
|
|
|
480
479
|
* `Calendar` props to simplify building custom `Calendar` components.
|
|
481
480
|
*/
|
|
482
481
|
type CalendarMonthEnhanced = CalendarMonth & {
|
|
482
|
+
/**
|
|
483
|
+
* The calendar configuration props for this item. Available when using a
|
|
484
|
+
* custom `renderItem` for backwards compatibility.
|
|
485
|
+
*
|
|
486
|
+
* @deprecated Prefer reading calendar config from context via
|
|
487
|
+
* `useCalendarListConfig()` instead of spreading `item.calendarProps`.
|
|
488
|
+
* This avoids creating a new data array each render and lets LegendList
|
|
489
|
+
* skip unnecessary item re-renders.
|
|
490
|
+
*
|
|
491
|
+
* **Before (slower):**
|
|
492
|
+
* ```tsx
|
|
493
|
+
* renderItem={({ item }) => (
|
|
494
|
+
* <MyCalendar calendarMonthId={item.id} {...item.calendarProps} />
|
|
495
|
+
* )}
|
|
496
|
+
* ```
|
|
497
|
+
*
|
|
498
|
+
* **After (faster):**
|
|
499
|
+
* ```tsx
|
|
500
|
+
* // Inside your custom calendar component:
|
|
501
|
+
* const listConfig = useCalendarListConfig();
|
|
502
|
+
* // Merge: { ...listConfig, ...props }
|
|
503
|
+
* ```
|
|
504
|
+
*/
|
|
483
505
|
calendarProps: Omit<CalendarProps, "calendarMonthId">;
|
|
484
506
|
};
|
|
485
507
|
interface CalendarListProps extends Omit<CalendarProps, "calendarMonthId">, Omit<LegendListProps<CalendarMonthEnhanced>, "renderItem" | "data" | "children"> {
|
|
@@ -540,6 +562,12 @@ interface CalendarListProps extends Omit<CalendarProps, "calendarMonthId">, Omit
|
|
|
540
562
|
* - calendarAdditionalHeight
|
|
541
563
|
* - calendarRowVerticalSpacing
|
|
542
564
|
* - calendarSpacing
|
|
565
|
+
*
|
|
566
|
+
* **Performance tip**: Using `item.calendarProps` is provided for
|
|
567
|
+
* backwards compatibility but creates a new data array each render.
|
|
568
|
+
* For better performance, have your custom component call
|
|
569
|
+
* `useCalendarListConfig()` to read the shared config from context
|
|
570
|
+
* and only use `item.id` as `calendarMonthId`.
|
|
543
571
|
*/
|
|
544
572
|
renderItem?: LegendListProps<CalendarMonthEnhanced>["renderItem"];
|
|
545
573
|
}
|
|
@@ -555,7 +583,7 @@ interface CalendarListRef {
|
|
|
555
583
|
scrollToDate: (date: Date, animated: boolean, params?: ImperativeScrollParams) => void;
|
|
556
584
|
scrollToOffset: (offset: number, animated: boolean) => void;
|
|
557
585
|
}
|
|
558
|
-
declare function CalendarList(
|
|
586
|
+
declare function CalendarList(props: CalendarListProps & {
|
|
559
587
|
ref?: React.Ref<CalendarListRef>;
|
|
560
588
|
}): react_jsx_runtime.JSX.Element;
|
|
561
589
|
|
|
@@ -583,6 +611,23 @@ interface VStackProps {
|
|
|
583
611
|
}
|
|
584
612
|
declare function VStack({ children, spacing, alignItems, justifyContent, grow, }: VStackProps): react_jsx_runtime.JSX.Element;
|
|
585
613
|
|
|
614
|
+
/**
|
|
615
|
+
* The calendar configuration props shared across all items in a
|
|
616
|
+
* `CalendarList`. When `Calendar` is rendered inside `CalendarList`, it reads
|
|
617
|
+
* these values from context instead of receiving them through the list item's
|
|
618
|
+
* data, which keeps the `data` array identity stable and allows LegendList to
|
|
619
|
+
* skip unnecessary re-renders.
|
|
620
|
+
*
|
|
621
|
+
* When `Calendar` is used standalone (outside a list), the context is `null`
|
|
622
|
+
* and all props are passed directly.
|
|
623
|
+
*/
|
|
624
|
+
type CalendarListConfig = Omit<CalendarProps, "calendarMonthId">;
|
|
625
|
+
/**
|
|
626
|
+
* Returns the shared calendar configuration from the nearest
|
|
627
|
+
* `CalendarListConfigProvider`, or `null` when used outside a `CalendarList`.
|
|
628
|
+
*/
|
|
629
|
+
declare const useCalendarListConfig: () => CalendarListConfig | null;
|
|
630
|
+
|
|
586
631
|
/**
|
|
587
632
|
* This file houses the public API for the legend-calendar package.
|
|
588
633
|
*/
|
|
@@ -704,4 +749,4 @@ declare const useDateRange: (initialDateRange?: CalendarActiveDateRange) => {
|
|
|
704
749
|
isDateRangeValid: boolean;
|
|
705
750
|
};
|
|
706
751
|
|
|
707
|
-
export { Calendar, type CalendarActiveDateRange, type CalendarDayMetadata, type CalendarItemDayContainerProps, type CalendarItemDayProps, type CalendarItemDayWithContainerProps, type CalendarItemEmptyProps, type CalendarItemWeekNameProps, type CalendarListProps, type CalendarListRef, type CalendarMonth, type CalendarMonthEnhanced, type CalendarOnDayPress, type CalendarProps, type CalendarRowMonthProps, type CalendarRowWeekProps, type CalendarTextProps, type CalendarTheme, type HStackProps, type UseCalendarListParams, type UseCalendarParams, type VStackProps, activeDateRangesStore, buildCalendar, fromDateId, getHeightForMonth, toDateId, useCalendar, useCalendarList, useDateRange, useOptimizedDayMetadata };
|
|
752
|
+
export { Calendar, type CalendarActiveDateRange, type CalendarDayMetadata, type CalendarItemDayContainerProps, type CalendarItemDayProps, type CalendarItemDayWithContainerProps, type CalendarItemEmptyProps, type CalendarItemWeekNameProps, type CalendarListConfig, type CalendarListProps, type CalendarListRef, type CalendarMonth, type CalendarMonthEnhanced, type CalendarOnDayPress, type CalendarProps, type CalendarRowMonthProps, type CalendarRowWeekProps, type CalendarTextProps, type CalendarTheme, type HStackProps, type UseCalendarListParams, type UseCalendarParams, type VStackProps, activeDateRangesStore, buildCalendar, fromDateId, getHeightForMonth, toDateId, useCalendar, useCalendarList, useCalendarListConfig, useDateRange, useOptimizedDayMetadata };
|