@react-spectrum/autocomplete 3.0.0-alpha.52 → 3.0.0-alpha.54
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 +5 -3
- package/dist/main.js +7 -5
- package/dist/main.js.map +1 -1
- package/dist/module.js +5 -3
- package/dist/module.js.map +1 -1
- package/dist/types/src/index.d.ts +4 -0
- package/package.json +14 -49
- package/src/index.ts +5 -3
- package/dist/MobileSearchAutocomplete.main.js +0 -449
- package/dist/MobileSearchAutocomplete.main.js.map +0 -1
- package/dist/MobileSearchAutocomplete.mjs +0 -444
- package/dist/MobileSearchAutocomplete.module.js +0 -444
- package/dist/MobileSearchAutocomplete.module.js.map +0 -1
- package/dist/SearchAutocomplete.main.js +0 -305
- package/dist/SearchAutocomplete.main.js.map +0 -1
- package/dist/SearchAutocomplete.mjs +0 -300
- package/dist/SearchAutocomplete.module.js +0 -300
- package/dist/SearchAutocomplete.module.js.map +0 -1
- package/dist/ar-AE.main.js +0 -9
- package/dist/ar-AE.main.js.map +0 -1
- package/dist/ar-AE.mjs +0 -11
- package/dist/ar-AE.module.js +0 -11
- package/dist/ar-AE.module.js.map +0 -1
- package/dist/autocomplete.02db68b2.css +0 -55
- package/dist/autocomplete.02db68b2.css.map +0 -1
- package/dist/autocomplete.102c5c14.css +0 -223
- package/dist/autocomplete.102c5c14.css.map +0 -1
- package/dist/autocomplete.30e64bfb.css +0 -550
- package/dist/autocomplete.30e64bfb.css.map +0 -1
- package/dist/autocomplete.c4adfff6.css +0 -649
- package/dist/autocomplete.c4adfff6.css.map +0 -1
- package/dist/bg-BG.main.js +0 -9
- package/dist/bg-BG.main.js.map +0 -1
- package/dist/bg-BG.mjs +0 -11
- package/dist/bg-BG.module.js +0 -11
- package/dist/bg-BG.module.js.map +0 -1
- package/dist/cs-CZ.main.js +0 -9
- package/dist/cs-CZ.main.js.map +0 -1
- package/dist/cs-CZ.mjs +0 -11
- package/dist/cs-CZ.module.js +0 -11
- package/dist/cs-CZ.module.js.map +0 -1
- package/dist/da-DK.main.js +0 -9
- package/dist/da-DK.main.js.map +0 -1
- package/dist/da-DK.mjs +0 -11
- package/dist/da-DK.module.js +0 -11
- package/dist/da-DK.module.js.map +0 -1
- package/dist/de-DE.main.js +0 -9
- package/dist/de-DE.main.js.map +0 -1
- package/dist/de-DE.mjs +0 -11
- package/dist/de-DE.module.js +0 -11
- package/dist/de-DE.module.js.map +0 -1
- package/dist/el-GR.main.js +0 -9
- package/dist/el-GR.main.js.map +0 -1
- package/dist/el-GR.mjs +0 -11
- package/dist/el-GR.module.js +0 -11
- package/dist/el-GR.module.js.map +0 -1
- package/dist/en-US.main.js +0 -9
- package/dist/en-US.main.js.map +0 -1
- package/dist/en-US.mjs +0 -11
- package/dist/en-US.module.js +0 -11
- package/dist/en-US.module.js.map +0 -1
- package/dist/es-ES.main.js +0 -9
- package/dist/es-ES.main.js.map +0 -1
- package/dist/es-ES.mjs +0 -11
- package/dist/es-ES.module.js +0 -11
- package/dist/es-ES.module.js.map +0 -1
- package/dist/et-EE.main.js +0 -9
- package/dist/et-EE.main.js.map +0 -1
- package/dist/et-EE.mjs +0 -11
- package/dist/et-EE.module.js +0 -11
- package/dist/et-EE.module.js.map +0 -1
- package/dist/fi-FI.main.js +0 -9
- package/dist/fi-FI.main.js.map +0 -1
- package/dist/fi-FI.mjs +0 -11
- package/dist/fi-FI.module.js +0 -11
- package/dist/fi-FI.module.js.map +0 -1
- package/dist/fr-FR.main.js +0 -9
- package/dist/fr-FR.main.js.map +0 -1
- package/dist/fr-FR.mjs +0 -11
- package/dist/fr-FR.module.js +0 -11
- package/dist/fr-FR.module.js.map +0 -1
- package/dist/he-IL.main.js +0 -9
- package/dist/he-IL.main.js.map +0 -1
- package/dist/he-IL.mjs +0 -11
- package/dist/he-IL.module.js +0 -11
- package/dist/he-IL.module.js.map +0 -1
- package/dist/hr-HR.main.js +0 -9
- package/dist/hr-HR.main.js.map +0 -1
- package/dist/hr-HR.mjs +0 -11
- package/dist/hr-HR.module.js +0 -11
- package/dist/hr-HR.module.js.map +0 -1
- package/dist/hu-HU.main.js +0 -9
- package/dist/hu-HU.main.js.map +0 -1
- package/dist/hu-HU.mjs +0 -11
- package/dist/hu-HU.module.js +0 -11
- package/dist/hu-HU.module.js.map +0 -1
- package/dist/inputgroup_vars_css.main.js +0 -86
- package/dist/inputgroup_vars_css.main.js.map +0 -1
- package/dist/inputgroup_vars_css.mjs +0 -88
- package/dist/inputgroup_vars_css.module.js +0 -88
- package/dist/inputgroup_vars_css.module.js.map +0 -1
- package/dist/intlStrings.main.js +0 -108
- package/dist/intlStrings.main.js.map +0 -1
- package/dist/intlStrings.mjs +0 -110
- package/dist/intlStrings.module.js +0 -110
- package/dist/intlStrings.module.js.map +0 -1
- package/dist/it-IT.main.js +0 -9
- package/dist/it-IT.main.js.map +0 -1
- package/dist/it-IT.mjs +0 -11
- package/dist/it-IT.module.js +0 -11
- package/dist/it-IT.module.js.map +0 -1
- package/dist/ja-JP.main.js +0 -9
- package/dist/ja-JP.main.js.map +0 -1
- package/dist/ja-JP.mjs +0 -11
- package/dist/ja-JP.module.js +0 -11
- package/dist/ja-JP.module.js.map +0 -1
- package/dist/ko-KR.main.js +0 -9
- package/dist/ko-KR.main.js.map +0 -1
- package/dist/ko-KR.mjs +0 -11
- package/dist/ko-KR.module.js +0 -11
- package/dist/ko-KR.module.js.map +0 -1
- package/dist/lt-LT.main.js +0 -9
- package/dist/lt-LT.main.js.map +0 -1
- package/dist/lt-LT.mjs +0 -11
- package/dist/lt-LT.module.js +0 -11
- package/dist/lt-LT.module.js.map +0 -1
- package/dist/lv-LV.main.js +0 -9
- package/dist/lv-LV.main.js.map +0 -1
- package/dist/lv-LV.mjs +0 -11
- package/dist/lv-LV.module.js +0 -11
- package/dist/lv-LV.module.js.map +0 -1
- package/dist/nb-NO.main.js +0 -9
- package/dist/nb-NO.main.js.map +0 -1
- package/dist/nb-NO.mjs +0 -11
- package/dist/nb-NO.module.js +0 -11
- package/dist/nb-NO.module.js.map +0 -1
- package/dist/nl-NL.main.js +0 -9
- package/dist/nl-NL.main.js.map +0 -1
- package/dist/nl-NL.mjs +0 -11
- package/dist/nl-NL.module.js +0 -11
- package/dist/nl-NL.module.js.map +0 -1
- package/dist/pl-PL.main.js +0 -9
- package/dist/pl-PL.main.js.map +0 -1
- package/dist/pl-PL.mjs +0 -11
- package/dist/pl-PL.module.js +0 -11
- package/dist/pl-PL.module.js.map +0 -1
- package/dist/pt-BR.main.js +0 -9
- package/dist/pt-BR.main.js.map +0 -1
- package/dist/pt-BR.mjs +0 -11
- package/dist/pt-BR.module.js +0 -11
- package/dist/pt-BR.module.js.map +0 -1
- package/dist/pt-PT.main.js +0 -9
- package/dist/pt-PT.main.js.map +0 -1
- package/dist/pt-PT.mjs +0 -11
- package/dist/pt-PT.module.js +0 -11
- package/dist/pt-PT.module.js.map +0 -1
- package/dist/ro-RO.main.js +0 -9
- package/dist/ro-RO.main.js.map +0 -1
- package/dist/ro-RO.mjs +0 -11
- package/dist/ro-RO.module.js +0 -11
- package/dist/ro-RO.module.js.map +0 -1
- package/dist/ru-RU.main.js +0 -9
- package/dist/ru-RU.main.js.map +0 -1
- package/dist/ru-RU.mjs +0 -11
- package/dist/ru-RU.module.js +0 -11
- package/dist/ru-RU.module.js.map +0 -1
- package/dist/search_vars_css.main.js +0 -53
- package/dist/search_vars_css.main.js.map +0 -1
- package/dist/search_vars_css.mjs +0 -55
- package/dist/search_vars_css.module.js +0 -55
- package/dist/search_vars_css.module.js.map +0 -1
- package/dist/searchautocomplete_css.main.js +0 -38
- package/dist/searchautocomplete_css.main.js.map +0 -1
- package/dist/searchautocomplete_css.mjs +0 -40
- package/dist/searchautocomplete_css.module.js +0 -40
- package/dist/searchautocomplete_css.module.js.map +0 -1
- package/dist/sk-SK.main.js +0 -9
- package/dist/sk-SK.main.js.map +0 -1
- package/dist/sk-SK.mjs +0 -11
- package/dist/sk-SK.module.js +0 -11
- package/dist/sk-SK.module.js.map +0 -1
- package/dist/sl-SI.main.js +0 -9
- package/dist/sl-SI.main.js.map +0 -1
- package/dist/sl-SI.mjs +0 -11
- package/dist/sl-SI.module.js +0 -11
- package/dist/sl-SI.module.js.map +0 -1
- package/dist/sr-SP.main.js +0 -9
- package/dist/sr-SP.main.js.map +0 -1
- package/dist/sr-SP.mjs +0 -11
- package/dist/sr-SP.module.js +0 -11
- package/dist/sr-SP.module.js.map +0 -1
- package/dist/sv-SE.main.js +0 -9
- package/dist/sv-SE.main.js.map +0 -1
- package/dist/sv-SE.mjs +0 -11
- package/dist/sv-SE.module.js +0 -11
- package/dist/sv-SE.module.js.map +0 -1
- package/dist/textfield_vars_css.main.js +0 -74
- package/dist/textfield_vars_css.main.js.map +0 -1
- package/dist/textfield_vars_css.mjs +0 -76
- package/dist/textfield_vars_css.module.js +0 -76
- package/dist/textfield_vars_css.module.js.map +0 -1
- package/dist/tr-TR.main.js +0 -9
- package/dist/tr-TR.main.js.map +0 -1
- package/dist/tr-TR.mjs +0 -11
- package/dist/tr-TR.module.js +0 -11
- package/dist/tr-TR.module.js.map +0 -1
- package/dist/types.d.ts +0 -13
- package/dist/types.d.ts.map +0 -1
- package/dist/uk-UA.main.js +0 -9
- package/dist/uk-UA.main.js.map +0 -1
- package/dist/uk-UA.mjs +0 -11
- package/dist/uk-UA.module.js +0 -11
- package/dist/uk-UA.module.js.map +0 -1
- package/dist/zh-CN.main.js +0 -9
- package/dist/zh-CN.main.js.map +0 -1
- package/dist/zh-CN.mjs +0 -11
- package/dist/zh-CN.module.js +0 -11
- package/dist/zh-CN.module.js.map +0 -1
- package/dist/zh-TW.main.js +0 -9
- package/dist/zh-TW.main.js.map +0 -1
- package/dist/zh-TW.mjs +0 -11
- package/dist/zh-TW.module.js +0 -11
- package/dist/zh-TW.module.js.map +0 -1
- package/src/MobileSearchAutocomplete.tsx +0 -632
- package/src/SearchAutocomplete.tsx +0 -382
- package/src/searchautocomplete.css +0 -71
package/dist/import.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {SearchAutocomplete as $
|
|
2
|
-
import {Item as $
|
|
1
|
+
import {SearchAutocomplete as $36571e405ca8b13b$re_export$SearchAutocomplete} from "@adobe/react-spectrum/private/autocomplete/SearchAutocomplete";
|
|
2
|
+
import {Item as $36571e405ca8b13b$re_export$Item} from "react-stately/Item";
|
|
3
|
+
import {Section as $36571e405ca8b13b$re_export$Section} from "react-stately/Section";
|
|
3
4
|
|
|
4
5
|
/*
|
|
5
6
|
* Copyright 2021 Adobe. All rights reserved.
|
|
@@ -16,5 +17,6 @@ import {Item as $dc667e3abdbeb6b2$re_export$Item, Section as $dc667e3abdbeb6b2$r
|
|
|
16
17
|
|
|
17
18
|
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
|
|
21
|
+
export {$36571e405ca8b13b$re_export$SearchAutocomplete as SearchAutocomplete, $36571e405ca8b13b$re_export$Item as Item, $36571e405ca8b13b$re_export$Section as Section};
|
|
20
22
|
//# sourceMappingURL=module.js.map
|
package/dist/main.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
var $
|
|
2
|
-
var $
|
|
1
|
+
var $e3sWl$adobereactspectrumprivateautocompleteSearchAutocomplete = require("@adobe/react-spectrum/private/autocomplete/SearchAutocomplete");
|
|
2
|
+
var $e3sWl$reactstatelyItem = require("react-stately/Item");
|
|
3
|
+
var $e3sWl$reactstatelySection = require("react-stately/Section");
|
|
3
4
|
|
|
4
5
|
|
|
5
6
|
function $parcel$export(e, n, v, s) {
|
|
6
7
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
7
8
|
}
|
|
8
9
|
|
|
9
|
-
$parcel$export(module.exports, "SearchAutocomplete", ()
|
|
10
|
-
$parcel$export(module.exports, "Item", ()
|
|
11
|
-
$parcel$export(module.exports, "Section", ()
|
|
10
|
+
$parcel$export(module.exports, "SearchAutocomplete", function () { return $e3sWl$adobereactspectrumprivateautocompleteSearchAutocomplete.SearchAutocomplete; });
|
|
11
|
+
$parcel$export(module.exports, "Item", function () { return $e3sWl$reactstatelyItem.Item; });
|
|
12
|
+
$parcel$export(module.exports, "Section", function () { return $e3sWl$reactstatelySection.Section; });
|
|
12
13
|
/*
|
|
13
14
|
* Copyright 2021 Adobe. All rights reserved.
|
|
14
15
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -24,4 +25,5 @@ $parcel$export(module.exports, "Section", () => $aWXRc$reactstatelycollections.S
|
|
|
24
25
|
|
|
25
26
|
|
|
26
27
|
|
|
28
|
+
|
|
27
29
|
//# sourceMappingURL=main.js.map
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GACD,0CAA0C","sources":["packages/@react-spectrum/autocomplete/src/index.ts"],"sourcesContent":["/*\n * Copyright 2021 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/// <reference types=\"css-module-types\" />\nexport {SearchAutocomplete} from '@adobe/react-spectrum/private/autocomplete/SearchAutocomplete';\n\nexport type {SpectrumSearchAutocompleteProps} from '@adobe/react-spectrum/private/autocomplete/SearchAutocomplete';\nexport {Item} from 'react-stately/Item';\nexport {Section} from 'react-stately/Section';\n"],"names":[],"version":3,"file":"main.js.map"}
|
package/dist/module.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {SearchAutocomplete as $
|
|
2
|
-
import {Item as $
|
|
1
|
+
import {SearchAutocomplete as $36571e405ca8b13b$re_export$SearchAutocomplete} from "@adobe/react-spectrum/private/autocomplete/SearchAutocomplete";
|
|
2
|
+
import {Item as $36571e405ca8b13b$re_export$Item} from "react-stately/Item";
|
|
3
|
+
import {Section as $36571e405ca8b13b$re_export$Section} from "react-stately/Section";
|
|
3
4
|
|
|
4
5
|
/*
|
|
5
6
|
* Copyright 2021 Adobe. All rights reserved.
|
|
@@ -16,5 +17,6 @@ import {Item as $dc667e3abdbeb6b2$re_export$Item, Section as $dc667e3abdbeb6b2$r
|
|
|
16
17
|
|
|
17
18
|
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
|
|
21
|
+
export {$36571e405ca8b13b$re_export$SearchAutocomplete as SearchAutocomplete, $36571e405ca8b13b$re_export$Item as Item, $36571e405ca8b13b$re_export$Section as Section};
|
|
20
22
|
//# sourceMappingURL=module.js.map
|
package/dist/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;AAAA;;;;;;;;;;CAUC,GACD,0CAA0C","sources":["packages/@react-spectrum/autocomplete/src/index.ts"],"sourcesContent":["/*\n * Copyright 2021 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/// <reference types=\"css-module-types\" />\nexport {SearchAutocomplete} from '@adobe/react-spectrum/private/autocomplete/SearchAutocomplete';\n\nexport type {SpectrumSearchAutocompleteProps} from '@adobe/react-spectrum/private/autocomplete/SearchAutocomplete';\nexport {Item} from 'react-stately/Item';\nexport {Section} from 'react-stately/Section';\n"],"names":[],"version":3,"file":"module.js.map"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { SearchAutocomplete } from '@adobe/react-spectrum/private/autocomplete/SearchAutocomplete';
|
|
2
|
+
export type { SpectrumSearchAutocompleteProps } from '@adobe/react-spectrum/private/autocomplete/SearchAutocomplete';
|
|
3
|
+
export { Item } from 'react-stately/Item';
|
|
4
|
+
export { Section } from 'react-stately/Section';
|
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-spectrum/autocomplete",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.54",
|
|
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
8
|
"exports": {
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
"./dist/types.d.ts",
|
|
12
|
-
"./
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"
|
|
9
|
+
".": {
|
|
10
|
+
"source": "./src/index.ts",
|
|
11
|
+
"types": "./dist/types/src/index.d.ts",
|
|
12
|
+
"import": "./dist/import.mjs",
|
|
13
|
+
"require": "./dist/main.js"
|
|
14
|
+
},
|
|
15
|
+
"./package.json": "./package.json"
|
|
16
16
|
},
|
|
17
|
-
"types": "dist/types.d.ts",
|
|
17
|
+
"types": "dist/types/src/index.d.ts",
|
|
18
18
|
"source": "src/index.ts",
|
|
19
19
|
"files": [
|
|
20
20
|
"dist",
|
|
@@ -24,58 +24,23 @@
|
|
|
24
24
|
"*.css"
|
|
25
25
|
],
|
|
26
26
|
"targets": {
|
|
27
|
-
"
|
|
28
|
-
"includeNodeModules": [
|
|
29
|
-
"@adobe/spectrum-css-temp"
|
|
30
|
-
]
|
|
31
|
-
},
|
|
32
|
-
"module": {
|
|
33
|
-
"includeNodeModules": [
|
|
34
|
-
"@adobe/spectrum-css-temp"
|
|
35
|
-
]
|
|
36
|
-
}
|
|
27
|
+
"types": false
|
|
37
28
|
},
|
|
38
29
|
"repository": {
|
|
39
30
|
"type": "git",
|
|
40
31
|
"url": "https://github.com/adobe/react-spectrum"
|
|
41
32
|
},
|
|
42
33
|
"dependencies": {
|
|
43
|
-
"@react-
|
|
44
|
-
"@
|
|
45
|
-
"
|
|
46
|
-
"@react-aria/focus": "^3.21.4",
|
|
47
|
-
"@react-aria/form": "^3.1.4",
|
|
48
|
-
"@react-aria/i18n": "^3.12.15",
|
|
49
|
-
"@react-aria/interactions": "^3.27.0",
|
|
50
|
-
"@react-aria/label": "^3.7.24",
|
|
51
|
-
"@react-aria/overlays": "^3.31.1",
|
|
52
|
-
"@react-aria/utils": "^3.33.0",
|
|
53
|
-
"@react-spectrum/button": "^3.17.6",
|
|
54
|
-
"@react-spectrum/form": "^3.7.21",
|
|
55
|
-
"@react-spectrum/label": "^3.16.21",
|
|
56
|
-
"@react-spectrum/listbox": "^3.15.10",
|
|
57
|
-
"@react-spectrum/overlays": "^5.9.2",
|
|
58
|
-
"@react-spectrum/progress": "^3.7.22",
|
|
59
|
-
"@react-spectrum/textfield": "^3.14.4",
|
|
60
|
-
"@react-spectrum/utils": "^3.12.11",
|
|
61
|
-
"@react-stately/collections": "^3.12.9",
|
|
62
|
-
"@react-stately/combobox": "^3.12.2",
|
|
63
|
-
"@react-types/autocomplete": "3.0.0-alpha.37",
|
|
64
|
-
"@react-types/button": "^3.15.0",
|
|
65
|
-
"@react-types/shared": "^3.33.0",
|
|
66
|
-
"@spectrum-icons/ui": "^3.6.22",
|
|
67
|
-
"@swc/helpers": "^0.5.0"
|
|
68
|
-
},
|
|
69
|
-
"devDependencies": {
|
|
70
|
-
"@adobe/spectrum-css-temp": "3.0.0-alpha.1"
|
|
34
|
+
"@adobe/react-spectrum": "3.47.0",
|
|
35
|
+
"@swc/helpers": "^0.5.0",
|
|
36
|
+
"react-stately": "3.46.0"
|
|
71
37
|
},
|
|
72
38
|
"peerDependencies": {
|
|
73
|
-
"@react-spectrum/provider": "^3.0.0",
|
|
74
39
|
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",
|
|
75
40
|
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
|
|
76
41
|
},
|
|
77
42
|
"publishConfig": {
|
|
78
43
|
"access": "public"
|
|
79
44
|
},
|
|
80
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "a6999bdf494a2e9c0381a5881908328bdd22ddae"
|
|
81
46
|
}
|
package/src/index.ts
CHANGED
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
/// <reference types="css-module-types" />
|
|
13
|
-
export {SearchAutocomplete} from '
|
|
14
|
-
|
|
15
|
-
export type {SpectrumSearchAutocompleteProps} from '@react-
|
|
13
|
+
export {SearchAutocomplete} from '@adobe/react-spectrum/private/autocomplete/SearchAutocomplete';
|
|
14
|
+
|
|
15
|
+
export type {SpectrumSearchAutocompleteProps} from '@adobe/react-spectrum/private/autocomplete/SearchAutocomplete';
|
|
16
|
+
export {Item} from 'react-stately/Item';
|
|
17
|
+
export {Section} from 'react-stately/Section';
|
|
@@ -1,449 +0,0 @@
|
|
|
1
|
-
var $e32120882142a69f$exports = require("./intlStrings.main.js");
|
|
2
|
-
require("./autocomplete.02db68b2.css");
|
|
3
|
-
var $83da5c2df967875d$exports = require("./searchautocomplete_css.main.js");
|
|
4
|
-
require("./autocomplete.102c5c14.css");
|
|
5
|
-
var $1e139f06a0a4b696$exports = require("./search_vars_css.main.js");
|
|
6
|
-
require("./autocomplete.c4adfff6.css");
|
|
7
|
-
var $2f86633ce5b04f1e$exports = require("./inputgroup_vars_css.main.js");
|
|
8
|
-
require("./autocomplete.30e64bfb.css");
|
|
9
|
-
var $40cb3a00c193680f$exports = require("./textfield_vars_css.main.js");
|
|
10
|
-
var $56uON$spectrumiconsuiAlertMedium = require("@spectrum-icons/ui/AlertMedium");
|
|
11
|
-
var $56uON$spectrumiconsuiCheckmarkMedium = require("@spectrum-icons/ui/CheckmarkMedium");
|
|
12
|
-
var $56uON$reactspectrumutils = require("@react-spectrum/utils");
|
|
13
|
-
var $56uON$reactspectrumbutton = require("@react-spectrum/button");
|
|
14
|
-
var $56uON$reactstatelycombobox = require("@react-stately/combobox");
|
|
15
|
-
var $56uON$reactariaoverlays = require("@react-aria/overlays");
|
|
16
|
-
var $56uON$reactspectrumlabel = require("@react-spectrum/label");
|
|
17
|
-
var $56uON$reactariainteractions = require("@react-aria/interactions");
|
|
18
|
-
var $56uON$reactariafocus = require("@react-aria/focus");
|
|
19
|
-
var $56uON$reactspectrumlistbox = require("@react-spectrum/listbox");
|
|
20
|
-
var $56uON$spectrumiconsuiMagnifier = require("@spectrum-icons/ui/Magnifier");
|
|
21
|
-
var $56uON$reactariautils = require("@react-aria/utils");
|
|
22
|
-
var $56uON$reactspectrumprogress = require("@react-spectrum/progress");
|
|
23
|
-
var $56uON$react = require("react");
|
|
24
|
-
var $56uON$reactspectrumtextfield = require("@react-spectrum/textfield");
|
|
25
|
-
var $56uON$reactspectrumoverlays = require("@react-spectrum/overlays");
|
|
26
|
-
var $56uON$reactariabutton = require("@react-aria/button");
|
|
27
|
-
var $56uON$reactariadialog = require("@react-aria/dialog");
|
|
28
|
-
var $56uON$reactarialabel = require("@react-aria/label");
|
|
29
|
-
var $56uON$reactariai18n = require("@react-aria/i18n");
|
|
30
|
-
var $56uON$reactariaform = require("@react-aria/form");
|
|
31
|
-
var $56uON$reactspectrumprovider = require("@react-spectrum/provider");
|
|
32
|
-
var $56uON$reactariaautocomplete = require("@react-aria/autocomplete");
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
function $parcel$interopDefault(a) {
|
|
36
|
-
return a && a.__esModule ? a.default : a;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function $parcel$export(e, n, v, s) {
|
|
40
|
-
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
$parcel$export(module.exports, "MobileSearchAutocomplete", () => $a9f98e219df0b64d$export$e7a90f7d6b078162);
|
|
44
|
-
/*
|
|
45
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
46
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
47
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
48
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
49
|
-
*
|
|
50
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
51
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
52
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
53
|
-
* governing permissions and limitations under the License.
|
|
54
|
-
*/
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
function $a9f98e219df0b64d$var$ForwardMobileSearchAutocomplete(props, ref) {
|
|
83
|
-
props = (0, $56uON$reactspectrumprovider.useProviderProps)(props);
|
|
84
|
-
let { isQuiet: isQuiet, isDisabled: isDisabled, isRequired: isRequired, validationBehavior: validationBehavior, validate: validate, name: name, isReadOnly: isReadOnly, onSubmit: onSubmit = ()=>{} } = props;
|
|
85
|
-
let { contains: contains } = (0, $56uON$reactariai18n.useFilter)({
|
|
86
|
-
sensitivity: 'base'
|
|
87
|
-
});
|
|
88
|
-
let state = (0, $56uON$reactstatelycombobox.useComboBoxState)({
|
|
89
|
-
...props,
|
|
90
|
-
defaultFilter: contains,
|
|
91
|
-
allowsEmptyCollection: true,
|
|
92
|
-
// Needs to be false here otherwise we double up on commitSelection/commitCustomValue calls when
|
|
93
|
-
// user taps on underlay (i.e. initial tap will call setFocused(false) -> commitSelection/commitCustomValue via onBlur,
|
|
94
|
-
// then the closing of the tray will call setFocused(false) again due to cleanup effect)
|
|
95
|
-
shouldCloseOnBlur: false,
|
|
96
|
-
allowsCustomValue: true,
|
|
97
|
-
onSelectionChange: (key)=>key !== null && onSubmit(null, key),
|
|
98
|
-
selectedKey: undefined,
|
|
99
|
-
defaultSelectedKey: undefined,
|
|
100
|
-
validate: (0, $56uON$react.useCallback)((v)=>validate === null || validate === void 0 ? void 0 : validate(v.inputValue), [
|
|
101
|
-
validate
|
|
102
|
-
])
|
|
103
|
-
});
|
|
104
|
-
let buttonRef = (0, $56uON$react.useRef)(null);
|
|
105
|
-
let domRef = (0, $56uON$reactspectrumutils.useFocusableRef)(ref, buttonRef);
|
|
106
|
-
let { triggerProps: triggerProps, overlayProps: overlayProps } = (0, $56uON$reactariaoverlays.useOverlayTrigger)({
|
|
107
|
-
type: 'listbox'
|
|
108
|
-
}, state, buttonRef);
|
|
109
|
-
let inputRef = (0, $56uON$react.useRef)(null);
|
|
110
|
-
(0, $56uON$reactariaform.useFormValidation)({
|
|
111
|
-
...props,
|
|
112
|
-
focus: ()=>{
|
|
113
|
-
var _buttonRef_current;
|
|
114
|
-
return (_buttonRef_current = buttonRef.current) === null || _buttonRef_current === void 0 ? void 0 : _buttonRef_current.focus();
|
|
115
|
-
}
|
|
116
|
-
}, state, inputRef);
|
|
117
|
-
let { isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = state.displayValidation;
|
|
118
|
-
let validationState = props.validationState || (isInvalid ? 'invalid' : undefined);
|
|
119
|
-
var _props_errorMessage;
|
|
120
|
-
let errorMessage = (_props_errorMessage = props.errorMessage) !== null && _props_errorMessage !== void 0 ? _props_errorMessage : validationErrors.join(' ');
|
|
121
|
-
let { labelProps: labelProps, fieldProps: fieldProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps } = (0, $56uON$reactarialabel.useField)({
|
|
122
|
-
...props,
|
|
123
|
-
labelElementType: 'span',
|
|
124
|
-
isInvalid: isInvalid,
|
|
125
|
-
errorMessage: errorMessage
|
|
126
|
-
});
|
|
127
|
-
// Focus the button and show focus ring when clicking on the label
|
|
128
|
-
labelProps.onClick = ()=>{
|
|
129
|
-
if (!props.isDisabled && buttonRef.current) {
|
|
130
|
-
buttonRef.current.focus();
|
|
131
|
-
(0, $56uON$reactariainteractions.setInteractionModality)('keyboard');
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
let inputProps = {
|
|
135
|
-
type: 'hidden',
|
|
136
|
-
name: name,
|
|
137
|
-
value: state.inputValue
|
|
138
|
-
};
|
|
139
|
-
if (validationBehavior === 'native') {
|
|
140
|
-
// Use a hidden <input type="text"> rather than <input type="hidden">
|
|
141
|
-
// so that an empty value blocks HTML form submission when the field is required.
|
|
142
|
-
inputProps.type = 'text';
|
|
143
|
-
inputProps.hidden = true;
|
|
144
|
-
inputProps.required = isRequired;
|
|
145
|
-
// Ignore react warning.
|
|
146
|
-
inputProps.onChange = ()=>{};
|
|
147
|
-
}
|
|
148
|
-
(0, $56uON$reactariautils.useFormReset)(inputRef, state.defaultInputValue, state.setInputValue);
|
|
149
|
-
return /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).createElement((0, ($parcel$interopDefault($56uON$react))).Fragment, null, /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).createElement((0, $56uON$reactspectrumlabel.Field), {
|
|
150
|
-
...props,
|
|
151
|
-
labelProps: labelProps,
|
|
152
|
-
descriptionProps: descriptionProps,
|
|
153
|
-
errorMessageProps: errorMessageProps,
|
|
154
|
-
isInvalid: isInvalid,
|
|
155
|
-
validationErrors: validationErrors,
|
|
156
|
-
validationDetails: validationDetails,
|
|
157
|
-
elementType: "span",
|
|
158
|
-
ref: domRef,
|
|
159
|
-
includeNecessityIndicatorInAccessibilityName: true
|
|
160
|
-
}, /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).createElement($a9f98e219df0b64d$var$SearchAutocompleteButton, {
|
|
161
|
-
...(0, $56uON$reactariautils.mergeProps)(triggerProps, fieldProps, {
|
|
162
|
-
autoFocus: props.autoFocus,
|
|
163
|
-
icon: props.icon
|
|
164
|
-
}),
|
|
165
|
-
ref: buttonRef,
|
|
166
|
-
isQuiet: isQuiet,
|
|
167
|
-
isDisabled: isDisabled,
|
|
168
|
-
isReadOnly: isReadOnly,
|
|
169
|
-
isPlaceholder: !state.inputValue,
|
|
170
|
-
validationState: validationState,
|
|
171
|
-
inputValue: state.inputValue,
|
|
172
|
-
clearInput: ()=>state.setInputValue(''),
|
|
173
|
-
onPress: ()=>!isReadOnly && state.open(null, 'manual')
|
|
174
|
-
}, state.inputValue || props.placeholder || '')), /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).createElement("input", {
|
|
175
|
-
...inputProps,
|
|
176
|
-
ref: inputRef
|
|
177
|
-
}), /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).createElement((0, $56uON$reactspectrumoverlays.Tray), {
|
|
178
|
-
state: state,
|
|
179
|
-
isFixedHeight: true,
|
|
180
|
-
...overlayProps
|
|
181
|
-
}, /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).createElement($a9f98e219df0b64d$var$SearchAutocompleteTray, {
|
|
182
|
-
...props,
|
|
183
|
-
onClose: state.close,
|
|
184
|
-
overlayProps: overlayProps,
|
|
185
|
-
state: state
|
|
186
|
-
})));
|
|
187
|
-
}
|
|
188
|
-
let $a9f98e219df0b64d$export$e7a90f7d6b078162 = /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).forwardRef($a9f98e219df0b64d$var$ForwardMobileSearchAutocomplete);
|
|
189
|
-
// any type is because we don't want to call useObjectRef because this is an internal component and we know
|
|
190
|
-
// we are always passing an object ref
|
|
191
|
-
const $a9f98e219df0b64d$var$SearchAutocompleteButton = /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).forwardRef(function SearchAutocompleteButton(props, ref) {
|
|
192
|
-
let searchIcon = /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).createElement((0, ($parcel$interopDefault($56uON$spectrumiconsuiMagnifier))), {
|
|
193
|
-
"data-testid": "searchicon"
|
|
194
|
-
});
|
|
195
|
-
let { icon: icon = searchIcon, isQuiet: isQuiet, isDisabled: isDisabled, isReadOnly: isReadOnly, isPlaceholder: isPlaceholder, validationState: validationState, inputValue: inputValue, clearInput: clearInput, children: children, style: style, className: className } = props;
|
|
196
|
-
let stringFormatter = (0, $56uON$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($e32120882142a69f$exports))), '@react-spectrum/autocomplete');
|
|
197
|
-
let valueId = (0, $56uON$reactariautils.useId)();
|
|
198
|
-
let invalidId = (0, $56uON$reactariautils.useId)();
|
|
199
|
-
let validationIcon = validationState === 'invalid' ? /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).createElement((0, ($parcel$interopDefault($56uON$spectrumiconsuiAlertMedium))), {
|
|
200
|
-
id: invalidId,
|
|
201
|
-
"aria-label": stringFormatter.format('invalid')
|
|
202
|
-
}) : /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).createElement((0, ($parcel$interopDefault($56uON$spectrumiconsuiCheckmarkMedium))), null);
|
|
203
|
-
if (icon) icon = /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).cloneElement(icon, {
|
|
204
|
-
UNSAFE_className: (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($40cb3a00c193680f$exports))), 'spectrum-Textfield-icon'),
|
|
205
|
-
size: 'S'
|
|
206
|
-
});
|
|
207
|
-
let clearButton = /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).createElement((0, $56uON$reactspectrumbutton.ClearButton), {
|
|
208
|
-
onPress: (e)=>{
|
|
209
|
-
var _props_onPress;
|
|
210
|
-
clearInput === null || clearInput === void 0 ? void 0 : clearInput();
|
|
211
|
-
props === null || props === void 0 ? void 0 : (_props_onPress = props.onPress) === null || _props_onPress === void 0 ? void 0 : _props_onPress.call(props, e);
|
|
212
|
-
},
|
|
213
|
-
preventFocus: true,
|
|
214
|
-
"aria-label": stringFormatter.format('clear'),
|
|
215
|
-
excludeFromTabOrder: true,
|
|
216
|
-
UNSAFE_className: (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($1e139f06a0a4b696$exports))), 'spectrum-ClearButton'),
|
|
217
|
-
isDisabled: isDisabled
|
|
218
|
-
});
|
|
219
|
-
let validation = /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).cloneElement(validationIcon, {
|
|
220
|
-
UNSAFE_className: (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($40cb3a00c193680f$exports))), 'spectrum-Textfield-validationIcon', (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($2f86633ce5b04f1e$exports))), 'spectrum-InputGroup-input-validationIcon'), (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($1e139f06a0a4b696$exports))), 'spectrum-Search-validationIcon'))
|
|
221
|
-
});
|
|
222
|
-
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $56uON$reactariainteractions.useHover)({});
|
|
223
|
-
let { isFocused: isFocused, isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $56uON$reactariafocus.useFocusRing)();
|
|
224
|
-
let { buttonProps: buttonProps } = (0, $56uON$reactariabutton.useButton)({
|
|
225
|
-
...props,
|
|
226
|
-
'aria-labelledby': [
|
|
227
|
-
props['aria-labelledby'],
|
|
228
|
-
props['aria-label'] && !props['aria-labelledby'] ? props.id : null,
|
|
229
|
-
valueId,
|
|
230
|
-
validationState === 'invalid' ? invalidId : null
|
|
231
|
-
].filter(Boolean).join(' '),
|
|
232
|
-
elementType: 'div'
|
|
233
|
-
}, ref);
|
|
234
|
-
return /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).createElement("div", {
|
|
235
|
-
...(0, $56uON$reactariautils.mergeProps)(hoverProps, focusProps, buttonProps),
|
|
236
|
-
"aria-haspopup": "dialog",
|
|
237
|
-
ref: ref,
|
|
238
|
-
style: {
|
|
239
|
-
...style,
|
|
240
|
-
outline: 'none'
|
|
241
|
-
},
|
|
242
|
-
className: (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($2f86633ce5b04f1e$exports))), 'spectrum-InputGroup', {
|
|
243
|
-
'spectrum-InputGroup--quiet': isQuiet,
|
|
244
|
-
'is-disabled': isDisabled,
|
|
245
|
-
'spectrum-InputGroup--invalid': validationState === 'invalid' && !isDisabled,
|
|
246
|
-
'is-hovered': isHovered,
|
|
247
|
-
'is-focused': isFocused,
|
|
248
|
-
'focus-ring': isFocusVisible
|
|
249
|
-
}, (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($83da5c2df967875d$exports))), 'searchautocomplete', 'mobile-searchautocomplete'), className)
|
|
250
|
-
}, /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).createElement("div", {
|
|
251
|
-
className: (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($40cb3a00c193680f$exports))), 'spectrum-Textfield', {
|
|
252
|
-
'spectrum-Textfield--invalid': validationState === 'invalid' && !isDisabled,
|
|
253
|
-
'spectrum-Textfield--valid': validationState === 'valid' && !isDisabled,
|
|
254
|
-
'spectrum-Textfield--quiet': isQuiet
|
|
255
|
-
}, (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($1e139f06a0a4b696$exports))), 'spectrum-Search', 'spectrum-Search--loadable', {
|
|
256
|
-
'is-disabled': isDisabled,
|
|
257
|
-
'is-quiet': isQuiet,
|
|
258
|
-
'spectrum-Search--invalid': validationState === 'invalid' && !isDisabled,
|
|
259
|
-
'spectrum-Search--valid': validationState === 'valid' && !isDisabled
|
|
260
|
-
}), (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($2f86633ce5b04f1e$exports))), 'spectrum-InputGroup-field'))
|
|
261
|
-
}, /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).createElement("div", {
|
|
262
|
-
className: (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($40cb3a00c193680f$exports))), 'spectrum-Textfield-input', {
|
|
263
|
-
'spectrum-Textfield-inputIcon': !!icon,
|
|
264
|
-
'is-hovered': isHovered,
|
|
265
|
-
'is-placeholder': isPlaceholder,
|
|
266
|
-
'is-disabled': isDisabled,
|
|
267
|
-
'is-quiet': isQuiet,
|
|
268
|
-
'is-focused': isFocused
|
|
269
|
-
}, (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($1e139f06a0a4b696$exports))), 'spectrum-Search-input'), (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($83da5c2df967875d$exports))), 'mobile-input'))
|
|
270
|
-
}, icon, /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).createElement("span", {
|
|
271
|
-
id: valueId,
|
|
272
|
-
className: (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($83da5c2df967875d$exports))), 'mobile-value')
|
|
273
|
-
}, children)), validationState && !isDisabled ? validation : null, (inputValue !== '' || validationState != null) && !isReadOnly && clearButton));
|
|
274
|
-
});
|
|
275
|
-
function $a9f98e219df0b64d$var$SearchAutocompleteTray(props) {
|
|
276
|
-
let searchIcon = /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).createElement((0, ($parcel$interopDefault($56uON$spectrumiconsuiMagnifier))), {
|
|
277
|
-
"data-testid": "searchicon"
|
|
278
|
-
});
|
|
279
|
-
let { state: // completionMode = 'suggest',
|
|
280
|
-
state, icon: icon = searchIcon, isDisabled: isDisabled, validationState: validationState, label: label, overlayProps: overlayProps, loadingState: loadingState, onLoadMore: onLoadMore, onClose: onClose, onSubmit: onSubmit } = props;
|
|
281
|
-
let timeout = (0, $56uON$react.useRef)(null);
|
|
282
|
-
let [showLoading, setShowLoading] = (0, $56uON$react.useState)(false);
|
|
283
|
-
let inputRef = (0, $56uON$react.useRef)(null);
|
|
284
|
-
let popoverRef = (0, $56uON$react.useRef)(null);
|
|
285
|
-
let listBoxRef = (0, $56uON$react.useRef)(null);
|
|
286
|
-
let isLoading = loadingState === 'loading' || loadingState === 'loadingMore';
|
|
287
|
-
let layout = (0, $56uON$reactspectrumlistbox.useListBoxLayout)();
|
|
288
|
-
let stringFormatter = (0, $56uON$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($e32120882142a69f$exports))), '@react-spectrum/autocomplete');
|
|
289
|
-
let { inputProps: inputProps, listBoxProps: listBoxProps, labelProps: labelProps, clearButtonProps: clearButtonProps } = (0, $56uON$reactariaautocomplete.useSearchAutocomplete)({
|
|
290
|
-
...props,
|
|
291
|
-
layoutDelegate: layout,
|
|
292
|
-
popoverRef: popoverRef,
|
|
293
|
-
listBoxRef: listBoxRef,
|
|
294
|
-
inputRef: inputRef,
|
|
295
|
-
// Handled outside the tray.
|
|
296
|
-
name: undefined
|
|
297
|
-
}, state);
|
|
298
|
-
(0, ($parcel$interopDefault($56uON$react))).useEffect(()=>{
|
|
299
|
-
if (inputRef.current) (0, $56uON$reactariainteractions.focusSafely)(inputRef.current);
|
|
300
|
-
}, []);
|
|
301
|
-
(0, ($parcel$interopDefault($56uON$react))).useEffect(()=>{
|
|
302
|
-
// When the tray closes, set state.isFocused (i.e. the tray input's focus tracker) to false.
|
|
303
|
-
// This is to prevent state.isFocused from being set to true when the tray closes via tapping on the underlay
|
|
304
|
-
// (FocusScope attempts to restore focus to the tray input when tapping outside the tray due to "contain")
|
|
305
|
-
// Have to do this manually since React doesn't call onBlur when a component is unmounted: https://github.com/facebook/react/issues/12363
|
|
306
|
-
if (!state.isOpen && state.isFocused) state.setFocused(false);
|
|
307
|
-
});
|
|
308
|
-
let { dialogProps: dialogProps } = (0, $56uON$reactariadialog.useDialog)({
|
|
309
|
-
'aria-labelledby': (0, $56uON$reactariautils.useId)(labelProps.id)
|
|
310
|
-
}, popoverRef);
|
|
311
|
-
// Override the role of the input to "searchbox" instead of "combobox".
|
|
312
|
-
// Since the listbox is always visible, the combobox role doesn't really give us anything.
|
|
313
|
-
// VoiceOver on iOS reads "double tap to collapse" when focused on the input rather than
|
|
314
|
-
// "double tap to edit text", as with a textbox or searchbox. We'd like double tapping to
|
|
315
|
-
// open the virtual keyboard rather than closing the tray.
|
|
316
|
-
inputProps.role = 'searchbox';
|
|
317
|
-
inputProps['aria-haspopup'] = 'listbox';
|
|
318
|
-
delete inputProps.onTouchEnd;
|
|
319
|
-
let clearButton = /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).createElement((0, $56uON$reactspectrumbutton.ClearButton), {
|
|
320
|
-
...clearButtonProps,
|
|
321
|
-
preventFocus: true,
|
|
322
|
-
"aria-label": stringFormatter.format('clear'),
|
|
323
|
-
excludeFromTabOrder: true,
|
|
324
|
-
UNSAFE_className: (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($1e139f06a0a4b696$exports))), 'spectrum-ClearButton'),
|
|
325
|
-
isDisabled: isDisabled
|
|
326
|
-
});
|
|
327
|
-
let loadingCircle = /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).createElement((0, $56uON$reactspectrumprogress.ProgressCircle), {
|
|
328
|
-
"aria-label": stringFormatter.format('loading'),
|
|
329
|
-
size: "S",
|
|
330
|
-
isIndeterminate: true,
|
|
331
|
-
UNSAFE_className: (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($1e139f06a0a4b696$exports))), 'spectrum-Search-circleLoader', (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($40cb3a00c193680f$exports))), 'spectrum-Textfield-circleLoader'))
|
|
332
|
-
});
|
|
333
|
-
// Close the software keyboard on scroll to give the user a bigger area to scroll.
|
|
334
|
-
// But only do this if scrolling with touch, otherwise it can cause issues with touch
|
|
335
|
-
// screen readers.
|
|
336
|
-
let isTouchDown = (0, $56uON$react.useRef)(false);
|
|
337
|
-
let onTouchStart = ()=>{
|
|
338
|
-
isTouchDown.current = true;
|
|
339
|
-
};
|
|
340
|
-
let onTouchEnd = ()=>{
|
|
341
|
-
isTouchDown.current = false;
|
|
342
|
-
};
|
|
343
|
-
let onScroll = (0, $56uON$react.useCallback)(()=>{
|
|
344
|
-
if (!inputRef.current || document.activeElement !== inputRef.current || !isTouchDown.current) return;
|
|
345
|
-
if (popoverRef.current) popoverRef.current.focus();
|
|
346
|
-
}, [
|
|
347
|
-
inputRef,
|
|
348
|
-
popoverRef,
|
|
349
|
-
isTouchDown
|
|
350
|
-
]);
|
|
351
|
-
let inputValue = inputProps.value;
|
|
352
|
-
let lastInputValue = (0, $56uON$react.useRef)(inputValue);
|
|
353
|
-
(0, $56uON$react.useEffect)(()=>{
|
|
354
|
-
if (loadingState === 'filtering' && !showLoading) {
|
|
355
|
-
if (timeout.current === null) timeout.current = setTimeout(()=>{
|
|
356
|
-
setShowLoading(true);
|
|
357
|
-
}, 500);
|
|
358
|
-
// If user is typing, clear the timer and restart since it is a new request
|
|
359
|
-
if (inputValue !== lastInputValue.current) {
|
|
360
|
-
clearTimeout(timeout.current);
|
|
361
|
-
timeout.current = setTimeout(()=>{
|
|
362
|
-
setShowLoading(true);
|
|
363
|
-
}, 500);
|
|
364
|
-
}
|
|
365
|
-
} else if (loadingState !== 'filtering') {
|
|
366
|
-
// If loading is no longer happening, clear any timers and hide the loading circle
|
|
367
|
-
setShowLoading(false);
|
|
368
|
-
if (timeout.current !== null) {
|
|
369
|
-
clearTimeout(timeout.current);
|
|
370
|
-
timeout.current = null;
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
lastInputValue.current = inputValue;
|
|
374
|
-
}, [
|
|
375
|
-
loadingState,
|
|
376
|
-
inputValue,
|
|
377
|
-
showLoading
|
|
378
|
-
]);
|
|
379
|
-
let onKeyDown = (e)=>{
|
|
380
|
-
// Close virtual keyboard, close tray, and fire onSubmit if user hits Enter w/o any focused options
|
|
381
|
-
if (e.key === 'Enter' && state.selectionManager.focusedKey == null) {
|
|
382
|
-
var _popoverRef_current;
|
|
383
|
-
(_popoverRef_current = popoverRef.current) === null || _popoverRef_current === void 0 ? void 0 : _popoverRef_current.focus();
|
|
384
|
-
if (onClose) onClose();
|
|
385
|
-
if (onSubmit) onSubmit(inputValue == null ? null : inputValue.toString(), null);
|
|
386
|
-
} else if (inputProps.onKeyDown) inputProps.onKeyDown(e);
|
|
387
|
-
};
|
|
388
|
-
if (icon) icon = /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).cloneElement(icon, {
|
|
389
|
-
UNSAFE_className: (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($40cb3a00c193680f$exports))), 'spectrum-Textfield-icon'),
|
|
390
|
-
size: 'S'
|
|
391
|
-
});
|
|
392
|
-
return /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).createElement((0, $56uON$reactariafocus.FocusScope), {
|
|
393
|
-
restoreFocus: true,
|
|
394
|
-
contain: true
|
|
395
|
-
}, /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).createElement("div", {
|
|
396
|
-
...(0, $56uON$reactariautils.mergeProps)(overlayProps, dialogProps),
|
|
397
|
-
ref: popoverRef,
|
|
398
|
-
className: (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($83da5c2df967875d$exports))), 'tray-dialog')
|
|
399
|
-
}, /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).createElement((0, $56uON$reactariaoverlays.DismissButton), {
|
|
400
|
-
onDismiss: onClose
|
|
401
|
-
}), /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).createElement((0, $56uON$reactspectrumtextfield.TextFieldBase), {
|
|
402
|
-
label: label,
|
|
403
|
-
labelProps: labelProps,
|
|
404
|
-
inputProps: {
|
|
405
|
-
...inputProps,
|
|
406
|
-
onKeyDown: onKeyDown
|
|
407
|
-
},
|
|
408
|
-
inputRef: inputRef,
|
|
409
|
-
isDisabled: isDisabled,
|
|
410
|
-
isLoading: showLoading && loadingState === 'filtering',
|
|
411
|
-
loadingIndicator: loadingState != null ? loadingCircle : undefined,
|
|
412
|
-
validationState: validationState,
|
|
413
|
-
wrapperChildren: (state.inputValue !== '' || loadingState === 'filtering' || validationState != null) && !props.isReadOnly ? clearButton : undefined,
|
|
414
|
-
icon: icon,
|
|
415
|
-
UNSAFE_className: (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($1e139f06a0a4b696$exports))), 'spectrum-Search', 'spectrum-Textfield', 'spectrum-Search--loadable', {
|
|
416
|
-
'spectrum-Search--invalid': validationState === 'invalid' && !isDisabled,
|
|
417
|
-
'spectrum-Search--valid': validationState === 'valid' && !isDisabled
|
|
418
|
-
}, (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($83da5c2df967875d$exports))), 'tray-textfield', {
|
|
419
|
-
'has-label': !!props.label
|
|
420
|
-
})),
|
|
421
|
-
inputClassName: (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($1e139f06a0a4b696$exports))), 'spectrum-Search-input'),
|
|
422
|
-
validationIconClassName: (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($1e139f06a0a4b696$exports))), 'spectrum-Search-validationIcon')
|
|
423
|
-
}), /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).createElement((0, $56uON$reactspectrumlistbox.ListBoxBase), {
|
|
424
|
-
...listBoxProps,
|
|
425
|
-
domProps: {
|
|
426
|
-
onTouchStart: onTouchStart,
|
|
427
|
-
onTouchEnd: onTouchEnd
|
|
428
|
-
},
|
|
429
|
-
disallowEmptySelection: true,
|
|
430
|
-
shouldSelectOnPressUp: true,
|
|
431
|
-
focusOnPointerEnter: true,
|
|
432
|
-
layout: layout,
|
|
433
|
-
state: state,
|
|
434
|
-
shouldUseVirtualFocus: true,
|
|
435
|
-
renderEmptyState: ()=>loadingState !== 'loading' && /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).createElement("span", {
|
|
436
|
-
className: (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($83da5c2df967875d$exports))), 'no-results')
|
|
437
|
-
}, stringFormatter.format('noResults')),
|
|
438
|
-
UNSAFE_className: (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($83da5c2df967875d$exports))), 'tray-listbox'),
|
|
439
|
-
ref: listBoxRef,
|
|
440
|
-
onScroll: onScroll,
|
|
441
|
-
onLoadMore: onLoadMore,
|
|
442
|
-
isLoading: isLoading
|
|
443
|
-
}), /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).createElement((0, $56uON$reactariaoverlays.DismissButton), {
|
|
444
|
-
onDismiss: onClose
|
|
445
|
-
})));
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
//# sourceMappingURL=MobileSearchAutocomplete.main.js.map
|