@react-spectrum/datepicker 3.14.10 → 3.15.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 (255) hide show
  1. package/dist/import.mjs +5 -5
  2. package/dist/main.js +8 -8
  3. package/dist/main.js.map +1 -1
  4. package/dist/module.js +5 -5
  5. package/dist/module.js.map +1 -1
  6. package/dist/types/src/index.d.ts +8 -0
  7. package/package.json +12 -44
  8. package/src/index.ts +9 -5
  9. package/dist/DateField.main.js +0 -108
  10. package/dist/DateField.main.js.map +0 -1
  11. package/dist/DateField.mjs +0 -103
  12. package/dist/DateField.module.js +0 -103
  13. package/dist/DateField.module.js.map +0 -1
  14. package/dist/DatePicker.main.js +0 -197
  15. package/dist/DatePicker.main.js.map +0 -1
  16. package/dist/DatePicker.mjs +0 -192
  17. package/dist/DatePicker.module.js +0 -192
  18. package/dist/DatePicker.module.js.map +0 -1
  19. package/dist/DatePickerField.main.js +0 -72
  20. package/dist/DatePickerField.main.js.map +0 -1
  21. package/dist/DatePickerField.mjs +0 -67
  22. package/dist/DatePickerField.module.js +0 -67
  23. package/dist/DatePickerField.module.js.map +0 -1
  24. package/dist/DatePickerSegment.main.js +0 -73
  25. package/dist/DatePickerSegment.main.js.map +0 -1
  26. package/dist/DatePickerSegment.mjs +0 -68
  27. package/dist/DatePickerSegment.module.js +0 -68
  28. package/dist/DatePickerSegment.module.js.map +0 -1
  29. package/dist/DateRangePicker.main.js +0 -229
  30. package/dist/DateRangePicker.main.js.map +0 -1
  31. package/dist/DateRangePicker.mjs +0 -224
  32. package/dist/DateRangePicker.module.js +0 -224
  33. package/dist/DateRangePicker.module.js.map +0 -1
  34. package/dist/Input.main.js +0 -128
  35. package/dist/Input.main.js.map +0 -1
  36. package/dist/Input.mjs +0 -123
  37. package/dist/Input.module.js +0 -123
  38. package/dist/Input.module.js.map +0 -1
  39. package/dist/TimeField.main.js +0 -100
  40. package/dist/TimeField.main.js.map +0 -1
  41. package/dist/TimeField.mjs +0 -95
  42. package/dist/TimeField.module.js +0 -95
  43. package/dist/TimeField.module.js.map +0 -1
  44. package/dist/ar-AE.main.js +0 -8
  45. package/dist/ar-AE.main.js.map +0 -1
  46. package/dist/ar-AE.mjs +0 -10
  47. package/dist/ar-AE.module.js +0 -10
  48. package/dist/ar-AE.module.js.map +0 -1
  49. package/dist/bg-BG.main.js +0 -8
  50. package/dist/bg-BG.main.js.map +0 -1
  51. package/dist/bg-BG.mjs +0 -10
  52. package/dist/bg-BG.module.js +0 -10
  53. package/dist/bg-BG.module.js.map +0 -1
  54. package/dist/cs-CZ.main.js +0 -8
  55. package/dist/cs-CZ.main.js.map +0 -1
  56. package/dist/cs-CZ.mjs +0 -10
  57. package/dist/cs-CZ.module.js +0 -10
  58. package/dist/cs-CZ.module.js.map +0 -1
  59. package/dist/da-DK.main.js +0 -8
  60. package/dist/da-DK.main.js.map +0 -1
  61. package/dist/da-DK.mjs +0 -10
  62. package/dist/da-DK.module.js +0 -10
  63. package/dist/da-DK.module.js.map +0 -1
  64. package/dist/datepicker.4d1286b0.css +0 -649
  65. package/dist/datepicker.4d1286b0.css.map +0 -1
  66. package/dist/datepicker.776a7787.css +0 -550
  67. package/dist/datepicker.776a7787.css.map +0 -1
  68. package/dist/datepicker.e85992d8.css +0 -204
  69. package/dist/datepicker.e85992d8.css.map +0 -1
  70. package/dist/de-DE.main.js +0 -8
  71. package/dist/de-DE.main.js.map +0 -1
  72. package/dist/de-DE.mjs +0 -10
  73. package/dist/de-DE.module.js +0 -10
  74. package/dist/de-DE.module.js.map +0 -1
  75. package/dist/el-GR.main.js +0 -8
  76. package/dist/el-GR.main.js.map +0 -1
  77. package/dist/el-GR.mjs +0 -10
  78. package/dist/el-GR.module.js +0 -10
  79. package/dist/el-GR.module.js.map +0 -1
  80. package/dist/en-US.main.js +0 -8
  81. package/dist/en-US.main.js.map +0 -1
  82. package/dist/en-US.mjs +0 -10
  83. package/dist/en-US.module.js +0 -10
  84. package/dist/en-US.module.js.map +0 -1
  85. package/dist/es-ES.main.js +0 -8
  86. package/dist/es-ES.main.js.map +0 -1
  87. package/dist/es-ES.mjs +0 -10
  88. package/dist/es-ES.module.js +0 -10
  89. package/dist/es-ES.module.js.map +0 -1
  90. package/dist/et-EE.main.js +0 -8
  91. package/dist/et-EE.main.js.map +0 -1
  92. package/dist/et-EE.mjs +0 -10
  93. package/dist/et-EE.module.js +0 -10
  94. package/dist/et-EE.module.js.map +0 -1
  95. package/dist/fi-FI.main.js +0 -8
  96. package/dist/fi-FI.main.js.map +0 -1
  97. package/dist/fi-FI.mjs +0 -10
  98. package/dist/fi-FI.module.js +0 -10
  99. package/dist/fi-FI.module.js.map +0 -1
  100. package/dist/fr-FR.main.js +0 -8
  101. package/dist/fr-FR.main.js.map +0 -1
  102. package/dist/fr-FR.mjs +0 -10
  103. package/dist/fr-FR.module.js +0 -10
  104. package/dist/fr-FR.module.js.map +0 -1
  105. package/dist/he-IL.main.js +0 -8
  106. package/dist/he-IL.main.js.map +0 -1
  107. package/dist/he-IL.mjs +0 -10
  108. package/dist/he-IL.module.js +0 -10
  109. package/dist/he-IL.module.js.map +0 -1
  110. package/dist/hr-HR.main.js +0 -8
  111. package/dist/hr-HR.main.js.map +0 -1
  112. package/dist/hr-HR.mjs +0 -10
  113. package/dist/hr-HR.module.js +0 -10
  114. package/dist/hr-HR.module.js.map +0 -1
  115. package/dist/hu-HU.main.js +0 -8
  116. package/dist/hu-HU.main.js.map +0 -1
  117. package/dist/hu-HU.mjs +0 -10
  118. package/dist/hu-HU.module.js +0 -10
  119. package/dist/hu-HU.module.js.map +0 -1
  120. package/dist/inputgroup_vars_css.main.js +0 -86
  121. package/dist/inputgroup_vars_css.main.js.map +0 -1
  122. package/dist/inputgroup_vars_css.mjs +0 -88
  123. package/dist/inputgroup_vars_css.module.js +0 -88
  124. package/dist/inputgroup_vars_css.module.js.map +0 -1
  125. package/dist/intlStrings.main.js +0 -108
  126. package/dist/intlStrings.main.js.map +0 -1
  127. package/dist/intlStrings.mjs +0 -110
  128. package/dist/intlStrings.module.js +0 -110
  129. package/dist/intlStrings.module.js.map +0 -1
  130. package/dist/it-IT.main.js +0 -8
  131. package/dist/it-IT.main.js.map +0 -1
  132. package/dist/it-IT.mjs +0 -10
  133. package/dist/it-IT.module.js +0 -10
  134. package/dist/it-IT.module.js.map +0 -1
  135. package/dist/ja-JP.main.js +0 -8
  136. package/dist/ja-JP.main.js.map +0 -1
  137. package/dist/ja-JP.mjs +0 -10
  138. package/dist/ja-JP.module.js +0 -10
  139. package/dist/ja-JP.module.js.map +0 -1
  140. package/dist/ko-KR.main.js +0 -8
  141. package/dist/ko-KR.main.js.map +0 -1
  142. package/dist/ko-KR.mjs +0 -10
  143. package/dist/ko-KR.module.js +0 -10
  144. package/dist/ko-KR.module.js.map +0 -1
  145. package/dist/lt-LT.main.js +0 -8
  146. package/dist/lt-LT.main.js.map +0 -1
  147. package/dist/lt-LT.mjs +0 -10
  148. package/dist/lt-LT.module.js +0 -10
  149. package/dist/lt-LT.module.js.map +0 -1
  150. package/dist/lv-LV.main.js +0 -8
  151. package/dist/lv-LV.main.js.map +0 -1
  152. package/dist/lv-LV.mjs +0 -10
  153. package/dist/lv-LV.module.js +0 -10
  154. package/dist/lv-LV.module.js.map +0 -1
  155. package/dist/nb-NO.main.js +0 -8
  156. package/dist/nb-NO.main.js.map +0 -1
  157. package/dist/nb-NO.mjs +0 -10
  158. package/dist/nb-NO.module.js +0 -10
  159. package/dist/nb-NO.module.js.map +0 -1
  160. package/dist/nl-NL.main.js +0 -8
  161. package/dist/nl-NL.main.js.map +0 -1
  162. package/dist/nl-NL.mjs +0 -10
  163. package/dist/nl-NL.module.js +0 -10
  164. package/dist/nl-NL.module.js.map +0 -1
  165. package/dist/pl-PL.main.js +0 -8
  166. package/dist/pl-PL.main.js.map +0 -1
  167. package/dist/pl-PL.mjs +0 -10
  168. package/dist/pl-PL.module.js +0 -10
  169. package/dist/pl-PL.module.js.map +0 -1
  170. package/dist/pt-BR.main.js +0 -8
  171. package/dist/pt-BR.main.js.map +0 -1
  172. package/dist/pt-BR.mjs +0 -10
  173. package/dist/pt-BR.module.js +0 -10
  174. package/dist/pt-BR.module.js.map +0 -1
  175. package/dist/pt-PT.main.js +0 -8
  176. package/dist/pt-PT.main.js.map +0 -1
  177. package/dist/pt-PT.mjs +0 -10
  178. package/dist/pt-PT.module.js +0 -10
  179. package/dist/pt-PT.module.js.map +0 -1
  180. package/dist/ro-RO.main.js +0 -8
  181. package/dist/ro-RO.main.js.map +0 -1
  182. package/dist/ro-RO.mjs +0 -10
  183. package/dist/ro-RO.module.js +0 -10
  184. package/dist/ro-RO.module.js.map +0 -1
  185. package/dist/ru-RU.main.js +0 -8
  186. package/dist/ru-RU.main.js.map +0 -1
  187. package/dist/ru-RU.mjs +0 -10
  188. package/dist/ru-RU.module.js +0 -10
  189. package/dist/ru-RU.module.js.map +0 -1
  190. package/dist/sk-SK.main.js +0 -8
  191. package/dist/sk-SK.main.js.map +0 -1
  192. package/dist/sk-SK.mjs +0 -10
  193. package/dist/sk-SK.module.js +0 -10
  194. package/dist/sk-SK.module.js.map +0 -1
  195. package/dist/sl-SI.main.js +0 -8
  196. package/dist/sl-SI.main.js.map +0 -1
  197. package/dist/sl-SI.mjs +0 -10
  198. package/dist/sl-SI.module.js +0 -10
  199. package/dist/sl-SI.module.js.map +0 -1
  200. package/dist/sr-SP.main.js +0 -8
  201. package/dist/sr-SP.main.js.map +0 -1
  202. package/dist/sr-SP.mjs +0 -10
  203. package/dist/sr-SP.module.js +0 -10
  204. package/dist/sr-SP.module.js.map +0 -1
  205. package/dist/styles_css.main.js +0 -77
  206. package/dist/styles_css.main.js.map +0 -1
  207. package/dist/styles_css.mjs +0 -79
  208. package/dist/styles_css.module.js +0 -79
  209. package/dist/styles_css.module.js.map +0 -1
  210. package/dist/sv-SE.main.js +0 -8
  211. package/dist/sv-SE.main.js.map +0 -1
  212. package/dist/sv-SE.mjs +0 -10
  213. package/dist/sv-SE.module.js +0 -10
  214. package/dist/sv-SE.module.js.map +0 -1
  215. package/dist/textfield_vars_css.main.js +0 -74
  216. package/dist/textfield_vars_css.main.js.map +0 -1
  217. package/dist/textfield_vars_css.mjs +0 -76
  218. package/dist/textfield_vars_css.module.js +0 -76
  219. package/dist/textfield_vars_css.module.js.map +0 -1
  220. package/dist/tr-TR.main.js +0 -8
  221. package/dist/tr-TR.main.js.map +0 -1
  222. package/dist/tr-TR.mjs +0 -10
  223. package/dist/tr-TR.module.js +0 -10
  224. package/dist/tr-TR.module.js.map +0 -1
  225. package/dist/types.d.ts +0 -33
  226. package/dist/types.d.ts.map +0 -1
  227. package/dist/uk-UA.main.js +0 -8
  228. package/dist/uk-UA.main.js.map +0 -1
  229. package/dist/uk-UA.mjs +0 -10
  230. package/dist/uk-UA.module.js +0 -10
  231. package/dist/uk-UA.module.js.map +0 -1
  232. package/dist/utils.main.js +0 -117
  233. package/dist/utils.main.js.map +0 -1
  234. package/dist/utils.mjs +0 -105
  235. package/dist/utils.module.js +0 -105
  236. package/dist/utils.module.js.map +0 -1
  237. package/dist/zh-CN.main.js +0 -8
  238. package/dist/zh-CN.main.js.map +0 -1
  239. package/dist/zh-CN.mjs +0 -10
  240. package/dist/zh-CN.module.js +0 -10
  241. package/dist/zh-CN.module.js.map +0 -1
  242. package/dist/zh-TW.main.js +0 -8
  243. package/dist/zh-TW.main.js.map +0 -1
  244. package/dist/zh-TW.mjs +0 -10
  245. package/dist/zh-TW.module.js +0 -10
  246. package/dist/zh-TW.module.js.map +0 -1
  247. package/src/DateField.tsx +0 -106
  248. package/src/DatePicker.tsx +0 -196
  249. package/src/DatePickerField.tsx +0 -61
  250. package/src/DatePickerSegment.tsx +0 -69
  251. package/src/DateRangePicker.tsx +0 -234
  252. package/src/Input.tsx +0 -142
  253. package/src/TimeField.tsx +0 -96
  254. package/src/styles.css +0 -203
  255. package/src/utils.tsx +0 -96
