@react-stately/datepicker 3.8.0 → 3.9.1

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 (183) hide show
  1. package/dist/ar-AE.main.js +9 -0
  2. package/dist/ar-AE.main.js.map +1 -0
  3. package/dist/ar-AE.mjs +11 -0
  4. package/dist/ar-AE.module.js +11 -0
  5. package/dist/ar-AE.module.js.map +1 -0
  6. package/dist/bg-BG.main.js +9 -0
  7. package/dist/bg-BG.main.js.map +1 -0
  8. package/dist/bg-BG.mjs +11 -0
  9. package/dist/bg-BG.module.js +11 -0
  10. package/dist/bg-BG.module.js.map +1 -0
  11. package/dist/cs-CZ.main.js +9 -0
  12. package/dist/cs-CZ.main.js.map +1 -0
  13. package/dist/cs-CZ.mjs +11 -0
  14. package/dist/cs-CZ.module.js +11 -0
  15. package/dist/cs-CZ.module.js.map +1 -0
  16. package/dist/da-DK.main.js +9 -0
  17. package/dist/da-DK.main.js.map +1 -0
  18. package/dist/da-DK.mjs +11 -0
  19. package/dist/da-DK.module.js +11 -0
  20. package/dist/da-DK.module.js.map +1 -0
  21. package/dist/de-DE.main.js +9 -0
  22. package/dist/de-DE.main.js.map +1 -0
  23. package/dist/de-DE.mjs +11 -0
  24. package/dist/de-DE.module.js +11 -0
  25. package/dist/de-DE.module.js.map +1 -0
  26. package/dist/el-GR.main.js +9 -0
  27. package/dist/el-GR.main.js.map +1 -0
  28. package/dist/el-GR.mjs +11 -0
  29. package/dist/el-GR.module.js +11 -0
  30. package/dist/el-GR.module.js.map +1 -0
  31. package/dist/en-US.main.js +9 -0
  32. package/dist/en-US.main.js.map +1 -0
  33. package/dist/en-US.mjs +11 -0
  34. package/dist/en-US.module.js +11 -0
  35. package/dist/en-US.module.js.map +1 -0
  36. package/dist/es-ES.main.js +9 -0
  37. package/dist/es-ES.main.js.map +1 -0
  38. package/dist/es-ES.mjs +11 -0
  39. package/dist/es-ES.module.js +11 -0
  40. package/dist/es-ES.module.js.map +1 -0
  41. package/dist/et-EE.main.js +9 -0
  42. package/dist/et-EE.main.js.map +1 -0
  43. package/dist/et-EE.mjs +11 -0
  44. package/dist/et-EE.module.js +11 -0
  45. package/dist/et-EE.module.js.map +1 -0
  46. package/dist/fi-FI.main.js +9 -0
  47. package/dist/fi-FI.main.js.map +1 -0
  48. package/dist/fi-FI.mjs +11 -0
  49. package/dist/fi-FI.module.js +11 -0
  50. package/dist/fi-FI.module.js.map +1 -0
  51. package/dist/fr-FR.main.js +9 -0
  52. package/dist/fr-FR.main.js.map +1 -0
  53. package/dist/fr-FR.mjs +11 -0
  54. package/dist/fr-FR.module.js +11 -0
  55. package/dist/fr-FR.module.js.map +1 -0
  56. package/dist/he-IL.main.js +9 -0
  57. package/dist/he-IL.main.js.map +1 -0
  58. package/dist/he-IL.mjs +11 -0
  59. package/dist/he-IL.module.js +11 -0
  60. package/dist/he-IL.module.js.map +1 -0
  61. package/dist/hr-HR.main.js +9 -0
  62. package/dist/hr-HR.main.js.map +1 -0
  63. package/dist/hr-HR.mjs +11 -0
  64. package/dist/hr-HR.module.js +11 -0
  65. package/dist/hr-HR.module.js.map +1 -0
  66. package/dist/hu-HU.main.js +9 -0
  67. package/dist/hu-HU.main.js.map +1 -0
  68. package/dist/hu-HU.mjs +11 -0
  69. package/dist/hu-HU.module.js +11 -0
  70. package/dist/hu-HU.module.js.map +1 -0
  71. package/dist/import.mjs +361 -98
  72. package/dist/it-IT.main.js +9 -0
  73. package/dist/it-IT.main.js.map +1 -0
  74. package/dist/it-IT.mjs +11 -0
  75. package/dist/it-IT.module.js +11 -0
  76. package/dist/it-IT.module.js.map +1 -0
  77. package/dist/ja-JP.main.js +9 -0
  78. package/dist/ja-JP.main.js.map +1 -0
  79. package/dist/ja-JP.mjs +11 -0
  80. package/dist/ja-JP.module.js +11 -0
  81. package/dist/ja-JP.module.js.map +1 -0
  82. package/dist/ko-KR.main.js +9 -0
  83. package/dist/ko-KR.main.js.map +1 -0
  84. package/dist/ko-KR.mjs +11 -0
  85. package/dist/ko-KR.module.js +11 -0
  86. package/dist/ko-KR.module.js.map +1 -0
  87. package/dist/lt-LT.main.js +9 -0
  88. package/dist/lt-LT.main.js.map +1 -0
  89. package/dist/lt-LT.mjs +11 -0
  90. package/dist/lt-LT.module.js +11 -0
  91. package/dist/lt-LT.module.js.map +1 -0
  92. package/dist/lv-LV.main.js +9 -0
  93. package/dist/lv-LV.main.js.map +1 -0
  94. package/dist/lv-LV.mjs +11 -0
  95. package/dist/lv-LV.module.js +11 -0
  96. package/dist/lv-LV.module.js.map +1 -0
  97. package/dist/main.js +360 -96
  98. package/dist/main.js.map +1 -1
  99. package/dist/module.js +361 -98
  100. package/dist/module.js.map +1 -1
  101. package/dist/nb-NO.main.js +9 -0
  102. package/dist/nb-NO.main.js.map +1 -0
  103. package/dist/nb-NO.mjs +11 -0
  104. package/dist/nb-NO.module.js +11 -0
  105. package/dist/nb-NO.module.js.map +1 -0
  106. package/dist/nl-NL.main.js +9 -0
  107. package/dist/nl-NL.main.js.map +1 -0
  108. package/dist/nl-NL.mjs +11 -0
  109. package/dist/nl-NL.module.js +11 -0
  110. package/dist/nl-NL.module.js.map +1 -0
  111. package/dist/pl-PL.main.js +9 -0
  112. package/dist/pl-PL.main.js.map +1 -0
  113. package/dist/pl-PL.mjs +11 -0
  114. package/dist/pl-PL.module.js +11 -0
  115. package/dist/pl-PL.module.js.map +1 -0
  116. package/dist/pt-BR.main.js +9 -0
  117. package/dist/pt-BR.main.js.map +1 -0
  118. package/dist/pt-BR.mjs +11 -0
  119. package/dist/pt-BR.module.js +11 -0
  120. package/dist/pt-BR.module.js.map +1 -0
  121. package/dist/pt-PT.main.js +9 -0
  122. package/dist/pt-PT.main.js.map +1 -0
  123. package/dist/pt-PT.mjs +11 -0
  124. package/dist/pt-PT.module.js +11 -0
  125. package/dist/pt-PT.module.js.map +1 -0
  126. package/dist/ro-RO.main.js +9 -0
  127. package/dist/ro-RO.main.js.map +1 -0
  128. package/dist/ro-RO.mjs +11 -0
  129. package/dist/ro-RO.module.js +11 -0
  130. package/dist/ro-RO.module.js.map +1 -0
  131. package/dist/ru-RU.main.js +9 -0
  132. package/dist/ru-RU.main.js.map +1 -0
  133. package/dist/ru-RU.mjs +11 -0
  134. package/dist/ru-RU.module.js +11 -0
  135. package/dist/ru-RU.module.js.map +1 -0
  136. package/dist/sk-SK.main.js +9 -0
  137. package/dist/sk-SK.main.js.map +1 -0
  138. package/dist/sk-SK.mjs +11 -0
  139. package/dist/sk-SK.module.js +11 -0
  140. package/dist/sk-SK.module.js.map +1 -0
  141. package/dist/sl-SI.main.js +9 -0
  142. package/dist/sl-SI.main.js.map +1 -0
  143. package/dist/sl-SI.mjs +11 -0
  144. package/dist/sl-SI.module.js +11 -0
  145. package/dist/sl-SI.module.js.map +1 -0
  146. package/dist/sr-SP.main.js +9 -0
  147. package/dist/sr-SP.main.js.map +1 -0
  148. package/dist/sr-SP.mjs +11 -0
  149. package/dist/sr-SP.module.js +11 -0
  150. package/dist/sr-SP.module.js.map +1 -0
  151. package/dist/sv-SE.main.js +9 -0
  152. package/dist/sv-SE.main.js.map +1 -0
  153. package/dist/sv-SE.mjs +11 -0
  154. package/dist/sv-SE.module.js +11 -0
  155. package/dist/sv-SE.module.js.map +1 -0
  156. package/dist/tr-TR.main.js +9 -0
  157. package/dist/tr-TR.main.js.map +1 -0
  158. package/dist/tr-TR.mjs +11 -0
  159. package/dist/tr-TR.module.js +11 -0
  160. package/dist/tr-TR.module.js.map +1 -0
  161. package/dist/types.d.ts +4 -3
  162. package/dist/types.d.ts.map +1 -1
  163. package/dist/uk-UA.main.js +9 -0
  164. package/dist/uk-UA.main.js.map +1 -0
  165. package/dist/uk-UA.mjs +11 -0
  166. package/dist/uk-UA.module.js +11 -0
  167. package/dist/uk-UA.module.js.map +1 -0
  168. package/dist/zh-CN.main.js +9 -0
  169. package/dist/zh-CN.main.js.map +1 -0
  170. package/dist/zh-CN.mjs +11 -0
  171. package/dist/zh-CN.module.js +11 -0
  172. package/dist/zh-CN.module.js.map +1 -0
  173. package/dist/zh-TW.main.js +9 -0
  174. package/dist/zh-TW.main.js.map +1 -0
  175. package/dist/zh-TW.mjs +11 -0
  176. package/dist/zh-TW.module.js +11 -0
  177. package/dist/zh-TW.module.js.map +1 -0
  178. package/package.json +9 -8
  179. package/src/useDateFieldState.ts +23 -5
  180. package/src/useDatePickerState.ts +36 -16
  181. package/src/useDateRangePickerState.ts +35 -12
  182. package/src/useTimeFieldState.ts +5 -3
  183. package/src/utils.ts +104 -5
