@react-aria/calendar 3.9.5 → 3.10.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.
Files changed (221) hide show
  1. package/dist/import.mjs +3 -7
  2. package/dist/main.js +6 -10
  3. package/dist/main.js.map +1 -1
  4. package/dist/module.js +3 -7
  5. package/dist/module.js.map +1 -1
  6. package/dist/types/src/index.d.ts +6 -0
  7. package/package.json +16 -20
  8. package/src/index.ts +6 -8
  9. package/dist/ar-AE.main.js +0 -17
  10. package/dist/ar-AE.main.js.map +0 -1
  11. package/dist/ar-AE.mjs +0 -19
  12. package/dist/ar-AE.module.js +0 -19
  13. package/dist/ar-AE.module.js.map +0 -1
  14. package/dist/bg-BG.main.js +0 -17
  15. package/dist/bg-BG.main.js.map +0 -1
  16. package/dist/bg-BG.mjs +0 -19
  17. package/dist/bg-BG.module.js +0 -19
  18. package/dist/bg-BG.module.js.map +0 -1
  19. package/dist/cs-CZ.main.js +0 -17
  20. package/dist/cs-CZ.main.js.map +0 -1
  21. package/dist/cs-CZ.mjs +0 -19
  22. package/dist/cs-CZ.module.js +0 -19
  23. package/dist/cs-CZ.module.js.map +0 -1
  24. package/dist/da-DK.main.js +0 -17
  25. package/dist/da-DK.main.js.map +0 -1
  26. package/dist/da-DK.mjs +0 -19
  27. package/dist/da-DK.module.js +0 -19
  28. package/dist/da-DK.module.js.map +0 -1
  29. package/dist/de-DE.main.js +0 -17
  30. package/dist/de-DE.main.js.map +0 -1
  31. package/dist/de-DE.mjs +0 -19
  32. package/dist/de-DE.module.js +0 -19
  33. package/dist/de-DE.module.js.map +0 -1
  34. package/dist/el-GR.main.js +0 -17
  35. package/dist/el-GR.main.js.map +0 -1
  36. package/dist/el-GR.mjs +0 -19
  37. package/dist/el-GR.module.js +0 -19
  38. package/dist/el-GR.module.js.map +0 -1
  39. package/dist/en-US.main.js +0 -17
  40. package/dist/en-US.main.js.map +0 -1
  41. package/dist/en-US.mjs +0 -19
  42. package/dist/en-US.module.js +0 -19
  43. package/dist/en-US.module.js.map +0 -1
  44. package/dist/es-ES.main.js +0 -17
  45. package/dist/es-ES.main.js.map +0 -1
  46. package/dist/es-ES.mjs +0 -19
  47. package/dist/es-ES.module.js +0 -19
  48. package/dist/es-ES.module.js.map +0 -1
  49. package/dist/et-EE.main.js +0 -17
  50. package/dist/et-EE.main.js.map +0 -1
  51. package/dist/et-EE.mjs +0 -19
  52. package/dist/et-EE.module.js +0 -19
  53. package/dist/et-EE.module.js.map +0 -1
  54. package/dist/fi-FI.main.js +0 -17
  55. package/dist/fi-FI.main.js.map +0 -1
  56. package/dist/fi-FI.mjs +0 -19
  57. package/dist/fi-FI.module.js +0 -19
  58. package/dist/fi-FI.module.js.map +0 -1
  59. package/dist/fr-FR.main.js +0 -17
  60. package/dist/fr-FR.main.js.map +0 -1
  61. package/dist/fr-FR.mjs +0 -19
  62. package/dist/fr-FR.module.js +0 -19
  63. package/dist/fr-FR.module.js.map +0 -1
  64. package/dist/he-IL.main.js +0 -17
  65. package/dist/he-IL.main.js.map +0 -1
  66. package/dist/he-IL.mjs +0 -19
  67. package/dist/he-IL.module.js +0 -19
  68. package/dist/he-IL.module.js.map +0 -1
  69. package/dist/hr-HR.main.js +0 -17
  70. package/dist/hr-HR.main.js.map +0 -1
  71. package/dist/hr-HR.mjs +0 -19
  72. package/dist/hr-HR.module.js +0 -19
  73. package/dist/hr-HR.module.js.map +0 -1
  74. package/dist/hu-HU.main.js +0 -17
  75. package/dist/hu-HU.main.js.map +0 -1
  76. package/dist/hu-HU.mjs +0 -19
  77. package/dist/hu-HU.module.js +0 -19
  78. package/dist/hu-HU.module.js.map +0 -1
  79. package/dist/intlStrings.main.js +0 -108
  80. package/dist/intlStrings.main.js.map +0 -1
  81. package/dist/intlStrings.mjs +0 -110
  82. package/dist/intlStrings.module.js +0 -110
  83. package/dist/intlStrings.module.js.map +0 -1
  84. package/dist/it-IT.main.js +0 -17
  85. package/dist/it-IT.main.js.map +0 -1
  86. package/dist/it-IT.mjs +0 -19
  87. package/dist/it-IT.module.js +0 -19
  88. package/dist/it-IT.module.js.map +0 -1
  89. package/dist/ja-JP.main.js +0 -17
  90. package/dist/ja-JP.main.js.map +0 -1
  91. package/dist/ja-JP.mjs +0 -19
  92. package/dist/ja-JP.module.js +0 -19
  93. package/dist/ja-JP.module.js.map +0 -1
  94. package/dist/ko-KR.main.js +0 -17
  95. package/dist/ko-KR.main.js.map +0 -1
  96. package/dist/ko-KR.mjs +0 -19
  97. package/dist/ko-KR.module.js +0 -19
  98. package/dist/ko-KR.module.js.map +0 -1
  99. package/dist/lt-LT.main.js +0 -17
  100. package/dist/lt-LT.main.js.map +0 -1
  101. package/dist/lt-LT.mjs +0 -19
  102. package/dist/lt-LT.module.js +0 -19
  103. package/dist/lt-LT.module.js.map +0 -1
  104. package/dist/lv-LV.main.js +0 -17
  105. package/dist/lv-LV.main.js.map +0 -1
  106. package/dist/lv-LV.mjs +0 -19
  107. package/dist/lv-LV.module.js +0 -19
  108. package/dist/lv-LV.module.js.map +0 -1
  109. package/dist/nb-NO.main.js +0 -17
  110. package/dist/nb-NO.main.js.map +0 -1
  111. package/dist/nb-NO.mjs +0 -19
  112. package/dist/nb-NO.module.js +0 -19
  113. package/dist/nb-NO.module.js.map +0 -1
  114. package/dist/nl-NL.main.js +0 -17
  115. package/dist/nl-NL.main.js.map +0 -1
  116. package/dist/nl-NL.mjs +0 -19
  117. package/dist/nl-NL.module.js +0 -19
  118. package/dist/nl-NL.module.js.map +0 -1
  119. package/dist/pl-PL.main.js +0 -17
  120. package/dist/pl-PL.main.js.map +0 -1
  121. package/dist/pl-PL.mjs +0 -19
  122. package/dist/pl-PL.module.js +0 -19
  123. package/dist/pl-PL.module.js.map +0 -1
  124. package/dist/pt-BR.main.js +0 -17
  125. package/dist/pt-BR.main.js.map +0 -1
  126. package/dist/pt-BR.mjs +0 -19
  127. package/dist/pt-BR.module.js +0 -19
  128. package/dist/pt-BR.module.js.map +0 -1
  129. package/dist/pt-PT.main.js +0 -17
  130. package/dist/pt-PT.main.js.map +0 -1
  131. package/dist/pt-PT.mjs +0 -19
  132. package/dist/pt-PT.module.js +0 -19
  133. package/dist/pt-PT.module.js.map +0 -1
  134. package/dist/ro-RO.main.js +0 -17
  135. package/dist/ro-RO.main.js.map +0 -1
  136. package/dist/ro-RO.mjs +0 -19
  137. package/dist/ro-RO.module.js +0 -19
  138. package/dist/ro-RO.module.js.map +0 -1
  139. package/dist/ru-RU.main.js +0 -17
  140. package/dist/ru-RU.main.js.map +0 -1
  141. package/dist/ru-RU.mjs +0 -19
  142. package/dist/ru-RU.module.js +0 -19
  143. package/dist/ru-RU.module.js.map +0 -1
  144. package/dist/sk-SK.main.js +0 -17
  145. package/dist/sk-SK.main.js.map +0 -1
  146. package/dist/sk-SK.mjs +0 -19
  147. package/dist/sk-SK.module.js +0 -19
  148. package/dist/sk-SK.module.js.map +0 -1
  149. package/dist/sl-SI.main.js +0 -17
  150. package/dist/sl-SI.main.js.map +0 -1
  151. package/dist/sl-SI.mjs +0 -19
  152. package/dist/sl-SI.module.js +0 -19
  153. package/dist/sl-SI.module.js.map +0 -1
  154. package/dist/sr-SP.main.js +0 -17
  155. package/dist/sr-SP.main.js.map +0 -1
  156. package/dist/sr-SP.mjs +0 -19
  157. package/dist/sr-SP.module.js +0 -19
  158. package/dist/sr-SP.module.js.map +0 -1
  159. package/dist/sv-SE.main.js +0 -17
  160. package/dist/sv-SE.main.js.map +0 -1
  161. package/dist/sv-SE.mjs +0 -19
  162. package/dist/sv-SE.module.js +0 -19
  163. package/dist/sv-SE.module.js.map +0 -1
  164. package/dist/tr-TR.main.js +0 -17
  165. package/dist/tr-TR.main.js.map +0 -1
  166. package/dist/tr-TR.mjs +0 -19
  167. package/dist/tr-TR.module.js +0 -19
  168. package/dist/tr-TR.module.js.map +0 -1
  169. package/dist/types.d.ts +0 -124
  170. package/dist/types.d.ts.map +0 -1
  171. package/dist/uk-UA.main.js +0 -17
  172. package/dist/uk-UA.main.js.map +0 -1
  173. package/dist/uk-UA.mjs +0 -19
  174. package/dist/uk-UA.module.js +0 -19
  175. package/dist/uk-UA.module.js.map +0 -1
  176. package/dist/useCalendar.main.js +0 -25
  177. package/dist/useCalendar.main.js.map +0 -1
  178. package/dist/useCalendar.mjs +0 -20
  179. package/dist/useCalendar.module.js +0 -20
  180. package/dist/useCalendar.module.js.map +0 -1
  181. package/dist/useCalendarBase.main.js +0 -113
  182. package/dist/useCalendarBase.main.js.map +0 -1
  183. package/dist/useCalendarBase.mjs +0 -108
  184. package/dist/useCalendarBase.module.js +0 -108
  185. package/dist/useCalendarBase.module.js.map +0 -1
  186. package/dist/useCalendarCell.main.js +0 -295
  187. package/dist/useCalendarCell.main.js.map +0 -1
  188. package/dist/useCalendarCell.mjs +0 -290
  189. package/dist/useCalendarCell.module.js +0 -290
  190. package/dist/useCalendarCell.module.js.map +0 -1
  191. package/dist/useCalendarGrid.main.js +0 -142
  192. package/dist/useCalendarGrid.main.js.map +0 -1
  193. package/dist/useCalendarGrid.mjs +0 -137
  194. package/dist/useCalendarGrid.module.js +0 -137
  195. package/dist/useCalendarGrid.module.js.map +0 -1
  196. package/dist/useRangeCalendar.main.js +0 -66
  197. package/dist/useRangeCalendar.main.js.map +0 -1
  198. package/dist/useRangeCalendar.mjs +0 -61
  199. package/dist/useRangeCalendar.module.js +0 -61
  200. package/dist/useRangeCalendar.module.js.map +0 -1
  201. package/dist/utils.main.js +0 -143
  202. package/dist/utils.main.js.map +0 -1
  203. package/dist/utils.mjs +0 -135
  204. package/dist/utils.module.js +0 -135
  205. package/dist/utils.module.js.map +0 -1
  206. package/dist/zh-CN.main.js +0 -17
  207. package/dist/zh-CN.main.js.map +0 -1
  208. package/dist/zh-CN.mjs +0 -19
  209. package/dist/zh-CN.module.js +0 -19
  210. package/dist/zh-CN.module.js.map +0 -1
  211. package/dist/zh-TW.main.js +0 -17
  212. package/dist/zh-TW.main.js.map +0 -1
  213. package/dist/zh-TW.mjs +0 -19
  214. package/dist/zh-TW.module.js +0 -19
  215. package/dist/zh-TW.module.js.map +0 -1
  216. package/src/useCalendar.ts +0 -23
  217. package/src/useCalendarBase.ts +0 -116
  218. package/src/useCalendarCell.ts +0 -375
  219. package/src/useCalendarGrid.ts +0 -174
  220. package/src/useRangeCalendar.ts +0 -82
  221. package/src/utils.ts +0 -147
