@react-aria/datepicker 3.10.0 → 3.10.1
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/ar-AE.mjs +1 -1
- package/dist/bg-BG.mjs +1 -1
- package/dist/cs-CZ.mjs +1 -1
- package/dist/da-DK.mjs +1 -1
- package/dist/de-DE.mjs +1 -1
- package/dist/el-GR.mjs +1 -1
- package/dist/en-US.mjs +1 -1
- package/dist/es-ES.mjs +1 -1
- package/dist/et-EE.mjs +1 -1
- package/dist/fi-FI.mjs +1 -1
- package/dist/fr-FR.mjs +1 -1
- package/dist/he-IL.mjs +1 -1
- package/dist/hr-HR.mjs +1 -1
- package/dist/hu-HU.mjs +1 -1
- package/dist/intlStrings.mjs +1 -1
- package/dist/it-IT.mjs +1 -1
- package/dist/ja-JP.mjs +1 -1
- package/dist/ko-KR.mjs +1 -1
- package/dist/lt-LT.mjs +1 -1
- package/dist/lv-LV.mjs +1 -1
- package/dist/nb-NO.mjs +1 -1
- package/dist/nl-NL.mjs +1 -1
- package/dist/pl-PL.mjs +1 -1
- package/dist/pt-BR.mjs +1 -1
- package/dist/pt-PT.mjs +1 -1
- package/dist/ro-RO.mjs +1 -1
- package/dist/ru-RU.mjs +1 -1
- package/dist/sk-SK.mjs +1 -1
- package/dist/sl-SI.mjs +1 -1
- package/dist/sr-SP.mjs +1 -1
- package/dist/sv-SE.mjs +1 -1
- package/dist/tr-TR.mjs +1 -1
- package/dist/uk-UA.mjs +1 -1
- package/dist/useDateField.main.js +26 -26
- package/dist/useDateField.mjs +27 -27
- package/dist/useDateField.module.js +26 -26
- package/dist/useDatePicker.main.js +22 -22
- package/dist/useDatePicker.mjs +23 -23
- package/dist/useDatePicker.module.js +22 -22
- package/dist/useDatePickerGroup.main.js +9 -9
- package/dist/useDatePickerGroup.mjs +10 -10
- package/dist/useDatePickerGroup.module.js +9 -9
- package/dist/useDateRangePicker.main.js +27 -27
- package/dist/useDateRangePicker.mjs +28 -28
- package/dist/useDateRangePicker.module.js +27 -27
- package/dist/useDateSegment.main.js +72 -72
- package/dist/useDateSegment.mjs +73 -73
- package/dist/useDateSegment.module.js +72 -72
- package/dist/useDisplayNames.main.js +2 -2
- package/dist/useDisplayNames.mjs +3 -3
- package/dist/useDisplayNames.module.js +2 -2
- package/dist/zh-CN.mjs +1 -1
- package/dist/zh-TW.mjs +1 -1
- package/package.json +19 -19
package/dist/ar-AE.mjs
CHANGED
package/dist/bg-BG.mjs
CHANGED
package/dist/cs-CZ.mjs
CHANGED
package/dist/da-DK.mjs
CHANGED
package/dist/de-DE.mjs
CHANGED
package/dist/el-GR.mjs
CHANGED
package/dist/en-US.mjs
CHANGED
package/dist/es-ES.mjs
CHANGED
package/dist/et-EE.mjs
CHANGED
package/dist/fi-FI.mjs
CHANGED
package/dist/fr-FR.mjs
CHANGED
package/dist/he-IL.mjs
CHANGED
package/dist/hr-HR.mjs
CHANGED
package/dist/hu-HU.mjs
CHANGED
package/dist/intlStrings.mjs
CHANGED
package/dist/it-IT.mjs
CHANGED
package/dist/ja-JP.mjs
CHANGED
package/dist/ko-KR.mjs
CHANGED
package/dist/lt-LT.mjs
CHANGED
package/dist/lv-LV.mjs
CHANGED
package/dist/nb-NO.mjs
CHANGED
package/dist/nl-NL.mjs
CHANGED
package/dist/pl-PL.mjs
CHANGED
package/dist/pt-BR.mjs
CHANGED
package/dist/pt-PT.mjs
CHANGED
package/dist/ro-RO.mjs
CHANGED
package/dist/ru-RU.mjs
CHANGED
package/dist/sk-SK.mjs
CHANGED
package/dist/sl-SI.mjs
CHANGED
package/dist/sr-SP.mjs
CHANGED
package/dist/sv-SE.mjs
CHANGED
package/dist/tr-TR.mjs
CHANGED
package/dist/uk-UA.mjs
CHANGED
|
@@ -42,14 +42,14 @@ $parcel$export(module.exports, "useTimeField", () => $4acc2f407c169e55$export$4c
|
|
|
42
42
|
|
|
43
43
|
|
|
44
44
|
const $4acc2f407c169e55$export$653eddfc964b0f8a = new WeakMap();
|
|
45
|
-
const $4acc2f407c169e55$export$300019f83c56d282 =
|
|
46
|
-
const $4acc2f407c169e55$export$7b3062cd49e80452 =
|
|
45
|
+
const $4acc2f407c169e55$export$300019f83c56d282 = '__role_' + Date.now();
|
|
46
|
+
const $4acc2f407c169e55$export$7b3062cd49e80452 = '__focusManager_' + Date.now();
|
|
47
47
|
function $4acc2f407c169e55$export$5591b0b878c1a989(props, state, ref) {
|
|
48
48
|
var _state_value;
|
|
49
49
|
let { isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = state.displayValidation;
|
|
50
50
|
let { labelProps: labelProps, fieldProps: fieldProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps } = (0, $lVMtq$reactarialabel.useField)({
|
|
51
51
|
...props,
|
|
52
|
-
labelElementType:
|
|
52
|
+
labelElementType: 'span',
|
|
53
53
|
isInvalid: isInvalid,
|
|
54
54
|
errorMessage: props.errorMessage || validationErrors
|
|
55
55
|
});
|
|
@@ -69,34 +69,34 @@ function $4acc2f407c169e55$export$5591b0b878c1a989(props, state, ref) {
|
|
|
69
69
|
},
|
|
70
70
|
onFocusWithinChange: props.onFocusChange
|
|
71
71
|
});
|
|
72
|
-
let stringFormatter = (0, $lVMtq$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($c1905b78f6d2f5bf$exports))),
|
|
73
|
-
let message = state.maxGranularity ===
|
|
74
|
-
let field = state.maxGranularity ===
|
|
72
|
+
let stringFormatter = (0, $lVMtq$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($c1905b78f6d2f5bf$exports))), '@react-aria/datepicker');
|
|
73
|
+
let message = state.maxGranularity === 'hour' ? 'selectedTimeDescription' : 'selectedDateDescription';
|
|
74
|
+
let field = state.maxGranularity === 'hour' ? 'time' : 'date';
|
|
75
75
|
let description = state.value ? stringFormatter.format(message, {
|
|
76
76
|
[field]: state.formatValue({
|
|
77
|
-
month:
|
|
77
|
+
month: 'long'
|
|
78
78
|
})
|
|
79
|
-
}) :
|
|
79
|
+
}) : '';
|
|
80
80
|
let descProps = (0, $lVMtq$reactariautils.useDescription)(description);
|
|
81
81
|
// If within a date picker or date range picker, the date field will have role="presentation" and an aria-describedby
|
|
82
82
|
// will be passed in that references the value (e.g. entire range). Otherwise, add the field's value description.
|
|
83
|
-
let describedBy = props[$4acc2f407c169e55$export$300019f83c56d282] ===
|
|
84
|
-
descProps[
|
|
85
|
-
fieldProps[
|
|
86
|
-
].filter(Boolean).join(
|
|
83
|
+
let describedBy = props[$4acc2f407c169e55$export$300019f83c56d282] === 'presentation' ? fieldProps['aria-describedby'] : [
|
|
84
|
+
descProps['aria-describedby'],
|
|
85
|
+
fieldProps['aria-describedby']
|
|
86
|
+
].filter(Boolean).join(' ') || undefined;
|
|
87
87
|
let propsFocusManager = props[$4acc2f407c169e55$export$7b3062cd49e80452];
|
|
88
88
|
let focusManager = (0, $lVMtq$react.useMemo)(()=>propsFocusManager || (0, $lVMtq$reactariafocus.createFocusManager)(ref), [
|
|
89
89
|
propsFocusManager,
|
|
90
90
|
ref
|
|
91
91
|
]);
|
|
92
|
-
let groupProps = (0, $715562ad3b4cced4$exports.useDatePickerGroup)(state, ref, props[$4acc2f407c169e55$export$300019f83c56d282] ===
|
|
92
|
+
let groupProps = (0, $715562ad3b4cced4$exports.useDatePickerGroup)(state, ref, props[$4acc2f407c169e55$export$300019f83c56d282] === 'presentation');
|
|
93
93
|
// Pass labels and other information to segments.
|
|
94
94
|
$4acc2f407c169e55$export$653eddfc964b0f8a.set(state, {
|
|
95
|
-
ariaLabel: props[
|
|
95
|
+
ariaLabel: props['aria-label'],
|
|
96
96
|
ariaLabelledBy: [
|
|
97
97
|
labelProps.id,
|
|
98
|
-
props[
|
|
99
|
-
].filter(Boolean).join(
|
|
98
|
+
props['aria-labelledby']
|
|
99
|
+
].filter(Boolean).join(' ') || undefined,
|
|
100
100
|
ariaDescribedBy: describedBy,
|
|
101
101
|
focusManager: focusManager
|
|
102
102
|
});
|
|
@@ -106,13 +106,13 @@ function $4acc2f407c169e55$export$5591b0b878c1a989(props, state, ref) {
|
|
|
106
106
|
// with a label and description, and the segments are already labeled by this as well, this
|
|
107
107
|
// avoids very verbose duplicate announcements.
|
|
108
108
|
let fieldDOMProps;
|
|
109
|
-
if (props[$4acc2f407c169e55$export$300019f83c56d282] ===
|
|
110
|
-
role:
|
|
109
|
+
if (props[$4acc2f407c169e55$export$300019f83c56d282] === 'presentation') fieldDOMProps = {
|
|
110
|
+
role: 'presentation'
|
|
111
111
|
};
|
|
112
112
|
else fieldDOMProps = (0, $lVMtq$reactariautils.mergeProps)(fieldProps, {
|
|
113
|
-
role:
|
|
114
|
-
|
|
115
|
-
|
|
113
|
+
role: 'group',
|
|
114
|
+
'aria-disabled': props.isDisabled || undefined,
|
|
115
|
+
'aria-describedby': describedBy
|
|
116
116
|
});
|
|
117
117
|
(0, $lVMtq$react.useEffect)(()=>{
|
|
118
118
|
if (autoFocusRef.current) focusManager.focusFirst();
|
|
@@ -128,14 +128,14 @@ function $4acc2f407c169e55$export$5591b0b878c1a989(props, state, ref) {
|
|
|
128
128
|
}
|
|
129
129
|
}, state, props.inputRef);
|
|
130
130
|
let inputProps = {
|
|
131
|
-
type:
|
|
131
|
+
type: 'hidden',
|
|
132
132
|
name: props.name,
|
|
133
|
-
value: ((_state_value = state.value) === null || _state_value === void 0 ? void 0 : _state_value.toString()) ||
|
|
133
|
+
value: ((_state_value = state.value) === null || _state_value === void 0 ? void 0 : _state_value.toString()) || ''
|
|
134
134
|
};
|
|
135
|
-
if (props.validationBehavior ===
|
|
135
|
+
if (props.validationBehavior === 'native') {
|
|
136
136
|
// Use a hidden <input type="text"> rather than <input type="hidden">
|
|
137
137
|
// so that an empty value blocks HTML form submission when the field is required.
|
|
138
|
-
inputProps.type =
|
|
138
|
+
inputProps.type = 'text';
|
|
139
139
|
inputProps.hidden = true;
|
|
140
140
|
inputProps.required = props.isRequired;
|
|
141
141
|
// Ignore react warning.
|
|
@@ -168,7 +168,7 @@ function $4acc2f407c169e55$export$5591b0b878c1a989(props, state, ref) {
|
|
|
168
168
|
function $4acc2f407c169e55$export$4c842f6a241dc825(props, state, ref) {
|
|
169
169
|
var _state_timeValue;
|
|
170
170
|
let res = $4acc2f407c169e55$export$5591b0b878c1a989(props, state, ref);
|
|
171
|
-
res.inputProps.value = ((_state_timeValue = state.timeValue) === null || _state_timeValue === void 0 ? void 0 : _state_timeValue.toString()) ||
|
|
171
|
+
res.inputProps.value = ((_state_timeValue = state.timeValue) === null || _state_timeValue === void 0 ? void 0 : _state_timeValue.toString()) || '';
|
|
172
172
|
return res;
|
|
173
173
|
}
|
|
174
174
|
|
package/dist/useDateField.mjs
CHANGED
|
@@ -32,14 +32,14 @@ function $parcel$interopDefault(a) {
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
const $16f0b7bb276bc17e$export$653eddfc964b0f8a = new WeakMap();
|
|
35
|
-
const $16f0b7bb276bc17e$export$300019f83c56d282 =
|
|
36
|
-
const $16f0b7bb276bc17e$export$7b3062cd49e80452 =
|
|
35
|
+
const $16f0b7bb276bc17e$export$300019f83c56d282 = '__role_' + Date.now();
|
|
36
|
+
const $16f0b7bb276bc17e$export$7b3062cd49e80452 = '__focusManager_' + Date.now();
|
|
37
37
|
function $16f0b7bb276bc17e$export$5591b0b878c1a989(props, state, ref) {
|
|
38
38
|
var _state_value;
|
|
39
39
|
let { isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = state.displayValidation;
|
|
40
40
|
let { labelProps: labelProps, fieldProps: fieldProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps } = (0, $7Gzdi$useField)({
|
|
41
41
|
...props,
|
|
42
|
-
labelElementType:
|
|
42
|
+
labelElementType: 'span',
|
|
43
43
|
isInvalid: isInvalid,
|
|
44
44
|
errorMessage: props.errorMessage || validationErrors
|
|
45
45
|
});
|
|
@@ -59,34 +59,34 @@ function $16f0b7bb276bc17e$export$5591b0b878c1a989(props, state, ref) {
|
|
|
59
59
|
},
|
|
60
60
|
onFocusWithinChange: props.onFocusChange
|
|
61
61
|
});
|
|
62
|
-
let stringFormatter = (0, $7Gzdi$useLocalizedStringFormatter)((0, ($parcel$interopDefault($7Gzdi$intlStringsmodulejs))),
|
|
63
|
-
let message = state.maxGranularity ===
|
|
64
|
-
let field = state.maxGranularity ===
|
|
62
|
+
let stringFormatter = (0, $7Gzdi$useLocalizedStringFormatter)((0, ($parcel$interopDefault($7Gzdi$intlStringsmodulejs))), '@react-aria/datepicker');
|
|
63
|
+
let message = state.maxGranularity === 'hour' ? 'selectedTimeDescription' : 'selectedDateDescription';
|
|
64
|
+
let field = state.maxGranularity === 'hour' ? 'time' : 'date';
|
|
65
65
|
let description = state.value ? stringFormatter.format(message, {
|
|
66
66
|
[field]: state.formatValue({
|
|
67
|
-
month:
|
|
67
|
+
month: 'long'
|
|
68
68
|
})
|
|
69
|
-
}) :
|
|
69
|
+
}) : '';
|
|
70
70
|
let descProps = (0, $7Gzdi$useDescription)(description);
|
|
71
71
|
// If within a date picker or date range picker, the date field will have role="presentation" and an aria-describedby
|
|
72
72
|
// will be passed in that references the value (e.g. entire range). Otherwise, add the field's value description.
|
|
73
|
-
let describedBy = props[$16f0b7bb276bc17e$export$300019f83c56d282] ===
|
|
74
|
-
descProps[
|
|
75
|
-
fieldProps[
|
|
76
|
-
].filter(Boolean).join(
|
|
73
|
+
let describedBy = props[$16f0b7bb276bc17e$export$300019f83c56d282] === 'presentation' ? fieldProps['aria-describedby'] : [
|
|
74
|
+
descProps['aria-describedby'],
|
|
75
|
+
fieldProps['aria-describedby']
|
|
76
|
+
].filter(Boolean).join(' ') || undefined;
|
|
77
77
|
let propsFocusManager = props[$16f0b7bb276bc17e$export$7b3062cd49e80452];
|
|
78
78
|
let focusManager = (0, $7Gzdi$useMemo)(()=>propsFocusManager || (0, $7Gzdi$createFocusManager)(ref), [
|
|
79
79
|
propsFocusManager,
|
|
80
80
|
ref
|
|
81
81
|
]);
|
|
82
|
-
let groupProps = (0, $3dfb0f96be0d6a08$export$4a931266a3838b86)(state, ref, props[$16f0b7bb276bc17e$export$300019f83c56d282] ===
|
|
82
|
+
let groupProps = (0, $3dfb0f96be0d6a08$export$4a931266a3838b86)(state, ref, props[$16f0b7bb276bc17e$export$300019f83c56d282] === 'presentation');
|
|
83
83
|
// Pass labels and other information to segments.
|
|
84
84
|
$16f0b7bb276bc17e$export$653eddfc964b0f8a.set(state, {
|
|
85
|
-
ariaLabel: props[
|
|
85
|
+
ariaLabel: props['aria-label'],
|
|
86
86
|
ariaLabelledBy: [
|
|
87
87
|
labelProps.id,
|
|
88
|
-
props[
|
|
89
|
-
].filter(Boolean).join(
|
|
88
|
+
props['aria-labelledby']
|
|
89
|
+
].filter(Boolean).join(' ') || undefined,
|
|
90
90
|
ariaDescribedBy: describedBy,
|
|
91
91
|
focusManager: focusManager
|
|
92
92
|
});
|
|
@@ -96,13 +96,13 @@ function $16f0b7bb276bc17e$export$5591b0b878c1a989(props, state, ref) {
|
|
|
96
96
|
// with a label and description, and the segments are already labeled by this as well, this
|
|
97
97
|
// avoids very verbose duplicate announcements.
|
|
98
98
|
let fieldDOMProps;
|
|
99
|
-
if (props[$16f0b7bb276bc17e$export$300019f83c56d282] ===
|
|
100
|
-
role:
|
|
99
|
+
if (props[$16f0b7bb276bc17e$export$300019f83c56d282] === 'presentation') fieldDOMProps = {
|
|
100
|
+
role: 'presentation'
|
|
101
101
|
};
|
|
102
102
|
else fieldDOMProps = (0, $7Gzdi$mergeProps)(fieldProps, {
|
|
103
|
-
role:
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
role: 'group',
|
|
104
|
+
'aria-disabled': props.isDisabled || undefined,
|
|
105
|
+
'aria-describedby': describedBy
|
|
106
106
|
});
|
|
107
107
|
(0, $7Gzdi$useEffect)(()=>{
|
|
108
108
|
if (autoFocusRef.current) focusManager.focusFirst();
|
|
@@ -118,14 +118,14 @@ function $16f0b7bb276bc17e$export$5591b0b878c1a989(props, state, ref) {
|
|
|
118
118
|
}
|
|
119
119
|
}, state, props.inputRef);
|
|
120
120
|
let inputProps = {
|
|
121
|
-
type:
|
|
121
|
+
type: 'hidden',
|
|
122
122
|
name: props.name,
|
|
123
|
-
value: ((_state_value = state.value) === null || _state_value === void 0 ? void 0 : _state_value.toString()) ||
|
|
123
|
+
value: ((_state_value = state.value) === null || _state_value === void 0 ? void 0 : _state_value.toString()) || ''
|
|
124
124
|
};
|
|
125
|
-
if (props.validationBehavior ===
|
|
125
|
+
if (props.validationBehavior === 'native') {
|
|
126
126
|
// Use a hidden <input type="text"> rather than <input type="hidden">
|
|
127
127
|
// so that an empty value blocks HTML form submission when the field is required.
|
|
128
|
-
inputProps.type =
|
|
128
|
+
inputProps.type = 'text';
|
|
129
129
|
inputProps.hidden = true;
|
|
130
130
|
inputProps.required = props.isRequired;
|
|
131
131
|
// Ignore react warning.
|
|
@@ -158,10 +158,10 @@ function $16f0b7bb276bc17e$export$5591b0b878c1a989(props, state, ref) {
|
|
|
158
158
|
function $16f0b7bb276bc17e$export$4c842f6a241dc825(props, state, ref) {
|
|
159
159
|
var _state_timeValue;
|
|
160
160
|
let res = $16f0b7bb276bc17e$export$5591b0b878c1a989(props, state, ref);
|
|
161
|
-
res.inputProps.value = ((_state_timeValue = state.timeValue) === null || _state_timeValue === void 0 ? void 0 : _state_timeValue.toString()) ||
|
|
161
|
+
res.inputProps.value = ((_state_timeValue = state.timeValue) === null || _state_timeValue === void 0 ? void 0 : _state_timeValue.toString()) || '';
|
|
162
162
|
return res;
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
|
|
166
166
|
export {$16f0b7bb276bc17e$export$653eddfc964b0f8a as hookData, $16f0b7bb276bc17e$export$300019f83c56d282 as roleSymbol, $16f0b7bb276bc17e$export$7b3062cd49e80452 as focusManagerSymbol, $16f0b7bb276bc17e$export$5591b0b878c1a989 as useDateField, $16f0b7bb276bc17e$export$4c842f6a241dc825 as useTimeField};
|
|
167
|
-
//# sourceMappingURL=useDateField.
|
|
167
|
+
//# sourceMappingURL=useDateField.module.js.map
|
|
@@ -32,14 +32,14 @@ function $parcel$interopDefault(a) {
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
const $16f0b7bb276bc17e$export$653eddfc964b0f8a = new WeakMap();
|
|
35
|
-
const $16f0b7bb276bc17e$export$300019f83c56d282 =
|
|
36
|
-
const $16f0b7bb276bc17e$export$7b3062cd49e80452 =
|
|
35
|
+
const $16f0b7bb276bc17e$export$300019f83c56d282 = '__role_' + Date.now();
|
|
36
|
+
const $16f0b7bb276bc17e$export$7b3062cd49e80452 = '__focusManager_' + Date.now();
|
|
37
37
|
function $16f0b7bb276bc17e$export$5591b0b878c1a989(props, state, ref) {
|
|
38
38
|
var _state_value;
|
|
39
39
|
let { isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = state.displayValidation;
|
|
40
40
|
let { labelProps: labelProps, fieldProps: fieldProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps } = (0, $7Gzdi$useField)({
|
|
41
41
|
...props,
|
|
42
|
-
labelElementType:
|
|
42
|
+
labelElementType: 'span',
|
|
43
43
|
isInvalid: isInvalid,
|
|
44
44
|
errorMessage: props.errorMessage || validationErrors
|
|
45
45
|
});
|
|
@@ -59,34 +59,34 @@ function $16f0b7bb276bc17e$export$5591b0b878c1a989(props, state, ref) {
|
|
|
59
59
|
},
|
|
60
60
|
onFocusWithinChange: props.onFocusChange
|
|
61
61
|
});
|
|
62
|
-
let stringFormatter = (0, $7Gzdi$useLocalizedStringFormatter)((0, ($parcel$interopDefault($7Gzdi$intlStringsmodulejs))),
|
|
63
|
-
let message = state.maxGranularity ===
|
|
64
|
-
let field = state.maxGranularity ===
|
|
62
|
+
let stringFormatter = (0, $7Gzdi$useLocalizedStringFormatter)((0, ($parcel$interopDefault($7Gzdi$intlStringsmodulejs))), '@react-aria/datepicker');
|
|
63
|
+
let message = state.maxGranularity === 'hour' ? 'selectedTimeDescription' : 'selectedDateDescription';
|
|
64
|
+
let field = state.maxGranularity === 'hour' ? 'time' : 'date';
|
|
65
65
|
let description = state.value ? stringFormatter.format(message, {
|
|
66
66
|
[field]: state.formatValue({
|
|
67
|
-
month:
|
|
67
|
+
month: 'long'
|
|
68
68
|
})
|
|
69
|
-
}) :
|
|
69
|
+
}) : '';
|
|
70
70
|
let descProps = (0, $7Gzdi$useDescription)(description);
|
|
71
71
|
// If within a date picker or date range picker, the date field will have role="presentation" and an aria-describedby
|
|
72
72
|
// will be passed in that references the value (e.g. entire range). Otherwise, add the field's value description.
|
|
73
|
-
let describedBy = props[$16f0b7bb276bc17e$export$300019f83c56d282] ===
|
|
74
|
-
descProps[
|
|
75
|
-
fieldProps[
|
|
76
|
-
].filter(Boolean).join(
|
|
73
|
+
let describedBy = props[$16f0b7bb276bc17e$export$300019f83c56d282] === 'presentation' ? fieldProps['aria-describedby'] : [
|
|
74
|
+
descProps['aria-describedby'],
|
|
75
|
+
fieldProps['aria-describedby']
|
|
76
|
+
].filter(Boolean).join(' ') || undefined;
|
|
77
77
|
let propsFocusManager = props[$16f0b7bb276bc17e$export$7b3062cd49e80452];
|
|
78
78
|
let focusManager = (0, $7Gzdi$useMemo)(()=>propsFocusManager || (0, $7Gzdi$createFocusManager)(ref), [
|
|
79
79
|
propsFocusManager,
|
|
80
80
|
ref
|
|
81
81
|
]);
|
|
82
|
-
let groupProps = (0, $3dfb0f96be0d6a08$export$4a931266a3838b86)(state, ref, props[$16f0b7bb276bc17e$export$300019f83c56d282] ===
|
|
82
|
+
let groupProps = (0, $3dfb0f96be0d6a08$export$4a931266a3838b86)(state, ref, props[$16f0b7bb276bc17e$export$300019f83c56d282] === 'presentation');
|
|
83
83
|
// Pass labels and other information to segments.
|
|
84
84
|
$16f0b7bb276bc17e$export$653eddfc964b0f8a.set(state, {
|
|
85
|
-
ariaLabel: props[
|
|
85
|
+
ariaLabel: props['aria-label'],
|
|
86
86
|
ariaLabelledBy: [
|
|
87
87
|
labelProps.id,
|
|
88
|
-
props[
|
|
89
|
-
].filter(Boolean).join(
|
|
88
|
+
props['aria-labelledby']
|
|
89
|
+
].filter(Boolean).join(' ') || undefined,
|
|
90
90
|
ariaDescribedBy: describedBy,
|
|
91
91
|
focusManager: focusManager
|
|
92
92
|
});
|
|
@@ -96,13 +96,13 @@ function $16f0b7bb276bc17e$export$5591b0b878c1a989(props, state, ref) {
|
|
|
96
96
|
// with a label and description, and the segments are already labeled by this as well, this
|
|
97
97
|
// avoids very verbose duplicate announcements.
|
|
98
98
|
let fieldDOMProps;
|
|
99
|
-
if (props[$16f0b7bb276bc17e$export$300019f83c56d282] ===
|
|
100
|
-
role:
|
|
99
|
+
if (props[$16f0b7bb276bc17e$export$300019f83c56d282] === 'presentation') fieldDOMProps = {
|
|
100
|
+
role: 'presentation'
|
|
101
101
|
};
|
|
102
102
|
else fieldDOMProps = (0, $7Gzdi$mergeProps)(fieldProps, {
|
|
103
|
-
role:
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
role: 'group',
|
|
104
|
+
'aria-disabled': props.isDisabled || undefined,
|
|
105
|
+
'aria-describedby': describedBy
|
|
106
106
|
});
|
|
107
107
|
(0, $7Gzdi$useEffect)(()=>{
|
|
108
108
|
if (autoFocusRef.current) focusManager.focusFirst();
|
|
@@ -118,14 +118,14 @@ function $16f0b7bb276bc17e$export$5591b0b878c1a989(props, state, ref) {
|
|
|
118
118
|
}
|
|
119
119
|
}, state, props.inputRef);
|
|
120
120
|
let inputProps = {
|
|
121
|
-
type:
|
|
121
|
+
type: 'hidden',
|
|
122
122
|
name: props.name,
|
|
123
|
-
value: ((_state_value = state.value) === null || _state_value === void 0 ? void 0 : _state_value.toString()) ||
|
|
123
|
+
value: ((_state_value = state.value) === null || _state_value === void 0 ? void 0 : _state_value.toString()) || ''
|
|
124
124
|
};
|
|
125
|
-
if (props.validationBehavior ===
|
|
125
|
+
if (props.validationBehavior === 'native') {
|
|
126
126
|
// Use a hidden <input type="text"> rather than <input type="hidden">
|
|
127
127
|
// so that an empty value blocks HTML form submission when the field is required.
|
|
128
|
-
inputProps.type =
|
|
128
|
+
inputProps.type = 'text';
|
|
129
129
|
inputProps.hidden = true;
|
|
130
130
|
inputProps.required = props.isRequired;
|
|
131
131
|
// Ignore react warning.
|
|
@@ -158,7 +158,7 @@ function $16f0b7bb276bc17e$export$5591b0b878c1a989(props, state, ref) {
|
|
|
158
158
|
function $16f0b7bb276bc17e$export$4c842f6a241dc825(props, state, ref) {
|
|
159
159
|
var _state_timeValue;
|
|
160
160
|
let res = $16f0b7bb276bc17e$export$5591b0b878c1a989(props, state, ref);
|
|
161
|
-
res.inputProps.value = ((_state_timeValue = state.timeValue) === null || _state_timeValue === void 0 ? void 0 : _state_timeValue.toString()) ||
|
|
161
|
+
res.inputProps.value = ((_state_timeValue = state.timeValue) === null || _state_timeValue === void 0 ? void 0 : _state_timeValue.toString()) || '';
|
|
162
162
|
return res;
|
|
163
163
|
}
|
|
164
164
|
|