@react-spectrum/combobox 3.13.4 → 3.14.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/README.md +1 -1
- package/dist/ComboBox.main.js +22 -21
- package/dist/ComboBox.main.js.map +1 -1
- package/dist/ComboBox.mjs +22 -21
- package/dist/ComboBox.module.js +22 -21
- package/dist/ComboBox.module.js.map +1 -1
- package/dist/MobileComboBox.main.js +35 -26
- package/dist/MobileComboBox.main.js.map +1 -1
- package/dist/MobileComboBox.mjs +37 -28
- package/dist/MobileComboBox.module.js +37 -28
- package/dist/MobileComboBox.module.js.map +1 -1
- package/dist/button_vars_css.main.js.map +1 -1
- package/dist/button_vars_css.module.js.map +1 -1
- package/dist/fieldlabel_vars_css.main.js.map +1 -1
- package/dist/fieldlabel_vars_css.module.js.map +1 -1
- package/dist/inputgroup_vars_css.main.js.map +1 -1
- package/dist/inputgroup_vars_css.module.js.map +1 -1
- package/dist/search_vars_css.main.js.map +1 -1
- package/dist/search_vars_css.module.js.map +1 -1
- package/dist/textfield_vars_css.main.js.map +1 -1
- package/dist/textfield_vars_css.module.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/{vars.7a9c8a9c.css → vars.202cbdb0.css} +3 -3
- package/dist/{vars.7a9c8a9c.css.map → vars.202cbdb0.css.map} +1 -1
- package/dist/{vars.09a5f62b.css → vars.3ad1a294.css} +3 -3
- package/dist/{vars.09a5f62b.css.map → vars.3ad1a294.css.map} +1 -1
- package/dist/{vars.03cfef19.css → vars.3f2ff1e8.css} +2 -2
- package/dist/{vars.03cfef19.css.map → vars.3f2ff1e8.css.map} +1 -1
- package/dist/{vars.01699409.css → vars.8e9a1ae1.css} +3 -3
- package/dist/{vars.01699409.css.map → vars.8e9a1ae1.css.map} +1 -1
- package/package.json +28 -28
- package/src/ComboBox.tsx +27 -24
- package/src/MobileComboBox.tsx +33 -28
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AA4D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AAQJ;;;;AAII;;;;AAEE;;;;AAIE;;;;AAKJ;;;;AAQR;EACE;;;;;;;;;;;;;;;;EAeE;;;;;;EAKA;;;;;;;;;;;;;;;;EAiBE;;;;EAeI;;;;EAQF;;;;EAQF;;;;EAIF;;;;EAuBE;;;;EAGA","sources":["packages/@adobe/spectrum-css-temp/components/inputgroup/vars.css"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"vars.
|
|
1
|
+
{"mappings":"AA4DA;;;;;AAIE;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAQA;;;;AAIA;;;;AAKF;;;;;;;;AAOE;;;;;;;;;;;AAqBE;;;;;AAQF;;;;AAKE;;;;;AAOJ;EACE;;;;EAIE;;;;;AAMJ;;;;;;;;;AAWE;;;;;;;;;;AAAA;;;;;;;AAAA;;;;;;;AAAA;;;;;;;AAAA;;;;;;;AAaE;;;;;;;;;;;AAAA;;;;;AAAA;;;;;AAAA;;;;;AAAA;;;;;AAaA;;;;AAAA;;;;;AAAA;;;;;AAAA;;;;;AAAA;;;;;AASA;;;;;AAAA;;;;;AAAA;;;;;AAAA;;;;;AAAA;;;;;AASA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAKA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAOJ;;;;AAMA;;;;AAAA;;;;;AAAA;;;;;AAAA;;;;;AAAA;;;;;AAMA;;;;;AAME;;;;;;;AAOE;;;;;;;AAQA;;;;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AASF;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAKE;;;;AAMA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAKA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAOJ;;;;;AAMA;;;;AAGE;;;;AASE;;;;;AAMF;;;;;;AAME;;;;;AAKA;;;;AAKA;;;;;;;AAQF;;;;;;;;AAME;;;;;;;;;;AAYA;;;;;;;AAYE;;;;;AAMA;;;;AAmBN;;;;;AAKI;;;;AAOE;;;;AAcA;;;;AAWF;;;;AAME;;;;AAOA;;;;AASA;;;;AAQJ;;;;AAgBA;;;;AAKF;;;;AAQM;;;;AAqBA;;;;AAgBA;;;;AAQA;;;;AAME;;;;AAOA;;;;AAQF;;;;AAgBF;;;;AAMA;;;;AAMF;;;;AAGE;;;;AAUA;;;;AAME;;;;AACE;;;;AAOF;;;;AAIE;;;;;AAQJ;;;;AAII;;;;AAEE;;;;AAIE;;;;AAKJ;;;;AAQR;EACE;;;;;;;;;;;;;;;;EAeE;;;;;;EAKA;;;;;;;;;;;;;;;;EAiBE;;;;EAeI;;;;EAQF;;;;EAQF;;;;EAIF;;;;EAuBE;;;;EAGA","sources":["packages/@adobe/spectrum-css-temp/components/inputgroup/vars.css"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"vars.3f2ff1e8.css.map"}
|
|
@@ -130,23 +130,23 @@ button.ntVziG_spectrum-BaseButton {
|
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
.ntVziG_spectrum-BaseButton .ntVziG_spectrum-Icon {
|
|
133
|
+
max-block-size: 100%;
|
|
133
134
|
transition: background var(--spectrum-global-animation-duration-100, .13s) ease-out, fill var(--spectrum-global-animation-duration-100, .13s) ease-out;
|
|
134
135
|
box-sizing: initial;
|
|
135
136
|
flex-shrink: 0;
|
|
136
137
|
order: 0;
|
|
137
|
-
max-block-size: 100%;
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
.ntVziG_spectrum-Button {
|
|
141
141
|
--spectrum-button-border-radius: var(--spectrum-button-primary-border-radius, var(--spectrum-alias-border-radius-large));
|
|
142
142
|
--spectrum-button-border-width: var(--spectrum-button-primary-border-size, var(--spectrum-alias-border-size-thick));
|
|
143
143
|
min-block-size: var(--spectrum-button-primary-height, var(--spectrum-alias-single-line-height));
|
|
144
|
+
block-size: 0%;
|
|
144
145
|
min-inline-size: var(--spectrum-button-primary-min-width);
|
|
145
146
|
padding: var(--spectrum-global-dimension-size-50) calc(var(--spectrum-button-primary-padding-x, var(--spectrum-global-dimension-size-200)) - var(--spectrum-button-primary-border-size, var(--spectrum-alias-border-size-thick)));
|
|
146
147
|
font-size: var(--spectrum-button-primary-text-size, var(--spectrum-alias-pill-button-text-size));
|
|
147
148
|
font-weight: var(--spectrum-button-primary-text-font-weight, var(--spectrum-global-font-weight-bold));
|
|
148
149
|
border-style: solid;
|
|
149
|
-
block-size: 0%;
|
|
150
150
|
padding-block-start: calc(var(--spectrum-global-dimension-size-50) - 1px);
|
|
151
151
|
padding-block-end: calc(var(--spectrum-global-dimension-size-50) + 1px);
|
|
152
152
|
}
|
|
@@ -1642,4 +1642,4 @@ a.ntVziG_spectrum-Button, a.ntVziG_spectrum-ActionButton {
|
|
|
1642
1642
|
--spectrum-actionbutton-static-color-selected-disabled: ButtonFace;
|
|
1643
1643
|
}
|
|
1644
1644
|
}
|
|
1645
|
-
/*# sourceMappingURL=vars.
|
|
1645
|
+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AAME;;;;AASF;;;;;;AAME;;;;AAIA;;;;;;;AAME;;;;AAKF;;;;;;AAME;;;;AANF;;;;;;AAME;;;;AAKF;;;;;;AAME;;;;AAIA;;;;AAVF;;;;;;AAME;;;;AAIA;;;;AA1CJ;;;;;;AAME;;;;AAIA;;;;;;;AAME;;;;AAKF;;;;;;AAME;;;;AANF;;;;;;AAME;;;;AAKF;;;;;;AAME;;;;AAIA;;;;AAVF;;;;;;AAME;;;;AAIA;;;;AAMJ;;;;;;;;;;;AAaF;;;;;;AAKE;;;;;;AAMA;;;;;;AAQF;;;;;;AAKE;;;;;;AAMA;;;;;;AAQF;;;;;;AAKE;;;;AAIA;;;;;;AAKE;;;;AAKF;;;;;AAKE;;;;AALF;;;;;AAKE;;;;AAKF;;;;;;AAME;;;;AAIA;;;;AAVF;;;;;;AAME;;;;AAIA;;;;AAKF;;;;AAGE;;;;AAIA;;;;AAKA;;;;AAMF;;;;;AAKE;;;;AALF;;;;;AAKE;;;;AAMJ;;;;;;AAKE;;;;;AAKA;;;;AAIE;;;;AAJF;;;;AAIE;;;;AAKF;;;;;AAKE;;;;AALF;;;;;AAKE;;;;AAMF;;;;;AAOF;EACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuDA;;;;EAIA","sources":["packages/@adobe/spectrum-css-temp/components/button/vars.css"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"vars.
|
|
1
|
+
{"mappings":"AA4DA;;;;;AAIE;;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;;;AAME;;;;AAIA;;;;AAVF;;;;;;AAME;;;;AAIA;;;;AA1CJ;;;;;;AAME;;;;AAIA;;;;;;;AAME;;;;AAKF;;;;;;AAME;;;;AANF;;;;;;AAME;;;;AAKF;;;;;;AAME;;;;AAIA;;;;AAVF;;;;;;AAME;;;;AAIA;;;;AAMJ;;;;;;;;;;;AAaF;;;;;;AAKE;;;;;;AAMA;;;;;;AAQF;;;;;;AAKE;;;;;;AAMA;;;;;;AAQF;;;;;;AAKE;;;;AAIA;;;;;;AAKE;;;;AAKF;;;;;AAKE;;;;AALF;;;;;AAKE;;;;AAKF;;;;;;AAME;;;;AAIA;;;;AAVF;;;;;;AAME;;;;AAIA;;;;AAKF;;;;AAGE;;;;AAIA;;;;AAKA;;;;AAMF;;;;;AAKE;;;;AALF;;;;;AAKE;;;;AAMJ;;;;;;AAKE;;;;;AAKA;;;;AAIE;;;;AAJF;;;;AAIE;;;;AAKF;;;;;AAKE;;;;AALF;;;;;AAKE;;;;AAMF;;;;;AAOF;EACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuDA;;;;EAIA","sources":["packages/@adobe/spectrum-css-temp/components/button/vars.css"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"vars.8e9a1ae1.css.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-spectrum/combobox",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.14.1",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -36,30 +36,30 @@
|
|
|
36
36
|
"url": "https://github.com/adobe/react-spectrum"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@react-aria/button": "^3.
|
|
40
|
-
"@react-aria/combobox": "^3.
|
|
41
|
-
"@react-aria/dialog": "^3.5.
|
|
42
|
-
"@react-aria/focus": "^3.
|
|
43
|
-
"@react-aria/form": "^3.0.
|
|
44
|
-
"@react-aria/i18n": "^3.12.
|
|
45
|
-
"@react-aria/interactions": "^3.
|
|
46
|
-
"@react-aria/label": "^3.7.
|
|
47
|
-
"@react-aria/overlays": "^3.
|
|
48
|
-
"@react-aria/utils": "^3.
|
|
49
|
-
"@react-spectrum/button": "^3.16.
|
|
50
|
-
"@react-spectrum/form": "^3.7.
|
|
51
|
-
"@react-spectrum/label": "^3.16.
|
|
52
|
-
"@react-spectrum/listbox": "^3.
|
|
53
|
-
"@react-spectrum/overlays": "^5.
|
|
54
|
-
"@react-spectrum/progress": "^3.7.
|
|
55
|
-
"@react-spectrum/textfield": "^3.12.
|
|
56
|
-
"@react-spectrum/utils": "^3.
|
|
57
|
-
"@react-stately/collections": "^3.
|
|
58
|
-
"@react-stately/combobox": "^3.10.
|
|
59
|
-
"@react-types/button": "^3.10.
|
|
60
|
-
"@react-types/combobox": "^3.13.
|
|
61
|
-
"@react-types/shared": "^3.
|
|
62
|
-
"@spectrum-icons/ui": "^3.6.
|
|
39
|
+
"@react-aria/button": "^3.11.1",
|
|
40
|
+
"@react-aria/combobox": "^3.11.1",
|
|
41
|
+
"@react-aria/dialog": "^3.5.21",
|
|
42
|
+
"@react-aria/focus": "^3.19.1",
|
|
43
|
+
"@react-aria/form": "^3.0.12",
|
|
44
|
+
"@react-aria/i18n": "^3.12.5",
|
|
45
|
+
"@react-aria/interactions": "^3.23.0",
|
|
46
|
+
"@react-aria/label": "^3.7.14",
|
|
47
|
+
"@react-aria/overlays": "^3.25.0",
|
|
48
|
+
"@react-aria/utils": "^3.27.0",
|
|
49
|
+
"@react-spectrum/button": "^3.16.10",
|
|
50
|
+
"@react-spectrum/form": "^3.7.11",
|
|
51
|
+
"@react-spectrum/label": "^3.16.11",
|
|
52
|
+
"@react-spectrum/listbox": "^3.14.1",
|
|
53
|
+
"@react-spectrum/overlays": "^5.7.1",
|
|
54
|
+
"@react-spectrum/progress": "^3.7.12",
|
|
55
|
+
"@react-spectrum/textfield": "^3.12.8",
|
|
56
|
+
"@react-spectrum/utils": "^3.12.1",
|
|
57
|
+
"@react-stately/collections": "^3.12.1",
|
|
58
|
+
"@react-stately/combobox": "^3.10.2",
|
|
59
|
+
"@react-types/button": "^3.10.2",
|
|
60
|
+
"@react-types/combobox": "^3.13.2",
|
|
61
|
+
"@react-types/shared": "^3.27.0",
|
|
62
|
+
"@spectrum-icons/ui": "^3.6.12",
|
|
63
63
|
"@swc/helpers": "^0.5.0"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
@@ -67,11 +67,11 @@
|
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
69
|
"@react-spectrum/provider": "^3.0.0",
|
|
70
|
-
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0",
|
|
71
|
-
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0"
|
|
70
|
+
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",
|
|
71
|
+
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
|
|
72
72
|
},
|
|
73
73
|
"publishConfig": {
|
|
74
74
|
"access": "public"
|
|
75
75
|
},
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "09e7f44bebdc9d89122926b2b439a0a38a2814ea"
|
|
77
77
|
}
|
package/src/ComboBox.tsx
CHANGED
|
@@ -33,6 +33,7 @@ import {Popover} from '@react-spectrum/overlays';
|
|
|
33
33
|
import {PressResponder, useHover} from '@react-aria/interactions';
|
|
34
34
|
import {ProgressCircle} from '@react-spectrum/progress';
|
|
35
35
|
import React, {
|
|
36
|
+
ForwardedRef,
|
|
36
37
|
InputHTMLAttributes,
|
|
37
38
|
ReactElement,
|
|
38
39
|
RefObject,
|
|
@@ -52,7 +53,10 @@ import {useFormProps} from '@react-spectrum/form';
|
|
|
52
53
|
import {useLayoutEffect} from '@react-aria/utils';
|
|
53
54
|
import {useProvider, useProviderProps} from '@react-spectrum/provider';
|
|
54
55
|
|
|
55
|
-
|
|
56
|
+
/**
|
|
57
|
+
* ComboBoxes combine a text entry with a picker menu, allowing users to filter longer lists to only the selections matching a query.
|
|
58
|
+
*/
|
|
59
|
+
export const ComboBox = React.forwardRef(function ComboBox<T extends object>(props: SpectrumComboBoxProps<T>, ref: FocusableRef<HTMLElement>) {
|
|
56
60
|
props = useProviderProps(props);
|
|
57
61
|
props = useFormProps(props);
|
|
58
62
|
|
|
@@ -67,9 +71,9 @@ function ComboBox<T extends object>(props: SpectrumComboBoxProps<T>, ref: Focusa
|
|
|
67
71
|
} else {
|
|
68
72
|
return <ComboBoxBase {...props} ref={ref} />;
|
|
69
73
|
}
|
|
70
|
-
}
|
|
74
|
+
}) as <T>(props: SpectrumComboBoxProps<T> & {ref?: FocusableRef<HTMLElement>}) => ReactElement;
|
|
71
75
|
|
|
72
|
-
const ComboBoxBase = React.forwardRef(function ComboBoxBase
|
|
76
|
+
const ComboBoxBase = React.forwardRef(function ComboBoxBase(props: SpectrumComboBoxProps<any>, ref: FocusableRef<HTMLElement>) {
|
|
73
77
|
let {
|
|
74
78
|
menuTrigger = 'input',
|
|
75
79
|
shouldFlip = true,
|
|
@@ -89,14 +93,14 @@ const ComboBoxBase = React.forwardRef(function ComboBoxBase<T extends object>(pr
|
|
|
89
93
|
|
|
90
94
|
let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/combobox');
|
|
91
95
|
let isAsync = loadingState != null;
|
|
92
|
-
let popoverRef = useRef<DOMRefValue<HTMLDivElement>>(
|
|
96
|
+
let popoverRef = useRef<DOMRefValue<HTMLDivElement>>(null);
|
|
93
97
|
let unwrappedPopoverRef = useUnwrapDOMRef(popoverRef);
|
|
94
|
-
let buttonRef = useRef<FocusableRefValue<HTMLElement>>(
|
|
98
|
+
let buttonRef = useRef<FocusableRefValue<HTMLElement>>(null);
|
|
95
99
|
let unwrappedButtonRef = useUnwrapDOMRef(buttonRef);
|
|
96
|
-
let listBoxRef = useRef(
|
|
97
|
-
let inputRef = useRef<HTMLInputElement>(
|
|
100
|
+
let listBoxRef = useRef(null);
|
|
101
|
+
let inputRef = useRef<HTMLInputElement>(null);
|
|
98
102
|
// serve as the new popover `triggerRef` instead of `unwrappedButtonRef` before for better positioning.
|
|
99
|
-
let inputGroupRef = useRef<HTMLDivElement>(
|
|
103
|
+
let inputGroupRef = useRef<HTMLDivElement>(null);
|
|
100
104
|
let domRef = useFocusableRef(ref, inputRef);
|
|
101
105
|
|
|
102
106
|
let {contains} = useFilter({sensitivity: 'base'});
|
|
@@ -124,7 +128,7 @@ const ComboBoxBase = React.forwardRef(function ComboBoxBase<T extends object>(pr
|
|
|
124
128
|
);
|
|
125
129
|
|
|
126
130
|
// Measure the width of the inputfield and the button to inform the width of the menu (below).
|
|
127
|
-
let [menuWidth, setMenuWidth] = useState(
|
|
131
|
+
let [menuWidth, setMenuWidth] = useState<number | undefined>(undefined);
|
|
128
132
|
let {scale} = useProvider();
|
|
129
133
|
|
|
130
134
|
let onResize = useCallback(() => {
|
|
@@ -142,11 +146,12 @@ const ComboBoxBase = React.forwardRef(function ComboBoxBase<T extends object>(pr
|
|
|
142
146
|
|
|
143
147
|
useLayoutEffect(onResize, [scale, onResize]);
|
|
144
148
|
|
|
145
|
-
let width = isQuiet ?
|
|
149
|
+
let width = isQuiet ? undefined : menuWidth;
|
|
146
150
|
let style = {
|
|
147
151
|
width: customMenuWidth ? dimensionValue(customMenuWidth) : width,
|
|
148
152
|
minWidth: isQuiet ? `calc(${menuWidth}px + calc(2 * var(--spectrum-dropdown-quiet-offset)))` : menuWidth
|
|
149
153
|
};
|
|
154
|
+
let cbInputProps = {...props, children: null};
|
|
150
155
|
|
|
151
156
|
return (
|
|
152
157
|
<>
|
|
@@ -160,14 +165,14 @@ const ComboBoxBase = React.forwardRef(function ComboBoxBase<T extends object>(pr
|
|
|
160
165
|
labelProps={labelProps}
|
|
161
166
|
ref={domRef}>
|
|
162
167
|
<ComboBoxInput
|
|
163
|
-
{...
|
|
168
|
+
{...cbInputProps}
|
|
164
169
|
isOpen={state.isOpen}
|
|
165
170
|
loadingState={loadingState}
|
|
166
171
|
inputProps={inputProps}
|
|
167
172
|
inputRef={inputRef}
|
|
168
173
|
triggerProps={buttonProps}
|
|
169
174
|
triggerRef={buttonRef}
|
|
170
|
-
validationState={props.validationState || (isInvalid ? 'invalid' :
|
|
175
|
+
validationState={props.validationState || (isInvalid ? 'invalid' : undefined)}
|
|
171
176
|
ref={inputGroupRef} />
|
|
172
177
|
</Field>
|
|
173
178
|
{name && formValue === 'key' && <input type="hidden" name={name} value={state.selectedKey ?? ''} />}
|
|
@@ -186,7 +191,7 @@ const ComboBoxBase = React.forwardRef(function ComboBoxBase<T extends object>(pr
|
|
|
186
191
|
{...listBoxProps}
|
|
187
192
|
ref={listBoxRef}
|
|
188
193
|
disallowEmptySelection
|
|
189
|
-
autoFocus={state.focusStrategy}
|
|
194
|
+
autoFocus={state.focusStrategy ?? undefined}
|
|
190
195
|
shouldSelectOnPressUp
|
|
191
196
|
focusOnPointerEnter
|
|
192
197
|
layout={layout}
|
|
@@ -215,7 +220,7 @@ interface ComboBoxInputProps extends SpectrumComboBoxProps<unknown> {
|
|
|
215
220
|
isOpen?: boolean
|
|
216
221
|
}
|
|
217
222
|
|
|
218
|
-
const ComboBoxInput = React.forwardRef(function ComboBoxInput(props: ComboBoxInputProps, ref:
|
|
223
|
+
const ComboBoxInput = React.forwardRef(function ComboBoxInput(props: ComboBoxInputProps, ref: ForwardedRef<HTMLElement | null>) {
|
|
219
224
|
let {
|
|
220
225
|
isQuiet,
|
|
221
226
|
isDisabled,
|
|
@@ -233,7 +238,7 @@ const ComboBoxInput = React.forwardRef(function ComboBoxInput(props: ComboBoxInp
|
|
|
233
238
|
} = props;
|
|
234
239
|
let {hoverProps, isHovered} = useHover({});
|
|
235
240
|
let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/combobox');
|
|
236
|
-
let timeout = useRef(null);
|
|
241
|
+
let timeout = useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
237
242
|
let [showLoading, setShowLoading] = useState(false);
|
|
238
243
|
|
|
239
244
|
let loadingCircle = (
|
|
@@ -272,7 +277,9 @@ const ComboBoxInput = React.forwardRef(function ComboBoxInput(props: ComboBoxInp
|
|
|
272
277
|
} else if (!isLoading) {
|
|
273
278
|
// If loading is no longer happening, clear any timers and hide the loading circle
|
|
274
279
|
setShowLoading(false);
|
|
275
|
-
|
|
280
|
+
if (timeout.current) {
|
|
281
|
+
clearTimeout(timeout.current);
|
|
282
|
+
}
|
|
276
283
|
timeout.current = null;
|
|
277
284
|
}
|
|
278
285
|
|
|
@@ -281,7 +288,9 @@ const ComboBoxInput = React.forwardRef(function ComboBoxInput(props: ComboBoxInp
|
|
|
281
288
|
|
|
282
289
|
useEffect(() => {
|
|
283
290
|
return () => {
|
|
284
|
-
|
|
291
|
+
if (timeout.current) {
|
|
292
|
+
clearTimeout(timeout.current);
|
|
293
|
+
}
|
|
285
294
|
timeout.current = null;
|
|
286
295
|
};
|
|
287
296
|
}, []);
|
|
@@ -337,7 +346,7 @@ const ComboBoxInput = React.forwardRef(function ComboBoxInput(props: ComboBoxInp
|
|
|
337
346
|
// loading circle should only be displayed if menu is open, if menuTrigger is "manual", or first time load (to stop circle from showing up when user selects an option)
|
|
338
347
|
// TODO: add special case for completionMode: complete as well
|
|
339
348
|
isLoading={showLoading && (isOpen || menuTrigger === 'manual' || loadingState === 'loading')}
|
|
340
|
-
loadingIndicator={loadingState != null
|
|
349
|
+
loadingIndicator={loadingState != null ? loadingCircle : undefined}
|
|
341
350
|
disableFocusRing />
|
|
342
351
|
<PressResponder preventFocusOnPress isPressed={isOpen}>
|
|
343
352
|
<FieldButton
|
|
@@ -358,9 +367,3 @@ const ComboBoxInput = React.forwardRef(function ComboBoxInput(props: ComboBoxInp
|
|
|
358
367
|
</FocusRing>)
|
|
359
368
|
);
|
|
360
369
|
});
|
|
361
|
-
|
|
362
|
-
/**
|
|
363
|
-
* ComboBoxes combine a text entry with a picker menu, allowing users to filter longer lists to only the selections matching a query.
|
|
364
|
-
*/
|
|
365
|
-
const _ComboBox = React.forwardRef(ComboBox) as <T>(props: SpectrumComboBoxProps<T> & {ref?: FocusableRef<HTMLElement>}) => ReactElement;
|
|
366
|
-
export {_ComboBox as ComboBox};
|
package/src/MobileComboBox.tsx
CHANGED
|
@@ -21,15 +21,15 @@ import {ComboBoxState, useComboBoxState} from '@react-stately/combobox';
|
|
|
21
21
|
import comboboxStyles from './combobox.css';
|
|
22
22
|
import {DismissButton, useOverlayTrigger} from '@react-aria/overlays';
|
|
23
23
|
import {Field} from '@react-spectrum/label';
|
|
24
|
-
import {FocusableRef, FocusableRefValue,
|
|
24
|
+
import {FocusableRef, FocusableRefValue, ValidationState} from '@react-types/shared';
|
|
25
25
|
import {FocusRing, focusSafely, FocusScope} from '@react-aria/focus';
|
|
26
26
|
// @ts-ignore
|
|
27
27
|
import intlMessages from '../intl/*.json';
|
|
28
28
|
import labelStyles from '@adobe/spectrum-css-temp/components/fieldlabel/vars.css';
|
|
29
29
|
import {ListBoxBase, useListBoxLayout} from '@react-spectrum/listbox';
|
|
30
|
-
import {mergeProps, useFormReset, useId} from '@react-aria/utils';
|
|
30
|
+
import {mergeProps, useFormReset, useId, useObjectRef} from '@react-aria/utils';
|
|
31
31
|
import {ProgressCircle} from '@react-spectrum/progress';
|
|
32
|
-
import React, {HTMLAttributes, InputHTMLAttributes, ReactElement, ReactNode, useCallback, useEffect, useRef, useState} from 'react';
|
|
32
|
+
import React, {ForwardedRef, HTMLAttributes, InputHTMLAttributes, ReactElement, ReactNode, useCallback, useEffect, useRef, useState} from 'react';
|
|
33
33
|
import searchStyles from '@adobe/spectrum-css-temp/components/search/vars.css';
|
|
34
34
|
import {setInteractionModality, useHover} from '@react-aria/interactions';
|
|
35
35
|
import {SpectrumComboBoxProps} from '@react-types/combobox';
|
|
@@ -45,7 +45,7 @@ import {useFilter, useLocalizedStringFormatter} from '@react-aria/i18n';
|
|
|
45
45
|
import {useFormValidation} from '@react-aria/form';
|
|
46
46
|
import {useProviderProps} from '@react-spectrum/provider';
|
|
47
47
|
|
|
48
|
-
export const MobileComboBox = React.forwardRef(function MobileComboBox
|
|
48
|
+
export const MobileComboBox = React.forwardRef(function MobileComboBox(props: SpectrumComboBoxProps<any>, ref: FocusableRef<HTMLElement>) {
|
|
49
49
|
props = useProviderProps(props);
|
|
50
50
|
|
|
51
51
|
let {
|
|
@@ -73,17 +73,17 @@ export const MobileComboBox = React.forwardRef(function MobileComboBox<T extends
|
|
|
73
73
|
shouldCloseOnBlur: false
|
|
74
74
|
});
|
|
75
75
|
|
|
76
|
-
let buttonRef = useRef<
|
|
76
|
+
let buttonRef = useRef<HTMLDivElement>(null);
|
|
77
77
|
let domRef = useFocusableRef(ref, buttonRef);
|
|
78
78
|
let {triggerProps, overlayProps} = useOverlayTrigger({type: 'listbox'}, state, buttonRef);
|
|
79
79
|
|
|
80
80
|
let inputRef = useRef<HTMLInputElement>(null);
|
|
81
81
|
useFormValidation({
|
|
82
82
|
...props,
|
|
83
|
-
focus: () => buttonRef.current
|
|
83
|
+
focus: () => buttonRef.current?.focus()
|
|
84
84
|
}, state, inputRef);
|
|
85
85
|
let {isInvalid, validationErrors, validationDetails} = state.displayValidation;
|
|
86
|
-
let validationState = props.validationState || (isInvalid ? 'invalid' :
|
|
86
|
+
let validationState = props.validationState || (isInvalid ? 'invalid' : undefined);
|
|
87
87
|
let errorMessage = props.errorMessage ?? validationErrors.join(' ');
|
|
88
88
|
|
|
89
89
|
let {labelProps, fieldProps, descriptionProps, errorMessageProps} = useField({
|
|
@@ -96,7 +96,7 @@ export const MobileComboBox = React.forwardRef(function MobileComboBox<T extends
|
|
|
96
96
|
// Focus the button and show focus ring when clicking on the label
|
|
97
97
|
labelProps.onClick = () => {
|
|
98
98
|
if (!props.isDisabled) {
|
|
99
|
-
buttonRef.current
|
|
99
|
+
buttonRef.current?.focus();
|
|
100
100
|
setInteractionModality('keyboard');
|
|
101
101
|
}
|
|
102
102
|
};
|
|
@@ -104,7 +104,7 @@ export const MobileComboBox = React.forwardRef(function MobileComboBox<T extends
|
|
|
104
104
|
let inputProps: InputHTMLAttributes<HTMLInputElement> = {
|
|
105
105
|
type: 'hidden',
|
|
106
106
|
name,
|
|
107
|
-
value: formValue === 'text' ? state.inputValue : state.selectedKey
|
|
107
|
+
value: formValue === 'text' ? state.inputValue : String(state.selectedKey)
|
|
108
108
|
};
|
|
109
109
|
|
|
110
110
|
if (validationBehavior === 'native') {
|
|
@@ -117,7 +117,7 @@ export const MobileComboBox = React.forwardRef(function MobileComboBox<T extends
|
|
|
117
117
|
inputProps.onChange = () => {};
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
useFormReset(inputRef, inputProps.value, formValue === 'text' ? state.setInputValue : state.setSelectedKey);
|
|
120
|
+
useFormReset(inputRef, String(inputProps.value ?? ''), formValue === 'text' ? state.setInputValue : state.setSelectedKey);
|
|
121
121
|
|
|
122
122
|
return (
|
|
123
123
|
<>
|
|
@@ -166,7 +166,7 @@ interface ComboBoxButtonProps extends AriaButtonProps {
|
|
|
166
166
|
className?: string
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
-
const ComboBoxButton = React.forwardRef(function ComboBoxButton(props: ComboBoxButtonProps, ref:
|
|
169
|
+
export const ComboBoxButton = React.forwardRef(function ComboBoxButton(props: ComboBoxButtonProps, ref: ForwardedRef<HTMLDivElement>) {
|
|
170
170
|
let {
|
|
171
171
|
isQuiet,
|
|
172
172
|
isDisabled,
|
|
@@ -194,6 +194,7 @@ const ComboBoxButton = React.forwardRef(function ComboBoxButton(props: ComboBoxB
|
|
|
194
194
|
)
|
|
195
195
|
});
|
|
196
196
|
|
|
197
|
+
let objRef = useObjectRef(ref);
|
|
197
198
|
let {hoverProps, isHovered} = useHover({});
|
|
198
199
|
let {buttonProps, isPressed} = useButton({
|
|
199
200
|
...props,
|
|
@@ -204,7 +205,7 @@ const ComboBoxButton = React.forwardRef(function ComboBoxButton(props: ComboBoxB
|
|
|
204
205
|
validationState === 'invalid' ? invalidId : null
|
|
205
206
|
].filter(Boolean).join(' '),
|
|
206
207
|
elementType: 'div'
|
|
207
|
-
},
|
|
208
|
+
}, objRef);
|
|
208
209
|
|
|
209
210
|
return (
|
|
210
211
|
(<FocusRing
|
|
@@ -213,7 +214,7 @@ const ComboBoxButton = React.forwardRef(function ComboBoxButton(props: ComboBoxB
|
|
|
213
214
|
<div
|
|
214
215
|
{...mergeProps(hoverProps, buttonProps)}
|
|
215
216
|
aria-haspopup="dialog"
|
|
216
|
-
ref={
|
|
217
|
+
ref={objRef}
|
|
217
218
|
style={{...style, outline: 'none'}}
|
|
218
219
|
className={
|
|
219
220
|
classNames(
|
|
@@ -307,8 +308,8 @@ const ComboBoxButton = React.forwardRef(function ComboBoxButton(props: ComboBoxB
|
|
|
307
308
|
);
|
|
308
309
|
});
|
|
309
310
|
|
|
310
|
-
interface ComboBoxTrayProps extends SpectrumComboBoxProps<
|
|
311
|
-
state: ComboBoxState<
|
|
311
|
+
interface ComboBoxTrayProps extends SpectrumComboBoxProps<any> {
|
|
312
|
+
state: ComboBoxState<any>,
|
|
312
313
|
overlayProps: HTMLAttributes<HTMLElement>,
|
|
313
314
|
loadingIndicator?: ReactElement,
|
|
314
315
|
onClose: () => void
|
|
@@ -327,12 +328,12 @@ function ComboBoxTray(props: ComboBoxTrayProps) {
|
|
|
327
328
|
onClose
|
|
328
329
|
} = props;
|
|
329
330
|
|
|
330
|
-
let timeout = useRef(null);
|
|
331
|
+
let timeout = useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
331
332
|
let [showLoading, setShowLoading] = useState(false);
|
|
332
|
-
let inputRef = useRef<HTMLInputElement>(
|
|
333
|
-
let buttonRef = useRef<FocusableRefValue<HTMLElement>>(
|
|
334
|
-
let popoverRef = useRef<HTMLDivElement>(
|
|
335
|
-
let listBoxRef = useRef<HTMLDivElement>(
|
|
333
|
+
let inputRef = useRef<HTMLInputElement>(null);
|
|
334
|
+
let buttonRef = useRef<FocusableRefValue<HTMLElement>>(null);
|
|
335
|
+
let popoverRef = useRef<HTMLDivElement>(null);
|
|
336
|
+
let listBoxRef = useRef<HTMLDivElement>(null);
|
|
336
337
|
let isLoading = loadingState === 'loading' || loadingState === 'loadingMore';
|
|
337
338
|
let layout = useListBoxLayout();
|
|
338
339
|
let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/combobox');
|
|
@@ -353,7 +354,9 @@ function ComboBoxTray(props: ComboBoxTrayProps) {
|
|
|
353
354
|
);
|
|
354
355
|
|
|
355
356
|
React.useEffect(() => {
|
|
356
|
-
|
|
357
|
+
if (inputRef.current) {
|
|
358
|
+
focusSafely(inputRef.current);
|
|
359
|
+
}
|
|
357
360
|
}, []);
|
|
358
361
|
|
|
359
362
|
React.useEffect(() => {
|
|
@@ -388,7 +391,7 @@ function ComboBoxTray(props: ComboBoxTrayProps) {
|
|
|
388
391
|
excludeFromTabOrder
|
|
389
392
|
onPress={() => {
|
|
390
393
|
state.setInputValue('');
|
|
391
|
-
inputRef.current
|
|
394
|
+
inputRef.current?.focus();
|
|
392
395
|
}}
|
|
393
396
|
UNSAFE_className={
|
|
394
397
|
classNames(
|
|
@@ -431,7 +434,7 @@ function ComboBoxTray(props: ComboBoxTrayProps) {
|
|
|
431
434
|
return;
|
|
432
435
|
}
|
|
433
436
|
|
|
434
|
-
popoverRef.current
|
|
437
|
+
popoverRef.current?.focus();
|
|
435
438
|
}, [inputRef, popoverRef, isTouchDown]);
|
|
436
439
|
|
|
437
440
|
let inputValue = inputProps.value;
|
|
@@ -454,7 +457,9 @@ function ComboBoxTray(props: ComboBoxTrayProps) {
|
|
|
454
457
|
} else if (loadingState !== 'filtering') {
|
|
455
458
|
// If loading is no longer happening, clear any timers and hide the loading circle
|
|
456
459
|
setShowLoading(false);
|
|
457
|
-
|
|
460
|
+
if (timeout.current) {
|
|
461
|
+
clearTimeout(timeout.current);
|
|
462
|
+
}
|
|
458
463
|
timeout.current = null;
|
|
459
464
|
}
|
|
460
465
|
|
|
@@ -464,9 +469,9 @@ function ComboBoxTray(props: ComboBoxTrayProps) {
|
|
|
464
469
|
let onKeyDown = (e) => {
|
|
465
470
|
// Close virtual keyboard if user hits Enter w/o any focused options
|
|
466
471
|
if (e.key === 'Enter' && state.selectionManager.focusedKey == null) {
|
|
467
|
-
popoverRef.current
|
|
472
|
+
popoverRef.current?.focus();
|
|
468
473
|
} else {
|
|
469
|
-
inputProps.onKeyDown(e);
|
|
474
|
+
inputProps.onKeyDown?.(e);
|
|
470
475
|
}
|
|
471
476
|
};
|
|
472
477
|
|
|
@@ -489,11 +494,11 @@ function ComboBoxTray(props: ComboBoxTrayProps) {
|
|
|
489
494
|
inputRef={inputRef}
|
|
490
495
|
isDisabled={isDisabled}
|
|
491
496
|
isLoading={showLoading && loadingState === 'filtering'}
|
|
492
|
-
loadingIndicator={loadingState != null
|
|
497
|
+
loadingIndicator={loadingState != null ? loadingCircle : undefined}
|
|
493
498
|
validationState={validationState}
|
|
494
499
|
labelAlign="start"
|
|
495
500
|
labelPosition="top"
|
|
496
|
-
wrapperChildren={(state.inputValue !== '' || loadingState === 'filtering' || validationState != null) && !props.isReadOnly
|
|
501
|
+
wrapperChildren={(state.inputValue !== '' || loadingState === 'filtering' || validationState != null) && !props.isReadOnly ? clearButton : undefined}
|
|
497
502
|
UNSAFE_className={
|
|
498
503
|
classNames(
|
|
499
504
|
searchStyles,
|