@react-aria/datepicker 3.9.0 → 3.9.2
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 +12 -10
- package/dist/main.js +11 -9
- package/dist/main.js.map +1 -1
- package/dist/module.js +12 -10
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +15 -15
- package/src/useDateField.ts +1 -1
- package/src/useDatePicker.ts +2 -1
- package/src/useDateRangePicker.ts +2 -1
- package/src/useDisplayNames.ts +6 -5
package/dist/module.js
CHANGED
|
@@ -4,12 +4,11 @@ import {privateValidationStateProp as $cIPI0$privateValidationStateProp, DEFAULT
|
|
|
4
4
|
import $cIPI0$react, {useMemo as $cIPI0$useMemo, useRef as $cIPI0$useRef, useEffect as $cIPI0$useEffect} from "react";
|
|
5
5
|
import {useField as $cIPI0$useField} from "@react-aria/label";
|
|
6
6
|
import {useFocusWithin as $cIPI0$useFocusWithin, usePress as $cIPI0$usePress} from "@react-aria/interactions";
|
|
7
|
-
import {useLocalizedStringFormatter as $cIPI0$useLocalizedStringFormatter, useLocale as $cIPI0$useLocale, useDateFormatter as $cIPI0$useDateFormatter, useFilter as $cIPI0$useFilter} from "@react-aria/i18n";
|
|
7
|
+
import {useLocalizedStringFormatter as $cIPI0$useLocalizedStringFormatter, useLocale as $cIPI0$useLocale, useDateFormatter as $cIPI0$useDateFormatter, useFilter as $cIPI0$useFilter, useLocalizedStringDictionary as $cIPI0$useLocalizedStringDictionary} from "@react-aria/i18n";
|
|
8
8
|
import {useFormValidation as $cIPI0$useFormValidation} from "@react-aria/form";
|
|
9
9
|
import {toCalendar as $cIPI0$toCalendar, CalendarDate as $cIPI0$CalendarDate} from "@internationalized/date";
|
|
10
10
|
import {NumberParser as $cIPI0$NumberParser} from "@internationalized/number";
|
|
11
11
|
import {useSpinButton as $cIPI0$useSpinButton} from "@react-aria/spinbutton";
|
|
12
|
-
import {LocalizedStringDictionary as $cIPI0$LocalizedStringDictionary} from "@internationalized/string";
|
|
13
12
|
|
|
14
13
|
|
|
15
14
|
function $parcel$interopDefault(a) {
|
|
@@ -916,7 +915,7 @@ function $16f0b7bb276bc17e$export$5591b0b878c1a989(props, state, ref) {
|
|
|
916
915
|
},
|
|
917
916
|
onFocusWithinChange: props.onFocusChange
|
|
918
917
|
});
|
|
919
|
-
let stringFormatter = (0, $cIPI0$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($dfb4eba373ed9493$exports))));
|
|
918
|
+
let stringFormatter = (0, $cIPI0$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($dfb4eba373ed9493$exports))), "@react-aria/datepicker");
|
|
920
919
|
let message = state.maxGranularity === "hour" ? "selectedTimeDescription" : "selectedDateDescription";
|
|
921
920
|
let field = state.maxGranularity === "hour" ? "time" : "date";
|
|
922
921
|
let description = state.value ? stringFormatter.format(message, {
|
|
@@ -1028,7 +1027,7 @@ function $6057a3d2a53a12fd$export$42df105a73306d51(props, state, ref) {
|
|
|
1028
1027
|
let buttonId = (0, $cIPI0$useId)();
|
|
1029
1028
|
let dialogId = (0, $cIPI0$useId)();
|
|
1030
1029
|
let fieldId = (0, $cIPI0$useId)();
|
|
1031
|
-
let stringFormatter = (0, $cIPI0$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($dfb4eba373ed9493$exports))));
|
|
1030
|
+
let stringFormatter = (0, $cIPI0$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($dfb4eba373ed9493$exports))), "@react-aria/datepicker");
|
|
1032
1031
|
let { isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = state.displayValidation;
|
|
1033
1032
|
let { labelProps: labelProps, fieldProps: fieldProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps } = (0, $cIPI0$useField)({
|
|
1034
1033
|
...props,
|
|
@@ -1113,6 +1112,7 @@ function $6057a3d2a53a12fd$export$42df105a73306d51(props, state, ref) {
|
|
|
1113
1112
|
"aria-labelledby": `${buttonId} ${labelledBy}`,
|
|
1114
1113
|
"aria-describedby": ariaDescribedBy,
|
|
1115
1114
|
"aria-expanded": state.isOpen,
|
|
1115
|
+
isDisabled: props.isDisabled || props.isReadOnly,
|
|
1116
1116
|
onPress: ()=>state.setOpen(true)
|
|
1117
1117
|
},
|
|
1118
1118
|
dialogProps: {
|
|
@@ -1169,9 +1169,9 @@ function $6057a3d2a53a12fd$export$42df105a73306d51(props, state, ref) {
|
|
|
1169
1169
|
|
|
1170
1170
|
|
|
1171
1171
|
|
|
1172
|
-
|
|
1173
1172
|
function $3aeceb3a64eb8358$export$d42c60378c8168f8() {
|
|
1174
1173
|
let { locale: locale } = (0, $cIPI0$useLocale)();
|
|
1174
|
+
let dictionary = (0, $cIPI0$useLocalizedStringDictionary)((0, (/*@__PURE__*/$parcel$interopDefault($dfb4eba373ed9493$exports))), "@react-aria/datepicker");
|
|
1175
1175
|
return (0, $cIPI0$useMemo)(()=>{
|
|
1176
1176
|
// Try to use Intl.DisplayNames if possible. It may be supported in browsers, but not support the dateTimeField
|
|
1177
1177
|
// type as that was only added in v2. https://github.com/tc39/intl-displaynames-v2
|
|
@@ -1181,19 +1181,20 @@ function $3aeceb3a64eb8358$export$d42c60378c8168f8() {
|
|
|
1181
1181
|
type: "dateTimeField"
|
|
1182
1182
|
});
|
|
1183
1183
|
} catch (err) {
|
|
1184
|
-
return new $3aeceb3a64eb8358$var$DisplayNamesPolyfill(locale);
|
|
1184
|
+
return new $3aeceb3a64eb8358$var$DisplayNamesPolyfill(locale, dictionary);
|
|
1185
1185
|
}
|
|
1186
1186
|
}, [
|
|
1187
|
-
locale
|
|
1187
|
+
locale,
|
|
1188
|
+
dictionary
|
|
1188
1189
|
]);
|
|
1189
1190
|
}
|
|
1190
1191
|
class $3aeceb3a64eb8358$var$DisplayNamesPolyfill {
|
|
1191
1192
|
of(field) {
|
|
1192
1193
|
return this.dictionary.getStringForLocale(field, this.locale);
|
|
1193
1194
|
}
|
|
1194
|
-
constructor(locale){
|
|
1195
|
+
constructor(locale, dictionary){
|
|
1195
1196
|
this.locale = locale;
|
|
1196
|
-
this.dictionary =
|
|
1197
|
+
this.dictionary = dictionary;
|
|
1197
1198
|
}
|
|
1198
1199
|
}
|
|
1199
1200
|
|
|
@@ -1548,7 +1549,7 @@ function $32489daedd52963e$var$commonPrefixLength(strings) {
|
|
|
1548
1549
|
|
|
1549
1550
|
function $887cac91b7cc8801$export$12fd5f0e9f4bb192(props, state, ref) {
|
|
1550
1551
|
var _state_value, _state_value1;
|
|
1551
|
-
let stringFormatter = (0, $cIPI0$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($dfb4eba373ed9493$exports))));
|
|
1552
|
+
let stringFormatter = (0, $cIPI0$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($dfb4eba373ed9493$exports))), "@react-aria/datepicker");
|
|
1552
1553
|
let { isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = state.displayValidation;
|
|
1553
1554
|
let { labelProps: labelProps, fieldProps: fieldProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps } = (0, $cIPI0$useField)({
|
|
1554
1555
|
...props,
|
|
@@ -1640,6 +1641,7 @@ function $887cac91b7cc8801$export$12fd5f0e9f4bb192(props, state, ref) {
|
|
|
1640
1641
|
"aria-labelledby": `${buttonId} ${labelledBy}`,
|
|
1641
1642
|
"aria-describedby": ariaDescribedBy,
|
|
1642
1643
|
"aria-expanded": state.isOpen,
|
|
1644
|
+
isDisabled: props.isDisabled || props.isReadOnly,
|
|
1643
1645
|
onPress: ()=>state.setOpen(true)
|
|
1644
1646
|
},
|
|
1645
1647
|
dialogProps: {
|