@react-aria/autocomplete 3.0.0-nightly.3696 → 3.0.0-nightly.3705

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.
Files changed (2) hide show
  1. package/dist/import.mjs +68 -0
  2. package/package.json +24 -19
@@ -0,0 +1,68 @@
1
+ import {mergeProps as $fgZRc$mergeProps} from "@react-aria/utils";
2
+ import {useComboBox as $fgZRc$useComboBox} from "@react-aria/combobox";
3
+ import {useSearchField as $fgZRc$useSearchField} from "@react-aria/searchfield";
4
+
5
+ /*
6
+ * Copyright 2021 Adobe. All rights reserved.
7
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License. You may obtain a copy
9
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software distributed under
12
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
13
+ * OF ANY KIND, either express or implied. See the License for the specific language
14
+ * governing permissions and limitations under the License.
15
+ */ /*
16
+ * Copyright 2020 Adobe. All rights reserved.
17
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
18
+ * you may not use this file except in compliance with the License. You may obtain a copy
19
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
20
+ *
21
+ * Unless required by applicable law or agreed to in writing, software distributed under
22
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
23
+ * OF ANY KIND, either express or implied. See the License for the specific language
24
+ * governing permissions and limitations under the License.
25
+ */
26
+
27
+
28
+ function $c04f11f368135585$export$da7ade746446be1f(props, state) {
29
+ let { popoverRef: popoverRef , inputRef: inputRef , listBoxRef: listBoxRef , keyboardDelegate: keyboardDelegate , onSubmit: onSubmit = ()=>{} , onClear: onClear } = props;
30
+ let { inputProps: inputProps , clearButtonProps: clearButtonProps } = (0, $fgZRc$useSearchField)({
31
+ ...props,
32
+ value: state.inputValue,
33
+ onChange: state.setInputValue,
34
+ autoComplete: "off",
35
+ onClear: ()=>{
36
+ state.setInputValue("");
37
+ if (onClear) onClear();
38
+ },
39
+ onSubmit: (value)=>{
40
+ // Prevent submission from search field if menu item was selected
41
+ if (state.selectionManager.focusedKey === null) onSubmit(value, null);
42
+ }
43
+ }, {
44
+ value: state.inputValue,
45
+ setValue: state.setInputValue
46
+ }, inputRef);
47
+ let { listBoxProps: listBoxProps , labelProps: labelProps , inputProps: comboBoxInputProps } = (0, $fgZRc$useComboBox)({
48
+ ...props,
49
+ keyboardDelegate: keyboardDelegate,
50
+ popoverRef: popoverRef,
51
+ listBoxRef: listBoxRef,
52
+ inputRef: inputRef,
53
+ onFocus: undefined,
54
+ onBlur: undefined
55
+ }, state);
56
+ return {
57
+ labelProps: labelProps,
58
+ inputProps: (0, $fgZRc$mergeProps)(inputProps, comboBoxInputProps),
59
+ listBoxProps: listBoxProps,
60
+ clearButtonProps: clearButtonProps
61
+ };
62
+ }
63
+
64
+
65
+
66
+
67
+ export {$c04f11f368135585$export$da7ade746446be1f as useSearchAutocomplete};
68
+ //# sourceMappingURL=module.js.map
package/package.json CHANGED
@@ -1,10 +1,15 @@
1
1
  {
2
2
  "name": "@react-aria/autocomplete",
3
- "version": "3.0.0-nightly.3696+be0fae9f7",
3
+ "version": "3.0.0-nightly.3705+93b3c951e",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
7
7
  "module": "dist/module.js",
8
+ "exports": {
9
+ "types": "./dist/types.d.ts",
10
+ "import": "./dist/import.mjs",
11
+ "require": "./dist/main.js"
12
+ },
8
13
  "types": "dist/types.d.ts",
9
14
  "source": "src/index.ts",
10
15
  "files": [
@@ -17,23 +22,23 @@
17
22
  "url": "https://github.com/adobe/react-spectrum"
18
23
  },
19
24
  "dependencies": {
20
- "@react-aria/combobox": "3.4.5-nightly.3696+be0fae9f7",
21
- "@react-aria/i18n": "3.0.0-nightly.1996+be0fae9f7",
22
- "@react-aria/listbox": "3.7.3-nightly.3696+be0fae9f7",
23
- "@react-aria/live-announcer": "3.0.0-nightly.1996+be0fae9f7",
24
- "@react-aria/menu": "3.7.2-nightly.3696+be0fae9f7",
25
- "@react-aria/overlays": "3.0.0-nightly.1996+be0fae9f7",
26
- "@react-aria/searchfield": "3.0.0-nightly.1996+be0fae9f7",
27
- "@react-aria/selection": "3.0.0-nightly.1996+be0fae9f7",
28
- "@react-aria/textfield": "3.0.0-nightly.1996+be0fae9f7",
29
- "@react-aria/utils": "3.0.0-nightly.1996+be0fae9f7",
30
- "@react-stately/collections": "3.0.0-nightly.1996+be0fae9f7",
31
- "@react-stately/combobox": "3.3.2-nightly.3696+be0fae9f7",
32
- "@react-types/autocomplete": "3.0.0-nightly.3696+be0fae9f7",
33
- "@react-types/button": "3.7.1-nightly.3696+be0fae9f7",
34
- "@react-types/combobox": "3.5.6-nightly.3696+be0fae9f7",
35
- "@react-types/searchfield": "3.0.0-nightly.1996+be0fae9f7",
36
- "@react-types/shared": "3.0.0-nightly.1996+be0fae9f7",
25
+ "@react-aria/combobox": "3.4.5-nightly.3705+93b3c951e",
26
+ "@react-aria/i18n": "3.0.0-nightly.2005+93b3c951e",
27
+ "@react-aria/listbox": "3.7.3-nightly.3705+93b3c951e",
28
+ "@react-aria/live-announcer": "3.0.0-nightly.2005+93b3c951e",
29
+ "@react-aria/menu": "3.7.2-nightly.3705+93b3c951e",
30
+ "@react-aria/overlays": "3.0.0-nightly.2005+93b3c951e",
31
+ "@react-aria/searchfield": "3.0.0-nightly.2005+93b3c951e",
32
+ "@react-aria/selection": "3.0.0-nightly.2005+93b3c951e",
33
+ "@react-aria/textfield": "3.0.0-nightly.2005+93b3c951e",
34
+ "@react-aria/utils": "3.0.0-nightly.2005+93b3c951e",
35
+ "@react-stately/collections": "3.0.0-nightly.2005+93b3c951e",
36
+ "@react-stately/combobox": "3.3.2-nightly.3705+93b3c951e",
37
+ "@react-types/autocomplete": "3.0.0-nightly.3705+93b3c951e",
38
+ "@react-types/button": "3.7.1-nightly.3705+93b3c951e",
39
+ "@react-types/combobox": "3.5.6-nightly.3705+93b3c951e",
40
+ "@react-types/searchfield": "3.0.0-nightly.2005+93b3c951e",
41
+ "@react-types/shared": "3.0.0-nightly.2005+93b3c951e",
37
42
  "@swc/helpers": "^0.4.14"
38
43
  },
39
44
  "peerDependencies": {
@@ -42,5 +47,5 @@
42
47
  "publishConfig": {
43
48
  "access": "public"
44
49
  },
45
- "gitHead": "be0fae9f7952f4d09823498dc1f251e13842f338"
50
+ "gitHead": "93b3c951eb784b14183f9988f2d188b34de8f42d"
46
51
  }