@react-aria/datepicker 3.0.0-nightly.1847 → 3.0.0-nightly.1853
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 +25 -45
- package/dist/main.js.map +1 -1
- package/dist/module.js +25 -45
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +17 -17
- package/src/useDateField.ts +10 -33
- package/src/useDatePicker.ts +11 -40
- package/src/useDateRangePicker.ts +11 -40
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';
|
|
@@ -1043,18 +1047,6 @@ function $4acc2f407c169e55$export$5591b0b878c1a989(props, state, ref) {
|
|
|
1043
1047
|
},
|
|
1044
1048
|
onKeyUp (e) {
|
|
1045
1049
|
if (props.onKeyUp) props.onKeyUp(e);
|
|
1046
|
-
},
|
|
1047
|
-
onFocus (e) {
|
|
1048
|
-
if (state.isFocused) return;
|
|
1049
|
-
if (props.onFocus) props.onFocus(e);
|
|
1050
|
-
if (props.onFocusChange) props.onFocusChange(true);
|
|
1051
|
-
state.setFocused(true);
|
|
1052
|
-
},
|
|
1053
|
-
onBlur (e) {
|
|
1054
|
-
if (e.currentTarget.contains(e.relatedTarget)) return;
|
|
1055
|
-
if (props.onBlur) props.onBlur(e);
|
|
1056
|
-
if (props.onFocusChange) props.onFocusChange(false);
|
|
1057
|
-
state.setFocused(false);
|
|
1058
1050
|
}
|
|
1059
1051
|
}),
|
|
1060
1052
|
descriptionProps: descriptionProps,
|
|
@@ -1069,6 +1061,7 @@ function $4acc2f407c169e55$export$4c842f6a241dc825(props, state, ref) {
|
|
|
1069
1061
|
|
|
1070
1062
|
|
|
1071
1063
|
|
|
1064
|
+
|
|
1072
1065
|
function $e90ae7c26a69c6b1$export$42df105a73306d51(props, state, ref) {
|
|
1073
1066
|
let buttonId = $IwcIq$reactariautils.useId();
|
|
1074
1067
|
let dialogId = $IwcIq$reactariautils.useId();
|
|
@@ -1096,8 +1089,15 @@ function $e90ae7c26a69c6b1$export$42df105a73306d51(props, state, ref) {
|
|
|
1096
1089
|
, [
|
|
1097
1090
|
ref
|
|
1098
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
|
+
});
|
|
1099
1099
|
return {
|
|
1100
|
-
groupProps: $IwcIq$reactariautils.mergeProps(domProps, groupProps, fieldProps, descProps, {
|
|
1100
|
+
groupProps: $IwcIq$reactariautils.mergeProps(domProps, groupProps, fieldProps, descProps, focusWithinProps, {
|
|
1101
1101
|
role: 'group',
|
|
1102
1102
|
'aria-disabled': props.isDisabled || null,
|
|
1103
1103
|
'aria-labelledby': labelledBy,
|
|
@@ -1109,20 +1109,6 @@ function $e90ae7c26a69c6b1$export$42df105a73306d51(props, state, ref) {
|
|
|
1109
1109
|
onKeyUp (e) {
|
|
1110
1110
|
if (state.isOpen) return;
|
|
1111
1111
|
if (props.onKeyUp) props.onKeyUp(e);
|
|
1112
|
-
},
|
|
1113
|
-
onFocus (e) {
|
|
1114
|
-
if (state.isFocused) return;
|
|
1115
|
-
if (state.isOpen) return;
|
|
1116
|
-
if (props.onFocus) props.onFocus(e);
|
|
1117
|
-
if (props.onFocusChange) props.onFocusChange(true);
|
|
1118
|
-
state.setFocused(true);
|
|
1119
|
-
},
|
|
1120
|
-
onBlur (e) {
|
|
1121
|
-
if (state.isOpen) return;
|
|
1122
|
-
if (e.currentTarget.contains(e.relatedTarget)) return;
|
|
1123
|
-
if (props.onBlur) props.onBlur(e);
|
|
1124
|
-
if (props.onFocusChange) props.onFocusChange(false);
|
|
1125
|
-
state.setFocused(false);
|
|
1126
1112
|
}
|
|
1127
1113
|
}),
|
|
1128
1114
|
labelProps: {
|
|
@@ -1563,6 +1549,7 @@ function $5c015c6316d1904d$var$commonPrefixLength(strings) {
|
|
|
1563
1549
|
|
|
1564
1550
|
|
|
1565
1551
|
|
|
1552
|
+
|
|
1566
1553
|
function $20f695b1b69e6b9e$export$12fd5f0e9f4bb192(props, state, ref) {
|
|
1567
1554
|
var ref1, ref2;
|
|
1568
1555
|
let stringFormatter = $IwcIq$reactariai18n.useLocalizedStringFormatter((/*@__PURE__*/$parcel$interopDefault($c7d0e80b992ca68a$exports)));
|
|
@@ -1619,8 +1606,15 @@ function $20f695b1b69e6b9e$export$12fd5f0e9f4bb192(props, state, ref) {
|
|
|
1619
1606
|
validationState: state.validationState
|
|
1620
1607
|
};
|
|
1621
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
|
+
});
|
|
1622
1616
|
return {
|
|
1623
|
-
groupProps: $IwcIq$reactariautils.mergeProps(domProps, groupProps, fieldProps, descProps, {
|
|
1617
|
+
groupProps: $IwcIq$reactariautils.mergeProps(domProps, groupProps, fieldProps, descProps, focusWithinProps, {
|
|
1624
1618
|
role: 'group',
|
|
1625
1619
|
'aria-disabled': props.isDisabled || null,
|
|
1626
1620
|
'aria-describedby': ariaDescribedBy,
|
|
@@ -1631,20 +1625,6 @@ function $20f695b1b69e6b9e$export$12fd5f0e9f4bb192(props, state, ref) {
|
|
|
1631
1625
|
onKeyUp (e) {
|
|
1632
1626
|
if (state.isOpen) return;
|
|
1633
1627
|
if (props.onKeyUp) props.onKeyUp(e);
|
|
1634
|
-
},
|
|
1635
|
-
onFocus (e) {
|
|
1636
|
-
if (state.isFocused) return;
|
|
1637
|
-
if (state.isOpen) return;
|
|
1638
|
-
if (props.onFocus) props.onFocus(e);
|
|
1639
|
-
if (props.onFocusChange) props.onFocusChange(true);
|
|
1640
|
-
state.setFocused(true);
|
|
1641
|
-
},
|
|
1642
|
-
onBlur (e) {
|
|
1643
|
-
if (state.isOpen) return;
|
|
1644
|
-
if (e.currentTarget.contains(e.relatedTarget)) return;
|
|
1645
|
-
if (props.onBlur) props.onBlur(e);
|
|
1646
|
-
if (props.onFocusChange) props.onFocusChange(false);
|
|
1647
|
-
state.setFocused(false);
|
|
1648
1628
|
}
|
|
1649
1629
|
}),
|
|
1650
1630
|
labelProps: {
|