@react-aria/datepicker 3.16.0 → 3.17.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 +6 -6
  2. package/dist/main.js +11 -11
  3. package/dist/main.js.map +1 -1
  4. package/dist/module.js +6 -6
  5. package/dist/module.js.map +1 -1
  6. package/dist/types/src/index.d.ts +12 -0
  7. package/package.json +16 -28
  8. package/src/index.ts +13 -11
  9. package/dist/ar-AE.main.js +0 -21
  10. package/dist/ar-AE.main.js.map +0 -1
  11. package/dist/ar-AE.mjs +0 -23
  12. package/dist/ar-AE.module.js +0 -23
  13. package/dist/ar-AE.module.js.map +0 -1
  14. package/dist/bg-BG.main.js +0 -21
  15. package/dist/bg-BG.main.js.map +0 -1
  16. package/dist/bg-BG.mjs +0 -23
  17. package/dist/bg-BG.module.js +0 -23
  18. package/dist/bg-BG.module.js.map +0 -1
  19. package/dist/cs-CZ.main.js +0 -21
  20. package/dist/cs-CZ.main.js.map +0 -1
  21. package/dist/cs-CZ.mjs +0 -23
  22. package/dist/cs-CZ.module.js +0 -23
  23. package/dist/cs-CZ.module.js.map +0 -1
  24. package/dist/da-DK.main.js +0 -21
  25. package/dist/da-DK.main.js.map +0 -1
  26. package/dist/da-DK.mjs +0 -23
  27. package/dist/da-DK.module.js +0 -23
  28. package/dist/da-DK.module.js.map +0 -1
  29. package/dist/de-DE.main.js +0 -21
  30. package/dist/de-DE.main.js.map +0 -1
  31. package/dist/de-DE.mjs +0 -23
  32. package/dist/de-DE.module.js +0 -23
  33. package/dist/de-DE.module.js.map +0 -1
  34. package/dist/el-GR.main.js +0 -21
  35. package/dist/el-GR.main.js.map +0 -1
  36. package/dist/el-GR.mjs +0 -23
  37. package/dist/el-GR.module.js +0 -23
  38. package/dist/el-GR.module.js.map +0 -1
  39. package/dist/en-US.main.js +0 -21
  40. package/dist/en-US.main.js.map +0 -1
  41. package/dist/en-US.mjs +0 -23
  42. package/dist/en-US.module.js +0 -23
  43. package/dist/en-US.module.js.map +0 -1
  44. package/dist/es-ES.main.js +0 -21
  45. package/dist/es-ES.main.js.map +0 -1
  46. package/dist/es-ES.mjs +0 -23
  47. package/dist/es-ES.module.js +0 -23
  48. package/dist/es-ES.module.js.map +0 -1
  49. package/dist/et-EE.main.js +0 -21
  50. package/dist/et-EE.main.js.map +0 -1
  51. package/dist/et-EE.mjs +0 -23
  52. package/dist/et-EE.module.js +0 -23
  53. package/dist/et-EE.module.js.map +0 -1
  54. package/dist/fi-FI.main.js +0 -21
  55. package/dist/fi-FI.main.js.map +0 -1
  56. package/dist/fi-FI.mjs +0 -23
  57. package/dist/fi-FI.module.js +0 -23
  58. package/dist/fi-FI.module.js.map +0 -1
  59. package/dist/fr-FR.main.js +0 -21
  60. package/dist/fr-FR.main.js.map +0 -1
  61. package/dist/fr-FR.mjs +0 -23
  62. package/dist/fr-FR.module.js +0 -23
  63. package/dist/fr-FR.module.js.map +0 -1
  64. package/dist/he-IL.main.js +0 -21
  65. package/dist/he-IL.main.js.map +0 -1
  66. package/dist/he-IL.mjs +0 -23
  67. package/dist/he-IL.module.js +0 -23
  68. package/dist/he-IL.module.js.map +0 -1
  69. package/dist/hr-HR.main.js +0 -21
  70. package/dist/hr-HR.main.js.map +0 -1
  71. package/dist/hr-HR.mjs +0 -23
  72. package/dist/hr-HR.module.js +0 -23
  73. package/dist/hr-HR.module.js.map +0 -1
  74. package/dist/hu-HU.main.js +0 -21
  75. package/dist/hu-HU.main.js.map +0 -1
  76. package/dist/hu-HU.mjs +0 -23
  77. package/dist/hu-HU.module.js +0 -23
  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 -21
  85. package/dist/it-IT.main.js.map +0 -1
  86. package/dist/it-IT.mjs +0 -23
  87. package/dist/it-IT.module.js +0 -23
  88. package/dist/it-IT.module.js.map +0 -1
  89. package/dist/ja-JP.main.js +0 -21
  90. package/dist/ja-JP.main.js.map +0 -1
  91. package/dist/ja-JP.mjs +0 -23
  92. package/dist/ja-JP.module.js +0 -23
  93. package/dist/ja-JP.module.js.map +0 -1
  94. package/dist/ko-KR.main.js +0 -21
  95. package/dist/ko-KR.main.js.map +0 -1
  96. package/dist/ko-KR.mjs +0 -23
  97. package/dist/ko-KR.module.js +0 -23
  98. package/dist/ko-KR.module.js.map +0 -1
  99. package/dist/lt-LT.main.js +0 -21
  100. package/dist/lt-LT.main.js.map +0 -1
  101. package/dist/lt-LT.mjs +0 -23
  102. package/dist/lt-LT.module.js +0 -23
  103. package/dist/lt-LT.module.js.map +0 -1
  104. package/dist/lv-LV.main.js +0 -21
  105. package/dist/lv-LV.main.js.map +0 -1
  106. package/dist/lv-LV.mjs +0 -23
  107. package/dist/lv-LV.module.js +0 -23
  108. package/dist/lv-LV.module.js.map +0 -1
  109. package/dist/nb-NO.main.js +0 -21
  110. package/dist/nb-NO.main.js.map +0 -1
  111. package/dist/nb-NO.mjs +0 -23
  112. package/dist/nb-NO.module.js +0 -23
  113. package/dist/nb-NO.module.js.map +0 -1
  114. package/dist/nl-NL.main.js +0 -21
  115. package/dist/nl-NL.main.js.map +0 -1
  116. package/dist/nl-NL.mjs +0 -23
  117. package/dist/nl-NL.module.js +0 -23
  118. package/dist/nl-NL.module.js.map +0 -1
  119. package/dist/pl-PL.main.js +0 -21
  120. package/dist/pl-PL.main.js.map +0 -1
  121. package/dist/pl-PL.mjs +0 -23
  122. package/dist/pl-PL.module.js +0 -23
  123. package/dist/pl-PL.module.js.map +0 -1
  124. package/dist/pt-BR.main.js +0 -21
  125. package/dist/pt-BR.main.js.map +0 -1
  126. package/dist/pt-BR.mjs +0 -23
  127. package/dist/pt-BR.module.js +0 -23
  128. package/dist/pt-BR.module.js.map +0 -1
  129. package/dist/pt-PT.main.js +0 -21
  130. package/dist/pt-PT.main.js.map +0 -1
  131. package/dist/pt-PT.mjs +0 -23
  132. package/dist/pt-PT.module.js +0 -23
  133. package/dist/pt-PT.module.js.map +0 -1
  134. package/dist/ro-RO.main.js +0 -21
  135. package/dist/ro-RO.main.js.map +0 -1
  136. package/dist/ro-RO.mjs +0 -23
  137. package/dist/ro-RO.module.js +0 -23
  138. package/dist/ro-RO.module.js.map +0 -1
  139. package/dist/ru-RU.main.js +0 -21
  140. package/dist/ru-RU.main.js.map +0 -1
  141. package/dist/ru-RU.mjs +0 -23
  142. package/dist/ru-RU.module.js +0 -23
  143. package/dist/ru-RU.module.js.map +0 -1
  144. package/dist/sk-SK.main.js +0 -21
  145. package/dist/sk-SK.main.js.map +0 -1
  146. package/dist/sk-SK.mjs +0 -23
  147. package/dist/sk-SK.module.js +0 -23
  148. package/dist/sk-SK.module.js.map +0 -1
  149. package/dist/sl-SI.main.js +0 -21
  150. package/dist/sl-SI.main.js.map +0 -1
  151. package/dist/sl-SI.mjs +0 -23
  152. package/dist/sl-SI.module.js +0 -23
  153. package/dist/sl-SI.module.js.map +0 -1
  154. package/dist/sr-SP.main.js +0 -21
  155. package/dist/sr-SP.main.js.map +0 -1
  156. package/dist/sr-SP.mjs +0 -23
  157. package/dist/sr-SP.module.js +0 -23
  158. package/dist/sr-SP.module.js.map +0 -1
  159. package/dist/sv-SE.main.js +0 -21
  160. package/dist/sv-SE.main.js.map +0 -1
  161. package/dist/sv-SE.mjs +0 -23
  162. package/dist/sv-SE.module.js +0 -23
  163. package/dist/sv-SE.module.js.map +0 -1
  164. package/dist/tr-TR.main.js +0 -21
  165. package/dist/tr-TR.main.js.map +0 -1
  166. package/dist/tr-TR.mjs +0 -23
  167. package/dist/tr-TR.module.js +0 -23
  168. package/dist/tr-TR.module.js.map +0 -1
  169. package/dist/types.d.ts +0 -108
  170. package/dist/types.d.ts.map +0 -1
  171. package/dist/uk-UA.main.js +0 -21
  172. package/dist/uk-UA.main.js.map +0 -1
  173. package/dist/uk-UA.mjs +0 -23
  174. package/dist/uk-UA.module.js +0 -23
  175. package/dist/uk-UA.module.js.map +0 -1
  176. package/dist/useDateField.main.js +0 -181
  177. package/dist/useDateField.main.js.map +0 -1
  178. package/dist/useDateField.mjs +0 -172
  179. package/dist/useDateField.module.js +0 -172
  180. package/dist/useDateField.module.js.map +0 -1
  181. package/dist/useDatePicker.main.js +0 -178
  182. package/dist/useDatePicker.main.js.map +0 -1
  183. package/dist/useDatePicker.mjs +0 -173
  184. package/dist/useDatePicker.module.js +0 -173
  185. package/dist/useDatePicker.module.js.map +0 -1
  186. package/dist/useDatePickerGroup.main.js +0 -121
  187. package/dist/useDatePickerGroup.main.js.map +0 -1
  188. package/dist/useDatePickerGroup.mjs +0 -116
  189. package/dist/useDatePickerGroup.module.js +0 -116
  190. package/dist/useDatePickerGroup.module.js.map +0 -1
  191. package/dist/useDateRangePicker.main.js +0 -224
  192. package/dist/useDateRangePicker.main.js.map +0 -1
  193. package/dist/useDateRangePicker.mjs +0 -219
  194. package/dist/useDateRangePicker.module.js +0 -219
  195. package/dist/useDateRangePicker.module.js.map +0 -1
  196. package/dist/useDateSegment.main.js +0 -370
  197. package/dist/useDateSegment.main.js.map +0 -1
  198. package/dist/useDateSegment.mjs +0 -361
  199. package/dist/useDateSegment.module.js +0 -361
  200. package/dist/useDateSegment.module.js.map +0 -1
  201. package/dist/useDisplayNames.main.js +0 -58
  202. package/dist/useDisplayNames.main.js.map +0 -1
  203. package/dist/useDisplayNames.mjs +0 -53
  204. package/dist/useDisplayNames.module.js +0 -53
  205. package/dist/useDisplayNames.module.js.map +0 -1
  206. package/dist/zh-CN.main.js +0 -21
  207. package/dist/zh-CN.main.js.map +0 -1
  208. package/dist/zh-CN.mjs +0 -23
  209. package/dist/zh-CN.module.js +0 -23
  210. package/dist/zh-CN.module.js.map +0 -1
  211. package/dist/zh-TW.main.js +0 -21
  212. package/dist/zh-TW.main.js.map +0 -1
  213. package/dist/zh-TW.mjs +0 -23
  214. package/dist/zh-TW.module.js +0 -23
  215. package/dist/zh-TW.module.js.map +0 -1
  216. package/src/useDateField.ts +0 -213
  217. package/src/useDatePicker.ts +0 -192
  218. package/src/useDatePickerGroup.ts +0 -138
  219. package/src/useDateRangePicker.ts +0 -243
  220. package/src/useDateSegment.ts +0 -413
  221. package/src/useDisplayNames.ts +0 -51
