@react-aria/datepicker 3.1.1 → 3.2.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/main.js +51 -8
- package/dist/main.js.map +1 -1
- package/dist/module.js +51 -8
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +14 -14
- package/src/useDateField.ts +23 -5
- package/src/useDatePicker.ts +30 -3
- package/src/useDateRangePicker.ts +30 -3
package/dist/main.js
CHANGED
|
@@ -2,8 +2,8 @@ var $IwcIq$reactariafocus = require("@react-aria/focus");
|
|
|
2
2
|
var $IwcIq$reactariautils = require("@react-aria/utils");
|
|
3
3
|
var $IwcIq$react = require("react");
|
|
4
4
|
var $IwcIq$reactarialabel = require("@react-aria/label");
|
|
5
|
-
var $IwcIq$reactariai18n = require("@react-aria/i18n");
|
|
6
5
|
var $IwcIq$reactariainteractions = require("@react-aria/interactions");
|
|
6
|
+
var $IwcIq$reactariai18n = require("@react-aria/i18n");
|
|
7
7
|
var $IwcIq$internationalizeddate = require("@internationalized/date");
|
|
8
8
|
var $IwcIq$internationalizednumber = require("@internationalized/number");
|
|
9
9
|
var $IwcIq$reactariaspinbutton = require("@react-aria/spinbutton");
|
|
@@ -973,9 +973,13 @@ function $4acc2f407c169e55$export$5591b0b878c1a989(props, state, ref) {
|
|
|
973
973
|
labelElementType: 'span'
|
|
974
974
|
});
|
|
975
975
|
let { focusWithinProps: focusWithinProps } = $IwcIq$reactariainteractions.useFocusWithin({
|
|
976
|
-
|
|
976
|
+
...props,
|
|
977
|
+
onBlurWithin: (e)=>{
|
|
977
978
|
state.confirmPlaceholder();
|
|
978
|
-
|
|
979
|
+
if (props.onBlur) props.onBlur(e);
|
|
980
|
+
},
|
|
981
|
+
onFocusWithin: props.onFocus,
|
|
982
|
+
onFocusWithinChange: props.onFocusChange
|
|
979
983
|
});
|
|
980
984
|
let stringFormatter = $IwcIq$reactariai18n.useLocalizedStringFormatter((/*@__PURE__*/$parcel$interopDefault($c7d0e80b992ca68a$exports)));
|
|
981
985
|
let message = state.maxGranularity === 'hour' ? 'selectedTimeDescription' : 'selectedDateDescription';
|
|
@@ -1037,7 +1041,14 @@ function $4acc2f407c169e55$export$5591b0b878c1a989(props, state, ref) {
|
|
|
1037
1041
|
focusManager.focusFirst();
|
|
1038
1042
|
}
|
|
1039
1043
|
},
|
|
1040
|
-
fieldProps: $IwcIq$reactariautils.mergeProps(domProps, fieldDOMProps, groupProps, focusWithinProps
|
|
1044
|
+
fieldProps: $IwcIq$reactariautils.mergeProps(domProps, fieldDOMProps, groupProps, focusWithinProps, {
|
|
1045
|
+
onKeyDown (e) {
|
|
1046
|
+
if (props.onKeyDown) props.onKeyDown(e);
|
|
1047
|
+
},
|
|
1048
|
+
onKeyUp (e) {
|
|
1049
|
+
if (props.onKeyUp) props.onKeyUp(e);
|
|
1050
|
+
}
|
|
1051
|
+
}),
|
|
1041
1052
|
descriptionProps: descriptionProps,
|
|
1042
1053
|
errorMessageProps: errorMessageProps
|
|
1043
1054
|
};
|
|
@@ -1050,6 +1061,7 @@ function $4acc2f407c169e55$export$4c842f6a241dc825(props, state, ref) {
|
|
|
1050
1061
|
|
|
1051
1062
|
|
|
1052
1063
|
|
|
1064
|
+
|
|
1053
1065
|
function $e90ae7c26a69c6b1$export$42df105a73306d51(props, state, ref) {
|
|
1054
1066
|
let buttonId = $IwcIq$reactariautils.useId();
|
|
1055
1067
|
let dialogId = $IwcIq$reactariautils.useId();
|
|
@@ -1077,12 +1089,27 @@ function $e90ae7c26a69c6b1$export$42df105a73306d51(props, state, ref) {
|
|
|
1077
1089
|
, [
|
|
1078
1090
|
ref
|
|
1079
1091
|
]);
|
|
1092
|
+
let { focusWithinProps: focusWithinProps } = $IwcIq$reactariainteractions.useFocusWithin({
|
|
1093
|
+
...props,
|
|
1094
|
+
isDisabled: state.isOpen,
|
|
1095
|
+
onBlurWithin: props.onBlur,
|
|
1096
|
+
onFocusWithin: props.onFocus,
|
|
1097
|
+
onFocusWithinChange: props.onFocusChange
|
|
1098
|
+
});
|
|
1080
1099
|
return {
|
|
1081
|
-
groupProps: $IwcIq$reactariautils.mergeProps(domProps, groupProps, fieldProps, descProps, {
|
|
1100
|
+
groupProps: $IwcIq$reactariautils.mergeProps(domProps, groupProps, fieldProps, descProps, focusWithinProps, {
|
|
1082
1101
|
role: 'group',
|
|
1083
1102
|
'aria-disabled': props.isDisabled || null,
|
|
1084
1103
|
'aria-labelledby': labelledBy,
|
|
1085
|
-
'aria-describedby': ariaDescribedBy
|
|
1104
|
+
'aria-describedby': ariaDescribedBy,
|
|
1105
|
+
onKeyDown (e) {
|
|
1106
|
+
if (state.isOpen) return;
|
|
1107
|
+
if (props.onKeyDown) props.onKeyDown(e);
|
|
1108
|
+
},
|
|
1109
|
+
onKeyUp (e) {
|
|
1110
|
+
if (state.isOpen) return;
|
|
1111
|
+
if (props.onKeyUp) props.onKeyUp(e);
|
|
1112
|
+
}
|
|
1086
1113
|
}),
|
|
1087
1114
|
labelProps: {
|
|
1088
1115
|
...labelProps,
|
|
@@ -1522,6 +1549,7 @@ function $5c015c6316d1904d$var$commonPrefixLength(strings) {
|
|
|
1522
1549
|
|
|
1523
1550
|
|
|
1524
1551
|
|
|
1552
|
+
|
|
1525
1553
|
function $20f695b1b69e6b9e$export$12fd5f0e9f4bb192(props, state, ref) {
|
|
1526
1554
|
var ref1, ref2;
|
|
1527
1555
|
let stringFormatter = $IwcIq$reactariai18n.useLocalizedStringFormatter((/*@__PURE__*/$parcel$interopDefault($c7d0e80b992ca68a$exports)));
|
|
@@ -1578,11 +1606,26 @@ function $20f695b1b69e6b9e$export$12fd5f0e9f4bb192(props, state, ref) {
|
|
|
1578
1606
|
validationState: state.validationState
|
|
1579
1607
|
};
|
|
1580
1608
|
let domProps = $IwcIq$reactariautils.filterDOMProps(props);
|
|
1609
|
+
let { focusWithinProps: focusWithinProps } = $IwcIq$reactariainteractions.useFocusWithin({
|
|
1610
|
+
...props,
|
|
1611
|
+
isDisabled: state.isOpen,
|
|
1612
|
+
onBlurWithin: props.onBlur,
|
|
1613
|
+
onFocusWithin: props.onFocus,
|
|
1614
|
+
onFocusWithinChange: props.onFocusChange
|
|
1615
|
+
});
|
|
1581
1616
|
return {
|
|
1582
|
-
groupProps: $IwcIq$reactariautils.mergeProps(domProps, groupProps, fieldProps, descProps, {
|
|
1617
|
+
groupProps: $IwcIq$reactariautils.mergeProps(domProps, groupProps, fieldProps, descProps, focusWithinProps, {
|
|
1583
1618
|
role: 'group',
|
|
1584
1619
|
'aria-disabled': props.isDisabled || null,
|
|
1585
|
-
'aria-describedby': ariaDescribedBy
|
|
1620
|
+
'aria-describedby': ariaDescribedBy,
|
|
1621
|
+
onKeyDown (e) {
|
|
1622
|
+
if (state.isOpen) return;
|
|
1623
|
+
if (props.onKeyDown) props.onKeyDown(e);
|
|
1624
|
+
},
|
|
1625
|
+
onKeyUp (e) {
|
|
1626
|
+
if (state.isOpen) return;
|
|
1627
|
+
if (props.onKeyUp) props.onKeyUp(e);
|
|
1628
|
+
}
|
|
1586
1629
|
}),
|
|
1587
1630
|
labelProps: {
|
|
1588
1631
|
...labelProps,
|