@react-spectrum/autocomplete 3.0.0-nightly.3599 → 3.0.0-nightly.3600
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 +241 -218
- package/dist/main.js.map +1 -1
- package/dist/module.mjs +241 -218
- package/dist/module.mjs.map +1 -1
- package/package.json +29 -29
package/dist/main.js
CHANGED
|
@@ -33,7 +33,28 @@ function $parcel$interopDefault(a) {
|
|
|
33
33
|
$parcel$export(module.exports, "SearchAutocomplete", () => $dcf500d58a031ca6$export$dd65332a5b19fa63);
|
|
34
34
|
$parcel$export(module.exports, "Item", () => $aWXRc$reactstatelycollections.Item);
|
|
35
35
|
$parcel$export(module.exports, "Section", () => $aWXRc$reactstatelycollections.Section);
|
|
36
|
-
|
|
36
|
+
/*
|
|
37
|
+
* Copyright 2021 Adobe. All rights reserved.
|
|
38
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
39
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
40
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
41
|
+
*
|
|
42
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
43
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
44
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
45
|
+
* governing permissions and limitations under the License.
|
|
46
|
+
*/ /// <reference types="css-module-types" />
|
|
47
|
+
/*
|
|
48
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
49
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
50
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
51
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
52
|
+
*
|
|
53
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
54
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
55
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
56
|
+
* governing permissions and limitations under the License.
|
|
57
|
+
*/
|
|
37
58
|
|
|
38
59
|
|
|
39
60
|
|
|
@@ -384,7 +405,17 @@ $ccb60979256717ac$exports = {
|
|
|
384
405
|
|
|
385
406
|
|
|
386
407
|
|
|
387
|
-
|
|
408
|
+
/*
|
|
409
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
410
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
411
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
412
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
413
|
+
*
|
|
414
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
415
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
416
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
417
|
+
* governing permissions and limitations under the License.
|
|
418
|
+
*/
|
|
388
419
|
|
|
389
420
|
|
|
390
421
|
|
|
@@ -607,13 +638,12 @@ $40cb3a00c193680f$export$d35bc1e505d1ebbf = "is-disabled_73bc77";
|
|
|
607
638
|
|
|
608
639
|
|
|
609
640
|
function $a9f98e219df0b64d$var$_MobileSearchAutocomplete(props, ref) {
|
|
610
|
-
props = $aWXRc$reactspectrumprovider.useProviderProps(props);
|
|
611
|
-
let { isQuiet: isQuiet , isDisabled: isDisabled , validationState: validationState , isReadOnly: isReadOnly , onSubmit: onSubmit = ()=>{
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
sensitivity: 'base'
|
|
641
|
+
props = (0, $aWXRc$reactspectrumprovider.useProviderProps)(props);
|
|
642
|
+
let { isQuiet: isQuiet , isDisabled: isDisabled , validationState: validationState , isReadOnly: isReadOnly , onSubmit: onSubmit = ()=>{} } = props;
|
|
643
|
+
let { contains: contains } = (0, $aWXRc$reactariai18n.useFilter)({
|
|
644
|
+
sensitivity: "base"
|
|
615
645
|
});
|
|
616
|
-
let state = $aWXRc$reactstatelycombobox.useComboBoxState({
|
|
646
|
+
let state = (0, $aWXRc$reactstatelycombobox.useComboBoxState)({
|
|
617
647
|
...props,
|
|
618
648
|
defaultFilter: contains,
|
|
619
649
|
allowsEmptyCollection: true,
|
|
@@ -622,35 +652,34 @@ function $a9f98e219df0b64d$var$_MobileSearchAutocomplete(props, ref) {
|
|
|
622
652
|
// then the closing of the tray will call setFocused(false) again due to cleanup effect)
|
|
623
653
|
shouldCloseOnBlur: false,
|
|
624
654
|
allowsCustomValue: true,
|
|
625
|
-
onSelectionChange: (key)=>key !== null && onSubmit(null, key)
|
|
626
|
-
,
|
|
655
|
+
onSelectionChange: (key)=>key !== null && onSubmit(null, key),
|
|
627
656
|
selectedKey: undefined,
|
|
628
657
|
defaultSelectedKey: undefined
|
|
629
658
|
});
|
|
630
|
-
let buttonRef = $aWXRc$react.useRef(null);
|
|
631
|
-
let domRef = $aWXRc$reactspectrumutils.useFocusableRef(ref, buttonRef);
|
|
632
|
-
let { triggerProps: triggerProps , overlayProps: overlayProps } = $aWXRc$reactariaoverlays.useOverlayTrigger({
|
|
633
|
-
type:
|
|
659
|
+
let buttonRef = (0, $aWXRc$react.useRef)(null);
|
|
660
|
+
let domRef = (0, $aWXRc$reactspectrumutils.useFocusableRef)(ref, buttonRef);
|
|
661
|
+
let { triggerProps: triggerProps , overlayProps: overlayProps } = (0, $aWXRc$reactariaoverlays.useOverlayTrigger)({
|
|
662
|
+
type: "listbox"
|
|
634
663
|
}, state, buttonRef);
|
|
635
|
-
let { labelProps: labelProps , fieldProps: fieldProps } = $aWXRc$reactarialabel.useLabel({
|
|
664
|
+
let { labelProps: labelProps , fieldProps: fieldProps } = (0, $aWXRc$reactarialabel.useLabel)({
|
|
636
665
|
...props,
|
|
637
|
-
labelElementType:
|
|
666
|
+
labelElementType: "span"
|
|
638
667
|
});
|
|
639
668
|
// Focus the button and show focus ring when clicking on the label
|
|
640
669
|
labelProps.onClick = ()=>{
|
|
641
670
|
if (!props.isDisabled && buttonRef.current) {
|
|
642
671
|
buttonRef.current.focus();
|
|
643
|
-
$aWXRc$reactariainteractions.setInteractionModality(
|
|
672
|
+
(0, $aWXRc$reactariainteractions.setInteractionModality)("keyboard");
|
|
644
673
|
}
|
|
645
674
|
};
|
|
646
|
-
return
|
|
675
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($aWXRc$react))).createElement((0, ($parcel$interopDefault($aWXRc$react))).Fragment, null, /*#__PURE__*/ (0, ($parcel$interopDefault($aWXRc$react))).createElement((0, $aWXRc$reactspectrumlabel.Field), {
|
|
647
676
|
...props,
|
|
648
677
|
labelProps: labelProps,
|
|
649
678
|
elementType: "span",
|
|
650
679
|
ref: domRef,
|
|
651
680
|
includeNecessityIndicatorInAccessibilityName: true
|
|
652
|
-
}, /*#__PURE__*/ ($parcel$interopDefault($aWXRc$react)).createElement($a9f98e219df0b64d$var$SearchAutocompleteButton, {
|
|
653
|
-
|
|
681
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($aWXRc$react))).createElement($a9f98e219df0b64d$var$SearchAutocompleteButton, {
|
|
682
|
+
...(0, $aWXRc$reactariautils.mergeProps)(triggerProps, fieldProps, {
|
|
654
683
|
autoFocus: props.autoFocus,
|
|
655
684
|
icon: props.icon
|
|
656
685
|
}),
|
|
@@ -661,130 +690,128 @@ function $a9f98e219df0b64d$var$_MobileSearchAutocomplete(props, ref) {
|
|
|
661
690
|
isPlaceholder: !state.inputValue,
|
|
662
691
|
validationState: validationState,
|
|
663
692
|
inputValue: state.inputValue,
|
|
664
|
-
clearInput: ()=>state.setInputValue(
|
|
665
|
-
,
|
|
666
|
-
|
|
667
|
-
}, state.inputValue || props.placeholder || '')), /*#__PURE__*/ ($parcel$interopDefault($aWXRc$react)).createElement($aWXRc$reactspectrumoverlays.Tray, {
|
|
693
|
+
clearInput: ()=>state.setInputValue(""),
|
|
694
|
+
onPress: ()=>!isReadOnly && state.open(null, "manual")
|
|
695
|
+
}, state.inputValue || props.placeholder || "")), /*#__PURE__*/ (0, ($parcel$interopDefault($aWXRc$react))).createElement((0, $aWXRc$reactspectrumoverlays.Tray), {
|
|
668
696
|
state: state,
|
|
669
697
|
isFixedHeight: true,
|
|
670
698
|
...overlayProps
|
|
671
|
-
}, /*#__PURE__*/ ($parcel$interopDefault($aWXRc$react)).createElement($a9f98e219df0b64d$var$SearchAutocompleteTray, {
|
|
699
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($aWXRc$react))).createElement($a9f98e219df0b64d$var$SearchAutocompleteTray, {
|
|
672
700
|
...props,
|
|
673
701
|
onClose: state.close,
|
|
674
702
|
overlayProps: overlayProps,
|
|
675
703
|
state: state
|
|
676
|
-
})))
|
|
704
|
+
})));
|
|
677
705
|
}
|
|
678
|
-
let $a9f98e219df0b64d$export$e7a90f7d6b078162 = /*#__PURE__*/ ($parcel$interopDefault($aWXRc$react)).forwardRef($a9f98e219df0b64d$var$_MobileSearchAutocomplete);
|
|
706
|
+
let $a9f98e219df0b64d$export$e7a90f7d6b078162 = /*#__PURE__*/ (0, ($parcel$interopDefault($aWXRc$react))).forwardRef($a9f98e219df0b64d$var$_MobileSearchAutocomplete);
|
|
679
707
|
// any type is because we don't want to call useObjectRef because this is an internal component and we know
|
|
680
708
|
// we are always passing an object ref
|
|
681
|
-
const $a9f98e219df0b64d$var$SearchAutocompleteButton = /*#__PURE__*/ ($parcel$interopDefault($aWXRc$react)).forwardRef(function SearchAutocompleteButton(props,
|
|
682
|
-
let searchIcon = /*#__PURE__*/ ($parcel$interopDefault($aWXRc$react)).createElement(($parcel$interopDefault($aWXRc$spectrumiconsuiMagnifier)), {
|
|
709
|
+
const $a9f98e219df0b64d$var$SearchAutocompleteButton = /*#__PURE__*/ (0, ($parcel$interopDefault($aWXRc$react))).forwardRef(function SearchAutocompleteButton(props, ref) {
|
|
710
|
+
let searchIcon = /*#__PURE__*/ (0, ($parcel$interopDefault($aWXRc$react))).createElement((0, ($parcel$interopDefault($aWXRc$spectrumiconsuiMagnifier))), {
|
|
683
711
|
"data-testid": "searchicon"
|
|
684
712
|
});
|
|
685
713
|
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;
|
|
686
|
-
let stringFormatter = $aWXRc$reactariai18n.useLocalizedStringFormatter((/*@__PURE__*/$parcel$interopDefault($ccb60979256717ac$exports)));
|
|
687
|
-
let valueId = $aWXRc$reactariautils.useId();
|
|
688
|
-
let invalidId = $aWXRc$reactariautils.useId();
|
|
689
|
-
let validationIcon = validationState ===
|
|
714
|
+
let stringFormatter = (0, $aWXRc$reactariai18n.useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($ccb60979256717ac$exports))));
|
|
715
|
+
let valueId = (0, $aWXRc$reactariautils.useId)();
|
|
716
|
+
let invalidId = (0, $aWXRc$reactariautils.useId)();
|
|
717
|
+
let validationIcon = validationState === "invalid" ? /*#__PURE__*/ (0, ($parcel$interopDefault($aWXRc$react))).createElement((0, ($parcel$interopDefault($aWXRc$spectrumiconsuiAlertMedium))), {
|
|
690
718
|
id: invalidId,
|
|
691
|
-
"aria-label": stringFormatter.format(
|
|
692
|
-
}) : /*#__PURE__*/ ($parcel$interopDefault($aWXRc$react)).createElement(($parcel$interopDefault($aWXRc$spectrumiconsuiCheckmarkMedium)), null);
|
|
693
|
-
if (icon) icon = /*#__PURE__*/ ($parcel$interopDefault($aWXRc$react)).cloneElement(icon, {
|
|
694
|
-
UNSAFE_className: $aWXRc$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($40cb3a00c193680f$exports)),
|
|
695
|
-
size:
|
|
719
|
+
"aria-label": stringFormatter.format("invalid")
|
|
720
|
+
}) : /*#__PURE__*/ (0, ($parcel$interopDefault($aWXRc$react))).createElement((0, ($parcel$interopDefault($aWXRc$spectrumiconsuiCheckmarkMedium))), null);
|
|
721
|
+
if (icon) icon = /*#__PURE__*/ (0, ($parcel$interopDefault($aWXRc$react))).cloneElement(icon, {
|
|
722
|
+
UNSAFE_className: (0, $aWXRc$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($40cb3a00c193680f$exports))), "spectrum-Textfield-icon"),
|
|
723
|
+
size: "S"
|
|
696
724
|
});
|
|
697
|
-
let clearButton = /*#__PURE__*/ ($parcel$interopDefault($aWXRc$react)).createElement($aWXRc$reactspectrumbutton.ClearButton, {
|
|
725
|
+
let clearButton = /*#__PURE__*/ (0, ($parcel$interopDefault($aWXRc$react))).createElement((0, $aWXRc$reactspectrumbutton.ClearButton), {
|
|
698
726
|
onPress: (e)=>{
|
|
699
727
|
var ref;
|
|
700
728
|
clearInput === null || clearInput === void 0 ? void 0 : clearInput();
|
|
701
729
|
props === null || props === void 0 ? void 0 : (ref = props.onPress) === null || ref === void 0 ? void 0 : ref.call(props, e);
|
|
702
730
|
},
|
|
703
731
|
preventFocus: true,
|
|
704
|
-
"aria-label": stringFormatter.format(
|
|
732
|
+
"aria-label": stringFormatter.format("clear"),
|
|
705
733
|
excludeFromTabOrder: true,
|
|
706
|
-
UNSAFE_className: $aWXRc$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($1e139f06a0a4b696$exports)),
|
|
734
|
+
UNSAFE_className: (0, $aWXRc$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($1e139f06a0a4b696$exports))), "spectrum-ClearButton"),
|
|
707
735
|
isDisabled: isDisabled
|
|
708
736
|
});
|
|
709
|
-
let validation = /*#__PURE__*/ ($parcel$interopDefault($aWXRc$react)).cloneElement(validationIcon, {
|
|
710
|
-
UNSAFE_className: $aWXRc$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($40cb3a00c193680f$exports)),
|
|
737
|
+
let validation = /*#__PURE__*/ (0, ($parcel$interopDefault($aWXRc$react))).cloneElement(validationIcon, {
|
|
738
|
+
UNSAFE_className: (0, $aWXRc$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($40cb3a00c193680f$exports))), "spectrum-Textfield-validationIcon", (0, $aWXRc$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($2f86633ce5b04f1e$exports))), "spectrum-InputGroup-input-validationIcon"))
|
|
711
739
|
});
|
|
712
|
-
let { hoverProps: hoverProps , isHovered: isHovered } = $aWXRc$reactariainteractions.useHover({
|
|
713
|
-
});
|
|
714
|
-
let {
|
|
715
|
-
let { buttonProps: buttonProps } = $aWXRc$reactariabutton.useButton({
|
|
740
|
+
let { hoverProps: hoverProps , isHovered: isHovered } = (0, $aWXRc$reactariainteractions.useHover)({});
|
|
741
|
+
let { isFocused: isFocused , isFocusVisible: isFocusVisible , focusProps: focusProps } = (0, $aWXRc$reactariafocus.useFocusRing)();
|
|
742
|
+
let { buttonProps: buttonProps } = (0, $aWXRc$reactariabutton.useButton)({
|
|
716
743
|
...props,
|
|
717
|
-
|
|
718
|
-
props[
|
|
719
|
-
props[
|
|
744
|
+
"aria-labelledby": [
|
|
745
|
+
props["aria-labelledby"],
|
|
746
|
+
props["aria-label"] && !props["aria-labelledby"] ? props.id : null,
|
|
720
747
|
valueId,
|
|
721
|
-
validationState ===
|
|
722
|
-
].filter(Boolean).join(
|
|
723
|
-
elementType:
|
|
724
|
-
},
|
|
725
|
-
return
|
|
726
|
-
|
|
748
|
+
validationState === "invalid" ? invalidId : null
|
|
749
|
+
].filter(Boolean).join(" "),
|
|
750
|
+
elementType: "div"
|
|
751
|
+
}, ref);
|
|
752
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($aWXRc$react))).createElement("div", {
|
|
753
|
+
...(0, $aWXRc$reactariautils.mergeProps)(hoverProps, focusProps, buttonProps),
|
|
727
754
|
"aria-haspopup": "dialog",
|
|
728
|
-
ref:
|
|
755
|
+
ref: ref,
|
|
729
756
|
style: {
|
|
730
757
|
...style,
|
|
731
|
-
outline:
|
|
758
|
+
outline: "none"
|
|
732
759
|
},
|
|
733
|
-
className: $aWXRc$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($2f86633ce5b04f1e$exports)),
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
}, $aWXRc$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($83da5c2df967875d$exports)),
|
|
741
|
-
}, /*#__PURE__*/ ($parcel$interopDefault($aWXRc$react)).createElement("div", {
|
|
742
|
-
className: $aWXRc$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($40cb3a00c193680f$exports)),
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
}, $aWXRc$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($1e139f06a0a4b696$exports)),
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
760
|
+
className: (0, $aWXRc$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($2f86633ce5b04f1e$exports))), "spectrum-InputGroup", {
|
|
761
|
+
"spectrum-InputGroup--quiet": isQuiet,
|
|
762
|
+
"is-disabled": isDisabled,
|
|
763
|
+
"spectrum-InputGroup--invalid": validationState === "invalid" && !isDisabled,
|
|
764
|
+
"is-hovered": isHovered,
|
|
765
|
+
"is-focused": isFocused,
|
|
766
|
+
"focus-ring": isFocusVisible
|
|
767
|
+
}, (0, $aWXRc$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($83da5c2df967875d$exports))), "searchautocomplete", "mobile-searchautocomplete"), className)
|
|
768
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($aWXRc$react))).createElement("div", {
|
|
769
|
+
className: (0, $aWXRc$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($40cb3a00c193680f$exports))), "spectrum-Textfield", {
|
|
770
|
+
"spectrum-Textfield--invalid": validationState === "invalid" && !isDisabled,
|
|
771
|
+
"spectrum-Textfield--valid": validationState === "valid" && !isDisabled,
|
|
772
|
+
"spectrum-Textfield--quiet": isQuiet
|
|
773
|
+
}, (0, $aWXRc$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($1e139f06a0a4b696$exports))), "spectrum-Search", {
|
|
774
|
+
"is-disabled": isDisabled,
|
|
775
|
+
"is-quiet": isQuiet,
|
|
776
|
+
"spectrum-Search--invalid": validationState === "invalid" && !isDisabled,
|
|
777
|
+
"spectrum-Search--valid": validationState === "valid" && !isDisabled
|
|
751
778
|
}))
|
|
752
|
-
}, /*#__PURE__*/ ($parcel$interopDefault($aWXRc$react)).createElement("div", {
|
|
753
|
-
className: $aWXRc$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($40cb3a00c193680f$exports)),
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
}, $aWXRc$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($1e139f06a0a4b696$exports)),
|
|
761
|
-
}, icon, /*#__PURE__*/ ($parcel$interopDefault($aWXRc$react)).createElement("span", {
|
|
779
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($aWXRc$react))).createElement("div", {
|
|
780
|
+
className: (0, $aWXRc$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($40cb3a00c193680f$exports))), "spectrum-Textfield-input", {
|
|
781
|
+
"spectrum-Textfield-inputIcon": !!icon,
|
|
782
|
+
"is-hovered": isHovered,
|
|
783
|
+
"is-placeholder": isPlaceholder,
|
|
784
|
+
"is-disabled": isDisabled,
|
|
785
|
+
"is-quiet": isQuiet,
|
|
786
|
+
"is-focused": isFocused
|
|
787
|
+
}, (0, $aWXRc$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($1e139f06a0a4b696$exports))), "spectrum-Search-input"), (0, $aWXRc$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($83da5c2df967875d$exports))), "mobile-input"))
|
|
788
|
+
}, icon, /*#__PURE__*/ (0, ($parcel$interopDefault($aWXRc$react))).createElement("span", {
|
|
762
789
|
id: valueId,
|
|
763
|
-
className: $aWXRc$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($83da5c2df967875d$exports)),
|
|
764
|
-
}, children)), validationState && !isDisabled ? validation : null, (inputValue !==
|
|
790
|
+
className: (0, $aWXRc$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($83da5c2df967875d$exports))), "mobile-value")
|
|
791
|
+
}, children)), validationState && !isDisabled ? validation : null, (inputValue !== "" || validationState != null) && !isReadOnly && clearButton));
|
|
765
792
|
});
|
|
766
793
|
function $a9f98e219df0b64d$var$SearchAutocompleteTray(props) {
|
|
767
|
-
let searchIcon = /*#__PURE__*/ ($parcel$interopDefault($aWXRc$react)).createElement(($parcel$interopDefault($aWXRc$spectrumiconsuiMagnifier)), {
|
|
794
|
+
let searchIcon = /*#__PURE__*/ (0, ($parcel$interopDefault($aWXRc$react))).createElement((0, ($parcel$interopDefault($aWXRc$spectrumiconsuiMagnifier))), {
|
|
768
795
|
"data-testid": "searchicon"
|
|
769
796
|
});
|
|
770
797
|
let { state: // completionMode = 'suggest',
|
|
771
798
|
state , icon: icon = searchIcon , isDisabled: isDisabled , validationState: validationState , label: label , overlayProps: overlayProps , loadingState: loadingState , onLoadMore: onLoadMore , onClose: onClose , onSubmit: onSubmit } = props;
|
|
772
|
-
let timeout = $aWXRc$react.useRef(null);
|
|
773
|
-
let [showLoading, setShowLoading] = $aWXRc$react.useState(false);
|
|
774
|
-
let inputRef = $aWXRc$react.useRef(null);
|
|
775
|
-
let popoverRef = $aWXRc$react.useRef(null);
|
|
776
|
-
let listBoxRef = $aWXRc$react.useRef(null);
|
|
777
|
-
let layout = $aWXRc$reactspectrumlistbox.useListBoxLayout(state);
|
|
778
|
-
let stringFormatter = $aWXRc$reactariai18n.useLocalizedStringFormatter((/*@__PURE__*/$parcel$interopDefault($ccb60979256717ac$exports)));
|
|
779
|
-
let { inputProps: inputProps , listBoxProps: listBoxProps , labelProps: labelProps , clearButtonProps: clearButtonProps } = $aWXRc$reactariaautocomplete.useSearchAutocomplete({
|
|
799
|
+
let timeout = (0, $aWXRc$react.useRef)(null);
|
|
800
|
+
let [showLoading, setShowLoading] = (0, $aWXRc$react.useState)(false);
|
|
801
|
+
let inputRef = (0, $aWXRc$react.useRef)(null);
|
|
802
|
+
let popoverRef = (0, $aWXRc$react.useRef)(null);
|
|
803
|
+
let listBoxRef = (0, $aWXRc$react.useRef)(null);
|
|
804
|
+
let layout = (0, $aWXRc$reactspectrumlistbox.useListBoxLayout)(state);
|
|
805
|
+
let stringFormatter = (0, $aWXRc$reactariai18n.useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($ccb60979256717ac$exports))));
|
|
806
|
+
let { inputProps: inputProps , listBoxProps: listBoxProps , labelProps: labelProps , clearButtonProps: clearButtonProps } = (0, $aWXRc$reactariaautocomplete.useSearchAutocomplete)({
|
|
780
807
|
...props,
|
|
781
808
|
keyboardDelegate: layout,
|
|
782
809
|
popoverRef: popoverRef,
|
|
783
810
|
listBoxRef: listBoxRef,
|
|
784
811
|
inputRef: inputRef
|
|
785
812
|
}, state);
|
|
786
|
-
($parcel$interopDefault($aWXRc$react)).useEffect(()=>{
|
|
787
|
-
if (inputRef.current) $aWXRc$reactariafocus.focusSafely(inputRef.current);
|
|
813
|
+
(0, ($parcel$interopDefault($aWXRc$react))).useEffect(()=>{
|
|
814
|
+
if (inputRef.current) (0, $aWXRc$reactariafocus.focusSafely)(inputRef.current);
|
|
788
815
|
// When the tray unmounts, set state.isFocused (i.e. the tray input's focus tracker) to false.
|
|
789
816
|
// This is to prevent state.isFocused from being set to true when the tray closes via tapping on the underlay
|
|
790
817
|
// (FocusScope attempts to restore focus to the tray input when tapping outside the tray due to "contain")
|
|
@@ -794,42 +821,42 @@ function $a9f98e219df0b64d$var$SearchAutocompleteTray(props) {
|
|
|
794
821
|
};
|
|
795
822
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
796
823
|
}, []);
|
|
797
|
-
let { dialogProps: dialogProps } = $aWXRc$reactariadialog.useDialog({
|
|
798
|
-
|
|
824
|
+
let { dialogProps: dialogProps } = (0, $aWXRc$reactariadialog.useDialog)({
|
|
825
|
+
"aria-labelledby": (0, $aWXRc$reactariautils.useId)(labelProps.id)
|
|
799
826
|
}, popoverRef);
|
|
800
827
|
// Override the role of the input to "searchbox" instead of "combobox".
|
|
801
828
|
// Since the listbox is always visible, the combobox role doesn't really give us anything.
|
|
802
829
|
// VoiceOver on iOS reads "double tap to collapse" when focused on the input rather than
|
|
803
830
|
// "double tap to edit text", as with a textbox or searchbox. We'd like double tapping to
|
|
804
831
|
// open the virtual keyboard rather than closing the tray.
|
|
805
|
-
inputProps.role =
|
|
806
|
-
inputProps[
|
|
832
|
+
inputProps.role = "searchbox";
|
|
833
|
+
inputProps["aria-haspopup"] = "listbox";
|
|
807
834
|
delete inputProps.onTouchEnd;
|
|
808
|
-
let clearButton = /*#__PURE__*/ ($parcel$interopDefault($aWXRc$react)).createElement($aWXRc$reactspectrumbutton.ClearButton, {
|
|
835
|
+
let clearButton = /*#__PURE__*/ (0, ($parcel$interopDefault($aWXRc$react))).createElement((0, $aWXRc$reactspectrumbutton.ClearButton), {
|
|
809
836
|
...clearButtonProps,
|
|
810
837
|
preventFocus: true,
|
|
811
|
-
"aria-label": stringFormatter.format(
|
|
838
|
+
"aria-label": stringFormatter.format("clear"),
|
|
812
839
|
excludeFromTabOrder: true,
|
|
813
|
-
UNSAFE_className: $aWXRc$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($1e139f06a0a4b696$exports)),
|
|
840
|
+
UNSAFE_className: (0, $aWXRc$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($1e139f06a0a4b696$exports))), "spectrum-ClearButton"),
|
|
814
841
|
isDisabled: isDisabled
|
|
815
842
|
});
|
|
816
|
-
let loadingCircle = /*#__PURE__*/ ($parcel$interopDefault($aWXRc$react)).createElement($aWXRc$reactspectrumprogress.ProgressCircle, {
|
|
817
|
-
"aria-label": stringFormatter.format(
|
|
843
|
+
let loadingCircle = /*#__PURE__*/ (0, ($parcel$interopDefault($aWXRc$react))).createElement((0, $aWXRc$reactspectrumprogress.ProgressCircle), {
|
|
844
|
+
"aria-label": stringFormatter.format("loading"),
|
|
818
845
|
size: "S",
|
|
819
846
|
isIndeterminate: true,
|
|
820
|
-
UNSAFE_className: $aWXRc$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($1e139f06a0a4b696$exports)),
|
|
847
|
+
UNSAFE_className: (0, $aWXRc$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($1e139f06a0a4b696$exports))), "spectrum-Search-circleLoader", (0, $aWXRc$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($40cb3a00c193680f$exports))), "spectrum-Textfield-circleLoader"))
|
|
821
848
|
});
|
|
822
849
|
// Close the software keyboard on scroll to give the user a bigger area to scroll.
|
|
823
850
|
// But only do this if scrolling with touch, otherwise it can cause issues with touch
|
|
824
851
|
// screen readers.
|
|
825
|
-
let isTouchDown = $aWXRc$react.useRef(false);
|
|
852
|
+
let isTouchDown = (0, $aWXRc$react.useRef)(false);
|
|
826
853
|
let onTouchStart = ()=>{
|
|
827
854
|
isTouchDown.current = true;
|
|
828
855
|
};
|
|
829
856
|
let onTouchEnd = ()=>{
|
|
830
857
|
isTouchDown.current = false;
|
|
831
858
|
};
|
|
832
|
-
let onScroll = $aWXRc$react.useCallback(()=>{
|
|
859
|
+
let onScroll = (0, $aWXRc$react.useCallback)(()=>{
|
|
833
860
|
if (!inputRef.current || document.activeElement !== inputRef.current || !isTouchDown.current) return;
|
|
834
861
|
if (popoverRef.current) popoverRef.current.focus();
|
|
835
862
|
}, [
|
|
@@ -838,9 +865,9 @@ function $a9f98e219df0b64d$var$SearchAutocompleteTray(props) {
|
|
|
838
865
|
isTouchDown
|
|
839
866
|
]);
|
|
840
867
|
let inputValue = inputProps.value;
|
|
841
|
-
let lastInputValue = $aWXRc$react.useRef(inputValue);
|
|
842
|
-
$aWXRc$react.useEffect(()=>{
|
|
843
|
-
if (loadingState ===
|
|
868
|
+
let lastInputValue = (0, $aWXRc$react.useRef)(inputValue);
|
|
869
|
+
(0, $aWXRc$react.useEffect)(()=>{
|
|
870
|
+
if (loadingState === "filtering" && !showLoading) {
|
|
844
871
|
if (timeout.current === null) timeout.current = setTimeout(()=>{
|
|
845
872
|
setShowLoading(true);
|
|
846
873
|
}, 500);
|
|
@@ -851,7 +878,7 @@ function $a9f98e219df0b64d$var$SearchAutocompleteTray(props) {
|
|
|
851
878
|
setShowLoading(true);
|
|
852
879
|
}, 500);
|
|
853
880
|
}
|
|
854
|
-
} else if (loadingState !==
|
|
881
|
+
} else if (loadingState !== "filtering") {
|
|
855
882
|
// If loading is no longer happening, clear any timers and hide the loading circle
|
|
856
883
|
setShowLoading(false);
|
|
857
884
|
if (timeout.current !== null) {
|
|
@@ -867,27 +894,27 @@ function $a9f98e219df0b64d$var$SearchAutocompleteTray(props) {
|
|
|
867
894
|
]);
|
|
868
895
|
let onKeyDown = (e)=>{
|
|
869
896
|
// Close virtual keyboard, close tray, and fire onSubmit if user hits Enter w/o any focused options
|
|
870
|
-
if (e.key ===
|
|
897
|
+
if (e.key === "Enter" && state.selectionManager.focusedKey == null) {
|
|
871
898
|
var ref;
|
|
872
899
|
(ref = popoverRef.current) === null || ref === void 0 ? void 0 : ref.focus();
|
|
873
900
|
if (onClose) onClose();
|
|
874
901
|
if (onSubmit) onSubmit(inputValue == null ? null : inputValue.toString(), null);
|
|
875
902
|
} else if (inputProps.onKeyDown) inputProps.onKeyDown(e);
|
|
876
903
|
};
|
|
877
|
-
if (icon) icon = /*#__PURE__*/ ($parcel$interopDefault($aWXRc$react)).cloneElement(icon, {
|
|
878
|
-
UNSAFE_className: $aWXRc$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($40cb3a00c193680f$exports)),
|
|
879
|
-
size:
|
|
904
|
+
if (icon) icon = /*#__PURE__*/ (0, ($parcel$interopDefault($aWXRc$react))).cloneElement(icon, {
|
|
905
|
+
UNSAFE_className: (0, $aWXRc$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($40cb3a00c193680f$exports))), "spectrum-Textfield-icon"),
|
|
906
|
+
size: "S"
|
|
880
907
|
});
|
|
881
|
-
return
|
|
908
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($aWXRc$react))).createElement((0, $aWXRc$reactariafocus.FocusScope), {
|
|
882
909
|
restoreFocus: true,
|
|
883
910
|
contain: true
|
|
884
|
-
}, /*#__PURE__*/ ($parcel$interopDefault($aWXRc$react)).createElement("div", {
|
|
885
|
-
|
|
911
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($aWXRc$react))).createElement("div", {
|
|
912
|
+
...(0, $aWXRc$reactariautils.mergeProps)(overlayProps, dialogProps),
|
|
886
913
|
ref: popoverRef,
|
|
887
|
-
className: $aWXRc$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($83da5c2df967875d$exports)),
|
|
888
|
-
}, /*#__PURE__*/ ($parcel$interopDefault($aWXRc$react)).createElement($aWXRc$reactariaoverlays.DismissButton, {
|
|
914
|
+
className: (0, $aWXRc$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($83da5c2df967875d$exports))), "tray-dialog")
|
|
915
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($aWXRc$react))).createElement((0, $aWXRc$reactariaoverlays.DismissButton), {
|
|
889
916
|
onDismiss: onClose
|
|
890
|
-
}), /*#__PURE__*/ ($parcel$interopDefault($aWXRc$react)).createElement($aWXRc$reactspectrumtextfield.TextFieldBase, {
|
|
917
|
+
}), /*#__PURE__*/ (0, ($parcel$interopDefault($aWXRc$react))).createElement((0, $aWXRc$reactspectrumtextfield.TextFieldBase), {
|
|
891
918
|
label: label,
|
|
892
919
|
labelProps: labelProps,
|
|
893
920
|
inputProps: {
|
|
@@ -896,20 +923,20 @@ function $a9f98e219df0b64d$var$SearchAutocompleteTray(props) {
|
|
|
896
923
|
},
|
|
897
924
|
inputRef: inputRef,
|
|
898
925
|
isDisabled: isDisabled,
|
|
899
|
-
isLoading: showLoading && loadingState ===
|
|
926
|
+
isLoading: showLoading && loadingState === "filtering",
|
|
900
927
|
loadingIndicator: loadingState != null ? loadingCircle : undefined,
|
|
901
928
|
validationState: validationState,
|
|
902
|
-
wrapperChildren: (state.inputValue !==
|
|
929
|
+
wrapperChildren: (state.inputValue !== "" || loadingState === "filtering" || validationState != null) && !props.isReadOnly ? clearButton : undefined,
|
|
903
930
|
icon: icon,
|
|
904
|
-
UNSAFE_className: $aWXRc$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($1e139f06a0a4b696$exports)),
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
}, $aWXRc$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($83da5c2df967875d$exports)),
|
|
908
|
-
|
|
931
|
+
UNSAFE_className: (0, $aWXRc$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($1e139f06a0a4b696$exports))), "spectrum-Search", "spectrum-Textfield", "spectrum-Search--loadable", {
|
|
932
|
+
"spectrum-Search--invalid": validationState === "invalid" && !isDisabled,
|
|
933
|
+
"spectrum-Search--valid": validationState === "valid" && !isDisabled
|
|
934
|
+
}, (0, $aWXRc$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($83da5c2df967875d$exports))), "tray-textfield", {
|
|
935
|
+
"has-label": !!props.label
|
|
909
936
|
})),
|
|
910
|
-
inputClassName: $aWXRc$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($1e139f06a0a4b696$exports)),
|
|
911
|
-
validationIconClassName: $aWXRc$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($1e139f06a0a4b696$exports)),
|
|
912
|
-
}), /*#__PURE__*/ ($parcel$interopDefault($aWXRc$react)).createElement($aWXRc$reactspectrumlistbox.ListBoxBase, {
|
|
937
|
+
inputClassName: (0, $aWXRc$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($1e139f06a0a4b696$exports))), "spectrum-Search-input"),
|
|
938
|
+
validationIconClassName: (0, $aWXRc$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($1e139f06a0a4b696$exports))), "spectrum-Search-validationIcon")
|
|
939
|
+
}), /*#__PURE__*/ (0, ($parcel$interopDefault($aWXRc$react))).createElement((0, $aWXRc$reactspectrumlistbox.ListBoxBase), {
|
|
913
940
|
...listBoxProps,
|
|
914
941
|
domProps: {
|
|
915
942
|
onTouchStart: onTouchStart,
|
|
@@ -921,18 +948,17 @@ function $a9f98e219df0b64d$var$SearchAutocompleteTray(props) {
|
|
|
921
948
|
layout: layout,
|
|
922
949
|
state: state,
|
|
923
950
|
shouldUseVirtualFocus: true,
|
|
924
|
-
renderEmptyState: ()=>loadingState !==
|
|
925
|
-
className: $aWXRc$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($83da5c2df967875d$exports)),
|
|
926
|
-
}, stringFormatter.format(
|
|
927
|
-
,
|
|
928
|
-
UNSAFE_className: $aWXRc$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($83da5c2df967875d$exports)), 'tray-listbox'),
|
|
951
|
+
renderEmptyState: ()=>loadingState !== "loading" && /*#__PURE__*/ (0, ($parcel$interopDefault($aWXRc$react))).createElement("span", {
|
|
952
|
+
className: (0, $aWXRc$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($83da5c2df967875d$exports))), "no-results")
|
|
953
|
+
}, stringFormatter.format("noResults")),
|
|
954
|
+
UNSAFE_className: (0, $aWXRc$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($83da5c2df967875d$exports))), "tray-listbox"),
|
|
929
955
|
ref: listBoxRef,
|
|
930
956
|
onScroll: onScroll,
|
|
931
957
|
onLoadMore: onLoadMore,
|
|
932
|
-
isLoading: loadingState ===
|
|
933
|
-
}), /*#__PURE__*/ ($parcel$interopDefault($aWXRc$react)).createElement($aWXRc$reactariaoverlays.DismissButton, {
|
|
958
|
+
isLoading: loadingState === "loading" || loadingState === "loadingMore"
|
|
959
|
+
}), /*#__PURE__*/ (0, ($parcel$interopDefault($aWXRc$react))).createElement((0, $aWXRc$reactariaoverlays.DismissButton), {
|
|
934
960
|
onDismiss: onClose
|
|
935
|
-
})))
|
|
961
|
+
})));
|
|
936
962
|
}
|
|
937
963
|
|
|
938
964
|
|
|
@@ -951,46 +977,44 @@ function $a9f98e219df0b64d$var$SearchAutocompleteTray(props) {
|
|
|
951
977
|
|
|
952
978
|
|
|
953
979
|
function $dcf500d58a031ca6$var$SearchAutocomplete(props, ref) {
|
|
954
|
-
props = $aWXRc$reactspectrumprovider.useProviderProps(props);
|
|
955
|
-
if (props.placeholder) console.warn(
|
|
956
|
-
let isMobile = $aWXRc$reactspectrumutils.useIsMobileDevice();
|
|
980
|
+
props = (0, $aWXRc$reactspectrumprovider.useProviderProps)(props);
|
|
981
|
+
if (props.placeholder) console.warn("Placeholders are deprecated due to accessibility issues. Please use help text instead.");
|
|
982
|
+
let isMobile = (0, $aWXRc$reactspectrumutils.useIsMobileDevice)();
|
|
957
983
|
if (isMobile) // menuTrigger=focus/manual don't apply to mobile searchwithin
|
|
958
|
-
return
|
|
984
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($aWXRc$react))).createElement((0, $a9f98e219df0b64d$export$e7a90f7d6b078162), {
|
|
959
985
|
...props,
|
|
960
986
|
menuTrigger: "input",
|
|
961
987
|
ref: ref
|
|
962
|
-
})
|
|
963
|
-
else return
|
|
988
|
+
});
|
|
989
|
+
else return /*#__PURE__*/ (0, ($parcel$interopDefault($aWXRc$react))).createElement($dcf500d58a031ca6$var$SearchAutocompleteBase, {
|
|
964
990
|
...props,
|
|
965
991
|
ref: ref
|
|
966
|
-
})
|
|
992
|
+
});
|
|
967
993
|
}
|
|
968
994
|
function $dcf500d58a031ca6$var$_SearchAutocompleteBase(props, ref) {
|
|
969
|
-
props = $aWXRc$reactspectrumprovider.useProviderProps(props);
|
|
970
|
-
let { menuTrigger: menuTrigger =
|
|
971
|
-
|
|
972
|
-
let stringFormatter = $aWXRc$reactariai18n.useLocalizedStringFormatter((/*@__PURE__*/$parcel$interopDefault($ccb60979256717ac$exports)));
|
|
995
|
+
props = (0, $aWXRc$reactspectrumprovider.useProviderProps)(props);
|
|
996
|
+
let { menuTrigger: menuTrigger = "input" , shouldFlip: shouldFlip = true , direction: direction = "bottom" , isQuiet: isQuiet , loadingState: loadingState , onLoadMore: onLoadMore , onSubmit: onSubmit = ()=>{} } = props;
|
|
997
|
+
let stringFormatter = (0, $aWXRc$reactariai18n.useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($ccb60979256717ac$exports))));
|
|
973
998
|
let isAsync = loadingState != null;
|
|
974
|
-
let popoverRef = $aWXRc$react.useRef(null);
|
|
975
|
-
let unwrappedPopoverRef = $aWXRc$reactspectrumutils.useUnwrapDOMRef(popoverRef);
|
|
976
|
-
let listBoxRef = $aWXRc$react.useRef(null);
|
|
977
|
-
let inputRef = $aWXRc$react.useRef(null);
|
|
978
|
-
let domRef = $aWXRc$reactspectrumutils.useFocusableRef(ref, inputRef);
|
|
979
|
-
let { contains: contains } = $aWXRc$reactariai18n.useFilter({
|
|
980
|
-
sensitivity:
|
|
999
|
+
let popoverRef = (0, $aWXRc$react.useRef)(null);
|
|
1000
|
+
let unwrappedPopoverRef = (0, $aWXRc$reactspectrumutils.useUnwrapDOMRef)(popoverRef);
|
|
1001
|
+
let listBoxRef = (0, $aWXRc$react.useRef)(null);
|
|
1002
|
+
let inputRef = (0, $aWXRc$react.useRef)(null);
|
|
1003
|
+
let domRef = (0, $aWXRc$reactspectrumutils.useFocusableRef)(ref, inputRef);
|
|
1004
|
+
let { contains: contains } = (0, $aWXRc$reactariai18n.useFilter)({
|
|
1005
|
+
sensitivity: "base"
|
|
981
1006
|
});
|
|
982
|
-
let state = $aWXRc$reactstatelycombobox.useComboBoxState({
|
|
1007
|
+
let state = (0, $aWXRc$reactstatelycombobox.useComboBoxState)({
|
|
983
1008
|
...props,
|
|
984
1009
|
defaultFilter: contains,
|
|
985
1010
|
allowsEmptyCollection: isAsync,
|
|
986
1011
|
allowsCustomValue: true,
|
|
987
|
-
onSelectionChange: (key)=>key !== null && onSubmit(null, key)
|
|
988
|
-
,
|
|
1012
|
+
onSelectionChange: (key)=>key !== null && onSubmit(null, key),
|
|
989
1013
|
selectedKey: undefined,
|
|
990
1014
|
defaultSelectedKey: undefined
|
|
991
1015
|
});
|
|
992
|
-
let layout = $aWXRc$reactspectrumlistbox.useListBoxLayout(state);
|
|
993
|
-
let { inputProps: inputProps , listBoxProps: listBoxProps , labelProps: labelProps , clearButtonProps: clearButtonProps } = $aWXRc$reactariaautocomplete.useSearchAutocomplete({
|
|
1016
|
+
let layout = (0, $aWXRc$reactspectrumlistbox.useListBoxLayout)(state);
|
|
1017
|
+
let { inputProps: inputProps , listBoxProps: listBoxProps , labelProps: labelProps , clearButtonProps: clearButtonProps } = (0, $aWXRc$reactariaautocomplete.useSearchAutocomplete)({
|
|
994
1018
|
...props,
|
|
995
1019
|
keyboardDelegate: layout,
|
|
996
1020
|
popoverRef: unwrappedPopoverRef,
|
|
@@ -999,9 +1023,9 @@ function $dcf500d58a031ca6$var$_SearchAutocompleteBase(props, ref) {
|
|
|
999
1023
|
menuTrigger: menuTrigger
|
|
1000
1024
|
}, state);
|
|
1001
1025
|
// Measure the width of the inputfield to inform the width of the menu (below).
|
|
1002
|
-
let [menuWidth, setMenuWidth] = $aWXRc$react.useState(0);
|
|
1003
|
-
let { scale: scale } = $aWXRc$reactspectrumprovider.useProvider();
|
|
1004
|
-
let onResize = $aWXRc$react.useCallback(()=>{
|
|
1026
|
+
let [menuWidth, setMenuWidth] = (0, $aWXRc$react.useState)(0);
|
|
1027
|
+
let { scale: scale } = (0, $aWXRc$reactspectrumprovider.useProvider)();
|
|
1028
|
+
let onResize = (0, $aWXRc$react.useCallback)(()=>{
|
|
1005
1029
|
if (inputRef.current) {
|
|
1006
1030
|
let inputWidth = inputRef.current.offsetWidth;
|
|
1007
1031
|
setMenuWidth(inputWidth);
|
|
@@ -1010,11 +1034,11 @@ function $dcf500d58a031ca6$var$_SearchAutocompleteBase(props, ref) {
|
|
|
1010
1034
|
inputRef,
|
|
1011
1035
|
setMenuWidth
|
|
1012
1036
|
]);
|
|
1013
|
-
$aWXRc$reactspectrumutils.useResizeObserver({
|
|
1037
|
+
(0, $aWXRc$reactspectrumutils.useResizeObserver)({
|
|
1014
1038
|
ref: domRef,
|
|
1015
1039
|
onResize: onResize
|
|
1016
1040
|
});
|
|
1017
|
-
$aWXRc$reactariautils.useLayoutEffect(onResize, [
|
|
1041
|
+
(0, $aWXRc$reactariautils.useLayoutEffect)(onResize, [
|
|
1018
1042
|
scale,
|
|
1019
1043
|
onResize
|
|
1020
1044
|
]);
|
|
@@ -1022,22 +1046,22 @@ function $dcf500d58a031ca6$var$_SearchAutocompleteBase(props, ref) {
|
|
|
1022
1046
|
width: isQuiet ? undefined : menuWidth,
|
|
1023
1047
|
minWidth: isQuiet ? `calc(${menuWidth}px + calc(2 * var(--spectrum-dropdown-quiet-offset)))` : menuWidth
|
|
1024
1048
|
};
|
|
1025
|
-
return
|
|
1049
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($aWXRc$react))).createElement((0, ($parcel$interopDefault($aWXRc$react))).Fragment, null, /*#__PURE__*/ (0, ($parcel$interopDefault($aWXRc$react))).createElement((0, $aWXRc$reactspectrumlabel.Field), {
|
|
1026
1050
|
...props,
|
|
1027
1051
|
labelProps: labelProps,
|
|
1028
1052
|
ref: domRef
|
|
1029
|
-
}, /*#__PURE__*/ ($parcel$interopDefault($aWXRc$react)).createElement($dcf500d58a031ca6$var$SearchAutocompleteInput, {
|
|
1053
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($aWXRc$react))).createElement($dcf500d58a031ca6$var$SearchAutocompleteInput, {
|
|
1030
1054
|
...props,
|
|
1031
1055
|
isOpen: state.isOpen,
|
|
1032
1056
|
loadingState: loadingState,
|
|
1033
1057
|
inputProps: inputProps,
|
|
1034
1058
|
inputRef: inputRef,
|
|
1035
1059
|
clearButtonProps: clearButtonProps
|
|
1036
|
-
})), /*#__PURE__*/ ($parcel$interopDefault($aWXRc$react)).createElement($aWXRc$reactspectrumoverlays.Popover, {
|
|
1060
|
+
})), /*#__PURE__*/ (0, ($parcel$interopDefault($aWXRc$react))).createElement((0, $aWXRc$reactspectrumoverlays.Popover), {
|
|
1037
1061
|
state: state,
|
|
1038
1062
|
UNSAFE_style: style,
|
|
1039
|
-
UNSAFE_className: $aWXRc$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($2f86633ce5b04f1e$exports)),
|
|
1040
|
-
|
|
1063
|
+
UNSAFE_className: (0, $aWXRc$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($2f86633ce5b04f1e$exports))), "spectrum-InputGroup-popover", {
|
|
1064
|
+
"spectrum-InputGroup-popover--quiet": isQuiet
|
|
1041
1065
|
}),
|
|
1042
1066
|
ref: popoverRef,
|
|
1043
1067
|
triggerRef: inputRef,
|
|
@@ -1045,7 +1069,7 @@ function $dcf500d58a031ca6$var$_SearchAutocompleteBase(props, ref) {
|
|
|
1045
1069
|
hideArrow: true,
|
|
1046
1070
|
isNonModal: true,
|
|
1047
1071
|
shouldFlip: shouldFlip
|
|
1048
|
-
}, /*#__PURE__*/ ($parcel$interopDefault($aWXRc$react)).createElement($aWXRc$reactspectrumlistbox.ListBoxBase, {
|
|
1072
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($aWXRc$react))).createElement((0, $aWXRc$reactspectrumlistbox.ListBoxBase), {
|
|
1049
1073
|
...listBoxProps,
|
|
1050
1074
|
ref: listBoxRef,
|
|
1051
1075
|
disallowEmptySelection: true,
|
|
@@ -1055,40 +1079,39 @@ function $dcf500d58a031ca6$var$_SearchAutocompleteBase(props, ref) {
|
|
|
1055
1079
|
layout: layout,
|
|
1056
1080
|
state: state,
|
|
1057
1081
|
shouldUseVirtualFocus: true,
|
|
1058
|
-
isLoading: loadingState ===
|
|
1082
|
+
isLoading: loadingState === "loadingMore",
|
|
1059
1083
|
onLoadMore: onLoadMore,
|
|
1060
|
-
renderEmptyState: ()=>isAsync && /*#__PURE__*/ ($parcel$interopDefault($aWXRc$react)).createElement("span", null, stringFormatter.format(
|
|
1061
|
-
})))
|
|
1084
|
+
renderEmptyState: ()=>isAsync && /*#__PURE__*/ (0, ($parcel$interopDefault($aWXRc$react))).createElement("span", null, stringFormatter.format("noResults"))
|
|
1085
|
+
})));
|
|
1062
1086
|
}
|
|
1063
|
-
let $dcf500d58a031ca6$var$SearchAutocompleteBase = /*#__PURE__*/ ($parcel$interopDefault($aWXRc$react)).forwardRef($dcf500d58a031ca6$var$_SearchAutocompleteBase);
|
|
1087
|
+
let $dcf500d58a031ca6$var$SearchAutocompleteBase = /*#__PURE__*/ (0, ($parcel$interopDefault($aWXRc$react))).forwardRef($dcf500d58a031ca6$var$_SearchAutocompleteBase);
|
|
1064
1088
|
// any type is because we don't want to call useObjectRef because this is an internal component and we know
|
|
1065
1089
|
// we are always passing an object ref
|
|
1066
1090
|
function $dcf500d58a031ca6$var$_SearchAutocompleteInput(props, ref) {
|
|
1067
|
-
let searchIcon = /*#__PURE__*/ ($parcel$interopDefault($aWXRc$react)).createElement(($parcel$interopDefault($aWXRc$spectrumiconsuiMagnifier)), {
|
|
1091
|
+
let searchIcon = /*#__PURE__*/ (0, ($parcel$interopDefault($aWXRc$react))).createElement((0, ($parcel$interopDefault($aWXRc$spectrumiconsuiMagnifier))), {
|
|
1068
1092
|
"data-testid": "searchicon"
|
|
1069
1093
|
});
|
|
1070
1094
|
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;
|
|
1071
|
-
let { hoverProps: hoverProps , isHovered: isHovered } = $aWXRc$reactariainteractions.useHover({
|
|
1072
|
-
|
|
1073
|
-
let
|
|
1074
|
-
let
|
|
1075
|
-
let
|
|
1076
|
-
|
|
1077
|
-
"aria-label": stringFormatter.format('loading'),
|
|
1095
|
+
let { hoverProps: hoverProps , isHovered: isHovered } = (0, $aWXRc$reactariainteractions.useHover)({});
|
|
1096
|
+
let stringFormatter = (0, $aWXRc$reactariai18n.useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($ccb60979256717ac$exports))));
|
|
1097
|
+
let timeout = (0, $aWXRc$react.useRef)(null);
|
|
1098
|
+
let [showLoading, setShowLoading] = (0, $aWXRc$react.useState)(false);
|
|
1099
|
+
let loadingCircle = /*#__PURE__*/ (0, ($parcel$interopDefault($aWXRc$react))).createElement((0, $aWXRc$reactspectrumprogress.ProgressCircle), {
|
|
1100
|
+
"aria-label": stringFormatter.format("loading"),
|
|
1078
1101
|
size: "S",
|
|
1079
1102
|
isIndeterminate: true,
|
|
1080
|
-
UNSAFE_className: $aWXRc$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($40cb3a00c193680f$exports)),
|
|
1103
|
+
UNSAFE_className: (0, $aWXRc$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($40cb3a00c193680f$exports))), "spectrum-Textfield-circleLoader", (0, $aWXRc$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($2f86633ce5b04f1e$exports))), "spectrum-InputGroup-input-circleLoader"))
|
|
1081
1104
|
});
|
|
1082
|
-
let clearButton = /*#__PURE__*/ ($parcel$interopDefault($aWXRc$react)).createElement($aWXRc$reactspectrumbutton.ClearButton, {
|
|
1105
|
+
let clearButton = /*#__PURE__*/ (0, ($parcel$interopDefault($aWXRc$react))).createElement((0, $aWXRc$reactspectrumbutton.ClearButton), {
|
|
1083
1106
|
...clearButtonProps,
|
|
1084
1107
|
preventFocus: true,
|
|
1085
|
-
UNSAFE_className: $aWXRc$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($1e139f06a0a4b696$exports)),
|
|
1108
|
+
UNSAFE_className: (0, $aWXRc$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($1e139f06a0a4b696$exports))), "spectrum-ClearButton"),
|
|
1086
1109
|
isDisabled: isDisabled
|
|
1087
1110
|
});
|
|
1088
|
-
let isLoading = loadingState ===
|
|
1111
|
+
let isLoading = loadingState === "loading" || loadingState === "filtering";
|
|
1089
1112
|
let inputValue = inputProps.value;
|
|
1090
|
-
let lastInputValue = $aWXRc$react.useRef(inputValue);
|
|
1091
|
-
$aWXRc$react.useEffect(()=>{
|
|
1113
|
+
let lastInputValue = (0, $aWXRc$react.useRef)(inputValue);
|
|
1114
|
+
(0, $aWXRc$react.useEffect)(()=>{
|
|
1092
1115
|
if (isLoading && !showLoading) {
|
|
1093
1116
|
if (timeout.current === null) timeout.current = setTimeout(()=>{
|
|
1094
1117
|
setShowLoading(true);
|
|
@@ -1114,46 +1137,46 @@ function $dcf500d58a031ca6$var$_SearchAutocompleteInput(props, ref) {
|
|
|
1114
1137
|
showLoading,
|
|
1115
1138
|
inputValue
|
|
1116
1139
|
]);
|
|
1117
|
-
return
|
|
1140
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($aWXRc$react))).createElement((0, $aWXRc$reactariafocus.FocusRing), {
|
|
1118
1141
|
within: true,
|
|
1119
1142
|
isTextInput: true,
|
|
1120
|
-
focusClass: $aWXRc$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($2f86633ce5b04f1e$exports)),
|
|
1121
|
-
focusRingClass: $aWXRc$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($2f86633ce5b04f1e$exports)),
|
|
1143
|
+
focusClass: (0, $aWXRc$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($2f86633ce5b04f1e$exports))), "is-focused"),
|
|
1144
|
+
focusRingClass: (0, $aWXRc$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($2f86633ce5b04f1e$exports))), "focus-ring"),
|
|
1122
1145
|
autoFocus: autoFocus
|
|
1123
|
-
}, /*#__PURE__*/ ($parcel$interopDefault($aWXRc$react)).createElement("div", {
|
|
1146
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($aWXRc$react))).createElement("div", {
|
|
1124
1147
|
...hoverProps,
|
|
1125
1148
|
ref: ref,
|
|
1126
1149
|
style: style,
|
|
1127
|
-
className: $aWXRc$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($2f86633ce5b04f1e$exports)),
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
}, $aWXRc$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($83da5c2df967875d$exports)),
|
|
1133
|
-
}, /*#__PURE__*/ ($parcel$interopDefault($aWXRc$react)).createElement($aWXRc$reactspectrumtextfield.TextFieldBase, {
|
|
1150
|
+
className: (0, $aWXRc$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($2f86633ce5b04f1e$exports))), "spectrum-InputGroup", {
|
|
1151
|
+
"spectrum-InputGroup--quiet": isQuiet,
|
|
1152
|
+
"is-disabled": isDisabled,
|
|
1153
|
+
"spectrum-InputGroup--invalid": validationState === "invalid" && !isDisabled,
|
|
1154
|
+
"is-hovered": isHovered
|
|
1155
|
+
}, (0, $aWXRc$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($83da5c2df967875d$exports))), "searchautocomplete"), className)
|
|
1156
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($aWXRc$react))).createElement((0, $aWXRc$reactspectrumtextfield.TextFieldBase), {
|
|
1134
1157
|
inputProps: inputProps,
|
|
1135
1158
|
inputRef: inputRef,
|
|
1136
|
-
UNSAFE_className: $aWXRc$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($1e139f06a0a4b696$exports)),
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
}, $aWXRc$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($2f86633ce5b04f1e$exports)),
|
|
1142
|
-
inputClassName: $aWXRc$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($1e139f06a0a4b696$exports)),
|
|
1159
|
+
UNSAFE_className: (0, $aWXRc$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($1e139f06a0a4b696$exports))), "spectrum-Search", "spectrum-Textfield", {
|
|
1160
|
+
"is-disabled": isDisabled,
|
|
1161
|
+
"is-quiet": isQuiet,
|
|
1162
|
+
"spectrum-Search--invalid": validationState === "invalid" && !isDisabled,
|
|
1163
|
+
"spectrum-Search--valid": validationState === "valid" && !isDisabled
|
|
1164
|
+
}, (0, $aWXRc$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($2f86633ce5b04f1e$exports))), "spectrum-InputGroup-field")),
|
|
1165
|
+
inputClassName: (0, $aWXRc$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($1e139f06a0a4b696$exports))), "spectrum-Search-input"),
|
|
1143
1166
|
isDisabled: isDisabled,
|
|
1144
1167
|
isQuiet: isQuiet,
|
|
1145
1168
|
validationState: validationState,
|
|
1146
|
-
isLoading: showLoading && (isOpen || menuTrigger ===
|
|
1169
|
+
isLoading: showLoading && (isOpen || menuTrigger === "manual" || loadingState === "loading"),
|
|
1147
1170
|
loadingIndicator: loadingState != null ? loadingCircle : undefined,
|
|
1148
1171
|
icon: icon,
|
|
1149
|
-
wrapperChildren: inputValue !==
|
|
1172
|
+
wrapperChildren: inputValue !== "" && !isReadOnly ? clearButton : undefined,
|
|
1150
1173
|
disableFocusRing: true
|
|
1151
|
-
})))
|
|
1174
|
+
})));
|
|
1152
1175
|
}
|
|
1153
|
-
let $dcf500d58a031ca6$var$SearchAutocompleteInput = /*#__PURE__*/ ($parcel$interopDefault($aWXRc$react)).forwardRef($dcf500d58a031ca6$var$_SearchAutocompleteInput);
|
|
1176
|
+
let $dcf500d58a031ca6$var$SearchAutocompleteInput = /*#__PURE__*/ (0, ($parcel$interopDefault($aWXRc$react))).forwardRef($dcf500d58a031ca6$var$_SearchAutocompleteInput);
|
|
1154
1177
|
/**
|
|
1155
1178
|
* A SearchAutocomplete is a searchfield that supports a dynamic list of suggestions.
|
|
1156
|
-
*/ let $dcf500d58a031ca6$export$dd65332a5b19fa63 = /*#__PURE__*/ $aWXRc$react.forwardRef($dcf500d58a031ca6$var$SearchAutocomplete);
|
|
1179
|
+
*/ let $dcf500d58a031ca6$export$dd65332a5b19fa63 = /*#__PURE__*/ (0, $aWXRc$react.forwardRef)($dcf500d58a031ca6$var$SearchAutocomplete);
|
|
1157
1180
|
|
|
1158
1181
|
|
|
1159
1182
|
|