@react-aria/select 3.14.5-nightly.4623 → 3.14.5
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/HiddenSelect.main.js +8 -8
- package/dist/HiddenSelect.mjs +8 -8
- package/dist/HiddenSelect.module.js +8 -8
- package/dist/useSelect.main.js +17 -17
- package/dist/useSelect.mjs +17 -17
- package/dist/useSelect.module.js +17 -17
- package/package.json +15 -15
|
@@ -65,12 +65,12 @@ function $6eae0e0872a4cdd4$export$f809e80f58e251d1(props, state, triggerRef) {
|
|
|
65
65
|
return {
|
|
66
66
|
containerProps: {
|
|
67
67
|
...visuallyHiddenProps,
|
|
68
|
-
|
|
69
|
-
[
|
|
70
|
-
[
|
|
68
|
+
'aria-hidden': true,
|
|
69
|
+
['data-react-aria-prevent-focus']: true,
|
|
70
|
+
['data-a11y-ignore']: 'aria-hidden-focus'
|
|
71
71
|
},
|
|
72
72
|
inputProps: {
|
|
73
|
-
type:
|
|
73
|
+
type: 'text',
|
|
74
74
|
tabIndex: modality == null || state.isFocused || state.isOpen ? -1 : 0,
|
|
75
75
|
style: {
|
|
76
76
|
fontSize: 16
|
|
@@ -82,9 +82,9 @@ function $6eae0e0872a4cdd4$export$f809e80f58e251d1(props, state, triggerRef) {
|
|
|
82
82
|
tabIndex: -1,
|
|
83
83
|
autoComplete: autoComplete,
|
|
84
84
|
disabled: isDisabled,
|
|
85
|
-
required: validationBehavior ===
|
|
85
|
+
required: validationBehavior === 'native' && isRequired,
|
|
86
86
|
name: name,
|
|
87
|
-
value: (_state_selectedKey = state.selectedKey) !== null && _state_selectedKey !== void 0 ? _state_selectedKey :
|
|
87
|
+
value: (_state_selectedKey = state.selectedKey) !== null && _state_selectedKey !== void 0 ? _state_selectedKey : '',
|
|
88
88
|
onChange: (e)=>state.setSelectedKey(e.target.value)
|
|
89
89
|
}
|
|
90
90
|
};
|
|
@@ -110,7 +110,7 @@ function $6eae0e0872a4cdd4$export$cbd84cdb2e668835(props) {
|
|
|
110
110
|
...state.collection.getKeys()
|
|
111
111
|
].map((key)=>{
|
|
112
112
|
let item = state.collection.getItem(key);
|
|
113
|
-
if (item.type ===
|
|
113
|
+
if (item.type === 'item') return /*#__PURE__*/ (0, ($parcel$interopDefault($ccxQv$react))).createElement("option", {
|
|
114
114
|
key: item.key,
|
|
115
115
|
value: item.key
|
|
116
116
|
}, item.textValue);
|
|
@@ -120,7 +120,7 @@ function $6eae0e0872a4cdd4$export$cbd84cdb2e668835(props) {
|
|
|
120
120
|
autoComplete: selectProps.autoComplete,
|
|
121
121
|
name: name,
|
|
122
122
|
disabled: isDisabled,
|
|
123
|
-
value: (_state_selectedKey = state.selectedKey) !== null && _state_selectedKey !== void 0 ? _state_selectedKey :
|
|
123
|
+
value: (_state_selectedKey = state.selectedKey) !== null && _state_selectedKey !== void 0 ? _state_selectedKey : ''
|
|
124
124
|
});
|
|
125
125
|
return null;
|
|
126
126
|
}
|
package/dist/HiddenSelect.mjs
CHANGED
|
@@ -54,12 +54,12 @@ function $bdd25dc72710631f$export$f809e80f58e251d1(props, state, triggerRef) {
|
|
|
54
54
|
return {
|
|
55
55
|
containerProps: {
|
|
56
56
|
...visuallyHiddenProps,
|
|
57
|
-
|
|
58
|
-
[
|
|
59
|
-
[
|
|
57
|
+
'aria-hidden': true,
|
|
58
|
+
['data-react-aria-prevent-focus']: true,
|
|
59
|
+
['data-a11y-ignore']: 'aria-hidden-focus'
|
|
60
60
|
},
|
|
61
61
|
inputProps: {
|
|
62
|
-
type:
|
|
62
|
+
type: 'text',
|
|
63
63
|
tabIndex: modality == null || state.isFocused || state.isOpen ? -1 : 0,
|
|
64
64
|
style: {
|
|
65
65
|
fontSize: 16
|
|
@@ -71,9 +71,9 @@ function $bdd25dc72710631f$export$f809e80f58e251d1(props, state, triggerRef) {
|
|
|
71
71
|
tabIndex: -1,
|
|
72
72
|
autoComplete: autoComplete,
|
|
73
73
|
disabled: isDisabled,
|
|
74
|
-
required: validationBehavior ===
|
|
74
|
+
required: validationBehavior === 'native' && isRequired,
|
|
75
75
|
name: name,
|
|
76
|
-
value: (_state_selectedKey = state.selectedKey) !== null && _state_selectedKey !== void 0 ? _state_selectedKey :
|
|
76
|
+
value: (_state_selectedKey = state.selectedKey) !== null && _state_selectedKey !== void 0 ? _state_selectedKey : '',
|
|
77
77
|
onChange: (e)=>state.setSelectedKey(e.target.value)
|
|
78
78
|
}
|
|
79
79
|
};
|
|
@@ -99,7 +99,7 @@ function $bdd25dc72710631f$export$cbd84cdb2e668835(props) {
|
|
|
99
99
|
...state.collection.getKeys()
|
|
100
100
|
].map((key)=>{
|
|
101
101
|
let item = state.collection.getItem(key);
|
|
102
|
-
if (item.type ===
|
|
102
|
+
if (item.type === 'item') return /*#__PURE__*/ (0, $8BE50$react).createElement("option", {
|
|
103
103
|
key: item.key,
|
|
104
104
|
value: item.key
|
|
105
105
|
}, item.textValue);
|
|
@@ -109,7 +109,7 @@ function $bdd25dc72710631f$export$cbd84cdb2e668835(props) {
|
|
|
109
109
|
autoComplete: selectProps.autoComplete,
|
|
110
110
|
name: name,
|
|
111
111
|
disabled: isDisabled,
|
|
112
|
-
value: (_state_selectedKey = state.selectedKey) !== null && _state_selectedKey !== void 0 ? _state_selectedKey :
|
|
112
|
+
value: (_state_selectedKey = state.selectedKey) !== null && _state_selectedKey !== void 0 ? _state_selectedKey : ''
|
|
113
113
|
});
|
|
114
114
|
return null;
|
|
115
115
|
}
|
|
@@ -54,12 +54,12 @@ function $bdd25dc72710631f$export$f809e80f58e251d1(props, state, triggerRef) {
|
|
|
54
54
|
return {
|
|
55
55
|
containerProps: {
|
|
56
56
|
...visuallyHiddenProps,
|
|
57
|
-
|
|
58
|
-
[
|
|
59
|
-
[
|
|
57
|
+
'aria-hidden': true,
|
|
58
|
+
['data-react-aria-prevent-focus']: true,
|
|
59
|
+
['data-a11y-ignore']: 'aria-hidden-focus'
|
|
60
60
|
},
|
|
61
61
|
inputProps: {
|
|
62
|
-
type:
|
|
62
|
+
type: 'text',
|
|
63
63
|
tabIndex: modality == null || state.isFocused || state.isOpen ? -1 : 0,
|
|
64
64
|
style: {
|
|
65
65
|
fontSize: 16
|
|
@@ -71,9 +71,9 @@ function $bdd25dc72710631f$export$f809e80f58e251d1(props, state, triggerRef) {
|
|
|
71
71
|
tabIndex: -1,
|
|
72
72
|
autoComplete: autoComplete,
|
|
73
73
|
disabled: isDisabled,
|
|
74
|
-
required: validationBehavior ===
|
|
74
|
+
required: validationBehavior === 'native' && isRequired,
|
|
75
75
|
name: name,
|
|
76
|
-
value: (_state_selectedKey = state.selectedKey) !== null && _state_selectedKey !== void 0 ? _state_selectedKey :
|
|
76
|
+
value: (_state_selectedKey = state.selectedKey) !== null && _state_selectedKey !== void 0 ? _state_selectedKey : '',
|
|
77
77
|
onChange: (e)=>state.setSelectedKey(e.target.value)
|
|
78
78
|
}
|
|
79
79
|
};
|
|
@@ -99,7 +99,7 @@ function $bdd25dc72710631f$export$cbd84cdb2e668835(props) {
|
|
|
99
99
|
...state.collection.getKeys()
|
|
100
100
|
].map((key)=>{
|
|
101
101
|
let item = state.collection.getItem(key);
|
|
102
|
-
if (item.type ===
|
|
102
|
+
if (item.type === 'item') return /*#__PURE__*/ (0, $8BE50$react).createElement("option", {
|
|
103
103
|
key: item.key,
|
|
104
104
|
value: item.key
|
|
105
105
|
}, item.textValue);
|
|
@@ -109,7 +109,7 @@ function $bdd25dc72710631f$export$cbd84cdb2e668835(props) {
|
|
|
109
109
|
autoComplete: selectProps.autoComplete,
|
|
110
110
|
name: name,
|
|
111
111
|
disabled: isDisabled,
|
|
112
|
-
value: (_state_selectedKey = state.selectedKey) !== null && _state_selectedKey !== void 0 ? _state_selectedKey :
|
|
112
|
+
value: (_state_selectedKey = state.selectedKey) !== null && _state_selectedKey !== void 0 ? _state_selectedKey : ''
|
|
113
113
|
});
|
|
114
114
|
return null;
|
|
115
115
|
}
|
package/dist/useSelect.main.js
CHANGED
|
@@ -32,12 +32,12 @@ $parcel$export(module.exports, "useSelect", () => $23a1e93dc7fa8653$export$e64b2
|
|
|
32
32
|
|
|
33
33
|
const $23a1e93dc7fa8653$export$703601b7e90536f8 = new WeakMap();
|
|
34
34
|
function $23a1e93dc7fa8653$export$e64b2f635402ca43(props, state, ref) {
|
|
35
|
-
let { keyboardDelegate: keyboardDelegate, isDisabled: isDisabled, isRequired: isRequired, name: name, validationBehavior: validationBehavior =
|
|
35
|
+
let { keyboardDelegate: keyboardDelegate, isDisabled: isDisabled, isRequired: isRequired, name: name, validationBehavior: validationBehavior = 'aria' } = props;
|
|
36
36
|
// By default, a KeyboardDelegate is provided which uses the DOM to query layout information (e.g. for page up/page down).
|
|
37
37
|
// When virtualized, the layout object will be passed in as a prop and override this.
|
|
38
38
|
let collator = (0, $63cuq$reactariai18n.useCollator)({
|
|
39
|
-
usage:
|
|
40
|
-
sensitivity:
|
|
39
|
+
usage: 'search',
|
|
40
|
+
sensitivity: 'base'
|
|
41
41
|
});
|
|
42
42
|
let delegate = (0, $63cuq$react.useMemo)(()=>keyboardDelegate || new (0, $63cuq$reactariaselection.ListKeyboardDelegate)(state.collection, state.disabledKeys, null, collator), [
|
|
43
43
|
keyboardDelegate,
|
|
@@ -47,11 +47,11 @@ function $23a1e93dc7fa8653$export$e64b2f635402ca43(props, state, ref) {
|
|
|
47
47
|
]);
|
|
48
48
|
let { menuTriggerProps: menuTriggerProps, menuProps: menuProps } = (0, $63cuq$reactariamenu.useMenuTrigger)({
|
|
49
49
|
isDisabled: isDisabled,
|
|
50
|
-
type:
|
|
50
|
+
type: 'listbox'
|
|
51
51
|
}, state, ref);
|
|
52
52
|
let onKeyDown = (e)=>{
|
|
53
53
|
switch(e.key){
|
|
54
|
-
case
|
|
54
|
+
case 'ArrowLeft':
|
|
55
55
|
{
|
|
56
56
|
// prevent scrolling containers
|
|
57
57
|
e.preventDefault();
|
|
@@ -59,7 +59,7 @@ function $23a1e93dc7fa8653$export$e64b2f635402ca43(props, state, ref) {
|
|
|
59
59
|
if (key) state.setSelectedKey(key);
|
|
60
60
|
break;
|
|
61
61
|
}
|
|
62
|
-
case
|
|
62
|
+
case 'ArrowRight':
|
|
63
63
|
{
|
|
64
64
|
// prevent scrolling containers
|
|
65
65
|
e.preventDefault();
|
|
@@ -79,7 +79,7 @@ function $23a1e93dc7fa8653$export$e64b2f635402ca43(props, state, ref) {
|
|
|
79
79
|
let { isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = state.displayValidation;
|
|
80
80
|
let { labelProps: labelProps, fieldProps: fieldProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps } = (0, $63cuq$reactarialabel.useField)({
|
|
81
81
|
...props,
|
|
82
|
-
labelElementType:
|
|
82
|
+
labelElementType: 'span',
|
|
83
83
|
isInvalid: isInvalid,
|
|
84
84
|
errorMessage: props.errorMessage || validationErrors
|
|
85
85
|
});
|
|
@@ -103,7 +103,7 @@ function $23a1e93dc7fa8653$export$e64b2f635402ca43(props, state, ref) {
|
|
|
103
103
|
if (!props.isDisabled) {
|
|
104
104
|
ref.current.focus();
|
|
105
105
|
// Show the focus ring so the user knows where focus went
|
|
106
|
-
(0, $63cuq$reactariainteractions.setInteractionModality)(
|
|
106
|
+
(0, $63cuq$reactariainteractions.setInteractionModality)('keyboard');
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
},
|
|
@@ -112,11 +112,11 @@ function $23a1e93dc7fa8653$export$e64b2f635402ca43(props, state, ref) {
|
|
|
112
112
|
isDisabled: isDisabled,
|
|
113
113
|
onKeyDown: (0, $63cuq$reactariautils.chain)(triggerProps.onKeyDown, onKeyDown, props.onKeyDown),
|
|
114
114
|
onKeyUp: props.onKeyUp,
|
|
115
|
-
|
|
115
|
+
'aria-labelledby': [
|
|
116
116
|
valueId,
|
|
117
|
-
triggerProps[
|
|
118
|
-
triggerProps[
|
|
119
|
-
].filter(Boolean).join(
|
|
117
|
+
triggerProps['aria-labelledby'],
|
|
118
|
+
triggerProps['aria-label'] && !triggerProps['aria-labelledby'] ? triggerProps.id : null
|
|
119
|
+
].filter(Boolean).join(' '),
|
|
120
120
|
onFocus (e) {
|
|
121
121
|
if (state.isFocused) return;
|
|
122
122
|
if (props.onFocus) props.onFocus(e);
|
|
@@ -139,17 +139,17 @@ function $23a1e93dc7fa8653$export$e64b2f635402ca43(props, state, ref) {
|
|
|
139
139
|
shouldSelectOnPressUp: true,
|
|
140
140
|
shouldFocusOnHover: true,
|
|
141
141
|
disallowEmptySelection: true,
|
|
142
|
-
linkBehavior:
|
|
142
|
+
linkBehavior: 'selection',
|
|
143
143
|
onBlur: (e)=>{
|
|
144
144
|
if (e.currentTarget.contains(e.relatedTarget)) return;
|
|
145
145
|
if (props.onBlur) props.onBlur(e);
|
|
146
146
|
if (props.onFocusChange) props.onFocusChange(false);
|
|
147
147
|
state.setFocused(false);
|
|
148
148
|
},
|
|
149
|
-
|
|
150
|
-
fieldProps[
|
|
151
|
-
triggerProps[
|
|
152
|
-
].filter(Boolean).join(
|
|
149
|
+
'aria-labelledby': [
|
|
150
|
+
fieldProps['aria-labelledby'],
|
|
151
|
+
triggerProps['aria-label'] && !fieldProps['aria-labelledby'] ? triggerProps.id : null
|
|
152
|
+
].filter(Boolean).join(' ')
|
|
153
153
|
},
|
|
154
154
|
descriptionProps: descriptionProps,
|
|
155
155
|
errorMessageProps: errorMessageProps,
|
package/dist/useSelect.mjs
CHANGED
|
@@ -25,12 +25,12 @@ import {useMenuTrigger as $aUnai$useMenuTrigger} from "@react-aria/menu";
|
|
|
25
25
|
|
|
26
26
|
const $58aed456727eb0f3$export$703601b7e90536f8 = new WeakMap();
|
|
27
27
|
function $58aed456727eb0f3$export$e64b2f635402ca43(props, state, ref) {
|
|
28
|
-
let { keyboardDelegate: keyboardDelegate, isDisabled: isDisabled, isRequired: isRequired, name: name, validationBehavior: validationBehavior =
|
|
28
|
+
let { keyboardDelegate: keyboardDelegate, isDisabled: isDisabled, isRequired: isRequired, name: name, validationBehavior: validationBehavior = 'aria' } = props;
|
|
29
29
|
// By default, a KeyboardDelegate is provided which uses the DOM to query layout information (e.g. for page up/page down).
|
|
30
30
|
// When virtualized, the layout object will be passed in as a prop and override this.
|
|
31
31
|
let collator = (0, $aUnai$useCollator)({
|
|
32
|
-
usage:
|
|
33
|
-
sensitivity:
|
|
32
|
+
usage: 'search',
|
|
33
|
+
sensitivity: 'base'
|
|
34
34
|
});
|
|
35
35
|
let delegate = (0, $aUnai$useMemo)(()=>keyboardDelegate || new (0, $aUnai$ListKeyboardDelegate)(state.collection, state.disabledKeys, null, collator), [
|
|
36
36
|
keyboardDelegate,
|
|
@@ -40,11 +40,11 @@ function $58aed456727eb0f3$export$e64b2f635402ca43(props, state, ref) {
|
|
|
40
40
|
]);
|
|
41
41
|
let { menuTriggerProps: menuTriggerProps, menuProps: menuProps } = (0, $aUnai$useMenuTrigger)({
|
|
42
42
|
isDisabled: isDisabled,
|
|
43
|
-
type:
|
|
43
|
+
type: 'listbox'
|
|
44
44
|
}, state, ref);
|
|
45
45
|
let onKeyDown = (e)=>{
|
|
46
46
|
switch(e.key){
|
|
47
|
-
case
|
|
47
|
+
case 'ArrowLeft':
|
|
48
48
|
{
|
|
49
49
|
// prevent scrolling containers
|
|
50
50
|
e.preventDefault();
|
|
@@ -52,7 +52,7 @@ function $58aed456727eb0f3$export$e64b2f635402ca43(props, state, ref) {
|
|
|
52
52
|
if (key) state.setSelectedKey(key);
|
|
53
53
|
break;
|
|
54
54
|
}
|
|
55
|
-
case
|
|
55
|
+
case 'ArrowRight':
|
|
56
56
|
{
|
|
57
57
|
// prevent scrolling containers
|
|
58
58
|
e.preventDefault();
|
|
@@ -72,7 +72,7 @@ function $58aed456727eb0f3$export$e64b2f635402ca43(props, state, ref) {
|
|
|
72
72
|
let { isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = state.displayValidation;
|
|
73
73
|
let { labelProps: labelProps, fieldProps: fieldProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps } = (0, $aUnai$useField)({
|
|
74
74
|
...props,
|
|
75
|
-
labelElementType:
|
|
75
|
+
labelElementType: 'span',
|
|
76
76
|
isInvalid: isInvalid,
|
|
77
77
|
errorMessage: props.errorMessage || validationErrors
|
|
78
78
|
});
|
|
@@ -96,7 +96,7 @@ function $58aed456727eb0f3$export$e64b2f635402ca43(props, state, ref) {
|
|
|
96
96
|
if (!props.isDisabled) {
|
|
97
97
|
ref.current.focus();
|
|
98
98
|
// Show the focus ring so the user knows where focus went
|
|
99
|
-
(0, $aUnai$setInteractionModality)(
|
|
99
|
+
(0, $aUnai$setInteractionModality)('keyboard');
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
},
|
|
@@ -105,11 +105,11 @@ function $58aed456727eb0f3$export$e64b2f635402ca43(props, state, ref) {
|
|
|
105
105
|
isDisabled: isDisabled,
|
|
106
106
|
onKeyDown: (0, $aUnai$chain)(triggerProps.onKeyDown, onKeyDown, props.onKeyDown),
|
|
107
107
|
onKeyUp: props.onKeyUp,
|
|
108
|
-
|
|
108
|
+
'aria-labelledby': [
|
|
109
109
|
valueId,
|
|
110
|
-
triggerProps[
|
|
111
|
-
triggerProps[
|
|
112
|
-
].filter(Boolean).join(
|
|
110
|
+
triggerProps['aria-labelledby'],
|
|
111
|
+
triggerProps['aria-label'] && !triggerProps['aria-labelledby'] ? triggerProps.id : null
|
|
112
|
+
].filter(Boolean).join(' '),
|
|
113
113
|
onFocus (e) {
|
|
114
114
|
if (state.isFocused) return;
|
|
115
115
|
if (props.onFocus) props.onFocus(e);
|
|
@@ -132,17 +132,17 @@ function $58aed456727eb0f3$export$e64b2f635402ca43(props, state, ref) {
|
|
|
132
132
|
shouldSelectOnPressUp: true,
|
|
133
133
|
shouldFocusOnHover: true,
|
|
134
134
|
disallowEmptySelection: true,
|
|
135
|
-
linkBehavior:
|
|
135
|
+
linkBehavior: 'selection',
|
|
136
136
|
onBlur: (e)=>{
|
|
137
137
|
if (e.currentTarget.contains(e.relatedTarget)) return;
|
|
138
138
|
if (props.onBlur) props.onBlur(e);
|
|
139
139
|
if (props.onFocusChange) props.onFocusChange(false);
|
|
140
140
|
state.setFocused(false);
|
|
141
141
|
},
|
|
142
|
-
|
|
143
|
-
fieldProps[
|
|
144
|
-
triggerProps[
|
|
145
|
-
].filter(Boolean).join(
|
|
142
|
+
'aria-labelledby': [
|
|
143
|
+
fieldProps['aria-labelledby'],
|
|
144
|
+
triggerProps['aria-label'] && !fieldProps['aria-labelledby'] ? triggerProps.id : null
|
|
145
|
+
].filter(Boolean).join(' ')
|
|
146
146
|
},
|
|
147
147
|
descriptionProps: descriptionProps,
|
|
148
148
|
errorMessageProps: errorMessageProps,
|
package/dist/useSelect.module.js
CHANGED
|
@@ -25,12 +25,12 @@ import {useMenuTrigger as $aUnai$useMenuTrigger} from "@react-aria/menu";
|
|
|
25
25
|
|
|
26
26
|
const $58aed456727eb0f3$export$703601b7e90536f8 = new WeakMap();
|
|
27
27
|
function $58aed456727eb0f3$export$e64b2f635402ca43(props, state, ref) {
|
|
28
|
-
let { keyboardDelegate: keyboardDelegate, isDisabled: isDisabled, isRequired: isRequired, name: name, validationBehavior: validationBehavior =
|
|
28
|
+
let { keyboardDelegate: keyboardDelegate, isDisabled: isDisabled, isRequired: isRequired, name: name, validationBehavior: validationBehavior = 'aria' } = props;
|
|
29
29
|
// By default, a KeyboardDelegate is provided which uses the DOM to query layout information (e.g. for page up/page down).
|
|
30
30
|
// When virtualized, the layout object will be passed in as a prop and override this.
|
|
31
31
|
let collator = (0, $aUnai$useCollator)({
|
|
32
|
-
usage:
|
|
33
|
-
sensitivity:
|
|
32
|
+
usage: 'search',
|
|
33
|
+
sensitivity: 'base'
|
|
34
34
|
});
|
|
35
35
|
let delegate = (0, $aUnai$useMemo)(()=>keyboardDelegate || new (0, $aUnai$ListKeyboardDelegate)(state.collection, state.disabledKeys, null, collator), [
|
|
36
36
|
keyboardDelegate,
|
|
@@ -40,11 +40,11 @@ function $58aed456727eb0f3$export$e64b2f635402ca43(props, state, ref) {
|
|
|
40
40
|
]);
|
|
41
41
|
let { menuTriggerProps: menuTriggerProps, menuProps: menuProps } = (0, $aUnai$useMenuTrigger)({
|
|
42
42
|
isDisabled: isDisabled,
|
|
43
|
-
type:
|
|
43
|
+
type: 'listbox'
|
|
44
44
|
}, state, ref);
|
|
45
45
|
let onKeyDown = (e)=>{
|
|
46
46
|
switch(e.key){
|
|
47
|
-
case
|
|
47
|
+
case 'ArrowLeft':
|
|
48
48
|
{
|
|
49
49
|
// prevent scrolling containers
|
|
50
50
|
e.preventDefault();
|
|
@@ -52,7 +52,7 @@ function $58aed456727eb0f3$export$e64b2f635402ca43(props, state, ref) {
|
|
|
52
52
|
if (key) state.setSelectedKey(key);
|
|
53
53
|
break;
|
|
54
54
|
}
|
|
55
|
-
case
|
|
55
|
+
case 'ArrowRight':
|
|
56
56
|
{
|
|
57
57
|
// prevent scrolling containers
|
|
58
58
|
e.preventDefault();
|
|
@@ -72,7 +72,7 @@ function $58aed456727eb0f3$export$e64b2f635402ca43(props, state, ref) {
|
|
|
72
72
|
let { isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = state.displayValidation;
|
|
73
73
|
let { labelProps: labelProps, fieldProps: fieldProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps } = (0, $aUnai$useField)({
|
|
74
74
|
...props,
|
|
75
|
-
labelElementType:
|
|
75
|
+
labelElementType: 'span',
|
|
76
76
|
isInvalid: isInvalid,
|
|
77
77
|
errorMessage: props.errorMessage || validationErrors
|
|
78
78
|
});
|
|
@@ -96,7 +96,7 @@ function $58aed456727eb0f3$export$e64b2f635402ca43(props, state, ref) {
|
|
|
96
96
|
if (!props.isDisabled) {
|
|
97
97
|
ref.current.focus();
|
|
98
98
|
// Show the focus ring so the user knows where focus went
|
|
99
|
-
(0, $aUnai$setInteractionModality)(
|
|
99
|
+
(0, $aUnai$setInteractionModality)('keyboard');
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
},
|
|
@@ -105,11 +105,11 @@ function $58aed456727eb0f3$export$e64b2f635402ca43(props, state, ref) {
|
|
|
105
105
|
isDisabled: isDisabled,
|
|
106
106
|
onKeyDown: (0, $aUnai$chain)(triggerProps.onKeyDown, onKeyDown, props.onKeyDown),
|
|
107
107
|
onKeyUp: props.onKeyUp,
|
|
108
|
-
|
|
108
|
+
'aria-labelledby': [
|
|
109
109
|
valueId,
|
|
110
|
-
triggerProps[
|
|
111
|
-
triggerProps[
|
|
112
|
-
].filter(Boolean).join(
|
|
110
|
+
triggerProps['aria-labelledby'],
|
|
111
|
+
triggerProps['aria-label'] && !triggerProps['aria-labelledby'] ? triggerProps.id : null
|
|
112
|
+
].filter(Boolean).join(' '),
|
|
113
113
|
onFocus (e) {
|
|
114
114
|
if (state.isFocused) return;
|
|
115
115
|
if (props.onFocus) props.onFocus(e);
|
|
@@ -132,17 +132,17 @@ function $58aed456727eb0f3$export$e64b2f635402ca43(props, state, ref) {
|
|
|
132
132
|
shouldSelectOnPressUp: true,
|
|
133
133
|
shouldFocusOnHover: true,
|
|
134
134
|
disallowEmptySelection: true,
|
|
135
|
-
linkBehavior:
|
|
135
|
+
linkBehavior: 'selection',
|
|
136
136
|
onBlur: (e)=>{
|
|
137
137
|
if (e.currentTarget.contains(e.relatedTarget)) return;
|
|
138
138
|
if (props.onBlur) props.onBlur(e);
|
|
139
139
|
if (props.onFocusChange) props.onFocusChange(false);
|
|
140
140
|
state.setFocused(false);
|
|
141
141
|
},
|
|
142
|
-
|
|
143
|
-
fieldProps[
|
|
144
|
-
triggerProps[
|
|
145
|
-
].filter(Boolean).join(
|
|
142
|
+
'aria-labelledby': [
|
|
143
|
+
fieldProps['aria-labelledby'],
|
|
144
|
+
triggerProps['aria-label'] && !fieldProps['aria-labelledby'] ? triggerProps.id : null
|
|
145
|
+
].filter(Boolean).join(' ')
|
|
146
146
|
},
|
|
147
147
|
descriptionProps: descriptionProps,
|
|
148
148
|
errorMessageProps: errorMessageProps,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-aria/select",
|
|
3
|
-
"version": "3.14.5
|
|
3
|
+
"version": "3.14.5",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -22,19 +22,19 @@
|
|
|
22
22
|
"url": "https://github.com/adobe/react-spectrum"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@react-aria/form": "3.0.5
|
|
26
|
-
"@react-aria/i18n": "3.
|
|
27
|
-
"@react-aria/interactions": "3.
|
|
28
|
-
"@react-aria/label": "3.
|
|
29
|
-
"@react-aria/listbox": "3.12.1
|
|
30
|
-
"@react-aria/menu": "3.14.1
|
|
31
|
-
"@react-aria/selection": "3.
|
|
32
|
-
"@react-aria/utils": "3.
|
|
33
|
-
"@react-aria/visually-hidden": "3.
|
|
34
|
-
"@react-stately/select": "3.6.4
|
|
35
|
-
"@react-types/button": "3.9.4
|
|
36
|
-
"@react-types/select": "3.9.4
|
|
37
|
-
"@react-types/shared": "3.
|
|
25
|
+
"@react-aria/form": "^3.0.5",
|
|
26
|
+
"@react-aria/i18n": "^3.11.1",
|
|
27
|
+
"@react-aria/interactions": "^3.21.3",
|
|
28
|
+
"@react-aria/label": "^3.7.8",
|
|
29
|
+
"@react-aria/listbox": "^3.12.1",
|
|
30
|
+
"@react-aria/menu": "^3.14.1",
|
|
31
|
+
"@react-aria/selection": "^3.18.1",
|
|
32
|
+
"@react-aria/utils": "^3.24.1",
|
|
33
|
+
"@react-aria/visually-hidden": "^3.8.12",
|
|
34
|
+
"@react-stately/select": "^3.6.4",
|
|
35
|
+
"@react-types/button": "^3.9.4",
|
|
36
|
+
"@react-types/select": "^3.9.4",
|
|
37
|
+
"@react-types/shared": "^3.23.1",
|
|
38
38
|
"@swc/helpers": "^0.5.0"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"publishConfig": {
|
|
45
45
|
"access": "public"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "b77d7d594dff4dcfb5359bffbcfd18142b146433"
|
|
48
48
|
}
|