@react-aria/datepicker 3.2.1 → 3.4.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 +1628 -0
- package/dist/main.js +7 -1
- package/dist/main.js.map +1 -1
- package/dist/module.js +8 -2
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +4 -4
- package/dist/types.d.ts.map +1 -1
- package/package.json +22 -17
- package/src/index.ts +2 -2
- package/src/useDateField.ts +3 -3
- package/src/useDatePicker.ts +3 -0
- package/src/useDateRangePicker.ts +1 -0
- package/src/useDateSegment.ts +2 -2
package/dist/module.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {createFocusManager as $cIPI0$createFocusManager, getFocusableTreeWalker as $cIPI0$getFocusableTreeWalker} from "@react-aria/focus";
|
|
2
|
-
import {useId as $cIPI0$useId, useDescription as $cIPI0$useDescription, filterDOMProps as $cIPI0$filterDOMProps, mergeProps as $cIPI0$mergeProps, isMac as $cIPI0$isMac,
|
|
2
|
+
import {useId as $cIPI0$useId, useDescription as $cIPI0$useDescription, filterDOMProps as $cIPI0$filterDOMProps, mergeProps as $cIPI0$mergeProps, isMac as $cIPI0$isMac, scrollIntoViewport as $cIPI0$scrollIntoViewport, getScrollParent as $cIPI0$getScrollParent, useEvent as $cIPI0$useEvent, useLayoutEffect as $cIPI0$useLayoutEffect, isIOS as $cIPI0$isIOS, useLabels as $cIPI0$useLabels} from "@react-aria/utils";
|
|
3
3
|
import $cIPI0$react, {useMemo as $cIPI0$useMemo, useRef as $cIPI0$useRef, useEffect as $cIPI0$useEffect} from "react";
|
|
4
4
|
import {useField as $cIPI0$useField} from "@react-aria/label";
|
|
5
5
|
import {useFocusWithin as $cIPI0$useFocusWithin, usePress as $cIPI0$usePress} from "@react-aria/interactions";
|
|
@@ -982,6 +982,7 @@ function $16f0b7bb276bc17e$export$4c842f6a241dc825(props, state, ref) {
|
|
|
982
982
|
function $6057a3d2a53a12fd$export$42df105a73306d51(props, state, ref) {
|
|
983
983
|
let buttonId = (0, $cIPI0$useId)();
|
|
984
984
|
let dialogId = (0, $cIPI0$useId)();
|
|
985
|
+
let fieldId = (0, $cIPI0$useId)();
|
|
985
986
|
let stringFormatter = (0, $cIPI0$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($204383cf4f6b0d06$exports))));
|
|
986
987
|
let { labelProps: labelProps , fieldProps: fieldProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps } = (0, $cIPI0$useField)({
|
|
987
988
|
...props,
|
|
@@ -1035,6 +1036,7 @@ function $6057a3d2a53a12fd$export$42df105a73306d51(props, state, ref) {
|
|
|
1035
1036
|
},
|
|
1036
1037
|
fieldProps: {
|
|
1037
1038
|
...fieldProps,
|
|
1039
|
+
id: fieldId,
|
|
1038
1040
|
[(0, $16f0b7bb276bc17e$export$300019f83c56d282)]: "presentation",
|
|
1039
1041
|
"aria-describedby": ariaDescribedBy,
|
|
1040
1042
|
value: state.value,
|
|
@@ -1060,6 +1062,7 @@ function $6057a3d2a53a12fd$export$42df105a73306d51(props, state, ref) {
|
|
|
1060
1062
|
"aria-label": stringFormatter.format("calendar"),
|
|
1061
1063
|
"aria-labelledby": `${labelledBy} ${buttonId}`,
|
|
1062
1064
|
"aria-describedby": ariaDescribedBy,
|
|
1065
|
+
"aria-expanded": state.isOpen || undefined,
|
|
1063
1066
|
onPress: ()=>state.setOpen(true)
|
|
1064
1067
|
},
|
|
1065
1068
|
dialogProps: {
|
|
@@ -1341,7 +1344,9 @@ function $32489daedd52963e$export$1315d136e6f7581(segment, state, ref) {
|
|
|
1341
1344
|
};
|
|
1342
1345
|
let onFocus = ()=>{
|
|
1343
1346
|
enteredKeys.current = "";
|
|
1344
|
-
(0, $cIPI0$
|
|
1347
|
+
(0, $cIPI0$scrollIntoViewport)(ref.current, {
|
|
1348
|
+
containingElement: (0, $cIPI0$getScrollParent)(ref.current)
|
|
1349
|
+
});
|
|
1345
1350
|
// Collapse selection to start or Chrome won't fire input events.
|
|
1346
1351
|
let selection = window.getSelection();
|
|
1347
1352
|
selection.collapse(ref.current);
|
|
@@ -1576,6 +1581,7 @@ function $887cac91b7cc8801$export$12fd5f0e9f4bb192(props, state, ref) {
|
|
|
1576
1581
|
"aria-label": stringFormatter.format("calendar"),
|
|
1577
1582
|
"aria-labelledby": `${labelledBy} ${buttonId}`,
|
|
1578
1583
|
"aria-describedby": ariaDescribedBy,
|
|
1584
|
+
"aria-expanded": state.isOpen || undefined,
|
|
1579
1585
|
onPress: ()=>state.setOpen(true)
|
|
1580
1586
|
},
|
|
1581
1587
|
dialogProps: {
|