@react-aria/datepicker 3.4.1 → 3.6.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 +33 -18
- package/dist/main.js +32 -17
- package/dist/main.js.map +1 -1
- package/dist/module.js +33 -18
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +12 -4
- package/dist/types.d.ts.map +1 -1
- package/package.json +18 -18
- package/src/useDateField.ts +26 -7
- package/src/useDatePicker.ts +5 -3
- package/src/useDateRangePicker.ts +7 -4
- package/src/useDateSegment.ts +1 -1
- package/src/useDisplayNames.ts +1 -1
package/dist/import.mjs
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, 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";
|
|
2
|
+
import {useId as $cIPI0$useId, useDescription as $cIPI0$useDescription, filterDOMProps as $cIPI0$filterDOMProps, mergeProps as $cIPI0$mergeProps, useFormReset as $cIPI0$useFormReset, 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";
|
|
@@ -34,7 +34,7 @@ function $parcel$interopDefault(a) {
|
|
|
34
34
|
* governing permissions and limitations under the License.
|
|
35
35
|
*/
|
|
36
36
|
|
|
37
|
-
var $
|
|
37
|
+
var $dfb4eba373ed9493$exports = {};
|
|
38
38
|
var $f23889fffbde9058$exports = {};
|
|
39
39
|
$f23889fffbde9058$exports = {
|
|
40
40
|
"calendar": `التقويم`,
|
|
@@ -749,7 +749,7 @@ $33fab8219207655a$exports = {
|
|
|
749
749
|
};
|
|
750
750
|
|
|
751
751
|
|
|
752
|
-
$
|
|
752
|
+
$dfb4eba373ed9493$exports = {
|
|
753
753
|
"ar-AE": $f23889fffbde9058$exports,
|
|
754
754
|
"bg-BG": $09d9badaa8903929$exports,
|
|
755
755
|
"cs-CZ": $151b77e0fd711730$exports,
|
|
@@ -886,6 +886,7 @@ const $16f0b7bb276bc17e$export$653eddfc964b0f8a = new WeakMap();
|
|
|
886
886
|
const $16f0b7bb276bc17e$export$300019f83c56d282 = "__role_" + Date.now();
|
|
887
887
|
const $16f0b7bb276bc17e$export$7b3062cd49e80452 = "__focusManager_" + Date.now();
|
|
888
888
|
function $16f0b7bb276bc17e$export$5591b0b878c1a989(props, state, ref) {
|
|
889
|
+
var _state_value;
|
|
889
890
|
let { labelProps: labelProps , fieldProps: fieldProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps } = (0, $cIPI0$useField)({
|
|
890
891
|
...props,
|
|
891
892
|
labelElementType: "span"
|
|
@@ -899,7 +900,7 @@ function $16f0b7bb276bc17e$export$5591b0b878c1a989(props, state, ref) {
|
|
|
899
900
|
onFocusWithin: props.onFocus,
|
|
900
901
|
onFocusWithinChange: props.onFocusChange
|
|
901
902
|
});
|
|
902
|
-
let stringFormatter = (0, $cIPI0$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($
|
|
903
|
+
let stringFormatter = (0, $cIPI0$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($dfb4eba373ed9493$exports))));
|
|
903
904
|
let message = state.maxGranularity === "hour" ? "selectedTimeDescription" : "selectedDateDescription";
|
|
904
905
|
let field = state.maxGranularity === "hour" ? "time" : "date";
|
|
905
906
|
let description = state.value ? stringFormatter.format(message, {
|
|
@@ -924,8 +925,8 @@ function $16f0b7bb276bc17e$export$5591b0b878c1a989(props, state, ref) {
|
|
|
924
925
|
$16f0b7bb276bc17e$export$653eddfc964b0f8a.set(state, {
|
|
925
926
|
ariaLabel: props["aria-label"],
|
|
926
927
|
ariaLabelledBy: [
|
|
927
|
-
|
|
928
|
-
|
|
928
|
+
labelProps.id,
|
|
929
|
+
props["aria-labelledby"]
|
|
929
930
|
].filter(Boolean).join(" ") || undefined,
|
|
930
931
|
ariaDescribedBy: describedBy,
|
|
931
932
|
focusManager: focusManager
|
|
@@ -950,6 +951,7 @@ function $16f0b7bb276bc17e$export$5591b0b878c1a989(props, state, ref) {
|
|
|
950
951
|
}, [
|
|
951
952
|
focusManager
|
|
952
953
|
]);
|
|
954
|
+
(0, $cIPI0$useFormReset)(props.inputRef, state.value, state.setValue);
|
|
953
955
|
let domProps = (0, $cIPI0$filterDOMProps)(props);
|
|
954
956
|
return {
|
|
955
957
|
labelProps: {
|
|
@@ -966,12 +968,20 @@ function $16f0b7bb276bc17e$export$5591b0b878c1a989(props, state, ref) {
|
|
|
966
968
|
if (props.onKeyUp) props.onKeyUp(e);
|
|
967
969
|
}
|
|
968
970
|
}),
|
|
971
|
+
inputProps: {
|
|
972
|
+
type: "hidden",
|
|
973
|
+
name: props.name,
|
|
974
|
+
value: ((_state_value = state.value) === null || _state_value === void 0 ? void 0 : _state_value.toString()) || ""
|
|
975
|
+
},
|
|
969
976
|
descriptionProps: descriptionProps,
|
|
970
977
|
errorMessageProps: errorMessageProps
|
|
971
978
|
};
|
|
972
979
|
}
|
|
973
980
|
function $16f0b7bb276bc17e$export$4c842f6a241dc825(props, state, ref) {
|
|
974
|
-
|
|
981
|
+
var _state_timeValue;
|
|
982
|
+
let res = $16f0b7bb276bc17e$export$5591b0b878c1a989(props, state, ref);
|
|
983
|
+
res.inputProps.value = ((_state_timeValue = state.timeValue) === null || _state_timeValue === void 0 ? void 0 : _state_timeValue.toString()) || "";
|
|
984
|
+
return res;
|
|
975
985
|
}
|
|
976
986
|
|
|
977
987
|
|
|
@@ -983,7 +993,7 @@ function $6057a3d2a53a12fd$export$42df105a73306d51(props, state, ref) {
|
|
|
983
993
|
let buttonId = (0, $cIPI0$useId)();
|
|
984
994
|
let dialogId = (0, $cIPI0$useId)();
|
|
985
995
|
let fieldId = (0, $cIPI0$useId)();
|
|
986
|
-
let stringFormatter = (0, $cIPI0$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($
|
|
996
|
+
let stringFormatter = (0, $cIPI0$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($dfb4eba373ed9493$exports))));
|
|
987
997
|
let { labelProps: labelProps , fieldProps: fieldProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps } = (0, $cIPI0$useField)({
|
|
988
998
|
...props,
|
|
989
999
|
labelElementType: "span"
|
|
@@ -1046,12 +1056,14 @@ function $6057a3d2a53a12fd$export$42df105a73306d51(props, state, ref) {
|
|
|
1046
1056
|
placeholderValue: props.placeholderValue,
|
|
1047
1057
|
hideTimeZone: props.hideTimeZone,
|
|
1048
1058
|
hourCycle: props.hourCycle,
|
|
1059
|
+
shouldForceLeadingZeros: props.shouldForceLeadingZeros,
|
|
1049
1060
|
granularity: props.granularity,
|
|
1050
1061
|
isDisabled: props.isDisabled,
|
|
1051
1062
|
isReadOnly: props.isReadOnly,
|
|
1052
1063
|
isRequired: props.isRequired,
|
|
1053
1064
|
validationState: state.validationState,
|
|
1054
|
-
autoFocus: props.autoFocus
|
|
1065
|
+
autoFocus: props.autoFocus,
|
|
1066
|
+
name: props.name
|
|
1055
1067
|
},
|
|
1056
1068
|
descriptionProps: descriptionProps,
|
|
1057
1069
|
errorMessageProps: errorMessageProps,
|
|
@@ -1060,14 +1072,14 @@ function $6057a3d2a53a12fd$export$42df105a73306d51(props, state, ref) {
|
|
|
1060
1072
|
id: buttonId,
|
|
1061
1073
|
"aria-haspopup": "dialog",
|
|
1062
1074
|
"aria-label": stringFormatter.format("calendar"),
|
|
1063
|
-
"aria-labelledby": `${
|
|
1075
|
+
"aria-labelledby": `${buttonId} ${labelledBy}`,
|
|
1064
1076
|
"aria-describedby": ariaDescribedBy,
|
|
1065
1077
|
"aria-expanded": state.isOpen || undefined,
|
|
1066
1078
|
onPress: ()=>state.setOpen(true)
|
|
1067
1079
|
},
|
|
1068
1080
|
dialogProps: {
|
|
1069
1081
|
id: dialogId,
|
|
1070
|
-
"aria-labelledby": `${
|
|
1082
|
+
"aria-labelledby": `${buttonId} ${labelledBy}`
|
|
1071
1083
|
},
|
|
1072
1084
|
calendarProps: {
|
|
1073
1085
|
autoFocus: true,
|
|
@@ -1140,7 +1152,7 @@ class $3aeceb3a64eb8358$var$DisplayNamesPolyfill {
|
|
|
1140
1152
|
}
|
|
1141
1153
|
constructor(locale){
|
|
1142
1154
|
this.locale = locale;
|
|
1143
|
-
this.dictionary = new (0, $cIPI0$LocalizedStringDictionary)((0, (/*@__PURE__*/$parcel$interopDefault($
|
|
1155
|
+
this.dictionary = new (0, $cIPI0$LocalizedStringDictionary)((0, (/*@__PURE__*/$parcel$interopDefault($dfb4eba373ed9493$exports))));
|
|
1144
1156
|
}
|
|
1145
1157
|
}
|
|
1146
1158
|
|
|
@@ -1418,7 +1430,7 @@ function $32489daedd52963e$export$1315d136e6f7581(segment, state, ref) {
|
|
|
1418
1430
|
// This is needed because VoiceOver on iOS does not announce groups.
|
|
1419
1431
|
let name = segment.type === "literal" ? "" : displayNames.of(segment.type);
|
|
1420
1432
|
let labelProps = (0, $cIPI0$useLabels)({
|
|
1421
|
-
"aria-label":
|
|
1433
|
+
"aria-label": `${name}${ariaLabel ? `, ${ariaLabel}` : ""}${ariaLabelledBy ? ", " : ""}`,
|
|
1422
1434
|
"aria-labelledby": ariaLabelledBy
|
|
1423
1435
|
});
|
|
1424
1436
|
// Literal segments should not be visible to screen readers. We don't really need any of the above,
|
|
@@ -1494,7 +1506,7 @@ function $32489daedd52963e$var$commonPrefixLength(strings) {
|
|
|
1494
1506
|
|
|
1495
1507
|
function $887cac91b7cc8801$export$12fd5f0e9f4bb192(props, state, ref) {
|
|
1496
1508
|
var _state_value, _state_value1;
|
|
1497
|
-
let stringFormatter = (0, $cIPI0$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($
|
|
1509
|
+
let stringFormatter = (0, $cIPI0$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($dfb4eba373ed9493$exports))));
|
|
1498
1510
|
let { labelProps: labelProps , fieldProps: fieldProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps } = (0, $cIPI0$useField)({
|
|
1499
1511
|
...props,
|
|
1500
1512
|
labelElementType: "span"
|
|
@@ -1541,6 +1553,7 @@ function $887cac91b7cc8801$export$12fd5f0e9f4bb192(props, state, ref) {
|
|
|
1541
1553
|
hideTimeZone: props.hideTimeZone,
|
|
1542
1554
|
hourCycle: props.hourCycle,
|
|
1543
1555
|
granularity: props.granularity,
|
|
1556
|
+
shouldForceLeadingZeros: props.shouldForceLeadingZeros,
|
|
1544
1557
|
isDisabled: props.isDisabled,
|
|
1545
1558
|
isReadOnly: props.isReadOnly,
|
|
1546
1559
|
isRequired: props.isRequired,
|
|
@@ -1579,27 +1592,29 @@ function $887cac91b7cc8801$export$12fd5f0e9f4bb192(props, state, ref) {
|
|
|
1579
1592
|
id: buttonId,
|
|
1580
1593
|
"aria-haspopup": "dialog",
|
|
1581
1594
|
"aria-label": stringFormatter.format("calendar"),
|
|
1582
|
-
"aria-labelledby": `${
|
|
1595
|
+
"aria-labelledby": `${buttonId} ${labelledBy}`,
|
|
1583
1596
|
"aria-describedby": ariaDescribedBy,
|
|
1584
1597
|
"aria-expanded": state.isOpen || undefined,
|
|
1585
1598
|
onPress: ()=>state.setOpen(true)
|
|
1586
1599
|
},
|
|
1587
1600
|
dialogProps: {
|
|
1588
1601
|
id: dialogId,
|
|
1589
|
-
"aria-labelledby": `${
|
|
1602
|
+
"aria-labelledby": `${buttonId} ${labelledBy}`
|
|
1590
1603
|
},
|
|
1591
1604
|
startFieldProps: {
|
|
1592
1605
|
...startFieldProps,
|
|
1593
1606
|
...commonFieldProps,
|
|
1594
1607
|
value: (_state_value = state.value) === null || _state_value === void 0 ? void 0 : _state_value.start,
|
|
1595
1608
|
onChange: (start)=>state.setDateTime("start", start),
|
|
1596
|
-
autoFocus: props.autoFocus
|
|
1609
|
+
autoFocus: props.autoFocus,
|
|
1610
|
+
name: props.startName
|
|
1597
1611
|
},
|
|
1598
1612
|
endFieldProps: {
|
|
1599
1613
|
...endFieldProps,
|
|
1600
1614
|
...commonFieldProps,
|
|
1601
1615
|
value: (_state_value1 = state.value) === null || _state_value1 === void 0 ? void 0 : _state_value1.end,
|
|
1602
|
-
onChange: (end)=>state.setDateTime("end", end)
|
|
1616
|
+
onChange: (end)=>state.setDateTime("end", end),
|
|
1617
|
+
name: props.endName
|
|
1603
1618
|
},
|
|
1604
1619
|
descriptionProps: descriptionProps,
|
|
1605
1620
|
errorMessageProps: errorMessageProps,
|
package/dist/main.js
CHANGED
|
@@ -44,7 +44,7 @@ $parcel$export(module.exports, "useDisplayNames", () => $934ac650a0aceb4b$export
|
|
|
44
44
|
* governing permissions and limitations under the License.
|
|
45
45
|
*/
|
|
46
46
|
|
|
47
|
-
var $
|
|
47
|
+
var $c1905b78f6d2f5bf$exports = {};
|
|
48
48
|
var $aa344be62785b256$exports = {};
|
|
49
49
|
$aa344be62785b256$exports = {
|
|
50
50
|
"calendar": `التقويم`,
|
|
@@ -759,7 +759,7 @@ $0335c3ddb5f70cbe$exports = {
|
|
|
759
759
|
};
|
|
760
760
|
|
|
761
761
|
|
|
762
|
-
$
|
|
762
|
+
$c1905b78f6d2f5bf$exports = {
|
|
763
763
|
"ar-AE": $aa344be62785b256$exports,
|
|
764
764
|
"bg-BG": $615986c3475e7c8c$exports,
|
|
765
765
|
"cs-CZ": $6c6207692f1ab248$exports,
|
|
@@ -896,6 +896,7 @@ const $4acc2f407c169e55$export$653eddfc964b0f8a = new WeakMap();
|
|
|
896
896
|
const $4acc2f407c169e55$export$300019f83c56d282 = "__role_" + Date.now();
|
|
897
897
|
const $4acc2f407c169e55$export$7b3062cd49e80452 = "__focusManager_" + Date.now();
|
|
898
898
|
function $4acc2f407c169e55$export$5591b0b878c1a989(props, state, ref) {
|
|
899
|
+
var _state_value;
|
|
899
900
|
let { labelProps: labelProps , fieldProps: fieldProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps } = (0, $IwcIq$reactarialabel.useField)({
|
|
900
901
|
...props,
|
|
901
902
|
labelElementType: "span"
|
|
@@ -909,7 +910,7 @@ function $4acc2f407c169e55$export$5591b0b878c1a989(props, state, ref) {
|
|
|
909
910
|
onFocusWithin: props.onFocus,
|
|
910
911
|
onFocusWithinChange: props.onFocusChange
|
|
911
912
|
});
|
|
912
|
-
let stringFormatter = (0, $IwcIq$reactariai18n.useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($
|
|
913
|
+
let stringFormatter = (0, $IwcIq$reactariai18n.useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($c1905b78f6d2f5bf$exports))));
|
|
913
914
|
let message = state.maxGranularity === "hour" ? "selectedTimeDescription" : "selectedDateDescription";
|
|
914
915
|
let field = state.maxGranularity === "hour" ? "time" : "date";
|
|
915
916
|
let description = state.value ? stringFormatter.format(message, {
|
|
@@ -934,8 +935,8 @@ function $4acc2f407c169e55$export$5591b0b878c1a989(props, state, ref) {
|
|
|
934
935
|
$4acc2f407c169e55$export$653eddfc964b0f8a.set(state, {
|
|
935
936
|
ariaLabel: props["aria-label"],
|
|
936
937
|
ariaLabelledBy: [
|
|
937
|
-
|
|
938
|
-
|
|
938
|
+
labelProps.id,
|
|
939
|
+
props["aria-labelledby"]
|
|
939
940
|
].filter(Boolean).join(" ") || undefined,
|
|
940
941
|
ariaDescribedBy: describedBy,
|
|
941
942
|
focusManager: focusManager
|
|
@@ -960,6 +961,7 @@ function $4acc2f407c169e55$export$5591b0b878c1a989(props, state, ref) {
|
|
|
960
961
|
}, [
|
|
961
962
|
focusManager
|
|
962
963
|
]);
|
|
964
|
+
(0, $IwcIq$reactariautils.useFormReset)(props.inputRef, state.value, state.setValue);
|
|
963
965
|
let domProps = (0, $IwcIq$reactariautils.filterDOMProps)(props);
|
|
964
966
|
return {
|
|
965
967
|
labelProps: {
|
|
@@ -976,12 +978,20 @@ function $4acc2f407c169e55$export$5591b0b878c1a989(props, state, ref) {
|
|
|
976
978
|
if (props.onKeyUp) props.onKeyUp(e);
|
|
977
979
|
}
|
|
978
980
|
}),
|
|
981
|
+
inputProps: {
|
|
982
|
+
type: "hidden",
|
|
983
|
+
name: props.name,
|
|
984
|
+
value: ((_state_value = state.value) === null || _state_value === void 0 ? void 0 : _state_value.toString()) || ""
|
|
985
|
+
},
|
|
979
986
|
descriptionProps: descriptionProps,
|
|
980
987
|
errorMessageProps: errorMessageProps
|
|
981
988
|
};
|
|
982
989
|
}
|
|
983
990
|
function $4acc2f407c169e55$export$4c842f6a241dc825(props, state, ref) {
|
|
984
|
-
|
|
991
|
+
var _state_timeValue;
|
|
992
|
+
let res = $4acc2f407c169e55$export$5591b0b878c1a989(props, state, ref);
|
|
993
|
+
res.inputProps.value = ((_state_timeValue = state.timeValue) === null || _state_timeValue === void 0 ? void 0 : _state_timeValue.toString()) || "";
|
|
994
|
+
return res;
|
|
985
995
|
}
|
|
986
996
|
|
|
987
997
|
|
|
@@ -993,7 +1003,7 @@ function $e90ae7c26a69c6b1$export$42df105a73306d51(props, state, ref) {
|
|
|
993
1003
|
let buttonId = (0, $IwcIq$reactariautils.useId)();
|
|
994
1004
|
let dialogId = (0, $IwcIq$reactariautils.useId)();
|
|
995
1005
|
let fieldId = (0, $IwcIq$reactariautils.useId)();
|
|
996
|
-
let stringFormatter = (0, $IwcIq$reactariai18n.useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($
|
|
1006
|
+
let stringFormatter = (0, $IwcIq$reactariai18n.useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($c1905b78f6d2f5bf$exports))));
|
|
997
1007
|
let { labelProps: labelProps , fieldProps: fieldProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps } = (0, $IwcIq$reactarialabel.useField)({
|
|
998
1008
|
...props,
|
|
999
1009
|
labelElementType: "span"
|
|
@@ -1056,12 +1066,14 @@ function $e90ae7c26a69c6b1$export$42df105a73306d51(props, state, ref) {
|
|
|
1056
1066
|
placeholderValue: props.placeholderValue,
|
|
1057
1067
|
hideTimeZone: props.hideTimeZone,
|
|
1058
1068
|
hourCycle: props.hourCycle,
|
|
1069
|
+
shouldForceLeadingZeros: props.shouldForceLeadingZeros,
|
|
1059
1070
|
granularity: props.granularity,
|
|
1060
1071
|
isDisabled: props.isDisabled,
|
|
1061
1072
|
isReadOnly: props.isReadOnly,
|
|
1062
1073
|
isRequired: props.isRequired,
|
|
1063
1074
|
validationState: state.validationState,
|
|
1064
|
-
autoFocus: props.autoFocus
|
|
1075
|
+
autoFocus: props.autoFocus,
|
|
1076
|
+
name: props.name
|
|
1065
1077
|
},
|
|
1066
1078
|
descriptionProps: descriptionProps,
|
|
1067
1079
|
errorMessageProps: errorMessageProps,
|
|
@@ -1070,14 +1082,14 @@ function $e90ae7c26a69c6b1$export$42df105a73306d51(props, state, ref) {
|
|
|
1070
1082
|
id: buttonId,
|
|
1071
1083
|
"aria-haspopup": "dialog",
|
|
1072
1084
|
"aria-label": stringFormatter.format("calendar"),
|
|
1073
|
-
"aria-labelledby": `${
|
|
1085
|
+
"aria-labelledby": `${buttonId} ${labelledBy}`,
|
|
1074
1086
|
"aria-describedby": ariaDescribedBy,
|
|
1075
1087
|
"aria-expanded": state.isOpen || undefined,
|
|
1076
1088
|
onPress: ()=>state.setOpen(true)
|
|
1077
1089
|
},
|
|
1078
1090
|
dialogProps: {
|
|
1079
1091
|
id: dialogId,
|
|
1080
|
-
"aria-labelledby": `${
|
|
1092
|
+
"aria-labelledby": `${buttonId} ${labelledBy}`
|
|
1081
1093
|
},
|
|
1082
1094
|
calendarProps: {
|
|
1083
1095
|
autoFocus: true,
|
|
@@ -1150,7 +1162,7 @@ class $934ac650a0aceb4b$var$DisplayNamesPolyfill {
|
|
|
1150
1162
|
}
|
|
1151
1163
|
constructor(locale){
|
|
1152
1164
|
this.locale = locale;
|
|
1153
|
-
this.dictionary = new (0, $IwcIq$internationalizedstring.LocalizedStringDictionary)((0, (/*@__PURE__*/$parcel$interopDefault($
|
|
1165
|
+
this.dictionary = new (0, $IwcIq$internationalizedstring.LocalizedStringDictionary)((0, (/*@__PURE__*/$parcel$interopDefault($c1905b78f6d2f5bf$exports))));
|
|
1154
1166
|
}
|
|
1155
1167
|
}
|
|
1156
1168
|
|
|
@@ -1428,7 +1440,7 @@ function $5c015c6316d1904d$export$1315d136e6f7581(segment, state, ref) {
|
|
|
1428
1440
|
// This is needed because VoiceOver on iOS does not announce groups.
|
|
1429
1441
|
let name = segment.type === "literal" ? "" : displayNames.of(segment.type);
|
|
1430
1442
|
let labelProps = (0, $IwcIq$reactariautils.useLabels)({
|
|
1431
|
-
"aria-label":
|
|
1443
|
+
"aria-label": `${name}${ariaLabel ? `, ${ariaLabel}` : ""}${ariaLabelledBy ? ", " : ""}`,
|
|
1432
1444
|
"aria-labelledby": ariaLabelledBy
|
|
1433
1445
|
});
|
|
1434
1446
|
// Literal segments should not be visible to screen readers. We don't really need any of the above,
|
|
@@ -1504,7 +1516,7 @@ function $5c015c6316d1904d$var$commonPrefixLength(strings) {
|
|
|
1504
1516
|
|
|
1505
1517
|
function $20f695b1b69e6b9e$export$12fd5f0e9f4bb192(props, state, ref) {
|
|
1506
1518
|
var _state_value, _state_value1;
|
|
1507
|
-
let stringFormatter = (0, $IwcIq$reactariai18n.useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($
|
|
1519
|
+
let stringFormatter = (0, $IwcIq$reactariai18n.useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($c1905b78f6d2f5bf$exports))));
|
|
1508
1520
|
let { labelProps: labelProps , fieldProps: fieldProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps } = (0, $IwcIq$reactarialabel.useField)({
|
|
1509
1521
|
...props,
|
|
1510
1522
|
labelElementType: "span"
|
|
@@ -1551,6 +1563,7 @@ function $20f695b1b69e6b9e$export$12fd5f0e9f4bb192(props, state, ref) {
|
|
|
1551
1563
|
hideTimeZone: props.hideTimeZone,
|
|
1552
1564
|
hourCycle: props.hourCycle,
|
|
1553
1565
|
granularity: props.granularity,
|
|
1566
|
+
shouldForceLeadingZeros: props.shouldForceLeadingZeros,
|
|
1554
1567
|
isDisabled: props.isDisabled,
|
|
1555
1568
|
isReadOnly: props.isReadOnly,
|
|
1556
1569
|
isRequired: props.isRequired,
|
|
@@ -1589,27 +1602,29 @@ function $20f695b1b69e6b9e$export$12fd5f0e9f4bb192(props, state, ref) {
|
|
|
1589
1602
|
id: buttonId,
|
|
1590
1603
|
"aria-haspopup": "dialog",
|
|
1591
1604
|
"aria-label": stringFormatter.format("calendar"),
|
|
1592
|
-
"aria-labelledby": `${
|
|
1605
|
+
"aria-labelledby": `${buttonId} ${labelledBy}`,
|
|
1593
1606
|
"aria-describedby": ariaDescribedBy,
|
|
1594
1607
|
"aria-expanded": state.isOpen || undefined,
|
|
1595
1608
|
onPress: ()=>state.setOpen(true)
|
|
1596
1609
|
},
|
|
1597
1610
|
dialogProps: {
|
|
1598
1611
|
id: dialogId,
|
|
1599
|
-
"aria-labelledby": `${
|
|
1612
|
+
"aria-labelledby": `${buttonId} ${labelledBy}`
|
|
1600
1613
|
},
|
|
1601
1614
|
startFieldProps: {
|
|
1602
1615
|
...startFieldProps,
|
|
1603
1616
|
...commonFieldProps,
|
|
1604
1617
|
value: (_state_value = state.value) === null || _state_value === void 0 ? void 0 : _state_value.start,
|
|
1605
1618
|
onChange: (start)=>state.setDateTime("start", start),
|
|
1606
|
-
autoFocus: props.autoFocus
|
|
1619
|
+
autoFocus: props.autoFocus,
|
|
1620
|
+
name: props.startName
|
|
1607
1621
|
},
|
|
1608
1622
|
endFieldProps: {
|
|
1609
1623
|
...endFieldProps,
|
|
1610
1624
|
...commonFieldProps,
|
|
1611
1625
|
value: (_state_value1 = state.value) === null || _state_value1 === void 0 ? void 0 : _state_value1.end,
|
|
1612
|
-
onChange: (end)=>state.setDateTime("end", end)
|
|
1626
|
+
onChange: (end)=>state.setDateTime("end", end),
|
|
1627
|
+
name: props.endName
|
|
1613
1628
|
},
|
|
1614
1629
|
descriptionProps: descriptionProps,
|
|
1615
1630
|
errorMessageProps: errorMessageProps,
|