@react-stately/datepicker 3.9.3 → 3.9.4

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 (54) hide show
  1. package/dist/ar-AE.mjs +1 -1
  2. package/dist/bg-BG.mjs +1 -1
  3. package/dist/cs-CZ.mjs +1 -1
  4. package/dist/da-DK.mjs +1 -1
  5. package/dist/de-DE.mjs +1 -1
  6. package/dist/el-GR.mjs +1 -1
  7. package/dist/en-US.mjs +1 -1
  8. package/dist/es-ES.mjs +1 -1
  9. package/dist/et-EE.mjs +1 -1
  10. package/dist/fi-FI.mjs +1 -1
  11. package/dist/fr-FR.mjs +1 -1
  12. package/dist/he-IL.mjs +1 -1
  13. package/dist/hr-HR.mjs +1 -1
  14. package/dist/hu-HU.mjs +1 -1
  15. package/dist/intlStrings.mjs +1 -1
  16. package/dist/it-IT.mjs +1 -1
  17. package/dist/ja-JP.mjs +1 -1
  18. package/dist/ko-KR.mjs +1 -1
  19. package/dist/lt-LT.mjs +1 -1
  20. package/dist/lv-LV.mjs +1 -1
  21. package/dist/nb-NO.mjs +1 -1
  22. package/dist/nl-NL.mjs +1 -1
  23. package/dist/pl-PL.mjs +1 -1
  24. package/dist/placeholders.main.js +155 -155
  25. package/dist/placeholders.mjs +156 -156
  26. package/dist/placeholders.module.js +155 -155
  27. package/dist/pt-BR.mjs +1 -1
  28. package/dist/pt-PT.mjs +1 -1
  29. package/dist/ro-RO.mjs +1 -1
  30. package/dist/ru-RU.mjs +1 -1
  31. package/dist/sk-SK.mjs +1 -1
  32. package/dist/sl-SI.mjs +1 -1
  33. package/dist/sr-SP.mjs +1 -1
  34. package/dist/sv-SE.mjs +1 -1
  35. package/dist/tr-TR.mjs +1 -1
  36. package/dist/uk-UA.mjs +1 -1
  37. package/dist/useDateFieldState.main.js +41 -41
  38. package/dist/useDateFieldState.mjs +42 -42
  39. package/dist/useDateFieldState.module.js +41 -41
  40. package/dist/useDatePickerState.main.js +9 -9
  41. package/dist/useDatePickerState.mjs +10 -10
  42. package/dist/useDatePickerState.module.js +9 -9
  43. package/dist/useDateRangePickerState.main.js +18 -18
  44. package/dist/useDateRangePickerState.mjs +19 -19
  45. package/dist/useDateRangePickerState.module.js +18 -18
  46. package/dist/useTimeFieldState.main.js +7 -7
  47. package/dist/useTimeFieldState.mjs +8 -8
  48. package/dist/useTimeFieldState.module.js +7 -7
  49. package/dist/utils.main.js +31 -31
  50. package/dist/utils.mjs +32 -32
  51. package/dist/utils.module.js +31 -31
  52. package/dist/zh-CN.mjs +1 -1
  53. package/dist/zh-TW.mjs +1 -1
  54. package/package.json +9 -9
@@ -28,7 +28,7 @@ function $35a22f14a1f04b11$var$getLocale() {
28
28
  // Match browser language setting here, NOT react-aria's I18nProvider, so that we match other browser-provided
29
29
  // validation messages, which to not respect our provider's language.
30
30
  // @ts-ignore
31
- return typeof navigator !== "undefined" && (navigator.language || navigator.userLanguage) || "en-US";
31
+ return typeof navigator !== 'undefined' && (navigator.language || navigator.userLanguage) || 'en-US';
32
32
  }
