@ringcentral/juno 2.14.0 → 2.15.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 +38 -2
- package/components/Downshift/Downshift.js +32 -12
- package/components/Downshift/SuggestionList/SuggestionList.d.ts +7 -1
- package/components/Downshift/SuggestionList/SuggestionList.js +40 -27
- package/components/Downshift/styles/StyledPopper.d.ts +3 -3
- package/components/Downshift/styles/StyledPopper.js +4 -4
- package/es6/components/Downshift/Downshift.js +32 -12
- package/es6/components/Downshift/SuggestionList/SuggestionList.js +40 -27
- package/es6/components/Downshift/styles/StyledPopper.js +4 -4
- package/package.json +1 -1
|
@@ -7,6 +7,7 @@ import { WithTooltipProps } from '../Tooltip';
|
|
|
7
7
|
import { RcDownshiftInput } from './styles';
|
|
8
8
|
import { RcSuggestionListProps } from './SuggestionList';
|
|
9
9
|
import { RcDownshiftDefaultFilterOptions, RcDownshiftFilterOptions, RcDownshiftGroupedOption, RcDownshiftSelectedItem, RcDownshiftSelectedItemAdditionProps } from './utils';
|
|
10
|
+
import { TransitionProps as MuiTransitionProps } from '@material-ui/core/transitions';
|
|
10
11
|
export interface RcDownshiftRenderOptionState {
|
|
11
12
|
/** current input value */
|
|
12
13
|
inputValue?: string;
|
|
@@ -178,11 +179,46 @@ declare type RcDownshiftProps<T extends RcDownshiftSelectedItem = RcDownshiftSel
|
|
|
178
179
|
*/
|
|
179
180
|
autoSelect?: boolean;
|
|
180
181
|
/** props for apply on `RcPopper` */
|
|
181
|
-
PopperProps?: RcBaseProps<RcPopperProps
|
|
182
|
+
PopperProps?: RcBaseProps<Partial<RcPopperProps>, 'open' | 'keepMounted' | 'anchorEl' | 'style'> & {
|
|
183
|
+
/**
|
|
184
|
+
* typeof that popper `anchorEl` binding when menu open
|
|
185
|
+
*
|
|
186
|
+
* - `root`: on that whole TextField
|
|
187
|
+
* - `input`: on that inside input
|
|
188
|
+
* @default 'root'
|
|
189
|
+
*/
|
|
190
|
+
anchorElType?: 'root' | 'input';
|
|
191
|
+
/**
|
|
192
|
+
* The component used for the transition.
|
|
193
|
+
*
|
|
194
|
+
* default will base on `SuggestionListProps.virtualize`
|
|
195
|
+
* @default virtualize ? `RcFade` : `RcGrow`
|
|
196
|
+
*/
|
|
197
|
+
TransitionComponent?: React.JSXElementConstructor<MuiTransitionProps & {
|
|
198
|
+
children: React.ReactElement<any, any>;
|
|
199
|
+
}>;
|
|
200
|
+
/**
|
|
201
|
+
* Set to 'auto' to automatically calculate transition time based on height.
|
|
202
|
+
* @default 'auto'
|
|
203
|
+
*/
|
|
204
|
+
transitionDuration?: MuiTransitionProps['timeout'] | 'auto';
|
|
205
|
+
/**
|
|
206
|
+
* Props applied to the transition element.
|
|
207
|
+
* By default, the element is based on this [`Transition`](http://reactcommunity.org/react-transition-group/transition/) component.
|
|
208
|
+
* @default {}
|
|
209
|
+
*/
|
|
210
|
+
TransitionProps?: MuiTransitionProps;
|
|
211
|
+
};
|
|
182
212
|
/** is have ToggleButton */
|
|
183
213
|
toggleButton?: boolean;
|
|
184
214
|
/** Props for apply on ToggleButton */
|
|
185
|
-
ToggleButtonProps?:
|
|
215
|
+
ToggleButtonProps?: RcIconButtonProps & WithTooltipProps;
|
|
216
|
+
/**
|
|
217
|
+
* get custom `ToggleButtonProps` with menu open state.
|
|
218
|
+
*
|
|
219
|
+
* that can be use when you need custom toggle button icon, that will override props you pass inside `ToggleButtonProps`
|
|
220
|
+
*/
|
|
221
|
+
getToggleButtonProps?: (isOpen: boolean) => RcDownshiftProps<T>['ToggleButtonProps'];
|
|
186
222
|
/**
|
|
187
223
|
* A ref for imperative actions.
|
|
188
224
|
*
|
|
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
var tslib_1 = require("tslib");
|
|
4
4
|
var react_1 = tslib_1.__importStar(require("react"));
|
|
5
5
|
var juno_icon_1 = require("@ringcentral/juno-icon");
|
|
6
|
+
var Fade_1 = require("../Transitions/Fade");
|
|
7
|
+
var Grow_1 = require("../Transitions/Grow");
|
|
6
8
|
var foundation_1 = require("../../foundation");
|
|
7
9
|
var Chip_1 = require("../Chip");
|
|
8
10
|
var ClearIconButton_1 = require("../Forms/TextField/styles/ClearIconButton");
|
|
@@ -12,6 +14,10 @@ exports.RcDownshiftInput = styles_1.RcDownshiftInput;
|
|
|
12
14
|
var SuggestionList_1 = require("./SuggestionList");
|
|
13
15
|
var utils_1 = require("./utils");
|
|
14
16
|
exports.RcDownshiftDefaultFilterOptions = utils_1.RcDownshiftDefaultFilterOptions;
|
|
17
|
+
/**
|
|
18
|
+
* default transition style for grow when not virtualize
|
|
19
|
+
*/
|
|
20
|
+
var DEFAULT_GROW_STYLE = { style: { transformOrigin: '0 0 0' } };
|
|
15
21
|
var _RcDownshift = react_1.memo(react_1.forwardRef(function (inProps, ref) {
|
|
16
22
|
var props = foundation_1.useThemeProps({ props: inProps, name: 'RcDownshift' });
|
|
17
23
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -125,21 +131,27 @@ var _RcDownshift = react_1.memo(react_1.forwardRef(function (inProps, ref) {
|
|
|
125
131
|
]);
|
|
126
132
|
}
|
|
127
133
|
var theme = foundation_1.useTheme();
|
|
128
|
-
var _a = props.itemToString, itemToString = _a === void 0 ? utils_1.DEFAULT_GET_OPTION_LABEL : _a, _b = props.keyToChips, keyToChips = _b === void 0 ? utils_1.DEFAULT_KEY_TO_CHIPS : _b, _c = props.limitOfFreeChips, limitOfFreeChips = _c === void 0 ? utils_1.DEFAULT_LIMIT_CHIPS : _c, minRowHeight = props.minRowHeight, suggestionItems = props.suggestionItems, messageRef = props.messageRef, MenuItem = props.MenuItem, inputLabel = props.inputLabel, nameError = props.nameError, maxLength = props.maxLength, InputItem = props.InputItem, emailError = props.emailError, autoSwitchEmail = props.autoSwitchEmail, enableFreeChips = props.enableFreeChips, inputPlaceholder = props.inputPlaceholder, errorSelectedItems = props.errorSelectedItems, enableAutoTransform = props.enableAutoTransform, allowPlainHelperText = props.allowPlainHelperText, TextFieldProps = props.TextFieldProps, selectedItemsProp = props.selectedItems, automationId = props.automationId, screenReader = props.screenReader, onSelectChange = props.onSelectChange, variant = props.variant, groupExpanded = props.groupExpanded, groupDefaultExpanded = props.groupDefaultExpanded, _d = props.groupVariant, groupVariant = _d === void 0 ? 'normal' : _d, getExpandIconProps = props.getExpandIconProps, groupBy = props.groupBy, _e = props.value, valueProp = _e === void 0 ? selectedItemsProp : _e, _f = props.autoHighlight, autoHighlight = _f === void 0 ? true : _f, _g = props.fullWidth, fullWidth = _g === void 0 ? true : _g, _h = props.clearBtn, clearBtn = _h === void 0 ? false : _h, _j = props.toggleButton, toggleButton = _j === void 0 ? false : _j, _k = props.multiple, multiple = _k === void 0 ? false : _k, clearButtonProps = props.clearButtonProps, onClear = props.onClear, ToggleButtonProps = props.ToggleButtonProps,
|
|
129
|
-
|
|
134
|
+
var _a = props.itemToString, itemToString = _a === void 0 ? utils_1.DEFAULT_GET_OPTION_LABEL : _a, _b = props.keyToChips, keyToChips = _b === void 0 ? utils_1.DEFAULT_KEY_TO_CHIPS : _b, _c = props.limitOfFreeChips, limitOfFreeChips = _c === void 0 ? utils_1.DEFAULT_LIMIT_CHIPS : _c, minRowHeight = props.minRowHeight, suggestionItems = props.suggestionItems, messageRef = props.messageRef, MenuItem = props.MenuItem, inputLabel = props.inputLabel, nameError = props.nameError, maxLength = props.maxLength, InputItem = props.InputItem, emailError = props.emailError, autoSwitchEmail = props.autoSwitchEmail, enableFreeChips = props.enableFreeChips, inputPlaceholder = props.inputPlaceholder, errorSelectedItems = props.errorSelectedItems, enableAutoTransform = props.enableAutoTransform, allowPlainHelperText = props.allowPlainHelperText, TextFieldProps = props.TextFieldProps, selectedItemsProp = props.selectedItems, automationId = props.automationId, screenReader = props.screenReader, onSelectChange = props.onSelectChange, variant = props.variant, groupExpanded = props.groupExpanded, groupDefaultExpanded = props.groupDefaultExpanded, _d = props.groupVariant, groupVariant = _d === void 0 ? 'normal' : _d, getExpandIconProps = props.getExpandIconProps, groupBy = props.groupBy, _e = props.value, valueProp = _e === void 0 ? selectedItemsProp : _e, _f = props.autoHighlight, autoHighlight = _f === void 0 ? true : _f, _g = props.fullWidth, fullWidth = _g === void 0 ? true : _g, _h = props.clearBtn, clearBtn = _h === void 0 ? false : _h, _j = props.toggleButton, toggleButton = _j === void 0 ? false : _j, _k = props.multiple, multiple = _k === void 0 ? false : _k, clearButtonProps = props.clearButtonProps, onClear = props.onClear, ToggleButtonProps = props.ToggleButtonProps, _l = props.getToggleButtonProps, getToggleButtonPropsProp = _l === void 0 ? function (isOpen) {
|
|
135
|
+
return {
|
|
136
|
+
symbol: isOpen ? juno_icon_1.ArrowUp : juno_icon_1.ArrowDown,
|
|
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"]);
|
|
139
|
+
var _8 = tslib_1.__read(react_1.useState('bottom-start'), 2), position = _8[0], setPosition = _8[1];
|
|
130
140
|
var innerInputRef = react_1.useRef(null);
|
|
131
141
|
var textFieldRef = react_1.useRef(null);
|
|
132
142
|
var inputRef = foundation_1.useForkRef(inputRefProp, innerInputRef);
|
|
133
143
|
var inputContainerRef = react_1.useRef(null);
|
|
134
144
|
// * if that have pass old suggestionItems mean that use old logic
|
|
135
145
|
var isNew = !suggestionItems;
|
|
146
|
+
var transitionDuration = transitionDurationProp === 'auto' ? undefined : transitionDurationProp;
|
|
147
|
+
var anchorElRef = anchorElType === 'input' ? inputContainerRef : textFieldRef;
|
|
136
148
|
var oneOfTagError = false;
|
|
137
149
|
if (process.env.NODE_ENV !== 'production') {
|
|
138
150
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
139
151
|
utils_1.useDownshiftError({ isNew: isNew, MenuItem: MenuItem, InputItem: InputItem });
|
|
140
152
|
}
|
|
141
153
|
var required = requiredProp || (TextFieldProps === null || TextFieldProps === void 0 ? void 0 : TextFieldProps.required);
|
|
142
|
-
var
|
|
154
|
+
var _9 = utils_1.useDownshift({
|
|
143
155
|
focused: focused,
|
|
144
156
|
open: openProp,
|
|
145
157
|
variant: variant,
|
|
@@ -178,9 +190,9 @@ var _RcDownshift = react_1.memo(react_1.forwardRef(function (inProps, ref) {
|
|
|
178
190
|
onKeyDown: onKeyDownProp,
|
|
179
191
|
disabledItemsHighlightable: disabledItemsHighlightable,
|
|
180
192
|
onGroupExpanded: onGroupExpanded,
|
|
181
|
-
}), focusInput =
|
|
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;
|
|
182
194
|
var open = Boolean((isOpen || noOptionItem) && textFieldRef.current);
|
|
183
|
-
var
|
|
195
|
+
var _10 = getInputProps(), onBlur = _10.onBlur, InputProps = tslib_1.__rest(_10, ["onBlur"]);
|
|
184
196
|
var helperText = isNew
|
|
185
197
|
? helperTextProp
|
|
186
198
|
: nameError || allowPlainHelperText
|
|
@@ -246,15 +258,15 @@ var _RcDownshift = react_1.memo(react_1.forwardRef(function (inProps, ref) {
|
|
|
246
258
|
? color || 'interactive.f01'
|
|
247
259
|
: error
|
|
248
260
|
? 'danger.f02'
|
|
249
|
-
: 'neutral.f04', size: "large",
|
|
250
|
-
var
|
|
261
|
+
: 'neutral.f04', size: "large" }, getToggleButtonProps(tslib_1.__assign(tslib_1.__assign({}, ToggleButtonProps), getToggleButtonPropsProp(isOpen))))))));
|
|
262
|
+
var _11 = (function () {
|
|
251
263
|
var _a = InputPropsProp || {}, classes = _a.classes, restInputPropsProp = tslib_1.__rest(_a, ["classes"]);
|
|
252
264
|
var toClasses = foundation_1.combineClasses(classes, utils_1.RcDownshiftInputClasses);
|
|
253
265
|
return {
|
|
254
266
|
containerClassName: toClasses.container,
|
|
255
267
|
TextFieldInputProps: foundation_1.combineProps(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ classes: foundation_1.omit(toClasses, ['container']), endAdornment: endAdornment, inputComponent: styles_1.RcDownshiftInput }, getTagListBoxProps()), InputProps), { onBlur: debug ? undefined : onBlur }), restInputPropsProp),
|
|
256
268
|
};
|
|
257
|
-
})(), containerClassName =
|
|
269
|
+
})(), containerClassName = _11.containerClassName, TextFieldInputProps = _11.TextFieldInputProps;
|
|
258
270
|
react_1.useImperativeHandle(action, function () { return ({
|
|
259
271
|
getActiveIndex: function () { return activeIndex; },
|
|
260
272
|
setActiveIndex: setActiveIndex,
|
|
@@ -277,6 +289,11 @@ var _RcDownshift = react_1.memo(react_1.forwardRef(function (inProps, ref) {
|
|
|
277
289
|
var _a;
|
|
278
290
|
(_a = popperRef.current) === null || _a === void 0 ? void 0 : _a.update();
|
|
279
291
|
});
|
|
292
|
+
var menuChildren = (
|
|
293
|
+
// * that root element for animation host
|
|
294
|
+
react_1.default.createElement("div", null,
|
|
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))),
|
|
296
|
+
isRenderNoOptions && (renderNoOptions === null || renderNoOptions === void 0 ? void 0 : renderNoOptions(getNoOptionsProps, noOptionItem))));
|
|
280
297
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
281
298
|
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,
|
|
282
299
|
// * if below one of tag is error, that main downshift default will be error
|
|
@@ -287,7 +304,7 @@ var _RcDownshift = react_1.memo(react_1.forwardRef(function (inProps, ref) {
|
|
|
287
304
|
maxLength: maxLength, containerRef: inputContainerRef }, getInputAriaProps(TextFieldProps === null || TextFieldProps === void 0 ? void 0 : TextFieldProps.inputProps)),
|
|
288
305
|
}, rest), { value: inputValue, clearBtn: false })),
|
|
289
306
|
!helperText && screenReaderText && (react_1.default.createElement(VisuallyHidden_1.RcVisuallyHidden, { id: describedbyId }, screenReaderText)),
|
|
290
|
-
react_1.default.createElement(styles_1.StyledPopper, tslib_1.__assign({ open: open, position: position, anchorEl:
|
|
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,
|
|
291
308
|
// * view type in popper.js
|
|
292
309
|
popperOptions: {
|
|
293
310
|
onUpdate: function (e) {
|
|
@@ -296,9 +313,12 @@ var _RcDownshift = react_1.memo(react_1.forwardRef(function (inProps, ref) {
|
|
|
296
313
|
setPosition(currPosition);
|
|
297
314
|
}
|
|
298
315
|
},
|
|
299
|
-
} }, getPopperProps(PopperProps)),
|
|
300
|
-
|
|
301
|
-
|
|
316
|
+
} }, getPopperProps(PopperProps), { transition: true }), popperTransition
|
|
317
|
+
? function (_a) {
|
|
318
|
+
var TransitionProps = _a.TransitionProps;
|
|
319
|
+
return (react_1.default.createElement(TransitionComponent, tslib_1.__assign({}, TransitionProps, (virtualize ? {} : DEFAULT_GROW_STYLE), TransitionPropsProp, { timeout: transitionDuration }), menuChildren));
|
|
320
|
+
}
|
|
321
|
+
: menuChildren)));
|
|
302
322
|
}));
|
|
303
323
|
var RcDownshift = foundation_1.styled(_RcDownshift)(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), styles_1.DownshiftStyle);
|
|
304
324
|
RcDownshift.defaultProps = {};
|
|
@@ -16,6 +16,8 @@ export declare type RcSuggestionListProps<T> = RcBaseProps<Partial<VirtuosoProps
|
|
|
16
16
|
* @default false
|
|
17
17
|
*/
|
|
18
18
|
padding?: boolean | number;
|
|
19
|
+
/** is that menu virtualize */
|
|
20
|
+
virtualize?: boolean;
|
|
19
21
|
} & RcClassesProps<'root' | 'toggle' | 'expanded' | 'groupTitle'>;
|
|
20
22
|
export declare type InnerSuggestionListProps = {
|
|
21
23
|
/** current highlightedIndex */
|
|
@@ -77,6 +79,8 @@ export declare const RcSuggestionList: import("styled-components").StyledCompone
|
|
|
77
79
|
* @default false
|
|
78
80
|
*/
|
|
79
81
|
padding?: number | boolean | undefined;
|
|
82
|
+
/** is that menu virtualize */
|
|
83
|
+
virtualize?: boolean | undefined;
|
|
80
84
|
} & RcClassesProps<"root" | "expanded" | "toggle" | "groupTitle"> & React.RefAttributes<any>, import("../../../foundation").RcTheme, Pick<{
|
|
81
85
|
/** current highlightedIndex */
|
|
82
86
|
highlightedIndex: number;
|
|
@@ -113,6 +117,8 @@ export declare const RcSuggestionList: import("styled-components").StyledCompone
|
|
|
113
117
|
* @default false
|
|
114
118
|
*/
|
|
115
119
|
padding?: number | boolean | undefined;
|
|
116
|
-
|
|
120
|
+
/** is that menu virtualize */
|
|
121
|
+
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"> & {
|
|
117
123
|
theme?: import("../../../foundation").RcTheme | undefined;
|
|
118
124
|
}>;
|
|
@@ -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, 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,
|
|
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"]);
|
|
25
25
|
var vlRef = react_1.useRef(null);
|
|
26
26
|
var forkVlRef = foundation_1.useForkRef(ref, vlRef);
|
|
27
27
|
var isTitleMode = groupVariant === 'normal';
|
|
@@ -30,7 +30,7 @@ var SuggestionList = react_1.forwardRef(function (inProps, ref) {
|
|
|
30
30
|
var itemCount = options.length;
|
|
31
31
|
var classes = foundation_1.combineClasses(utils_1.RcSuggestionListClasses, classesProp);
|
|
32
32
|
var className = clsx_1.default(classNameProp, classes === null || classes === void 0 ? void 0 : classes.root);
|
|
33
|
-
var
|
|
33
|
+
var _e = Virtuoso_1.useDynamicHeight({
|
|
34
34
|
itemCount: itemCount,
|
|
35
35
|
maxContainerHeight: maxContainerHeight,
|
|
36
36
|
onContainerHeightChange: function (changeHeight) {
|
|
@@ -40,25 +40,30 @@ var SuggestionList = react_1.forwardRef(function (inProps, ref) {
|
|
|
40
40
|
onUpdatePopper === null || onUpdatePopper === void 0 ? void 0 : onUpdatePopper();
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
|
-
}), totalListHeightChanged =
|
|
43
|
+
}), totalListHeightChanged = _e.totalListHeightChanged, style = _e.style, containerHeighRef = _e.containerHeighRef;
|
|
44
44
|
var sleep = foundation_1.useSleep().sleep;
|
|
45
45
|
var scrollToIndexWithRetry = foundation_1.useRetry(function (location) { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
|
|
46
|
-
var toIndex, toElm;
|
|
47
|
-
var _a, _b;
|
|
48
|
-
return tslib_1.__generator(this, function (
|
|
49
|
-
switch (
|
|
46
|
+
var toIndex, toElm_1, toElm;
|
|
47
|
+
var _a, _b, _c;
|
|
48
|
+
return tslib_1.__generator(this, function (_d) {
|
|
49
|
+
switch (_d.label) {
|
|
50
50
|
case 0:
|
|
51
|
+
toIndex = location.index;
|
|
52
|
+
if (!virtualize) {
|
|
53
|
+
toElm_1 = (_a = listRef.current) === null || _a === void 0 ? void 0 : _a.querySelector("[data-item-index=\"" + toIndex + "\"]");
|
|
54
|
+
toElm_1 === null || toElm_1 === void 0 ? void 0 : toElm_1.scrollIntoView({ block: 'nearest', inline: 'nearest' });
|
|
55
|
+
return [2 /*return*/, true];
|
|
56
|
+
}
|
|
51
57
|
if (location.index === 0 && padding !== undefined) {
|
|
52
58
|
location = tslib_1.__assign(tslib_1.__assign({}, location), { offset: -(typeof padding === 'number'
|
|
53
59
|
? padding
|
|
54
60
|
: styles_1.menuListBoundaryPadding) });
|
|
55
61
|
}
|
|
56
|
-
(
|
|
57
|
-
toIndex = location.index;
|
|
62
|
+
(_b = vlRef.current) === null || _b === void 0 ? void 0 : _b.scrollToIndex(location);
|
|
58
63
|
return [4 /*yield*/, sleep(0)];
|
|
59
64
|
case 1:
|
|
60
|
-
|
|
61
|
-
toElm = (
|
|
65
|
+
_d.sent();
|
|
66
|
+
toElm = (_c = listRef.current) === null || _c === void 0 ? void 0 : _c.querySelector("[data-item-index=\"" + toIndex + "\"]");
|
|
62
67
|
if (toElm) {
|
|
63
68
|
return [2 /*return*/, true];
|
|
64
69
|
}
|
|
@@ -69,10 +74,10 @@ var SuggestionList = react_1.forwardRef(function (inProps, ref) {
|
|
|
69
74
|
retryTimes: 10,
|
|
70
75
|
intervalTime: 20,
|
|
71
76
|
}).retry;
|
|
72
|
-
var
|
|
77
|
+
var _f = Virtuoso_1.useHighlightScroll({
|
|
73
78
|
containerHeighRef: containerHeighRef,
|
|
74
79
|
scrollToIndex: scrollToIndexWithRetry,
|
|
75
|
-
}), scrollerRef =
|
|
80
|
+
}), scrollerRef = _f.scrollerRef, scrollerRefFn = _f.scrollerRefFn, itemsRendered = _f.itemsRendered, scrollToHighlightedIndex = _f.scrollToHighlightedIndex;
|
|
76
81
|
// for safari, prevent popover
|
|
77
82
|
var virtuosoViewPort = (_a = scrollerRef.current) === null || _a === void 0 ? void 0 : _a.firstElementChild;
|
|
78
83
|
react_1.useLayoutEffect(function () {
|
|
@@ -82,7 +87,7 @@ var SuggestionList = react_1.forwardRef(function (inProps, ref) {
|
|
|
82
87
|
}, [virtuosoViewPort, position]);
|
|
83
88
|
var prevHighlightedIndex = foundation_1.usePrevious(function () { return highlightedIndex; }, true);
|
|
84
89
|
react_1.useLayoutEffect(function () {
|
|
85
|
-
if (vlRef.current &&
|
|
90
|
+
if ((!virtualize || vlRef.current) &&
|
|
86
91
|
!isKeepHighlightedIndex &&
|
|
87
92
|
// * only scroll when reason is 'keyboard'
|
|
88
93
|
changeHighlightedIndexReason &&
|
|
@@ -121,7 +126,7 @@ var SuggestionList = react_1.forwardRef(function (inProps, ref) {
|
|
|
121
126
|
className: isGroupTitle ? classes.groupTitle : undefined,
|
|
122
127
|
});
|
|
123
128
|
var selected = highlightedIndex === index;
|
|
124
|
-
var resultProps = tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, option), itemProps), { key: itemProps.id });
|
|
129
|
+
var resultProps = tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ 'data-item-index': !virtualize ? index : undefined }, option), itemProps), { key: itemProps.id });
|
|
125
130
|
var indexInOwnGroup = resultProps.indexInOwnGroup;
|
|
126
131
|
delete resultProps.indexInOwnGroup;
|
|
127
132
|
// * when item is not disabled, that should check outside is that disabled
|
|
@@ -143,7 +148,9 @@ var SuggestionList = react_1.forwardRef(function (inProps, ref) {
|
|
|
143
148
|
}
|
|
144
149
|
// TODO: that MenuItem will be remove
|
|
145
150
|
if (MenuItem) {
|
|
146
|
-
return (react_1.default.createElement(MenuItem
|
|
151
|
+
return (react_1.default.createElement(MenuItem
|
|
152
|
+
// 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 })));
|
|
147
154
|
}
|
|
148
155
|
return (react_1.default.createElement(MenuItem_1.RcMenuItem, tslib_1.__assign({ component: "div", selected: selected }, foundation_1.omit(resultProps, [
|
|
149
156
|
'isSuggestion',
|
|
@@ -166,17 +173,23 @@ var SuggestionList = react_1.forwardRef(function (inProps, ref) {
|
|
|
166
173
|
var components = react_1.useMemo(function () {
|
|
167
174
|
return tslib_1.__assign({ List: List, Header: PaddingComponent, Footer: PaddingComponent }, componentsProp);
|
|
168
175
|
}, [componentsProp, PaddingComponent]);
|
|
169
|
-
return (react_1.default.createElement(SuggestionListContext.Provider, { value: listRef },
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
176
|
+
return (react_1.default.createElement(SuggestionListContext.Provider, { value: listRef }, virtualize ? (react_1.default.createElement(Virtuoso_1.Virtuoso, tslib_1.__assign({ ref: forkVlRef, totalCount: itemCount, data: itemData, className: className, components: components, itemContent: itemContent }, getMenuProps(), foundation_1.combineProps({
|
|
177
|
+
scrollerRef: function (scrollElm) {
|
|
178
|
+
scrollerRefFn(scrollElm);
|
|
179
|
+
Virtuoso_1.modifyVlScrollerStyle(scrollElm, position);
|
|
180
|
+
},
|
|
181
|
+
itemsRendered: itemsRendered,
|
|
182
|
+
totalListHeightChanged: totalListHeightChanged,
|
|
183
|
+
style: style,
|
|
184
|
+
isScrolling: handleScrolling,
|
|
185
|
+
}, rest)))) : (react_1.default.createElement(List, { style: { maxHeight: style.height, overflow: 'auto' }, ref: function (scrollElm) {
|
|
186
|
+
scrollerRefFn(scrollElm);
|
|
187
|
+
} },
|
|
188
|
+
react_1.default.createElement(PaddingComponent, null),
|
|
189
|
+
options.map(function (x, i) {
|
|
190
|
+
return itemContent(i, x);
|
|
191
|
+
}),
|
|
192
|
+
react_1.default.createElement(PaddingComponent, null)))));
|
|
180
193
|
});
|
|
181
194
|
exports.RcSuggestionList = foundation_1.styled(SuggestionList)(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), styles_2.SuggestionListStyle);
|
|
182
195
|
exports.RcSuggestionList.displayName = 'RcSuggestionList';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare type PopperPosition = 'top' | 'bottom';
|
|
2
|
+
export declare type PopperPosition = 'top-start' | 'bottom-start';
|
|
3
3
|
export declare const StyledPopper: import("styled-components").StyledComponentClass<Pick<Pick<import("@material-ui/core").PopperProps, "ref" | "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" | "placement" | "disablePortal" | "open" | "container" | "keepMounted" | "anchorEl" | "modifiers" | "popperOptions" | "popperRef" | "transition"> & {
|
|
4
|
-
position:
|
|
4
|
+
position: PopperPosition;
|
|
5
5
|
}, "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" | "placement" | "disablePortal" | "position" | "open" | "container" | "keepMounted" | "anchorEl" | "modifiers" | "popperOptions" | "popperRef" | "transition"> & React.RefAttributes<any>, import("../../../foundation").RcTheme, Pick<Pick<Pick<import("@material-ui/core").PopperProps, "ref" | "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" | "placement" | "disablePortal" | "open" | "container" | "keepMounted" | "anchorEl" | "modifiers" | "popperOptions" | "popperRef" | "transition"> & {
|
|
6
|
-
position:
|
|
6
|
+
position: PopperPosition;
|
|
7
7
|
}, "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" | "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" | "placement" | "disablePortal" | "position" | "open" | "container" | "keepMounted" | "anchorEl" | "modifiers" | "popperOptions" | "popperRef" | "transition"> & {
|
|
8
8
|
theme?: import("../../../foundation").RcTheme | undefined;
|
|
9
9
|
}>;
|
|
@@ -9,10 +9,10 @@ var _StyledPopper = react_1.forwardRef(function (_a, ref) {
|
|
|
9
9
|
var position = _a.position, rest = tslib_1.__rest(_a, ["position"]);
|
|
10
10
|
return react_1.default.createElement(Popper_1.RcPopper, tslib_1.__assign({ ref: ref }, rest));
|
|
11
11
|
});
|
|
12
|
-
exports.StyledPopper = foundation_1.styled(_StyledPopper)(templateObject_3 || (templateObject_3 = tslib_1.__makeTemplateObject(["\n box-shadow: ", ";\n
|
|
13
|
-
"\n"])), foundation_1.shadows('1'), foundation_1.palette2('neutral', 'elevation'), function (_a) {
|
|
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
|
+
"\n }\n"])), foundation_1.shadows('1'), foundation_1.palette2('neutral', 'elevation'), function (_a) {
|
|
14
14
|
var position = _a.position;
|
|
15
|
-
return position === 'top'
|
|
16
|
-
? foundation_1.css(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n
|
|
15
|
+
return position === 'top-start'
|
|
16
|
+
? foundation_1.css(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n border-top-right-radius: ", ";\n border-top-left-radius: ", ";\n "], ["\n border-top-right-radius: ", ";\n border-top-left-radius: ", ";\n "])), radiusLg, radiusLg) : foundation_1.css(templateObject_2 || (templateObject_2 = tslib_1.__makeTemplateObject(["\n border-bottom-right-radius: ", ";\n border-bottom-left-radius: ", ";\n "], ["\n border-bottom-right-radius: ", ";\n border-bottom-left-radius: ", ";\n "])), radiusLg, radiusLg);
|
|
17
17
|
});
|
|
18
18
|
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { __assign, __makeTemplateObject, __read, __rest } from "tslib";
|
|
2
2
|
import React, { forwardRef, memo, useImperativeHandle, useMemo, useRef, useState, } from 'react';
|
|
3
3
|
import { ArrowDown, ArrowUp } from '@ringcentral/juno-icon';
|
|
4
|
+
import { RcFade } from '../Transitions/Fade';
|
|
5
|
+
import { RcGrow } from '../Transitions/Grow';
|
|
4
6
|
import { combineClasses, combineProps, getParsePaletteColor, omit, styled, useDeprecatedCheck, useEventCallback, useForkRef, useTheme, useThemeProps, } from '../../foundation';
|
|
5
7
|
import { RcChip } from '../Chip';
|
|
6
8
|
import { ClearIconButton } from '../Forms/TextField/styles/ClearIconButton';
|
|
@@ -8,6 +10,10 @@ import { RcVisuallyHidden } from '../VisuallyHidden';
|
|
|
8
10
|
import { ArrowDownButton, DownshiftStyle, EndAdornment, RcDownshiftInput, StyledPopper, StyledTextField, } from './styles';
|
|
9
11
|
import { RcSuggestionList } from './SuggestionList';
|
|
10
12
|
import { DEFAULT_GET_OPTION_LABEL, DEFAULT_KEY_TO_CHIPS, DEFAULT_LIMIT_CHIPS, RcDownshiftDefaultFilterOptions, RcDownshiftInputClasses, useDownshift, useDownshiftError, } from './utils';
|
|
13
|
+
/**
|
|
14
|
+
* default transition style for grow when not virtualize
|
|
15
|
+
*/
|
|
16
|
+
var DEFAULT_GROW_STYLE = { style: { transformOrigin: '0 0 0' } };
|
|
11
17
|
var _RcDownshift = memo(forwardRef(function (inProps, ref) {
|
|
12
18
|
var props = useThemeProps({ props: inProps, name: 'RcDownshift' });
|
|
13
19
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -121,21 +127,27 @@ var _RcDownshift = memo(forwardRef(function (inProps, ref) {
|
|
|
121
127
|
]);
|
|
122
128
|
}
|
|
123
129
|
var theme = useTheme();
|
|
124
|
-
var _a = props.itemToString, itemToString = _a === void 0 ? DEFAULT_GET_OPTION_LABEL : _a, _b = props.keyToChips, keyToChips = _b === void 0 ? DEFAULT_KEY_TO_CHIPS : _b, _c = props.limitOfFreeChips, limitOfFreeChips = _c === void 0 ? DEFAULT_LIMIT_CHIPS : _c, minRowHeight = props.minRowHeight, suggestionItems = props.suggestionItems, messageRef = props.messageRef, MenuItem = props.MenuItem, inputLabel = props.inputLabel, nameError = props.nameError, maxLength = props.maxLength, InputItem = props.InputItem, emailError = props.emailError, autoSwitchEmail = props.autoSwitchEmail, enableFreeChips = props.enableFreeChips, inputPlaceholder = props.inputPlaceholder, errorSelectedItems = props.errorSelectedItems, enableAutoTransform = props.enableAutoTransform, allowPlainHelperText = props.allowPlainHelperText, TextFieldProps = props.TextFieldProps, selectedItemsProp = props.selectedItems, automationId = props.automationId, screenReader = props.screenReader, onSelectChange = props.onSelectChange, variant = props.variant, groupExpanded = props.groupExpanded, groupDefaultExpanded = props.groupDefaultExpanded, _d = props.groupVariant, groupVariant = _d === void 0 ? 'normal' : _d, getExpandIconProps = props.getExpandIconProps, groupBy = props.groupBy, _e = props.value, valueProp = _e === void 0 ? selectedItemsProp : _e, _f = props.autoHighlight, autoHighlight = _f === void 0 ? true : _f, _g = props.fullWidth, fullWidth = _g === void 0 ? true : _g, _h = props.clearBtn, clearBtn = _h === void 0 ? false : _h, _j = props.toggleButton, toggleButton = _j === void 0 ? false : _j, _k = props.multiple, multiple = _k === void 0 ? false : _k, clearButtonProps = props.clearButtonProps, onClear = props.onClear, ToggleButtonProps = props.ToggleButtonProps,
|
|
125
|
-
|
|
130
|
+
var _a = props.itemToString, itemToString = _a === void 0 ? DEFAULT_GET_OPTION_LABEL : _a, _b = props.keyToChips, keyToChips = _b === void 0 ? DEFAULT_KEY_TO_CHIPS : _b, _c = props.limitOfFreeChips, limitOfFreeChips = _c === void 0 ? DEFAULT_LIMIT_CHIPS : _c, minRowHeight = props.minRowHeight, suggestionItems = props.suggestionItems, messageRef = props.messageRef, MenuItem = props.MenuItem, inputLabel = props.inputLabel, nameError = props.nameError, maxLength = props.maxLength, InputItem = props.InputItem, emailError = props.emailError, autoSwitchEmail = props.autoSwitchEmail, enableFreeChips = props.enableFreeChips, inputPlaceholder = props.inputPlaceholder, errorSelectedItems = props.errorSelectedItems, enableAutoTransform = props.enableAutoTransform, allowPlainHelperText = props.allowPlainHelperText, TextFieldProps = props.TextFieldProps, selectedItemsProp = props.selectedItems, automationId = props.automationId, screenReader = props.screenReader, onSelectChange = props.onSelectChange, variant = props.variant, groupExpanded = props.groupExpanded, groupDefaultExpanded = props.groupDefaultExpanded, _d = props.groupVariant, groupVariant = _d === void 0 ? 'normal' : _d, getExpandIconProps = props.getExpandIconProps, groupBy = props.groupBy, _e = props.value, valueProp = _e === void 0 ? selectedItemsProp : _e, _f = props.autoHighlight, autoHighlight = _f === void 0 ? true : _f, _g = props.fullWidth, fullWidth = _g === void 0 ? true : _g, _h = props.clearBtn, clearBtn = _h === void 0 ? false : _h, _j = props.toggleButton, toggleButton = _j === void 0 ? false : _j, _k = props.multiple, multiple = _k === void 0 ? false : _k, clearButtonProps = props.clearButtonProps, onClear = props.onClear, ToggleButtonProps = props.ToggleButtonProps, _l = props.getToggleButtonProps, getToggleButtonPropsProp = _l === void 0 ? function (isOpen) {
|
|
131
|
+
return {
|
|
132
|
+
symbol: isOpen ? ArrowUp : ArrowDown,
|
|
133
|
+
};
|
|
134
|
+
} : _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 = __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 ? RcFade : RcGrow : _2, _3 = _0.transitionDuration, transitionDurationProp = _3 === void 0 ? 'auto' : _3, _4 = _0.TransitionProps, TransitionPropsProp = _4 === void 0 ? {} : _4, PopperProps = __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 = __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"]);
|
|
135
|
+
var _8 = __read(useState('bottom-start'), 2), position = _8[0], setPosition = _8[1];
|
|
126
136
|
var innerInputRef = useRef(null);
|
|
127
137
|
var textFieldRef = useRef(null);
|
|
128
138
|
var inputRef = useForkRef(inputRefProp, innerInputRef);
|
|
129
139
|
var inputContainerRef = useRef(null);
|
|
130
140
|
// * if that have pass old suggestionItems mean that use old logic
|
|
131
141
|
var isNew = !suggestionItems;
|
|
142
|
+
var transitionDuration = transitionDurationProp === 'auto' ? undefined : transitionDurationProp;
|
|
143
|
+
var anchorElRef = anchorElType === 'input' ? inputContainerRef : textFieldRef;
|
|
132
144
|
var oneOfTagError = false;
|
|
133
145
|
if (process.env.NODE_ENV !== 'production') {
|
|
134
146
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
135
147
|
useDownshiftError({ isNew: isNew, MenuItem: MenuItem, InputItem: InputItem });
|
|
136
148
|
}
|
|
137
149
|
var required = requiredProp || (TextFieldProps === null || TextFieldProps === void 0 ? void 0 : TextFieldProps.required);
|
|
138
|
-
var
|
|
150
|
+
var _9 = useDownshift({
|
|
139
151
|
focused: focused,
|
|
140
152
|
open: openProp,
|
|
141
153
|
variant: variant,
|
|
@@ -174,9 +186,9 @@ var _RcDownshift = memo(forwardRef(function (inProps, ref) {
|
|
|
174
186
|
onKeyDown: onKeyDownProp,
|
|
175
187
|
disabledItemsHighlightable: disabledItemsHighlightable,
|
|
176
188
|
onGroupExpanded: onGroupExpanded,
|
|
177
|
-
}), focusInput =
|
|
189
|
+
}), 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;
|
|
178
190
|
var open = Boolean((isOpen || noOptionItem) && textFieldRef.current);
|
|
179
|
-
var
|
|
191
|
+
var _10 = getInputProps(), onBlur = _10.onBlur, InputProps = __rest(_10, ["onBlur"]);
|
|
180
192
|
var helperText = isNew
|
|
181
193
|
? helperTextProp
|
|
182
194
|
: nameError || allowPlainHelperText
|
|
@@ -242,15 +254,15 @@ var _RcDownshift = memo(forwardRef(function (inProps, ref) {
|
|
|
242
254
|
? color || 'interactive.f01'
|
|
243
255
|
: error
|
|
244
256
|
? 'danger.f02'
|
|
245
|
-
: 'neutral.f04', size: "large"
|
|
246
|
-
var
|
|
257
|
+
: 'neutral.f04', size: "large" }, getToggleButtonProps(__assign(__assign({}, ToggleButtonProps), getToggleButtonPropsProp(isOpen))))))));
|
|
258
|
+
var _11 = (function () {
|
|
247
259
|
var _a = InputPropsProp || {}, classes = _a.classes, restInputPropsProp = __rest(_a, ["classes"]);
|
|
248
260
|
var toClasses = combineClasses(classes, RcDownshiftInputClasses);
|
|
249
261
|
return {
|
|
250
262
|
containerClassName: toClasses.container,
|
|
251
263
|
TextFieldInputProps: combineProps(__assign(__assign(__assign({ classes: omit(toClasses, ['container']), endAdornment: endAdornment, inputComponent: RcDownshiftInput }, getTagListBoxProps()), InputProps), { onBlur: debug ? undefined : onBlur }), restInputPropsProp),
|
|
252
264
|
};
|
|
253
|
-
})(), containerClassName =
|
|
265
|
+
})(), containerClassName = _11.containerClassName, TextFieldInputProps = _11.TextFieldInputProps;
|
|
254
266
|
useImperativeHandle(action, function () { return ({
|
|
255
267
|
getActiveIndex: function () { return activeIndex; },
|
|
256
268
|
setActiveIndex: setActiveIndex,
|
|
@@ -273,6 +285,11 @@ var _RcDownshift = memo(forwardRef(function (inProps, ref) {
|
|
|
273
285
|
var _a;
|
|
274
286
|
(_a = popperRef.current) === null || _a === void 0 ? void 0 : _a.update();
|
|
275
287
|
});
|
|
288
|
+
var menuChildren = (
|
|
289
|
+
// * that root element for animation host
|
|
290
|
+
React.createElement("div", null,
|
|
291
|
+
isOpen && (React.createElement(RcSuggestionList, __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))),
|
|
292
|
+
isRenderNoOptions && (renderNoOptions === null || renderNoOptions === void 0 ? void 0 : renderNoOptions(getNoOptionsProps, noOptionItem))));
|
|
276
293
|
return (React.createElement(React.Fragment, null,
|
|
277
294
|
React.createElement(StyledTextField, __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,
|
|
278
295
|
// * if below one of tag is error, that main downshift default will be error
|
|
@@ -283,7 +300,7 @@ var _RcDownshift = memo(forwardRef(function (inProps, ref) {
|
|
|
283
300
|
maxLength: maxLength, containerRef: inputContainerRef }, getInputAriaProps(TextFieldProps === null || TextFieldProps === void 0 ? void 0 : TextFieldProps.inputProps)),
|
|
284
301
|
}, rest), { value: inputValue, clearBtn: false })),
|
|
285
302
|
!helperText && screenReaderText && (React.createElement(RcVisuallyHidden, { id: describedbyId }, screenReaderText)),
|
|
286
|
-
React.createElement(StyledPopper, __assign({ open: open, position: position, anchorEl:
|
|
303
|
+
React.createElement(StyledPopper, __assign({ open: open, position: position, placement: "bottom-start", anchorEl: anchorElRef.current, "data-test-automation-id": "suggestions-list", popperRef: popperRef,
|
|
287
304
|
// * view type in popper.js
|
|
288
305
|
popperOptions: {
|
|
289
306
|
onUpdate: function (e) {
|
|
@@ -292,9 +309,12 @@ var _RcDownshift = memo(forwardRef(function (inProps, ref) {
|
|
|
292
309
|
setPosition(currPosition);
|
|
293
310
|
}
|
|
294
311
|
},
|
|
295
|
-
} }, getPopperProps(PopperProps)),
|
|
296
|
-
|
|
297
|
-
|
|
312
|
+
} }, getPopperProps(PopperProps), { transition: true }), popperTransition
|
|
313
|
+
? function (_a) {
|
|
314
|
+
var TransitionProps = _a.TransitionProps;
|
|
315
|
+
return (React.createElement(TransitionComponent, __assign({}, TransitionProps, (virtualize ? {} : DEFAULT_GROW_STYLE), TransitionPropsProp, { timeout: transitionDuration }), menuChildren));
|
|
316
|
+
}
|
|
317
|
+
: menuChildren)));
|
|
298
318
|
}));
|
|
299
319
|
var RcDownshift = styled(_RcDownshift)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), DownshiftStyle);
|
|
300
320
|
RcDownshift.defaultProps = {};
|
|
@@ -19,7 +19,7 @@ var List = forwardRef(function (props, ref) {
|
|
|
19
19
|
var SuggestionList = forwardRef(function (inProps, ref) {
|
|
20
20
|
var _a;
|
|
21
21
|
var props = useThemeProps({ props: inProps, name: 'RcSuggestionList' });
|
|
22
|
-
var highlightedIndex = props.highlightedIndex, options = props.options, getItemProps = props.getItemProps, 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,
|
|
22
|
+
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 = __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"]);
|
|
23
23
|
var vlRef = useRef(null);
|
|
24
24
|
var forkVlRef = useForkRef(ref, vlRef);
|
|
25
25
|
var isTitleMode = groupVariant === 'normal';
|
|
@@ -28,7 +28,7 @@ var SuggestionList = forwardRef(function (inProps, ref) {
|
|
|
28
28
|
var itemCount = options.length;
|
|
29
29
|
var classes = combineClasses(RcSuggestionListClasses, classesProp);
|
|
30
30
|
var className = clsx(classNameProp, classes === null || classes === void 0 ? void 0 : classes.root);
|
|
31
|
-
var
|
|
31
|
+
var _e = useDynamicHeight({
|
|
32
32
|
itemCount: itemCount,
|
|
33
33
|
maxContainerHeight: maxContainerHeight,
|
|
34
34
|
onContainerHeightChange: function (changeHeight) {
|
|
@@ -38,25 +38,30 @@ var SuggestionList = forwardRef(function (inProps, ref) {
|
|
|
38
38
|
onUpdatePopper === null || onUpdatePopper === void 0 ? void 0 : onUpdatePopper();
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
|
-
}), totalListHeightChanged =
|
|
41
|
+
}), totalListHeightChanged = _e.totalListHeightChanged, style = _e.style, containerHeighRef = _e.containerHeighRef;
|
|
42
42
|
var sleep = useSleep().sleep;
|
|
43
43
|
var scrollToIndexWithRetry = useRetry(function (location) { return __awaiter(void 0, void 0, void 0, function () {
|
|
44
|
-
var toIndex, toElm;
|
|
45
|
-
var _a, _b;
|
|
46
|
-
return __generator(this, function (
|
|
47
|
-
switch (
|
|
44
|
+
var toIndex, toElm_1, toElm;
|
|
45
|
+
var _a, _b, _c;
|
|
46
|
+
return __generator(this, function (_d) {
|
|
47
|
+
switch (_d.label) {
|
|
48
48
|
case 0:
|
|
49
|
+
toIndex = location.index;
|
|
50
|
+
if (!virtualize) {
|
|
51
|
+
toElm_1 = (_a = listRef.current) === null || _a === void 0 ? void 0 : _a.querySelector("[data-item-index=\"" + toIndex + "\"]");
|
|
52
|
+
toElm_1 === null || toElm_1 === void 0 ? void 0 : toElm_1.scrollIntoView({ block: 'nearest', inline: 'nearest' });
|
|
53
|
+
return [2 /*return*/, true];
|
|
54
|
+
}
|
|
49
55
|
if (location.index === 0 && padding !== undefined) {
|
|
50
56
|
location = __assign(__assign({}, location), { offset: -(typeof padding === 'number'
|
|
51
57
|
? padding
|
|
52
58
|
: menuListBoundaryPadding) });
|
|
53
59
|
}
|
|
54
|
-
(
|
|
55
|
-
toIndex = location.index;
|
|
60
|
+
(_b = vlRef.current) === null || _b === void 0 ? void 0 : _b.scrollToIndex(location);
|
|
56
61
|
return [4 /*yield*/, sleep(0)];
|
|
57
62
|
case 1:
|
|
58
|
-
|
|
59
|
-
toElm = (
|
|
63
|
+
_d.sent();
|
|
64
|
+
toElm = (_c = listRef.current) === null || _c === void 0 ? void 0 : _c.querySelector("[data-item-index=\"" + toIndex + "\"]");
|
|
60
65
|
if (toElm) {
|
|
61
66
|
return [2 /*return*/, true];
|
|
62
67
|
}
|
|
@@ -67,10 +72,10 @@ var SuggestionList = forwardRef(function (inProps, ref) {
|
|
|
67
72
|
retryTimes: 10,
|
|
68
73
|
intervalTime: 20,
|
|
69
74
|
}).retry;
|
|
70
|
-
var
|
|
75
|
+
var _f = useHighlightScroll({
|
|
71
76
|
containerHeighRef: containerHeighRef,
|
|
72
77
|
scrollToIndex: scrollToIndexWithRetry,
|
|
73
|
-
}), scrollerRef =
|
|
78
|
+
}), scrollerRef = _f.scrollerRef, scrollerRefFn = _f.scrollerRefFn, itemsRendered = _f.itemsRendered, scrollToHighlightedIndex = _f.scrollToHighlightedIndex;
|
|
74
79
|
// for safari, prevent popover
|
|
75
80
|
var virtuosoViewPort = (_a = scrollerRef.current) === null || _a === void 0 ? void 0 : _a.firstElementChild;
|
|
76
81
|
useLayoutEffect(function () {
|
|
@@ -80,7 +85,7 @@ var SuggestionList = forwardRef(function (inProps, ref) {
|
|
|
80
85
|
}, [virtuosoViewPort, position]);
|
|
81
86
|
var prevHighlightedIndex = usePrevious(function () { return highlightedIndex; }, true);
|
|
82
87
|
useLayoutEffect(function () {
|
|
83
|
-
if (vlRef.current &&
|
|
88
|
+
if ((!virtualize || vlRef.current) &&
|
|
84
89
|
!isKeepHighlightedIndex &&
|
|
85
90
|
// * only scroll when reason is 'keyboard'
|
|
86
91
|
changeHighlightedIndexReason &&
|
|
@@ -119,7 +124,7 @@ var SuggestionList = forwardRef(function (inProps, ref) {
|
|
|
119
124
|
className: isGroupTitle ? classes.groupTitle : undefined,
|
|
120
125
|
});
|
|
121
126
|
var selected = highlightedIndex === index;
|
|
122
|
-
var resultProps = __assign(__assign(__assign({}, option), itemProps), { key: itemProps.id });
|
|
127
|
+
var resultProps = __assign(__assign(__assign({ 'data-item-index': !virtualize ? index : undefined }, option), itemProps), { key: itemProps.id });
|
|
123
128
|
var indexInOwnGroup = resultProps.indexInOwnGroup;
|
|
124
129
|
delete resultProps.indexInOwnGroup;
|
|
125
130
|
// * when item is not disabled, that should check outside is that disabled
|
|
@@ -141,7 +146,9 @@ var SuggestionList = forwardRef(function (inProps, ref) {
|
|
|
141
146
|
}
|
|
142
147
|
// TODO: that MenuItem will be remove
|
|
143
148
|
if (MenuItem) {
|
|
144
|
-
return (React.createElement(MenuItem
|
|
149
|
+
return (React.createElement(MenuItem
|
|
150
|
+
// when not virtualize, use index as key
|
|
151
|
+
, __assign({}, resultProps, { itemId: option.id, "data-suggestion-item-id": option.id, isHighlighted: selected, isMember: option.isMember })));
|
|
145
152
|
}
|
|
146
153
|
return (React.createElement(RcMenuItem, __assign({ component: "div", selected: selected }, omit(resultProps, [
|
|
147
154
|
'isSuggestion',
|
|
@@ -164,17 +171,23 @@ var SuggestionList = forwardRef(function (inProps, ref) {
|
|
|
164
171
|
var components = useMemo(function () {
|
|
165
172
|
return __assign({ List: List, Header: PaddingComponent, Footer: PaddingComponent }, componentsProp);
|
|
166
173
|
}, [componentsProp, PaddingComponent]);
|
|
167
|
-
return (React.createElement(SuggestionListContext.Provider, { value: listRef },
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
174
|
+
return (React.createElement(SuggestionListContext.Provider, { value: listRef }, virtualize ? (React.createElement(Virtuoso, __assign({ ref: forkVlRef, totalCount: itemCount, data: itemData, className: className, components: components, itemContent: itemContent }, getMenuProps(), combineProps({
|
|
175
|
+
scrollerRef: function (scrollElm) {
|
|
176
|
+
scrollerRefFn(scrollElm);
|
|
177
|
+
modifyVlScrollerStyle(scrollElm, position);
|
|
178
|
+
},
|
|
179
|
+
itemsRendered: itemsRendered,
|
|
180
|
+
totalListHeightChanged: totalListHeightChanged,
|
|
181
|
+
style: style,
|
|
182
|
+
isScrolling: handleScrolling,
|
|
183
|
+
}, rest)))) : (React.createElement(List, { style: { maxHeight: style.height, overflow: 'auto' }, ref: function (scrollElm) {
|
|
184
|
+
scrollerRefFn(scrollElm);
|
|
185
|
+
} },
|
|
186
|
+
React.createElement(PaddingComponent, null),
|
|
187
|
+
options.map(function (x, i) {
|
|
188
|
+
return itemContent(i, x);
|
|
189
|
+
}),
|
|
190
|
+
React.createElement(PaddingComponent, null)))));
|
|
178
191
|
});
|
|
179
192
|
export var RcSuggestionList = styled(SuggestionList)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), SuggestionListStyle);
|
|
180
193
|
RcSuggestionList.displayName = 'RcSuggestionList';
|
|
@@ -7,10 +7,10 @@ var _StyledPopper = forwardRef(function (_a, ref) {
|
|
|
7
7
|
var position = _a.position, rest = __rest(_a, ["position"]);
|
|
8
8
|
return React.createElement(RcPopper, __assign({ ref: ref }, rest));
|
|
9
9
|
});
|
|
10
|
-
export var StyledPopper = styled(_StyledPopper)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n box-shadow: ", ";\n
|
|
11
|
-
"\n"])), shadows('1'), palette2('neutral', 'elevation'), function (_a) {
|
|
10
|
+
export var StyledPopper = styled(_StyledPopper)(templateObject_3 || (templateObject_3 = __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 ",
|
|
11
|
+
"\n }\n"])), shadows('1'), palette2('neutral', 'elevation'), function (_a) {
|
|
12
12
|
var position = _a.position;
|
|
13
|
-
return position === 'top'
|
|
14
|
-
? css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n
|
|
13
|
+
return position === 'top-start'
|
|
14
|
+
? css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border-top-right-radius: ", ";\n border-top-left-radius: ", ";\n "], ["\n border-top-right-radius: ", ";\n border-top-left-radius: ", ";\n "])), radiusLg, radiusLg) : css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n border-bottom-right-radius: ", ";\n border-bottom-left-radius: ", ";\n "], ["\n border-bottom-right-radius: ", ";\n border-bottom-left-radius: ", ";\n "])), radiusLg, radiusLg);
|
|
15
15
|
});
|
|
16
16
|
var templateObject_1, templateObject_2, templateObject_3;
|