@@ -1,224 +0,0 @@
1
- import {DatePickerField as $d2bb88c82604b25f$export$34dc4cfa15ead1} from "./DatePickerField.module.js";
2
- import "./datepicker.e85992d8.css";
3
- import $dUbU7$styles_cssmodulejs from "./styles_css.module.js";
4
- import {Input as $79348162c55d687f$export$f5b8910cec6cf069} from "./Input.module.js";
5
- import $dUbU7$intlStringsmodulejs from "./intlStrings.module.js";
6
- import "./datepicker.4d1286b0.css";
7
- import $dUbU7$inputgroup_vars_cssmodulejs from "./inputgroup_vars_css.module.js";
8
- import {TimeField as $f0a04554754386b6$export$5eaee2322dd727eb} from "./TimeField.module.js";
9
- import {useFocusManagerRef as $ea94a5cfe92db3c2$export$71a23a36270e4bf0, useFormatHelpText as $ea94a5cfe92db3c2$export$322f4580ccd8dde6, useFormattedDateWidth as $ea94a5cfe92db3c2$export$31e22e3c931fc056, useVisibleMonths as $ea94a5cfe92db3c2$export$12ce2869ce471b1f} from "./utils.module.js";
10
- import $dUbU7$spectrumiconsworkflowCalendar from "@spectrum-icons/workflow/Calendar";
11
- import {classNames as $dUbU7$classNames} from "@react-spectrum/utils";
12
- import {Content as $dUbU7$Content} from "@react-spectrum/view";
13
- import {DialogTrigger as $dUbU7$DialogTrigger, Dialog as $dUbU7$Dialog} from "@react-spectrum/dialog";
14
- import {Field as $dUbU7$Field} from "@react-spectrum/label";
15
- import {FieldButton as $dUbU7$FieldButton} from "@react-spectrum/button";
16
- import {Flex as $dUbU7$Flex} from "@react-spectrum/layout";
17
- import {mergeProps as $dUbU7$mergeProps} from "@react-aria/utils";
18
- import {RangeCalendar as $dUbU7$RangeCalendar} from "@react-spectrum/calendar";
19
- import $dUbU7$react, {useRef as $dUbU7$useRef} from "react";
20
- import {useDateRangePicker as $dUbU7$useDateRangePicker} from "@react-aria/datepicker";
21
- import {useDateRangePickerState as $dUbU7$useDateRangePickerState} from "@react-stately/datepicker";
22
- import {useFocusRing as $dUbU7$useFocusRing} from "@react-aria/focus";
23
- import {useFormProps as $dUbU7$useFormProps} from "@react-spectrum/form";
24
- import {useHover as $dUbU7$useHover} from "@react-aria/interactions";
25
- import {useLocale as $dUbU7$useLocale, useLocalizedStringFormatter as $dUbU7$useLocalizedStringFormatter} from "@react-aria/i18n";
26
- import {useProviderProps as $dUbU7$useProviderProps} from "@react-spectrum/provider";
27
-
28
-
29
- function $parcel$interopDefault(a) {
30
- return a && a.__esModule ? a.default : a;
31
- }
32
- /*
33
- * Copyright 2020 Adobe. All rights reserved.
34
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
35
- * you may not use this file except in compliance with the License. You may obtain a copy
36
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
37
- *
38
- * Unless required by applicable law or agreed to in writing, software distributed under
39
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
40
- * OF ANY KIND, either express or implied. See the License for the specific language
41
- * governing permissions and limitations under the License.
42
- */
43
-
44
-
45
-
46
-
47
-
48
-
49
-
50
-
51
-
52
-
53
-
54
-
55
-
56
-
57
-
58
-
59
-
60
-
61
-
62
-
63
-
64
-
65
-
66
- const $cb301300011a98f7$export$17334619f3ac2224 = /*#__PURE__*/ (0, $dUbU7$react).forwardRef(function DateRangePicker(props, ref) {
67
- var _state_timeRange, _state_timeRange1;
68
- props = (0, $dUbU7$useProviderProps)(props);
69
- props = (0, $dUbU7$useFormProps)(props);
70
- let { isQuiet: isQuiet, isDisabled: isDisabled, autoFocus: autoFocus, placeholderValue: placeholderValue, maxVisibleMonths: maxVisibleMonths = 1 } = props;
71
- let { hoverProps: hoverProps, isHovered: isHovered } = (0, $dUbU7$useHover)({
72
- isDisabled: isDisabled
73
- });
74
- let targetRef = (0, $dUbU7$useRef)(null);
75
- let state = (0, $dUbU7$useDateRangePickerState)({
76
- ...props,
77
- shouldCloseOnSelect: ()=>!state.hasTime
78
- });
79
- let { labelProps: labelProps, groupProps: groupProps, buttonProps: buttonProps, dialogProps: dialogProps, startFieldProps: startFieldProps, endFieldProps: endFieldProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, calendarProps: calendarProps, isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = (0, $dUbU7$useDateRangePicker)(props, state, targetRef);
80
- let { isOpen: isOpen, setOpen: setOpen } = state;
81
- let { direction: direction } = (0, $dUbU7$useLocale)();
82
- let domRef = (0, $ea94a5cfe92db3c2$export$71a23a36270e4bf0)(ref);
83
- let stringFormatter = (0, $dUbU7$useLocalizedStringFormatter)((0, ($parcel$interopDefault($dUbU7$intlStringsmodulejs))), '@react-spectrum/datepicker');
84
- let { isFocused: isFocused, isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $dUbU7$useFocusRing)({
85
- within: true,
86
- isTextInput: true,
87
- autoFocus: autoFocus
88
- });
89
- let { isFocused: isFocusedButton, focusProps: focusPropsButton } = (0, $dUbU7$useFocusRing)({
90
- within: false,
91
- isTextInput: false,
92
- autoFocus: autoFocus
93
- });
94
- let className = (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$inputgroup_vars_cssmodulejs))), 'spectrum-InputGroup', {
95
- 'spectrum-InputGroup--quiet': isQuiet,
96
- 'spectrum-InputGroup--invalid': isInvalid && !isDisabled,
97
- 'is-disabled': isDisabled,
98
- 'is-hovered': isHovered,
99
- 'is-focused': isFocused,
100
- 'focus-ring': isFocusVisible && !isFocusedButton
101
- });
102
- let fieldClassName = (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$inputgroup_vars_cssmodulejs))), 'spectrum-InputGroup-input', {
103
- 'is-disabled': isDisabled,
104
- 'is-invalid': isInvalid && !isDisabled
105
- });
106
- // Note: this description is intentionally not passed to useDatePicker.
107
- // The format help text is unnecessary for screen reader users because each segment already has a label.
108
- let description = (0, $ea94a5cfe92db3c2$export$322f4580ccd8dde6)(props);
109
- if (description && !props.description) descriptionProps.id = undefined;
110
- let placeholder = placeholderValue;
111
- let timePlaceholder = placeholder && 'hour' in placeholder ? placeholder : null;
112
- let timeMinValue = props.minValue && 'hour' in props.minValue ? props.minValue : null;
113
- let timeMaxValue = props.maxValue && 'hour' in props.maxValue ? props.maxValue : null;
114
- let timeGranularity = state.granularity === 'hour' || state.granularity === 'minute' || state.granularity === 'second' ? state.granularity : null;
115
- let showTimeField = !!timeGranularity;
116
- let visibleMonths = (0, $ea94a5cfe92db3c2$export$12ce2869ce471b1f)(maxVisibleMonths);
117
- let validationState = state.validationState || (isInvalid ? 'invalid' : null);
118
- // Multiplying by two for the two dates, adding one character for the dash, and then the padding around the dash
119
- let approximateWidth = `calc(${(0, $ea94a5cfe92db3c2$export$31e22e3c931fc056)(state) * 2 + 1}ch + 2 * var(--spectrum-global-dimension-size-100))`;
120
- return /*#__PURE__*/ (0, $dUbU7$react).createElement((0, $dUbU7$Field), {
121
- ...props,
122
- ref: domRef,
123
- elementType: "span",
124
- description: description,
125
- labelProps: labelProps,
126
- descriptionProps: descriptionProps,
127
- errorMessageProps: errorMessageProps,
128
- validationState: validationState,
129
- isInvalid: isInvalid,
130
- validationErrors: validationErrors,
131
- validationDetails: validationDetails,
132
- wrapperClassName: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$styles_cssmodulejs))), 'react-spectrum-Datepicker-fieldWrapper')
133
- }, /*#__PURE__*/ (0, $dUbU7$react).createElement("div", {
134
- ...(0, $dUbU7$mergeProps)(groupProps, hoverProps, focusProps),
135
- className: className,
136
- ref: targetRef
137
- }, /*#__PURE__*/ (0, $dUbU7$react).createElement("div", {
138
- style: {
139
- overflow: 'hidden',
140
- width: '100%'
141
- }
142
- }, /*#__PURE__*/ (0, $dUbU7$react).createElement((0, $79348162c55d687f$export$f5b8910cec6cf069), {
143
- isDisabled: isDisabled,
144
- isQuiet: isQuiet,
145
- validationState: validationState,
146
- className: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$inputgroup_vars_cssmodulejs))), 'spectrum-InputGroup-field'),
147
- inputClassName: fieldClassName,
148
- disableFocusRing: true,
149
- minWidth: approximateWidth
150
- }, /*#__PURE__*/ (0, $dUbU7$react).createElement((0, $d2bb88c82604b25f$export$34dc4cfa15ead1), {
151
- ...startFieldProps,
152
- "data-testid": "start-date",
153
- isQuiet: props.isQuiet,
154
- inputClassName: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$styles_cssmodulejs))), 'react-spectrum-Datepicker-startField')
155
- }), /*#__PURE__*/ (0, $dUbU7$react).createElement($cb301300011a98f7$var$DateRangeDash, null), /*#__PURE__*/ (0, $dUbU7$react).createElement((0, $d2bb88c82604b25f$export$34dc4cfa15ead1), {
156
- ...endFieldProps,
157
- "data-testid": "end-date",
158
- isQuiet: props.isQuiet,
159
- inputClassName: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$inputgroup_vars_cssmodulejs))), 'spectrum-Datepicker-endField', (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$styles_cssmodulejs))), 'react-spectrum-Datepicker-endField'))
160
- }))), /*#__PURE__*/ (0, $dUbU7$react).createElement((0, $dUbU7$DialogTrigger), {
161
- type: "popover",
162
- mobileType: "tray",
163
- placement: direction === 'rtl' ? 'bottom right' : 'bottom left',
164
- targetRef: targetRef,
165
- hideArrow: true,
166
- isOpen: isOpen,
167
- onOpenChange: setOpen,
168
- shouldFlip: props.shouldFlip
169
- }, /*#__PURE__*/ (0, $dUbU7$react).createElement((0, $dUbU7$FieldButton), {
170
- ...(0, $dUbU7$mergeProps)(buttonProps, focusPropsButton),
171
- UNSAFE_className: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$inputgroup_vars_cssmodulejs))), 'spectrum-FieldButton'),
172
- isQuiet: isQuiet,
173
- validationState: validationState
174
- }, /*#__PURE__*/ (0, $dUbU7$react).createElement((0, $dUbU7$spectrumiconsworkflowCalendar), null)), /*#__PURE__*/ (0, $dUbU7$react).createElement((0, $dUbU7$Dialog), {
175
- UNSAFE_className: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$styles_cssmodulejs))), 'react-spectrum-Datepicker-dialog'),
176
- ...dialogProps
177
- }, /*#__PURE__*/ (0, $dUbU7$react).createElement((0, $dUbU7$Content), null, /*#__PURE__*/ (0, $dUbU7$react).createElement("div", {
178
- className: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$styles_cssmodulejs))), 'react-spectrum-Datepicker-dialogContent')
179
- }, /*#__PURE__*/ (0, $dUbU7$react).createElement((0, $dUbU7$RangeCalendar), {
180
- ...calendarProps,
181
- visibleMonths: visibleMonths,
182
- createCalendar: props.createCalendar,
183
- UNSAFE_className: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$styles_cssmodulejs))), 'react-spectrum-Datepicker-calendar', {
184
- 'is-invalid': validationState === 'invalid'
185
- })
186
- }), showTimeField && /*#__PURE__*/ (0, $dUbU7$react).createElement((0, $dUbU7$Flex), {
187
- gap: "size-100",
188
- marginTop: "size-100",
189
- UNSAFE_className: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$styles_cssmodulejs))), 'react-spectrum-Datepicker-timeFields')
190
- }, /*#__PURE__*/ (0, $dUbU7$react).createElement((0, $f0a04554754386b6$export$5eaee2322dd727eb), {
191
- label: stringFormatter.format('startTime'),
192
- value: ((_state_timeRange = state.timeRange) === null || _state_timeRange === void 0 ? void 0 : _state_timeRange.start) || null,
193
- onChange: (v)=>state.setTime('start', v),
194
- placeholderValue: timePlaceholder,
195
- granularity: timeGranularity,
196
- minValue: timeMinValue,
197
- maxValue: timeMaxValue,
198
- hourCycle: props.hourCycle,
199
- hideTimeZone: props.hideTimeZone,
200
- flex: true
201
- }), /*#__PURE__*/ (0, $dUbU7$react).createElement((0, $f0a04554754386b6$export$5eaee2322dd727eb), {
202
- label: stringFormatter.format('endTime'),
203
- value: ((_state_timeRange1 = state.timeRange) === null || _state_timeRange1 === void 0 ? void 0 : _state_timeRange1.end) || null,
204
- onChange: (v)=>state.setTime('end', v),
205
- placeholderValue: timePlaceholder,
206
- granularity: timeGranularity,
207
- minValue: timeMinValue,
208
- maxValue: timeMaxValue,
209
- hourCycle: props.hourCycle,
210
- hideTimeZone: props.hideTimeZone,
211
- flex: true
212
- }))))))));
213
- });
214
- function $cb301300011a98f7$var$DateRangeDash() {
215
- return /*#__PURE__*/ (0, $dUbU7$react).createElement("span", {
216
- "aria-hidden": "true",
217
- "data-testid": "date-range-dash",
218
- className: (0, $dUbU7$classNames)((0, ($parcel$interopDefault($dUbU7$styles_cssmodulejs))), 'react-spectrum-Datepicker-rangeDash')
219
- });
220
- }
221
-
222
-
223
- export {$cb301300011a98f7$export$17334619f3ac2224 as DateRangePicker};
224
- //# sourceMappingURL=DateRangePicker.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;;;;;AAkCM,MAAM,0DAAkB,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,gBAAqC,KAAsC,EAAE,GAA8B;QAuJvI,kBAWA;IAjK3B,QAAQ,CAAA,GAAA,uBAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,mBAAW,EAAE;IACrB,IAAI,WACF,OAAO,cACP,UAAU,aACV,SAAS,oBACT,gBAAgB,oBAChB,mBAAmB,GACpB,GAAG;IACJ,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,eAAO,EAAE;oBAAC;IAAU;IAClD,IAAI,YAAY,CAAA,GAAA,aAAK,EAAyB;IAC9C,IAAI,QAAQ,CAAA,GAAA,8BAAsB,EAAE;QAClC,GAAG,KAAK;QACR,qBAAqB,IAAM,CAAC,MAAM,OAAO;IAC3C;IACA,IAAI,cAAC,UAAU,cAAE,UAAU,eAAE,WAAW,eAAE,WAAW,mBAAE,eAAe,iBAAE,aAAa,oBAAE,gBAAgB,qBAAE,iBAAiB,iBAAE,aAAa,aAAE,SAAS,oBAAE,gBAAgB,qBAAE,iBAAiB,EAAC,GAAG,CAAA,GAAA,yBAAiB,EAAE,OAAO,OAAO;IAC9N,IAAI,UAAC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,OAAO,EAAA,oBAAA,MAAM,SAAS,cAAf,wCAAA,kBAAiB,GAAG,KAAI;QAC/B,UAAU,CAAA,IAAK,MAAM,OAAO,CAAC,OAAO;QACpC,kBAAkB;QAClB,aAAa;QACb,UAAU;QACV,UAAU;QACV,WAAW,MAAM,SAAS;QAC1B,cAAc,MAAM,YAAY;QAChC,MAAA;;AAUtB;AAEA,SAAS;IACP,qBACE,gCAAC;QACC,eAAY;QACZ,eAAY;QACZ,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,mDAAe,GAAG;;AAE9C","sources":["packages/@react-spectrum/datepicker/src/DateRangePicker.tsx"],"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 CalendarIcon from '@spectrum-icons/workflow/Calendar';\nimport {classNames} from '@react-spectrum/utils';\nimport {Content} from '@react-spectrum/view';\nimport {DatePickerField} from './DatePickerField';\nimport datepickerStyles from './styles.css';\nimport {DateValue, SpectrumDateRangePickerProps} from '@react-types/datepicker';\nimport {Dialog, DialogTrigger} from '@react-spectrum/dialog';\nimport {Field} from '@react-spectrum/label';\nimport {FieldButton} from '@react-spectrum/button';\nimport {Flex} from '@react-spectrum/layout';\nimport {FocusableRef} from '@react-types/shared';\nimport {Input} from './Input';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {mergeProps} from '@react-aria/utils';\nimport {RangeCalendar} from '@react-spectrum/calendar';\nimport React, {ReactElement, useRef} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/inputgroup/vars.css';\nimport {TimeField} from './TimeField';\nimport {useDateRangePicker} from '@react-aria/datepicker';\nimport {useDateRangePickerState} from '@react-stately/datepicker';\nimport {useFocusManagerRef, useFormatHelpText, useFormattedDateWidth, useVisibleMonths} from './utils';\nimport {useFocusRing} from '@react-aria/focus';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useHover} from '@react-aria/interactions';\nimport {useLocale, useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useProviderProps} from '@react-spectrum/provider';\n\n/**\n * DateRangePickers combine two DateFields and a RangeCalendar popover to allow users\n * to enter or select a date and time range.\n */\nexport const DateRangePicker = React.forwardRef(function DateRangePicker<T extends DateValue>(props: SpectrumDateRangePickerProps<T>, ref: FocusableRef<HTMLElement>) {\n props = useProviderProps(props);\n props = useFormProps(props);\n let {\n isQuiet,\n isDisabled,\n autoFocus,\n placeholderValue,\n maxVisibleMonths = 1\n } = props;\n let {hoverProps, isHovered} = useHover({isDisabled});\n let targetRef = useRef<HTMLDivElement | null>(null);\n let state = useDateRangePickerState({\n ...props,\n shouldCloseOnSelect: () => !state.hasTime\n });\n let {labelProps, groupProps, buttonProps, dialogProps, startFieldProps, endFieldProps, descriptionProps, errorMessageProps, calendarProps, isInvalid, validationErrors, validationDetails} = useDateRangePicker(props, state, targetRef);\n let {isOpen, setOpen} = state;\n let {direction} = useLocale();\n let domRef = useFocusManagerRef(ref);\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/datepicker');\n\n let {isFocused, isFocusVisible, focusProps} = useFocusRing({\n within: true,\n isTextInput: true,\n autoFocus\n });\n\n let {isFocused: isFocusedButton, focusProps: focusPropsButton} = useFocusRing({\n within: false,\n isTextInput: false,\n autoFocus\n });\n\n let className = classNames(\n styles,\n 'spectrum-InputGroup',\n {\n 'spectrum-InputGroup--quiet': isQuiet,\n 'spectrum-InputGroup--invalid': isInvalid && !isDisabled,\n 'is-disabled': isDisabled,\n 'is-hovered': isHovered,\n 'is-focused': isFocused,\n 'focus-ring': isFocusVisible && !isFocusedButton\n }\n );\n\n let fieldClassName = classNames(\n styles,\n 'spectrum-InputGroup-input',\n {\n 'is-disabled': isDisabled,\n 'is-invalid': isInvalid && !isDisabled\n }\n );\n\n // Note: this description is intentionally not passed to useDatePicker.\n // The format help text is unnecessary for screen reader users because each segment already has a label.\n let description = useFormatHelpText(props);\n if (description && !props.description) {\n descriptionProps.id = undefined;\n }\n\n let placeholder: DateValue | null | undefined = placeholderValue;\n let timePlaceholder = placeholder && 'hour' in placeholder ? placeholder : null;\n let timeMinValue = props.minValue && 'hour' in props.minValue ? props.minValue : null;\n let timeMaxValue = props.maxValue && 'hour' in props.maxValue ? props.maxValue : null;\n let timeGranularity = state.granularity === 'hour' || state.granularity === 'minute' || state.granularity === 'second' ? state.granularity : null;\n let showTimeField = !!timeGranularity;\n\n let visibleMonths = useVisibleMonths(maxVisibleMonths);\n let validationState = state.validationState || (isInvalid ? 'invalid' : null);\n\n // Multiplying by two for the two dates, adding one character for the dash, and then the padding around the dash\n let approximateWidth = `calc(${useFormattedDateWidth(state) * 2 + 1}ch + 2 * var(--spectrum-global-dimension-size-100))`;\n\n return (\n <Field\n {...props}\n ref={domRef}\n elementType=\"span\"\n description={description}\n labelProps={labelProps}\n descriptionProps={descriptionProps}\n errorMessageProps={errorMessageProps}\n validationState={validationState}\n isInvalid={isInvalid}\n validationErrors={validationErrors}\n validationDetails={validationDetails}\n wrapperClassName={classNames(datepickerStyles, 'react-spectrum-Datepicker-fieldWrapper')}>\n <div\n {...mergeProps(groupProps, hoverProps, focusProps)}\n className={className}\n ref={targetRef}>\n <div style={{overflow: 'hidden', width: '100%'}}>\n <Input\n isDisabled={isDisabled}\n isQuiet={isQuiet}\n validationState={validationState}\n className={classNames(styles, 'spectrum-InputGroup-field')}\n inputClassName={fieldClassName}\n disableFocusRing\n minWidth={approximateWidth}>\n <DatePickerField\n {...startFieldProps}\n data-testid=\"start-date\"\n isQuiet={props.isQuiet}\n inputClassName={classNames(datepickerStyles, 'react-spectrum-Datepicker-startField')} />\n <DateRangeDash />\n <DatePickerField\n {...endFieldProps}\n data-testid=\"end-date\"\n isQuiet={props.isQuiet}\n inputClassName={classNames(\n styles,\n 'spectrum-Datepicker-endField',\n classNames(\n datepickerStyles,\n 'react-spectrum-Datepicker-endField'\n )\n )} />\n </Input>\n </div>\n <DialogTrigger\n type=\"popover\"\n mobileType=\"tray\"\n placement={direction === 'rtl' ? 'bottom right' : 'bottom left'}\n targetRef={targetRef}\n hideArrow\n isOpen={isOpen}\n onOpenChange={setOpen}\n shouldFlip={props.shouldFlip}>\n <FieldButton\n {...mergeProps(buttonProps, focusPropsButton)}\n UNSAFE_className={classNames(styles, 'spectrum-FieldButton')}\n isQuiet={isQuiet}\n validationState={validationState}>\n <CalendarIcon />\n </FieldButton>\n <Dialog UNSAFE_className={classNames(datepickerStyles, 'react-spectrum-Datepicker-dialog')} {...dialogProps}>\n <Content>\n <div className={classNames(datepickerStyles, 'react-spectrum-Datepicker-dialogContent')}>\n <RangeCalendar\n {...calendarProps}\n visibleMonths={visibleMonths}\n createCalendar={props.createCalendar}\n UNSAFE_className={classNames(datepickerStyles, 'react-spectrum-Datepicker-calendar', {'is-invalid': validationState === 'invalid'})} />\n {showTimeField &&\n <Flex gap=\"size-100\" marginTop=\"size-100\" UNSAFE_className={classNames(datepickerStyles, 'react-spectrum-Datepicker-timeFields')}>\n <TimeField\n label={stringFormatter.format('startTime')}\n value={state.timeRange?.start || null}\n onChange={v => state.setTime('start', v)}\n placeholderValue={timePlaceholder}\n granularity={timeGranularity}\n minValue={timeMinValue}\n maxValue={timeMaxValue}\n hourCycle={props.hourCycle}\n hideTimeZone={props.hideTimeZone}\n flex />\n <TimeField\n label={stringFormatter.format('endTime')}\n value={state.timeRange?.end || null}\n onChange={v => state.setTime('end', v)}\n placeholderValue={timePlaceholder}\n granularity={timeGranularity}\n minValue={timeMinValue}\n maxValue={timeMaxValue}\n hourCycle={props.hourCycle}\n hideTimeZone={props.hideTimeZone}\n flex />\n </Flex>\n }\n </div>\n </Content>\n </Dialog>\n </DialogTrigger>\n </div>\n </Field>\n );\n}) as <T extends DateValue>(props: SpectrumDateRangePickerProps<T> & {ref?: FocusableRef<HTMLElement>}) => ReactElement;\n\nfunction DateRangeDash() {\n return (\n <span\n aria-hidden=\"true\"\n data-testid=\"date-range-dash\"\n className={classNames(datepickerStyles, 'react-spectrum-Datepicker-rangeDash')} />\n );\n}\n"],"names":[],"version":3,"file":"DateRangePicker.module.js.map"}
@@ -1,128 +0,0 @@
1
- require("./datepicker.e85992d8.css");
2
- var $91c3db8c6a21ca71$exports = require("./styles_css.main.js");
3
- require("./datepicker.776a7787.css");
4
- var $40cb3a00c193680f$exports = require("./textfield_vars_css.main.js");
5
- var $9cini$spectrumiconsuiAlertMedium = require("@spectrum-icons/ui/AlertMedium");
6
- var $9cini$spectrumiconsuiCheckmarkMedium = require("@spectrum-icons/ui/CheckmarkMedium");
7
- var $9cini$reactspectrumutils = require("@react-spectrum/utils");
8
- var $9cini$reactariautils = require("@react-aria/utils");
9
- var $9cini$react = require("react");
10
- var $9cini$reactariafocus = require("@react-aria/focus");
11
-
12
-
13
- function $parcel$interopDefault(a) {
14
- return a && a.__esModule ? a.default : a;
15
- }
16
-
17
- function $parcel$export(e, n, v, s) {
18
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
19
- }
20
-
21
- $parcel$export(module.exports, "Input", () => $c3ebc4931d9b9977$export$f5b8910cec6cf069);
22
- /*
23
- * Copyright 2020 Adobe. All rights reserved.
24
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
25
- * you may not use this file except in compliance with the License. You may obtain a copy
26
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
27
- *
28
- * Unless required by applicable law or agreed to in writing, software distributed under
29
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
30
- * OF ANY KIND, either express or implied. See the License for the specific language
31
- * governing permissions and limitations under the License.
32
- */
33
-
34
-
35
-
36
-
37
-
38
-
39
-
40
- const $c3ebc4931d9b9977$export$f5b8910cec6cf069 = /*#__PURE__*/ (0, ($parcel$interopDefault($9cini$react))).forwardRef(function Input(props, ref) {
41
- let inputRef = (0, $9cini$react.useRef)(null);
42
- let { isDisabled: isDisabled, isQuiet: isQuiet, inputClassName: inputClassName, validationState: validationState, children: children, fieldProps: fieldProps, className: className, style: style, disableFocusRing: disableFocusRing } = props;
43
- // Reserve padding for the error icon when the width of the input is unconstrained.
44
- // When constrained, don't reserve space because adding it only when invalid will
45
- // not cause a layout shift.
46
- let [reservePadding, setReservePadding] = (0, $9cini$reactspectrumutils.useValueEffect)(false);
47
- let onResize = (0, $9cini$react.useCallback)(()=>setReservePadding(function*(reservePadding) {
48
- if (inputRef.current && inputRef.current.parentElement) {
49
- if (reservePadding) // Try to collapse padding if the content is clipped.
50
- {
51
- if (inputRef.current.scrollWidth > inputRef.current.offsetWidth) {
52
- let width = inputRef.current.parentElement.offsetWidth;
53
- yield false;
54
- // If removing padding causes a layout shift, add it back.
55
- if (inputRef.current.parentElement.offsetWidth !== width) yield true;
56
- }
57
- } else // Try to add padding if the content is not clipped.
58
- if (inputRef.current.offsetWidth >= inputRef.current.scrollWidth) {
59
- let width = inputRef.current.parentElement.offsetWidth;
60
- yield true;
61
- // If adding padding does not change the width (i.e. width is constrained), remove it again.
62
- if (inputRef.current.parentElement.offsetWidth === width) yield false;
63
- }
64
- }
65
- }), [
66
- inputRef,
67
- setReservePadding
68
- ]);
69
- (0, $9cini$reactariautils.useLayoutEffect)(onResize, [
70
- onResize
71
- ]);
72
- (0, $9cini$reactariautils.useResizeObserver)({
73
- ref: inputRef,
74
- onResize: onResize
75
- });
76
- // We also need to listen for resize events of the window so we can detect
77
- // when there is enough space for the padding to be re-added. Ideally we'd
78
- // use a resize observer on a parent element, but it's hard to know _what_
79
- // parent element.
80
- (0, $9cini$reactariautils.useEvent)((0, $9cini$react.useRef)(typeof window !== 'undefined' ? window : null), 'resize', onResize);
81
- let { focusProps: focusProps, isFocusVisible: isFocusVisible, isFocused: isFocused } = (0, $9cini$reactariafocus.useFocusRing)({
82
- isTextInput: true,
83
- within: true
84
- });
85
- let isInvalid = validationState === 'invalid' && !isDisabled;
86
- let textfieldClass = (0, $9cini$reactspectrumutils.classNames)((0, ($parcel$interopDefault($40cb3a00c193680f$exports))), 'spectrum-Textfield', {
87
- 'spectrum-Textfield--invalid': isInvalid,
88
- 'spectrum-Textfield--valid': validationState === 'valid' && !isDisabled,
89
- 'spectrum-Textfield--quiet': isQuiet,
90
- 'focus-ring': isFocusVisible && !disableFocusRing
91
- }, (0, $9cini$reactspectrumutils.classNames)((0, ($parcel$interopDefault($91c3db8c6a21ca71$exports))), 'react-spectrum-Datepicker-field'), className);
92
- let inputClass = (0, $9cini$reactspectrumutils.classNames)((0, ($parcel$interopDefault($40cb3a00c193680f$exports))), 'spectrum-Textfield-input', {
93
- 'is-disabled': isDisabled,
94
- 'is-focused': isFocused
95
- }, (0, $9cini$reactspectrumutils.classNames)((0, ($parcel$interopDefault($91c3db8c6a21ca71$exports))), 'react-spectrum-DateField-Input'), reservePadding && (0, $9cini$reactspectrumutils.classNames)((0, ($parcel$interopDefault($91c3db8c6a21ca71$exports))), 'react-spectrum-Datepicker-input'), inputClassName);
96
- let iconClass = (0, $9cini$reactspectrumutils.classNames)((0, ($parcel$interopDefault($40cb3a00c193680f$exports))), 'spectrum-Textfield-validationIcon');
97
- let validationIcon = null;
98
- if (validationState === 'invalid' && !isDisabled) validationIcon = /*#__PURE__*/ (0, ($parcel$interopDefault($9cini$react))).createElement((0, ($parcel$interopDefault($9cini$spectrumiconsuiAlertMedium))), {
99
- "data-testid": "invalid-icon",
100
- UNSAFE_className: iconClass
101
- });
102
- else if (validationState === 'valid' && !isDisabled) validationIcon = /*#__PURE__*/ (0, ($parcel$interopDefault($9cini$react))).createElement((0, ($parcel$interopDefault($9cini$spectrumiconsuiCheckmarkMedium))), {
103
- "data-testid": "valid-icon",
104
- UNSAFE_className: iconClass
105
- });
106
- return /*#__PURE__*/ (0, ($parcel$interopDefault($9cini$react))).createElement("div", {
107
- role: "presentation",
108
- ...(0, $9cini$reactariautils.mergeProps)(fieldProps, focusProps),
109
- className: textfieldClass,
110
- style: style
111
- }, /*#__PURE__*/ (0, ($parcel$interopDefault($9cini$react))).createElement("div", {
112
- role: "presentation",
113
- className: inputClass
114
- }, /*#__PURE__*/ (0, ($parcel$interopDefault($9cini$react))).createElement("div", {
115
- role: "presentation",
116
- className: (0, $9cini$reactspectrumutils.classNames)((0, ($parcel$interopDefault($91c3db8c6a21ca71$exports))), 'react-spectrum-Datepicker-inputContents'),
117
- ref: (0, $9cini$reactariautils.mergeRefs)(ref, inputRef)
118
- }, /*#__PURE__*/ (0, ($parcel$interopDefault($9cini$react))).createElement("div", {
119
- role: "presentation",
120
- className: (0, $9cini$reactspectrumutils.classNames)((0, ($parcel$interopDefault($91c3db8c6a21ca71$exports))), 'react-spectrum-Datepicker-inputSized'),
121
- style: {
122
- minWidth: props.minWidth
123
- }
124
- }, children))), validationIcon);
125
- });
126
-
127
-
128
- //# sourceMappingURL=Input.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAWM,MAAM,0DAAQ,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,MAAM,KAAU,EAAE,GAAQ;IACvE,IAAI,WAAW,CAAA,GAAA,mBAAK,EAA2B;IAC/C,IAAI,cACF,UAAU,WACV,OAAO,kBACP,cAAc,mBACd,eAAe,YACf,QAAQ,cACR,UAAU,aACV,SAAS,SACT,KAAK,oBACL,gBAAgB,EACjB,GAAG;IAEJ,mFAAmF;IACnF,iFAAiF;IACjF,4BAA4B;IAC5B,IAAI,CAAC,gBAAgB,kBAAkB,GAAG,CAAA,GAAA,wCAAa,EAAE;IACzD,IAAI,WAAW,CAAA,GAAA,wBAAU,EAAE,IAAM,kBAAkB,UAAW,cAAc;YAC1E,IAAI,SAAS,OAAO,IAAI,SAAS,OAAO,C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C7B;IAGF,IAAI,aAAa,CAAA,GAAA,oCAAS,EACxB,CAAA,GAAA,mDAAc,GACd,4BACA;QACE,eAAe;QACf,cAAc;IAChB,GACA,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAe,GAAG,mCAC7B,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAe,GAAG,oCAC/C;IAGF,IAAI,YAAY,CAAA,GAAA,oCAAS,EACvB,CAAA,GAAA,mDAAc,GACd;IAGF,IAAI,iBAAsC;IAC1C,IAAI,oBAAoB,aAAa,CAAC,YACpC,+BAAiB,0DAAC,CAAA,GAAA,2DAAI;QAAE,eAAY;QAAe,kBAAkB;;SAChE,IAAI,oBAAoB,WAAW,CAAC,YACzC,+BAAiB,0DAAC,CAAA,GAAA,+DAAQ;QAAE,eAAY;QAAa,kBAAkB;;IAGzE,qBACE,0DAAC;QAAI,MAAK;QAAgB,GAAG,CAAA,GAAA,gCAAS,EAAE,YAAY,WAAW;QAAE,WAAW;QAAgB,OAAO;qBACjG,0DAAC;QAAI,MAAK;QAAe,WAAW;qBAClC,0DAAC;QACC,MAAK;QACL,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAe,GAAG;QACxC,KAAK,CAAA,GAAA,+BAAQ,EAAE,KAAK;qBACpB,0DAAC;QACC,MAAK;QACL,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAe,GAAG;QACxC,OAAO;YAAC,UAAU,MAAM,QAAQ;QAAA;OAC/B,aAIN;AAGP","sources":["packages/@react-spectrum/datepicker/src/Input.tsx"],"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 Alert from '@spectrum-icons/ui/AlertMedium';\nimport Checkmark from '@spectrum-icons/ui/CheckmarkMedium';\nimport {classNames, useValueEffect} from '@react-spectrum/utils';\nimport datepickerStyles from './styles.css';\nimport {mergeProps, mergeRefs, useEvent, useLayoutEffect, useResizeObserver} from '@react-aria/utils';\nimport React, {ReactElement, useCallback, useRef} from 'react';\nimport textfieldStyles from '@adobe/spectrum-css-temp/components/textfield/vars.css';\nimport {useFocusRing} from '@react-aria/focus';\n\nexport const Input = React.forwardRef(function Input(props: any, ref: any) {\n let inputRef = useRef<HTMLInputElement | null>(null);\n let {\n isDisabled,\n isQuiet,\n inputClassName,\n validationState,\n children,\n fieldProps,\n className,\n style,\n disableFocusRing\n } = props;\n\n // Reserve padding for the error icon when the width of the input is unconstrained.\n // When constrained, don't reserve space because adding it only when invalid will\n // not cause a layout shift.\n let [reservePadding, setReservePadding] = useValueEffect(false);\n let onResize = useCallback(() => setReservePadding(function *(reservePadding) {\n if (inputRef.current && inputRef.current.parentElement) {\n if (reservePadding) {\n // Try to collapse padding if the content is clipped.\n if (inputRef.current.scrollWidth > inputRef.current.offsetWidth) {\n let width = inputRef.current.parentElement.offsetWidth;\n yield false;\n\n // If removing padding causes a layout shift, add it back.\n if (inputRef.current.parentElement.offsetWidth !== width) {\n yield true;\n }\n }\n } else {\n // Try to add padding if the content is not clipped.\n if (inputRef.current.offsetWidth >= inputRef.current.scrollWidth) {\n let width = inputRef.current.parentElement.offsetWidth;\n yield true;\n\n // If adding padding does not change the width (i.e. width is constrained), remove it again.\n if (inputRef.current.parentElement.offsetWidth === width) {\n yield false;\n }\n }\n }\n }\n\n }), [inputRef, setReservePadding]);\n\n useLayoutEffect(onResize, [onResize]);\n useResizeObserver({\n ref: inputRef,\n onResize\n });\n\n // We also need to listen for resize events of the window so we can detect\n // when there is enough space for the padding to be re-added. Ideally we'd\n // use a resize observer on a parent element, but it's hard to know _what_\n // parent element.\n useEvent(useRef(typeof window !== 'undefined' ? window : null), 'resize', onResize);\n\n let {focusProps, isFocusVisible, isFocused} = useFocusRing({\n isTextInput: true,\n within: true\n });\n\n let isInvalid = validationState === 'invalid' && !isDisabled;\n let textfieldClass = classNames(\n textfieldStyles,\n 'spectrum-Textfield',\n {\n 'spectrum-Textfield--invalid': isInvalid,\n 'spectrum-Textfield--valid': validationState === 'valid' && !isDisabled,\n 'spectrum-Textfield--quiet': isQuiet,\n 'focus-ring': isFocusVisible && !disableFocusRing\n },\n classNames(datepickerStyles, 'react-spectrum-Datepicker-field'),\n className\n );\n\n let inputClass = classNames(\n textfieldStyles,\n 'spectrum-Textfield-input',\n {\n 'is-disabled': isDisabled,\n 'is-focused': isFocused\n },\n classNames(datepickerStyles, 'react-spectrum-DateField-Input'),\n reservePadding && classNames(datepickerStyles, 'react-spectrum-Datepicker-input'),\n inputClassName\n );\n\n let iconClass = classNames(\n textfieldStyles,\n 'spectrum-Textfield-validationIcon'\n );\n\n let validationIcon: ReactElement | null = null;\n if (validationState === 'invalid' && !isDisabled) {\n validationIcon = <Alert data-testid=\"invalid-icon\" UNSAFE_className={iconClass} />;\n } else if (validationState === 'valid' && !isDisabled) {\n validationIcon = <Checkmark data-testid=\"valid-icon\" UNSAFE_className={iconClass} />;\n }\n\n return (\n <div role=\"presentation\" {...mergeProps(fieldProps, focusProps)} className={textfieldClass} style={style}>\n <div role=\"presentation\" className={inputClass}>\n <div\n role=\"presentation\"\n className={classNames(datepickerStyles, 'react-spectrum-Datepicker-inputContents')}\n ref={mergeRefs(ref, inputRef)}>\n <div\n role=\"presentation\"\n className={classNames(datepickerStyles, 'react-spectrum-Datepicker-inputSized')}\n style={{minWidth: props.minWidth}}>\n {children}\n </div>\n </div>\n </div>\n {validationIcon}\n </div>\n );\n});\n"],"names":[],"version":3,"file":"Input.main.js.map"}
package/dist/Input.mjs DELETED
@@ -1,123 +0,0 @@
1
- import "./datepicker.e85992d8.css";
2
- import $fVzF9$styles_cssmodulejs from "./styles_css.mjs";
3
- import "./datepicker.776a7787.css";
4
- import $fVzF9$textfield_vars_cssmodulejs from "./textfield_vars_css.mjs";
5
- import $fVzF9$spectrumiconsuiAlertMedium from "@spectrum-icons/ui/AlertMedium";
6
- import $fVzF9$spectrumiconsuiCheckmarkMedium from "@spectrum-icons/ui/CheckmarkMedium";
7
- import {useValueEffect as $fVzF9$useValueEffect, classNames as $fVzF9$classNames} from "@react-spectrum/utils";
8
- import {useLayoutEffect as $fVzF9$useLayoutEffect, useResizeObserver as $fVzF9$useResizeObserver, useEvent as $fVzF9$useEvent, mergeProps as $fVzF9$mergeProps, mergeRefs as $fVzF9$mergeRefs} from "@react-aria/utils";
9
- import $fVzF9$react, {useRef as $fVzF9$useRef, useCallback as $fVzF9$useCallback} from "react";
10
- import {useFocusRing as $fVzF9$useFocusRing} from "@react-aria/focus";
11
-
12
-
13
- function $parcel$interopDefault(a) {
14
- return a && a.__esModule ? a.default : a;
15
- }
16
- /*
17
- * Copyright 2020 Adobe. All rights reserved.
18
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
19
- * you may not use this file except in compliance with the License. You may obtain a copy
20
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
21
- *
22
- * Unless required by applicable law or agreed to in writing, software distributed under
23
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
24
- * OF ANY KIND, either express or implied. See the License for the specific language
25
- * governing permissions and limitations under the License.
26
- */
27
-
28
-
29
-
30
-
31
-
32
-
33
-
34
- const $79348162c55d687f$export$f5b8910cec6cf069 = /*#__PURE__*/ (0, $fVzF9$react).forwardRef(function Input(props, ref) {
35
- let inputRef = (0, $fVzF9$useRef)(null);
36
- let { isDisabled: isDisabled, isQuiet: isQuiet, inputClassName: inputClassName, validationState: validationState, children: children, fieldProps: fieldProps, className: className, style: style, disableFocusRing: disableFocusRing } = props;
37
- // Reserve padding for the error icon when the width of the input is unconstrained.
38
- // When constrained, don't reserve space because adding it only when invalid will
39
- // not cause a layout shift.
40
- let [reservePadding, setReservePadding] = (0, $fVzF9$useValueEffect)(false);
41
- let onResize = (0, $fVzF9$useCallback)(()=>setReservePadding(function*(reservePadding) {
42
- if (inputRef.current && inputRef.current.parentElement) {
43
- if (reservePadding) // Try to collapse padding if the content is clipped.
44
- {
45
- if (inputRef.current.scrollWidth > inputRef.current.offsetWidth) {
46
- let width = inputRef.current.parentElement.offsetWidth;
47
- yield false;
48
- // If removing padding causes a layout shift, add it back.
49
- if (inputRef.current.parentElement.offsetWidth !== width) yield true;
50
- }
51
- } else // Try to add padding if the content is not clipped.
52
- if (inputRef.current.offsetWidth >= inputRef.current.scrollWidth) {
53
- let width = inputRef.current.parentElement.offsetWidth;
54
- yield true;
55
- // If adding padding does not change the width (i.e. width is constrained), remove it again.
56
- if (inputRef.current.parentElement.offsetWidth === width) yield false;
57
- }
58
- }
59
- }), [
60
- inputRef,
61
- setReservePadding
62
- ]);
63
- (0, $fVzF9$useLayoutEffect)(onResize, [
64
- onResize
65
- ]);
66
- (0, $fVzF9$useResizeObserver)({
67
- ref: inputRef,
68
- onResize: onResize
69
- });
70
- // We also need to listen for resize events of the window so we can detect
71
- // when there is enough space for the padding to be re-added. Ideally we'd
72
- // use a resize observer on a parent element, but it's hard to know _what_
73
- // parent element.
74
- (0, $fVzF9$useEvent)((0, $fVzF9$useRef)(typeof window !== 'undefined' ? window : null), 'resize', onResize);
75
- let { focusProps: focusProps, isFocusVisible: isFocusVisible, isFocused: isFocused } = (0, $fVzF9$useFocusRing)({
76
- isTextInput: true,
77
- within: true
78
- });
79
- let isInvalid = validationState === 'invalid' && !isDisabled;
80
- let textfieldClass = (0, $fVzF9$classNames)((0, ($parcel$interopDefault($fVzF9$textfield_vars_cssmodulejs))), 'spectrum-Textfield', {
81
- 'spectrum-Textfield--invalid': isInvalid,
82
- 'spectrum-Textfield--valid': validationState === 'valid' && !isDisabled,
83
- 'spectrum-Textfield--quiet': isQuiet,
84
- 'focus-ring': isFocusVisible && !disableFocusRing
85
- }, (0, $fVzF9$classNames)((0, ($parcel$interopDefault($fVzF9$styles_cssmodulejs))), 'react-spectrum-Datepicker-field'), className);
86
- let inputClass = (0, $fVzF9$classNames)((0, ($parcel$interopDefault($fVzF9$textfield_vars_cssmodulejs))), 'spectrum-Textfield-input', {
87
- 'is-disabled': isDisabled,
88
- 'is-focused': isFocused
89
- }, (0, $fVzF9$classNames)((0, ($parcel$interopDefault($fVzF9$styles_cssmodulejs))), 'react-spectrum-DateField-Input'), reservePadding && (0, $fVzF9$classNames)((0, ($parcel$interopDefault($fVzF9$styles_cssmodulejs))), 'react-spectrum-Datepicker-input'), inputClassName);
90
- let iconClass = (0, $fVzF9$classNames)((0, ($parcel$interopDefault($fVzF9$textfield_vars_cssmodulejs))), 'spectrum-Textfield-validationIcon');
91
- let validationIcon = null;
92
- if (validationState === 'invalid' && !isDisabled) validationIcon = /*#__PURE__*/ (0, $fVzF9$react).createElement((0, $fVzF9$spectrumiconsuiAlertMedium), {
93
- "data-testid": "invalid-icon",
94
- UNSAFE_className: iconClass
95
- });
96
- else if (validationState === 'valid' && !isDisabled) validationIcon = /*#__PURE__*/ (0, $fVzF9$react).createElement((0, $fVzF9$spectrumiconsuiCheckmarkMedium), {
97
- "data-testid": "valid-icon",
98
- UNSAFE_className: iconClass
99
- });
100
- return /*#__PURE__*/ (0, $fVzF9$react).createElement("div", {
101
- role: "presentation",
102
- ...(0, $fVzF9$mergeProps)(fieldProps, focusProps),
103
- className: textfieldClass,
104
- style: style
105
- }, /*#__PURE__*/ (0, $fVzF9$react).createElement("div", {
106
- role: "presentation",
107
- className: inputClass
108
- }, /*#__PURE__*/ (0, $fVzF9$react).createElement("div", {
109
- role: "presentation",
110
- className: (0, $fVzF9$classNames)((0, ($parcel$interopDefault($fVzF9$styles_cssmodulejs))), 'react-spectrum-Datepicker-inputContents'),
111
- ref: (0, $fVzF9$mergeRefs)(ref, inputRef)
112
- }, /*#__PURE__*/ (0, $fVzF9$react).createElement("div", {
113
- role: "presentation",
114
- className: (0, $fVzF9$classNames)((0, ($parcel$interopDefault($fVzF9$styles_cssmodulejs))), 'react-spectrum-Datepicker-inputSized'),
115
- style: {
116
- minWidth: props.minWidth
117
- }
118
- }, children))), validationIcon);
119
- });
120
-
121
-
122
- export {$79348162c55d687f$export$f5b8910cec6cf069 as Input};
123
- //# sourceMappingURL=Input.module.js.map