package/dist/utils.mjs DELETED
@@ -1,135 +0,0 @@
1
- import $3HATx$intlStringsmodulejs from "./intlStrings.mjs";
2
- import {isSameDay as $3HATx$isSameDay, startOfMonth as $3HATx$startOfMonth, endOfMonth as $3HATx$endOfMonth} from "@internationalized/date";
3
- import {useLocalizedStringFormatter as $3HATx$useLocalizedStringFormatter, useDateFormatter as $3HATx$useDateFormatter} from "@react-aria/i18n";
4
- import {useMemo as $3HATx$useMemo} from "react";
5
-
6
-
7
- function $parcel$interopDefault(a) {
8
- return a && a.__esModule ? a.default : a;
9
- }
10
- /*
11
- * Copyright 2020 Adobe. All rights reserved.
12
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
13
- * you may not use this file except in compliance with the License. You may obtain a copy
14
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
15
- *
16
- * Unless required by applicable law or agreed to in writing, software distributed under
17
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
18
- * OF ANY KIND, either express or implied. See the License for the specific language
19
- * governing permissions and limitations under the License.
20
- */
21
-
22
-
23
-
24
- const $a074e1e2d0f0a665$export$653eddfc964b0f8a = new WeakMap();
25
- function $a074e1e2d0f0a665$export$134cbb7fb09a9522(date) {
26
- return (date === null || date === void 0 ? void 0 : date.calendar.identifier) === 'gregory' && date.era === 'BC' ? 'short' : undefined;
27
- }
28
- function $a074e1e2d0f0a665$export$b6df97c887c38e1a(state) {
29
- let stringFormatter = (0, $3HATx$useLocalizedStringFormatter)((0, ($parcel$interopDefault($3HATx$intlStringsmodulejs))), '@react-aria/calendar');
30
- let start, end;
31
- var _state_value;
32
- if ('highlightedRange' in state) ({ start: start, end: end } = state.highlightedRange || {});
33
- else start = end = (_state_value = state.value) !== null && _state_value !== void 0 ? _state_value : undefined;
34
- let dateFormatter = (0, $3HATx$useDateFormatter)({
35
- weekday: 'long',
36
- month: 'long',
37
- year: 'numeric',
38
- day: 'numeric',
39
- era: $a074e1e2d0f0a665$export$134cbb7fb09a9522(start) || $a074e1e2d0f0a665$export$134cbb7fb09a9522(end),
40
- timeZone: state.timeZone
41
- });
42
- let anchorDate = 'anchorDate' in state ? state.anchorDate : null;
43
- return (0, $3HATx$useMemo)(()=>{
44
- // No message if currently selecting a range, or there is nothing highlighted.
45
- if (!anchorDate && start && end) {
46
- // Use a single date message if the start and end dates are the same day,
47
- // otherwise include both dates.
48
- if ((0, $3HATx$isSameDay)(start, end)) {
49
- let date = dateFormatter.format(start.toDate(state.timeZone));
50
- return stringFormatter.format('selectedDateDescription', {
51
- date: date
52
- });
53
- } else {
54
- let dateRange = $a074e1e2d0f0a665$var$formatRange(dateFormatter, stringFormatter, start, end, state.timeZone);
55
- return stringFormatter.format('selectedRangeDescription', {
56
- dateRange: dateRange
57
- });
58
- }
59
- }
60
- return '';
61
- }, [
62
- start,
63
- end,
64
- anchorDate,
65
- state.timeZone,
66
- stringFormatter,
67
- dateFormatter
68
- ]);
69
- }
70
- function $a074e1e2d0f0a665$export$31afe65d91ef6e8(startDate, endDate, timeZone, isAria) {
71
- let stringFormatter = (0, $3HATx$useLocalizedStringFormatter)((0, ($parcel$interopDefault($3HATx$intlStringsmodulejs))), '@react-aria/calendar');
72
- let era = $a074e1e2d0f0a665$export$134cbb7fb09a9522(startDate) || $a074e1e2d0f0a665$export$134cbb7fb09a9522(endDate);
73
- let monthFormatter = (0, $3HATx$useDateFormatter)({
74
- month: 'long',
75
- year: 'numeric',
76
- era: era,
77
- calendar: startDate.calendar.identifier,
78
- timeZone: timeZone
79
- });
80
- let dateFormatter = (0, $3HATx$useDateFormatter)({
81
- month: 'long',
82
- year: 'numeric',
83
- day: 'numeric',
84
- era: era,
85
- calendar: startDate.calendar.identifier,
86
- timeZone: timeZone
87
- });
88
- return (0, $3HATx$useMemo)(()=>{
89
- // Special case for month granularity. Format as a single month if only a
90
- // single month is visible, otherwise format as a range of months.
91
- if ((0, $3HATx$isSameDay)(startDate, (0, $3HATx$startOfMonth)(startDate))) {
92
- let startMonth = startDate;
93
- let endMonth = endDate;
94
- if (startDate.calendar.getFormattableMonth) startMonth = startDate.calendar.getFormattableMonth(startDate);
95
- if (endDate.calendar.getFormattableMonth) endMonth = endDate.calendar.getFormattableMonth(endDate);
96
- if ((0, $3HATx$isSameDay)(endDate, (0, $3HATx$endOfMonth)(startDate))) return monthFormatter.format(startMonth.toDate(timeZone));
97
- else if ((0, $3HATx$isSameDay)(endDate, (0, $3HATx$endOfMonth)(endDate))) return isAria ? $a074e1e2d0f0a665$var$formatRange(monthFormatter, stringFormatter, startMonth, endMonth, timeZone) : monthFormatter.formatRange(startMonth.toDate(timeZone), endMonth.toDate(timeZone));
98
- }
99
- return isAria ? $a074e1e2d0f0a665$var$formatRange(dateFormatter, stringFormatter, startDate, endDate, timeZone) : dateFormatter.formatRange(startDate.toDate(timeZone), endDate.toDate(timeZone));
100
- }, [
101
- startDate,
102
- endDate,
103
- monthFormatter,
104
- dateFormatter,
105
- stringFormatter,
106
- timeZone,
107
- isAria
108
- ]);
109
- }
110
- function $a074e1e2d0f0a665$var$formatRange(dateFormatter, stringFormatter, start, end, timeZone) {
111
- let parts = dateFormatter.formatRangeToParts(start.toDate(timeZone), end.toDate(timeZone));
112
- // Find the separator between the start and end date. This is determined
113
- // by finding the last shared literal before the end range.
114
- let separatorIndex = -1;
115
- for(let i = 0; i < parts.length; i++){
116
- let part = parts[i];
117
- if (part.source === 'shared' && part.type === 'literal') separatorIndex = i;
118
- else if (part.source === 'endRange') break;
119
- }
120
- // Now we can combine the parts into start and end strings.
121
- let startValue = '';
122
- let endValue = '';
123
- for(let i = 0; i < parts.length; i++){
124
- if (i < separatorIndex) startValue += parts[i].value;
125
- else if (i > separatorIndex) endValue += parts[i].value;
126
- }
127
- return stringFormatter.format('dateRange', {
128
- startDate: startValue,
129
- endDate: endValue
130
- });
131
- }
132
-
133
-
134
- export {$a074e1e2d0f0a665$export$653eddfc964b0f8a as hookData, $a074e1e2d0f0a665$export$134cbb7fb09a9522 as getEraFormat, $a074e1e2d0f0a665$export$b6df97c887c38e1a as useSelectedDateDescription, $a074e1e2d0f0a665$export$31afe65d91ef6e8 as useVisibleRangeDescription};
135
- //# sourceMappingURL=utils.module.js.map
@@ -1,135 +0,0 @@
1
- import $3HATx$intlStringsmodulejs from "./intlStrings.module.js";
2
- import {isSameDay as $3HATx$isSameDay, startOfMonth as $3HATx$startOfMonth, endOfMonth as $3HATx$endOfMonth} from "@internationalized/date";
3
- import {useLocalizedStringFormatter as $3HATx$useLocalizedStringFormatter, useDateFormatter as $3HATx$useDateFormatter} from "@react-aria/i18n";
4
- import {useMemo as $3HATx$useMemo} from "react";
5
-
6
-
7
- function $parcel$interopDefault(a) {
8
- return a && a.__esModule ? a.default : a;
9
- }
10
- /*
11
- * Copyright 2020 Adobe. All rights reserved.
12
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
13
- * you may not use this file except in compliance with the License. You may obtain a copy
14
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
15
- *
16
- * Unless required by applicable law or agreed to in writing, software distributed under
17
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
18
- * OF ANY KIND, either express or implied. See the License for the specific language
19
- * governing permissions and limitations under the License.
20
- */
21
-
22
-
23
-
24
- const $a074e1e2d0f0a665$export$653eddfc964b0f8a = new WeakMap();
25
- function $a074e1e2d0f0a665$export$134cbb7fb09a9522(date) {
26
- return (date === null || date === void 0 ? void 0 : date.calendar.identifier) === 'gregory' && date.era === 'BC' ? 'short' : undefined;
27
- }
28
- function $a074e1e2d0f0a665$export$b6df97c887c38e1a(state) {
29
- let stringFormatter = (0, $3HATx$useLocalizedStringFormatter)((0, ($parcel$interopDefault($3HATx$intlStringsmodulejs))), '@react-aria/calendar');
30
- let start, end;
31
- var _state_value;
32
- if ('highlightedRange' in state) ({ start: start, end: end } = state.highlightedRange || {});
33
- else start = end = (_state_value = state.value) !== null && _state_value !== void 0 ? _state_value : undefined;
34
- let dateFormatter = (0, $3HATx$useDateFormatter)({
35
- weekday: 'long',
36
- month: 'long',
37
- year: 'numeric',
38
- day: 'numeric',
39
- era: $a074e1e2d0f0a665$export$134cbb7fb09a9522(start) || $a074e1e2d0f0a665$export$134cbb7fb09a9522(end),
40
- timeZone: state.timeZone
41
- });
42
- let anchorDate = 'anchorDate' in state ? state.anchorDate : null;
43
- return (0, $3HATx$useMemo)(()=>{
44
- // No message if currently selecting a range, or there is nothing highlighted.
45
- if (!anchorDate && start && end) {
46
- // Use a single date message if the start and end dates are the same day,
47
- // otherwise include both dates.
48
- if ((0, $3HATx$isSameDay)(start, end)) {
49
- let date = dateFormatter.format(start.toDate(state.timeZone));
50
- return stringFormatter.format('selectedDateDescription', {
51
- date: date
52
- });
53
- } else {
54
- let dateRange = $a074e1e2d0f0a665$var$formatRange(dateFormatter, stringFormatter, start, end, state.timeZone);
55
- return stringFormatter.format('selectedRangeDescription', {
56
- dateRange: dateRange
57
- });
58
- }
59
- }
60
- return '';
61
- }, [
62
- start,
63
- end,
64
- anchorDate,
65
- state.timeZone,
66
- stringFormatter,
67
- dateFormatter
68
- ]);
69
- }
70
- function $a074e1e2d0f0a665$export$31afe65d91ef6e8(startDate, endDate, timeZone, isAria) {
71
- let stringFormatter = (0, $3HATx$useLocalizedStringFormatter)((0, ($parcel$interopDefault($3HATx$intlStringsmodulejs))), '@react-aria/calendar');
72
- let era = $a074e1e2d0f0a665$export$134cbb7fb09a9522(startDate) || $a074e1e2d0f0a665$export$134cbb7fb09a9522(endDate);
73
- let monthFormatter = (0, $3HATx$useDateFormatter)({
74
- month: 'long',
75
- year: 'numeric',
76
- era: era,
77
- calendar: startDate.calendar.identifier,
78
- timeZone: timeZone
79
- });
80
- let dateFormatter = (0, $3HATx$useDateFormatter)({
81
- month: 'long',
82
- year: 'numeric',
83
- day: 'numeric',
84
- era: era,
85
- calendar: startDate.calendar.identifier,
86
- timeZone: timeZone
87
- });
88
- return (0, $3HATx$useMemo)(()=>{
89
- // Special case for month granularity. Format as a single month if only a
90
- // single month is visible, otherwise format as a range of months.
91
- if ((0, $3HATx$isSameDay)(startDate, (0, $3HATx$startOfMonth)(startDate))) {
92
- let startMonth = startDate;
93
- let endMonth = endDate;
94
- if (startDate.calendar.getFormattableMonth) startMonth = startDate.calendar.getFormattableMonth(startDate);
95
- if (endDate.calendar.getFormattableMonth) endMonth = endDate.calendar.getFormattableMonth(endDate);
96
- if ((0, $3HATx$isSameDay)(endDate, (0, $3HATx$endOfMonth)(startDate))) return monthFormatter.format(startMonth.toDate(timeZone));
97
- else if ((0, $3HATx$isSameDay)(endDate, (0, $3HATx$endOfMonth)(endDate))) return isAria ? $a074e1e2d0f0a665$var$formatRange(monthFormatter, stringFormatter, startMonth, endMonth, timeZone) : monthFormatter.formatRange(startMonth.toDate(timeZone), endMonth.toDate(timeZone));
98
- }
99
- return isAria ? $a074e1e2d0f0a665$var$formatRange(dateFormatter, stringFormatter, startDate, endDate, timeZone) : dateFormatter.formatRange(startDate.toDate(timeZone), endDate.toDate(timeZone));
100
- }, [
101
- startDate,
102
- endDate,
103
- monthFormatter,
104
- dateFormatter,
105
- stringFormatter,
106
- timeZone,
107
- isAria
108
- ]);
109
- }
110
- function $a074e1e2d0f0a665$var$formatRange(dateFormatter, stringFormatter, start, end, timeZone) {
111
- let parts = dateFormatter.formatRangeToParts(start.toDate(timeZone), end.toDate(timeZone));
112
- // Find the separator between the start and end date. This is determined
113
- // by finding the last shared literal before the end range.
114
- let separatorIndex = -1;
115
- for(let i = 0; i < parts.length; i++){
116
- let part = parts[i];
117
- if (part.source === 'shared' && part.type === 'literal') separatorIndex = i;
118
- else if (part.source === 'endRange') break;
119
- }
120
- // Now we can combine the parts into start and end strings.
121
- let startValue = '';
122
- let endValue = '';
123
- for(let i = 0; i < parts.length; i++){
124
- if (i < separatorIndex) startValue += parts[i].value;
125
- else if (i > separatorIndex) endValue += parts[i].value;
126
- }
127
- return stringFormatter.format('dateRange', {
128
- startDate: startValue,
129
- endDate: endValue
130
- });
131
- }
132
-
133
-
134
- export {$a074e1e2d0f0a665$export$653eddfc964b0f8a as hookData, $a074e1e2d0f0a665$export$134cbb7fb09a9522 as getEraFormat, $a074e1e2d0f0a665$export$b6df97c887c38e1a as useSelectedDateDescription, $a074e1e2d0f0a665$export$31afe65d91ef6e8 as useVisibleRangeDescription};
135
- //# sourceMappingURL=utils.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":"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","sources":["packages/@react-aria/calendar/src/utils.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {CalendarDate, DateFormatter, endOfMonth, isSameDay, startOfMonth} from '@internationalized/date';\nimport {CalendarState, RangeCalendarState} from '@react-stately/calendar';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport type {LocalizedStringFormatter} from '@internationalized/string';\nimport {useDateFormatter, useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useMemo} from 'react';\n\ninterface HookData {\n ariaLabel?: string,\n ariaLabelledBy?: string,\n errorMessageId: string,\n selectedDateDescription: string\n}\n\nexport const hookData: WeakMap<CalendarState | RangeCalendarState, HookData> = new WeakMap<CalendarState | RangeCalendarState, HookData>();\n\nexport function getEraFormat(date: CalendarDate | undefined): 'short' | undefined {\n return date?.calendar.identifier === 'gregory' && date.era === 'BC' ? 'short' : undefined;\n}\n\nexport function useSelectedDateDescription(state: CalendarState | RangeCalendarState): string {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/calendar');\n\n let start: CalendarDate | undefined, end: CalendarDate | undefined;\n if ('highlightedRange' in state) {\n ({start, end} = state.highlightedRange || {});\n } else {\n start = end = state.value ?? undefined;\n }\n\n let dateFormatter = useDateFormatter({\n weekday: 'long',\n month: 'long',\n year: 'numeric',\n day: 'numeric',\n era: getEraFormat(start) || getEraFormat(end),\n timeZone: state.timeZone\n });\n\n let anchorDate = 'anchorDate' in state ? state.anchorDate : null;\n return useMemo(() => {\n // No message if currently selecting a range, or there is nothing highlighted.\n if (!anchorDate && start && end) {\n // Use a single date message if the start and end dates are the same day,\n // otherwise include both dates.\n if (isSameDay(start, end)) {\n let date = dateFormatter.format(start.toDate(state.timeZone));\n return stringFormatter.format('selectedDateDescription', {date});\n } else {\n let dateRange = formatRange(dateFormatter, stringFormatter, start, end, state.timeZone);\n\n return stringFormatter.format('selectedRangeDescription', {dateRange});\n }\n }\n return '';\n }, [start, end, anchorDate, state.timeZone, stringFormatter, dateFormatter]);\n}\n\nexport function useVisibleRangeDescription(startDate: CalendarDate, endDate: CalendarDate, timeZone: string, isAria: boolean): string {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/calendar');\n let era: any = getEraFormat(startDate) || getEraFormat(endDate);\n let monthFormatter = useDateFormatter({\n month: 'long',\n year: 'numeric',\n era,\n calendar: startDate.calendar.identifier,\n timeZone\n });\n\n let dateFormatter = useDateFormatter({\n month: 'long',\n year: 'numeric',\n day: 'numeric',\n era,\n calendar: startDate.calendar.identifier,\n timeZone\n });\n\n return useMemo(() => {\n // Special case for month granularity. Format as a single month if only a\n // single month is visible, otherwise format as a range of months.\n if (isSameDay(startDate, startOfMonth(startDate))) {\n let startMonth = startDate;\n let endMonth = endDate;\n if (startDate.calendar.getFormattableMonth) {\n startMonth = startDate.calendar.getFormattableMonth(startDate);\n }\n if (endDate.calendar.getFormattableMonth) {\n endMonth = endDate.calendar.getFormattableMonth(endDate);\n }\n\n if (isSameDay(endDate, endOfMonth(startDate))) {\n return monthFormatter.format(startMonth.toDate(timeZone));\n } else if (isSameDay(endDate, endOfMonth(endDate))) {\n return isAria\n ? formatRange(monthFormatter, stringFormatter, startMonth, endMonth, timeZone)\n : monthFormatter.formatRange(startMonth.toDate(timeZone), endMonth.toDate(timeZone));\n }\n }\n\n return isAria\n ? formatRange(dateFormatter, stringFormatter, startDate, endDate, timeZone)\n : dateFormatter.formatRange(startDate.toDate(timeZone), endDate.toDate(timeZone));\n }, [startDate, endDate, monthFormatter, dateFormatter, stringFormatter, timeZone, isAria]);\n}\n\nfunction formatRange(dateFormatter: DateFormatter, stringFormatter: LocalizedStringFormatter, start: CalendarDate, end: CalendarDate, timeZone: string) {\n let parts = dateFormatter.formatRangeToParts(start.toDate(timeZone), end.toDate(timeZone));\n\n // Find the separator between the start and end date. This is determined\n // by finding the last shared literal before the end range.\n let separatorIndex = -1;\n for (let i = 0; i < parts.length; i++) {\n let part = parts[i];\n if (part.source === 'shared' && part.type === 'literal') {\n separatorIndex = i;\n } else if (part.source === 'endRange') {\n break;\n }\n }\n\n // Now we can combine the parts into start and end strings.\n let startValue = '';\n let endValue = '';\n for (let i = 0; i < parts.length; i++) {\n if (i < separatorIndex) {\n startValue += parts[i].value;\n } else if (i > separatorIndex) {\n endValue += parts[i].value;\n }\n }\n\n return stringFormatter.format('dateRange', {startDate: startValue, endDate: endValue});\n}\n"],"names":[],"version":3,"file":"utils.module.js.map"}
@@ -1,17 +0,0 @@
1
- module.exports = {
2
- "dateRange": (args)=>`${args.startDate} \u{81F3} ${args.endDate}`,
3
- "dateSelected": (args)=>`\u{5DF2}\u{9009}\u{62E9} ${args.date}`,
4
- "finishRangeSelectionPrompt": `\u{5355}\u{51FB}\u{4EE5}\u{5B8C}\u{6210}\u{9009}\u{62E9}\u{65E5}\u{671F}\u{8303}\u{56F4}`,
5
- "maximumDate": `\u{6700}\u{540E}\u{4E00}\u{4E2A}\u{53EF}\u{7528}\u{65E5}\u{671F}`,
6
- "minimumDate": `\u{7B2C}\u{4E00}\u{4E2A}\u{53EF}\u{7528}\u{65E5}\u{671F}`,
7
- "next": `\u{4E0B}\u{4E00}\u{9875}`,
8
- "previous": `\u{4E0A}\u{4E00}\u{9875}`,
9
- "selectedDateDescription": (args)=>`\u{9009}\u{5B9A}\u{7684}\u{65E5}\u{671F}\u{FF1A}${args.date}`,
10
- "selectedRangeDescription": (args)=>`\u{9009}\u{5B9A}\u{7684}\u{8303}\u{56F4}\u{FF1A}${args.dateRange}`,
11
- "startRangeSelectionPrompt": `\u{5355}\u{51FB}\u{4EE5}\u{5F00}\u{59CB}\u{9009}\u{62E9}\u{65E5}\u{671F}\u{8303}\u{56F4}`,
12
- "todayDate": (args)=>`\u{4ECA}\u{5929}\u{FF0C}\u{5373} ${args.date}`,
13
- "todayDateSelected": (args)=>`\u{5DF2}\u{9009}\u{62E9}\u{4ECA}\u{5929}\u{FF0C}\u{5373} ${args.date}`
14
- };
15
-
16
-
17
- //# sourceMappingURL=zh-CN.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":"AAAA,iBAAiB;IAAG,aAAa,CAAC,OAAS,GAAG,KAAK,SAAS,CAAC,UAAG,EAAE,KAAK,OAAO,EAAE;IAC9E,gBAAgB,CAAC,OAAS,CAAC,yBAAI,EAAE,KAAK,IAAI,EAAE;IAC5C,8BAA8B,CAAC,wFAAW,CAAC;IAC3C,eAAe,CAAC,gEAAQ,CAAC;IACzB,eAAe,CAAC,wDAAO,CAAC;IACxB,QAAQ,CAAC,wBAAG,CAAC;IACb,YAAY,CAAC,wBAAG,CAAC;IACjB,2BAA2B,CAAC,OAAS,CAAC,gDAAM,EAAE,KAAK,IAAI,EAAE;IACzD,4BAA4B,CAAC,OAAS,CAAC,gDAAM,EAAE,KAAK,SAAS,EAAE;IAC/D,6BAA6B,CAAC,wFAAW,CAAC;IAC1C,aAAa,CAAC,OAAS,CAAC,iCAAK,EAAE,KAAK,IAAI,EAAE;IAC1C,qBAAqB,CAAC,OAAS,CAAC,yDAAQ,EAAE,KAAK,IAAI,EAAE;AACvD","sources":["packages/@react-aria/calendar/intl/zh-CN.json"],"sourcesContent":["{\n \"dateRange\": \"{startDate} 至 {endDate}\",\n \"dateSelected\": \"已选择 {date}\",\n \"finishRangeSelectionPrompt\": \"单击以完成选择日期范围\",\n \"maximumDate\": \"最后一个可用日期\",\n \"minimumDate\": \"第一个可用日期\",\n \"next\": \"下一页\",\n \"previous\": \"上一页\",\n \"selectedDateDescription\": \"选定的日期:{date}\",\n \"selectedRangeDescription\": \"选定的范围:{dateRange}\",\n \"startRangeSelectionPrompt\": \"单击以开始选择日期范围\",\n \"todayDate\": \"今天,即 {date}\",\n \"todayDateSelected\": \"已选择今天,即 {date}\"\n}\n"],"names":[],"version":3,"file":"zh-CN.main.js.map"}
package/dist/zh-CN.mjs DELETED
@@ -1,19 +0,0 @@
1
- var $628e140a43dfb330$exports = {};
2
- $628e140a43dfb330$exports = {
3
- "dateRange": (args)=>`${args.startDate} \u{81F3} ${args.endDate}`,
4
- "dateSelected": (args)=>`\u{5DF2}\u{9009}\u{62E9} ${args.date}`,
5
- "finishRangeSelectionPrompt": `\u{5355}\u{51FB}\u{4EE5}\u{5B8C}\u{6210}\u{9009}\u{62E9}\u{65E5}\u{671F}\u{8303}\u{56F4}`,
6
- "maximumDate": `\u{6700}\u{540E}\u{4E00}\u{4E2A}\u{53EF}\u{7528}\u{65E5}\u{671F}`,
7
- "minimumDate": `\u{7B2C}\u{4E00}\u{4E2A}\u{53EF}\u{7528}\u{65E5}\u{671F}`,
8
- "next": `\u{4E0B}\u{4E00}\u{9875}`,
9
- "previous": `\u{4E0A}\u{4E00}\u{9875}`,
10
- "selectedDateDescription": (args)=>`\u{9009}\u{5B9A}\u{7684}\u{65E5}\u{671F}\u{FF1A}${args.date}`,
11
- "selectedRangeDescription": (args)=>`\u{9009}\u{5B9A}\u{7684}\u{8303}\u{56F4}\u{FF1A}${args.dateRange}`,
12
- "startRangeSelectionPrompt": `\u{5355}\u{51FB}\u{4EE5}\u{5F00}\u{59CB}\u{9009}\u{62E9}\u{65E5}\u{671F}\u{8303}\u{56F4}`,
13
- "todayDate": (args)=>`\u{4ECA}\u{5929}\u{FF0C}\u{5373} ${args.date}`,
14
- "todayDateSelected": (args)=>`\u{5DF2}\u{9009}\u{62E9}\u{4ECA}\u{5929}\u{FF0C}\u{5373} ${args.date}`
15
- };
16
-
17
-
18
- export {$628e140a43dfb330$exports as default};
19
- //# sourceMappingURL=zh-CN.module.js.map
@@ -1,19 +0,0 @@
1
- var $628e140a43dfb330$exports = {};
2
- $628e140a43dfb330$exports = {
3
- "dateRange": (args)=>`${args.startDate} \u{81F3} ${args.endDate}`,
4
- "dateSelected": (args)=>`\u{5DF2}\u{9009}\u{62E9} ${args.date}`,
5
- "finishRangeSelectionPrompt": `\u{5355}\u{51FB}\u{4EE5}\u{5B8C}\u{6210}\u{9009}\u{62E9}\u{65E5}\u{671F}\u{8303}\u{56F4}`,
6
- "maximumDate": `\u{6700}\u{540E}\u{4E00}\u{4E2A}\u{53EF}\u{7528}\u{65E5}\u{671F}`,
7
- "minimumDate": `\u{7B2C}\u{4E00}\u{4E2A}\u{53EF}\u{7528}\u{65E5}\u{671F}`,
8
- "next": `\u{4E0B}\u{4E00}\u{9875}`,
9
- "previous": `\u{4E0A}\u{4E00}\u{9875}`,
10
- "selectedDateDescription": (args)=>`\u{9009}\u{5B9A}\u{7684}\u{65E5}\u{671F}\u{FF1A}${args.date}`,
11
- "selectedRangeDescription": (args)=>`\u{9009}\u{5B9A}\u{7684}\u{8303}\u{56F4}\u{FF1A}${args.dateRange}`,
12
- "startRangeSelectionPrompt": `\u{5355}\u{51FB}\u{4EE5}\u{5F00}\u{59CB}\u{9009}\u{62E9}\u{65E5}\u{671F}\u{8303}\u{56F4}`,
13
- "todayDate": (args)=>`\u{4ECA}\u{5929}\u{FF0C}\u{5373} ${args.date}`,
14
- "todayDateSelected": (args)=>`\u{5DF2}\u{9009}\u{62E9}\u{4ECA}\u{5929}\u{FF0C}\u{5373} ${args.date}`
15
- };
16
-
17
-
18
- export {$628e140a43dfb330$exports as default};
19
- //# sourceMappingURL=zh-CN.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";AAAA,4BAAiB;IAAG,aAAa,CAAC,OAAS,GAAG,KAAK,SAAS,CAAC,UAAG,EAAE,KAAK,OAAO,EAAE;IAC9E,gBAAgB,CAAC,OAAS,CAAC,yBAAI,EAAE,KAAK,IAAI,EAAE;IAC5C,8BAA8B,CAAC,wFAAW,CAAC;IAC3C,eAAe,CAAC,gEAAQ,CAAC;IACzB,eAAe,CAAC,wDAAO,CAAC;IACxB,QAAQ,CAAC,wBAAG,CAAC;IACb,YAAY,CAAC,wBAAG,CAAC;IACjB,2BAA2B,CAAC,OAAS,CAAC,gDAAM,EAAE,KAAK,IAAI,EAAE;IACzD,4BAA4B,CAAC,OAAS,CAAC,gDAAM,EAAE,KAAK,SAAS,EAAE;IAC/D,6BAA6B,CAAC,wFAAW,CAAC;IAC1C,aAAa,CAAC,OAAS,CAAC,iCAAK,EAAE,KAAK,IAAI,EAAE;IAC1C,qBAAqB,CAAC,OAAS,CAAC,yDAAQ,EAAE,KAAK,IAAI,EAAE;AACvD","sources":["packages/@react-aria/calendar/intl/zh-CN.json"],"sourcesContent":["{\n \"dateRange\": \"{startDate} 至 {endDate}\",\n \"dateSelected\": \"已选择 {date}\",\n \"finishRangeSelectionPrompt\": \"单击以完成选择日期范围\",\n \"maximumDate\": \"最后一个可用日期\",\n \"minimumDate\": \"第一个可用日期\",\n \"next\": \"下一页\",\n \"previous\": \"上一页\",\n \"selectedDateDescription\": \"选定的日期:{date}\",\n \"selectedRangeDescription\": \"选定的范围:{dateRange}\",\n \"startRangeSelectionPrompt\": \"单击以开始选择日期范围\",\n \"todayDate\": \"今天,即 {date}\",\n \"todayDateSelected\": \"已选择今天,即 {date}\"\n}\n"],"names":[],"version":3,"file":"zh-CN.module.js.map"}
@@ -1,17 +0,0 @@
1
- module.exports = {
2
- "dateRange": (args)=>`${args.startDate} \u{81F3} ${args.endDate}`,
3
- "dateSelected": (args)=>`\u{5DF2}\u{9078}\u{53D6} ${args.date}`,
4
- "finishRangeSelectionPrompt": `\u{6309}\u{4E00}\u{4E0B}\u{4EE5}\u{5B8C}\u{6210}\u{9078}\u{53D6}\u{65E5}\u{671F}\u{7BC4}\u{570D}`,
5
- "maximumDate": `\u{6700}\u{5F8C}\u{4E00}\u{500B}\u{53EF}\u{7528}\u{65E5}\u{671F}`,
6
- "minimumDate": `\u{7B2C}\u{4E00}\u{500B}\u{53EF}\u{7528}\u{65E5}\u{671F}`,
7
- "next": `\u{4E0B}\u{4E00}\u{9801}`,
8
- "previous": `\u{4E0A}\u{4E00}\u{9801}`,
9
- "selectedDateDescription": (args)=>`\u{9078}\u{5B9A}\u{7684}\u{65E5}\u{671F}\u{FF1A}${args.date}`,
10
- "selectedRangeDescription": (args)=>`\u{9078}\u{5B9A}\u{7684}\u{7BC4}\u{570D}\u{FF1A}${args.dateRange}`,
11
- "startRangeSelectionPrompt": `\u{6309}\u{4E00}\u{4E0B}\u{4EE5}\u{958B}\u{59CB}\u{9078}\u{53D6}\u{65E5}\u{671F}\u{7BC4}\u{570D}`,
12
- "todayDate": (args)=>`\u{4ECA}\u{5929}\u{FF0C}${args.date}`,
13
- "todayDateSelected": (args)=>`\u{5DF2}\u{9078}\u{53D6}\u{4ECA}\u{5929}\u{FF0C}${args.date}`
14
- };
15
-
16
-
17
- //# sourceMappingURL=zh-TW.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":"AAAA,iBAAiB;IAAG,aAAa,CAAC,OAAS,GAAG,KAAK,SAAS,CAAC,UAAG,EAAE,KAAK,OAAO,EAAE;IAC9E,gBAAgB,CAAC,OAAS,CAAC,yBAAI,EAAE,KAAK,IAAI,EAAE;IAC5C,8BAA8B,CAAC,gGAAY,CAAC;IAC5C,eAAe,CAAC,gEAAQ,CAAC;IACzB,eAAe,CAAC,wDAAO,CAAC;IACxB,QAAQ,CAAC,wBAAG,CAAC;IACb,YAAY,CAAC,wBAAG,CAAC;IACjB,2BAA2B,CAAC,OAAS,CAAC,gDAAM,EAAE,KAAK,IAAI,EAAE;IACzD,4BAA4B,CAAC,OAAS,CAAC,gDAAM,EAAE,KAAK,SAAS,EAAE;IAC/D,6BAA6B,CAAC,gGAAY,CAAC;IAC3C,aAAa,CAAC,OAAS,CAAC,wBAAG,EAAE,KAAK,IAAI,EAAE;IACxC,qBAAqB,CAAC,OAAS,CAAC,gDAAM,EAAE,KAAK,IAAI,EAAE;AACrD","sources":["packages/@react-aria/calendar/intl/zh-TW.json"],"sourcesContent":["{\n \"dateRange\": \"{startDate} 至 {endDate}\",\n \"dateSelected\": \"已選取 {date}\",\n \"finishRangeSelectionPrompt\": \"按一下以完成選取日期範圍\",\n \"maximumDate\": \"最後一個可用日期\",\n \"minimumDate\": \"第一個可用日期\",\n \"next\": \"下一頁\",\n \"previous\": \"上一頁\",\n \"selectedDateDescription\": \"選定的日期:{date}\",\n \"selectedRangeDescription\": \"選定的範圍:{dateRange}\",\n \"startRangeSelectionPrompt\": \"按一下以開始選取日期範圍\",\n \"todayDate\": \"今天,{date}\",\n \"todayDateSelected\": \"已選取今天,{date}\"\n}\n"],"names":[],"version":3,"file":"zh-TW.main.js.map"}
package/dist/zh-TW.mjs DELETED
@@ -1,19 +0,0 @@
1
- var $745937250cd4679c$exports = {};
2
- $745937250cd4679c$exports = {
3
- "dateRange": (args)=>`${args.startDate} \u{81F3} ${args.endDate}`,
4
- "dateSelected": (args)=>`\u{5DF2}\u{9078}\u{53D6} ${args.date}`,
5
- "finishRangeSelectionPrompt": `\u{6309}\u{4E00}\u{4E0B}\u{4EE5}\u{5B8C}\u{6210}\u{9078}\u{53D6}\u{65E5}\u{671F}\u{7BC4}\u{570D}`,
6
- "maximumDate": `\u{6700}\u{5F8C}\u{4E00}\u{500B}\u{53EF}\u{7528}\u{65E5}\u{671F}`,
7
- "minimumDate": `\u{7B2C}\u{4E00}\u{500B}\u{53EF}\u{7528}\u{65E5}\u{671F}`,
8
- "next": `\u{4E0B}\u{4E00}\u{9801}`,
9
- "previous": `\u{4E0A}\u{4E00}\u{9801}`,
10
- "selectedDateDescription": (args)=>`\u{9078}\u{5B9A}\u{7684}\u{65E5}\u{671F}\u{FF1A}${args.date}`,
11
- "selectedRangeDescription": (args)=>`\u{9078}\u{5B9A}\u{7684}\u{7BC4}\u{570D}\u{FF1A}${args.dateRange}`,
12
- "startRangeSelectionPrompt": `\u{6309}\u{4E00}\u{4E0B}\u{4EE5}\u{958B}\u{59CB}\u{9078}\u{53D6}\u{65E5}\u{671F}\u{7BC4}\u{570D}`,
13
- "todayDate": (args)=>`\u{4ECA}\u{5929}\u{FF0C}${args.date}`,
14
- "todayDateSelected": (args)=>`\u{5DF2}\u{9078}\u{53D6}\u{4ECA}\u{5929}\u{FF0C}${args.date}`
15
- };
16
-
17
-
18
- export {$745937250cd4679c$exports as default};
19
- //# sourceMappingURL=zh-TW.module.js.map
@@ -1,19 +0,0 @@
1
- var $745937250cd4679c$exports = {};
2
- $745937250cd4679c$exports = {
3
- "dateRange": (args)=>`${args.startDate} \u{81F3} ${args.endDate}`,
4
- "dateSelected": (args)=>`\u{5DF2}\u{9078}\u{53D6} ${args.date}`,
5
- "finishRangeSelectionPrompt": `\u{6309}\u{4E00}\u{4E0B}\u{4EE5}\u{5B8C}\u{6210}\u{9078}\u{53D6}\u{65E5}\u{671F}\u{7BC4}\u{570D}`,
6
- "maximumDate": `\u{6700}\u{5F8C}\u{4E00}\u{500B}\u{53EF}\u{7528}\u{65E5}\u{671F}`,
7
- "minimumDate": `\u{7B2C}\u{4E00}\u{500B}\u{53EF}\u{7528}\u{65E5}\u{671F}`,
8
- "next": `\u{4E0B}\u{4E00}\u{9801}`,
9
- "previous": `\u{4E0A}\u{4E00}\u{9801}`,
10
- "selectedDateDescription": (args)=>`\u{9078}\u{5B9A}\u{7684}\u{65E5}\u{671F}\u{FF1A}${args.date}`,
11
- "selectedRangeDescription": (args)=>`\u{9078}\u{5B9A}\u{7684}\u{7BC4}\u{570D}\u{FF1A}${args.dateRange}`,
12
- "startRangeSelectionPrompt": `\u{6309}\u{4E00}\u{4E0B}\u{4EE5}\u{958B}\u{59CB}\u{9078}\u{53D6}\u{65E5}\u{671F}\u{7BC4}\u{570D}`,
13
- "todayDate": (args)=>`\u{4ECA}\u{5929}\u{FF0C}${args.date}`,
14
- "todayDateSelected": (args)=>`\u{5DF2}\u{9078}\u{53D6}\u{4ECA}\u{5929}\u{FF0C}${args.date}`
15
- };
16
-
17
-
18
- export {$745937250cd4679c$exports as default};
19
- //# sourceMappingURL=zh-TW.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";AAAA,4BAAiB;IAAG,aAAa,CAAC,OAAS,GAAG,KAAK,SAAS,CAAC,UAAG,EAAE,KAAK,OAAO,EAAE;IAC9E,gBAAgB,CAAC,OAAS,CAAC,yBAAI,EAAE,KAAK,IAAI,EAAE;IAC5C,8BAA8B,CAAC,gGAAY,CAAC;IAC5C,eAAe,CAAC,gEAAQ,CAAC;IACzB,eAAe,CAAC,wDAAO,CAAC;IACxB,QAAQ,CAAC,wBAAG,CAAC;IACb,YAAY,CAAC,wBAAG,CAAC;IACjB,2BAA2B,CAAC,OAAS,CAAC,gDAAM,EAAE,KAAK,IAAI,EAAE;IACzD,4BAA4B,CAAC,OAAS,CAAC,gDAAM,EAAE,KAAK,SAAS,EAAE;IAC/D,6BAA6B,CAAC,gGAAY,CAAC;IAC3C,aAAa,CAAC,OAAS,CAAC,wBAAG,EAAE,KAAK,IAAI,EAAE;IACxC,qBAAqB,CAAC,OAAS,CAAC,gDAAM,EAAE,KAAK,IAAI,EAAE;AACrD","sources":["packages/@react-aria/calendar/intl/zh-TW.json"],"sourcesContent":["{\n \"dateRange\": \"{startDate} 至 {endDate}\",\n \"dateSelected\": \"已選取 {date}\",\n \"finishRangeSelectionPrompt\": \"按一下以完成選取日期範圍\",\n \"maximumDate\": \"最後一個可用日期\",\n \"minimumDate\": \"第一個可用日期\",\n \"next\": \"下一頁\",\n \"previous\": \"上一頁\",\n \"selectedDateDescription\": \"選定的日期:{date}\",\n \"selectedRangeDescription\": \"選定的範圍:{dateRange}\",\n \"startRangeSelectionPrompt\": \"按一下以開始選取日期範圍\",\n \"todayDate\": \"今天,{date}\",\n \"todayDateSelected\": \"已選取今天,{date}\"\n}\n"],"names":[],"version":3,"file":"zh-TW.module.js.map"}
@@ -1,23 +0,0 @@
1
- /*
2
- * Copyright 2020 Adobe. All rights reserved.
3
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License. You may obtain a copy
5
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
- *
7
- * Unless required by applicable law or agreed to in writing, software distributed under
8
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- * OF ANY KIND, either express or implied. See the License for the specific language
10
- * governing permissions and limitations under the License.
11
- */
12
-
13
- import {AriaCalendarProps, DateValue} from '@react-types/calendar';
14
- import {CalendarAria, useCalendarBase} from './useCalendarBase';
15
- import {CalendarState} from '@react-stately/calendar';
16
-
17
- /**
18
- * Provides the behavior and accessibility implementation for a calendar component.
19
- * A calendar displays one or more date grids and allows users to select a single date.
20
- */
21
- export function useCalendar<T extends DateValue>(props: AriaCalendarProps<T>, state: CalendarState): CalendarAria {
22
- return useCalendarBase(props, state);
23
- }
@@ -1,116 +0,0 @@
1
- /*
2
- * Copyright 2020 Adobe. All rights reserved.
3
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License. You may obtain a copy
5
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
- *
7
- * Unless required by applicable law or agreed to in writing, software distributed under
8
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- * OF ANY KIND, either express or implied. See the License for the specific language
10
- * governing permissions and limitations under the License.
11
- */
12
-
13
- import {announce} from '@react-aria/live-announcer';
14
- import {AriaButtonProps} from '@react-types/button';
15
- import {AriaLabelingProps, DOMAttributes, DOMProps} from '@react-types/shared';
16
- import {CalendarPropsBase} from '@react-types/calendar';
17
- import {CalendarState, RangeCalendarState} from '@react-stately/calendar';
18
- import {filterDOMProps, mergeProps, useLabels, useSlotId, useUpdateEffect} from '@react-aria/utils';
19
- import {hookData, useSelectedDateDescription, useVisibleRangeDescription} from './utils';
20
- // @ts-ignore
21
- import intlMessages from '../intl/*.json';
22
- import {useLocalizedStringFormatter} from '@react-aria/i18n';
23
- import {useState} from 'react';
24
-
25
- export interface CalendarAria {
26
- /** Props for the calendar grouping element. */
27
- calendarProps: DOMAttributes,
28
- /** Props for the next button. */
29
- nextButtonProps: AriaButtonProps,
30
- /** Props for the previous button. */
31
- prevButtonProps: AriaButtonProps,
32
- /** Props for the error message element, if any. */
33
- errorMessageProps: DOMAttributes,
34
- /** A description of the visible date range, for use in the calendar title. */
35
- title: string
36
- }
37
-
38
- export function useCalendarBase(props: CalendarPropsBase & DOMProps & AriaLabelingProps, state: CalendarState | RangeCalendarState): CalendarAria {
39
- let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/calendar');
40
- let domProps = filterDOMProps(props);
41
-
42
- let title = useVisibleRangeDescription(state.visibleRange.start, state.visibleRange.end, state.timeZone, false);
43
- let visibleRangeDescription = useVisibleRangeDescription(state.visibleRange.start, state.visibleRange.end, state.timeZone, true);
44
-
45
- // Announce when the visible date range changes
46
- useUpdateEffect(() => {
47
- // only when pressing the Previous or Next button
48
- if (!state.isFocused) {
49
- announce(visibleRangeDescription);
50
- }
51
- }, [visibleRangeDescription]);
52
-
53
- // Announce when the selected value changes
54
- let selectedDateDescription = useSelectedDateDescription(state);
55
- useUpdateEffect(() => {
56
- if (selectedDateDescription) {
57
- announce(selectedDateDescription, 'polite', 4000);
58
- }
59
- // handle an update to the caption that describes the currently selected range, to announce the new value
60
- }, [selectedDateDescription]);
61
-
62
- let errorMessageId = useSlotId([Boolean(props.errorMessage), props.isInvalid, props.validationState]);
63
-
64
- // Pass the label to the child grid elements.
65
- hookData.set(state, {
66
- ariaLabel: props['aria-label'],
67
- ariaLabelledBy: props['aria-labelledby'],
68
- errorMessageId,
69
- selectedDateDescription
70
- });
71
-
72
- // If the next or previous buttons become disabled while they are focused, move focus to the calendar body.
73
- let [nextFocused, setNextFocused] = useState(false);
74
- let nextDisabled = props.isDisabled || state.isNextVisibleRangeInvalid();
75
- if (nextDisabled && nextFocused) {
76
- setNextFocused(false);
77
- state.setFocused(true);
78
- }
79
-
80
- let [previousFocused, setPreviousFocused] = useState(false);
81
- let previousDisabled = props.isDisabled || state.isPreviousVisibleRangeInvalid();
82
- if (previousDisabled && previousFocused) {
83
- setPreviousFocused(false);
84
- state.setFocused(true);
85
- }
86
-
87
- let labelProps = useLabels({
88
- id: props['id'],
89
- 'aria-label': [props['aria-label'], visibleRangeDescription].filter(Boolean).join(', '),
90
- 'aria-labelledby': props['aria-labelledby']
91
- });
92
-
93
- return {
94
- calendarProps: mergeProps(domProps, labelProps, {
95
- role: 'application',
96
- 'aria-details': props['aria-details'] || undefined,
97
- 'aria-describedby': props['aria-describedby'] || undefined
98
- }),
99
- nextButtonProps: {
100
- onPress: () => state.focusNextPage(),
101
- 'aria-label': stringFormatter.format('next'),
102
- isDisabled: nextDisabled,
103
- onFocusChange: setNextFocused
104
- },
105
- prevButtonProps: {
106
- onPress: () => state.focusPreviousPage(),
107
- 'aria-label': stringFormatter.format('previous'),
108
- isDisabled: previousDisabled,
109
- onFocusChange: setPreviousFocused
110
- },
111
- errorMessageProps: {
112
- id: errorMessageId
113
- },
114
- title
115
- };
116
- }