@ringcentral/juno 2.15.0 → 2.16.0
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/components/Downshift/Downshift.d.ts +9 -1
- package/components/Downshift/Downshift.js +26 -9
- package/components/Downshift/SuggestionList/SuggestionList.d.ts +13 -1
- package/components/Downshift/SuggestionList/SuggestionList.js +6 -4
- package/components/Downshift/styles/StyledPopper.d.ts +10 -5
- package/components/Downshift/styles/StyledPopper.js +2 -2
- package/components/Downshift/utils/useDownshift.d.ts +1 -0
- package/components/Downshift/utils/useDownshift.js +3 -0
- package/components/List/ListItem/ListItem.d.ts +3 -1
- package/components/List/ListItem/ListItem.js +3 -2
- package/components/List/ListItem/styles/ListItemStyle.d.ts +5 -0
- package/components/List/ListItem/styles/ListItemStyle.js +17 -5
- package/components/List/ListItem/utils/ListItemUtils.d.ts +2 -0
- package/components/List/ListItem/utils/ListItemUtils.js +5 -4
- package/components/Menu/MenuItem/MenuItem.d.ts +7 -6
- package/components/Menu/MenuItem/MenuItem.js +14 -4
- package/components/Menu/MenuItem/styles/MenuItemStyle.js +6 -3
- package/components/Menu/MenuItem/utils/MenuItemUtils.d.ts +4 -1
- package/components/Menu/MenuItem/utils/MenuItemUtils.js +4 -1
- package/components/Menu/MenuOption/styles/StyledMenuOption.d.ts +1 -1
- package/components/Menu/SubMenu/SubMenu.d.ts +1 -1
- package/components/Menu/SubMenu/utils/SubMenuUtils.d.ts +1 -1
- package/components/TablePagination/styles/TablePaginationStyle.d.ts +4 -4
- package/es6/components/Downshift/Downshift.js +27 -10
- package/es6/components/Downshift/SuggestionList/SuggestionList.js +6 -4
- package/es6/components/Downshift/styles/StyledPopper.js +2 -2
- package/es6/components/Downshift/utils/useDownshift.js +3 -0
- package/es6/components/List/ListItem/ListItem.js +3 -2
- package/es6/components/List/ListItem/styles/ListItemStyle.js +19 -7
- package/es6/components/List/ListItem/utils/ListItemUtils.js +4 -3
- package/es6/components/Menu/MenuItem/MenuItem.js +16 -6
- package/es6/components/Menu/MenuItem/styles/MenuItemStyle.js +10 -7
- package/es6/components/Menu/MenuItem/utils/MenuItemUtils.js +4 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { HTMLAttributes } from 'react';
|
|
1
|
+
import React, { HTMLAttributes, ComponentType } from 'react';
|
|
2
2
|
import { CustomStyledComponentResult, RcBaseProps, RcClassesProps } from '../../foundation';
|
|
3
3
|
import { RcIconButtonProps } from '../Buttons/IconButton';
|
|
4
4
|
import { RcTextFieldProps } from '../Forms/TextField';
|
|
@@ -13,6 +13,8 @@ export interface RcDownshiftRenderOptionState {
|
|
|
13
13
|
inputValue?: string;
|
|
14
14
|
/** is that item selected */
|
|
15
15
|
selected: boolean;
|
|
16
|
+
/** is that item be show highlighted style */
|
|
17
|
+
highlighted?: boolean;
|
|
16
18
|
/** that item index */
|
|
17
19
|
index: number;
|
|
18
20
|
/** sort index in option own group */
|
|
@@ -178,6 +180,12 @@ declare type RcDownshiftProps<T extends RcDownshiftSelectedItem = RcDownshiftSel
|
|
|
178
180
|
* a different option or changes the character string in the input.
|
|
179
181
|
*/
|
|
180
182
|
autoSelect?: boolean;
|
|
183
|
+
/**
|
|
184
|
+
* custom PopperComponent for render
|
|
185
|
+
*
|
|
186
|
+
* @default RcPopper
|
|
187
|
+
*/
|
|
188
|
+
PopperComponent?: ComponentType<RcPopperProps>;
|
|
181
189
|
/** props for apply on `RcPopper` */
|
|
182
190
|
PopperProps?: RcBaseProps<Partial<RcPopperProps>, 'open' | 'keepMounted' | 'anchorEl' | 'style'> & {
|
|
183
191
|
/**
|
|
@@ -135,7 +135,7 @@ var _RcDownshift = react_1.memo(react_1.forwardRef(function (inProps, ref) {
|
|
|
135
135
|
return {
|
|
136
136
|
symbol: isOpen ? juno_icon_1.ArrowUp : juno_icon_1.ArrowDown,
|
|
137
137
|
};
|
|
138
|
-
} : _l, inputValueProp = props.inputValue, onKeyDownProp = props.onKeyDown, helperTextProp = props.helperText, options = props.options, openOnFocus = props.openOnFocus, _m = props.getOptionLabel, getOptionLabel = _m === void 0 ? itemToString : _m, renderInput = props.renderInput, _o = props.label, label = _o === void 0 ? inputLabel : _o, _p = props.inputRef, inputRefProp = _p === void 0 ? messageRef : _p, _q = props.error, error = _q === void 0 ? nameError : _q, _r = props.placeholder, placeholder = _r === void 0 ? inputPlaceholder : _r, _s = props.freeSolo, freeSolo = _s === void 0 ? enableFreeChips : _s, _t = props.keyToTags, keyToTags = _t === void 0 ? keyToChips : _t, _u = props.maxFreeSolo, maxFreeSolo = _u === void 0 ? limitOfFreeChips : _u, _v = props.SuggestionListProps, _w = _v === void 0 ? {} : _v, _x = _w.virtualize, virtualize = _x === void 0 ? true : _x, SuggestionListProps = tslib_1.__rest(_w, ["virtualize"]), _y = props.autoSelect, autoSelect = _y === void 0 ? enableAutoTransform : _y, _z = props.PopperProps, _0 = _z === void 0 ? {} : _z, _1 = _0.anchorElType, anchorElType = _1 === void 0 ? 'root' : _1, popperTransition = _0.transition, _2 = _0.TransitionComponent, TransitionComponent = _2 === void 0 ? virtualize ? Fade_1.RcFade : Grow_1.RcGrow : _2, _3 = _0.transitionDuration, transitionDurationProp = _3 === void 0 ? 'auto' : _3, _4 = _0.TransitionProps, TransitionPropsProp = _4 === void 0 ? {} : _4, PopperProps = tslib_1.__rest(_0, ["anchorElType", "transition", "TransitionComponent", "transitionDuration", "TransitionProps"]), initialIsOpen = props.initialIsOpen, disabled = props.disabled, requiredProp = props.required, _5 = props.defaultIsOpen, defaultIsOpen = _5 === void 0 ? openOnFocus : _5, _6 = props.disableCloseOnSelect, disableCloseOnSelect = _6 === void 0 ? defaultIsOpen : _6, _7 = props.onChange, onChangeProp = _7 === void 0 ? onSelectChange : _7, onInputChangeProp = props.onInputChange, onMaxFreeSolo = props.onMaxFreeSolo, FormHelperTextPropsProp = props.FormHelperTextProps, action = props.action, filterOptions = props.filterOptions, renderOption = props.renderOption, renderTags = props.renderTags, getOptionDisabled = props.getOptionDisabled, renderGroup = props.renderGroup, onGroupExpanded = props.onGroupExpanded, renderNoOptions = props.renderNoOptions, InputPropsProp = props.InputProps, debug = props.debug, disabledItemsHighlightable = props.disabledItemsHighlightable, openProp = props.open, onOpen = props.onOpen, onClose = props.onClose, focused = props.focused, color = props.color, rest = tslib_1.__rest(props, ["itemToString", "keyToChips", "limitOfFreeChips", "minRowHeight", "suggestionItems", "messageRef", "MenuItem", "inputLabel", "nameError", "maxLength", "InputItem", "emailError", "autoSwitchEmail", "enableFreeChips", "inputPlaceholder", "errorSelectedItems", "enableAutoTransform", "allowPlainHelperText", "TextFieldProps", "selectedItems", "automationId", "screenReader", "onSelectChange", "variant", "groupExpanded", "groupDefaultExpanded", "groupVariant", "getExpandIconProps", "groupBy", "value", "autoHighlight", "fullWidth", "clearBtn", "toggleButton", "multiple", "clearButtonProps", "onClear", "ToggleButtonProps", "getToggleButtonProps", "inputValue", "onKeyDown", "helperText", "options", "openOnFocus", "getOptionLabel", "renderInput", "label", "inputRef", "error", "placeholder", "freeSolo", "keyToTags", "maxFreeSolo", "SuggestionListProps", "autoSelect", "PopperProps", "initialIsOpen", "disabled", "required", "defaultIsOpen", "disableCloseOnSelect", "onChange", "onInputChange", "onMaxFreeSolo", "FormHelperTextProps", "action", "filterOptions", "renderOption", "renderTags", "getOptionDisabled", "renderGroup", "onGroupExpanded", "renderNoOptions", "InputProps", "debug", "disabledItemsHighlightable", "open", "onOpen", "onClose", "focused", "color"]);
|
|
138
|
+
} : _l, inputValueProp = props.inputValue, onKeyDownProp = props.onKeyDown, helperTextProp = props.helperText, options = props.options, openOnFocus = props.openOnFocus, _m = props.getOptionLabel, getOptionLabel = _m === void 0 ? itemToString : _m, renderInput = props.renderInput, _o = props.label, label = _o === void 0 ? inputLabel : _o, _p = props.inputRef, inputRefProp = _p === void 0 ? messageRef : _p, _q = props.error, error = _q === void 0 ? nameError : _q, _r = props.placeholder, placeholder = _r === void 0 ? inputPlaceholder : _r, _s = props.freeSolo, freeSolo = _s === void 0 ? enableFreeChips : _s, _t = props.keyToTags, keyToTags = _t === void 0 ? keyToChips : _t, _u = props.maxFreeSolo, maxFreeSolo = _u === void 0 ? limitOfFreeChips : _u, _v = props.SuggestionListProps, _w = _v === void 0 ? {} : _v, _x = _w.virtualize, virtualize = _x === void 0 ? true : _x, SuggestionListProps = tslib_1.__rest(_w, ["virtualize"]), _y = props.autoSelect, autoSelect = _y === void 0 ? enableAutoTransform : _y, PopperComponent = props.PopperComponent, _z = props.PopperProps, _0 = _z === void 0 ? {} : _z, _1 = _0.anchorElType, anchorElType = _1 === void 0 ? 'root' : _1, popperTransition = _0.transition, _2 = _0.TransitionComponent, TransitionComponent = _2 === void 0 ? virtualize ? Fade_1.RcFade : Grow_1.RcGrow : _2, _3 = _0.transitionDuration, transitionDurationProp = _3 === void 0 ? 'auto' : _3, _4 = _0.TransitionProps, TransitionPropsProp = _4 === void 0 ? {} : _4, PopperProps = tslib_1.__rest(_0, ["anchorElType", "transition", "TransitionComponent", "transitionDuration", "TransitionProps"]), initialIsOpen = props.initialIsOpen, disabled = props.disabled, requiredProp = props.required, _5 = props.defaultIsOpen, defaultIsOpen = _5 === void 0 ? openOnFocus : _5, _6 = props.disableCloseOnSelect, disableCloseOnSelect = _6 === void 0 ? defaultIsOpen : _6, _7 = props.onChange, onChangeProp = _7 === void 0 ? onSelectChange : _7, onInputChangeProp = props.onInputChange, onMaxFreeSolo = props.onMaxFreeSolo, FormHelperTextPropsProp = props.FormHelperTextProps, action = props.action, filterOptions = props.filterOptions, renderOption = props.renderOption, renderTags = props.renderTags, getOptionDisabled = props.getOptionDisabled, renderGroup = props.renderGroup, onGroupExpanded = props.onGroupExpanded, renderNoOptions = props.renderNoOptions, InputPropsProp = props.InputProps, debug = props.debug, disabledItemsHighlightable = props.disabledItemsHighlightable, openProp = props.open, onOpen = props.onOpen, onClose = props.onClose, focused = props.focused, color = props.color, rest = tslib_1.__rest(props, ["itemToString", "keyToChips", "limitOfFreeChips", "minRowHeight", "suggestionItems", "messageRef", "MenuItem", "inputLabel", "nameError", "maxLength", "InputItem", "emailError", "autoSwitchEmail", "enableFreeChips", "inputPlaceholder", "errorSelectedItems", "enableAutoTransform", "allowPlainHelperText", "TextFieldProps", "selectedItems", "automationId", "screenReader", "onSelectChange", "variant", "groupExpanded", "groupDefaultExpanded", "groupVariant", "getExpandIconProps", "groupBy", "value", "autoHighlight", "fullWidth", "clearBtn", "toggleButton", "multiple", "clearButtonProps", "onClear", "ToggleButtonProps", "getToggleButtonProps", "inputValue", "onKeyDown", "helperText", "options", "openOnFocus", "getOptionLabel", "renderInput", "label", "inputRef", "error", "placeholder", "freeSolo", "keyToTags", "maxFreeSolo", "SuggestionListProps", "autoSelect", "PopperComponent", "PopperProps", "initialIsOpen", "disabled", "required", "defaultIsOpen", "disableCloseOnSelect", "onChange", "onInputChange", "onMaxFreeSolo", "FormHelperTextProps", "action", "filterOptions", "renderOption", "renderTags", "getOptionDisabled", "renderGroup", "onGroupExpanded", "renderNoOptions", "InputProps", "debug", "disabledItemsHighlightable", "open", "onOpen", "onClose", "focused", "color"]);
|
|
139
139
|
var _8 = tslib_1.__read(react_1.useState('bottom-start'), 2), position = _8[0], setPosition = _8[1];
|
|
140
140
|
var innerInputRef = react_1.useRef(null);
|
|
141
141
|
var textFieldRef = react_1.useRef(null);
|
|
@@ -190,7 +190,7 @@ var _RcDownshift = react_1.memo(react_1.forwardRef(function (inProps, ref) {
|
|
|
190
190
|
onKeyDown: onKeyDownProp,
|
|
191
191
|
disabledItemsHighlightable: disabledItemsHighlightable,
|
|
192
192
|
onGroupExpanded: onGroupExpanded,
|
|
193
|
-
}), focusInput = _9.focusInput, optionItems = _9.optionItems, optionsGroupList = _9.optionsGroupList, selectedItems = _9.tags, highlightedIndex = _9.highlightedIndex, getToggleButtonProps = _9.getToggleButtonProps, getTagProps = _9.getTagProps, getTagListBoxProps = _9.getTagListBoxProps, getMenuProps = _9.getMenuProps, getPopperProps = _9.getPopperProps, getInputProps = _9.getInputProps, getInputAriaProps = _9.getInputAriaProps, getLabelProps = _9.getLabelProps, getItemProps = _9.getItemProps, isOpen = _9.isOpen, inputValue = _9.inputValue, activeIndex = _9.activeIndex, setActiveIndex = _9.setActiveIndex, setHighlightedIndex = _9.setHighlightedIndex, onInputChange = _9.onInputChange, keepHighlightedIndex = _9.keepHighlightedIndex, changeHighlightedIndexReason = _9.changeHighlightedIndexReason, closeMenu = _9.closeMenu, openMenu = _9.openMenu, reset = _9.reset, getClearButtonProps = _9.getClearButtonProps, noOptionItem = _9.noOptionItem, getNoOptionsProps = _9.getNoOptionsProps, isKeepHighlightedIndex = _9.isKeepHighlightedIndex, isDownshiftFocused = _9.focused;
|
|
193
|
+
}), focusInput = _9.focusInput, optionItems = _9.optionItems, optionsGroupList = _9.optionsGroupList, selectedItems = _9.tags, highlightedIndex = _9.highlightedIndex, getToggleButtonProps = _9.getToggleButtonProps, getTagProps = _9.getTagProps, getTagListBoxProps = _9.getTagListBoxProps, getMenuProps = _9.getMenuProps, getPopperProps = _9.getPopperProps, getInputProps = _9.getInputProps, getInputAriaProps = _9.getInputAriaProps, getLabelProps = _9.getLabelProps, getItemProps = _9.getItemProps, isOpen = _9.isOpen, inputValue = _9.inputValue, activeIndex = _9.activeIndex, setActiveIndex = _9.setActiveIndex, setHighlightedIndex = _9.setHighlightedIndex, onInputChange = _9.onInputChange, keepHighlightedIndex = _9.keepHighlightedIndex, changeHighlightedIndexReason = _9.changeHighlightedIndexReason, closeMenu = _9.closeMenu, openMenu = _9.openMenu, reset = _9.reset, getClearButtonProps = _9.getClearButtonProps, noOptionItem = _9.noOptionItem, getNoOptionsProps = _9.getNoOptionsProps, isKeepHighlightedIndex = _9.isKeepHighlightedIndex, isDownshiftFocused = _9.focused, autoCompleteSelectedIndex = _9.autoCompleteSelectedIndex;
|
|
194
194
|
var open = Boolean((isOpen || noOptionItem) && textFieldRef.current);
|
|
195
195
|
var _10 = getInputProps(), onBlur = _10.onBlur, InputProps = tslib_1.__rest(_10, ["onBlur"]);
|
|
196
196
|
var helperText = isNew
|
|
@@ -217,8 +217,9 @@ var _RcDownshift = react_1.memo(react_1.forwardRef(function (inProps, ref) {
|
|
|
217
217
|
}
|
|
218
218
|
var toTextFieldRef = foundation_1.useForkRef(textFieldRef, ref);
|
|
219
219
|
var colorHex = react_1.useMemo(function () { return (color ? foundation_1.getParsePaletteColor(color)({ theme: theme }) : undefined); }, [color, theme]);
|
|
220
|
+
var isAutocomplete = variant === 'autocomplete';
|
|
220
221
|
var startAdornment = (function () {
|
|
221
|
-
if (
|
|
222
|
+
if (isAutocomplete) {
|
|
222
223
|
return undefined;
|
|
223
224
|
}
|
|
224
225
|
var getCustomizedTagProps = function (selectedItem, index) {
|
|
@@ -291,9 +292,10 @@ var _RcDownshift = react_1.memo(react_1.forwardRef(function (inProps, ref) {
|
|
|
291
292
|
});
|
|
292
293
|
var menuChildren = (
|
|
293
294
|
// * that root element for animation host
|
|
294
|
-
react_1.default.createElement(
|
|
295
|
-
isOpen && (react_1.default.createElement(SuggestionList_1.RcSuggestionList, tslib_1.__assign({ highlightedIndex: highlightedIndex, optionsGroupList: optionsGroupList, options: optionItems, groupVariant: groupVariant, groupExpanded: groupExpanded, renderGroup: renderGroup, MenuItem: MenuItem, renderOption: renderOption, inputValue: inputValue, getItemProps: getItemProps, getMenuProps: getMenuProps, changeHighlightedIndexReason: changeHighlightedIndexReason, getOptionDisabled: getOptionDisabled, isKeepHighlightedIndex: isKeepHighlightedIndex, onUpdatePopper: handleUpdatePopper, maxContainerHeight: 180, getOptionLabel: getOptionLabel, position: "unset", virtualize: virtualize }, SuggestionListProps))),
|
|
295
|
+
react_1.default.createElement(react_1.default.Fragment, null,
|
|
296
|
+
isOpen && (react_1.default.createElement(SuggestionList_1.RcSuggestionList, tslib_1.__assign({ selectedIndex: isAutocomplete ? autoCompleteSelectedIndex : undefined, highlightedIndex: highlightedIndex, optionsGroupList: optionsGroupList, options: optionItems, groupVariant: groupVariant, groupExpanded: groupExpanded, renderGroup: renderGroup, MenuItem: MenuItem, renderOption: renderOption, inputValue: inputValue, getItemProps: getItemProps, getMenuProps: getMenuProps, changeHighlightedIndexReason: changeHighlightedIndexReason, getOptionDisabled: getOptionDisabled, isKeepHighlightedIndex: isKeepHighlightedIndex, onUpdatePopper: handleUpdatePopper, maxContainerHeight: 180, getOptionLabel: getOptionLabel, position: "unset", virtualize: virtualize }, SuggestionListProps))),
|
|
296
297
|
isRenderNoOptions && (renderNoOptions === null || renderNoOptions === void 0 ? void 0 : renderNoOptions(getNoOptionsProps, noOptionItem))));
|
|
298
|
+
var prevMenuChildren = foundation_1.usePrevious(function () { return menuChildren; });
|
|
297
299
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
298
300
|
react_1.default.createElement(styles_1.StyledTextField, tslib_1.__assign({ renderInput: renderInput, hasTags: hasTags, ref: toTextFieldRef, inputRef: inputRef, "data-test-automation-id": automationId, fullWidth: fullWidth, placeholder: !hasTags ? placeholder : undefined, label: label, focused: isDownshiftFocused, disabled: disabled, required: required, color: color,
|
|
299
301
|
// * if below one of tag is error, that main downshift default will be error
|
|
@@ -304,7 +306,7 @@ var _RcDownshift = react_1.memo(react_1.forwardRef(function (inProps, ref) {
|
|
|
304
306
|
maxLength: maxLength, containerRef: inputContainerRef }, getInputAriaProps(TextFieldProps === null || TextFieldProps === void 0 ? void 0 : TextFieldProps.inputProps)),
|
|
305
307
|
}, rest), { value: inputValue, clearBtn: false })),
|
|
306
308
|
!helperText && screenReaderText && (react_1.default.createElement(VisuallyHidden_1.RcVisuallyHidden, { id: describedbyId }, screenReaderText)),
|
|
307
|
-
react_1.default.createElement(styles_1.StyledPopper, tslib_1.__assign({ open: open, position: position, placement: "bottom-start", anchorEl: anchorElRef.current, "data-test-automation-id": "suggestions-list", popperRef: popperRef,
|
|
309
|
+
react_1.default.createElement(styles_1.StyledPopper, tslib_1.__assign({ open: open, position: position, component: PopperComponent, placement: "bottom-start", anchorEl: anchorElRef.current, "data-test-automation-id": "suggestions-list", popperRef: popperRef,
|
|
308
310
|
// * view type in popper.js
|
|
309
311
|
popperOptions: {
|
|
310
312
|
onUpdate: function (e) {
|
|
@@ -313,10 +315,25 @@ var _RcDownshift = react_1.memo(react_1.forwardRef(function (inProps, ref) {
|
|
|
313
315
|
setPosition(currPosition);
|
|
314
316
|
}
|
|
315
317
|
},
|
|
316
|
-
} }, getPopperProps(PopperProps), { transition:
|
|
318
|
+
} }, getPopperProps(PopperProps), { transition: popperTransition }), popperTransition
|
|
317
319
|
? function (_a) {
|
|
318
|
-
|
|
319
|
-
|
|
320
|
+
if (_a === void 0) { _a = {}; }
|
|
321
|
+
var _b = _a.TransitionProps, _c = _b === void 0 ? {} : _b, onEnterProp = _c.onEnter, onExitProp = _c.onExited, inProp = _c.in, restTransitionProp = tslib_1.__rest(_a, ["TransitionProps"]);
|
|
322
|
+
var onEnter = function (node, isAppearing) {
|
|
323
|
+
var _a;
|
|
324
|
+
onEnterProp();
|
|
325
|
+
(_a = TransitionPropsProp.onEnter) === null || _a === void 0 ? void 0 : _a.call(TransitionPropsProp, node, isAppearing);
|
|
326
|
+
};
|
|
327
|
+
var onExited = function (node) {
|
|
328
|
+
var _a;
|
|
329
|
+
onExitProp();
|
|
330
|
+
(_a = TransitionPropsProp.onExited) === null || _a === void 0 ? void 0 : _a.call(TransitionPropsProp, node);
|
|
331
|
+
};
|
|
332
|
+
return (react_1.default.createElement(TransitionComponent, tslib_1.__assign({ in: inProp, onEnter: onEnter, onExited: onExited }, restTransitionProp, { timeout: transitionDuration }, (virtualize ? {} : DEFAULT_GROW_STYLE), TransitionPropsProp),
|
|
333
|
+
react_1.default.createElement("div", null,
|
|
334
|
+
// when menu be close use previous option menu,
|
|
335
|
+
// keep menu item before animation done
|
|
336
|
+
inProp ? menuChildren : prevMenuChildren)));
|
|
320
337
|
}
|
|
321
338
|
: menuChildren)));
|
|
322
339
|
}));
|
|
@@ -42,6 +42,10 @@ export declare type InnerSuggestionListProps = {
|
|
|
42
42
|
* set that as `unset`, let outside `absolute` container to calculate that.
|
|
43
43
|
*/
|
|
44
44
|
position?: 'absolute' | 'unset';
|
|
45
|
+
/**
|
|
46
|
+
* in autocomplete mode, that will have selected index, show selected when focused
|
|
47
|
+
*/
|
|
48
|
+
selectedIndex?: number;
|
|
45
49
|
} & Pick<RcDownshiftProps, 'inputValue' | 'MenuItem' | 'renderOption' | 'getOptionDisabled' | 'renderGroup' | 'groupExpanded' | 'groupVariant' | 'getOptionLabel'> & RcSuggestionListProps<any>;
|
|
46
50
|
export declare const RcSuggestionList: import("styled-components").StyledComponentClass<{
|
|
47
51
|
/** current highlightedIndex */
|
|
@@ -66,6 +70,10 @@ export declare const RcSuggestionList: import("styled-components").StyledCompone
|
|
|
66
70
|
* set that as `unset`, let outside `absolute` container to calculate that.
|
|
67
71
|
*/
|
|
68
72
|
position?: "absolute" | "unset" | undefined;
|
|
73
|
+
/**
|
|
74
|
+
* in autocomplete mode, that will have selected index, show selected when focused
|
|
75
|
+
*/
|
|
76
|
+
selectedIndex?: number | undefined;
|
|
69
77
|
} & Pick<RcDownshiftProps<RcDownshiftSelectedItem>, "getOptionDisabled" | "getOptionLabel" | "renderOption" | "groupVariant" | "groupExpanded" | "renderGroup" | "MenuItem" | "inputValue"> & Pick<Partial<VirtuosoProps<any, undefined>>, "key" | "form" | "list" | "className" | "color" | "height" | "id" | "lang" | "max" | "media" | "method" | "min" | "name" | "style" | "target" | "type" | "width" | "role" | "tabIndex" | "crossOrigin" | "href" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "step" | "cite" | "label" | "slot" | "span" | "summary" | "title" | "pattern" | "download" | "start" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "size" | "value" | "shape" | "disabled" | "hrefLang" | "rel" | "default" | "action" | "content" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "open" | "selected" | "src" | "checked" | "readOnly" | "required" | "autoComplete" | "rows" | "accept" | "acceptCharset" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "async" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "dateTime" | "defer" | "encType" | "frameBorder" | "headers" | "high" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "maxLength" | "mediaGroup" | "minLength" | "multiple" | "muted" | "nonce" | "noValidate" | "optimum" | "playsInline" | "poster" | "preload" | "reversed" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "sizes" | "srcDoc" | "srcLang" | "srcSet" | "useMap" | "wmode" | "wrap" | "context" | "overscan" | "increaseViewportBy" | "topItemCount" | "initialTopMostItemIndex" | "initialScrollTop" | "initialItemCount" | "components" | "computeItemKey" | "defaultItemHeight" | "itemSize" | "fixedItemHeight" | "scrollSeekConfiguration" | "followOutput" | "headerFooterTag" | "firstItemIndex" | "isScrolling" | "endReached" | "startReached" | "rangeChanged" | "atBottomStateChange" | "atTopStateChange" | "totalListHeightChanged" | "itemsRendered" | "alignToBottom" | "useWindowScroll" | "customScrollParent" | "scrollerRef" | "atBottomThreshold" | "react18ConcurrentRendering"> & {
|
|
70
78
|
/**
|
|
71
79
|
* that virtual list container height,
|
|
@@ -104,6 +112,10 @@ export declare const RcSuggestionList: import("styled-components").StyledCompone
|
|
|
104
112
|
* set that as `unset`, let outside `absolute` container to calculate that.
|
|
105
113
|
*/
|
|
106
114
|
position?: "absolute" | "unset" | undefined;
|
|
115
|
+
/**
|
|
116
|
+
* in autocomplete mode, that will have selected index, show selected when focused
|
|
117
|
+
*/
|
|
118
|
+
selectedIndex?: number | undefined;
|
|
107
119
|
} & Pick<RcDownshiftProps<RcDownshiftSelectedItem>, "getOptionDisabled" | "getOptionLabel" | "renderOption" | "groupVariant" | "groupExpanded" | "renderGroup" | "MenuItem" | "inputValue"> & Pick<Partial<VirtuosoProps<any, undefined>>, "key" | "form" | "list" | "className" | "color" | "height" | "id" | "lang" | "max" | "media" | "method" | "min" | "name" | "style" | "target" | "type" | "width" | "role" | "tabIndex" | "crossOrigin" | "href" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "step" | "cite" | "label" | "slot" | "span" | "summary" | "title" | "pattern" | "download" | "start" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "size" | "value" | "shape" | "disabled" | "hrefLang" | "rel" | "default" | "action" | "content" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "open" | "selected" | "src" | "checked" | "readOnly" | "required" | "autoComplete" | "rows" | "accept" | "acceptCharset" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "async" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "dateTime" | "defer" | "encType" | "frameBorder" | "headers" | "high" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "maxLength" | "mediaGroup" | "minLength" | "multiple" | "muted" | "nonce" | "noValidate" | "optimum" | "playsInline" | "poster" | "preload" | "reversed" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "sizes" | "srcDoc" | "srcLang" | "srcSet" | "useMap" | "wmode" | "wrap" | "context" | "overscan" | "increaseViewportBy" | "topItemCount" | "initialTopMostItemIndex" | "initialScrollTop" | "initialItemCount" | "components" | "computeItemKey" | "defaultItemHeight" | "itemSize" | "fixedItemHeight" | "scrollSeekConfiguration" | "followOutput" | "headerFooterTag" | "firstItemIndex" | "isScrolling" | "endReached" | "startReached" | "rangeChanged" | "atBottomStateChange" | "atTopStateChange" | "totalListHeightChanged" | "itemsRendered" | "alignToBottom" | "useWindowScroll" | "customScrollParent" | "scrollerRef" | "atBottomThreshold" | "react18ConcurrentRendering"> & {
|
|
108
120
|
/**
|
|
109
121
|
* that virtual list container height,
|
|
@@ -119,6 +131,6 @@ export declare const RcSuggestionList: import("styled-components").StyledCompone
|
|
|
119
131
|
padding?: number | boolean | undefined;
|
|
120
132
|
/** is that menu virtualize */
|
|
121
133
|
virtualize?: boolean | undefined;
|
|
122
|
-
} & RcClassesProps<"root" | "expanded" | "toggle" | "groupTitle"> & React.RefAttributes<any>, "ref" | "key" | "form" | "list" | "className" | "color" | "height" | "id" | "lang" | "max" | "media" | "method" | "min" | "name" | "style" | "target" | "type" | "width" | "role" | "tabIndex" | "crossOrigin" | "href" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "step" | "cite" | "label" | "slot" | "span" | "summary" | "title" | "pattern" | "download" | "start" | "classes" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "size" | "value" | "shape" | "disabled" | "hrefLang" | "rel" | "default" | "action" | "content" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "position" | "open" | "padding" | "selected" | "src" | "checked" | "readOnly" | "required" | "autoComplete" | "rows" | "accept" | "acceptCharset" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "async" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "dateTime" | "defer" | "encType" | "frameBorder" | "headers" | "high" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "maxLength" | "mediaGroup" | "minLength" | "multiple" | "muted" | "nonce" | "noValidate" | "optimum" | "playsInline" | "poster" | "preload" | "reversed" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "sizes" | "srcDoc" | "srcLang" | "srcSet" | "useMap" | "wmode" | "wrap" | "context" | "overscan" | "increaseViewportBy" | "topItemCount" | "initialTopMostItemIndex" | "initialScrollTop" | "initialItemCount" | "components" | "computeItemKey" | "defaultItemHeight" | "itemSize" | "fixedItemHeight" | "scrollSeekConfiguration" | "followOutput" | "headerFooterTag" | "firstItemIndex" | "isScrolling" | "endReached" | "startReached" | "rangeChanged" | "atBottomStateChange" | "atTopStateChange" | "totalListHeightChanged" | "itemsRendered" | "alignToBottom" | "useWindowScroll" | "customScrollParent" | "scrollerRef" | "atBottomThreshold" | "react18ConcurrentRendering" | "options" | "getItemProps" | "getOptionDisabled" | "getOptionLabel" | "renderOption" | "groupVariant" | "groupExpanded" | "renderGroup" | "MenuItem" | "inputValue" | "maxContainerHeight" | "virtualize" | "optionsGroupList" | "highlightedIndex" | "getMenuProps" | "changeHighlightedIndexReason" | "isKeepHighlightedIndex" | "onUpdatePopper"> & {
|
|
134
|
+
} & RcClassesProps<"root" | "expanded" | "toggle" | "groupTitle"> & React.RefAttributes<any>, "ref" | "key" | "form" | "list" | "className" | "color" | "height" | "id" | "lang" | "max" | "media" | "method" | "min" | "name" | "style" | "target" | "type" | "width" | "role" | "tabIndex" | "crossOrigin" | "href" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "step" | "cite" | "label" | "slot" | "span" | "summary" | "title" | "pattern" | "download" | "start" | "classes" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "size" | "value" | "shape" | "disabled" | "hrefLang" | "rel" | "default" | "action" | "content" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "position" | "open" | "padding" | "selected" | "src" | "checked" | "readOnly" | "required" | "autoComplete" | "rows" | "accept" | "acceptCharset" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "async" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "dateTime" | "defer" | "encType" | "frameBorder" | "headers" | "high" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "maxLength" | "mediaGroup" | "minLength" | "multiple" | "muted" | "nonce" | "noValidate" | "optimum" | "playsInline" | "poster" | "preload" | "reversed" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "sizes" | "srcDoc" | "srcLang" | "srcSet" | "useMap" | "wmode" | "wrap" | "context" | "overscan" | "increaseViewportBy" | "topItemCount" | "initialTopMostItemIndex" | "initialScrollTop" | "initialItemCount" | "components" | "computeItemKey" | "defaultItemHeight" | "itemSize" | "fixedItemHeight" | "scrollSeekConfiguration" | "followOutput" | "headerFooterTag" | "firstItemIndex" | "isScrolling" | "endReached" | "startReached" | "rangeChanged" | "atBottomStateChange" | "atTopStateChange" | "totalListHeightChanged" | "itemsRendered" | "alignToBottom" | "useWindowScroll" | "customScrollParent" | "scrollerRef" | "atBottomThreshold" | "react18ConcurrentRendering" | "options" | "getItemProps" | "getOptionDisabled" | "getOptionLabel" | "renderOption" | "groupVariant" | "groupExpanded" | "renderGroup" | "MenuItem" | "inputValue" | "maxContainerHeight" | "virtualize" | "optionsGroupList" | "highlightedIndex" | "getMenuProps" | "changeHighlightedIndexReason" | "isKeepHighlightedIndex" | "onUpdatePopper" | "selectedIndex"> & {
|
|
123
135
|
theme?: import("../../../foundation").RcTheme | undefined;
|
|
124
136
|
}>;
|
|
@@ -21,7 +21,7 @@ var List = react_1.forwardRef(function (props, ref) {
|
|
|
21
21
|
var SuggestionList = react_1.forwardRef(function (inProps, ref) {
|
|
22
22
|
var _a;
|
|
23
23
|
var props = foundation_1.useThemeProps({ props: inProps, name: 'RcSuggestionList' });
|
|
24
|
-
var highlightedIndex = props.highlightedIndex, options = props.options, getItemProps = props.getItemProps, _b = props.virtualize, virtualize = _b === void 0 ? true : _b, getMenuProps = props.getMenuProps, renderOption = props.renderOption, inputValue = props.inputValue, groupVariant = props.groupVariant, groupExpanded = props.groupExpanded, renderGroup = props.renderGroup, optionsGroupList = props.optionsGroupList, getOptionDisabled = props.getOptionDisabled, MenuItem = props.MenuItem, changeHighlightedIndexReason = props.changeHighlightedIndexReason, isKeepHighlightedIndex = props.isKeepHighlightedIndex, componentsProp = props.components, onUpdatePopper = props.onUpdatePopper, getOptionLabel = props.getOptionLabel, padding = props.padding, _c = props.maxContainerHeight, maxContainerHeight = _c === void 0 ? '100%' : _c, classNameProp = props.className, classesProp = props.classes, _d = props.position, position = _d === void 0 ? 'absolute' : _d, rest = tslib_1.__rest(props, ["highlightedIndex", "options", "getItemProps", "virtualize", "getMenuProps", "renderOption", "inputValue", "groupVariant", "groupExpanded", "renderGroup", "optionsGroupList", "getOptionDisabled", "MenuItem", "changeHighlightedIndexReason", "isKeepHighlightedIndex", "components", "onUpdatePopper", "getOptionLabel", "padding", "maxContainerHeight", "className", "classes", "position"]);
|
|
24
|
+
var highlightedIndex = props.highlightedIndex, options = props.options, getItemProps = props.getItemProps, _b = props.virtualize, virtualize = _b === void 0 ? true : _b, getMenuProps = props.getMenuProps, renderOption = props.renderOption, selectedOptions = props.value, inputValue = props.inputValue, groupVariant = props.groupVariant, groupExpanded = props.groupExpanded, renderGroup = props.renderGroup, optionsGroupList = props.optionsGroupList, getOptionDisabled = props.getOptionDisabled, MenuItem = props.MenuItem, changeHighlightedIndexReason = props.changeHighlightedIndexReason, isKeepHighlightedIndex = props.isKeepHighlightedIndex, componentsProp = props.components, onUpdatePopper = props.onUpdatePopper, getOptionLabel = props.getOptionLabel, padding = props.padding, _c = props.maxContainerHeight, maxContainerHeight = _c === void 0 ? '100%' : _c, classNameProp = props.className, classesProp = props.classes, _d = props.position, position = _d === void 0 ? 'absolute' : _d, selectedIndex = props.selectedIndex, rest = tslib_1.__rest(props, ["highlightedIndex", "options", "getItemProps", "virtualize", "getMenuProps", "renderOption", "value", "inputValue", "groupVariant", "groupExpanded", "renderGroup", "optionsGroupList", "getOptionDisabled", "MenuItem", "changeHighlightedIndexReason", "isKeepHighlightedIndex", "components", "onUpdatePopper", "getOptionLabel", "padding", "maxContainerHeight", "className", "classes", "position", "selectedIndex"]);
|
|
25
25
|
var vlRef = react_1.useRef(null);
|
|
26
26
|
var forkVlRef = foundation_1.useForkRef(ref, vlRef);
|
|
27
27
|
var isTitleMode = groupVariant === 'normal';
|
|
@@ -125,7 +125,8 @@ var SuggestionList = react_1.forwardRef(function (inProps, ref) {
|
|
|
125
125
|
index: index,
|
|
126
126
|
className: isGroupTitle ? classes.groupTitle : undefined,
|
|
127
127
|
});
|
|
128
|
-
var
|
|
128
|
+
var highlighted = highlightedIndex === index;
|
|
129
|
+
var selected = selectedIndex === index;
|
|
129
130
|
var resultProps = tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ 'data-item-index': !virtualize ? index : undefined }, option), itemProps), { key: itemProps.id });
|
|
130
131
|
var indexInOwnGroup = resultProps.indexInOwnGroup;
|
|
131
132
|
delete resultProps.indexInOwnGroup;
|
|
@@ -136,6 +137,7 @@ var SuggestionList = react_1.forwardRef(function (inProps, ref) {
|
|
|
136
137
|
var state = {
|
|
137
138
|
inputValue: inputValue,
|
|
138
139
|
selected: selected,
|
|
140
|
+
highlighted: highlighted,
|
|
139
141
|
index: index,
|
|
140
142
|
indexInOwnGroup: indexInOwnGroup,
|
|
141
143
|
};
|
|
@@ -150,9 +152,9 @@ var SuggestionList = react_1.forwardRef(function (inProps, ref) {
|
|
|
150
152
|
if (MenuItem) {
|
|
151
153
|
return (react_1.default.createElement(MenuItem
|
|
152
154
|
// when not virtualize, use index as key
|
|
153
|
-
, tslib_1.__assign({}, resultProps, { itemId: option.id, "data-suggestion-item-id": option.id, isHighlighted: selected, isMember: option.isMember })));
|
|
155
|
+
, tslib_1.__assign({}, resultProps, { itemId: option.id, "data-suggestion-item-id": option.id, isHighlighted: selected || highlighted, isMember: option.isMember })));
|
|
154
156
|
}
|
|
155
|
-
return (react_1.default.createElement(MenuItem_1.RcMenuItem, tslib_1.__assign({ component: "div", selected: selected }, foundation_1.omit(resultProps, [
|
|
157
|
+
return (react_1.default.createElement(MenuItem_1.RcMenuItem, tslib_1.__assign({ component: "div", selected: selected, focused: highlighted }, foundation_1.omit(resultProps, [
|
|
156
158
|
'isSuggestion',
|
|
157
159
|
'freeSolo',
|
|
158
160
|
'label',
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { ComponentType } from 'react';
|
|
2
|
+
import { RcPopperProps } from '../../Popper';
|
|
2
3
|
export declare type PopperPosition = 'top-start' | 'bottom-start';
|
|
3
|
-
|
|
4
|
+
declare type StyledPopperProps = RcPopperProps & {
|
|
4
5
|
position: PopperPosition;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
/**
|
|
7
|
+
* custom component for popper
|
|
8
|
+
*/
|
|
9
|
+
component?: ComponentType<RcPopperProps>;
|
|
10
|
+
};
|
|
11
|
+
export declare const StyledPopper: import("styled-components").StyledComponentClass<Pick<StyledPopperProps, "className" | "color" | "id" | "lang" | "style" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "slot" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "component" | "placement" | "disablePortal" | "position" | "open" | "container" | "keepMounted" | "anchorEl" | "modifiers" | "popperOptions" | "popperRef" | "transition"> & React.RefAttributes<any>, import("../../../foundation").RcTheme, Pick<Pick<StyledPopperProps, "className" | "color" | "id" | "lang" | "style" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "slot" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "component" | "placement" | "disablePortal" | "position" | "open" | "container" | "keepMounted" | "anchorEl" | "modifiers" | "popperOptions" | "popperRef" | "transition"> & React.RefAttributes<any>, "ref" | "key" | "className" | "color" | "id" | "lang" | "style" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "slot" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "component" | "placement" | "disablePortal" | "position" | "open" | "container" | "keepMounted" | "anchorEl" | "modifiers" | "popperOptions" | "popperRef" | "transition"> & {
|
|
8
12
|
theme?: import("../../../foundation").RcTheme | undefined;
|
|
9
13
|
}>;
|
|
14
|
+
export {};
|
|
@@ -6,8 +6,8 @@ var foundation_1 = require("../../../foundation");
|
|
|
6
6
|
var Popper_1 = require("../../Popper");
|
|
7
7
|
var radiusLg = foundation_1.radius('lg');
|
|
8
8
|
var _StyledPopper = react_1.forwardRef(function (_a, ref) {
|
|
9
|
-
var position = _a.position, rest = tslib_1.__rest(_a, ["position"]);
|
|
10
|
-
return react_1.default.createElement(
|
|
9
|
+
var position = _a.position, _b = _a.component, Component = _b === void 0 ? Popper_1.RcPopper : _b, rest = tslib_1.__rest(_a, ["position", "component"]);
|
|
10
|
+
return react_1.default.createElement(Component, tslib_1.__assign({ ref: ref }, rest));
|
|
11
11
|
});
|
|
12
12
|
exports.StyledPopper = foundation_1.styled(_StyledPopper)(templateObject_3 || (templateObject_3 = tslib_1.__makeTemplateObject(["\n > div {\n box-shadow: ", ";\n background-color: ", ";\n overflow: hidden;\n\n ", "\n }\n"], ["\n > div {\n box-shadow: ", ";\n background-color: ", ";\n overflow: hidden;\n\n ",
|
|
13
13
|
"\n }\n"])), foundation_1.shadows('1'), foundation_1.palette2('neutral', 'elevation'), function (_a) {
|
|
@@ -11,6 +11,7 @@ var DEFAULT_HIGHLIGHTED_INDEX = -1;
|
|
|
11
11
|
exports.useDownshift = function (_a) {
|
|
12
12
|
var multipleProp = _a.multiple, variant = _a.variant, labelProp = _a.label, inputValueProp = _a.inputValue, _b = _a.getOptionLabel, getOptionLabel = _b === void 0 ? DownshiftUtils_1.DEFAULT_GET_OPTION_LABEL : _b, _c = _a.keyToTags, keyToTags = _c === void 0 ? DownshiftUtils_1.DEFAULT_KEY_TO_CHIPS : _c, filterOptionsProp = _a.filterOptions, disabledItemsHighlightable = _a.disabledItemsHighlightable, options = _a.options, freeSolo = _a.freeSolo, onInputChangeProp = _a.onInputChange, maxFreeSolo = _a.maxFreeSolo, onMaxFreeSolo = _a.onMaxFreeSolo, openOnFocus = _a.openOnFocus, disableCloseOnSelect = _a.disableCloseOnSelect, initialIsOpen = _a.initialIsOpen, autoSelect = _a.autoSelect, inputContainerRef = _a.inputContainerRef, inputRef = _a.inputRef, wrapperRef = _a.wrapperRef, onKeyDownProp = _a.onKeyDown, onSelectChange = _a.onChange, _d = _a.value, selectedItemsProp = _d === void 0 ? [] : _d, disabled = _a.disabled, renderNoOptions = _a.renderNoOptions, onClear = _a.onClear, autoHighlight = _a.autoHighlight, getOptionDisabled = _a.getOptionDisabled, addNoOptionItem = _a.addNoOptionItem, groupBy = _a.groupBy, onGroupExpanded = _a.onGroupExpanded, groupVariant = _a.groupVariant, groupExpanded = _a.groupExpanded, groupDefaultExpanded = _a.groupDefaultExpanded, getExpandIconProps = _a.getExpandIconProps, required = _a.required, openProp = _a.open, onOpen = _a.onOpen, onClose = _a.onClose, focused = _a.focused;
|
|
13
13
|
var isAutocomplete = variant === 'autocomplete';
|
|
14
|
+
var autoCompleteSelectedIndexRef = react_1.useRef(DEFAULT_HIGHLIGHTED_INDEX);
|
|
14
15
|
var downshiftId = foundation_1.useId('downshift', true);
|
|
15
16
|
var _e = tslib_1.__read(foundation_1.useControlled({
|
|
16
17
|
controlled: focused,
|
|
@@ -237,6 +238,7 @@ exports.useDownshift = function (_a) {
|
|
|
237
238
|
var fIndex = optionItems.findIndex(function (x) { return getOptionLabel(x) === itemText_1; });
|
|
238
239
|
if (fIndex > -1) {
|
|
239
240
|
toIndex = fIndex;
|
|
241
|
+
autoCompleteSelectedIndexRef.current = fIndex;
|
|
240
242
|
}
|
|
241
243
|
}
|
|
242
244
|
setHighlightedIndex(toIndex, { reason: 'auto' });
|
|
@@ -520,5 +522,6 @@ exports.useDownshift = function (_a) {
|
|
|
520
522
|
focused: focused !== null && focused !== void 0 ? focused : (tagFocused || inputFocused ? true : undefined),
|
|
521
523
|
id: downshiftId,
|
|
522
524
|
inputChanged: isInputValueChangedRef.current,
|
|
525
|
+
autoCompleteSelectedIndex: autoCompleteSelectedIndexRef.current,
|
|
523
526
|
};
|
|
524
527
|
};
|