package/dist/main.js CHANGED
@@ -1,13 +1,53 @@
1
+ var $a16eae39a66f3afd$exports = require("./ar-AE.main.js");
2
+ var $be973442240b2918$exports = require("./bg-BG.main.js");
3
+ var $a1709037331f64d7$exports = require("./cs-CZ.main.js");
4
+ var $1896523498fa2f44$exports = require("./da-DK.main.js");
5
+ var $169837a5a815615d$exports = require("./de-DE.main.js");
6
+ var $cfb55132d6925036$exports = require("./el-GR.main.js");
7
+ var $384a6c8de1da1e62$exports = require("./en-US.main.js");
8
+ var $be8241903709dc6e$exports = require("./es-ES.main.js");
9
+ var $63e1eb192205ecbf$exports = require("./et-EE.main.js");
10
+ var $41dc33071b9981dc$exports = require("./fi-FI.main.js");
11
+ var $c75ba81d7768253e$exports = require("./fr-FR.main.js");
12
+ var $f678f4bf27dcdd12$exports = require("./he-IL.main.js");
13
+ var $d23f6e75dc589b55$exports = require("./hr-HR.main.js");
14
+ var $439e34e0a9a3f4c1$exports = require("./hu-HU.main.js");
15
+ var $449973ba87982f00$exports = require("./it-IT.main.js");
16
+ var $902560907618d6e6$exports = require("./ja-JP.main.js");
17
+ var $8c0f39c970bc2860$exports = require("./ko-KR.main.js");
18
+ var $db03bc54746c5caa$exports = require("./lt-LT.main.js");
19
+ var $3f356a0921f4d37a$exports = require("./lv-LV.main.js");
20
+ var $1265d19da9735bfb$exports = require("./nb-NO.main.js");
21
+ var $7b57f991f3f6edd1$exports = require("./nl-NL.main.js");
22
+ var $04fe5f1360210d7c$exports = require("./pl-PL.main.js");
23
+ var $e64ffd0cafbe4c46$exports = require("./pt-BR.main.js");
24
+ var $f7b4a5fc25c8f238$exports = require("./pt-PT.main.js");
25
+ var $cf72ee454c27a2e7$exports = require("./ro-RO.main.js");
26
+ var $a41511fa599c2cbe$exports = require("./ru-RU.main.js");
27
+ var $2fedc389afac088d$exports = require("./sk-SK.main.js");
28
+ var $b0aebb8d8c040cc9$exports = require("./sl-SI.main.js");
29
+ var $67017d9b82b5d17e$exports = require("./sr-SP.main.js");
30
+ var $833e86f5dac82c23$exports = require("./sv-SE.main.js");
31
+ var $5b72687d362158b0$exports = require("./tr-TR.main.js");
32
+ var $5d2b1be67024bd70$exports = require("./uk-UA.main.js");
33
+ var $644f5cd034787834$exports = require("./zh-CN.main.js");
34
+ var $11c20589c8b82ee8$exports = require("./zh-TW.main.js");
1
35
  var $h2qOe$internationalizeddate = require("@internationalized/date");
