@react-spectrum/autocomplete 3.0.0-alpha.31 → 3.0.0-alpha.32
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/MobileSearchAutocomplete.main.js +83 -83
- package/dist/MobileSearchAutocomplete.mjs +84 -84
- package/dist/MobileSearchAutocomplete.module.js +83 -83
- package/dist/SearchAutocomplete.main.js +34 -34
- package/dist/SearchAutocomplete.mjs +35 -35
- package/dist/SearchAutocomplete.module.js +34 -34
- package/dist/ar-AE.mjs +1 -1
- package/dist/bg-BG.mjs +1 -1
- package/dist/cs-CZ.mjs +1 -1
- package/dist/da-DK.mjs +1 -1
- package/dist/de-DE.mjs +1 -1
- package/dist/el-GR.mjs +1 -1
- package/dist/en-US.mjs +1 -1
- package/dist/es-ES.mjs +1 -1
- package/dist/et-EE.mjs +1 -1
- package/dist/fi-FI.mjs +1 -1
- package/dist/fr-FR.mjs +1 -1
- package/dist/he-IL.mjs +1 -1
- package/dist/hr-HR.mjs +1 -1
- package/dist/hu-HU.mjs +1 -1
- package/dist/inputgroup_vars_css.mjs +1 -1
- package/dist/intlStrings.mjs +1 -1
- package/dist/it-IT.mjs +1 -1
- package/dist/ja-JP.mjs +1 -1
- package/dist/ko-KR.mjs +1 -1
- package/dist/lt-LT.mjs +1 -1
- package/dist/lv-LV.mjs +1 -1
- package/dist/nb-NO.mjs +1 -1
- package/dist/nl-NL.mjs +1 -1
- package/dist/pl-PL.mjs +1 -1
- package/dist/pt-BR.mjs +1 -1
- package/dist/pt-PT.mjs +1 -1
- package/dist/ro-RO.mjs +1 -1
- package/dist/ru-RU.mjs +1 -1
- package/dist/search_vars_css.mjs +1 -1
- package/dist/searchautocomplete_css.mjs +1 -1
- package/dist/sk-SK.mjs +1 -1
- package/dist/sl-SI.mjs +1 -1
- package/dist/sr-SP.mjs +1 -1
- package/dist/sv-SE.mjs +1 -1
- package/dist/textfield_vars_css.mjs +1 -1
- package/dist/tr-TR.mjs +1 -1
- package/dist/uk-UA.mjs +1 -1
- package/dist/zh-CN.mjs +1 -1
- package/dist/zh-TW.mjs +1 -1
- package/package.json +26 -26
|
@@ -83,7 +83,7 @@ function $a9f98e219df0b64d$var$_MobileSearchAutocomplete(props, ref) {
|
|
|
83
83
|
props = (0, $56uON$reactspectrumprovider.useProviderProps)(props);
|
|
84
84
|
let { isQuiet: isQuiet, isDisabled: isDisabled, isRequired: isRequired, validationBehavior: validationBehavior, validate: validate, name: name, isReadOnly: isReadOnly, onSubmit: onSubmit = ()=>{} } = props;
|
|
85
85
|
let { contains: contains } = (0, $56uON$reactariai18n.useFilter)({
|
|
86
|
-
sensitivity:
|
|
86
|
+
sensitivity: 'base'
|
|
87
87
|
});
|
|
88
88
|
let state = (0, $56uON$reactstatelycombobox.useComboBoxState)({
|
|
89
89
|
...props,
|
|
@@ -104,7 +104,7 @@ function $a9f98e219df0b64d$var$_MobileSearchAutocomplete(props, ref) {
|
|
|
104
104
|
let buttonRef = (0, $56uON$react.useRef)(null);
|
|
105
105
|
let domRef = (0, $56uON$reactspectrumutils.useFocusableRef)(ref, buttonRef);
|
|
106
106
|
let { triggerProps: triggerProps, overlayProps: overlayProps } = (0, $56uON$reactariaoverlays.useOverlayTrigger)({
|
|
107
|
-
type:
|
|
107
|
+
type: 'listbox'
|
|
108
108
|
}, state, buttonRef);
|
|
109
109
|
let inputRef = (0, $56uON$react.useRef)(null);
|
|
110
110
|
(0, $56uON$reactariaform.useFormValidation)({
|
|
@@ -115,12 +115,12 @@ function $a9f98e219df0b64d$var$_MobileSearchAutocomplete(props, ref) {
|
|
|
115
115
|
}
|
|
116
116
|
}, state, inputRef);
|
|
117
117
|
let { isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = state.displayValidation;
|
|
118
|
-
let validationState = props.validationState || (isInvalid ?
|
|
118
|
+
let validationState = props.validationState || (isInvalid ? 'invalid' : undefined);
|
|
119
119
|
var _props_errorMessage;
|
|
120
|
-
let errorMessage = (_props_errorMessage = props.errorMessage) !== null && _props_errorMessage !== void 0 ? _props_errorMessage : validationErrors.join(
|
|
120
|
+
let errorMessage = (_props_errorMessage = props.errorMessage) !== null && _props_errorMessage !== void 0 ? _props_errorMessage : validationErrors.join(' ');
|
|
121
121
|
let { labelProps: labelProps, fieldProps: fieldProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps } = (0, $56uON$reactarialabel.useField)({
|
|
122
122
|
...props,
|
|
123
|
-
labelElementType:
|
|
123
|
+
labelElementType: 'span',
|
|
124
124
|
isInvalid: isInvalid,
|
|
125
125
|
errorMessage: errorMessage
|
|
126
126
|
});
|
|
@@ -128,18 +128,18 @@ function $a9f98e219df0b64d$var$_MobileSearchAutocomplete(props, ref) {
|
|
|
128
128
|
labelProps.onClick = ()=>{
|
|
129
129
|
if (!props.isDisabled && buttonRef.current) {
|
|
130
130
|
buttonRef.current.focus();
|
|
131
|
-
(0, $56uON$reactariainteractions.setInteractionModality)(
|
|
131
|
+
(0, $56uON$reactariainteractions.setInteractionModality)('keyboard');
|
|
132
132
|
}
|
|
133
133
|
};
|
|
134
134
|
let inputProps = {
|
|
135
|
-
type:
|
|
135
|
+
type: 'hidden',
|
|
136
136
|
name: name,
|
|
137
137
|
value: state.inputValue
|
|
138
138
|
};
|
|
139
|
-
if (validationBehavior ===
|
|
139
|
+
if (validationBehavior === 'native') {
|
|
140
140
|
// Use a hidden <input type="text"> rather than <input type="hidden">
|
|
141
141
|
// so that an empty value blocks HTML form submission when the field is required.
|
|
142
|
-
inputProps.type =
|
|
142
|
+
inputProps.type = 'text';
|
|
143
143
|
inputProps.hidden = true;
|
|
144
144
|
inputProps.required = isRequired;
|
|
145
145
|
// Ignore react warning.
|
|
@@ -169,9 +169,9 @@ function $a9f98e219df0b64d$var$_MobileSearchAutocomplete(props, ref) {
|
|
|
169
169
|
isPlaceholder: !state.inputValue,
|
|
170
170
|
validationState: validationState,
|
|
171
171
|
inputValue: state.inputValue,
|
|
172
|
-
clearInput: ()=>state.setInputValue(
|
|
173
|
-
onPress: ()=>!isReadOnly && state.open(null,
|
|
174
|
-
}, state.inputValue || props.placeholder ||
|
|
172
|
+
clearInput: ()=>state.setInputValue(''),
|
|
173
|
+
onPress: ()=>!isReadOnly && state.open(null, 'manual')
|
|
174
|
+
}, state.inputValue || props.placeholder || '')), /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).createElement("input", {
|
|
175
175
|
...inputProps,
|
|
176
176
|
ref: inputRef
|
|
177
177
|
}), /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).createElement((0, $56uON$reactspectrumoverlays.Tray), {
|
|
@@ -193,16 +193,16 @@ const $a9f98e219df0b64d$var$SearchAutocompleteButton = /*#__PURE__*/ (0, ($parce
|
|
|
193
193
|
"data-testid": "searchicon"
|
|
194
194
|
});
|
|
195
195
|
let { icon: icon = searchIcon, isQuiet: isQuiet, isDisabled: isDisabled, isReadOnly: isReadOnly, isPlaceholder: isPlaceholder, validationState: validationState, inputValue: inputValue, clearInput: clearInput, children: children, style: style, className: className } = props;
|
|
196
|
-
let stringFormatter = (0, $56uON$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($e32120882142a69f$exports))),
|
|
196
|
+
let stringFormatter = (0, $56uON$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($e32120882142a69f$exports))), '@react-spectrum/autocomplete');
|
|
197
197
|
let valueId = (0, $56uON$reactariautils.useId)();
|
|
198
198
|
let invalidId = (0, $56uON$reactariautils.useId)();
|
|
199
|
-
let validationIcon = validationState ===
|
|
199
|
+
let validationIcon = validationState === 'invalid' ? /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).createElement((0, ($parcel$interopDefault($56uON$spectrumiconsuiAlertMedium))), {
|
|
200
200
|
id: invalidId,
|
|
201
|
-
"aria-label": stringFormatter.format(
|
|
201
|
+
"aria-label": stringFormatter.format('invalid')
|
|
202
202
|
}) : /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).createElement((0, ($parcel$interopDefault($56uON$spectrumiconsuiCheckmarkMedium))), null);
|
|
203
203
|
if (icon) icon = /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).cloneElement(icon, {
|
|
204
|
-
UNSAFE_className: (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($40cb3a00c193680f$exports))),
|
|
205
|
-
size:
|
|
204
|
+
UNSAFE_className: (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($40cb3a00c193680f$exports))), 'spectrum-Textfield-icon'),
|
|
205
|
+
size: 'S'
|
|
206
206
|
});
|
|
207
207
|
let clearButton = /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).createElement((0, $56uON$reactspectrumbutton.ClearButton), {
|
|
208
208
|
onPress: (e)=>{
|
|
@@ -211,25 +211,25 @@ const $a9f98e219df0b64d$var$SearchAutocompleteButton = /*#__PURE__*/ (0, ($parce
|
|
|
211
211
|
props === null || props === void 0 ? void 0 : (_props_onPress = props.onPress) === null || _props_onPress === void 0 ? void 0 : _props_onPress.call(props, e);
|
|
212
212
|
},
|
|
213
213
|
preventFocus: true,
|
|
214
|
-
"aria-label": stringFormatter.format(
|
|
214
|
+
"aria-label": stringFormatter.format('clear'),
|
|
215
215
|
excludeFromTabOrder: true,
|
|
216
|
-
UNSAFE_className: (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($1e139f06a0a4b696$exports))),
|
|
216
|
+
UNSAFE_className: (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($1e139f06a0a4b696$exports))), 'spectrum-ClearButton'),
|
|
217
217
|
isDisabled: isDisabled
|
|
218
218
|
});
|
|
219
219
|
let validation = /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).cloneElement(validationIcon, {
|
|
220
|
-
UNSAFE_className: (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($40cb3a00c193680f$exports))),
|
|
220
|
+
UNSAFE_className: (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($40cb3a00c193680f$exports))), 'spectrum-Textfield-validationIcon', (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($2f86633ce5b04f1e$exports))), 'spectrum-InputGroup-input-validationIcon'), (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($1e139f06a0a4b696$exports))), 'spectrum-Search-validationIcon'))
|
|
221
221
|
});
|
|
222
222
|
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $56uON$reactariainteractions.useHover)({});
|
|
223
223
|
let { isFocused: isFocused, isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $56uON$reactariafocus.useFocusRing)();
|
|
224
224
|
let { buttonProps: buttonProps } = (0, $56uON$reactariabutton.useButton)({
|
|
225
225
|
...props,
|
|
226
|
-
|
|
227
|
-
props[
|
|
228
|
-
props[
|
|
226
|
+
'aria-labelledby': [
|
|
227
|
+
props['aria-labelledby'],
|
|
228
|
+
props['aria-label'] && !props['aria-labelledby'] ? props.id : null,
|
|
229
229
|
valueId,
|
|
230
|
-
validationState ===
|
|
231
|
-
].filter(Boolean).join(
|
|
232
|
-
elementType:
|
|
230
|
+
validationState === 'invalid' ? invalidId : null
|
|
231
|
+
].filter(Boolean).join(' '),
|
|
232
|
+
elementType: 'div'
|
|
233
233
|
}, ref);
|
|
234
234
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).createElement("div", {
|
|
235
235
|
...(0, $56uON$reactariautils.mergeProps)(hoverProps, focusProps, buttonProps),
|
|
@@ -237,40 +237,40 @@ const $a9f98e219df0b64d$var$SearchAutocompleteButton = /*#__PURE__*/ (0, ($parce
|
|
|
237
237
|
ref: ref,
|
|
238
238
|
style: {
|
|
239
239
|
...style,
|
|
240
|
-
outline:
|
|
240
|
+
outline: 'none'
|
|
241
241
|
},
|
|
242
|
-
className: (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($2f86633ce5b04f1e$exports))),
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
}, (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($83da5c2df967875d$exports))),
|
|
242
|
+
className: (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($2f86633ce5b04f1e$exports))), 'spectrum-InputGroup', {
|
|
243
|
+
'spectrum-InputGroup--quiet': isQuiet,
|
|
244
|
+
'is-disabled': isDisabled,
|
|
245
|
+
'spectrum-InputGroup--invalid': validationState === 'invalid' && !isDisabled,
|
|
246
|
+
'is-hovered': isHovered,
|
|
247
|
+
'is-focused': isFocused,
|
|
248
|
+
'focus-ring': isFocusVisible
|
|
249
|
+
}, (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($83da5c2df967875d$exports))), 'searchautocomplete', 'mobile-searchautocomplete'), className)
|
|
250
250
|
}, /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).createElement("div", {
|
|
251
|
-
className: (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($40cb3a00c193680f$exports))),
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
}, (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($1e139f06a0a4b696$exports))),
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
}), (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($2f86633ce5b04f1e$exports))),
|
|
251
|
+
className: (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($40cb3a00c193680f$exports))), 'spectrum-Textfield', {
|
|
252
|
+
'spectrum-Textfield--invalid': validationState === 'invalid' && !isDisabled,
|
|
253
|
+
'spectrum-Textfield--valid': validationState === 'valid' && !isDisabled,
|
|
254
|
+
'spectrum-Textfield--quiet': isQuiet
|
|
255
|
+
}, (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($1e139f06a0a4b696$exports))), 'spectrum-Search', 'spectrum-Search--loadable', {
|
|
256
|
+
'is-disabled': isDisabled,
|
|
257
|
+
'is-quiet': isQuiet,
|
|
258
|
+
'spectrum-Search--invalid': validationState === 'invalid' && !isDisabled,
|
|
259
|
+
'spectrum-Search--valid': validationState === 'valid' && !isDisabled
|
|
260
|
+
}), (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($2f86633ce5b04f1e$exports))), 'spectrum-InputGroup-field'))
|
|
261
261
|
}, /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).createElement("div", {
|
|
262
|
-
className: (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($40cb3a00c193680f$exports))),
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
}, (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($1e139f06a0a4b696$exports))),
|
|
262
|
+
className: (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($40cb3a00c193680f$exports))), 'spectrum-Textfield-input', {
|
|
263
|
+
'spectrum-Textfield-inputIcon': !!icon,
|
|
264
|
+
'is-hovered': isHovered,
|
|
265
|
+
'is-placeholder': isPlaceholder,
|
|
266
|
+
'is-disabled': isDisabled,
|
|
267
|
+
'is-quiet': isQuiet,
|
|
268
|
+
'is-focused': isFocused
|
|
269
|
+
}, (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($1e139f06a0a4b696$exports))), 'spectrum-Search-input'), (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($83da5c2df967875d$exports))), 'mobile-input'))
|
|
270
270
|
}, icon, /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).createElement("span", {
|
|
271
271
|
id: valueId,
|
|
272
|
-
className: (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($83da5c2df967875d$exports))),
|
|
273
|
-
}, children)), validationState && !isDisabled ? validation : null, (inputValue !==
|
|
272
|
+
className: (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($83da5c2df967875d$exports))), 'mobile-value')
|
|
273
|
+
}, children)), validationState && !isDisabled ? validation : null, (inputValue !== '' || validationState != null) && !isReadOnly && clearButton));
|
|
274
274
|
});
|
|
275
275
|
function $a9f98e219df0b64d$var$SearchAutocompleteTray(props) {
|
|
276
276
|
let searchIcon = /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).createElement((0, ($parcel$interopDefault($56uON$spectrumiconsuiMagnifier))), {
|
|
@@ -283,9 +283,9 @@ function $a9f98e219df0b64d$var$SearchAutocompleteTray(props) {
|
|
|
283
283
|
let inputRef = (0, $56uON$react.useRef)(null);
|
|
284
284
|
let popoverRef = (0, $56uON$react.useRef)(null);
|
|
285
285
|
let listBoxRef = (0, $56uON$react.useRef)(null);
|
|
286
|
-
let isLoading = loadingState ===
|
|
286
|
+
let isLoading = loadingState === 'loading' || loadingState === 'loadingMore';
|
|
287
287
|
let layout = (0, $56uON$reactspectrumlistbox.useListBoxLayout)(state, isLoading);
|
|
288
|
-
let stringFormatter = (0, $56uON$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($e32120882142a69f$exports))),
|
|
288
|
+
let stringFormatter = (0, $56uON$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($e32120882142a69f$exports))), '@react-spectrum/autocomplete');
|
|
289
289
|
let { inputProps: inputProps, listBoxProps: listBoxProps, labelProps: labelProps, clearButtonProps: clearButtonProps } = (0, $56uON$reactariaautocomplete.useSearchAutocomplete)({
|
|
290
290
|
...props,
|
|
291
291
|
keyboardDelegate: layout,
|
|
@@ -306,29 +306,29 @@ function $a9f98e219df0b64d$var$SearchAutocompleteTray(props) {
|
|
|
306
306
|
if (!state.isOpen && state.isFocused) state.setFocused(false);
|
|
307
307
|
});
|
|
308
308
|
let { dialogProps: dialogProps } = (0, $56uON$reactariadialog.useDialog)({
|
|
309
|
-
|
|
309
|
+
'aria-labelledby': (0, $56uON$reactariautils.useId)(labelProps.id)
|
|
310
310
|
}, popoverRef);
|
|
311
311
|
// Override the role of the input to "searchbox" instead of "combobox".
|
|
312
312
|
// Since the listbox is always visible, the combobox role doesn't really give us anything.
|
|
313
313
|
// VoiceOver on iOS reads "double tap to collapse" when focused on the input rather than
|
|
314
314
|
// "double tap to edit text", as with a textbox or searchbox. We'd like double tapping to
|
|
315
315
|
// open the virtual keyboard rather than closing the tray.
|
|
316
|
-
inputProps.role =
|
|
317
|
-
inputProps[
|
|
316
|
+
inputProps.role = 'searchbox';
|
|
317
|
+
inputProps['aria-haspopup'] = 'listbox';
|
|
318
318
|
delete inputProps.onTouchEnd;
|
|
319
319
|
let clearButton = /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).createElement((0, $56uON$reactspectrumbutton.ClearButton), {
|
|
320
320
|
...clearButtonProps,
|
|
321
321
|
preventFocus: true,
|
|
322
|
-
"aria-label": stringFormatter.format(
|
|
322
|
+
"aria-label": stringFormatter.format('clear'),
|
|
323
323
|
excludeFromTabOrder: true,
|
|
324
|
-
UNSAFE_className: (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($1e139f06a0a4b696$exports))),
|
|
324
|
+
UNSAFE_className: (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($1e139f06a0a4b696$exports))), 'spectrum-ClearButton'),
|
|
325
325
|
isDisabled: isDisabled
|
|
326
326
|
});
|
|
327
327
|
let loadingCircle = /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).createElement((0, $56uON$reactspectrumprogress.ProgressCircle), {
|
|
328
|
-
"aria-label": stringFormatter.format(
|
|
328
|
+
"aria-label": stringFormatter.format('loading'),
|
|
329
329
|
size: "S",
|
|
330
330
|
isIndeterminate: true,
|
|
331
|
-
UNSAFE_className: (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($1e139f06a0a4b696$exports))),
|
|
331
|
+
UNSAFE_className: (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($1e139f06a0a4b696$exports))), 'spectrum-Search-circleLoader', (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($40cb3a00c193680f$exports))), 'spectrum-Textfield-circleLoader'))
|
|
332
332
|
});
|
|
333
333
|
// Close the software keyboard on scroll to give the user a bigger area to scroll.
|
|
334
334
|
// But only do this if scrolling with touch, otherwise it can cause issues with touch
|
|
@@ -351,7 +351,7 @@ function $a9f98e219df0b64d$var$SearchAutocompleteTray(props) {
|
|
|
351
351
|
let inputValue = inputProps.value;
|
|
352
352
|
let lastInputValue = (0, $56uON$react.useRef)(inputValue);
|
|
353
353
|
(0, $56uON$react.useEffect)(()=>{
|
|
354
|
-
if (loadingState ===
|
|
354
|
+
if (loadingState === 'filtering' && !showLoading) {
|
|
355
355
|
if (timeout.current === null) timeout.current = setTimeout(()=>{
|
|
356
356
|
setShowLoading(true);
|
|
357
357
|
}, 500);
|
|
@@ -362,7 +362,7 @@ function $a9f98e219df0b64d$var$SearchAutocompleteTray(props) {
|
|
|
362
362
|
setShowLoading(true);
|
|
363
363
|
}, 500);
|
|
364
364
|
}
|
|
365
|
-
} else if (loadingState !==
|
|
365
|
+
} else if (loadingState !== 'filtering') {
|
|
366
366
|
// If loading is no longer happening, clear any timers and hide the loading circle
|
|
367
367
|
setShowLoading(false);
|
|
368
368
|
if (timeout.current !== null) {
|
|
@@ -378,7 +378,7 @@ function $a9f98e219df0b64d$var$SearchAutocompleteTray(props) {
|
|
|
378
378
|
]);
|
|
379
379
|
let onKeyDown = (e)=>{
|
|
380
380
|
// Close virtual keyboard, close tray, and fire onSubmit if user hits Enter w/o any focused options
|
|
381
|
-
if (e.key ===
|
|
381
|
+
if (e.key === 'Enter' && state.selectionManager.focusedKey == null) {
|
|
382
382
|
var _popoverRef_current;
|
|
383
383
|
(_popoverRef_current = popoverRef.current) === null || _popoverRef_current === void 0 ? void 0 : _popoverRef_current.focus();
|
|
384
384
|
if (onClose) onClose();
|
|
@@ -386,8 +386,8 @@ function $a9f98e219df0b64d$var$SearchAutocompleteTray(props) {
|
|
|
386
386
|
} else if (inputProps.onKeyDown) inputProps.onKeyDown(e);
|
|
387
387
|
};
|
|
388
388
|
if (icon) icon = /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).cloneElement(icon, {
|
|
389
|
-
UNSAFE_className: (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($40cb3a00c193680f$exports))),
|
|
390
|
-
size:
|
|
389
|
+
UNSAFE_className: (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($40cb3a00c193680f$exports))), 'spectrum-Textfield-icon'),
|
|
390
|
+
size: 'S'
|
|
391
391
|
});
|
|
392
392
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).createElement((0, $56uON$reactariafocus.FocusScope), {
|
|
393
393
|
restoreFocus: true,
|
|
@@ -395,7 +395,7 @@ function $a9f98e219df0b64d$var$SearchAutocompleteTray(props) {
|
|
|
395
395
|
}, /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).createElement("div", {
|
|
396
396
|
...(0, $56uON$reactariautils.mergeProps)(overlayProps, dialogProps),
|
|
397
397
|
ref: popoverRef,
|
|
398
|
-
className: (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($83da5c2df967875d$exports))),
|
|
398
|
+
className: (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($83da5c2df967875d$exports))), 'tray-dialog')
|
|
399
399
|
}, /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).createElement((0, $56uON$reactariaoverlays.DismissButton), {
|
|
400
400
|
onDismiss: onClose
|
|
401
401
|
}), /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).createElement((0, $56uON$reactspectrumtextfield.TextFieldBase), {
|
|
@@ -407,19 +407,19 @@ function $a9f98e219df0b64d$var$SearchAutocompleteTray(props) {
|
|
|
407
407
|
},
|
|
408
408
|
inputRef: inputRef,
|
|
409
409
|
isDisabled: isDisabled,
|
|
410
|
-
isLoading: showLoading && loadingState ===
|
|
410
|
+
isLoading: showLoading && loadingState === 'filtering',
|
|
411
411
|
loadingIndicator: loadingState != null ? loadingCircle : undefined,
|
|
412
412
|
validationState: validationState,
|
|
413
|
-
wrapperChildren: (state.inputValue !==
|
|
413
|
+
wrapperChildren: (state.inputValue !== '' || loadingState === 'filtering' || validationState != null) && !props.isReadOnly ? clearButton : undefined,
|
|
414
414
|
icon: icon,
|
|
415
|
-
UNSAFE_className: (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($1e139f06a0a4b696$exports))),
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
}, (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($83da5c2df967875d$exports))),
|
|
419
|
-
|
|
415
|
+
UNSAFE_className: (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($1e139f06a0a4b696$exports))), 'spectrum-Search', 'spectrum-Textfield', 'spectrum-Search--loadable', {
|
|
416
|
+
'spectrum-Search--invalid': validationState === 'invalid' && !isDisabled,
|
|
417
|
+
'spectrum-Search--valid': validationState === 'valid' && !isDisabled
|
|
418
|
+
}, (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($83da5c2df967875d$exports))), 'tray-textfield', {
|
|
419
|
+
'has-label': !!props.label
|
|
420
420
|
})),
|
|
421
|
-
inputClassName: (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($1e139f06a0a4b696$exports))),
|
|
422
|
-
validationIconClassName: (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($1e139f06a0a4b696$exports))),
|
|
421
|
+
inputClassName: (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($1e139f06a0a4b696$exports))), 'spectrum-Search-input'),
|
|
422
|
+
validationIconClassName: (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($1e139f06a0a4b696$exports))), 'spectrum-Search-validationIcon')
|
|
423
423
|
}), /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).createElement((0, $56uON$reactspectrumlistbox.ListBoxBase), {
|
|
424
424
|
...listBoxProps,
|
|
425
425
|
domProps: {
|
|
@@ -432,10 +432,10 @@ function $a9f98e219df0b64d$var$SearchAutocompleteTray(props) {
|
|
|
432
432
|
layout: layout,
|
|
433
433
|
state: state,
|
|
434
434
|
shouldUseVirtualFocus: true,
|
|
435
|
-
renderEmptyState: ()=>loadingState !==
|
|
436
|
-
className: (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($83da5c2df967875d$exports))),
|
|
437
|
-
}, stringFormatter.format(
|
|
438
|
-
UNSAFE_className: (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($83da5c2df967875d$exports))),
|
|
435
|
+
renderEmptyState: ()=>loadingState !== 'loading' && /*#__PURE__*/ (0, ($parcel$interopDefault($56uON$react))).createElement("span", {
|
|
436
|
+
className: (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($83da5c2df967875d$exports))), 'no-results')
|
|
437
|
+
}, stringFormatter.format('noResults')),
|
|
438
|
+
UNSAFE_className: (0, $56uON$reactspectrumutils.classNames)((0, ($parcel$interopDefault($83da5c2df967875d$exports))), 'tray-listbox'),
|
|
439
439
|
ref: listBoxRef,
|
|
440
440
|
onScroll: onScroll,
|
|
441
441
|
onLoadMore: onLoadMore,
|