@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/dist/import.mjs
CHANGED
|
@@ -814,6 +814,7 @@ function $3dfb0f96be0d6a08$export$4a931266a3838b86(state, ref, disableArrowNavig
|
|
|
814
814
|
]);
|
|
815
815
|
// Open the popover on alt + arrow down
|
|
816
816
|
let onKeyDown = (e)=>{
|
|
817
|
+
if (!e.currentTarget.contains(e.target)) return;
|
|
817
818
|
if (e.altKey && (e.key === "ArrowDown" || e.key === "ArrowUp") && "setOpen" in state) {
|
|
818
819
|
e.preventDefault();
|
|
819
820
|
e.stopPropagation();
|
|
@@ -1061,7 +1062,7 @@ function $6057a3d2a53a12fd$export$42df105a73306d51(props, state, ref) {
|
|
|
1061
1062
|
isDisabled: props.isDisabled,
|
|
1062
1063
|
isReadOnly: props.isReadOnly,
|
|
1063
1064
|
isRequired: props.isRequired,
|
|
1064
|
-
|
|
1065
|
+
isInvalid: state.isInvalid,
|
|
1065
1066
|
autoFocus: props.autoFocus,
|
|
1066
1067
|
name: props.name
|
|
1067
1068
|
},
|
|
@@ -1091,7 +1092,7 @@ function $6057a3d2a53a12fd$export$42df105a73306d51(props, state, ref) {
|
|
|
1091
1092
|
isReadOnly: props.isReadOnly,
|
|
1092
1093
|
isDateUnavailable: props.isDateUnavailable,
|
|
1093
1094
|
defaultFocusedValue: state.dateValue ? undefined : props.placeholderValue,
|
|
1094
|
-
|
|
1095
|
+
isInvalid: state.isInvalid,
|
|
1095
1096
|
errorMessage: props.errorMessage
|
|
1096
1097
|
}
|
|
1097
1098
|
};
|
|
@@ -1423,7 +1424,7 @@ function $32489daedd52963e$export$1315d136e6f7581(segment, state, ref) {
|
|
|
1423
1424
|
let firstSegment = (0, $cIPI0$useMemo)(()=>state.segments.find((s)=>s.isEditable), [
|
|
1424
1425
|
state.segments
|
|
1425
1426
|
]);
|
|
1426
|
-
if (segment !== firstSegment && state.
|
|
1427
|
+
if (segment !== firstSegment && !state.isInvalid) ariaDescribedBy = undefined;
|
|
1427
1428
|
let id = (0, $cIPI0$useId)();
|
|
1428
1429
|
let isEditable = !state.isDisabled && !state.isReadOnly && segment.isEditable;
|
|
1429
1430
|
// Prepend the label passed from the field to each segment name.
|
|
@@ -1444,7 +1445,7 @@ function $32489daedd52963e$export$1315d136e6f7581(segment, state, ref) {
|
|
|
1444
1445
|
segmentProps: (0, $cIPI0$mergeProps)(spinButtonProps, labelProps, {
|
|
1445
1446
|
id: id,
|
|
1446
1447
|
...touchPropOverrides,
|
|
1447
|
-
"aria-invalid": state.
|
|
1448
|
+
"aria-invalid": state.isInvalid ? "true" : undefined,
|
|
1448
1449
|
"aria-describedby": ariaDescribedBy,
|
|
1449
1450
|
"aria-readonly": state.isReadOnly || !segment.isEditable ? "true" : undefined,
|
|
1450
1451
|
"data-placeholder": segment.isPlaceholder || undefined,
|
|
@@ -1557,7 +1558,7 @@ function $887cac91b7cc8801$export$12fd5f0e9f4bb192(props, state, ref) {
|
|
|
1557
1558
|
isDisabled: props.isDisabled,
|
|
1558
1559
|
isReadOnly: props.isReadOnly,
|
|
1559
1560
|
isRequired: props.isRequired,
|
|
1560
|
-
|
|
1561
|
+
isInvalid: state.isInvalid
|
|
1561
1562
|
};
|
|
1562
1563
|
let domProps = (0, $cIPI0$filterDOMProps)(props);
|
|
1563
1564
|
let { focusWithinProps: focusWithinProps } = (0, $cIPI0$useFocusWithin)({
|
|
@@ -1629,7 +1630,7 @@ function $887cac91b7cc8801$export$12fd5f0e9f4bb192(props, state, ref) {
|
|
|
1629
1630
|
isDateUnavailable: props.isDateUnavailable,
|
|
1630
1631
|
allowsNonContiguousRanges: props.allowsNonContiguousRanges,
|
|
1631
1632
|
defaultFocusedValue: state.dateRange ? undefined : props.placeholderValue,
|
|
1632
|
-
|
|
1633
|
+
isInvalid: state.isInvalid,
|
|
1633
1634
|
errorMessage: props.errorMessage
|
|
1634
1635
|
}
|
|
1635
1636
|
};
|
package/dist/main.js
CHANGED
|
@@ -824,6 +824,7 @@ function $715562ad3b4cced4$export$4a931266a3838b86(state, ref, disableArrowNavig
|
|
|
824
824
|
]);
|
|
825
825
|
// Open the popover on alt + arrow down
|
|
826
826
|
let onKeyDown = (e)=>{
|
|
827
|
+
if (!e.currentTarget.contains(e.target)) return;
|
|
827
828
|
if (e.altKey && (e.key === "ArrowDown" || e.key === "ArrowUp") && "setOpen" in state) {
|
|
828
829
|
e.preventDefault();
|
|
829
830
|
e.stopPropagation();
|
|
@@ -1071,7 +1072,7 @@ function $e90ae7c26a69c6b1$export$42df105a73306d51(props, state, ref) {
|
|
|
1071
1072
|
isDisabled: props.isDisabled,
|
|
1072
1073
|
isReadOnly: props.isReadOnly,
|
|
1073
1074
|
isRequired: props.isRequired,
|
|
1074
|
-
|
|
1075
|
+
isInvalid: state.isInvalid,
|
|
1075
1076
|
autoFocus: props.autoFocus,
|
|
1076
1077
|
name: props.name
|
|
1077
1078
|
},
|
|
@@ -1101,7 +1102,7 @@ function $e90ae7c26a69c6b1$export$42df105a73306d51(props, state, ref) {
|
|
|
1101
1102
|
isReadOnly: props.isReadOnly,
|
|
1102
1103
|
isDateUnavailable: props.isDateUnavailable,
|
|
1103
1104
|
defaultFocusedValue: state.dateValue ? undefined : props.placeholderValue,
|
|
1104
|
-
|
|
1105
|
+
isInvalid: state.isInvalid,
|
|
1105
1106
|
errorMessage: props.errorMessage
|
|
1106
1107
|
}
|
|
1107
1108
|
};
|
|
@@ -1433,7 +1434,7 @@ function $5c015c6316d1904d$export$1315d136e6f7581(segment, state, ref) {
|
|
|
1433
1434
|
let firstSegment = (0, $IwcIq$react.useMemo)(()=>state.segments.find((s)=>s.isEditable), [
|
|
1434
1435
|
state.segments
|
|
1435
1436
|
]);
|
|
1436
|
-
if (segment !== firstSegment && state.
|
|
1437
|
+
if (segment !== firstSegment && !state.isInvalid) ariaDescribedBy = undefined;
|
|
1437
1438
|
let id = (0, $IwcIq$reactariautils.useId)();
|
|
1438
1439
|
let isEditable = !state.isDisabled && !state.isReadOnly && segment.isEditable;
|
|
1439
1440
|
// Prepend the label passed from the field to each segment name.
|
|
@@ -1454,7 +1455,7 @@ function $5c015c6316d1904d$export$1315d136e6f7581(segment, state, ref) {
|
|
|
1454
1455
|
segmentProps: (0, $IwcIq$reactariautils.mergeProps)(spinButtonProps, labelProps, {
|
|
1455
1456
|
id: id,
|
|
1456
1457
|
...touchPropOverrides,
|
|
1457
|
-
"aria-invalid": state.
|
|
1458
|
+
"aria-invalid": state.isInvalid ? "true" : undefined,
|
|
1458
1459
|
"aria-describedby": ariaDescribedBy,
|
|
1459
1460
|
"aria-readonly": state.isReadOnly || !segment.isEditable ? "true" : undefined,
|
|
1460
1461
|
"data-placeholder": segment.isPlaceholder || undefined,
|
|
@@ -1567,7 +1568,7 @@ function $20f695b1b69e6b9e$export$12fd5f0e9f4bb192(props, state, ref) {
|
|
|
1567
1568
|
isDisabled: props.isDisabled,
|
|
1568
1569
|
isReadOnly: props.isReadOnly,
|
|
1569
1570
|
isRequired: props.isRequired,
|
|
1570
|
-
|
|
1571
|
+
isInvalid: state.isInvalid
|
|
1571
1572
|
};
|
|
1572
1573
|
let domProps = (0, $IwcIq$reactariautils.filterDOMProps)(props);
|
|
1573
1574
|
let { focusWithinProps: focusWithinProps } = (0, $IwcIq$reactariainteractions.useFocusWithin)({
|
|
@@ -1639,7 +1640,7 @@ function $20f695b1b69e6b9e$export$12fd5f0e9f4bb192(props, state, ref) {
|
|
|
1639
1640
|
isDateUnavailable: props.isDateUnavailable,
|
|
1640
1641
|
allowsNonContiguousRanges: props.allowsNonContiguousRanges,
|
|
1641
1642
|
defaultFocusedValue: state.dateRange ? undefined : props.placeholderValue,
|
|
1642
|
-
|
|
1643
|
+
isInvalid: state.isInvalid,
|
|
1643
1644
|
errorMessage: props.errorMessage
|
|
1644
1645
|
}
|
|
1645
1646
|
};
|