@react-spectrum/autocomplete 3.0.0-alpha.11 → 3.0.0-alpha.13
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/main.css +1 -1
- package/dist/main.js +294 -278
- package/dist/main.js.map +1 -1
- package/dist/module.js +294 -278
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +28 -28
- package/src/MobileSearchAutocomplete.tsx +65 -43
- package/src/SearchAutocomplete.tsx +52 -48
- package/src/searchautocomplete.css +6 -0
package/dist/module.js
CHANGED
|
@@ -2,7 +2,6 @@ import "./main.css";
|
|
|
2
2
|
import {Item as $dc667e3abdbeb6b2$re_export$Item, Section as $dc667e3abdbeb6b2$re_export$Section} from "@react-stately/collections";
|
|
3
3
|
import {useIsMobileDevice as $aQREU$useIsMobileDevice, useUnwrapDOMRef as $aQREU$useUnwrapDOMRef, useFocusableRef as $aQREU$useFocusableRef, useResizeObserver as $aQREU$useResizeObserver, classNames as $aQREU$classNames} from "@react-spectrum/utils";
|
|
4
4
|
import {ClearButton as $aQREU$ClearButton} from "@react-spectrum/button";
|
|
5
|
-
import {useOverlayPosition as $aQREU$useOverlayPosition, DismissButton as $aQREU$DismissButton, useOverlayTrigger as $aQREU$useOverlayTrigger} from "@react-aria/overlays";
|
|
6
5
|
import {Field as $aQREU$Field} from "@react-spectrum/label";
|
|
7
6
|
import {FocusRing as $aQREU$FocusRing, useFocusRing as $aQREU$useFocusRing, focusSafely as $aQREU$focusSafely, FocusScope as $aQREU$FocusScope} from "@react-aria/focus";
|
|
8
7
|
import {useListBoxLayout as $aQREU$useListBoxLayout, ListBoxBase as $aQREU$ListBoxBase} from "@react-spectrum/listbox";
|
|
@@ -19,6 +18,7 @@ import {useProviderProps as $aQREU$useProviderProps, useProvider as $aQREU$usePr
|
|
|
19
18
|
import {useSearchAutocomplete as $aQREU$useSearchAutocomplete} from "@react-aria/autocomplete";
|
|
20
19
|
import $aQREU$spectrumiconsuiAlertMedium from "@spectrum-icons/ui/AlertMedium";
|
|
21
20
|
import $aQREU$spectrumiconsuiCheckmarkMedium from "@spectrum-icons/ui/CheckmarkMedium";
|
|
21
|
+
import {useOverlayTrigger as $aQREU$useOverlayTrigger, DismissButton as $aQREU$DismissButton} from "@react-aria/overlays";
|
|
22
22
|
import {useButton as $aQREU$useButton} from "@react-aria/button";
|
|
23
23
|
import {useDialog as $aQREU$useDialog} from "@react-aria/dialog";
|
|
24
24
|
import {useLabel as $aQREU$useLabel} from "@react-aria/label";
|
|
@@ -29,8 +29,28 @@ function $parcel$interopDefault(a) {
|
|
|
29
29
|
function $parcel$export(e, n, v, s) {
|
|
30
30
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
31
31
|
}
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
/*
|
|
33
|
+
* Copyright 2021 Adobe. All rights reserved.
|
|
34
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
35
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
36
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
37
|
+
*
|
|
38
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
39
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
40
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
41
|
+
* governing permissions and limitations under the License.
|
|
42
|
+
*/ /// <reference types="css-module-types" />
|
|
43
|
+
/*
|
|
44
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
45
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
46
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
47
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
48
|
+
*
|
|
49
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
50
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
51
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
52
|
+
* governing permissions and limitations under the License.
|
|
53
|
+
*/
|
|
34
54
|
|
|
35
55
|
|
|
36
56
|
|
|
@@ -381,7 +401,17 @@ $06f6e8ce74a28744$exports = {
|
|
|
381
401
|
|
|
382
402
|
|
|
383
403
|
|
|
384
|
-
|
|
404
|
+
/*
|
|
405
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
406
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
407
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
408
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
409
|
+
*
|
|
410
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
411
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
412
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
413
|
+
* governing permissions and limitations under the License.
|
|
414
|
+
*/
|
|
385
415
|
|
|
386
416
|
|
|
387
417
|
|
|
@@ -399,6 +429,7 @@ $06f6e8ce74a28744$exports = {
|
|
|
399
429
|
var $f6bdc9f20ce7ef93$exports = {};
|
|
400
430
|
|
|
401
431
|
$parcel$export($f6bdc9f20ce7ef93$exports, "no-results", () => $f6bdc9f20ce7ef93$export$5b1939da91820a47, (v) => $f6bdc9f20ce7ef93$export$5b1939da91820a47 = v);
|
|
432
|
+
$parcel$export($f6bdc9f20ce7ef93$exports, "searchautocomplete", () => $f6bdc9f20ce7ef93$export$5096a212edbce2e8, (v) => $f6bdc9f20ce7ef93$export$5096a212edbce2e8 = v);
|
|
402
433
|
$parcel$export($f6bdc9f20ce7ef93$exports, "mobile-searchautocomplete", () => $f6bdc9f20ce7ef93$export$3117ea626976198e, (v) => $f6bdc9f20ce7ef93$export$3117ea626976198e = v);
|
|
403
434
|
$parcel$export($f6bdc9f20ce7ef93$exports, "mobile-input", () => $f6bdc9f20ce7ef93$export$bededa1c0ac414c5, (v) => $f6bdc9f20ce7ef93$export$bededa1c0ac414c5 = v);
|
|
404
435
|
$parcel$export($f6bdc9f20ce7ef93$exports, "mobile-value", () => $f6bdc9f20ce7ef93$export$e32ca2bb9f795355, (v) => $f6bdc9f20ce7ef93$export$e32ca2bb9f795355 = v);
|
|
@@ -408,6 +439,7 @@ $parcel$export($f6bdc9f20ce7ef93$exports, "has-label", () => $f6bdc9f20ce7ef93$e
|
|
|
408
439
|
$parcel$export($f6bdc9f20ce7ef93$exports, "tray-textfield-input", () => $f6bdc9f20ce7ef93$export$feb70b7bc717e2b8, (v) => $f6bdc9f20ce7ef93$export$feb70b7bc717e2b8 = v);
|
|
409
440
|
$parcel$export($f6bdc9f20ce7ef93$exports, "tray-listbox", () => $f6bdc9f20ce7ef93$export$7281dc54d38d4bed, (v) => $f6bdc9f20ce7ef93$export$7281dc54d38d4bed = v);
|
|
410
441
|
var $f6bdc9f20ce7ef93$export$5b1939da91820a47;
|
|
442
|
+
var $f6bdc9f20ce7ef93$export$5096a212edbce2e8;
|
|
411
443
|
var $f6bdc9f20ce7ef93$export$3117ea626976198e;
|
|
412
444
|
var $f6bdc9f20ce7ef93$export$bededa1c0ac414c5;
|
|
413
445
|
var $f6bdc9f20ce7ef93$export$e32ca2bb9f795355;
|
|
@@ -417,6 +449,7 @@ var $f6bdc9f20ce7ef93$export$b8e014ff9ad5e5e2;
|
|
|
417
449
|
var $f6bdc9f20ce7ef93$export$feb70b7bc717e2b8;
|
|
418
450
|
var $f6bdc9f20ce7ef93$export$7281dc54d38d4bed;
|
|
419
451
|
$f6bdc9f20ce7ef93$export$5b1939da91820a47 = "no-results_83bf62";
|
|
452
|
+
$f6bdc9f20ce7ef93$export$5096a212edbce2e8 = "searchautocomplete_83bf62";
|
|
420
453
|
$f6bdc9f20ce7ef93$export$3117ea626976198e = "mobile-searchautocomplete_83bf62";
|
|
421
454
|
$f6bdc9f20ce7ef93$export$bededa1c0ac414c5 = "mobile-input_83bf62";
|
|
422
455
|
$f6bdc9f20ce7ef93$export$e32ca2bb9f795355 = "mobile-value_83bf62";
|
|
@@ -465,10 +498,11 @@ $5589e2270a5c2f51$export$2c8a10299d8b3418 = "spectrum-Textfield_d3c0f3";
|
|
|
465
498
|
var $8fb52a80fe52b1c7$exports = {};
|
|
466
499
|
|
|
467
500
|
$parcel$export($8fb52a80fe52b1c7$exports, "spectrum-InputGroup", () => $8fb52a80fe52b1c7$export$5be359c1227eedcb, (v) => $8fb52a80fe52b1c7$export$5be359c1227eedcb = v);
|
|
501
|
+
$parcel$export($8fb52a80fe52b1c7$exports, "focus-ring", () => $8fb52a80fe52b1c7$export$f39a09f249340e2a, (v) => $8fb52a80fe52b1c7$export$f39a09f249340e2a = v);
|
|
502
|
+
$parcel$export($8fb52a80fe52b1c7$exports, "spectrum-InputGroup--quiet", () => $8fb52a80fe52b1c7$export$ebf265ffc062029b, (v) => $8fb52a80fe52b1c7$export$ebf265ffc062029b = v);
|
|
468
503
|
$parcel$export($8fb52a80fe52b1c7$exports, "spectrum-FieldButton", () => $8fb52a80fe52b1c7$export$a024c99ecf6b5741, (v) => $8fb52a80fe52b1c7$export$a024c99ecf6b5741 = v);
|
|
469
504
|
$parcel$export($8fb52a80fe52b1c7$exports, "is-disabled", () => $8fb52a80fe52b1c7$export$d35bc1e505d1ebbf, (v) => $8fb52a80fe52b1c7$export$d35bc1e505d1ebbf = v);
|
|
470
505
|
$parcel$export($8fb52a80fe52b1c7$exports, "spectrum-InputGroup--invalid", () => $8fb52a80fe52b1c7$export$3b48509739a9cda0, (v) => $8fb52a80fe52b1c7$export$3b48509739a9cda0 = v);
|
|
471
|
-
$parcel$export($8fb52a80fe52b1c7$exports, "spectrum-InputGroup--quiet", () => $8fb52a80fe52b1c7$export$ebf265ffc062029b, (v) => $8fb52a80fe52b1c7$export$ebf265ffc062029b = v);
|
|
472
506
|
$parcel$export($8fb52a80fe52b1c7$exports, "spectrum-InputGroup-field", () => $8fb52a80fe52b1c7$export$ea77459595e26bec, (v) => $8fb52a80fe52b1c7$export$ea77459595e26bec = v);
|
|
473
507
|
$parcel$export($8fb52a80fe52b1c7$exports, "spectrum-InputGroup-input-validationIcon", () => $8fb52a80fe52b1c7$export$f7ab13ee113f4884, (v) => $8fb52a80fe52b1c7$export$f7ab13ee113f4884 = v);
|
|
474
508
|
$parcel$export($8fb52a80fe52b1c7$exports, "spectrum-InputGroup-input-circleLoader", () => $8fb52a80fe52b1c7$export$dcc9e00cdad967fa, (v) => $8fb52a80fe52b1c7$export$dcc9e00cdad967fa = v);
|
|
@@ -483,14 +517,14 @@ $parcel$export($8fb52a80fe52b1c7$exports, "spectrum-Datepicker--rangeDash", () =
|
|
|
483
517
|
$parcel$export($8fb52a80fe52b1c7$exports, "is-focused", () => $8fb52a80fe52b1c7$export$e7dc768d35940237, (v) => $8fb52a80fe52b1c7$export$e7dc768d35940237 = v);
|
|
484
518
|
$parcel$export($8fb52a80fe52b1c7$exports, "spectrum-Datepicker-focusRing", () => $8fb52a80fe52b1c7$export$eb262b15b9261fde, (v) => $8fb52a80fe52b1c7$export$eb262b15b9261fde = v);
|
|
485
519
|
$parcel$export($8fb52a80fe52b1c7$exports, "is-hovered", () => $8fb52a80fe52b1c7$export$b8813cd5d7824ce7, (v) => $8fb52a80fe52b1c7$export$b8813cd5d7824ce7 = v);
|
|
486
|
-
$parcel$export($8fb52a80fe52b1c7$exports, "focus-ring", () => $8fb52a80fe52b1c7$export$f39a09f249340e2a, (v) => $8fb52a80fe52b1c7$export$f39a09f249340e2a = v);
|
|
487
520
|
$parcel$export($8fb52a80fe52b1c7$exports, "is-selected", () => $8fb52a80fe52b1c7$export$1e0fb04f31d3c22a, (v) => $8fb52a80fe52b1c7$export$1e0fb04f31d3c22a = v);
|
|
488
521
|
$parcel$export($8fb52a80fe52b1c7$exports, "spectrum-FieldButton--invalid", () => $8fb52a80fe52b1c7$export$c9f503f672e8a3c1, (v) => $8fb52a80fe52b1c7$export$c9f503f672e8a3c1 = v);
|
|
489
522
|
var $8fb52a80fe52b1c7$export$5be359c1227eedcb;
|
|
523
|
+
var $8fb52a80fe52b1c7$export$f39a09f249340e2a;
|
|
524
|
+
var $8fb52a80fe52b1c7$export$ebf265ffc062029b;
|
|
490
525
|
var $8fb52a80fe52b1c7$export$a024c99ecf6b5741;
|
|
491
526
|
var $8fb52a80fe52b1c7$export$d35bc1e505d1ebbf;
|
|
492
527
|
var $8fb52a80fe52b1c7$export$3b48509739a9cda0;
|
|
493
|
-
var $8fb52a80fe52b1c7$export$ebf265ffc062029b;
|
|
494
528
|
var $8fb52a80fe52b1c7$export$ea77459595e26bec;
|
|
495
529
|
var $8fb52a80fe52b1c7$export$f7ab13ee113f4884;
|
|
496
530
|
var $8fb52a80fe52b1c7$export$dcc9e00cdad967fa;
|
|
@@ -505,14 +539,14 @@ var $8fb52a80fe52b1c7$export$202113e883898dc;
|
|
|
505
539
|
var $8fb52a80fe52b1c7$export$e7dc768d35940237;
|
|
506
540
|
var $8fb52a80fe52b1c7$export$eb262b15b9261fde;
|
|
507
541
|
var $8fb52a80fe52b1c7$export$b8813cd5d7824ce7;
|
|
508
|
-
var $8fb52a80fe52b1c7$export$f39a09f249340e2a;
|
|
509
542
|
var $8fb52a80fe52b1c7$export$1e0fb04f31d3c22a;
|
|
510
543
|
var $8fb52a80fe52b1c7$export$c9f503f672e8a3c1;
|
|
511
544
|
$8fb52a80fe52b1c7$export$5be359c1227eedcb = "spectrum-InputGroup_a0942f";
|
|
545
|
+
$8fb52a80fe52b1c7$export$f39a09f249340e2a = "focus-ring_a0942f";
|
|
546
|
+
$8fb52a80fe52b1c7$export$ebf265ffc062029b = "spectrum-InputGroup--quiet_a0942f";
|
|
512
547
|
$8fb52a80fe52b1c7$export$a024c99ecf6b5741 = "spectrum-FieldButton_a0942f";
|
|
513
548
|
$8fb52a80fe52b1c7$export$d35bc1e505d1ebbf = "is-disabled_a0942f";
|
|
514
549
|
$8fb52a80fe52b1c7$export$3b48509739a9cda0 = "spectrum-InputGroup--invalid_a0942f";
|
|
515
|
-
$8fb52a80fe52b1c7$export$ebf265ffc062029b = "spectrum-InputGroup--quiet_a0942f";
|
|
516
550
|
$8fb52a80fe52b1c7$export$ea77459595e26bec = "spectrum-InputGroup-field_a0942f";
|
|
517
551
|
$8fb52a80fe52b1c7$export$f7ab13ee113f4884 = "spectrum-InputGroup-input-validationIcon_a0942f";
|
|
518
552
|
$8fb52a80fe52b1c7$export$dcc9e00cdad967fa = "spectrum-InputGroup-input-circleLoader_a0942f";
|
|
@@ -527,7 +561,6 @@ $8fb52a80fe52b1c7$export$202113e883898dc = "spectrum-Datepicker--rangeDash_a0942
|
|
|
527
561
|
$8fb52a80fe52b1c7$export$e7dc768d35940237 = "is-focused_a0942f";
|
|
528
562
|
$8fb52a80fe52b1c7$export$eb262b15b9261fde = "spectrum-Datepicker-focusRing_a0942f";
|
|
529
563
|
$8fb52a80fe52b1c7$export$b8813cd5d7824ce7 = "is-hovered_a0942f";
|
|
530
|
-
$8fb52a80fe52b1c7$export$f39a09f249340e2a = "focus-ring_a0942f";
|
|
531
564
|
$8fb52a80fe52b1c7$export$1e0fb04f31d3c22a = "is-selected_a0942f";
|
|
532
565
|
$8fb52a80fe52b1c7$export$c9f503f672e8a3c1 = "spectrum-FieldButton--invalid_a0942f";
|
|
533
566
|
|
|
@@ -537,6 +570,7 @@ var $c14528ddc146317f$exports = {};
|
|
|
537
570
|
|
|
538
571
|
$parcel$export($c14528ddc146317f$exports, "spectrum-Textfield-input", () => $c14528ddc146317f$export$1ac009feb2b0bd0c, (v) => $c14528ddc146317f$export$1ac009feb2b0bd0c = v);
|
|
539
572
|
$parcel$export($c14528ddc146317f$exports, "spectrum-Textfield", () => $c14528ddc146317f$export$2c8a10299d8b3418, (v) => $c14528ddc146317f$export$2c8a10299d8b3418 = v);
|
|
573
|
+
$parcel$export($c14528ddc146317f$exports, "focus-ring", () => $c14528ddc146317f$export$f39a09f249340e2a, (v) => $c14528ddc146317f$export$f39a09f249340e2a = v);
|
|
540
574
|
$parcel$export($c14528ddc146317f$exports, "spectrum-Textfield--quiet", () => $c14528ddc146317f$export$bffd5e3d61a81737, (v) => $c14528ddc146317f$export$bffd5e3d61a81737 = v);
|
|
541
575
|
$parcel$export($c14528ddc146317f$exports, "spectrum-Textfield--multiline", () => $c14528ddc146317f$export$9699f1c538a448a0, (v) => $c14528ddc146317f$export$9699f1c538a448a0 = v);
|
|
542
576
|
$parcel$export($c14528ddc146317f$exports, "is-placeholder", () => $c14528ddc146317f$export$e5b2f5233e4e5194, (v) => $c14528ddc146317f$export$e5b2f5233e4e5194 = v);
|
|
@@ -545,15 +579,16 @@ $parcel$export($c14528ddc146317f$exports, "spectrum-Textfield--valid", () => $c1
|
|
|
545
579
|
$parcel$export($c14528ddc146317f$exports, "spectrum-Textfield--invalid", () => $c14528ddc146317f$export$58e50b10d30123df, (v) => $c14528ddc146317f$export$58e50b10d30123df = v);
|
|
546
580
|
$parcel$export($c14528ddc146317f$exports, "spectrum-Textfield--loadable", () => $c14528ddc146317f$export$14fd30fea6f1348c, (v) => $c14528ddc146317f$export$14fd30fea6f1348c = v);
|
|
547
581
|
$parcel$export($c14528ddc146317f$exports, "spectrum-Textfield-wrapper", () => $c14528ddc146317f$export$dd1165e0e6012973, (v) => $c14528ddc146317f$export$dd1165e0e6012973 = v);
|
|
582
|
+
$parcel$export($c14528ddc146317f$exports, "spectrum-Textfield-wrapper--quiet", () => $c14528ddc146317f$export$9fcb3d6af94a9d12, (v) => $c14528ddc146317f$export$9fcb3d6af94a9d12 = v);
|
|
548
583
|
$parcel$export($c14528ddc146317f$exports, "spectrum-Textfield-validationIcon", () => $c14528ddc146317f$export$cf0ead5b44db0da3, (v) => $c14528ddc146317f$export$cf0ead5b44db0da3 = v);
|
|
549
584
|
$parcel$export($c14528ddc146317f$exports, "spectrum-Textfield-icon", () => $c14528ddc146317f$export$222d1ccd1870be1d, (v) => $c14528ddc146317f$export$222d1ccd1870be1d = v);
|
|
550
585
|
$parcel$export($c14528ddc146317f$exports, "spectrum-Textfield-inputIcon", () => $c14528ddc146317f$export$c1cdcaa5fe76a871, (v) => $c14528ddc146317f$export$c1cdcaa5fe76a871 = v);
|
|
551
586
|
$parcel$export($c14528ddc146317f$exports, "spectrum-Textfield-circleLoader", () => $c14528ddc146317f$export$82a249fb4d6127, (v) => $c14528ddc146317f$export$82a249fb4d6127 = v);
|
|
552
587
|
$parcel$export($c14528ddc146317f$exports, "is-focused", () => $c14528ddc146317f$export$e7dc768d35940237, (v) => $c14528ddc146317f$export$e7dc768d35940237 = v);
|
|
553
|
-
$parcel$export($c14528ddc146317f$exports, "focus-ring", () => $c14528ddc146317f$export$f39a09f249340e2a, (v) => $c14528ddc146317f$export$f39a09f249340e2a = v);
|
|
554
588
|
$parcel$export($c14528ddc146317f$exports, "is-disabled", () => $c14528ddc146317f$export$d35bc1e505d1ebbf, (v) => $c14528ddc146317f$export$d35bc1e505d1ebbf = v);
|
|
555
589
|
var $c14528ddc146317f$export$1ac009feb2b0bd0c;
|
|
556
590
|
var $c14528ddc146317f$export$2c8a10299d8b3418;
|
|
591
|
+
var $c14528ddc146317f$export$f39a09f249340e2a;
|
|
557
592
|
var $c14528ddc146317f$export$bffd5e3d61a81737;
|
|
558
593
|
var $c14528ddc146317f$export$9699f1c538a448a0;
|
|
559
594
|
var $c14528ddc146317f$export$e5b2f5233e4e5194;
|
|
@@ -562,15 +597,16 @@ var $c14528ddc146317f$export$c2abbc3f970170b7;
|
|
|
562
597
|
var $c14528ddc146317f$export$58e50b10d30123df;
|
|
563
598
|
var $c14528ddc146317f$export$14fd30fea6f1348c;
|
|
564
599
|
var $c14528ddc146317f$export$dd1165e0e6012973;
|
|
600
|
+
var $c14528ddc146317f$export$9fcb3d6af94a9d12;
|
|
565
601
|
var $c14528ddc146317f$export$cf0ead5b44db0da3;
|
|
566
602
|
var $c14528ddc146317f$export$222d1ccd1870be1d;
|
|
567
603
|
var $c14528ddc146317f$export$c1cdcaa5fe76a871;
|
|
568
604
|
var $c14528ddc146317f$export$82a249fb4d6127;
|
|
569
605
|
var $c14528ddc146317f$export$e7dc768d35940237;
|
|
570
|
-
var $c14528ddc146317f$export$f39a09f249340e2a;
|
|
571
606
|
var $c14528ddc146317f$export$d35bc1e505d1ebbf;
|
|
572
607
|
$c14528ddc146317f$export$1ac009feb2b0bd0c = "spectrum-Textfield-input_73bc77";
|
|
573
608
|
$c14528ddc146317f$export$2c8a10299d8b3418 = "spectrum-Textfield_73bc77";
|
|
609
|
+
$c14528ddc146317f$export$f39a09f249340e2a = "focus-ring_73bc77";
|
|
574
610
|
$c14528ddc146317f$export$bffd5e3d61a81737 = "spectrum-Textfield--quiet_73bc77";
|
|
575
611
|
$c14528ddc146317f$export$9699f1c538a448a0 = "spectrum-Textfield--multiline_73bc77";
|
|
576
612
|
$c14528ddc146317f$export$e5b2f5233e4e5194 = "is-placeholder_73bc77";
|
|
@@ -579,12 +615,12 @@ $c14528ddc146317f$export$c2abbc3f970170b7 = "spectrum-Textfield--valid_73bc77";
|
|
|
579
615
|
$c14528ddc146317f$export$58e50b10d30123df = "spectrum-Textfield--invalid_73bc77";
|
|
580
616
|
$c14528ddc146317f$export$14fd30fea6f1348c = "spectrum-Textfield--loadable_73bc77";
|
|
581
617
|
$c14528ddc146317f$export$dd1165e0e6012973 = "spectrum-Textfield-wrapper_73bc77";
|
|
618
|
+
$c14528ddc146317f$export$9fcb3d6af94a9d12 = "spectrum-Textfield-wrapper--quiet_73bc77";
|
|
582
619
|
$c14528ddc146317f$export$cf0ead5b44db0da3 = "spectrum-Textfield-validationIcon_73bc77";
|
|
583
620
|
$c14528ddc146317f$export$222d1ccd1870be1d = "spectrum-Textfield-icon_73bc77";
|
|
584
621
|
$c14528ddc146317f$export$c1cdcaa5fe76a871 = "spectrum-Textfield-inputIcon_73bc77";
|
|
585
622
|
$c14528ddc146317f$export$82a249fb4d6127 = "spectrum-Textfield-circleLoader_73bc77";
|
|
586
623
|
$c14528ddc146317f$export$e7dc768d35940237 = "is-focused_73bc77";
|
|
587
|
-
$c14528ddc146317f$export$f39a09f249340e2a = "focus-ring_73bc77";
|
|
588
624
|
$c14528ddc146317f$export$d35bc1e505d1ebbf = "is-disabled_73bc77";
|
|
589
625
|
|
|
590
626
|
|
|
@@ -597,14 +633,13 @@ $c14528ddc146317f$export$d35bc1e505d1ebbf = "is-disabled_73bc77";
|
|
|
597
633
|
|
|
598
634
|
|
|
599
635
|
|
|
600
|
-
|
|
601
|
-
props = $aQREU$useProviderProps(props);
|
|
602
|
-
let { isQuiet: isQuiet , isDisabled: isDisabled , validationState: validationState , isReadOnly: isReadOnly , onSubmit: onSubmit = ()=>{
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
sensitivity: 'base'
|
|
636
|
+
function $c940f54e16bafef5$var$_MobileSearchAutocomplete(props, ref) {
|
|
637
|
+
props = (0, $aQREU$useProviderProps)(props);
|
|
638
|
+
let { isQuiet: isQuiet , isDisabled: isDisabled , validationState: validationState , isReadOnly: isReadOnly , onSubmit: onSubmit = ()=>{} } = props;
|
|
639
|
+
let { contains: contains } = (0, $aQREU$useFilter)({
|
|
640
|
+
sensitivity: "base"
|
|
606
641
|
});
|
|
607
|
-
let state = $aQREU$useComboBoxState({
|
|
642
|
+
let state = (0, $aQREU$useComboBoxState)({
|
|
608
643
|
...props,
|
|
609
644
|
defaultFilter: contains,
|
|
610
645
|
allowsEmptyCollection: true,
|
|
@@ -613,37 +648,34 @@ const $c940f54e16bafef5$export$e7a90f7d6b078162 = /*#__PURE__*/ $aQREU$react.for
|
|
|
613
648
|
// then the closing of the tray will call setFocused(false) again due to cleanup effect)
|
|
614
649
|
shouldCloseOnBlur: false,
|
|
615
650
|
allowsCustomValue: true,
|
|
616
|
-
onSelectionChange: (key)=>key !== null && onSubmit(null, key)
|
|
617
|
-
,
|
|
651
|
+
onSelectionChange: (key)=>key !== null && onSubmit(null, key),
|
|
618
652
|
selectedKey: undefined,
|
|
619
653
|
defaultSelectedKey: undefined
|
|
620
654
|
});
|
|
621
|
-
let buttonRef = $aQREU$useRef();
|
|
622
|
-
let domRef = $aQREU$useFocusableRef(ref, buttonRef);
|
|
623
|
-
let { triggerProps: triggerProps , overlayProps: overlayProps } = $aQREU$useOverlayTrigger({
|
|
624
|
-
type:
|
|
655
|
+
let buttonRef = (0, $aQREU$useRef)(null);
|
|
656
|
+
let domRef = (0, $aQREU$useFocusableRef)(ref, buttonRef);
|
|
657
|
+
let { triggerProps: triggerProps , overlayProps: overlayProps } = (0, $aQREU$useOverlayTrigger)({
|
|
658
|
+
type: "listbox"
|
|
625
659
|
}, state, buttonRef);
|
|
626
|
-
let { labelProps: labelProps , fieldProps: fieldProps } = $aQREU$useLabel({
|
|
660
|
+
let { labelProps: labelProps , fieldProps: fieldProps } = (0, $aQREU$useLabel)({
|
|
627
661
|
...props,
|
|
628
|
-
labelElementType:
|
|
662
|
+
labelElementType: "span"
|
|
629
663
|
});
|
|
630
664
|
// Focus the button and show focus ring when clicking on the label
|
|
631
665
|
labelProps.onClick = ()=>{
|
|
632
|
-
if (!props.isDisabled) {
|
|
666
|
+
if (!props.isDisabled && buttonRef.current) {
|
|
633
667
|
buttonRef.current.focus();
|
|
634
|
-
$aQREU$setInteractionModality(
|
|
668
|
+
(0, $aQREU$setInteractionModality)("keyboard");
|
|
635
669
|
}
|
|
636
670
|
};
|
|
637
|
-
|
|
638
|
-
;
|
|
639
|
-
return(/*#__PURE__*/ $aQREU$react.createElement($aQREU$react.Fragment, null, /*#__PURE__*/ $aQREU$react.createElement($aQREU$Field, {
|
|
671
|
+
return /*#__PURE__*/ (0, $aQREU$react).createElement((0, $aQREU$react).Fragment, null, /*#__PURE__*/ (0, $aQREU$react).createElement((0, $aQREU$Field), {
|
|
640
672
|
...props,
|
|
641
673
|
labelProps: labelProps,
|
|
642
674
|
elementType: "span",
|
|
643
675
|
ref: domRef,
|
|
644
676
|
includeNecessityIndicatorInAccessibilityName: true
|
|
645
|
-
}, /*#__PURE__*/ $aQREU$react.createElement($c940f54e16bafef5$var$SearchAutocompleteButton, {
|
|
646
|
-
|
|
677
|
+
}, /*#__PURE__*/ (0, $aQREU$react).createElement($c940f54e16bafef5$var$SearchAutocompleteButton, {
|
|
678
|
+
...(0, $aQREU$mergeProps)(triggerProps, fieldProps, {
|
|
647
679
|
autoFocus: props.autoFocus,
|
|
648
680
|
icon: props.icon
|
|
649
681
|
}),
|
|
@@ -654,129 +686,128 @@ const $c940f54e16bafef5$export$e7a90f7d6b078162 = /*#__PURE__*/ $aQREU$react.for
|
|
|
654
686
|
isPlaceholder: !state.inputValue,
|
|
655
687
|
validationState: validationState,
|
|
656
688
|
inputValue: state.inputValue,
|
|
657
|
-
clearInput: ()=>state.setInputValue(
|
|
658
|
-
,
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
isOpen: state.isOpen,
|
|
662
|
-
onClose: onClose,
|
|
689
|
+
clearInput: ()=>state.setInputValue(""),
|
|
690
|
+
onPress: ()=>!isReadOnly && state.open(null, "manual")
|
|
691
|
+
}, state.inputValue || props.placeholder || "")), /*#__PURE__*/ (0, $aQREU$react).createElement((0, $aQREU$Tray), {
|
|
692
|
+
state: state,
|
|
663
693
|
isFixedHeight: true,
|
|
664
|
-
isNonModal: true,
|
|
665
694
|
...overlayProps
|
|
666
|
-
}, /*#__PURE__*/ $aQREU$react.createElement($c940f54e16bafef5$var$SearchAutocompleteTray, {
|
|
695
|
+
}, /*#__PURE__*/ (0, $aQREU$react).createElement($c940f54e16bafef5$var$SearchAutocompleteTray, {
|
|
667
696
|
...props,
|
|
668
|
-
onClose:
|
|
697
|
+
onClose: state.close,
|
|
669
698
|
overlayProps: overlayProps,
|
|
670
699
|
state: state
|
|
671
|
-
})))
|
|
672
|
-
}
|
|
673
|
-
|
|
674
|
-
|
|
700
|
+
})));
|
|
701
|
+
}
|
|
702
|
+
let $c940f54e16bafef5$export$e7a90f7d6b078162 = /*#__PURE__*/ (0, $aQREU$react).forwardRef($c940f54e16bafef5$var$_MobileSearchAutocomplete);
|
|
703
|
+
// any type is because we don't want to call useObjectRef because this is an internal component and we know
|
|
704
|
+
// we are always passing an object ref
|
|
705
|
+
const $c940f54e16bafef5$var$SearchAutocompleteButton = /*#__PURE__*/ (0, $aQREU$react).forwardRef(function SearchAutocompleteButton(props, ref) {
|
|
706
|
+
let searchIcon = /*#__PURE__*/ (0, $aQREU$react).createElement((0, $aQREU$spectrumiconsuiMagnifier), {
|
|
675
707
|
"data-testid": "searchicon"
|
|
676
708
|
});
|
|
677
709
|
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;
|
|
678
|
-
let stringFormatter = $aQREU$useLocalizedStringFormatter((/*@__PURE__*/$parcel$interopDefault($06f6e8ce74a28744$exports)));
|
|
679
|
-
let valueId = $aQREU$useId();
|
|
680
|
-
let invalidId = $aQREU$useId();
|
|
681
|
-
let validationIcon = validationState ===
|
|
710
|
+
let stringFormatter = (0, $aQREU$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($06f6e8ce74a28744$exports))));
|
|
711
|
+
let valueId = (0, $aQREU$useId)();
|
|
712
|
+
let invalidId = (0, $aQREU$useId)();
|
|
713
|
+
let validationIcon = validationState === "invalid" ? /*#__PURE__*/ (0, $aQREU$react).createElement((0, $aQREU$spectrumiconsuiAlertMedium), {
|
|
682
714
|
id: invalidId,
|
|
683
|
-
"aria-label": stringFormatter.format(
|
|
684
|
-
}) : /*#__PURE__*/ $aQREU$react.createElement($aQREU$spectrumiconsuiCheckmarkMedium, null);
|
|
685
|
-
if (icon) icon = /*#__PURE__*/ $aQREU$react.cloneElement(icon, {
|
|
686
|
-
UNSAFE_className: $aQREU$classNames((/*@__PURE__*/$parcel$interopDefault($c14528ddc146317f$exports)),
|
|
687
|
-
size:
|
|
715
|
+
"aria-label": stringFormatter.format("invalid")
|
|
716
|
+
}) : /*#__PURE__*/ (0, $aQREU$react).createElement((0, $aQREU$spectrumiconsuiCheckmarkMedium), null);
|
|
717
|
+
if (icon) icon = /*#__PURE__*/ (0, $aQREU$react).cloneElement(icon, {
|
|
718
|
+
UNSAFE_className: (0, $aQREU$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($c14528ddc146317f$exports))), "spectrum-Textfield-icon"),
|
|
719
|
+
size: "S"
|
|
688
720
|
});
|
|
689
|
-
let clearButton = /*#__PURE__*/ $aQREU$react.createElement($aQREU$ClearButton, {
|
|
721
|
+
let clearButton = /*#__PURE__*/ (0, $aQREU$react).createElement((0, $aQREU$ClearButton), {
|
|
690
722
|
onPress: (e)=>{
|
|
691
|
-
|
|
692
|
-
|
|
723
|
+
var _props_onPress;
|
|
724
|
+
clearInput === null || clearInput === void 0 ? void 0 : clearInput();
|
|
725
|
+
props === null || props === void 0 ? void 0 : (_props_onPress = props.onPress) === null || _props_onPress === void 0 ? void 0 : _props_onPress.call(props, e);
|
|
693
726
|
},
|
|
694
727
|
preventFocus: true,
|
|
695
|
-
"aria-label": stringFormatter.format(
|
|
728
|
+
"aria-label": stringFormatter.format("clear"),
|
|
696
729
|
excludeFromTabOrder: true,
|
|
697
|
-
UNSAFE_className: $aQREU$classNames((/*@__PURE__*/$parcel$interopDefault($5589e2270a5c2f51$exports)),
|
|
730
|
+
UNSAFE_className: (0, $aQREU$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($5589e2270a5c2f51$exports))), "spectrum-ClearButton"),
|
|
698
731
|
isDisabled: isDisabled
|
|
699
732
|
});
|
|
700
|
-
let validation = /*#__PURE__*/ $aQREU$react.cloneElement(validationIcon, {
|
|
701
|
-
UNSAFE_className: $aQREU$classNames((/*@__PURE__*/$parcel$interopDefault($c14528ddc146317f$exports)),
|
|
702
|
-
});
|
|
703
|
-
let { hoverProps: hoverProps , isHovered: isHovered } = $aQREU$useHover({
|
|
733
|
+
let validation = /*#__PURE__*/ (0, $aQREU$react).cloneElement(validationIcon, {
|
|
734
|
+
UNSAFE_className: (0, $aQREU$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($c14528ddc146317f$exports))), "spectrum-Textfield-validationIcon", (0, $aQREU$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($8fb52a80fe52b1c7$exports))), "spectrum-InputGroup-input-validationIcon"))
|
|
704
735
|
});
|
|
705
|
-
let {
|
|
706
|
-
let {
|
|
736
|
+
let { hoverProps: hoverProps , isHovered: isHovered } = (0, $aQREU$useHover)({});
|
|
737
|
+
let { isFocused: isFocused , isFocusVisible: isFocusVisible , focusProps: focusProps } = (0, $aQREU$useFocusRing)();
|
|
738
|
+
let { buttonProps: buttonProps } = (0, $aQREU$useButton)({
|
|
707
739
|
...props,
|
|
708
|
-
|
|
709
|
-
props[
|
|
710
|
-
props[
|
|
740
|
+
"aria-labelledby": [
|
|
741
|
+
props["aria-labelledby"],
|
|
742
|
+
props["aria-label"] && !props["aria-labelledby"] ? props.id : null,
|
|
711
743
|
valueId,
|
|
712
|
-
validationState ===
|
|
713
|
-
].filter(Boolean).join(
|
|
714
|
-
elementType:
|
|
744
|
+
validationState === "invalid" ? invalidId : null
|
|
745
|
+
].filter(Boolean).join(" "),
|
|
746
|
+
elementType: "div"
|
|
715
747
|
}, ref);
|
|
716
|
-
return
|
|
717
|
-
|
|
748
|
+
return /*#__PURE__*/ (0, $aQREU$react).createElement("div", {
|
|
749
|
+
...(0, $aQREU$mergeProps)(hoverProps, focusProps, buttonProps),
|
|
718
750
|
"aria-haspopup": "dialog",
|
|
719
751
|
ref: ref,
|
|
720
752
|
style: {
|
|
721
753
|
...style,
|
|
722
|
-
outline:
|
|
754
|
+
outline: "none"
|
|
723
755
|
},
|
|
724
|
-
className: $aQREU$classNames((/*@__PURE__*/$parcel$interopDefault($8fb52a80fe52b1c7$exports)),
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
}, $aQREU$classNames((/*@__PURE__*/$parcel$interopDefault($f6bdc9f20ce7ef93$exports)),
|
|
732
|
-
}, /*#__PURE__*/ $aQREU$react.createElement("div", {
|
|
733
|
-
className: $aQREU$classNames((/*@__PURE__*/$parcel$interopDefault($c14528ddc146317f$exports)),
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
}, $aQREU$classNames((/*@__PURE__*/$parcel$interopDefault($5589e2270a5c2f51$exports)),
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
756
|
+
className: (0, $aQREU$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($8fb52a80fe52b1c7$exports))), "spectrum-InputGroup", {
|
|
757
|
+
"spectrum-InputGroup--quiet": isQuiet,
|
|
758
|
+
"is-disabled": isDisabled,
|
|
759
|
+
"spectrum-InputGroup--invalid": validationState === "invalid" && !isDisabled,
|
|
760
|
+
"is-hovered": isHovered,
|
|
761
|
+
"is-focused": isFocused,
|
|
762
|
+
"focus-ring": isFocusVisible
|
|
763
|
+
}, (0, $aQREU$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($f6bdc9f20ce7ef93$exports))), "searchautocomplete", "mobile-searchautocomplete"), className)
|
|
764
|
+
}, /*#__PURE__*/ (0, $aQREU$react).createElement("div", {
|
|
765
|
+
className: (0, $aQREU$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($c14528ddc146317f$exports))), "spectrum-Textfield", {
|
|
766
|
+
"spectrum-Textfield--invalid": validationState === "invalid" && !isDisabled,
|
|
767
|
+
"spectrum-Textfield--valid": validationState === "valid" && !isDisabled,
|
|
768
|
+
"spectrum-Textfield--quiet": isQuiet
|
|
769
|
+
}, (0, $aQREU$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($5589e2270a5c2f51$exports))), "spectrum-Search", {
|
|
770
|
+
"is-disabled": isDisabled,
|
|
771
|
+
"is-quiet": isQuiet,
|
|
772
|
+
"spectrum-Search--invalid": validationState === "invalid" && !isDisabled,
|
|
773
|
+
"spectrum-Search--valid": validationState === "valid" && !isDisabled
|
|
742
774
|
}))
|
|
743
|
-
}, /*#__PURE__*/ $aQREU$react.createElement("div", {
|
|
744
|
-
className: $aQREU$classNames((/*@__PURE__*/$parcel$interopDefault($c14528ddc146317f$exports)),
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
}, icon, /*#__PURE__*/ $aQREU$react.createElement("span", {
|
|
775
|
+
}, /*#__PURE__*/ (0, $aQREU$react).createElement("div", {
|
|
776
|
+
className: (0, $aQREU$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($c14528ddc146317f$exports))), "spectrum-Textfield-input", {
|
|
777
|
+
"spectrum-Textfield-inputIcon": !!icon,
|
|
778
|
+
"is-hovered": isHovered,
|
|
779
|
+
"is-placeholder": isPlaceholder,
|
|
780
|
+
"is-disabled": isDisabled,
|
|
781
|
+
"is-quiet": isQuiet,
|
|
782
|
+
"is-focused": isFocused
|
|
783
|
+
}, (0, $aQREU$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($5589e2270a5c2f51$exports))), "spectrum-Search-input"), (0, $aQREU$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($f6bdc9f20ce7ef93$exports))), "mobile-input"))
|
|
784
|
+
}, icon, /*#__PURE__*/ (0, $aQREU$react).createElement("span", {
|
|
754
785
|
id: valueId,
|
|
755
|
-
className: $aQREU$classNames((/*@__PURE__*/$parcel$interopDefault($f6bdc9f20ce7ef93$exports)),
|
|
756
|
-
}, children)), validationState ? validation : null, (inputValue !==
|
|
786
|
+
className: (0, $aQREU$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($f6bdc9f20ce7ef93$exports))), "mobile-value")
|
|
787
|
+
}, children)), validationState && !isDisabled ? validation : null, (inputValue !== "" || validationState != null) && !isReadOnly && clearButton));
|
|
757
788
|
});
|
|
758
789
|
function $c940f54e16bafef5$var$SearchAutocompleteTray(props) {
|
|
759
|
-
let searchIcon = /*#__PURE__*/ $aQREU$react.createElement($aQREU$spectrumiconsuiMagnifier, {
|
|
790
|
+
let searchIcon = /*#__PURE__*/ (0, $aQREU$react).createElement((0, $aQREU$spectrumiconsuiMagnifier), {
|
|
760
791
|
"data-testid": "searchicon"
|
|
761
792
|
});
|
|
762
793
|
let { state: // completionMode = 'suggest',
|
|
763
794
|
state , icon: icon = searchIcon , isDisabled: isDisabled , validationState: validationState , label: label , overlayProps: overlayProps , loadingState: loadingState , onLoadMore: onLoadMore , onClose: onClose , onSubmit: onSubmit } = props;
|
|
764
|
-
let timeout = $aQREU$useRef(null);
|
|
765
|
-
let [showLoading, setShowLoading] = $aQREU$useState(false);
|
|
766
|
-
let inputRef = $aQREU$useRef();
|
|
767
|
-
let popoverRef = $aQREU$useRef();
|
|
768
|
-
let listBoxRef = $aQREU$useRef();
|
|
769
|
-
let layout = $aQREU$useListBoxLayout(state);
|
|
770
|
-
let stringFormatter = $aQREU$useLocalizedStringFormatter((/*@__PURE__*/$parcel$interopDefault($06f6e8ce74a28744$exports)));
|
|
771
|
-
let { inputProps: inputProps , listBoxProps: listBoxProps , labelProps: labelProps , clearButtonProps: clearButtonProps } = $aQREU$useSearchAutocomplete({
|
|
795
|
+
let timeout = (0, $aQREU$useRef)(null);
|
|
796
|
+
let [showLoading, setShowLoading] = (0, $aQREU$useState)(false);
|
|
797
|
+
let inputRef = (0, $aQREU$useRef)(null);
|
|
798
|
+
let popoverRef = (0, $aQREU$useRef)(null);
|
|
799
|
+
let listBoxRef = (0, $aQREU$useRef)(null);
|
|
800
|
+
let layout = (0, $aQREU$useListBoxLayout)(state);
|
|
801
|
+
let stringFormatter = (0, $aQREU$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($06f6e8ce74a28744$exports))));
|
|
802
|
+
let { inputProps: inputProps , listBoxProps: listBoxProps , labelProps: labelProps , clearButtonProps: clearButtonProps } = (0, $aQREU$useSearchAutocomplete)({
|
|
772
803
|
...props,
|
|
773
804
|
keyboardDelegate: layout,
|
|
774
805
|
popoverRef: popoverRef,
|
|
775
806
|
listBoxRef: listBoxRef,
|
|
776
807
|
inputRef: inputRef
|
|
777
808
|
}, state);
|
|
778
|
-
$aQREU$react.useEffect(()=>{
|
|
779
|
-
$aQREU$focusSafely(inputRef.current);
|
|
809
|
+
(0, $aQREU$react).useEffect(()=>{
|
|
810
|
+
if (inputRef.current) (0, $aQREU$focusSafely)(inputRef.current);
|
|
780
811
|
// When the tray unmounts, set state.isFocused (i.e. the tray input's focus tracker) to false.
|
|
781
812
|
// This is to prevent state.isFocused from being set to true when the tray closes via tapping on the underlay
|
|
782
813
|
// (FocusScope attempts to restore focus to the tray input when tapping outside the tray due to "contain")
|
|
@@ -786,53 +817,53 @@ function $c940f54e16bafef5$var$SearchAutocompleteTray(props) {
|
|
|
786
817
|
};
|
|
787
818
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
788
819
|
}, []);
|
|
789
|
-
let { dialogProps: dialogProps } = $aQREU$useDialog({
|
|
790
|
-
|
|
820
|
+
let { dialogProps: dialogProps } = (0, $aQREU$useDialog)({
|
|
821
|
+
"aria-labelledby": (0, $aQREU$useId)(labelProps.id)
|
|
791
822
|
}, popoverRef);
|
|
792
823
|
// Override the role of the input to "searchbox" instead of "combobox".
|
|
793
824
|
// Since the listbox is always visible, the combobox role doesn't really give us anything.
|
|
794
825
|
// VoiceOver on iOS reads "double tap to collapse" when focused on the input rather than
|
|
795
826
|
// "double tap to edit text", as with a textbox or searchbox. We'd like double tapping to
|
|
796
827
|
// open the virtual keyboard rather than closing the tray.
|
|
797
|
-
inputProps.role =
|
|
798
|
-
inputProps[
|
|
828
|
+
inputProps.role = "searchbox";
|
|
829
|
+
inputProps["aria-haspopup"] = "listbox";
|
|
799
830
|
delete inputProps.onTouchEnd;
|
|
800
|
-
let clearButton = /*#__PURE__*/ $aQREU$react.createElement($aQREU$ClearButton, {
|
|
831
|
+
let clearButton = /*#__PURE__*/ (0, $aQREU$react).createElement((0, $aQREU$ClearButton), {
|
|
801
832
|
...clearButtonProps,
|
|
802
833
|
preventFocus: true,
|
|
803
|
-
"aria-label": stringFormatter.format(
|
|
834
|
+
"aria-label": stringFormatter.format("clear"),
|
|
804
835
|
excludeFromTabOrder: true,
|
|
805
|
-
UNSAFE_className: $aQREU$classNames((/*@__PURE__*/$parcel$interopDefault($5589e2270a5c2f51$exports)),
|
|
836
|
+
UNSAFE_className: (0, $aQREU$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($5589e2270a5c2f51$exports))), "spectrum-ClearButton"),
|
|
806
837
|
isDisabled: isDisabled
|
|
807
838
|
});
|
|
808
|
-
let loadingCircle = /*#__PURE__*/ $aQREU$react.createElement($aQREU$ProgressCircle, {
|
|
809
|
-
"aria-label": stringFormatter.format(
|
|
839
|
+
let loadingCircle = /*#__PURE__*/ (0, $aQREU$react).createElement((0, $aQREU$ProgressCircle), {
|
|
840
|
+
"aria-label": stringFormatter.format("loading"),
|
|
810
841
|
size: "S",
|
|
811
842
|
isIndeterminate: true,
|
|
812
|
-
UNSAFE_className: $aQREU$classNames((/*@__PURE__*/$parcel$interopDefault($5589e2270a5c2f51$exports)),
|
|
843
|
+
UNSAFE_className: (0, $aQREU$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($5589e2270a5c2f51$exports))), "spectrum-Search-circleLoader", (0, $aQREU$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($c14528ddc146317f$exports))), "spectrum-Textfield-circleLoader"))
|
|
813
844
|
});
|
|
814
845
|
// Close the software keyboard on scroll to give the user a bigger area to scroll.
|
|
815
846
|
// But only do this if scrolling with touch, otherwise it can cause issues with touch
|
|
816
847
|
// screen readers.
|
|
817
|
-
let isTouchDown = $aQREU$useRef(false);
|
|
848
|
+
let isTouchDown = (0, $aQREU$useRef)(false);
|
|
818
849
|
let onTouchStart = ()=>{
|
|
819
850
|
isTouchDown.current = true;
|
|
820
851
|
};
|
|
821
852
|
let onTouchEnd = ()=>{
|
|
822
853
|
isTouchDown.current = false;
|
|
823
854
|
};
|
|
824
|
-
let onScroll = $aQREU$useCallback(()=>{
|
|
855
|
+
let onScroll = (0, $aQREU$useCallback)(()=>{
|
|
825
856
|
if (!inputRef.current || document.activeElement !== inputRef.current || !isTouchDown.current) return;
|
|
826
|
-
popoverRef.current.focus();
|
|
857
|
+
if (popoverRef.current) popoverRef.current.focus();
|
|
827
858
|
}, [
|
|
828
859
|
inputRef,
|
|
829
860
|
popoverRef,
|
|
830
861
|
isTouchDown
|
|
831
862
|
]);
|
|
832
863
|
let inputValue = inputProps.value;
|
|
833
|
-
let lastInputValue = $aQREU$useRef(inputValue);
|
|
834
|
-
$aQREU$useEffect(()=>{
|
|
835
|
-
if (loadingState ===
|
|
864
|
+
let lastInputValue = (0, $aQREU$useRef)(inputValue);
|
|
865
|
+
(0, $aQREU$useEffect)(()=>{
|
|
866
|
+
if (loadingState === "filtering" && !showLoading) {
|
|
836
867
|
if (timeout.current === null) timeout.current = setTimeout(()=>{
|
|
837
868
|
setShowLoading(true);
|
|
838
869
|
}, 500);
|
|
@@ -843,11 +874,13 @@ function $c940f54e16bafef5$var$SearchAutocompleteTray(props) {
|
|
|
843
874
|
setShowLoading(true);
|
|
844
875
|
}, 500);
|
|
845
876
|
}
|
|
846
|
-
} else if (loadingState !==
|
|
877
|
+
} else if (loadingState !== "filtering") {
|
|
847
878
|
// If loading is no longer happening, clear any timers and hide the loading circle
|
|
848
879
|
setShowLoading(false);
|
|
849
|
-
|
|
850
|
-
|
|
880
|
+
if (timeout.current !== null) {
|
|
881
|
+
clearTimeout(timeout.current);
|
|
882
|
+
timeout.current = null;
|
|
883
|
+
}
|
|
851
884
|
}
|
|
852
885
|
lastInputValue.current = inputValue;
|
|
853
886
|
}, [
|
|
@@ -857,26 +890,27 @@ function $c940f54e16bafef5$var$SearchAutocompleteTray(props) {
|
|
|
857
890
|
]);
|
|
858
891
|
let onKeyDown = (e)=>{
|
|
859
892
|
// Close virtual keyboard, close tray, and fire onSubmit if user hits Enter w/o any focused options
|
|
860
|
-
if (e.key ===
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
893
|
+
if (e.key === "Enter" && state.selectionManager.focusedKey == null) {
|
|
894
|
+
var _popoverRef_current;
|
|
895
|
+
(_popoverRef_current = popoverRef.current) === null || _popoverRef_current === void 0 ? void 0 : _popoverRef_current.focus();
|
|
896
|
+
if (onClose) onClose();
|
|
897
|
+
if (onSubmit) onSubmit(inputValue == null ? null : inputValue.toString(), null);
|
|
898
|
+
} else if (inputProps.onKeyDown) inputProps.onKeyDown(e);
|
|
865
899
|
};
|
|
866
|
-
if (icon) icon = /*#__PURE__*/ $aQREU$react.cloneElement(icon, {
|
|
867
|
-
UNSAFE_className: $aQREU$classNames((/*@__PURE__*/$parcel$interopDefault($c14528ddc146317f$exports)),
|
|
868
|
-
size:
|
|
900
|
+
if (icon) icon = /*#__PURE__*/ (0, $aQREU$react).cloneElement(icon, {
|
|
901
|
+
UNSAFE_className: (0, $aQREU$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($c14528ddc146317f$exports))), "spectrum-Textfield-icon"),
|
|
902
|
+
size: "S"
|
|
869
903
|
});
|
|
870
|
-
return
|
|
904
|
+
return /*#__PURE__*/ (0, $aQREU$react).createElement((0, $aQREU$FocusScope), {
|
|
871
905
|
restoreFocus: true,
|
|
872
906
|
contain: true
|
|
873
|
-
}, /*#__PURE__*/ $aQREU$react.createElement("div", {
|
|
874
|
-
|
|
907
|
+
}, /*#__PURE__*/ (0, $aQREU$react).createElement("div", {
|
|
908
|
+
...(0, $aQREU$mergeProps)(overlayProps, dialogProps),
|
|
875
909
|
ref: popoverRef,
|
|
876
|
-
className: $aQREU$classNames((/*@__PURE__*/$parcel$interopDefault($f6bdc9f20ce7ef93$exports)),
|
|
877
|
-
}, /*#__PURE__*/ $aQREU$react.createElement($aQREU$DismissButton, {
|
|
910
|
+
className: (0, $aQREU$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($f6bdc9f20ce7ef93$exports))), "tray-dialog")
|
|
911
|
+
}, /*#__PURE__*/ (0, $aQREU$react).createElement((0, $aQREU$DismissButton), {
|
|
878
912
|
onDismiss: onClose
|
|
879
|
-
}), /*#__PURE__*/ $aQREU$react.createElement($aQREU$TextFieldBase, {
|
|
913
|
+
}), /*#__PURE__*/ (0, $aQREU$react).createElement((0, $aQREU$TextFieldBase), {
|
|
880
914
|
label: label,
|
|
881
915
|
labelProps: labelProps,
|
|
882
916
|
inputProps: {
|
|
@@ -885,20 +919,20 @@ function $c940f54e16bafef5$var$SearchAutocompleteTray(props) {
|
|
|
885
919
|
},
|
|
886
920
|
inputRef: inputRef,
|
|
887
921
|
isDisabled: isDisabled,
|
|
888
|
-
isLoading: showLoading && loadingState ===
|
|
889
|
-
loadingIndicator: loadingState != null
|
|
922
|
+
isLoading: showLoading && loadingState === "filtering",
|
|
923
|
+
loadingIndicator: loadingState != null ? loadingCircle : undefined,
|
|
890
924
|
validationState: validationState,
|
|
891
|
-
wrapperChildren: (state.inputValue !==
|
|
925
|
+
wrapperChildren: (state.inputValue !== "" || loadingState === "filtering" || validationState != null) && !props.isReadOnly ? clearButton : undefined,
|
|
892
926
|
icon: icon,
|
|
893
|
-
UNSAFE_className: $aQREU$classNames((/*@__PURE__*/$parcel$interopDefault($5589e2270a5c2f51$exports)),
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
}, $aQREU$classNames((/*@__PURE__*/$parcel$interopDefault($f6bdc9f20ce7ef93$exports)),
|
|
897
|
-
|
|
927
|
+
UNSAFE_className: (0, $aQREU$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($5589e2270a5c2f51$exports))), "spectrum-Search", "spectrum-Textfield", "spectrum-Search--loadable", {
|
|
928
|
+
"spectrum-Search--invalid": validationState === "invalid" && !isDisabled,
|
|
929
|
+
"spectrum-Search--valid": validationState === "valid" && !isDisabled
|
|
930
|
+
}, (0, $aQREU$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($f6bdc9f20ce7ef93$exports))), "tray-textfield", {
|
|
931
|
+
"has-label": !!props.label
|
|
898
932
|
})),
|
|
899
|
-
inputClassName: $aQREU$classNames((/*@__PURE__*/$parcel$interopDefault($5589e2270a5c2f51$exports)),
|
|
900
|
-
validationIconClassName: $aQREU$classNames((/*@__PURE__*/$parcel$interopDefault($5589e2270a5c2f51$exports)),
|
|
901
|
-
}), /*#__PURE__*/ $aQREU$react.createElement($aQREU$ListBoxBase, {
|
|
933
|
+
inputClassName: (0, $aQREU$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($5589e2270a5c2f51$exports))), "spectrum-Search-input"),
|
|
934
|
+
validationIconClassName: (0, $aQREU$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($5589e2270a5c2f51$exports))), "spectrum-Search-validationIcon")
|
|
935
|
+
}), /*#__PURE__*/ (0, $aQREU$react).createElement((0, $aQREU$ListBoxBase), {
|
|
902
936
|
...listBoxProps,
|
|
903
937
|
domProps: {
|
|
904
938
|
onTouchStart: onTouchStart,
|
|
@@ -910,18 +944,17 @@ function $c940f54e16bafef5$var$SearchAutocompleteTray(props) {
|
|
|
910
944
|
layout: layout,
|
|
911
945
|
state: state,
|
|
912
946
|
shouldUseVirtualFocus: true,
|
|
913
|
-
renderEmptyState: ()=>loadingState !==
|
|
914
|
-
className: $aQREU$classNames((/*@__PURE__*/$parcel$interopDefault($f6bdc9f20ce7ef93$exports)),
|
|
915
|
-
}, stringFormatter.format(
|
|
916
|
-
,
|
|
917
|
-
UNSAFE_className: $aQREU$classNames((/*@__PURE__*/$parcel$interopDefault($f6bdc9f20ce7ef93$exports)), 'tray-listbox'),
|
|
947
|
+
renderEmptyState: ()=>loadingState !== "loading" && /*#__PURE__*/ (0, $aQREU$react).createElement("span", {
|
|
948
|
+
className: (0, $aQREU$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($f6bdc9f20ce7ef93$exports))), "no-results")
|
|
949
|
+
}, stringFormatter.format("noResults")),
|
|
950
|
+
UNSAFE_className: (0, $aQREU$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($f6bdc9f20ce7ef93$exports))), "tray-listbox"),
|
|
918
951
|
ref: listBoxRef,
|
|
919
952
|
onScroll: onScroll,
|
|
920
953
|
onLoadMore: onLoadMore,
|
|
921
|
-
isLoading: loadingState ===
|
|
922
|
-
}), /*#__PURE__*/ $aQREU$react.createElement($aQREU$DismissButton, {
|
|
954
|
+
isLoading: loadingState === "loading" || loadingState === "loadingMore"
|
|
955
|
+
}), /*#__PURE__*/ (0, $aQREU$react).createElement((0, $aQREU$DismissButton), {
|
|
923
956
|
onDismiss: onClose
|
|
924
|
-
})))
|
|
957
|
+
})));
|
|
925
958
|
}
|
|
926
959
|
|
|
927
960
|
|
|
@@ -938,47 +971,46 @@ function $c940f54e16bafef5$var$SearchAutocompleteTray(props) {
|
|
|
938
971
|
|
|
939
972
|
|
|
940
973
|
|
|
974
|
+
|
|
941
975
|
function $f3f3b62273a2d260$var$SearchAutocomplete(props, ref) {
|
|
942
|
-
props = $aQREU$useProviderProps(props);
|
|
943
|
-
if (props.placeholder) console.warn(
|
|
944
|
-
let isMobile = $aQREU$useIsMobileDevice();
|
|
976
|
+
props = (0, $aQREU$useProviderProps)(props);
|
|
977
|
+
if (props.placeholder) console.warn("Placeholders are deprecated due to accessibility issues. Please use help text instead.");
|
|
978
|
+
let isMobile = (0, $aQREU$useIsMobileDevice)();
|
|
945
979
|
if (isMobile) // menuTrigger=focus/manual don't apply to mobile searchwithin
|
|
946
|
-
return
|
|
980
|
+
return /*#__PURE__*/ (0, $aQREU$react).createElement((0, $c940f54e16bafef5$export$e7a90f7d6b078162), {
|
|
947
981
|
...props,
|
|
948
982
|
menuTrigger: "input",
|
|
949
983
|
ref: ref
|
|
950
|
-
})
|
|
951
|
-
else return
|
|
984
|
+
});
|
|
985
|
+
else return /*#__PURE__*/ (0, $aQREU$react).createElement($f3f3b62273a2d260$var$SearchAutocompleteBase, {
|
|
952
986
|
...props,
|
|
953
987
|
ref: ref
|
|
954
|
-
})
|
|
988
|
+
});
|
|
955
989
|
}
|
|
956
|
-
|
|
957
|
-
props = $aQREU$useProviderProps(props);
|
|
958
|
-
let { menuTrigger: menuTrigger =
|
|
959
|
-
|
|
960
|
-
let stringFormatter = $aQREU$useLocalizedStringFormatter((/*@__PURE__*/$parcel$interopDefault($06f6e8ce74a28744$exports)));
|
|
990
|
+
function $f3f3b62273a2d260$var$_SearchAutocompleteBase(props, ref) {
|
|
991
|
+
props = (0, $aQREU$useProviderProps)(props);
|
|
992
|
+
let { menuTrigger: menuTrigger = "input" , shouldFlip: shouldFlip = true , direction: direction = "bottom" , isQuiet: isQuiet , loadingState: loadingState , onLoadMore: onLoadMore , onSubmit: onSubmit = ()=>{} } = props;
|
|
993
|
+
let stringFormatter = (0, $aQREU$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($06f6e8ce74a28744$exports))));
|
|
961
994
|
let isAsync = loadingState != null;
|
|
962
|
-
let popoverRef = $aQREU$useRef();
|
|
963
|
-
let unwrappedPopoverRef = $aQREU$useUnwrapDOMRef(popoverRef);
|
|
964
|
-
let listBoxRef = $aQREU$useRef();
|
|
965
|
-
let inputRef = $aQREU$useRef();
|
|
966
|
-
let domRef = $aQREU$useFocusableRef(ref, inputRef);
|
|
967
|
-
let { contains: contains } = $aQREU$useFilter({
|
|
968
|
-
sensitivity:
|
|
995
|
+
let popoverRef = (0, $aQREU$useRef)(null);
|
|
996
|
+
let unwrappedPopoverRef = (0, $aQREU$useUnwrapDOMRef)(popoverRef);
|
|
997
|
+
let listBoxRef = (0, $aQREU$useRef)(null);
|
|
998
|
+
let inputRef = (0, $aQREU$useRef)(null);
|
|
999
|
+
let domRef = (0, $aQREU$useFocusableRef)(ref, inputRef);
|
|
1000
|
+
let { contains: contains } = (0, $aQREU$useFilter)({
|
|
1001
|
+
sensitivity: "base"
|
|
969
1002
|
});
|
|
970
|
-
let state = $aQREU$useComboBoxState({
|
|
1003
|
+
let state = (0, $aQREU$useComboBoxState)({
|
|
971
1004
|
...props,
|
|
972
1005
|
defaultFilter: contains,
|
|
973
1006
|
allowsEmptyCollection: isAsync,
|
|
974
1007
|
allowsCustomValue: true,
|
|
975
|
-
onSelectionChange: (key)=>key !== null && onSubmit(null, key)
|
|
976
|
-
,
|
|
1008
|
+
onSelectionChange: (key)=>key !== null && onSubmit(null, key),
|
|
977
1009
|
selectedKey: undefined,
|
|
978
1010
|
defaultSelectedKey: undefined
|
|
979
1011
|
});
|
|
980
|
-
let layout = $aQREU$useListBoxLayout(state);
|
|
981
|
-
let { inputProps: inputProps , listBoxProps: listBoxProps , labelProps: labelProps , clearButtonProps: clearButtonProps } = $aQREU$useSearchAutocomplete({
|
|
1012
|
+
let layout = (0, $aQREU$useListBoxLayout)(state);
|
|
1013
|
+
let { inputProps: inputProps , listBoxProps: listBoxProps , labelProps: labelProps , clearButtonProps: clearButtonProps } = (0, $aQREU$useSearchAutocomplete)({
|
|
982
1014
|
...props,
|
|
983
1015
|
keyboardDelegate: layout,
|
|
984
1016
|
popoverRef: unwrappedPopoverRef,
|
|
@@ -986,19 +1018,10 @@ const $f3f3b62273a2d260$var$SearchAutocompleteBase = /*#__PURE__*/ $aQREU$react.
|
|
|
986
1018
|
inputRef: inputRef,
|
|
987
1019
|
menuTrigger: menuTrigger
|
|
988
1020
|
}, state);
|
|
989
|
-
let { overlayProps: overlayProps , placement: placement , updatePosition: updatePosition } = $aQREU$useOverlayPosition({
|
|
990
|
-
targetRef: inputRef,
|
|
991
|
-
overlayRef: unwrappedPopoverRef,
|
|
992
|
-
scrollRef: listBoxRef,
|
|
993
|
-
placement: `${direction} end`,
|
|
994
|
-
shouldFlip: shouldFlip,
|
|
995
|
-
isOpen: state.isOpen,
|
|
996
|
-
onClose: state.close
|
|
997
|
-
});
|
|
998
1021
|
// Measure the width of the inputfield to inform the width of the menu (below).
|
|
999
|
-
let [menuWidth, setMenuWidth] = $aQREU$useState(
|
|
1000
|
-
let { scale: scale } = $aQREU$useProvider();
|
|
1001
|
-
let onResize = $aQREU$useCallback(()=>{
|
|
1022
|
+
let [menuWidth, setMenuWidth] = (0, $aQREU$useState)(0);
|
|
1023
|
+
let { scale: scale } = (0, $aQREU$useProvider)();
|
|
1024
|
+
let onResize = (0, $aQREU$useCallback)(()=>{
|
|
1002
1025
|
if (inputRef.current) {
|
|
1003
1026
|
let inputWidth = inputRef.current.offsetWidth;
|
|
1004
1027
|
setMenuWidth(inputWidth);
|
|
@@ -1007,53 +1030,42 @@ const $f3f3b62273a2d260$var$SearchAutocompleteBase = /*#__PURE__*/ $aQREU$react.
|
|
|
1007
1030
|
inputRef,
|
|
1008
1031
|
setMenuWidth
|
|
1009
1032
|
]);
|
|
1010
|
-
$aQREU$useResizeObserver({
|
|
1033
|
+
(0, $aQREU$useResizeObserver)({
|
|
1011
1034
|
ref: domRef,
|
|
1012
1035
|
onResize: onResize
|
|
1013
1036
|
});
|
|
1014
|
-
$aQREU$useLayoutEffect(onResize, [
|
|
1037
|
+
(0, $aQREU$useLayoutEffect)(onResize, [
|
|
1015
1038
|
scale,
|
|
1016
1039
|
onResize
|
|
1017
1040
|
]);
|
|
1018
|
-
// Update position once the ListBox has rendered. This ensures that
|
|
1019
|
-
// it flips properly when it doesn't fit in the available space.
|
|
1020
|
-
// TODO: add ResizeObserver to useOverlayPosition so we don't need this.
|
|
1021
|
-
$aQREU$useLayoutEffect(()=>{
|
|
1022
|
-
if (state.isOpen) requestAnimationFrame(()=>{
|
|
1023
|
-
updatePosition();
|
|
1024
|
-
});
|
|
1025
|
-
}, [
|
|
1026
|
-
state.isOpen,
|
|
1027
|
-
updatePosition
|
|
1028
|
-
]);
|
|
1029
1041
|
let style = {
|
|
1030
|
-
|
|
1031
|
-
width: isQuiet ? null : menuWidth,
|
|
1042
|
+
width: isQuiet ? undefined : menuWidth,
|
|
1032
1043
|
minWidth: isQuiet ? `calc(${menuWidth}px + calc(2 * var(--spectrum-dropdown-quiet-offset)))` : menuWidth
|
|
1033
1044
|
};
|
|
1034
|
-
return
|
|
1045
|
+
return /*#__PURE__*/ (0, $aQREU$react).createElement((0, $aQREU$react).Fragment, null, /*#__PURE__*/ (0, $aQREU$react).createElement((0, $aQREU$Field), {
|
|
1035
1046
|
...props,
|
|
1036
1047
|
labelProps: labelProps,
|
|
1037
1048
|
ref: domRef
|
|
1038
|
-
}, /*#__PURE__*/ $aQREU$react.createElement($f3f3b62273a2d260$var$SearchAutocompleteInput, {
|
|
1049
|
+
}, /*#__PURE__*/ (0, $aQREU$react).createElement($f3f3b62273a2d260$var$SearchAutocompleteInput, {
|
|
1039
1050
|
...props,
|
|
1040
1051
|
isOpen: state.isOpen,
|
|
1041
1052
|
loadingState: loadingState,
|
|
1042
1053
|
inputProps: inputProps,
|
|
1043
1054
|
inputRef: inputRef,
|
|
1044
1055
|
clearButtonProps: clearButtonProps
|
|
1045
|
-
})), /*#__PURE__*/ $aQREU$react.createElement($aQREU$Popover, {
|
|
1046
|
-
|
|
1056
|
+
})), /*#__PURE__*/ (0, $aQREU$react).createElement((0, $aQREU$Popover), {
|
|
1057
|
+
state: state,
|
|
1047
1058
|
UNSAFE_style: style,
|
|
1048
|
-
UNSAFE_className: $aQREU$classNames((/*@__PURE__*/$parcel$interopDefault($8fb52a80fe52b1c7$exports)),
|
|
1049
|
-
|
|
1059
|
+
UNSAFE_className: (0, $aQREU$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($8fb52a80fe52b1c7$exports))), "spectrum-InputGroup-popover", {
|
|
1060
|
+
"spectrum-InputGroup-popover--quiet": isQuiet
|
|
1050
1061
|
}),
|
|
1051
1062
|
ref: popoverRef,
|
|
1052
|
-
|
|
1063
|
+
triggerRef: inputRef,
|
|
1064
|
+
placement: `${direction} end`,
|
|
1053
1065
|
hideArrow: true,
|
|
1054
1066
|
isNonModal: true,
|
|
1055
|
-
|
|
1056
|
-
}, /*#__PURE__*/ $aQREU$react.createElement($aQREU$ListBoxBase, {
|
|
1067
|
+
shouldFlip: shouldFlip
|
|
1068
|
+
}, /*#__PURE__*/ (0, $aQREU$react).createElement((0, $aQREU$ListBoxBase), {
|
|
1057
1069
|
...listBoxProps,
|
|
1058
1070
|
ref: listBoxRef,
|
|
1059
1071
|
disallowEmptySelection: true,
|
|
@@ -1063,39 +1075,39 @@ const $f3f3b62273a2d260$var$SearchAutocompleteBase = /*#__PURE__*/ $aQREU$react.
|
|
|
1063
1075
|
layout: layout,
|
|
1064
1076
|
state: state,
|
|
1065
1077
|
shouldUseVirtualFocus: true,
|
|
1066
|
-
isLoading: loadingState ===
|
|
1078
|
+
isLoading: loadingState === "loadingMore",
|
|
1067
1079
|
onLoadMore: onLoadMore,
|
|
1068
|
-
renderEmptyState: ()=>isAsync && /*#__PURE__*/ $aQREU$react.createElement("span", null, stringFormatter.format(
|
|
1069
|
-
})
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1080
|
+
renderEmptyState: ()=>isAsync && /*#__PURE__*/ (0, $aQREU$react).createElement("span", null, stringFormatter.format("noResults"))
|
|
1081
|
+
})));
|
|
1082
|
+
}
|
|
1083
|
+
let $f3f3b62273a2d260$var$SearchAutocompleteBase = /*#__PURE__*/ (0, $aQREU$react).forwardRef($f3f3b62273a2d260$var$_SearchAutocompleteBase);
|
|
1084
|
+
// any type is because we don't want to call useObjectRef because this is an internal component and we know
|
|
1085
|
+
// we are always passing an object ref
|
|
1086
|
+
function $f3f3b62273a2d260$var$_SearchAutocompleteInput(props, ref) {
|
|
1087
|
+
let searchIcon = /*#__PURE__*/ (0, $aQREU$react).createElement((0, $aQREU$spectrumiconsuiMagnifier), {
|
|
1075
1088
|
"data-testid": "searchicon"
|
|
1076
1089
|
});
|
|
1077
1090
|
let { icon: icon = searchIcon , isQuiet: isQuiet , isDisabled: isDisabled , isReadOnly: isReadOnly , validationState: validationState , inputProps: inputProps , inputRef: inputRef , autoFocus: autoFocus , style: style , className: className , loadingState: loadingState , isOpen: isOpen , menuTrigger: menuTrigger , clearButtonProps: clearButtonProps } = props;
|
|
1078
|
-
let { hoverProps: hoverProps , isHovered: isHovered } = $aQREU$useHover({
|
|
1079
|
-
|
|
1080
|
-
let
|
|
1081
|
-
let
|
|
1082
|
-
let
|
|
1083
|
-
|
|
1084
|
-
"aria-label": stringFormatter.format('loading'),
|
|
1091
|
+
let { hoverProps: hoverProps , isHovered: isHovered } = (0, $aQREU$useHover)({});
|
|
1092
|
+
let stringFormatter = (0, $aQREU$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($06f6e8ce74a28744$exports))));
|
|
1093
|
+
let timeout = (0, $aQREU$useRef)(null);
|
|
1094
|
+
let [showLoading, setShowLoading] = (0, $aQREU$useState)(false);
|
|
1095
|
+
let loadingCircle = /*#__PURE__*/ (0, $aQREU$react).createElement((0, $aQREU$ProgressCircle), {
|
|
1096
|
+
"aria-label": stringFormatter.format("loading"),
|
|
1085
1097
|
size: "S",
|
|
1086
1098
|
isIndeterminate: true,
|
|
1087
|
-
UNSAFE_className: $aQREU$classNames((/*@__PURE__*/$parcel$interopDefault($c14528ddc146317f$exports)),
|
|
1099
|
+
UNSAFE_className: (0, $aQREU$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($c14528ddc146317f$exports))), "spectrum-Textfield-circleLoader", (0, $aQREU$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($8fb52a80fe52b1c7$exports))), "spectrum-InputGroup-input-circleLoader"))
|
|
1088
1100
|
});
|
|
1089
|
-
let clearButton = /*#__PURE__*/ $aQREU$react.createElement($aQREU$ClearButton, {
|
|
1101
|
+
let clearButton = /*#__PURE__*/ (0, $aQREU$react).createElement((0, $aQREU$ClearButton), {
|
|
1090
1102
|
...clearButtonProps,
|
|
1091
1103
|
preventFocus: true,
|
|
1092
|
-
UNSAFE_className: $aQREU$classNames((/*@__PURE__*/$parcel$interopDefault($5589e2270a5c2f51$exports)),
|
|
1104
|
+
UNSAFE_className: (0, $aQREU$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($5589e2270a5c2f51$exports))), "spectrum-ClearButton"),
|
|
1093
1105
|
isDisabled: isDisabled
|
|
1094
1106
|
});
|
|
1095
|
-
let isLoading = loadingState ===
|
|
1107
|
+
let isLoading = loadingState === "loading" || loadingState === "filtering";
|
|
1096
1108
|
let inputValue = inputProps.value;
|
|
1097
|
-
let lastInputValue = $aQREU$useRef(inputValue);
|
|
1098
|
-
$aQREU$useEffect(()=>{
|
|
1109
|
+
let lastInputValue = (0, $aQREU$useRef)(inputValue);
|
|
1110
|
+
(0, $aQREU$useEffect)(()=>{
|
|
1099
1111
|
if (isLoading && !showLoading) {
|
|
1100
1112
|
if (timeout.current === null) timeout.current = setTimeout(()=>{
|
|
1101
1113
|
setShowLoading(true);
|
|
@@ -1110,8 +1122,10 @@ const $f3f3b62273a2d260$var$SearchAutocompleteInput = /*#__PURE__*/ $aQREU$react
|
|
|
1110
1122
|
} else if (!isLoading) {
|
|
1111
1123
|
// If loading is no longer happening, clear any timers and hide the loading circle
|
|
1112
1124
|
setShowLoading(false);
|
|
1113
|
-
|
|
1114
|
-
|
|
1125
|
+
if (timeout.current != null) {
|
|
1126
|
+
clearTimeout(timeout.current);
|
|
1127
|
+
timeout.current = null;
|
|
1128
|
+
}
|
|
1115
1129
|
}
|
|
1116
1130
|
lastInputValue.current = inputValue;
|
|
1117
1131
|
}, [
|
|
@@ -1119,44 +1133,46 @@ const $f3f3b62273a2d260$var$SearchAutocompleteInput = /*#__PURE__*/ $aQREU$react
|
|
|
1119
1133
|
showLoading,
|
|
1120
1134
|
inputValue
|
|
1121
1135
|
]);
|
|
1122
|
-
return
|
|
1136
|
+
return /*#__PURE__*/ (0, $aQREU$react).createElement((0, $aQREU$FocusRing), {
|
|
1123
1137
|
within: true,
|
|
1124
1138
|
isTextInput: true,
|
|
1125
|
-
focusClass: $aQREU$classNames((/*@__PURE__*/$parcel$interopDefault($8fb52a80fe52b1c7$exports)),
|
|
1126
|
-
focusRingClass: $aQREU$classNames((/*@__PURE__*/$parcel$interopDefault($8fb52a80fe52b1c7$exports)),
|
|
1139
|
+
focusClass: (0, $aQREU$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($8fb52a80fe52b1c7$exports))), "is-focused"),
|
|
1140
|
+
focusRingClass: (0, $aQREU$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($8fb52a80fe52b1c7$exports))), "focus-ring"),
|
|
1127
1141
|
autoFocus: autoFocus
|
|
1128
|
-
}, /*#__PURE__*/ $aQREU$react.createElement("div", {
|
|
1142
|
+
}, /*#__PURE__*/ (0, $aQREU$react).createElement("div", {
|
|
1129
1143
|
...hoverProps,
|
|
1130
1144
|
ref: ref,
|
|
1131
1145
|
style: style,
|
|
1132
|
-
className: $aQREU$classNames((/*@__PURE__*/$parcel$interopDefault($8fb52a80fe52b1c7$exports)),
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
}, className)
|
|
1138
|
-
}, /*#__PURE__*/ $aQREU$react.createElement($aQREU$TextFieldBase, {
|
|
1146
|
+
className: (0, $aQREU$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($8fb52a80fe52b1c7$exports))), "spectrum-InputGroup", {
|
|
1147
|
+
"spectrum-InputGroup--quiet": isQuiet,
|
|
1148
|
+
"is-disabled": isDisabled,
|
|
1149
|
+
"spectrum-InputGroup--invalid": validationState === "invalid" && !isDisabled,
|
|
1150
|
+
"is-hovered": isHovered
|
|
1151
|
+
}, (0, $aQREU$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($f6bdc9f20ce7ef93$exports))), "searchautocomplete"), className)
|
|
1152
|
+
}, /*#__PURE__*/ (0, $aQREU$react).createElement((0, $aQREU$TextFieldBase), {
|
|
1139
1153
|
inputProps: inputProps,
|
|
1140
1154
|
inputRef: inputRef,
|
|
1141
|
-
UNSAFE_className: $aQREU$classNames((/*@__PURE__*/$parcel$interopDefault($5589e2270a5c2f51$exports)),
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
}),
|
|
1147
|
-
inputClassName: $aQREU$classNames((/*@__PURE__*/$parcel$interopDefault($5589e2270a5c2f51$exports)),
|
|
1155
|
+
UNSAFE_className: (0, $aQREU$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($5589e2270a5c2f51$exports))), "spectrum-Search", "spectrum-Textfield", {
|
|
1156
|
+
"is-disabled": isDisabled,
|
|
1157
|
+
"is-quiet": isQuiet,
|
|
1158
|
+
"spectrum-Search--invalid": validationState === "invalid" && !isDisabled,
|
|
1159
|
+
"spectrum-Search--valid": validationState === "valid" && !isDisabled
|
|
1160
|
+
}, (0, $aQREU$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($8fb52a80fe52b1c7$exports))), "spectrum-InputGroup-field")),
|
|
1161
|
+
inputClassName: (0, $aQREU$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($5589e2270a5c2f51$exports))), "spectrum-Search-input"),
|
|
1148
1162
|
isDisabled: isDisabled,
|
|
1149
1163
|
isQuiet: isQuiet,
|
|
1150
1164
|
validationState: validationState,
|
|
1151
|
-
isLoading: showLoading && (isOpen || menuTrigger ===
|
|
1152
|
-
loadingIndicator: loadingState != null
|
|
1165
|
+
isLoading: showLoading && (isOpen || menuTrigger === "manual" || loadingState === "loading"),
|
|
1166
|
+
loadingIndicator: loadingState != null ? loadingCircle : undefined,
|
|
1153
1167
|
icon: icon,
|
|
1154
|
-
wrapperChildren: inputValue !==
|
|
1155
|
-
|
|
1156
|
-
});
|
|
1168
|
+
wrapperChildren: inputValue !== "" && !isReadOnly ? clearButton : undefined,
|
|
1169
|
+
disableFocusRing: true
|
|
1170
|
+
})));
|
|
1171
|
+
}
|
|
1172
|
+
let $f3f3b62273a2d260$var$SearchAutocompleteInput = /*#__PURE__*/ (0, $aQREU$react).forwardRef($f3f3b62273a2d260$var$_SearchAutocompleteInput);
|
|
1157
1173
|
/**
|
|
1158
1174
|
* A SearchAutocomplete is a searchfield that supports a dynamic list of suggestions.
|
|
1159
|
-
*/ let $f3f3b62273a2d260$export$dd65332a5b19fa63 = /*#__PURE__*/ $aQREU$forwardRef($f3f3b62273a2d260$var$SearchAutocomplete);
|
|
1175
|
+
*/ let $f3f3b62273a2d260$export$dd65332a5b19fa63 = /*#__PURE__*/ (0, $aQREU$forwardRef)($f3f3b62273a2d260$var$SearchAutocomplete);
|
|
1160
1176
|
|
|
1161
1177
|
|
|
1162
1178
|
|