36
+ var $h2qOe$reactstatelyform = require("@react-stately/form");
2
37
  var $h2qOe$reactstatelyoverlays = require("@react-stately/overlays");
3
38
  var $h2qOe$reactstatelyutils = require("@react-stately/utils");
4
39
  var $h2qOe$react = require("react");
5
40
  var $h2qOe$internationalizedstring = require("@internationalized/string");
6
41
 
42
+
7
43
  function $parcel$export(e, n, v, s) {
8
44
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
9
45
  }
10
46
 
47
+ function $parcel$interopDefault(a) {
48
+ return a && a.__esModule ? a.default : a;
49
+ }
50
+
11
51
  $parcel$export(module.exports, "useDatePickerState", () => $aaab7a647e17e1fd$export$87194bb378cc3ac2);
12
52
  $parcel$export(module.exports, "useDateFieldState", () => $596a1f0f523d6752$export$60e84778edff6d26);
13
53
  $parcel$export(module.exports, "useDateRangePickerState", () => $7072d26f58deb33b$export$e50a61c1de9f574);
@@ -44,9 +84,144 @@ $parcel$export(module.exports, "useTimeFieldState", () => $2654e87be0231a69$expo
44
84
  * OF ANY KIND, either express or implied. See the License for the specific language
45
85
  * governing permissions and limitations under the License.
46
86
  */
87
+ var $5294278fb5cc815e$exports = {};
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+
111
+
112
+
47
113
 
48
- function $50d5d6a623389320$export$eac50920cf2fd59a(value, minValue, maxValue) {
49
- return value != null && (minValue != null && value.compare(minValue) < 0 || maxValue != null && value.compare(maxValue) > 0);
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+ $5294278fb5cc815e$exports = {
123
+ "ar-AE": $a16eae39a66f3afd$exports,
124
+ "bg-BG": $be973442240b2918$exports,
125
+ "cs-CZ": $a1709037331f64d7$exports,
126
+ "da-DK": $1896523498fa2f44$exports,
127
+ "de-DE": $169837a5a815615d$exports,
128
+ "el-GR": $cfb55132d6925036$exports,
129
+ "en-US": $384a6c8de1da1e62$exports,
130
+ "es-ES": $be8241903709dc6e$exports,
131
+ "et-EE": $63e1eb192205ecbf$exports,
132
+ "fi-FI": $41dc33071b9981dc$exports,
133
+ "fr-FR": $c75ba81d7768253e$exports,
134
+ "he-IL": $f678f4bf27dcdd12$exports,
135
+ "hr-HR": $d23f6e75dc589b55$exports,
136
+ "hu-HU": $439e34e0a9a3f4c1$exports,
137
+ "it-IT": $449973ba87982f00$exports,
138
+ "ja-JP": $902560907618d6e6$exports,
139
+ "ko-KR": $8c0f39c970bc2860$exports,
140
+ "lt-LT": $db03bc54746c5caa$exports,
141
+ "lv-LV": $3f356a0921f4d37a$exports,
142
+ "nb-NO": $1265d19da9735bfb$exports,
143
+ "nl-NL": $7b57f991f3f6edd1$exports,
144
+ "pl-PL": $04fe5f1360210d7c$exports,
145
+ "pt-BR": $e64ffd0cafbe4c46$exports,
146
+ "pt-PT": $f7b4a5fc25c8f238$exports,
147
+ "ro-RO": $cf72ee454c27a2e7$exports,
148
+ "ru-RU": $a41511fa599c2cbe$exports,
149
+ "sk-SK": $2fedc389afac088d$exports,
150
+ "sl-SI": $b0aebb8d8c040cc9$exports,
151
+ "sr-SP": $67017d9b82b5d17e$exports,
152
+ "sv-SE": $833e86f5dac82c23$exports,
153
+ "tr-TR": $5b72687d362158b0$exports,
154
+ "uk-UA": $5d2b1be67024bd70$exports,
155
+ "zh-CN": $644f5cd034787834$exports,
156
+ "zh-TW": $11c20589c8b82ee8$exports
157
+ };
158
+
159
+
160
+
161
+
162
+
163
+ const $50d5d6a623389320$var$dictionary = new (0, $h2qOe$internationalizedstring.LocalizedStringDictionary)((0, (/*@__PURE__*/$parcel$interopDefault($5294278fb5cc815e$exports))));
164
+ function $50d5d6a623389320$var$getLocale() {
165
+ // Match browser language setting here, NOT react-aria's I18nProvider, so that we match other browser-provided
166
+ // validation messages, which to not respect our provider's language.
167
+ // @ts-ignore
168
+ return typeof navigator !== "undefined" && (navigator.language || navigator.userLanguage) || "en-US";
169
+ }
170
+ function $50d5d6a623389320$export$f18627323ab57ac0(value, minValue, maxValue, isDateUnavailable, options) {
171
+ let rangeOverflow = value != null && maxValue != null && value.compare(maxValue) > 0;
172
+ let rangeUnderflow = value != null && minValue != null && value.compare(minValue) < 0;
173
+ let isUnavailable = value != null && (isDateUnavailable === null || isDateUnavailable === void 0 ? void 0 : isDateUnavailable(value)) || false;
174
+ let isInvalid = rangeOverflow || rangeUnderflow || isUnavailable;
175
+ let errors = [];
176
+ if (isInvalid) {
177
+ let locale = $50d5d6a623389320$var$getLocale();
178
+ let strings = (0, $h2qOe$internationalizedstring.LocalizedStringDictionary).getGlobalDictionaryForPackage("@react-stately/datepicker") || $50d5d6a623389320$var$dictionary;
179
+ let formatter = new (0, $h2qOe$internationalizedstring.LocalizedStringFormatter)(locale, strings);
180
+ let dateFormatter = new (0, $h2qOe$internationalizeddate.DateFormatter)(locale, $50d5d6a623389320$export$7e319ea407e63bc0({}, options));
181
+ let timeZone = dateFormatter.resolvedOptions().timeZone;
182
+ if (rangeUnderflow) errors.push(formatter.format("rangeUnderflow", {
183
+ minValue: dateFormatter.format(minValue.toDate(timeZone))
184
+ }));
185
+ if (rangeOverflow) errors.push(formatter.format("rangeOverflow", {
186
+ maxValue: dateFormatter.format(maxValue.toDate(timeZone))
187
+ }));
188
+ if (isUnavailable) errors.push(formatter.format("unavailableDate"));
189
+ }
190
+ return {
191
+ isInvalid: isInvalid,
192
+ validationErrors: errors,
193
+ validationDetails: {
194
+ badInput: isUnavailable,
195
+ customError: false,
196
+ patternMismatch: false,
197
+ rangeOverflow: rangeOverflow,
198
+ rangeUnderflow: rangeUnderflow,
199
+ stepMismatch: false,
200
+ tooLong: false,
201
+ tooShort: false,
202
+ typeMismatch: false,
203
+ valueMissing: false,
204
+ valid: !isInvalid
205
+ }
206
+ };
207
+ }
208
+ function $50d5d6a623389320$export$80ff8fc0ae339c13(value, minValue, maxValue, isDateUnavailable, options) {
209
+ let startValidation = $50d5d6a623389320$export$f18627323ab57ac0(value === null || value === void 0 ? void 0 : value.start, minValue, maxValue, isDateUnavailable, options);
210
+ let endValidation = $50d5d6a623389320$export$f18627323ab57ac0(value === null || value === void 0 ? void 0 : value.end, minValue, maxValue, isDateUnavailable, options);
211
+ let result = (0, $h2qOe$reactstatelyform.mergeValidation)(startValidation, endValidation);
212
+ if (value.end != null && value.start != null && value.end.compare(value.start) < 0) result = (0, $h2qOe$reactstatelyform.mergeValidation)(result, {
213
+ isInvalid: true,
214
+ validationErrors: [
215
+ $50d5d6a623389320$var$dictionary.getStringForLocale("rangeReversed", $50d5d6a623389320$var$getLocale())
216
+ ],
217
+ validationDetails: {
218
+ ...(0, $h2qOe$reactstatelyform.VALID_VALIDITY_STATE),
219
+ rangeUnderflow: true,
220
+ rangeOverflow: true,
221
+ valid: false
222
+ }
223
+ });
224
+ return result;
50
225
  }
51
226
  const $50d5d6a623389320$var$DEFAULT_FIELD_OPTIONS = {
52
227
  year: "numeric",
@@ -137,8 +312,8 @@ function $50d5d6a623389320$export$2440da353cedad43(v, granularity) {
137
312
 
138
313
 
139
314
 
315
+
140
316
  function $aaab7a647e17e1fd$export$87194bb378cc3ac2(props) {
141
- var _props_isDateUnavailable;
142
317
  let overlayState = (0, $h2qOe$reactstatelyoverlays.useOverlayTriggerState)(props);
143
318
  let [value, setValue] = (0, $h2qOe$reactstatelyutils.useControlledState)(props.value, props.defaultValue || null, props.onChange);
144
319
  let v = value || props.placeholderValue;
@@ -155,10 +330,42 @@ function $aaab7a647e17e1fd$export$87194bb378cc3ac2(props) {
155
330
  }
156
331
  // props.granularity must actually exist in the value if one is provided.
157
332
  if (v && !(granularity in v)) throw new Error("Invalid granularity " + granularity + " for value " + v.toString());
333
+ let showEra = (value === null || value === void 0 ? void 0 : value.calendar.identifier) === "gregory" && value.era === "BC";
334
+ let formatOpts = (0, $h2qOe$react.useMemo)(()=>({
335
+ granularity: granularity,
336
+ timeZone: defaultTimeZone,
337
+ hideTimeZone: props.hideTimeZone,
338
+ hourCycle: props.hourCycle,
339
+ shouldForceLeadingZeros: props.shouldForceLeadingZeros,
340
+ showEra: showEra
341
+ }), [
342
+ granularity,
343
+ props.hourCycle,
344
+ props.shouldForceLeadingZeros,
345
+ defaultTimeZone,
346
+ props.hideTimeZone,
347
+ showEra
348
+ ]);
349
+ let { minValue: minValue, maxValue: maxValue, isDateUnavailable: isDateUnavailable } = props;
350
+ let builtinValidation = (0, $h2qOe$react.useMemo)(()=>(0, $50d5d6a623389320$export$f18627323ab57ac0)(value, minValue, maxValue, isDateUnavailable, formatOpts), [
351
+ value,
352
+ minValue,
353
+ maxValue,
354
+ isDateUnavailable,
355
+ formatOpts
356
+ ]);
357
+ let validation = (0, $h2qOe$reactstatelyform.useFormValidationState)({
358
+ ...props,
359
+ value: value,
360
+ builtinValidation: builtinValidation
361
+ });
362
+ let isValueInvalid = validation.displayValidation.isInvalid;
363
+ let validationState = props.validationState || (isValueInvalid ? "invalid" : null);
158
364
  let commitValue = (date, time)=>{
159
365
  setValue("timeZone" in time ? time.set((0, $h2qOe$internationalizeddate.toCalendarDate)(date)) : (0, $h2qOe$internationalizeddate.toCalendarDateTime)(date, time));
160
366
  setSelectedDate(null);
161
367
  setSelectedTime(null);
368
+ validation.commitValidation();
162
369
  };
163
370
  // Intercept setValue to make sure the Time section is not changed by date selection in Calendar
164
371
  let selectDate = (newValue)=>{
@@ -166,16 +373,18 @@ function $aaab7a647e17e1fd$export$87194bb378cc3ac2(props) {
166
373
  if (hasTime) {
167
374
  if (selectedTime || shouldClose) commitValue(newValue, selectedTime || (0, $50d5d6a623389320$export$c5221a78ef73c5e9)(props.placeholderValue));
168
375
  else setSelectedDate(newValue);
169
- } else setValue(newValue);
376
+ } else {
377
+ setValue(newValue);
378
+ validation.commitValidation();
379
+ }
170
380
  if (shouldClose) overlayState.setOpen(false);
171
381
  };
172
382
  let selectTime = (newValue)=>{
173
383
  if (selectedDate && newValue) commitValue(selectedDate, newValue);
174
384
  else setSelectedTime(newValue);
175
385
  };
176
- let isValueInvalid = props.isInvalid || props.validationState === "invalid" || (0, $50d5d6a623389320$export$eac50920cf2fd59a)(value, props.minValue, props.maxValue) || value && ((_props_isDateUnavailable = props.isDateUnavailable) === null || _props_isDateUnavailable === void 0 ? void 0 : _props_isDateUnavailable.call(props, value));
177
- let validationState = props.validationState || (isValueInvalid ? "invalid" : null);
178
386
  return {
387
+ ...validation,
179
388
  value: value,
180
389
  setValue: setValue,
181
390
  dateValue: selectedDate,
@@ -196,13 +405,7 @@ function $aaab7a647e17e1fd$export$87194bb378cc3ac2(props) {
196
405
  isInvalid: isValueInvalid,
197
406
  formatValue (locale, fieldOptions) {
198
407
  if (!dateValue) return "";
199
- let formatOptions = (0, $50d5d6a623389320$export$7e319ea407e63bc0)(fieldOptions, {
200
- granularity: granularity,
201
- timeZone: defaultTimeZone,
202
- hideTimeZone: props.hideTimeZone,
203
- hourCycle: props.hourCycle,
204
- showEra: value.calendar.identifier === "gregory" && value.era === "BC"
205
- });
408
+ let formatOptions = (0, $50d5d6a623389320$export$7e319ea407e63bc0)(fieldOptions, formatOpts);
206
409
  let formatter = new (0, $h2qOe$internationalizeddate.DateFormatter)(locale, formatOptions);
207
410
  return formatter.format(dateValue);
208
411
  }
@@ -222,6 +425,7 @@ function $aaab7a647e17e1fd$export$87194bb378cc3ac2(props) {
222
425
  * governing permissions and limitations under the License.
223
426
  */
224
427
 
428
+
225
429
  /*
226
430
  * Copyright 2020 Adobe. All rights reserved.
227
431
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -248,9 +452,9 @@ const $e1e8ada727fae1a1$var$placeholders = new (0, $h2qOe$internationalizedstrin
248
452
  day: "dd"
249
453
  },
250
454
  am: {
251
- year: "ዓዓዓዓ",
252
- month: "ሚሜ",
253
- day: "ቀቀ"
455
+ year: "\u12D3\u12D3\u12D3\u12D3",
456
+ month: "\u121A\u121C",
457
+ day: "\u1240\u1240"
254
458
  },
255
459
  an: {
256
460
  year: "aaaa",
@@ -258,9 +462,9 @@ const $e1e8ada727fae1a1$var$placeholders = new (0, $h2qOe$internationalizedstrin
258
462
  day: "dd"
259
463
  },
260
464
  ar: {
261
- year: "سنة",
262
- month: "شهر",
263
- day: "يوم"
465
+ year: "\u0633\u0646\u0629",
466
+ month: "\u0634\u0647\u0631",
467
+ day: "\u064A\u0648\u0645"
264
468
  },
265
469
  ast: {
266
470
  year: "aaaa",
@@ -273,18 +477,18 @@ const $e1e8ada727fae1a1$var$placeholders = new (0, $h2qOe$internationalizedstrin
273
477
  day: "gg"
274
478
  },
275
479
  be: {
276
- year: "гггг",
277
- month: "мм",
278
- day: "дд"
480
+ year: "\u0433\u0433\u0433\u0433",
481
+ month: "\u043C\u043C",
482
+ day: "\u0434\u0434"
279
483
  },
280
484
  bg: {
281
- year: "гггг",
282
- month: "мм",
283
- day: "дд"
485
+ year: "\u0433\u0433\u0433\u0433",
486
+ month: "\u043C\u043C",
487
+ day: "\u0434\u0434"
284
488
  },
285
489
  bn: {
286
490
  year: "yyyy",
287
- month: "মিমি",
491
+ month: "\u09AE\u09BF\u09AE\u09BF",
288
492
  day: "dd"
289
493
  },
290
494
  br: {
@@ -308,9 +512,9 @@ const $e1e8ada727fae1a1$var$placeholders = new (0, $h2qOe$internationalizedstrin
308
512
  day: "q'q'"
309
513
  },
310
514
  ckb: {
311
- year: "ساڵ",
312
- month: "مانگ",
313
- day: "ڕۆژ"
515
+ year: "\u0633\u0627\u06B5",
516
+ month: "\u0645\u0627\u0646\u06AF",
517
+ day: "\u0695\u06C6\u0698"
314
518
  },
315
519
  cs: {
316
520
  year: "rrrr",
@@ -335,12 +539,12 @@ const $e1e8ada727fae1a1$var$placeholders = new (0, $h2qOe$internationalizedstrin
335
539
  dsb: {
336
540
  year: "llll",
337
541
  month: "mm",
338
- day: "źź"
542
+ day: "\u017A\u017A"
339
543
  },
340
544
  el: {
341
- year: "εεεε",
342
- month: "μμ",
343
- day: "ηη"
545
+ year: "\u03B5\u03B5\u03B5\u03B5",
546
+ month: "\u03BC\u03BC",
547
+ day: "\u03B7\u03B7"
344
548
  },
345
549
  en: {
346
550
  year: "yyyy",
@@ -368,9 +572,9 @@ const $e1e8ada727fae1a1$var$placeholders = new (0, $h2qOe$internationalizedstrin
368
572
  day: "ee"
369
573
  },
370
574
  fa: {
371
- year: "سال",
372
- month: "ماه",
373
- day: "روز"
575
+ year: "\u0633\u0627\u0644",
576
+ month: "\u0645\u0627\u0647",
577
+ day: "\u0631\u0648\u0632"
374
578
  },
375
579
  ff: {
376
580
  year: "hhhh",
@@ -408,9 +612,9 @@ const $e1e8ada727fae1a1$var$placeholders = new (0, $h2qOe$internationalizedstrin
408
612
  day: "dd"
409
613
  },
410
614
  he: {
411
- year: "שנה",
412
- month: "חודש",
413
- day: "יום"
615
+ year: "\u05E9\u05E0\u05D4",
616
+ month: "\u05D7\u05D5\u05D3\u05E9",
617
+ day: "\u05D9\u05D5\u05DD"
414
618
  },
415
619
  hr: {
416
620
  year: "gggg",
@@ -443,29 +647,29 @@ const $e1e8ada727fae1a1$var$placeholders = new (0, $h2qOe$internationalizedstrin
443
647
  day: "gg"
444
648
  },
445
649
  ja: {
446
- year: " ",
447
- month: "",
448
- day: ""
650
+ year: " \u5E74 ",
651
+ month: "\u6708",
652
+ day: "\u65E5"
449
653
  },
450
654
  ka: {
451
- year: "წწწწ",
452
- month: "თთ",
453
- day: "რრ"
655
+ year: "\u10EC\u10EC\u10EC\u10EC",
656
+ month: "\u10D7\u10D7",
657
+ day: "\u10E0\u10E0"
454
658
  },
455
659
  kk: {
456
- year: "жжжж",
457
- month: "аа",
458
- day: "кк"
660
+ year: "\u0436\u0436\u0436\u0436",
661
+ month: "\u0430\u0430",
662
+ day: "\u043A\u043A"
459
663
  },
460
664
  kn: {
461
- year: "ವವವವ",
462
- month: "ಮಿಮೀ",
463
- day: "ದಿದಿ"
665
+ year: "\u0CB5\u0CB5\u0CB5\u0CB5",
666
+ month: "\u0CAE\u0CBF\u0CAE\u0CC0",
667
+ day: "\u0CA6\u0CBF\u0CA6\u0CBF"
464
668
  },
465
669
  ko: {
466
- year: "연도",
467
- month: "",
468
- day: ""
670
+ year: "\uC5F0\uB3C4",
671
+ month: "\uC6D4",
672
+ day: "\uC77C"
469
673
  },
470
674
  lb: {
471
675
  year: "jjjj",
@@ -473,9 +677,9 @@ const $e1e8ada727fae1a1$var$placeholders = new (0, $h2qOe$internationalizedstrin
473
677
  day: "dd"
474
678
  },
475
679
  lo: {
476
- year: "ປປປປ",
477
- month: "ດດ",
478
- day: "ວວ"
680
+ year: "\u0E9B\u0E9B\u0E9B\u0E9B",
681
+ month: "\u0E94\u0E94",
682
+ day: "\u0EA7\u0EA7"
479
683
  },
480
684
  lt: {
481
685
  year: "mmmm",
@@ -493,9 +697,9 @@ const $e1e8ada727fae1a1$var$placeholders = new (0, $h2qOe$internationalizedstrin
493
697
  day: "dd"
494
698
  },
495
699
  ml: {
496
- year: "വർഷം",
497
- month: "മാസം",
498
- day: "തീയതി"
700
+ year: "\u0D35\u0D7C\u0D37\u0D02",
701
+ month: "\u0D2E\u0D3E\u0D38\u0D02",
702
+ day: "\u0D24\u0D40\u0D2F\u0D24\u0D3F"
499
703
  },
500
704
  ms: {
501
705
  year: "tttt",
@@ -543,9 +747,9 @@ const $e1e8ada727fae1a1$var$placeholders = new (0, $h2qOe$internationalizedstrin
543
747
  day: "zz"
544
748
  },
545
749
  ru: {
546
- year: "гггг",
547
- month: "мм",
548
- day: "дд"
750
+ year: "\u0433\u0433\u0433\u0433",
751
+ month: "\u043C\u043C",
752
+ day: "\u0434\u0434"
549
753
  },
550
754
  sc: {
551
755
  year: "aaaa",
@@ -568,9 +772,9 @@ const $e1e8ada727fae1a1$var$placeholders = new (0, $h2qOe$internationalizedstrin
568
772
  day: "dd"
569
773
  },
570
774
  sr: {
571
- year: "гггг",
572
- month: "мм",
573
- day: "дд"
775
+ year: "\u0433\u0433\u0433\u0433",
776
+ month: "\u043C\u043C",
777
+ day: "\u0434\u0434"
574
778
  },
575
779
  sv: {
576
780
  year: "\xe5\xe5\xe5\xe5",
@@ -583,14 +787,14 @@ const $e1e8ada727fae1a1$var$placeholders = new (0, $h2qOe$internationalizedstrin
583
787
  day: "dd"
584
788
  },
585
789
  tg: {
586
- year: "сссс",
587
- month: "мм",
588
- day: "рр"
790
+ year: "\u0441\u0441\u0441\u0441",
791
+ month: "\u043C\u043C",
792
+ day: "\u0440\u0440"
589
793
  },
590
794
  th: {
591
- year: "ปปปป",
592
- month: "ดด",
593
- day: "วว"
795
+ year: "\u0E1B\u0E1B\u0E1B\u0E1B",
796
+ month: "\u0E14\u0E14",
797
+ day: "\u0E27\u0E27"
594
798
  },
595
799
  tr: {
596
800
  year: "yyyy",
@@ -598,19 +802,19 @@ const $e1e8ada727fae1a1$var$placeholders = new (0, $h2qOe$internationalizedstrin
598
802
  day: "gg"
599
803
  },
600
804
  uk: {
601
- year: "рррр",
602
- month: "мм",
603
- day: "дд"
805
+ year: "\u0440\u0440\u0440\u0440",
806
+ month: "\u043C\u043C",
807
+ day: "\u0434\u0434"
604
808
  },
605
809
  "zh-CN": {
606
- year: "",
607
- month: "",
608
- day: ""
810
+ year: "\u5E74",
811
+ month: "\u6708",
812
+ day: "\u65E5"
609
813
  },
610
814
  "zh-TW": {
611
- year: "",
612
- month: "",
613
- day: ""
815
+ year: "\u5E74",
816
+ month: "\u6708",
817
+ day: "\u65E5"
614
818
  }
615
819
  }, "en");
616
820
  function $e1e8ada727fae1a1$export$d3f5c5e0a5023fa0(field, value, locale) {
@@ -618,7 +822,7 @@ function $e1e8ada727fae1a1$export$d3f5c5e0a5023fa0(field, value, locale) {
618
822
  if (field === "era" || field === "dayPeriod") return value;
619
823
  if (field === "year" || field === "month" || field === "day") return $e1e8ada727fae1a1$var$placeholders.getStringForLocale(field, locale);
620
824
  // For time fields (e.g. hour, minute, etc.), use two dashes as the placeholder.
621
- return "––";
825
+ return "\u2013\u2013";
622
826
  }
623
827
 
624
828
 
@@ -647,7 +851,7 @@ const $596a1f0f523d6752$var$TYPE_MAPPING = {
647
851
  dayperiod: "dayPeriod"
648
852
  };
649
853
  function $596a1f0f523d6752$export$60e84778edff6d26(props) {
650
- let { locale: locale, createCalendar: createCalendar, hideTimeZone: hideTimeZone, isDisabled: isDisabled, isReadOnly: isReadOnly, isRequired: isRequired } = props;
854
+ let { locale: locale, createCalendar: createCalendar, hideTimeZone: hideTimeZone, isDisabled: isDisabled, isReadOnly: isReadOnly, isRequired: isRequired, minValue: minValue, maxValue: maxValue, isDateUnavailable: isDateUnavailable } = props;
651
855
  let v = props.value || props.defaultValue || props.placeholderValue;
652
856
  let [granularity, defaultTimeZone] = (0, $50d5d6a623389320$export$2440da353cedad43)(v, props.granularity);
653
857
  let timeZone = defaultTimeZone || "UTC";
@@ -672,8 +876,9 @@ function $596a1f0f523d6752$export$60e84778edff6d26(props) {
672
876
  let [placeholderDate, setPlaceholderDate] = (0, $h2qOe$react.useState)(()=>(0, $50d5d6a623389320$export$66aa2b09de4b1ea5)(props.placeholderValue, granularity, calendar, defaultTimeZone));
673
877
  let val = calendarValue || placeholderDate;
674
878
  let showEra = calendar.identifier === "gregory" && val.era === "BC";
675
- var _props_maxGranularity;
676
- let formatOpts = (0, $h2qOe$react.useMemo)(()=>({
879
+ let formatOpts = (0, $h2qOe$react.useMemo)(()=>{
880
+ var _props_maxGranularity;
881
+ return {
677
882
  granularity: granularity,
678
883
  maxGranularity: (_props_maxGranularity = props.maxGranularity) !== null && _props_maxGranularity !== void 0 ? _props_maxGranularity : "year",
679
884
  timeZone: defaultTimeZone,
@@ -681,7 +886,8 @@ function $596a1f0f523d6752$export$60e84778edff6d26(props) {
681
886
  hourCycle: props.hourCycle,
682
887
  showEra: showEra,
683
888
  shouldForceLeadingZeros: props.shouldForceLeadingZeros
684
- }), [
889
+ };
890
+ }, [
685
891
  props.maxGranularity,
686
892
  granularity,
687
893
  props.hourCycle,
@@ -809,10 +1015,23 @@ function $596a1f0f523d6752$export$60e84778edff6d26(props) {
809
1015
  if (validKeys.length >= allKeys.length || validKeys.length === allKeys.length - 1 && allSegments.dayPeriod && !validSegments.dayPeriod) setValue(displayValue);
810
1016
  } else setValue($596a1f0f523d6752$var$addSegment(displayValue, type, amount, resolvedOptions));
811
1017
  };
812
- let isValueInvalid = props.isInvalid || props.validationState === "invalid" || (0, $50d5d6a623389320$export$eac50920cf2fd59a)(calendarValue, props.minValue, props.maxValue);
1018
+ let builtinValidation = (0, $h2qOe$react.useMemo)(()=>(0, $50d5d6a623389320$export$f18627323ab57ac0)(value, minValue, maxValue, isDateUnavailable, formatOpts), [
1019
+ value,
1020
+ minValue,
1021
+ maxValue,
1022
+ isDateUnavailable,
1023
+ formatOpts
1024
+ ]);
1025
+ let validation = (0, $h2qOe$reactstatelyform.useFormValidationState)({
1026
+ ...props,
1027
+ value: value,
1028
+ builtinValidation: builtinValidation
1029
+ });
1030
+ let isValueInvalid = validation.displayValidation.isInvalid;
813
1031
  let validationState = props.validationState || (isValueInvalid ? "invalid" : null);
814
- var _props_maxGranularity1;
1032
+ var _props_maxGranularity;
815
1033
  return {
1034
+ ...validation,
816
1035
  value: calendarValue,
817
1036
  dateValue: dateValue,
818
1037
  calendar: calendar,
@@ -822,7 +1041,7 @@ function $596a1f0f523d6752$export$60e84778edff6d26(props) {
822
1041
  validationState: validationState,
823
1042
  isInvalid: isValueInvalid,
824
1043
  granularity: granularity,
825
- maxGranularity: (_props_maxGranularity1 = props.maxGranularity) !== null && _props_maxGranularity1 !== void 0 ? _props_maxGranularity1 : "year",
1044
+ maxGranularity: (_props_maxGranularity = props.maxGranularity) !== null && _props_maxGranularity !== void 0 ? _props_maxGranularity : "year",
826
1045
  isDisabled: isDisabled,
827
1046
  isReadOnly: isReadOnly,
828
1047
  isRequired: isRequired,
@@ -1035,8 +1254,9 @@ function $596a1f0f523d6752$var$setSegment(value, part, segmentValue, options) {
1035
1254
 
1036
1255
 
1037
1256
 
1257
+
1038
1258
  function $7072d26f58deb33b$export$e50a61c1de9f574(props) {
1039
- var _props_isDateUnavailable, _props_isDateUnavailable1;
1259
+ var _value_start, _value_end;
1040
1260
  let overlayState = (0, $h2qOe$reactstatelyoverlays.useOverlayTriggerState)(props);
1041
1261
  let [controlledValue, setControlledValue] = (0, $h2qOe$reactstatelyutils.useControlledState)(props.value, props.defaultValue || null, props.onChange);
1042
1262
  let [placeholderValue, setPlaceholderValue] = (0, $h2qOe$react.useState)(()=>controlledValue || {
@@ -1061,7 +1281,7 @@ function $7072d26f58deb33b$export$e50a61c1de9f574(props) {
1061
1281
  else setControlledValue(null);
1062
1282
  };
1063
1283
  let v = (value === null || value === void 0 ? void 0 : value.start) || (value === null || value === void 0 ? void 0 : value.end) || props.placeholderValue;
1064
- let [granularity] = (0, $50d5d6a623389320$export$2440da353cedad43)(v, props.granularity);
1284
+ let [granularity, defaultTimeZone] = (0, $50d5d6a623389320$export$2440da353cedad43)(v, props.granularity);
1065
1285
  let hasTime = granularity === "hour" || granularity === "minute" || granularity === "second";
1066
1286
  var _props_shouldCloseOnSelect;
1067
1287
  let shouldCloseOnSelect = (_props_shouldCloseOnSelect = props.shouldCloseOnSelect) !== null && _props_shouldCloseOnSelect !== void 0 ? _props_shouldCloseOnSelect : true;
@@ -1078,6 +1298,7 @@ function $7072d26f58deb33b$export$e50a61c1de9f574(props) {
1078
1298
  });
1079
1299
  setSelectedDateRange(null);
1080
1300
  setSelectedTimeRange(null);
1301
+ validation.commitValidation();
1081
1302
  };
1082
1303
  // Intercept setValue to make sure the Time section is not changed by date selection in Calendar
1083
1304
  let setDateRange = (range)=>{
@@ -1088,17 +1309,56 @@ function $7072d26f58deb33b$export$e50a61c1de9f574(props) {
1088
1309
  end: (timeRange === null || timeRange === void 0 ? void 0 : timeRange.end) || (0, $50d5d6a623389320$export$c5221a78ef73c5e9)(props.placeholderValue)
1089
1310
  });
1090
1311
  else setSelectedDateRange(range);
1091
- } else if (range.start && range.end) setValue(range);
1092
- else setSelectedDateRange(range);
1312
+ } else if (range.start && range.end) {
1313
+ setValue(range);
1314
+ validation.commitValidation();
1315
+ } else setSelectedDateRange(range);
1093
1316
  if (shouldClose) overlayState.setOpen(false);
1094
1317
  };
1095
1318
  let setTimeRange = (range)=>{
1096
1319
  if ((dateRange === null || dateRange === void 0 ? void 0 : dateRange.start) && (dateRange === null || dateRange === void 0 ? void 0 : dateRange.end) && range.start && range.end) commitValue(dateRange, range);
1097
1320
  else setSelectedTimeRange(range);
1098
1321
  };
1099
- let isValueInvalid = props.isInvalid || props.validationState === "invalid" || value != null && ((0, $50d5d6a623389320$export$eac50920cf2fd59a)(value.start, props.minValue, props.maxValue) || (0, $50d5d6a623389320$export$eac50920cf2fd59a)(value.end, props.minValue, props.maxValue) || value.end != null && value.start != null && value.end.compare(value.start) < 0 || (value === null || value === void 0 ? void 0 : value.start) && ((_props_isDateUnavailable = props.isDateUnavailable) === null || _props_isDateUnavailable === void 0 ? void 0 : _props_isDateUnavailable.call(props, value.start)) || (value === null || value === void 0 ? void 0 : value.end) && ((_props_isDateUnavailable1 = props.isDateUnavailable) === null || _props_isDateUnavailable1 === void 0 ? void 0 : _props_isDateUnavailable1.call(props, value.end)));
1322
+ let showEra = (value === null || value === void 0 ? void 0 : (_value_start = value.start) === null || _value_start === void 0 ? void 0 : _value_start.calendar.identifier) === "gregory" && value.start.era === "BC" || (value === null || value === void 0 ? void 0 : (_value_end = value.end) === null || _value_end === void 0 ? void 0 : _value_end.calendar.identifier) === "gregory" && value.end.era === "BC";
1323
+ let formatOpts = (0, $h2qOe$react.useMemo)(()=>({
1324
+ granularity: granularity,
1325
+ timeZone: defaultTimeZone,
1326
+ hideTimeZone: props.hideTimeZone,
1327
+ hourCycle: props.hourCycle,
1328
+ shouldForceLeadingZeros: props.shouldForceLeadingZeros,
1329
+ showEra: showEra
1330
+ }), [
1331
+ granularity,
1332
+ props.hourCycle,
1333
+ props.shouldForceLeadingZeros,
1334
+ defaultTimeZone,
1335
+ props.hideTimeZone,
1336
+ showEra
1337
+ ]);
1338
+ let { minValue: minValue, maxValue: maxValue, isDateUnavailable: isDateUnavailable } = props;
1339
+ let builtinValidation = (0, $h2qOe$react.useMemo)(()=>(0, $50d5d6a623389320$export$80ff8fc0ae339c13)(value, minValue, maxValue, isDateUnavailable, formatOpts), [
1340
+ value,
1341
+ minValue,
1342
+ maxValue,
1343
+ isDateUnavailable,
1344
+ formatOpts
1345
+ ]);
1346
+ let validation = (0, $h2qOe$reactstatelyform.useFormValidationState)({
1347
+ ...props,
1348
+ value: controlledValue,
1349
+ name: (0, $h2qOe$react.useMemo)(()=>[
1350
+ props.startName,
1351
+ props.endName
1352
+ ], [
1353
+ props.startName,
1354
+ props.endName
1355
+ ]),
1356
+ builtinValidation: builtinValidation
1357
+ });
1358
+ let isValueInvalid = validation.displayValidation.isInvalid;
1100
1359
  let validationState = props.validationState || (isValueInvalid ? "invalid" : null);
1101
1360
  return {
1361
+ ...validation,
1102
1362
  value: value,
1103
1363
  setValue: setValue,
1104
1364
  dateRange: dateRange,
@@ -1217,7 +1477,7 @@ function $7072d26f58deb33b$export$e50a61c1de9f574(props) {
1217
1477
 
1218
1478
 
1219
1479
  function $2654e87be0231a69$export$fd53cef0cc796101(props) {
1220
- let { placeholderValue: placeholderValue = new (0, $h2qOe$internationalizeddate.Time)(), minValue: minValue, maxValue: maxValue, granularity: granularity } = props;
1480
+ let { placeholderValue: placeholderValue = new (0, $h2qOe$internationalizeddate.Time)(), minValue: minValue, maxValue: maxValue, granularity: granularity, validate: validate } = props;
1221
1481
  let [value, setValue] = (0, $h2qOe$reactstatelyutils.useControlledState)(props.value, props.defaultValue, props.onChange);
1222
1482
  let v = value || placeholderValue;
1223
1483
  let day = v && "day" in v ? v : undefined;
@@ -1258,7 +1518,11 @@ function $2654e87be0231a69$export$fd53cef0cc796101(props) {
1258
1518
  maxGranularity: "hour",
1259
1519
  placeholderValue: placeholderDate,
1260
1520
  // Calendar should not matter for time fields.
1261
- createCalendar: ()=>new (0, $h2qOe$internationalizeddate.GregorianCalendar)()
1521
+ createCalendar: ()=>new (0, $h2qOe$internationalizeddate.GregorianCalendar)(),
1522
+ validate: (0, $h2qOe$react.useCallback)(()=>validate === null || validate === void 0 ? void 0 : validate(value), [
1523
+ validate,
1524
+ value
1525
+ ])
1262
1526
  });
1263
1527
  return {
1264
1528
  ...state,