@react-aria/datepicker 3.6.0 → 3.7.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.
- package/dist/import.mjs +7 -6
- package/dist/main.js +7 -6
- package/dist/main.js.map +1 -1
- package/dist/module.js +7 -6
- package/dist/module.js.map +1 -1
- package/package.json +15 -15
- package/src/useDatePicker.ts +2 -2
- package/src/useDatePickerGroup.ts +4 -0
- package/src/useDateRangePicker.ts +2 -2
- package/src/useDateSegment.ts +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-aria/datepicker",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.7.0",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -22,21 +22,21 @@
|
|
|
22
22
|
"url": "https://github.com/adobe/react-spectrum"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@internationalized/date": "^3.
|
|
25
|
+
"@internationalized/date": "^3.5.0",
|
|
26
26
|
"@internationalized/number": "^3.2.1",
|
|
27
27
|
"@internationalized/string": "^3.1.1",
|
|
28
|
-
"@react-aria/focus": "^3.14.
|
|
29
|
-
"@react-aria/i18n": "^3.8.
|
|
30
|
-
"@react-aria/interactions": "^3.
|
|
31
|
-
"@react-aria/label": "^3.
|
|
32
|
-
"@react-aria/spinbutton": "^3.5.
|
|
33
|
-
"@react-aria/utils": "^3.
|
|
34
|
-
"@react-stately/datepicker": "^3.
|
|
35
|
-
"@react-types/button": "^3.
|
|
36
|
-
"@react-types/calendar": "^3.
|
|
37
|
-
"@react-types/datepicker": "^3.
|
|
38
|
-
"@react-types/dialog": "^3.5.
|
|
39
|
-
"@react-types/shared": "^3.
|
|
28
|
+
"@react-aria/focus": "^3.14.1",
|
|
29
|
+
"@react-aria/i18n": "^3.8.2",
|
|
30
|
+
"@react-aria/interactions": "^3.18.0",
|
|
31
|
+
"@react-aria/label": "^3.7.0",
|
|
32
|
+
"@react-aria/spinbutton": "^3.5.2",
|
|
33
|
+
"@react-aria/utils": "^3.20.0",
|
|
34
|
+
"@react-stately/datepicker": "^3.7.0",
|
|
35
|
+
"@react-types/button": "^3.8.0",
|
|
36
|
+
"@react-types/calendar": "^3.4.0",
|
|
37
|
+
"@react-types/datepicker": "^3.6.0",
|
|
38
|
+
"@react-types/dialog": "^3.5.5",
|
|
39
|
+
"@react-types/shared": "^3.20.0",
|
|
40
40
|
"@swc/helpers": "^0.5.0"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "54fbaa67cc56867506811819fef765546d403253"
|
|
50
50
|
}
|
package/src/useDatePicker.ts
CHANGED
|
@@ -129,7 +129,7 @@ export function useDatePicker<T extends DateValue>(props: AriaDatePickerProps<T>
|
|
|
129
129
|
isDisabled: props.isDisabled,
|
|
130
130
|
isReadOnly: props.isReadOnly,
|
|
131
131
|
isRequired: props.isRequired,
|
|
132
|
-
|
|
132
|
+
isInvalid: state.isInvalid,
|
|
133
133
|
autoFocus: props.autoFocus,
|
|
134
134
|
name: props.name
|
|
135
135
|
},
|
|
@@ -159,7 +159,7 @@ export function useDatePicker<T extends DateValue>(props: AriaDatePickerProps<T>
|
|
|
159
159
|
isReadOnly: props.isReadOnly,
|
|
160
160
|
isDateUnavailable: props.isDateUnavailable,
|
|
161
161
|
defaultFocusedValue: state.dateValue ? undefined : props.placeholderValue,
|
|
162
|
-
|
|
162
|
+
isInvalid: state.isInvalid,
|
|
163
163
|
errorMessage: props.errorMessage
|
|
164
164
|
}
|
|
165
165
|
};
|
|
@@ -12,6 +12,10 @@ export function useDatePickerGroup(state: DatePickerState | DateRangePickerState
|
|
|
12
12
|
|
|
13
13
|
// Open the popover on alt + arrow down
|
|
14
14
|
let onKeyDown = (e: KeyboardEvent) => {
|
|
15
|
+
if (!e.currentTarget.contains(e.target)) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
|
|
15
19
|
if (e.altKey && (e.key === 'ArrowDown' || e.key === 'ArrowUp') && 'setOpen' in state) {
|
|
16
20
|
e.preventDefault();
|
|
17
21
|
e.stopPropagation();
|
|
@@ -102,7 +102,7 @@ export function useDateRangePicker<T extends DateValue>(props: AriaDateRangePick
|
|
|
102
102
|
isDisabled: props.isDisabled,
|
|
103
103
|
isReadOnly: props.isReadOnly,
|
|
104
104
|
isRequired: props.isRequired,
|
|
105
|
-
|
|
105
|
+
isInvalid: state.isInvalid
|
|
106
106
|
};
|
|
107
107
|
|
|
108
108
|
let domProps = filterDOMProps(props);
|
|
@@ -187,7 +187,7 @@ export function useDateRangePicker<T extends DateValue>(props: AriaDateRangePick
|
|
|
187
187
|
isDateUnavailable: props.isDateUnavailable,
|
|
188
188
|
allowsNonContiguousRanges: props.allowsNonContiguousRanges,
|
|
189
189
|
defaultFocusedValue: state.dateRange ? undefined : props.placeholderValue,
|
|
190
|
-
|
|
190
|
+
isInvalid: state.isInvalid,
|
|
191
191
|
errorMessage: props.errorMessage
|
|
192
192
|
}
|
|
193
193
|
};
|
package/src/useDateSegment.ts
CHANGED
|
@@ -335,7 +335,7 @@ export function useDateSegment(segment: DateSegment, state: DateFieldState, ref:
|
|
|
335
335
|
// Only apply aria-describedby to the first segment, unless the field is invalid. This avoids it being
|
|
336
336
|
// read every time the user navigates to a new segment.
|
|
337
337
|
let firstSegment = useMemo(() => state.segments.find(s => s.isEditable), [state.segments]);
|
|
338
|
-
if (segment !== firstSegment && state.
|
|
338
|
+
if (segment !== firstSegment && !state.isInvalid) {
|
|
339
339
|
ariaDescribedBy = undefined;
|
|
340
340
|
}
|
|
341
341
|
|
|
@@ -364,7 +364,7 @@ export function useDateSegment(segment: DateSegment, state: DateFieldState, ref:
|
|
|
364
364
|
segmentProps: mergeProps(spinButtonProps, labelProps, {
|
|
365
365
|
id,
|
|
366
366
|
...touchPropOverrides,
|
|
367
|
-
'aria-invalid': state.
|
|
367
|
+
'aria-invalid': state.isInvalid ? 'true' : undefined,
|
|
368
368
|
'aria-describedby': ariaDescribedBy,
|
|
369
369
|
'aria-readonly': state.isReadOnly || !segment.isEditable ? 'true' : undefined,
|
|
370
370
|
'data-placeholder': segment.isPlaceholder || undefined,
|