@react-aria/datepicker 3.10.0 → 3.10.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.
- package/dist/ar-AE.mjs +1 -1
- package/dist/bg-BG.mjs +1 -1
- package/dist/cs-CZ.mjs +1 -1
- package/dist/da-DK.mjs +1 -1
- package/dist/de-DE.mjs +1 -1
- package/dist/el-GR.mjs +1 -1
- package/dist/en-US.mjs +1 -1
- package/dist/es-ES.mjs +1 -1
- package/dist/et-EE.mjs +1 -1
- package/dist/fi-FI.mjs +1 -1
- package/dist/fr-FR.mjs +1 -1
- package/dist/he-IL.mjs +1 -1
- package/dist/hr-HR.mjs +1 -1
- package/dist/hu-HU.mjs +1 -1
- package/dist/intlStrings.mjs +1 -1
- package/dist/it-IT.mjs +1 -1
- package/dist/ja-JP.mjs +1 -1
- package/dist/ko-KR.mjs +1 -1
- package/dist/lt-LT.mjs +1 -1
- package/dist/lv-LV.mjs +1 -1
- package/dist/nb-NO.mjs +1 -1
- package/dist/nl-NL.mjs +1 -1
- package/dist/pl-PL.mjs +1 -1
- package/dist/pt-BR.mjs +1 -1
- package/dist/pt-PT.mjs +1 -1
- package/dist/ro-RO.mjs +1 -1
- package/dist/ru-RU.mjs +1 -1
- package/dist/sk-SK.mjs +1 -1
- package/dist/sl-SI.mjs +1 -1
- package/dist/sr-SP.mjs +1 -1
- package/dist/sv-SE.mjs +1 -1
- package/dist/tr-TR.mjs +1 -1
- package/dist/uk-UA.mjs +1 -1
- package/dist/useDateField.main.js +26 -26
- package/dist/useDateField.mjs +27 -27
- package/dist/useDateField.module.js +26 -26
- package/dist/useDatePicker.main.js +22 -22
- package/dist/useDatePicker.mjs +23 -23
- package/dist/useDatePicker.module.js +22 -22
- package/dist/useDatePickerGroup.main.js +9 -9
- package/dist/useDatePickerGroup.mjs +10 -10
- package/dist/useDatePickerGroup.module.js +9 -9
- package/dist/useDateRangePicker.main.js +27 -27
- package/dist/useDateRangePicker.mjs +28 -28
- package/dist/useDateRangePicker.module.js +27 -27
- package/dist/useDateSegment.main.js +72 -72
- package/dist/useDateSegment.mjs +73 -73
- package/dist/useDateSegment.module.js +72 -72
- package/dist/useDisplayNames.main.js +2 -2
- package/dist/useDisplayNames.mjs +3 -3
- package/dist/useDisplayNames.module.js +2 -2
- package/dist/zh-CN.mjs +1 -1
- package/dist/zh-TW.mjs +1 -1
- package/package.json +19 -19
|
@@ -26,27 +26,27 @@ import {useSpinButton as $4d1jn$useSpinButton} from "@react-aria/spinbutton";
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
function $32489daedd52963e$export$1315d136e6f7581(segment, state, ref) {
|
|
29
|
-
let enteredKeys = (0, $4d1jn$useRef)(
|
|
29
|
+
let enteredKeys = (0, $4d1jn$useRef)('');
|
|
30
30
|
let { locale: locale } = (0, $4d1jn$useLocale)();
|
|
31
31
|
let displayNames = (0, $3aeceb3a64eb8358$export$d42c60378c8168f8)();
|
|
32
32
|
let { ariaLabel: ariaLabel, ariaLabelledBy: ariaLabelledBy, ariaDescribedBy: ariaDescribedBy, focusManager: focusManager } = (0, $16f0b7bb276bc17e$export$653eddfc964b0f8a).get(state);
|
|
33
|
-
let textValue = segment.isPlaceholder ?
|
|
33
|
+
let textValue = segment.isPlaceholder ? '' : segment.text;
|
|
34
34
|
let options = (0, $4d1jn$useMemo)(()=>state.dateFormatter.resolvedOptions(), [
|
|
35
35
|
state.dateFormatter
|
|
36
36
|
]);
|
|
37
37
|
let monthDateFormatter = (0, $4d1jn$useDateFormatter)({
|
|
38
|
-
month:
|
|
38
|
+
month: 'long',
|
|
39
39
|
timeZone: options.timeZone
|
|
40
40
|
});
|
|
41
41
|
let hourDateFormatter = (0, $4d1jn$useDateFormatter)({
|
|
42
|
-
hour:
|
|
42
|
+
hour: 'numeric',
|
|
43
43
|
hour12: options.hour12,
|
|
44
44
|
timeZone: options.timeZone
|
|
45
45
|
});
|
|
46
|
-
if (segment.type ===
|
|
46
|
+
if (segment.type === 'month' && !segment.isPlaceholder) {
|
|
47
47
|
let monthTextValue = monthDateFormatter.format(state.dateValue);
|
|
48
48
|
textValue = monthTextValue !== textValue ? `${textValue} \u{2013} ${monthTextValue}` : monthTextValue;
|
|
49
|
-
} else if (segment.type ===
|
|
49
|
+
} else if (segment.type === 'hour' && !segment.isPlaceholder) textValue = hourDateFormatter.format(state.dateValue);
|
|
50
50
|
let { spinButtonProps: spinButtonProps } = (0, $4d1jn$useSpinButton)({
|
|
51
51
|
// The ARIA spec says aria-valuenow is optional if there's no value, but aXe seems to require it.
|
|
52
52
|
// This doesn't seem to have any negative effects with real AT since we also use aria-valuetext.
|
|
@@ -59,27 +59,27 @@ function $32489daedd52963e$export$1315d136e6f7581(segment, state, ref) {
|
|
|
59
59
|
isReadOnly: state.isReadOnly || !segment.isEditable,
|
|
60
60
|
isRequired: state.isRequired,
|
|
61
61
|
onIncrement: ()=>{
|
|
62
|
-
enteredKeys.current =
|
|
62
|
+
enteredKeys.current = '';
|
|
63
63
|
state.increment(segment.type);
|
|
64
64
|
},
|
|
65
65
|
onDecrement: ()=>{
|
|
66
|
-
enteredKeys.current =
|
|
66
|
+
enteredKeys.current = '';
|
|
67
67
|
state.decrement(segment.type);
|
|
68
68
|
},
|
|
69
69
|
onIncrementPage: ()=>{
|
|
70
|
-
enteredKeys.current =
|
|
70
|
+
enteredKeys.current = '';
|
|
71
71
|
state.incrementPage(segment.type);
|
|
72
72
|
},
|
|
73
73
|
onDecrementPage: ()=>{
|
|
74
|
-
enteredKeys.current =
|
|
74
|
+
enteredKeys.current = '';
|
|
75
75
|
state.decrementPage(segment.type);
|
|
76
76
|
},
|
|
77
77
|
onIncrementToMax: ()=>{
|
|
78
|
-
enteredKeys.current =
|
|
78
|
+
enteredKeys.current = '';
|
|
79
79
|
state.setSegment(segment.type, segment.maxValue);
|
|
80
80
|
},
|
|
81
81
|
onDecrementToMin: ()=>{
|
|
82
|
-
enteredKeys.current =
|
|
82
|
+
enteredKeys.current = '';
|
|
83
83
|
state.setSegment(segment.type, segment.minValue);
|
|
84
84
|
}
|
|
85
85
|
});
|
|
@@ -93,20 +93,20 @@ function $32489daedd52963e$export$1315d136e6f7581(segment, state, ref) {
|
|
|
93
93
|
if (parser.isValidPartialNumber(segment.text) && !state.isReadOnly && !segment.isPlaceholder) {
|
|
94
94
|
let newValue = segment.text.slice(0, -1);
|
|
95
95
|
let parsed = parser.parse(newValue);
|
|
96
|
-
newValue = parsed === 0 ?
|
|
96
|
+
newValue = parsed === 0 ? '' : newValue;
|
|
97
97
|
if (newValue.length === 0 || parsed === 0) state.clearSegment(segment.type);
|
|
98
98
|
else state.setSegment(segment.type, parsed);
|
|
99
99
|
enteredKeys.current = newValue;
|
|
100
|
-
} else if (segment.type ===
|
|
100
|
+
} else if (segment.type === 'dayPeriod') state.clearSegment(segment.type);
|
|
101
101
|
};
|
|
102
102
|
let onKeyDown = (e)=>{
|
|
103
103
|
// Firefox does not fire selectstart for Ctrl/Cmd + A
|
|
104
104
|
// https://bugzilla.mozilla.org/show_bug.cgi?id=1742153
|
|
105
|
-
if (e.key ===
|
|
105
|
+
if (e.key === 'a' && ((0, $4d1jn$isMac)() ? e.metaKey : e.ctrlKey)) e.preventDefault();
|
|
106
106
|
if (e.ctrlKey || e.metaKey || e.shiftKey || e.altKey) return;
|
|
107
107
|
switch(e.key){
|
|
108
|
-
case
|
|
109
|
-
case
|
|
108
|
+
case 'Backspace':
|
|
109
|
+
case 'Delete':
|
|
110
110
|
// Safari on iOS does not fire beforeinput for the backspace key because the cursor is at the start.
|
|
111
111
|
e.preventDefault();
|
|
112
112
|
e.stopPropagation();
|
|
@@ -116,34 +116,34 @@ function $32489daedd52963e$export$1315d136e6f7581(segment, state, ref) {
|
|
|
116
116
|
};
|
|
117
117
|
// Safari dayPeriod option doesn't work...
|
|
118
118
|
let { startsWith: startsWith } = (0, $4d1jn$useFilter)({
|
|
119
|
-
sensitivity:
|
|
119
|
+
sensitivity: 'base'
|
|
120
120
|
});
|
|
121
121
|
let amPmFormatter = (0, $4d1jn$useDateFormatter)({
|
|
122
|
-
hour:
|
|
122
|
+
hour: 'numeric',
|
|
123
123
|
hour12: true
|
|
124
124
|
});
|
|
125
125
|
let am = (0, $4d1jn$useMemo)(()=>{
|
|
126
126
|
let date = new Date();
|
|
127
127
|
date.setHours(0);
|
|
128
|
-
return amPmFormatter.formatToParts(date).find((part)=>part.type ===
|
|
128
|
+
return amPmFormatter.formatToParts(date).find((part)=>part.type === 'dayPeriod').value;
|
|
129
129
|
}, [
|
|
130
130
|
amPmFormatter
|
|
131
131
|
]);
|
|
132
132
|
let pm = (0, $4d1jn$useMemo)(()=>{
|
|
133
133
|
let date = new Date();
|
|
134
134
|
date.setHours(12);
|
|
135
|
-
return amPmFormatter.formatToParts(date).find((part)=>part.type ===
|
|
135
|
+
return amPmFormatter.formatToParts(date).find((part)=>part.type === 'dayPeriod').value;
|
|
136
136
|
}, [
|
|
137
137
|
amPmFormatter
|
|
138
138
|
]);
|
|
139
139
|
// Get a list of formatted era names so users can type the first character to choose one.
|
|
140
140
|
let eraFormatter = (0, $4d1jn$useDateFormatter)({
|
|
141
|
-
year:
|
|
142
|
-
era:
|
|
143
|
-
timeZone:
|
|
141
|
+
year: 'numeric',
|
|
142
|
+
era: 'narrow',
|
|
143
|
+
timeZone: 'UTC'
|
|
144
144
|
});
|
|
145
145
|
let eras = (0, $4d1jn$useMemo)(()=>{
|
|
146
|
-
if (segment.type !==
|
|
146
|
+
if (segment.type !== 'era') return [];
|
|
147
147
|
let date = (0, $4d1jn$toCalendar)(new (0, $4d1jn$CalendarDate)(1, 1, 1), state.calendar);
|
|
148
148
|
let eras = state.calendar.getEras().map((era)=>{
|
|
149
149
|
let eraDate = date.set({
|
|
@@ -151,9 +151,9 @@ function $32489daedd52963e$export$1315d136e6f7581(segment, state, ref) {
|
|
|
151
151
|
month: 1,
|
|
152
152
|
day: 1,
|
|
153
153
|
era: era
|
|
154
|
-
}).toDate(
|
|
154
|
+
}).toDate('UTC');
|
|
155
155
|
let parts = eraFormatter.formatToParts(eraDate);
|
|
156
|
-
let formatted = parts.find((p)=>p.type ===
|
|
156
|
+
let formatted = parts.find((p)=>p.type === 'era').value;
|
|
157
157
|
return {
|
|
158
158
|
era: era,
|
|
159
159
|
formatted: formatted
|
|
@@ -174,38 +174,38 @@ function $32489daedd52963e$export$1315d136e6f7581(segment, state, ref) {
|
|
|
174
174
|
if (state.isDisabled || state.isReadOnly) return;
|
|
175
175
|
let newValue = enteredKeys.current + key;
|
|
176
176
|
switch(segment.type){
|
|
177
|
-
case
|
|
178
|
-
if (startsWith(am, key)) state.setSegment(
|
|
179
|
-
else if (startsWith(pm, key)) state.setSegment(
|
|
177
|
+
case 'dayPeriod':
|
|
178
|
+
if (startsWith(am, key)) state.setSegment('dayPeriod', 0);
|
|
179
|
+
else if (startsWith(pm, key)) state.setSegment('dayPeriod', 12);
|
|
180
180
|
else break;
|
|
181
181
|
focusManager.focusNext();
|
|
182
182
|
break;
|
|
183
|
-
case
|
|
183
|
+
case 'era':
|
|
184
184
|
{
|
|
185
185
|
let matched = eras.find((e)=>startsWith(e.formatted, key));
|
|
186
186
|
if (matched) {
|
|
187
|
-
state.setSegment(
|
|
187
|
+
state.setSegment('era', matched.era);
|
|
188
188
|
focusManager.focusNext();
|
|
189
189
|
}
|
|
190
190
|
break;
|
|
191
191
|
}
|
|
192
|
-
case
|
|
193
|
-
case
|
|
194
|
-
case
|
|
195
|
-
case
|
|
196
|
-
case
|
|
197
|
-
case
|
|
192
|
+
case 'day':
|
|
193
|
+
case 'hour':
|
|
194
|
+
case 'minute':
|
|
195
|
+
case 'second':
|
|
196
|
+
case 'month':
|
|
197
|
+
case 'year':
|
|
198
198
|
{
|
|
199
199
|
if (!parser.isValidPartialNumber(newValue)) return;
|
|
200
200
|
let numberValue = parser.parse(newValue);
|
|
201
201
|
let segmentValue = numberValue;
|
|
202
202
|
let allowsZero = segment.minValue === 0;
|
|
203
|
-
if (segment.type ===
|
|
203
|
+
if (segment.type === 'hour' && state.dateFormatter.resolvedOptions().hour12) {
|
|
204
204
|
switch(state.dateFormatter.resolvedOptions().hourCycle){
|
|
205
|
-
case
|
|
205
|
+
case 'h11':
|
|
206
206
|
if (numberValue > 11) segmentValue = parser.parse(key);
|
|
207
207
|
break;
|
|
208
|
-
case
|
|
208
|
+
case 'h12':
|
|
209
209
|
allowsZero = false;
|
|
210
210
|
if (numberValue > 12) segmentValue = parser.parse(key);
|
|
211
211
|
break;
|
|
@@ -215,8 +215,8 @@ function $32489daedd52963e$export$1315d136e6f7581(segment, state, ref) {
|
|
|
215
215
|
if (isNaN(numberValue)) return;
|
|
216
216
|
let shouldSetValue = segmentValue !== 0 || allowsZero;
|
|
217
217
|
if (shouldSetValue) state.setSegment(segment.type, segmentValue);
|
|
218
|
-
if (Number(numberValue +
|
|
219
|
-
enteredKeys.current =
|
|
218
|
+
if (Number(numberValue + '0') > segment.maxValue || newValue.length >= String(segment.maxValue).length) {
|
|
219
|
+
enteredKeys.current = '';
|
|
220
220
|
if (shouldSetValue) focusManager.focusNext();
|
|
221
221
|
} else enteredKeys.current = newValue;
|
|
222
222
|
break;
|
|
@@ -224,7 +224,7 @@ function $32489daedd52963e$export$1315d136e6f7581(segment, state, ref) {
|
|
|
224
224
|
}
|
|
225
225
|
};
|
|
226
226
|
let onFocus = ()=>{
|
|
227
|
-
enteredKeys.current =
|
|
227
|
+
enteredKeys.current = '';
|
|
228
228
|
(0, $4d1jn$scrollIntoViewport)(ref.current, {
|
|
229
229
|
containingElement: (0, $4d1jn$getScrollParent)(ref.current)
|
|
230
230
|
});
|
|
@@ -232,16 +232,16 @@ function $32489daedd52963e$export$1315d136e6f7581(segment, state, ref) {
|
|
|
232
232
|
let selection = window.getSelection();
|
|
233
233
|
selection.collapse(ref.current);
|
|
234
234
|
};
|
|
235
|
-
let compositionRef = (0, $4d1jn$useRef)(
|
|
235
|
+
let compositionRef = (0, $4d1jn$useRef)('');
|
|
236
236
|
// @ts-ignore - TODO: possibly old TS version? doesn't fail in my editor...
|
|
237
|
-
(0, $4d1jn$useEvent)(ref,
|
|
237
|
+
(0, $4d1jn$useEvent)(ref, 'beforeinput', (e)=>{
|
|
238
238
|
e.preventDefault();
|
|
239
239
|
switch(e.inputType){
|
|
240
|
-
case
|
|
241
|
-
case
|
|
240
|
+
case 'deleteContentBackward':
|
|
241
|
+
case 'deleteContentForward':
|
|
242
242
|
if (parser.isValidPartialNumber(segment.text) && !state.isReadOnly) backspace();
|
|
243
243
|
break;
|
|
244
|
-
case
|
|
244
|
+
case 'insertCompositionText':
|
|
245
245
|
// insertCompositionText cannot be canceled.
|
|
246
246
|
// Record the current state of the element so we can restore it in the `input` event below.
|
|
247
247
|
compositionRef.current = ref.current.textContent;
|
|
@@ -254,10 +254,10 @@ function $32489daedd52963e$export$1315d136e6f7581(segment, state, ref) {
|
|
|
254
254
|
break;
|
|
255
255
|
}
|
|
256
256
|
});
|
|
257
|
-
(0, $4d1jn$useEvent)(ref,
|
|
257
|
+
(0, $4d1jn$useEvent)(ref, 'input', (e)=>{
|
|
258
258
|
let { inputType: inputType, data: data } = e;
|
|
259
259
|
switch(inputType){
|
|
260
|
-
case
|
|
260
|
+
case 'insertCompositionText':
|
|
261
261
|
// Reset the DOM to how it was in the beforeinput event.
|
|
262
262
|
ref.current.textContent = compositionRef.current;
|
|
263
263
|
// Android sometimes fires key presses of letters as composition events. Need to handle am/pm keys here too.
|
|
@@ -280,12 +280,12 @@ function $32489daedd52963e$export$1315d136e6f7581(segment, state, ref) {
|
|
|
280
280
|
focusManager
|
|
281
281
|
]);
|
|
282
282
|
// spinbuttons cannot be focused with VoiceOver on iOS.
|
|
283
|
-
let touchPropOverrides = (0, $4d1jn$isIOS)() || segment.type ===
|
|
284
|
-
role:
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
283
|
+
let touchPropOverrides = (0, $4d1jn$isIOS)() || segment.type === 'timeZoneName' ? {
|
|
284
|
+
role: 'textbox',
|
|
285
|
+
'aria-valuemax': null,
|
|
286
|
+
'aria-valuemin': null,
|
|
287
|
+
'aria-valuetext': null,
|
|
288
|
+
'aria-valuenow': null
|
|
289
289
|
} : {};
|
|
290
290
|
// Only apply aria-describedby to the first segment, unless the field is invalid. This avoids it being
|
|
291
291
|
// read every time the user navigates to a new segment.
|
|
@@ -297,39 +297,39 @@ function $32489daedd52963e$export$1315d136e6f7581(segment, state, ref) {
|
|
|
297
297
|
let isEditable = !state.isDisabled && !state.isReadOnly && segment.isEditable;
|
|
298
298
|
// Prepend the label passed from the field to each segment name.
|
|
299
299
|
// This is needed because VoiceOver on iOS does not announce groups.
|
|
300
|
-
let name = segment.type ===
|
|
300
|
+
let name = segment.type === 'literal' ? '' : displayNames.of(segment.type);
|
|
301
301
|
let labelProps = (0, $4d1jn$useLabels)({
|
|
302
|
-
|
|
303
|
-
|
|
302
|
+
'aria-label': `${name}${ariaLabel ? `, ${ariaLabel}` : ''}${ariaLabelledBy ? ', ' : ''}`,
|
|
303
|
+
'aria-labelledby': ariaLabelledBy
|
|
304
304
|
});
|
|
305
305
|
// Literal segments should not be visible to screen readers. We don't really need any of the above,
|
|
306
306
|
// but the rules of hooks mean hooks cannot be conditional so we have to put this condition here.
|
|
307
|
-
if (segment.type ===
|
|
307
|
+
if (segment.type === 'literal') return {
|
|
308
308
|
segmentProps: {
|
|
309
|
-
|
|
309
|
+
'aria-hidden': true
|
|
310
310
|
}
|
|
311
311
|
};
|
|
312
312
|
return {
|
|
313
313
|
segmentProps: (0, $4d1jn$mergeProps)(spinButtonProps, labelProps, {
|
|
314
314
|
id: id,
|
|
315
315
|
...touchPropOverrides,
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
316
|
+
'aria-invalid': state.isInvalid ? 'true' : undefined,
|
|
317
|
+
'aria-describedby': ariaDescribedBy,
|
|
318
|
+
'aria-readonly': state.isReadOnly || !segment.isEditable ? 'true' : undefined,
|
|
319
|
+
'data-placeholder': segment.isPlaceholder || undefined,
|
|
320
320
|
contentEditable: isEditable,
|
|
321
321
|
suppressContentEditableWarning: isEditable,
|
|
322
|
-
spellCheck: isEditable ?
|
|
323
|
-
autoCapitalize: isEditable ?
|
|
324
|
-
autoCorrect: isEditable ?
|
|
322
|
+
spellCheck: isEditable ? 'false' : undefined,
|
|
323
|
+
autoCapitalize: isEditable ? 'off' : undefined,
|
|
324
|
+
autoCorrect: isEditable ? 'off' : undefined,
|
|
325
325
|
// Capitalization was changed in React 17...
|
|
326
|
-
[parseInt((0, $4d1jn$react).version, 10) >= 17 ?
|
|
327
|
-
inputMode: state.isDisabled || segment.type ===
|
|
326
|
+
[parseInt((0, $4d1jn$react).version, 10) >= 17 ? 'enterKeyHint' : 'enterkeyhint']: isEditable ? 'next' : undefined,
|
|
327
|
+
inputMode: state.isDisabled || segment.type === 'dayPeriod' || segment.type === 'era' || !isEditable ? undefined : 'numeric',
|
|
328
328
|
tabIndex: state.isDisabled ? undefined : 0,
|
|
329
329
|
onKeyDown: onKeyDown,
|
|
330
330
|
onFocus: onFocus,
|
|
331
331
|
style: {
|
|
332
|
-
caretColor:
|
|
332
|
+
caretColor: 'transparent'
|
|
333
333
|
},
|
|
334
334
|
// Prevent pointer events from reaching useDatePickerGroup, and allow native browser behavior to focus the segment.
|
|
335
335
|
onPointerDown (e) {
|
|
@@ -28,14 +28,14 @@ $parcel$export(module.exports, "useDisplayNames", () => $934ac650a0aceb4b$export
|
|
|
28
28
|
|
|
29
29
|
function $934ac650a0aceb4b$export$d42c60378c8168f8() {
|
|
30
30
|
let { locale: locale } = (0, $2nNUW$reactariai18n.useLocale)();
|
|
31
|
-
let dictionary = (0, $2nNUW$reactariai18n.useLocalizedStringDictionary)((0, ($parcel$interopDefault($c1905b78f6d2f5bf$exports))),
|
|
31
|
+
let dictionary = (0, $2nNUW$reactariai18n.useLocalizedStringDictionary)((0, ($parcel$interopDefault($c1905b78f6d2f5bf$exports))), '@react-aria/datepicker');
|
|
32
32
|
return (0, $2nNUW$react.useMemo)(()=>{
|
|
33
33
|
// Try to use Intl.DisplayNames if possible. It may be supported in browsers, but not support the dateTimeField
|
|
34
34
|
// type as that was only added in v2. https://github.com/tc39/intl-displaynames-v2
|
|
35
35
|
try {
|
|
36
36
|
// @ts-ignore
|
|
37
37
|
return new Intl.DisplayNames(locale, {
|
|
38
|
-
type:
|
|
38
|
+
type: 'dateTimeField'
|
|
39
39
|
});
|
|
40
40
|
} catch (err) {
|
|
41
41
|
return new $934ac650a0aceb4b$var$DisplayNamesPolyfill(locale, dictionary);
|
package/dist/useDisplayNames.mjs
CHANGED
|
@@ -22,14 +22,14 @@ function $parcel$interopDefault(a) {
|
|
|
22
22
|
|
|
23
23
|
function $3aeceb3a64eb8358$export$d42c60378c8168f8() {
|
|
24
24
|
let { locale: locale } = (0, $jR5iF$useLocale)();
|
|
25
|
-
let dictionary = (0, $jR5iF$useLocalizedStringDictionary)((0, ($parcel$interopDefault($jR5iF$intlStringsmodulejs))),
|
|
25
|
+
let dictionary = (0, $jR5iF$useLocalizedStringDictionary)((0, ($parcel$interopDefault($jR5iF$intlStringsmodulejs))), '@react-aria/datepicker');
|
|
26
26
|
return (0, $jR5iF$useMemo)(()=>{
|
|
27
27
|
// Try to use Intl.DisplayNames if possible. It may be supported in browsers, but not support the dateTimeField
|
|
28
28
|
// type as that was only added in v2. https://github.com/tc39/intl-displaynames-v2
|
|
29
29
|
try {
|
|
30
30
|
// @ts-ignore
|
|
31
31
|
return new Intl.DisplayNames(locale, {
|
|
32
|
-
type:
|
|
32
|
+
type: 'dateTimeField'
|
|
33
33
|
});
|
|
34
34
|
} catch (err) {
|
|
35
35
|
return new $3aeceb3a64eb8358$var$DisplayNamesPolyfill(locale, dictionary);
|
|
@@ -51,4 +51,4 @@ class $3aeceb3a64eb8358$var$DisplayNamesPolyfill {
|
|
|
51
51
|
|
|
52
52
|
|
|
53
53
|
export {$3aeceb3a64eb8358$export$d42c60378c8168f8 as useDisplayNames};
|
|
54
|
-
//# sourceMappingURL=useDisplayNames.
|
|
54
|
+
//# sourceMappingURL=useDisplayNames.module.js.map
|
|
@@ -22,14 +22,14 @@ function $parcel$interopDefault(a) {
|
|
|
22
22
|
|
|
23
23
|
function $3aeceb3a64eb8358$export$d42c60378c8168f8() {
|
|
24
24
|
let { locale: locale } = (0, $jR5iF$useLocale)();
|
|
25
|
-
let dictionary = (0, $jR5iF$useLocalizedStringDictionary)((0, ($parcel$interopDefault($jR5iF$intlStringsmodulejs))),
|
|
25
|
+
let dictionary = (0, $jR5iF$useLocalizedStringDictionary)((0, ($parcel$interopDefault($jR5iF$intlStringsmodulejs))), '@react-aria/datepicker');
|
|
26
26
|
return (0, $jR5iF$useMemo)(()=>{
|
|
27
27
|
// Try to use Intl.DisplayNames if possible. It may be supported in browsers, but not support the dateTimeField
|
|
28
28
|
// type as that was only added in v2. https://github.com/tc39/intl-displaynames-v2
|
|
29
29
|
try {
|
|
30
30
|
// @ts-ignore
|
|
31
31
|
return new Intl.DisplayNames(locale, {
|
|
32
|
-
type:
|
|
32
|
+
type: 'dateTimeField'
|
|
33
33
|
});
|
|
34
34
|
} catch (err) {
|
|
35
35
|
return new $3aeceb3a64eb8358$var$DisplayNamesPolyfill(locale, dictionary);
|
package/dist/zh-CN.mjs
CHANGED
package/dist/zh-TW.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-aria/datepicker",
|
|
3
|
-
"version": "3.10.
|
|
3
|
+
"version": "3.10.1",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -22,23 +22,23 @@
|
|
|
22
22
|
"url": "https://github.com/adobe/react-spectrum"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@internationalized/date": "^3.5.
|
|
26
|
-
"@internationalized/number": "^3.5.
|
|
27
|
-
"@internationalized/string": "^3.2.
|
|
28
|
-
"@react-aria/focus": "^3.17.
|
|
29
|
-
"@react-aria/form": "^3.0.
|
|
30
|
-
"@react-aria/i18n": "^3.11.
|
|
31
|
-
"@react-aria/interactions": "^3.21.
|
|
32
|
-
"@react-aria/label": "^3.7.
|
|
33
|
-
"@react-aria/spinbutton": "^3.6.
|
|
34
|
-
"@react-aria/utils": "^3.24.
|
|
35
|
-
"@react-stately/datepicker": "^3.9.
|
|
36
|
-
"@react-stately/form": "^3.0.
|
|
37
|
-
"@react-types/button": "^3.9.
|
|
38
|
-
"@react-types/calendar": "^3.4.
|
|
39
|
-
"@react-types/datepicker": "^3.7.
|
|
40
|
-
"@react-types/dialog": "^3.5.
|
|
41
|
-
"@react-types/shared": "^3.23.
|
|
25
|
+
"@internationalized/date": "^3.5.4",
|
|
26
|
+
"@internationalized/number": "^3.5.3",
|
|
27
|
+
"@internationalized/string": "^3.2.3",
|
|
28
|
+
"@react-aria/focus": "^3.17.1",
|
|
29
|
+
"@react-aria/form": "^3.0.5",
|
|
30
|
+
"@react-aria/i18n": "^3.11.1",
|
|
31
|
+
"@react-aria/interactions": "^3.21.3",
|
|
32
|
+
"@react-aria/label": "^3.7.8",
|
|
33
|
+
"@react-aria/spinbutton": "^3.6.5",
|
|
34
|
+
"@react-aria/utils": "^3.24.1",
|
|
35
|
+
"@react-stately/datepicker": "^3.9.4",
|
|
36
|
+
"@react-stately/form": "^3.0.3",
|
|
37
|
+
"@react-types/button": "^3.9.4",
|
|
38
|
+
"@react-types/calendar": "^3.4.6",
|
|
39
|
+
"@react-types/datepicker": "^3.7.4",
|
|
40
|
+
"@react-types/dialog": "^3.5.10",
|
|
41
|
+
"@react-types/shared": "^3.23.1",
|
|
42
42
|
"@swc/helpers": "^0.5.0"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "b77d7d594dff4dcfb5359bffbcfd18142b146433"
|
|
52
52
|
}
|