33
33
  function $35a22f14a1f04b11$export$f18627323ab57ac0(value, minValue, maxValue, isDateUnavailable, options) {
34
34
  let rangeOverflow = value != null && maxValue != null && value.compare(maxValue) > 0;
@@ -38,17 +38,17 @@ function $35a22f14a1f04b11$export$f18627323ab57ac0(value, minValue, maxValue, is
38
38
  let errors = [];
39
39
  if (isInvalid) {
40
40
  let locale = $35a22f14a1f04b11$var$getLocale();
41
- let strings = (0, $bUJMr$LocalizedStringDictionary).getGlobalDictionaryForPackage("@react-stately/datepicker") || $35a22f14a1f04b11$var$dictionary;
41
+ let strings = (0, $bUJMr$LocalizedStringDictionary).getGlobalDictionaryForPackage('@react-stately/datepicker') || $35a22f14a1f04b11$var$dictionary;
42
42
  let formatter = new (0, $bUJMr$LocalizedStringFormatter)(locale, strings);
43
43
  let dateFormatter = new (0, $bUJMr$DateFormatter)(locale, $35a22f14a1f04b11$export$7e319ea407e63bc0({}, options));
44
44
  let timeZone = dateFormatter.resolvedOptions().timeZone;
45
- if (rangeUnderflow) errors.push(formatter.format("rangeUnderflow", {
45
+ if (rangeUnderflow) errors.push(formatter.format('rangeUnderflow', {
46
46
  minValue: dateFormatter.format(minValue.toDate(timeZone))
47
47
  }));
48
- if (rangeOverflow) errors.push(formatter.format("rangeOverflow", {
48
+ if (rangeOverflow) errors.push(formatter.format('rangeOverflow', {
49
49
  maxValue: dateFormatter.format(maxValue.toDate(timeZone))
50
50
  }));
51
- if (isUnavailable) errors.push(formatter.format("unavailableDate"));
51
+ if (isUnavailable) errors.push(formatter.format('unavailableDate'));
52
52
  }
53
53
  return {
54
54
  isInvalid: isInvalid,
@@ -73,11 +73,11 @@ function $35a22f14a1f04b11$export$80ff8fc0ae339c13(value, minValue, maxValue, is
73
73
  let endValidation = $35a22f14a1f04b11$export$f18627323ab57ac0(value === null || value === void 0 ? void 0 : value.end, minValue, maxValue, isDateUnavailable, options);
74
74
  let result = (0, $bUJMr$mergeValidation)(startValidation, endValidation);
75
75
  if (value.end != null && value.start != null && value.end.compare(value.start) < 0) {
76
- let strings = (0, $bUJMr$LocalizedStringDictionary).getGlobalDictionaryForPackage("@react-stately/datepicker") || $35a22f14a1f04b11$var$dictionary;
76
+ let strings = (0, $bUJMr$LocalizedStringDictionary).getGlobalDictionaryForPackage('@react-stately/datepicker') || $35a22f14a1f04b11$var$dictionary;
77
77
  result = (0, $bUJMr$mergeValidation)(result, {
78
78
  isInvalid: true,
79
79
  validationErrors: [
80
- strings.getStringForLocale("rangeReversed", $35a22f14a1f04b11$var$getLocale())
80
+ strings.getStringForLocale('rangeReversed', $35a22f14a1f04b11$var$getLocale())
81
81
  ],
82
82
  validationDetails: {
83
83
  ...(0, $bUJMr$VALID_VALIDITY_STATE),
@@ -90,20 +90,20 @@ function $35a22f14a1f04b11$export$80ff8fc0ae339c13(value, minValue, maxValue, is
90
90
  return result;
91
91
  }
92
92
  const $35a22f14a1f04b11$var$DEFAULT_FIELD_OPTIONS = {
93
- year: "numeric",
94
- month: "numeric",
95
- day: "numeric",
96
- hour: "numeric",
97
- minute: "2-digit",
98
- second: "2-digit"
93
+ year: 'numeric',
94
+ month: 'numeric',
95
+ day: 'numeric',
96
+ hour: 'numeric',
97
+ minute: '2-digit',
98
+ second: '2-digit'
99
99
  };
100
100
  const $35a22f14a1f04b11$var$TWO_DIGIT_FIELD_OPTIONS = {
101
- year: "numeric",
102
- month: "2-digit",
103
- day: "2-digit",
104
- hour: "2-digit",
105
- minute: "2-digit",
106
- second: "2-digit"
101
+ year: 'numeric',
102
+ month: '2-digit',
103
+ day: '2-digit',
104
+ hour: '2-digit',
105
+ minute: '2-digit',
106
+ second: '2-digit'
107
107
  };
108
108
  function $35a22f14a1f04b11$export$7e319ea407e63bc0(fieldOptions, options) {
109
109
  let defaultFieldOptions = options.shouldForceLeadingZeros ? $35a22f14a1f04b11$var$TWO_DIGIT_FIELD_OPTIONS : $35a22f14a1f04b11$var$DEFAULT_FIELD_OPTIONS;
@@ -111,27 +111,27 @@ function $35a22f14a1f04b11$export$7e319ea407e63bc0(fieldOptions, options) {
111
111
  ...defaultFieldOptions,
112
112
  ...fieldOptions
113
113
  };
114
- let granularity = options.granularity || "minute";
114
+ let granularity = options.granularity || 'minute';
115
115
  let keys = Object.keys(fieldOptions);
116
116
  var _options_maxGranularity;
117
- let startIdx = keys.indexOf((_options_maxGranularity = options.maxGranularity) !== null && _options_maxGranularity !== void 0 ? _options_maxGranularity : "year");
117
+ let startIdx = keys.indexOf((_options_maxGranularity = options.maxGranularity) !== null && _options_maxGranularity !== void 0 ? _options_maxGranularity : 'year');
118
118
  if (startIdx < 0) startIdx = 0;
119
119
  let endIdx = keys.indexOf(granularity);
120
120
  if (endIdx < 0) endIdx = 2;
121
- if (startIdx > endIdx) throw new Error("maxGranularity must be greater than granularity");
121
+ if (startIdx > endIdx) throw new Error('maxGranularity must be greater than granularity');
122
122
  let opts = keys.slice(startIdx, endIdx + 1).reduce((opts, key)=>{
123
123
  opts[key] = fieldOptions[key];
124
124
  return opts;
125
125
  }, {});
126
126
  if (options.hourCycle != null) opts.hour12 = options.hourCycle === 12;
127
- opts.timeZone = options.timeZone || "UTC";
128
- let hasTime = granularity === "hour" || granularity === "minute" || granularity === "second";
129
- if (hasTime && options.timeZone && !options.hideTimeZone) opts.timeZoneName = "short";
130
- if (options.showEra && startIdx === 0) opts.era = "short";
127
+ opts.timeZone = options.timeZone || 'UTC';
128
+ let hasTime = granularity === 'hour' || granularity === 'minute' || granularity === 'second';
129
+ if (hasTime && options.timeZone && !options.hideTimeZone) opts.timeZoneName = 'short';
130
+ if (options.showEra && startIdx === 0) opts.era = 'short';
131
131
  return opts;
132
132
  }
133
133
  function $35a22f14a1f04b11$export$c5221a78ef73c5e9(placeholderValue) {
134
- if (placeholderValue && "hour" in placeholderValue) return placeholderValue;
134
+ if (placeholderValue && 'hour' in placeholderValue) return placeholderValue;
135
135
  return new (0, $bUJMr$Time)();
136
136
  }
137
137
  function $35a22f14a1f04b11$export$61a490a80c552550(value, calendar) {
@@ -147,16 +147,16 @@ function $35a22f14a1f04b11$export$66aa2b09de4b1ea5(placeholderValue, granularity
147
147
  second: 0,
148
148
  millisecond: 0
149
149
  }), calendar);
150
- if (granularity === "year" || granularity === "month" || granularity === "day") return (0, $bUJMr$toCalendarDate)(date);
150
+ if (granularity === 'year' || granularity === 'month' || granularity === 'day') return (0, $bUJMr$toCalendarDate)(date);
151
151
  if (!timeZone) return (0, $bUJMr$toCalendarDateTime)(date);
152
152
  return date;
153
153
  }
154
154
  function $35a22f14a1f04b11$export$2440da353cedad43(v, granularity) {
155
155
  // Compute default granularity and time zone from the value. If the value becomes null, keep the last values.
156
- let defaultTimeZone = v && "timeZone" in v ? v.timeZone : undefined;
157
- let defaultGranularity = v && "minute" in v ? "minute" : "day";
156
+ let defaultTimeZone = v && 'timeZone' in v ? v.timeZone : undefined;
157
+ let defaultGranularity = v && 'minute' in v ? 'minute' : 'day';
158
158
  // props.granularity must actually exist in the value if one is provided.
159
- if (v && granularity && !(granularity in v)) throw new Error("Invalid granularity " + granularity + " for value " + v.toString());
159
+ if (v && granularity && !(granularity in v)) throw new Error('Invalid granularity ' + granularity + ' for value ' + v.toString());
160
160
  let [lastValue, setLastValue] = (0, $bUJMr$useState)([
161
161
  defaultGranularity,
162
162
  defaultTimeZone
package/dist/zh-CN.mjs CHANGED
@@ -8,4 +8,4 @@ $e6cc491d590dfda5$exports = {
8
8
 
9
9
 
10
10
  export {$e6cc491d590dfda5$exports as default};
11
- //# sourceMappingURL=zh-CN.mjs.map
11
+ //# sourceMappingURL=zh-CN.module.js.map
package/dist/zh-TW.mjs CHANGED
@@ -8,4 +8,4 @@ $9aebf53181a474bd$exports = {
8
8
 
9
9
 
10
10
  export {$9aebf53181a474bd$exports as default};
11
- //# sourceMappingURL=zh-TW.mjs.map
11
+ //# sourceMappingURL=zh-TW.module.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-stately/datepicker",
3
- "version": "3.9.3",
3
+ "version": "3.9.4",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -22,13 +22,13 @@
22
22
  "url": "https://github.com/adobe/react-spectrum"
23
23
  },
24
24
  "dependencies": {
25
- "@internationalized/date": "^3.5.3",
26
- "@internationalized/string": "^3.2.2",
27
- "@react-stately/form": "^3.0.2",
28
- "@react-stately/overlays": "^3.6.6",
29
- "@react-stately/utils": "^3.10.0",
30
- "@react-types/datepicker": "^3.7.3",
31
- "@react-types/shared": "^3.23.0",
25
+ "@internationalized/date": "^3.5.4",
26
+ "@internationalized/string": "^3.2.3",
27
+ "@react-stately/form": "^3.0.3",
28
+ "@react-stately/overlays": "^3.6.7",
29
+ "@react-stately/utils": "^3.10.1",
30
+ "@react-types/datepicker": "^3.7.4",
31
+ "@react-types/shared": "^3.23.1",
32
32
  "@swc/helpers": "^0.5.0"
33
33
  },
34
34
  "peerDependencies": {
@@ -37,5 +37,5 @@
37
37
  "publishConfig": {
38
38
  "access": "public"
39
39
  },
40
- "gitHead": "f645f29edc1322153fd60af4640cbcab1d992dbd"
40
+ "gitHead": "b77d7d594dff4dcfb5359bffbcfd18142b146433"
41
41
  }