package/dist/tr-TR.mjs DELETED
@@ -1,23 +0,0 @@
1
- var $3a49d121fe4c9e1d$exports = {};
2
- $3a49d121fe4c9e1d$exports = {
3
- "calendar": `Takvim`,
4
- "day": `g\xfcn`,
5
- "dayPeriod": `\xd6\xd6/\xd6S`,
6
- "endDate": `Biti\u{15F} Tarihi`,
7
- "era": `\xe7a\u{11F}`,
8
- "hour": `saat`,
9
- "minute": `dakika`,
10
- "month": `ay`,
11
- "second": `saniye`,
12
- "selectedDateDescription": (args)=>`Se\xe7ilen Tarih: ${args.date}`,
13
- "selectedRangeDescription": (args)=>`Se\xe7ilen Aral\u{131}k: ${args.startDate} - ${args.endDate}`,
14
- "selectedTimeDescription": (args)=>`Se\xe7ilen Zaman: ${args.time}`,
15
- "startDate": `Ba\u{15F}lang\u{131}\xe7 Tarihi`,
16
- "timeZoneName": `saat dilimi`,
17
- "weekday": `haftan\u{131}n g\xfcn\xfc`,
18
- "year": `y\u{131}l`
19
- };
20
-
21
-
22
- export {$3a49d121fe4c9e1d$exports as default};
23
- //# sourceMappingURL=tr-TR.module.js.map
@@ -1,23 +0,0 @@
1
- var $3a49d121fe4c9e1d$exports = {};
2
- $3a49d121fe4c9e1d$exports = {
3
- "calendar": `Takvim`,
4
- "day": `g\xfcn`,
5
- "dayPeriod": `\xd6\xd6/\xd6S`,
6
- "endDate": `Biti\u{15F} Tarihi`,
7
- "era": `\xe7a\u{11F}`,
8
- "hour": `saat`,
9
- "minute": `dakika`,
10
- "month": `ay`,
11
- "second": `saniye`,
12
- "selectedDateDescription": (args)=>`Se\xe7ilen Tarih: ${args.date}`,
13
- "selectedRangeDescription": (args)=>`Se\xe7ilen Aral\u{131}k: ${args.startDate} - ${args.endDate}`,
14
- "selectedTimeDescription": (args)=>`Se\xe7ilen Zaman: ${args.time}`,
15
- "startDate": `Ba\u{15F}lang\u{131}\xe7 Tarihi`,
16
- "timeZoneName": `saat dilimi`,
17
- "weekday": `haftan\u{131}n g\xfcn\xfc`,
18
- "year": `y\u{131}l`
19
- };
20
-
21
-
22
- export {$3a49d121fe4c9e1d$exports as default};
23
- //# sourceMappingURL=tr-TR.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";AAAA,4BAAiB;IAAG,YAAY,CAAC,MAAM,CAAC;IACtC,OAAO,CAAC,MAAG,CAAC;IACZ,aAAa,CAAC,cAAK,CAAC;IACpB,WAAW,CAAC,kBAAY,CAAC;IACzB,OAAO,CAAC,YAAG,CAAC;IACZ,QAAQ,CAAC,IAAI,CAAC;IACd,UAAU,CAAC,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,CAAC;IACb,UAAU,CAAC,MAAM,CAAC;IAClB,2BAA2B,CAAC,OAAS,CAAC,kBAAe,EAAE,KAAK,IAAI,EAAE;IAClE,4BAA4B,CAAC,OAAS,CAAC,yBAAgB,EAAE,KAAK,SAAS,CAAC,GAAG,EAAE,KAAK,OAAO,EAAE;IAC3F,2BAA2B,CAAC,OAAS,CAAC,kBAAe,EAAE,KAAK,IAAI,EAAE;IAClE,aAAa,CAAC,+BAAgB,CAAC;IAC/B,gBAAgB,CAAC,WAAW,CAAC;IAC7B,WAAW,CAAC,yBAAa,CAAC;IAC1B,QAAQ,CAAC,SAAG,CAAC;AACf","sources":["packages/@react-aria/datepicker/intl/tr-TR.json"],"sourcesContent":["{\n \"calendar\": \"Takvim\",\n \"day\": \"gün\",\n \"dayPeriod\": \"ÖÖ/ÖS\",\n \"endDate\": \"Bitiş Tarihi\",\n \"era\": \"çağ\",\n \"hour\": \"saat\",\n \"minute\": \"dakika\",\n \"month\": \"ay\",\n \"second\": \"saniye\",\n \"selectedDateDescription\": \"Seçilen Tarih: {date}\",\n \"selectedRangeDescription\": \"Seçilen Aralık: {startDate} - {endDate}\",\n \"selectedTimeDescription\": \"Seçilen Zaman: {time}\",\n \"startDate\": \"Başlangıç Tarihi\",\n \"timeZoneName\": \"saat dilimi\",\n \"weekday\": \"haftanın günü\",\n \"year\": \"yıl\"\n}\n"],"names":[],"version":3,"file":"tr-TR.module.js.map"}
package/dist/types.d.ts DELETED
@@ -1,108 +0,0 @@
1
- import { AriaDateFieldProps, AriaTimeFieldProps, DateValue, TimeValue, AriaDatePickerProps, AriaDateRangePickerProps } from "@react-types/datepicker";
2
- import { DateFieldState, TimeFieldState, DatePickerState, DateSegment, DateRangePickerState } from "@react-stately/datepicker";
3
- import { DOMAttributes, GroupDOMAttributes, RefObject, ValidationResult } from "@react-types/shared";
4
- import React, { InputHTMLAttributes } from "react";
5
- import { AriaButtonProps } from "@react-types/button";
6
- import { AriaDialogProps } from "@react-types/dialog";
7
- import { CalendarProps, RangeCalendarProps } from "@react-types/calendar";
8
- export interface AriaDateFieldOptions<T extends DateValue> extends Omit<AriaDateFieldProps<T>, 'value' | 'defaultValue' | 'onChange' | 'minValue' | 'maxValue' | 'placeholderValue' | 'validate'> {
9
- /** A ref for the hidden input element for HTML form submission. */
10
- inputRef?: RefObject<HTMLInputElement | null>;
11
- }
12
- export interface DateFieldAria extends ValidationResult {
13
- /** Props for the field's visible label element, if any. */
14
- labelProps: DOMAttributes;
15
- /** Props for the field grouping element. */
16
- fieldProps: GroupDOMAttributes;
17
- /** Props for the hidden input element for HTML form submission. */
18
- inputProps: InputHTMLAttributes<HTMLInputElement>;
19
- /** Props for the description element, if any. */
20
- descriptionProps: DOMAttributes;
21
- /** Props for the error message element, if any. */
22
- errorMessageProps: DOMAttributes;
23
- }
24
- /**
25
- * Provides the behavior and accessibility implementation for a date field component.
26
- * A date field allows users to enter and edit date and time values using a keyboard.
27
- * Each part of a date value is displayed in an individually editable segment.
28
- */
29
- export function useDateField<T extends DateValue>(props: AriaDateFieldOptions<T>, state: DateFieldState, ref: RefObject<Element | null>): DateFieldAria;
30
- interface AriaTimeFieldOptions<T extends TimeValue> extends AriaTimeFieldProps<T> {
31
- /** A ref for the hidden input element for HTML form submission. */
32
- inputRef?: RefObject<HTMLInputElement | null>;
33
- }
34
- /**
35
- * Provides the behavior and accessibility implementation for a time field component.
36
- * A time field allows users to enter and edit time values using a keyboard.
37
- * Each part of a time value is displayed in an individually editable segment.
38
- */
39
- export function useTimeField<T extends TimeValue>(props: AriaTimeFieldOptions<T>, state: TimeFieldState, ref: RefObject<Element | null>): DateFieldAria;
40
- export interface DatePickerAria extends ValidationResult {
41
- /** Props for the date picker's visible label element, if any. */
42
- labelProps: DOMAttributes;
43
- /** Props for the grouping element containing the date field and button. */
44
- groupProps: GroupDOMAttributes;
45
- /** Props for the date field. */
46
- fieldProps: AriaDatePickerProps<DateValue>;
47
- /** Props for the popover trigger button. */
48
- buttonProps: AriaButtonProps;
49
- /** Props for the description element, if any. */
50
- descriptionProps: DOMAttributes;
51
- /** Props for the error message element, if any. */
52
- errorMessageProps: DOMAttributes;
53
- /** Props for the popover dialog. */
54
- dialogProps: AriaDialogProps;
55
- /** Props for the calendar within the popover dialog. */
56
- calendarProps: CalendarProps<DateValue>;
57
- }
58
- /**
59
- * Provides the behavior and accessibility implementation for a date picker component.
60
- * A date picker combines a DateField and a Calendar popover to allow users to enter or select a date and time value.
61
- */
62
- export function useDatePicker<T extends DateValue>(props: AriaDatePickerProps<T>, state: DatePickerState, ref: RefObject<Element | null>): DatePickerAria;
63
- type Field = Intl.DateTimeFormatPartTypes;
64
- interface DisplayNames {
65
- of(field: Field): string | undefined;
66
- }
67
- /** @private */
68
- export function useDisplayNames(): DisplayNames;
69
- export interface DateSegmentAria {
70
- /** Props for the segment element. */
71
- segmentProps: React.HTMLAttributes<HTMLDivElement>;
72
- }
73
- /**
74
- * Provides the behavior and accessibility implementation for a segment in a date field.
75
- * A date segment displays an individual unit of a date and time, and allows users to edit
76
- * the value by typing or using the arrow keys to increment and decrement.
77
- */
78
- export function useDateSegment(segment: DateSegment, state: DateFieldState, ref: RefObject<HTMLElement | null>): DateSegmentAria;
79
- export interface DateRangePickerAria extends ValidationResult {
80
- /** Props for the date range picker's visible label element, if any. */
81
- labelProps: DOMAttributes;
82
- /** Props for the grouping element containing the date fields and button. */
83
- groupProps: GroupDOMAttributes;
84
- /** Props for the start date field. */
85
- startFieldProps: AriaDatePickerProps<DateValue>;
86
- /** Props for the end date field. */
87
- endFieldProps: AriaDatePickerProps<DateValue>;
88
- /** Props for the popover trigger button. */
89
- buttonProps: AriaButtonProps;
90
- /** Props for the description element, if any. */
91
- descriptionProps: DOMAttributes;
92
- /** Props for the error message element, if any. */
93
- errorMessageProps: DOMAttributes;
94
- /** Props for the popover dialog. */
95
- dialogProps: AriaDialogProps;
96
- /** Props for the range calendar within the popover dialog. */
97
- calendarProps: RangeCalendarProps<DateValue>;
98
- }
99
- /**
100
- * Provides the behavior and accessibility implementation for a date picker component.
101
- * A date range picker combines two DateFields and a RangeCalendar popover to allow
102
- * users to enter or select a date and time range.
103
- */
104
- export function useDateRangePicker<T extends DateValue>(props: AriaDateRangePickerProps<T>, state: DateRangePickerState, ref: RefObject<Element | null>): DateRangePickerAria;
105
- export type { AriaDateFieldProps, AriaDatePickerProps, AriaDateRangePickerProps, DateRange, DateValue, TimeValue } from '@react-types/datepicker';
106
- export type { AriaTimeFieldProps } from '@react-types/datepicker';
107
-
108
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;AC2BA,sCAAsC,CAAC,SAAS,SAAS,CAAE,SAAQ,IAAI,CAAC,mBAAuB,CAAC,CAAC,EAAE,OAAO,GAAG,cAAc,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,kBAAkB,GAAG,UAAU,CAAC;IACnM,mEAAmE;IACnE,QAAQ,CAAC,EAAE,UAAU,gBAAgB,GAAG,IAAI,CAAC,CAAA;CAC9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Y,EAAC,kBAAkB,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAC,MAAM,yBAAyB,CAAC;AAKhJ,YAAY,EAAC,kBAAkB,EAAC,MAAM,yBAAyB,CAAC","sources":["packages/@react-aria/datepicker/src/packages/@react-aria/datepicker/src/useDatePickerGroup.ts","packages/@react-aria/datepicker/src/packages/@react-aria/datepicker/src/useDateField.ts","packages/@react-aria/datepicker/src/packages/@react-aria/datepicker/src/useDatePicker.ts","packages/@react-aria/datepicker/src/packages/@react-aria/datepicker/src/useDisplayNames.ts","packages/@react-aria/datepicker/src/packages/@react-aria/datepicker/src/useDateSegment.ts","packages/@react-aria/datepicker/src/packages/@react-aria/datepicker/src/useDateRangePicker.ts","packages/@react-aria/datepicker/src/packages/@react-aria/datepicker/src/index.ts","packages/@react-aria/datepicker/src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,"/*\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\nexport {useDatePicker} from './useDatePicker';\nexport {useDateSegment} from './useDateSegment';\nexport {useDateField, useTimeField} from './useDateField';\nexport {useDateRangePicker} from './useDateRangePicker';\nexport {useDisplayNames} from './useDisplayNames';\n\nexport type {AriaDateFieldProps, AriaDatePickerProps, AriaDateRangePickerProps, DateRange, DateValue, TimeValue} from '@react-types/datepicker';\nexport type {AriaDateFieldOptions, DateFieldAria} from './useDateField';\nexport type {DatePickerAria} from './useDatePicker';\nexport type {DateRangePickerAria} from './useDateRangePicker';\nexport type {DateSegmentAria} from './useDateSegment';\nexport type {AriaTimeFieldProps} from '@react-types/datepicker';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
@@ -1,21 +0,0 @@
1
- module.exports = {
2
- "calendar": `\u{41A}\u{430}\u{43B}\u{435}\u{43D}\u{434}\u{430}\u{440}`,
3
- "day": `\u{434}\u{435}\u{43D}\u{44C}`,
4
- "dayPeriod": `\u{434}\u{43F}/\u{43F}\u{43F}`,
5
- "endDate": `\u{414}\u{430}\u{442}\u{430} \u{437}\u{430}\u{432}\u{435}\u{440}\u{448}\u{435}\u{43D}\u{43D}\u{44F}`,
6
- "era": `\u{435}\u{440}\u{430}`,
7
- "hour": `\u{433}\u{43E}\u{434}\u{438}\u{43D}\u{430}`,
8
- "minute": `\u{445}\u{432}\u{438}\u{43B}\u{438}\u{43D}\u{430}`,
9
- "month": `\u{43C}\u{456}\u{441}\u{44F}\u{446}\u{44C}`,
10
- "second": `\u{441}\u{435}\u{43A}\u{443}\u{43D}\u{434}\u{430}`,
11
- "selectedDateDescription": (args)=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{430} \u{434}\u{430}\u{442}\u{430}: ${args.date}`,
12
- "selectedRangeDescription": (args)=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{438}\u{439} \u{434}\u{456}\u{430}\u{43F}\u{430}\u{437}\u{43E}\u{43D}: ${args.startDate} \u{2014} ${args.endDate}`,
13
- "selectedTimeDescription": (args)=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{438}\u{439} \u{447}\u{430}\u{441}: ${args.time}`,
14
- "startDate": `\u{414}\u{430}\u{442}\u{430} \u{43F}\u{43E}\u{447}\u{430}\u{442}\u{43A}\u{443}`,
15
- "timeZoneName": `\u{447}\u{430}\u{441}\u{43E}\u{432}\u{438}\u{439} \u{43F}\u{43E}\u{44F}\u{441}`,
16
- "weekday": `\u{434}\u{435}\u{43D}\u{44C} \u{442}\u{438}\u{436}\u{43D}\u{44F}`,
17
- "year": `\u{440}\u{456}\u{43A}`
18
- };
19
-
20
-
21
- //# sourceMappingURL=uk-UA.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":"AAAA,iBAAiB;IAAG,YAAY,CAAC,wDAAQ,CAAC;IACxC,OAAO,CAAC,4BAAI,CAAC;IACb,aAAa,CAAC,6BAAK,CAAC;IACpB,WAAW,CAAC,mGAAe,CAAC;IAC5B,OAAO,CAAC,qBAAG,CAAC;IACZ,QAAQ,CAAC,0CAAM,CAAC;IAChB,UAAU,CAAC,iDAAO,CAAC;IACnB,SAAS,CAAC,0CAAM,CAAC;IACjB,UAAU,CAAC,iDAAO,CAAC;IACnB,2BAA2B,CAAC,OAAS,CAAC,gFAAc,EAAE,KAAK,IAAI,EAAE;IACjE,4BAA4B,CAAC,OAAS,CAAC,mHAAmB,EAAE,KAAK,SAAS,CAAC,UAAG,EAAE,KAAK,OAAO,EAAE;IAC9F,2BAA2B,CAAC,OAAS,CAAC,gFAAc,EAAE,KAAK,IAAI,EAAE;IACjE,aAAa,CAAC,8EAAY,CAAC;IAC3B,gBAAgB,CAAC,8EAAY,CAAC;IAC9B,WAAW,CAAC,gEAAU,CAAC;IACvB,QAAQ,CAAC,qBAAG,CAAC;AACf","sources":["packages/@react-aria/datepicker/intl/uk-UA.json"],"sourcesContent":["{\n \"calendar\": \"Календар\",\n \"day\": \"день\",\n \"dayPeriod\": \"дп/пп\",\n \"endDate\": \"Дата завершення\",\n \"era\": \"ера\",\n \"hour\": \"година\",\n \"minute\": \"хвилина\",\n \"month\": \"місяць\",\n \"second\": \"секунда\",\n \"selectedDateDescription\": \"Вибрана дата: {date}\",\n \"selectedRangeDescription\": \"Вибраний діапазон: {startDate} — {endDate}\",\n \"selectedTimeDescription\": \"Вибраний час: {time}\",\n \"startDate\": \"Дата початку\",\n \"timeZoneName\": \"часовий пояс\",\n \"weekday\": \"день тижня\",\n \"year\": \"рік\"\n}\n"],"names":[],"version":3,"file":"uk-UA.main.js.map"}
package/dist/uk-UA.mjs DELETED
@@ -1,23 +0,0 @@
1
- var $5ba21dbb8914919d$exports = {};
2
- $5ba21dbb8914919d$exports = {
3
- "calendar": `\u{41A}\u{430}\u{43B}\u{435}\u{43D}\u{434}\u{430}\u{440}`,
4
- "day": `\u{434}\u{435}\u{43D}\u{44C}`,
5
- "dayPeriod": `\u{434}\u{43F}/\u{43F}\u{43F}`,
6
- "endDate": `\u{414}\u{430}\u{442}\u{430} \u{437}\u{430}\u{432}\u{435}\u{440}\u{448}\u{435}\u{43D}\u{43D}\u{44F}`,
7
- "era": `\u{435}\u{440}\u{430}`,
8
- "hour": `\u{433}\u{43E}\u{434}\u{438}\u{43D}\u{430}`,
9
- "minute": `\u{445}\u{432}\u{438}\u{43B}\u{438}\u{43D}\u{430}`,
10
- "month": `\u{43C}\u{456}\u{441}\u{44F}\u{446}\u{44C}`,
11
- "second": `\u{441}\u{435}\u{43A}\u{443}\u{43D}\u{434}\u{430}`,
12
- "selectedDateDescription": (args)=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{430} \u{434}\u{430}\u{442}\u{430}: ${args.date}`,
13
- "selectedRangeDescription": (args)=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{438}\u{439} \u{434}\u{456}\u{430}\u{43F}\u{430}\u{437}\u{43E}\u{43D}: ${args.startDate} \u{2014} ${args.endDate}`,
14
- "selectedTimeDescription": (args)=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{438}\u{439} \u{447}\u{430}\u{441}: ${args.time}`,
15
- "startDate": `\u{414}\u{430}\u{442}\u{430} \u{43F}\u{43E}\u{447}\u{430}\u{442}\u{43A}\u{443}`,
16
- "timeZoneName": `\u{447}\u{430}\u{441}\u{43E}\u{432}\u{438}\u{439} \u{43F}\u{43E}\u{44F}\u{441}`,
17
- "weekday": `\u{434}\u{435}\u{43D}\u{44C} \u{442}\u{438}\u{436}\u{43D}\u{44F}`,
18
- "year": `\u{440}\u{456}\u{43A}`
19
- };
20
-
21
-
22
- export {$5ba21dbb8914919d$exports as default};
23
- //# sourceMappingURL=uk-UA.module.js.map
@@ -1,23 +0,0 @@
1
- var $5ba21dbb8914919d$exports = {};
2
- $5ba21dbb8914919d$exports = {
3
- "calendar": `\u{41A}\u{430}\u{43B}\u{435}\u{43D}\u{434}\u{430}\u{440}`,
4
- "day": `\u{434}\u{435}\u{43D}\u{44C}`,
5
- "dayPeriod": `\u{434}\u{43F}/\u{43F}\u{43F}`,
6
- "endDate": `\u{414}\u{430}\u{442}\u{430} \u{437}\u{430}\u{432}\u{435}\u{440}\u{448}\u{435}\u{43D}\u{43D}\u{44F}`,
7
- "era": `\u{435}\u{440}\u{430}`,
8
- "hour": `\u{433}\u{43E}\u{434}\u{438}\u{43D}\u{430}`,
9
- "minute": `\u{445}\u{432}\u{438}\u{43B}\u{438}\u{43D}\u{430}`,
10
- "month": `\u{43C}\u{456}\u{441}\u{44F}\u{446}\u{44C}`,
11
- "second": `\u{441}\u{435}\u{43A}\u{443}\u{43D}\u{434}\u{430}`,
12
- "selectedDateDescription": (args)=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{430} \u{434}\u{430}\u{442}\u{430}: ${args.date}`,
13
- "selectedRangeDescription": (args)=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{438}\u{439} \u{434}\u{456}\u{430}\u{43F}\u{430}\u{437}\u{43E}\u{43D}: ${args.startDate} \u{2014} ${args.endDate}`,
14
- "selectedTimeDescription": (args)=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{438}\u{439} \u{447}\u{430}\u{441}: ${args.time}`,
15
- "startDate": `\u{414}\u{430}\u{442}\u{430} \u{43F}\u{43E}\u{447}\u{430}\u{442}\u{43A}\u{443}`,
16
- "timeZoneName": `\u{447}\u{430}\u{441}\u{43E}\u{432}\u{438}\u{439} \u{43F}\u{43E}\u{44F}\u{441}`,
17
- "weekday": `\u{434}\u{435}\u{43D}\u{44C} \u{442}\u{438}\u{436}\u{43D}\u{44F}`,
18
- "year": `\u{440}\u{456}\u{43A}`
19
- };
20
-
21
-
22
- export {$5ba21dbb8914919d$exports as default};
23
- //# sourceMappingURL=uk-UA.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";AAAA,4BAAiB;IAAG,YAAY,CAAC,wDAAQ,CAAC;IACxC,OAAO,CAAC,4BAAI,CAAC;IACb,aAAa,CAAC,6BAAK,CAAC;IACpB,WAAW,CAAC,mGAAe,CAAC;IAC5B,OAAO,CAAC,qBAAG,CAAC;IACZ,QAAQ,CAAC,0CAAM,CAAC;IAChB,UAAU,CAAC,iDAAO,CAAC;IACnB,SAAS,CAAC,0CAAM,CAAC;IACjB,UAAU,CAAC,iDAAO,CAAC;IACnB,2BAA2B,CAAC,OAAS,CAAC,gFAAc,EAAE,KAAK,IAAI,EAAE;IACjE,4BAA4B,CAAC,OAAS,CAAC,mHAAmB,EAAE,KAAK,SAAS,CAAC,UAAG,EAAE,KAAK,OAAO,EAAE;IAC9F,2BAA2B,CAAC,OAAS,CAAC,gFAAc,EAAE,KAAK,IAAI,EAAE;IACjE,aAAa,CAAC,8EAAY,CAAC;IAC3B,gBAAgB,CAAC,8EAAY,CAAC;IAC9B,WAAW,CAAC,gEAAU,CAAC;IACvB,QAAQ,CAAC,qBAAG,CAAC;AACf","sources":["packages/@react-aria/datepicker/intl/uk-UA.json"],"sourcesContent":["{\n \"calendar\": \"Календар\",\n \"day\": \"день\",\n \"dayPeriod\": \"дп/пп\",\n \"endDate\": \"Дата завершення\",\n \"era\": \"ера\",\n \"hour\": \"година\",\n \"minute\": \"хвилина\",\n \"month\": \"місяць\",\n \"second\": \"секунда\",\n \"selectedDateDescription\": \"Вибрана дата: {date}\",\n \"selectedRangeDescription\": \"Вибраний діапазон: {startDate} — {endDate}\",\n \"selectedTimeDescription\": \"Вибраний час: {time}\",\n \"startDate\": \"Дата початку\",\n \"timeZoneName\": \"часовий пояс\",\n \"weekday\": \"день тижня\",\n \"year\": \"рік\"\n}\n"],"names":[],"version":3,"file":"uk-UA.module.js.map"}
@@ -1,181 +0,0 @@
1
- var $c1905b78f6d2f5bf$exports = require("./intlStrings.main.js");
2
- var $715562ad3b4cced4$exports = require("./useDatePickerGroup.main.js");
3
- var $lVMtq$reactariafocus = require("@react-aria/focus");
4
- var $lVMtq$reactariautils = require("@react-aria/utils");
5
- var $lVMtq$react = require("react");
6
- var $lVMtq$reactarialabel = require("@react-aria/label");
7
- var $lVMtq$reactariainteractions = require("@react-aria/interactions");
8
- var $lVMtq$reactariaform = require("@react-aria/form");
9
- var $lVMtq$reactariai18n = require("@react-aria/i18n");
10
-
11
-
12
- function $parcel$interopDefault(a) {
13
- return a && a.__esModule ? a.default : a;
14
- }
15
-
16
- function $parcel$export(e, n, v, s) {
17
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
18
- }
19
-
20
- $parcel$export(module.exports, "hookData", () => $4acc2f407c169e55$export$653eddfc964b0f8a);
21
- $parcel$export(module.exports, "roleSymbol", () => $4acc2f407c169e55$export$300019f83c56d282);
22
- $parcel$export(module.exports, "focusManagerSymbol", () => $4acc2f407c169e55$export$7b3062cd49e80452);
23
- $parcel$export(module.exports, "useDateField", () => $4acc2f407c169e55$export$5591b0b878c1a989);
24
- $parcel$export(module.exports, "useTimeField", () => $4acc2f407c169e55$export$4c842f6a241dc825);
25
- /*
26
- * Copyright 2020 Adobe. All rights reserved.
27
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
28
- * you may not use this file except in compliance with the License. You may obtain a copy
29
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
30
- *
31
- * Unless required by applicable law or agreed to in writing, software distributed under
32
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
33
- * OF ANY KIND, either express or implied. See the License for the specific language
34
- * governing permissions and limitations under the License.
35
- */
36
-
37
-
38
-
39
-
40
-
41
-
42
-
43
-
44
- const $4acc2f407c169e55$export$653eddfc964b0f8a = new WeakMap();
45
- const $4acc2f407c169e55$export$300019f83c56d282 = '__role_' + Date.now();
46
- const $4acc2f407c169e55$export$7b3062cd49e80452 = '__focusManager_' + Date.now();
47
- function $4acc2f407c169e55$export$5591b0b878c1a989(props, state, ref) {
48
- var _state_value;
49
- let { isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = state.displayValidation;
50
- let { labelProps: labelProps, fieldProps: fieldProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps } = (0, $lVMtq$reactarialabel.useField)({
51
- ...props,
52
- labelElementType: 'span',
53
- isInvalid: isInvalid,
54
- errorMessage: props.errorMessage || validationErrors
55
- });
56
- let valueOnFocus = (0, $lVMtq$react.useRef)(null);
57
- let { focusWithinProps: focusWithinProps } = (0, $lVMtq$reactariainteractions.useFocusWithin)({
58
- ...props,
59
- onFocusWithin (e) {
60
- var _props_onFocus;
61
- valueOnFocus.current = state.value;
62
- (_props_onFocus = props.onFocus) === null || _props_onFocus === void 0 ? void 0 : _props_onFocus.call(props, e);
63
- },
64
- onBlurWithin: (e)=>{
65
- var _props_onBlur;
66
- state.confirmPlaceholder();
67
- if (state.value !== valueOnFocus.current) state.commitValidation();
68
- (_props_onBlur = props.onBlur) === null || _props_onBlur === void 0 ? void 0 : _props_onBlur.call(props, e);
69
- },
70
- onFocusWithinChange: props.onFocusChange
71
- });
72
- let stringFormatter = (0, $lVMtq$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($c1905b78f6d2f5bf$exports))), '@react-aria/datepicker');
73
- let message = state.maxGranularity === 'hour' ? 'selectedTimeDescription' : 'selectedDateDescription';
74
- let field = state.maxGranularity === 'hour' ? 'time' : 'date';
75
- let description = state.value ? stringFormatter.format(message, {
76
- [field]: state.formatValue({
77
- month: 'long'
78
- })
79
- }) : '';
80
- let descProps = (0, $lVMtq$reactariautils.useDescription)(description);
81
- // If within a date picker or date range picker, the date field will have role="presentation" and an aria-describedby
82
- // will be passed in that references the value (e.g. entire range). Otherwise, add the field's value description.
83
- let describedBy = props[$4acc2f407c169e55$export$300019f83c56d282] === 'presentation' ? fieldProps['aria-describedby'] : [
84
- descProps['aria-describedby'],
85
- fieldProps['aria-describedby']
86
- ].filter(Boolean).join(' ') || undefined;
87
- let propsFocusManager = props[$4acc2f407c169e55$export$7b3062cd49e80452];
88
- let focusManager = (0, $lVMtq$react.useMemo)(()=>propsFocusManager || (0, $lVMtq$reactariafocus.createFocusManager)(ref), [
89
- propsFocusManager,
90
- ref
91
- ]);
92
- let groupProps = (0, $715562ad3b4cced4$exports.useDatePickerGroup)(state, ref, props[$4acc2f407c169e55$export$300019f83c56d282] === 'presentation');
93
- // Pass labels and other information to segments.
94
- $4acc2f407c169e55$export$653eddfc964b0f8a.set(state, {
95
- ariaLabel: props['aria-label'],
96
- ariaLabelledBy: [
97
- labelProps.id,
98
- props['aria-labelledby']
99
- ].filter(Boolean).join(' ') || undefined,
100
- ariaDescribedBy: describedBy,
101
- focusManager: focusManager
102
- });
103
- let autoFocusRef = (0, $lVMtq$react.useRef)(props.autoFocus);
104
- // When used within a date picker or date range picker, the field gets role="presentation"
105
- // rather than role="group". Since the date picker/date range picker already has a role="group"
106
- // with a label and description, and the segments are already labeled by this as well, this
107
- // avoids very verbose duplicate announcements.
108
- let fieldDOMProps;
109
- if (props[$4acc2f407c169e55$export$300019f83c56d282] === 'presentation') fieldDOMProps = {
110
- role: 'presentation'
111
- };
112
- else fieldDOMProps = (0, $lVMtq$reactariautils.mergeProps)(fieldProps, {
113
- role: 'group',
114
- 'aria-disabled': props.isDisabled || undefined,
115
- 'aria-describedby': describedBy
116
- });
117
- (0, $lVMtq$react.useEffect)(()=>{
118
- if (autoFocusRef.current) focusManager.focusFirst();
119
- autoFocusRef.current = false;
120
- }, [
121
- focusManager
122
- ]);
123
- (0, $lVMtq$reactariautils.useFormReset)(props.inputRef, state.defaultValue, state.setValue);
124
- (0, $lVMtq$reactariaform.useFormValidation)({
125
- ...props,
126
- focus () {
127
- focusManager.focusFirst();
128
- }
129
- }, state, props.inputRef);
130
- let inputProps = {
131
- type: 'hidden',
132
- name: props.name,
133
- form: props.form,
134
- value: ((_state_value = state.value) === null || _state_value === void 0 ? void 0 : _state_value.toString()) || '',
135
- disabled: props.isDisabled
136
- };
137
- if (props.validationBehavior === 'native') {
138
- // Use a hidden <input type="text"> rather than <input type="hidden">
139
- // so that an empty value blocks HTML form submission when the field is required.
140
- inputProps.type = 'text';
141
- inputProps.hidden = true;
142
- inputProps.required = props.isRequired;
143
- // Ignore react warning.
144
- inputProps.onChange = ()=>{};
145
- }
146
- let domProps = (0, $lVMtq$reactariautils.filterDOMProps)(props);
147
- return {
148
- labelProps: {
149
- ...labelProps,
150
- onClick: ()=>{
151
- focusManager.focusFirst();
152
- }
153
- },
154
- fieldProps: (0, $lVMtq$reactariautils.mergeProps)(domProps, fieldDOMProps, groupProps, focusWithinProps, {
155
- onKeyDown (e) {
156
- if (props.onKeyDown) props.onKeyDown(e);
157
- },
158
- onKeyUp (e) {
159
- if (props.onKeyUp) props.onKeyUp(e);
160
- },
161
- style: {
162
- unicodeBidi: 'isolate'
163
- }
164
- }),
165
- inputProps: inputProps,
166
- descriptionProps: descriptionProps,
167
- errorMessageProps: errorMessageProps,
168
- isInvalid: isInvalid,
169
- validationErrors: validationErrors,
170
- validationDetails: validationDetails
171
- };
172
- }
173
- function $4acc2f407c169e55$export$4c842f6a241dc825(props, state, ref) {
174
- var _state_timeValue;
175
- let res = $4acc2f407c169e55$export$5591b0b878c1a989(props, state, ref);
176
- res.inputProps.value = ((_state_timeValue = state.timeValue) === null || _state_timeValue === void 0 ? void 0 : _state_timeValue.toString()) || '';
177
- return res;
178
- }
179
-
180
-
181
- //# sourceMappingURL=useDateField.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AA2CM,MAAM,4CAA8C,IAAI;AAIxD,MAAM,4CAAqB,YAAY,KAAK,GAAG;AAC/C,MAAM,4CAA6B,oBAAoB,KAAK,GAAG;AAO/D,SAAS,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AAI;QAChB,OAAO,EAAA,eAAA,MAAM,KAAK,cAAX,mCAAA,aAAa,QAAQ,OAAM;QAClC,UAAU,MAAM,UAAU;IAC5B;IAEA,IAAI,MAAM,kBAAkB,KAAK,UAAU;QACzC,qEAAqE;QACrE,iFAAiF;QACjF,WAAW,IAAI,GAAG;QAClB,WAAW,MAAM,GAAG;QACpB,WAAW,QAAQ,GAAG,MAAM,UAAU;QACtC,wBAAwB;QACxB,WAAW,QAAQ,GAAG,KAAO;IAC/B;IAEA,IAAI,WAAW,CAAA,GAAA,oCAAa,EAAE;IAC9B,OAAO;QACL,YAAY;YACV,GAAG,UAAU;YACb,SAAS;gBACP,aAAa,UAAU;YACzB;QACF;QACA,YAAY,CAAA,GAAA,gCAAS,EAAE,UAAU,eAAe,YAAY,kBAAkB;YAC5E,WAAU,CAAgB;gBACxB,IAAI,MAAM,SAAS,EACjB,MAAM,SAAS,CAAC;YAEpB;YACA,SAAQ,CAAgB;gBACtB,IAAI,MAAM,OAAO,EACf,MAAM,OAAO,CAAC;YAElB;YACA,OAAO;gBACL,aAAa;YACf;QACF;oBACA;0BACA;2BACA;mBACA;0BACA;2BACA;IACF;AACF;AAYO,SAAS,0CAAkC,KAA8B,EAAE,KAAqB,EAAE,GAA8B;QAE9G;IADvB,IAAI,MAAM,0CAAa,OAAO,OAAO;IACrC,IAAI,UAAU,CAAC,KAAK,GAAG,EAAA,mBAAA,MAAM,SAAS,cAAf,uCAAA,iBAAiB,QAAQ,OAAM;IACtD,OAAO;AACT","sources":["packages/@react-aria/datepicker/src/useDateField.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 {AriaDateFieldProps as AriaDateFieldPropsBase, AriaTimeFieldProps, DateValue, TimeValue} from '@react-types/datepicker';\nimport {createFocusManager, FocusManager} from '@react-aria/focus';\nimport {DateFieldState, TimeFieldState} from '@react-stately/datepicker';\nimport {DOMAttributes, GroupDOMAttributes, KeyboardEvent, RefObject, ValidationResult} from '@react-types/shared';\nimport {filterDOMProps, mergeProps, useDescription, useFormReset} from '@react-aria/utils';\nimport {InputHTMLAttributes, useEffect, useMemo, useRef} from 'react';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {useDatePickerGroup} from './useDatePickerGroup';\nimport {useField} from '@react-aria/label';\nimport {useFocusWithin} from '@react-aria/interactions';\nimport {useFormValidation} from '@react-aria/form';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\n// Allows this hook to also be used with TimeField\nexport interface AriaDateFieldOptions<T extends DateValue> extends Omit<AriaDateFieldPropsBase<T>, 'value' | 'defaultValue' | 'onChange' | 'minValue' | 'maxValue' | 'placeholderValue' | 'validate'> {\n /** A ref for the hidden input element for HTML form submission. */\n inputRef?: RefObject<HTMLInputElement | null>\n}\n\nexport interface DateFieldAria extends ValidationResult {\n /** Props for the field's visible label element, if any. */\n labelProps: DOMAttributes,\n /** Props for the field grouping element. */\n fieldProps: GroupDOMAttributes,\n /** Props for the hidden input element for HTML form submission. */\n inputProps: InputHTMLAttributes<HTMLInputElement>,\n /** Props for the description element, if any. */\n descriptionProps: DOMAttributes,\n /** Props for the error message element, if any. */\n errorMessageProps: DOMAttributes\n}\n\n// Data that is passed between useDateField and useDateSegment.\ninterface HookData {\n ariaLabel?: string,\n ariaLabelledBy?: string,\n ariaDescribedBy?: string,\n focusManager: FocusManager\n}\n\nexport const hookData: WeakMap<DateFieldState, HookData> = new WeakMap<DateFieldState, HookData>();\n\n// Private props that we pass from useDatePicker/useDateRangePicker.\n// Ideally we'd use a Symbol for this, but React doesn't support them: https://github.com/facebook/react/issues/7552\nexport const roleSymbol: string = '__role_' + Date.now();\nexport const focusManagerSymbol: string = '__focusManager_' + Date.now();\n\n/**\n * Provides the behavior and accessibility implementation for a date field component.\n * A date field allows users to enter and edit date and time values using a keyboard.\n * Each part of a date value is displayed in an individually editable segment.\n */\nexport function useDateField<T extends DateValue>(props: AriaDateFieldOptions<T>, state: DateFieldState, ref: RefObject<Element | null>): DateFieldAria {\n let {isInvalid, validationErrors, validationDetails} = state.displayValidation;\n let {labelProps, fieldProps, descriptionProps, errorMessageProps} = useField({\n ...props,\n labelElementType: 'span',\n isInvalid,\n errorMessage: props.errorMessage || validationErrors\n });\n\n let valueOnFocus = useRef<DateValue | null>(null);\n let {focusWithinProps} = useFocusWithin({\n ...props,\n onFocusWithin(e) {\n valueOnFocus.current = state.value;\n props.onFocus?.(e);\n },\n onBlurWithin: (e) => {\n state.confirmPlaceholder();\n if (state.value !== valueOnFocus.current) {\n state.commitValidation();\n }\n props.onBlur?.(e);\n },\n onFocusWithinChange: props.onFocusChange\n });\n\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/datepicker');\n let message = state.maxGranularity === 'hour' ? 'selectedTimeDescription' : 'selectedDateDescription';\n let field = state.maxGranularity === 'hour' ? 'time' : 'date';\n let description = state.value ? stringFormatter.format(message, {[field]: state.formatValue({month: 'long'})}) : '';\n let descProps = useDescription(description);\n\n // If within a date picker or date range picker, the date field will have role=\"presentation\" and an aria-describedby\n // will be passed in that references the value (e.g. entire range). Otherwise, add the field's value description.\n let describedBy = props[roleSymbol] === 'presentation'\n ? fieldProps['aria-describedby']\n : [descProps['aria-describedby'], fieldProps['aria-describedby']].filter(Boolean).join(' ') || undefined;\n let propsFocusManager = props[focusManagerSymbol];\n let focusManager = useMemo(() => propsFocusManager || createFocusManager(ref), [propsFocusManager, ref]);\n let groupProps = useDatePickerGroup(state, ref, props[roleSymbol] === 'presentation');\n\n // Pass labels and other information to segments.\n hookData.set(state, {\n ariaLabel: props['aria-label'],\n ariaLabelledBy: [labelProps.id, props['aria-labelledby']].filter(Boolean).join(' ') || undefined,\n ariaDescribedBy: describedBy,\n focusManager\n });\n\n let autoFocusRef = useRef(props.autoFocus);\n\n // When used within a date picker or date range picker, the field gets role=\"presentation\"\n // rather than role=\"group\". Since the date picker/date range picker already has a role=\"group\"\n // with a label and description, and the segments are already labeled by this as well, this\n // avoids very verbose duplicate announcements.\n let fieldDOMProps: GroupDOMAttributes;\n if (props[roleSymbol] === 'presentation') {\n fieldDOMProps = {\n role: 'presentation'\n };\n } else {\n fieldDOMProps = mergeProps(fieldProps, {\n role: 'group' as const,\n 'aria-disabled': props.isDisabled || undefined,\n 'aria-describedby': describedBy\n });\n }\n\n useEffect(() => {\n if (autoFocusRef.current) {\n focusManager.focusFirst();\n }\n autoFocusRef.current = false;\n }, [focusManager]);\n\n useFormReset(props.inputRef, state.defaultValue, state.setValue);\n useFormValidation({\n ...props,\n focus() {\n focusManager.focusFirst();\n }\n }, state, props.inputRef);\n\n let inputProps: InputHTMLAttributes<HTMLInputElement> = {\n type: 'hidden',\n name: props.name,\n form: props.form,\n value: state.value?.toString() || '',\n disabled: props.isDisabled\n };\n\n if (props.validationBehavior === 'native') {\n // Use a hidden <input type=\"text\"> rather than <input type=\"hidden\">\n // so that an empty value blocks HTML form submission when the field is required.\n inputProps.type = 'text';\n inputProps.hidden = true;\n inputProps.required = props.isRequired;\n // Ignore react warning.\n inputProps.onChange = () => {};\n }\n\n let domProps = filterDOMProps(props);\n return {\n labelProps: {\n ...labelProps,\n onClick: () => {\n focusManager.focusFirst();\n }\n },\n fieldProps: mergeProps(domProps, fieldDOMProps, groupProps, focusWithinProps, {\n onKeyDown(e: KeyboardEvent) {\n if (props.onKeyDown) {\n props.onKeyDown(e);\n }\n },\n onKeyUp(e: KeyboardEvent) {\n if (props.onKeyUp) {\n props.onKeyUp(e);\n }\n },\n style: {\n unicodeBidi: 'isolate'\n }\n }),\n inputProps,\n descriptionProps,\n errorMessageProps,\n isInvalid,\n validationErrors,\n validationDetails\n };\n}\n\nexport interface AriaTimeFieldOptions<T extends TimeValue> extends AriaTimeFieldProps<T> {\n /** A ref for the hidden input element for HTML form submission. */\n inputRef?: RefObject<HTMLInputElement | null>\n}\n\n/**\n * Provides the behavior and accessibility implementation for a time field component.\n * A time field allows users to enter and edit time values using a keyboard.\n * Each part of a time value is displayed in an individually editable segment.\n */\nexport function useTimeField<T extends TimeValue>(props: AriaTimeFieldOptions<T>, state: TimeFieldState, ref: RefObject<Element | null>): DateFieldAria {\n let res = useDateField(props, state, ref);\n res.inputProps.value = state.timeValue?.toString() || '';\n return res;\n}\n"],"names":[],"version":3,"file":"useDateField.main.js.map"}
@@ -1,172 +0,0 @@
1
- import $7Gzdi$intlStringsmodulejs from "./intlStrings.mjs";
2
- import {useDatePickerGroup as $3dfb0f96be0d6a08$export$4a931266a3838b86} from "./useDatePickerGroup.mjs";
3
- import {createFocusManager as $7Gzdi$createFocusManager} from "@react-aria/focus";
4
- import {useDescription as $7Gzdi$useDescription, mergeProps as $7Gzdi$mergeProps, useFormReset as $7Gzdi$useFormReset, filterDOMProps as $7Gzdi$filterDOMProps} from "@react-aria/utils";
5
- import {useRef as $7Gzdi$useRef, useMemo as $7Gzdi$useMemo, useEffect as $7Gzdi$useEffect} from "react";
6
- import {useField as $7Gzdi$useField} from "@react-aria/label";
7
- import {useFocusWithin as $7Gzdi$useFocusWithin} from "@react-aria/interactions";
8
- import {useFormValidation as $7Gzdi$useFormValidation} from "@react-aria/form";
9
- import {useLocalizedStringFormatter as $7Gzdi$useLocalizedStringFormatter} from "@react-aria/i18n";
10
-
11
-
12
- function $parcel$interopDefault(a) {
13
- return a && a.__esModule ? a.default : a;
14
- }
15
- /*
16
- * Copyright 2020 Adobe. All rights reserved.
17
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
18
- * you may not use this file except in compliance with the License. You may obtain a copy
19
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
20
- *
21
- * Unless required by applicable law or agreed to in writing, software distributed under
22
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
23
- * OF ANY KIND, either express or implied. See the License for the specific language
24
- * governing permissions and limitations under the License.
25
- */
26
-
27
-
28
-
29
-
30
-
31
-
32
-
33
-
34
- const $16f0b7bb276bc17e$export$653eddfc964b0f8a = new WeakMap();
35
- const $16f0b7bb276bc17e$export$300019f83c56d282 = '__role_' + Date.now();
36
- const $16f0b7bb276bc17e$export$7b3062cd49e80452 = '__focusManager_' + Date.now();
37
- function $16f0b7bb276bc17e$export$5591b0b878c1a989(props, state, ref) {
38
- var _state_value;
39
- let { isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = state.displayValidation;
40
- let { labelProps: labelProps, fieldProps: fieldProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps } = (0, $7Gzdi$useField)({
41
- ...props,
42
- labelElementType: 'span',
43
- isInvalid: isInvalid,
44
- errorMessage: props.errorMessage || validationErrors
45
- });
46
- let valueOnFocus = (0, $7Gzdi$useRef)(null);
47
- let { focusWithinProps: focusWithinProps } = (0, $7Gzdi$useFocusWithin)({
48
- ...props,
49
- onFocusWithin (e) {
50
- var _props_onFocus;
51
- valueOnFocus.current = state.value;
52
- (_props_onFocus = props.onFocus) === null || _props_onFocus === void 0 ? void 0 : _props_onFocus.call(props, e);
53
- },
54
- onBlurWithin: (e)=>{
55
- var _props_onBlur;
56
- state.confirmPlaceholder();
57
- if (state.value !== valueOnFocus.current) state.commitValidation();
58
- (_props_onBlur = props.onBlur) === null || _props_onBlur === void 0 ? void 0 : _props_onBlur.call(props, e);
59
- },
60
- onFocusWithinChange: props.onFocusChange
61
- });
62
- let stringFormatter = (0, $7Gzdi$useLocalizedStringFormatter)((0, ($parcel$interopDefault($7Gzdi$intlStringsmodulejs))), '@react-aria/datepicker');
63
- let message = state.maxGranularity === 'hour' ? 'selectedTimeDescription' : 'selectedDateDescription';
64
- let field = state.maxGranularity === 'hour' ? 'time' : 'date';
65
- let description = state.value ? stringFormatter.format(message, {
66
- [field]: state.formatValue({
67
- month: 'long'
68
- })
69
- }) : '';
70
- let descProps = (0, $7Gzdi$useDescription)(description);
71
- // If within a date picker or date range picker, the date field will have role="presentation" and an aria-describedby
72
- // will be passed in that references the value (e.g. entire range). Otherwise, add the field's value description.
73
- let describedBy = props[$16f0b7bb276bc17e$export$300019f83c56d282] === 'presentation' ? fieldProps['aria-describedby'] : [
74
- descProps['aria-describedby'],
75
- fieldProps['aria-describedby']
76
- ].filter(Boolean).join(' ') || undefined;
77
- let propsFocusManager = props[$16f0b7bb276bc17e$export$7b3062cd49e80452];
78
- let focusManager = (0, $7Gzdi$useMemo)(()=>propsFocusManager || (0, $7Gzdi$createFocusManager)(ref), [
79
- propsFocusManager,
80
- ref
81
- ]);
82
- let groupProps = (0, $3dfb0f96be0d6a08$export$4a931266a3838b86)(state, ref, props[$16f0b7bb276bc17e$export$300019f83c56d282] === 'presentation');
83
- // Pass labels and other information to segments.
84
- $16f0b7bb276bc17e$export$653eddfc964b0f8a.set(state, {
85
- ariaLabel: props['aria-label'],
86
- ariaLabelledBy: [
87
- labelProps.id,
88
- props['aria-labelledby']
89
- ].filter(Boolean).join(' ') || undefined,
90
- ariaDescribedBy: describedBy,
91
- focusManager: focusManager
92
- });
93
- let autoFocusRef = (0, $7Gzdi$useRef)(props.autoFocus);
94
- // When used within a date picker or date range picker, the field gets role="presentation"
95
- // rather than role="group". Since the date picker/date range picker already has a role="group"
96
- // with a label and description, and the segments are already labeled by this as well, this
97
- // avoids very verbose duplicate announcements.
98
- let fieldDOMProps;
99
- if (props[$16f0b7bb276bc17e$export$300019f83c56d282] === 'presentation') fieldDOMProps = {
100
- role: 'presentation'
101
- };
102
- else fieldDOMProps = (0, $7Gzdi$mergeProps)(fieldProps, {
103
- role: 'group',
104
- 'aria-disabled': props.isDisabled || undefined,
105
- 'aria-describedby': describedBy
106
- });
107
- (0, $7Gzdi$useEffect)(()=>{
108
- if (autoFocusRef.current) focusManager.focusFirst();
109
- autoFocusRef.current = false;
110
- }, [
111
- focusManager
112
- ]);
113
- (0, $7Gzdi$useFormReset)(props.inputRef, state.defaultValue, state.setValue);
114
- (0, $7Gzdi$useFormValidation)({
115
- ...props,
116
- focus () {
117
- focusManager.focusFirst();
118
- }
119
- }, state, props.inputRef);
120
- let inputProps = {
121
- type: 'hidden',
122
- name: props.name,
123
- form: props.form,
124
- value: ((_state_value = state.value) === null || _state_value === void 0 ? void 0 : _state_value.toString()) || '',
125
- disabled: props.isDisabled
126
- };
127
- if (props.validationBehavior === 'native') {
128
- // Use a hidden <input type="text"> rather than <input type="hidden">
129
- // so that an empty value blocks HTML form submission when the field is required.
130
- inputProps.type = 'text';
131
- inputProps.hidden = true;
132
- inputProps.required = props.isRequired;
133
- // Ignore react warning.
134
- inputProps.onChange = ()=>{};
135
- }
136
- let domProps = (0, $7Gzdi$filterDOMProps)(props);
137
- return {
138
- labelProps: {
139
- ...labelProps,
140
- onClick: ()=>{
141
- focusManager.focusFirst();
142
- }
143
- },
144
- fieldProps: (0, $7Gzdi$mergeProps)(domProps, fieldDOMProps, groupProps, focusWithinProps, {
145
- onKeyDown (e) {
146
- if (props.onKeyDown) props.onKeyDown(e);
147
- },
148
- onKeyUp (e) {
149
- if (props.onKeyUp) props.onKeyUp(e);
150
- },
151
- style: {
152
- unicodeBidi: 'isolate'
153
- }
154
- }),
155
- inputProps: inputProps,
156
- descriptionProps: descriptionProps,
157
- errorMessageProps: errorMessageProps,
158
- isInvalid: isInvalid,
159
- validationErrors: validationErrors,
160
- validationDetails: validationDetails
161
- };
162
- }
163
- function $16f0b7bb276bc17e$export$4c842f6a241dc825(props, state, ref) {
164
- var _state_timeValue;
165
- let res = $16f0b7bb276bc17e$export$5591b0b878c1a989(props, state, ref);
166
- res.inputProps.value = ((_state_timeValue = state.timeValue) === null || _state_timeValue === void 0 ? void 0 : _state_timeValue.toString()) || '';
167
- return res;
168
- }
169
-
170
-
171
- export {$16f0b7bb276bc17e$export$653eddfc964b0f8a as hookData, $16f0b7bb276bc17e$export$300019f83c56d282 as roleSymbol, $16f0b7bb276bc17e$export$7b3062cd49e80452 as focusManagerSymbol, $16f0b7bb276bc17e$export$5591b0b878c1a989 as useDateField, $16f0b7bb276bc17e$export$4c842f6a241dc825 as useTimeField};
172
- //# sourceMappingURL=useDateField.module.js.map