@ringcentral/juno 2.22.0 → 2.22.1-hotfix.1
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/Buttons/Button/Button.d.ts +5 -2
- package/components/Buttons/Button/Button.js +16 -10
- package/components/Buttons/ButtonGroup/ButtonGroup.js +3 -3
- package/components/Buttons/IconButton/IconButton.d.ts +3 -2
- package/components/Buttons/IconButton/IconButton.js +17 -14
- package/components/Buttons/SplitButton/SplitButton.js +5 -5
- package/components/Buttons/SplitButton/styles/StyledSplitButton.js +3 -3
- package/components/Buttons/SplitButton/utils/SplitButtonUtils.js +8 -1
- package/components/Downshift/Downshift.js +2 -2
- package/components/Downshift/SuggestionList/utils/useSuggestionList.js +0 -3
- package/components/Downshift/styles/DownshiftStyle.d.ts +2 -2
- package/components/Downshift/utils/useDownshift.d.ts +3 -1
- package/components/Downshift/utils/useDownshift.js +23 -3
- package/components/Forms/Picker/DatePicker/styles/StyledDatePickerHeader.d.ts +2 -2
- package/components/Forms/Switch/Switch.js +13 -2
- package/components/Forms/Switch/styles/SwitchStyle.js +1 -1
- package/components/Forms/Switch/utils/SwitchUtils.js +1 -9
- package/components/Forms/TextField/TextField.js +29 -43
- package/components/Forms/TextField/styles/ClearIconButton.d.ts +2 -2
- package/components/List/ListItem/ListItem.d.ts +2 -2
- package/components/List/ListItem/ListItem.js +13 -10
- package/components/Menu/MenuItem/MenuItem.d.ts +3 -3
- package/components/Menu/MenuItem/MenuItem.js +11 -8
- package/components/TablePagination/styles/TablePaginationStyle.d.ts +3 -3
- package/es6/components/Buttons/Button/Button.js +16 -10
- package/es6/components/Buttons/ButtonGroup/ButtonGroup.js +4 -4
- package/es6/components/Buttons/IconButton/IconButton.js +17 -14
- package/es6/components/Buttons/SplitButton/SplitButton.js +6 -6
- package/es6/components/Buttons/SplitButton/styles/StyledSplitButton.js +3 -3
- package/es6/components/Buttons/SplitButton/utils/SplitButtonUtils.js +8 -1
- package/es6/components/Downshift/Downshift.js +2 -2
- package/es6/components/Downshift/SuggestionList/utils/useSuggestionList.js +0 -3
- package/es6/components/Downshift/utils/useDownshift.js +24 -4
- package/es6/components/Forms/Switch/Switch.js +15 -4
- package/es6/components/Forms/Switch/styles/SwitchStyle.js +1 -1
- package/es6/components/Forms/Switch/utils/SwitchUtils.js +1 -9
- package/es6/components/Forms/TextField/TextField.js +30 -44
- package/es6/components/List/ListItem/ListItem.js +13 -10
- package/es6/components/Menu/MenuItem/MenuItem.js +11 -8
- package/package.json +1 -1
|
@@ -8,9 +8,8 @@ import { RcButtonBase } from '../ButtonBase';
|
|
|
8
8
|
import { rcIconButtonWarning, } from './deprecated/IconButtonProps';
|
|
9
9
|
import { iconButtonStyle } from './styles';
|
|
10
10
|
import { RcIconButtonClasses, RcIconButtonTouchRippleClasses } from './utils';
|
|
11
|
-
var _RcIconButton = memo(forwardRef(function (
|
|
11
|
+
var _RcIconButton = memo(forwardRef(function (props, ref) {
|
|
12
12
|
var _a;
|
|
13
|
-
var props = useThemeProps({ props: inProps, name: 'RcIconButton' });
|
|
14
13
|
if (process.env.NODE_ENV !== 'production') {
|
|
15
14
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
16
15
|
useDeprecatedCheck(RcIconButton, props, rcIconButtonWarning);
|
|
@@ -54,18 +53,22 @@ var _RcIconButton = memo(forwardRef(function (inProps, ref) {
|
|
|
54
53
|
}
|
|
55
54
|
return iconButton;
|
|
56
55
|
}));
|
|
57
|
-
var RcIconButton = styled(withTooltip(_RcIconButton))(
|
|
56
|
+
var RcIconButton = styled(withTooltip(_RcIconButton)).attrs(function (inProps) {
|
|
57
|
+
var _a = useThemeProps({ props: inProps, name: 'RcIconButton' }),
|
|
58
|
+
// @ts-ignore
|
|
59
|
+
theme = _a.theme,
|
|
60
|
+
// Omit className, prevent duplicate className
|
|
61
|
+
className = _a.className, _b = _a.variant, variant = _b === void 0 ? 'round' : _b, _c = _a.color, color = _c === void 0 ? 'neutral.f04' : _c, _d = _a.size, size = _d === void 0 ? 'medium' : _d, _e = _a.type, type = _e === void 0 ? 'button' : _e, _f = _a.focusRipple, focusRipple = _f === void 0 ? true : _f, _g = _a.disableTouchRipple, disableTouchRipple = _g === void 0 ? true : _g, _h = _a.classes, classes = _h === void 0 ? {} : _h, _j = _a.useRcTooltip, useRcTooltip = _j === void 0 ? true : _j, _k = _a.focusVariant, focusVariant = _k === void 0 ? 'highlight' : _k, rest = __rest(_a, ["theme", "className", "variant", "color", "size", "type", "focusRipple", "disableTouchRipple", "classes", "useRcTooltip", "focusVariant"]);
|
|
62
|
+
return __assign({ variant: variant,
|
|
63
|
+
color: color,
|
|
64
|
+
size: size,
|
|
65
|
+
type: type,
|
|
66
|
+
focusRipple: focusRipple,
|
|
67
|
+
disableTouchRipple: disableTouchRipple,
|
|
68
|
+
classes: classes,
|
|
69
|
+
useRcTooltip: useRcTooltip,
|
|
70
|
+
focusVariant: focusVariant }, rest);
|
|
71
|
+
})(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), iconButtonStyle);
|
|
58
72
|
RcIconButton.displayName = 'RcIconButton';
|
|
59
|
-
RcIconButton.defaultProps = {
|
|
60
|
-
variant: 'round',
|
|
61
|
-
color: 'neutral.f04',
|
|
62
|
-
size: 'medium',
|
|
63
|
-
type: 'button',
|
|
64
|
-
focusRipple: true,
|
|
65
|
-
disableTouchRipple: true,
|
|
66
|
-
classes: {},
|
|
67
|
-
useRcTooltip: true,
|
|
68
|
-
focusVariant: 'highlight',
|
|
69
|
-
};
|
|
70
73
|
export { RcIconButton };
|
|
71
74
|
var templateObject_1;
|
|
@@ -3,7 +3,7 @@ import React, { forwardRef, useMemo, useRef, useState, } from 'react';
|
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import { checkDefaultPrevented, combineClasses, combineProps, logInDev, omit, styled, useEventCallback, useEver, useForkRef, useTheme, useThemeProps, } from '../../../foundation';
|
|
5
5
|
import { RcMenu } from '../../Menu/Menu';
|
|
6
|
-
import { RcButton } from '../Button';
|
|
6
|
+
import { RcButtonDefaultVariant, RcButtonDefaultSize, RcButtonDefaultColor, RcButton, } from '../Button';
|
|
7
7
|
import { RcButtonGroup } from '../ButtonGroup';
|
|
8
8
|
import { splitButtonStyle, StyledArrowIcon } from './styles';
|
|
9
9
|
import { getVariant, RcSplitButtonClasses, RcSplitButtonTouchRippleClasses, variantIsHandler, } from './utils';
|
|
@@ -155,17 +155,17 @@ var _RcSplitButton = forwardRef(function (inProps, ref) {
|
|
|
155
155
|
variantIs(['plain', 'plainIcon']) }, rest, { className: clsx(className, (_a = {},
|
|
156
156
|
_a[RcSplitButtonClasses.menuOpen] = isMenuOpen,
|
|
157
157
|
_a)), innerRef: splitRef, classes: classes }),
|
|
158
|
-
React.createElement(RcButton, __assign({}, _ActionButtonProps)),
|
|
159
|
-
React.createElement(RcButton, __assign({ "aria-haspopup": "listbox" }, _ControlButtonProps),
|
|
158
|
+
React.createElement(RcButton, __assign({}, _ActionButtonProps, { focusVariant: "ripple" })),
|
|
159
|
+
React.createElement(RcButton, __assign({ "aria-haspopup": "listbox" }, _ControlButtonProps, { focusVariant: "ripple" }),
|
|
160
160
|
React.createElement(StyledArrowIcon, __assign({ open: isMenuOpen, size: variantIs(['round', 'plainIcon']) ? size : toButtonSize }, ArrowIconProps)))),
|
|
161
161
|
isMenuEverOpen && (React.createElement(RcMenu, __assign({}, MenuProps, { anchorEl: anchorEl, open: isMenuOpen, onClose: handleClose }), children))));
|
|
162
162
|
});
|
|
163
163
|
var RcSplitButton = styled(_RcSplitButton)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), splitButtonStyle);
|
|
164
164
|
RcSplitButton.displayName = 'RcSplitButton';
|
|
165
165
|
RcSplitButton.defaultProps = {
|
|
166
|
-
size:
|
|
167
|
-
color:
|
|
168
|
-
variant:
|
|
166
|
+
size: RcButtonDefaultSize,
|
|
167
|
+
color: RcButtonDefaultColor,
|
|
168
|
+
variant: RcButtonDefaultVariant,
|
|
169
169
|
ControlButtonProps: {},
|
|
170
170
|
ActionButtonProps: {},
|
|
171
171
|
MenuProps: {},
|
|
@@ -38,7 +38,7 @@ var iconButtonStyle = function (_a) {
|
|
|
38
38
|
var width = px(currIconSize);
|
|
39
39
|
return css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n .", " {\n &.", " {\n min-width: auto;\n ", ";\n\n ", " {\n margin-right: 0;\n }\n }\n\n &.", " {\n min-width: ", ";\n width: ", ";\n }\n }\n "], ["\n .", " {\n &.", " {\n min-width: auto;\n ",
|
|
40
40
|
";\n\n ", " {\n margin-right: 0;\n }\n }\n\n &.", " {\n min-width: ", ";\n width: ", ";\n }\n }\n "])), RcSplitButtonClasses.groupedHorizontal, RcSplitButtonClasses.actionButton, variant === 'plainIcon'
|
|
41
|
-
? css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n padding: 0;\n box-shadow: none;\n\n ", " {\n ", "\n }\n "], ["\n padding: 0;\n box-shadow: none;\n\n ", " {\n ", "\n }\n "])), focusVisible, plainIconButtonFocusStyle({ radius: 'circle' })) : css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n padding: ", ";\n "], ["\n padding: ", ";\n "])), spacing(space, rightSpace, space, space)), RcIcon, RcSplitButtonClasses.controlButton, width, width);
|
|
41
|
+
? css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n padding: 0;\n box-shadow: none;\n\n ", " {\n outline: none;\n ", "\n }\n "], ["\n padding: 0;\n box-shadow: none;\n\n ", " {\n outline: none;\n ", "\n }\n "])), focusVisible, plainIconButtonFocusStyle({ radius: 'circle' })) : css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n padding: ", ";\n "], ["\n padding: ", ";\n "])), spacing(space, rightSpace, space, space)), RcIcon, RcSplitButtonClasses.controlButton, width, width);
|
|
42
42
|
};
|
|
43
43
|
export var splitButtonStyle = function (props) {
|
|
44
44
|
var variant = props.variant, disabled = props.disabled, loading = props.loading;
|
|
@@ -47,14 +47,14 @@ export var splitButtonStyle = function (props) {
|
|
|
47
47
|
var isContainer = variant === 'contained';
|
|
48
48
|
var activeColor24 = setOpacity(currColor, '24');
|
|
49
49
|
var containedActiveColor = setOpacity(currColor, '24', true);
|
|
50
|
-
return css(templateObject_17 || (templateObject_17 = __makeTemplateObject(["\n .", " {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n\n &:after {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n }\n }\n\n .", " {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n\n &:after {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n }\n }\n\n &.", " {\n ", ";\n\n ", ";\n }\n\n .", " {\n ", ";\n\n &.", " {\n padding: 0;\n min-width: 24px;\n ", ";\n }\n\n &.", " {\n border-right: ", ";\n }\n\n &:not(.", ") {\n margin-left: 0;\n }\n\n ", ";\n }\n\n ", ";\n\n ", ";\n\n ", ";\n\n &.", " {\n ", ";\n\n .", " {\n background: ", ";\n }\n }\n "], ["\n .", " {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n\n &:after {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n }\n }\n\n .", " {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n\n &:after {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n }\n }\n\n &.", " {\n ",
|
|
50
|
+
return css(templateObject_17 || (templateObject_17 = __makeTemplateObject(["\n .", " {\n &:not(:last-child) {\n border-right: unset;\n }\n }\n\n .", " {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n\n &:after {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n }\n }\n\n .", " {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n\n &:after {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n }\n }\n\n &.", " {\n ", ";\n\n ", ";\n }\n\n .", " {\n ", ";\n\n &.", " {\n padding: 0;\n min-width: 24px;\n ", ";\n }\n\n &.", " {\n border-right: ", ";\n }\n\n &:not(.", ") {\n margin-left: 0;\n }\n\n ", ";\n }\n\n ", ";\n\n ", ";\n\n ", ";\n\n &.", " {\n ", ";\n\n .", " {\n background: ", ";\n }\n }\n "], ["\n .", " {\n &:not(:last-child) {\n border-right: unset;\n }\n }\n\n .", " {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n\n &:after {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n }\n }\n\n .", " {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n\n &:after {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n }\n }\n\n &.", " {\n ",
|
|
51
51
|
";\n\n ",
|
|
52
52
|
";\n }\n\n .", " {\n ",
|
|
53
53
|
";\n\n &.", " {\n padding: 0;\n min-width: 24px;\n ", ";\n }\n\n &.", " {\n border-right: ", ";\n }\n\n &:not(.", ") {\n margin-left: 0;\n }\n\n ",
|
|
54
54
|
";\n }\n\n ",
|
|
55
55
|
";\n\n ",
|
|
56
56
|
";\n\n ", ";\n\n &.", " {\n ",
|
|
57
|
-
";\n\n .", " {\n background: ", ";\n }\n }\n "])), RcSplitButtonClasses.actionButton, RcSplitButtonClasses.controlButton, RcSplitButtonClasses.root, !disabled &&
|
|
57
|
+
";\n\n .", " {\n background: ", ";\n }\n }\n "])), RcSplitButtonClasses.groupedContainedHorizontal, RcSplitButtonClasses.actionButton, RcSplitButtonClasses.controlButton, RcSplitButtonClasses.root, !disabled &&
|
|
58
58
|
variantIs(['outlined', 'text', 'round']) &&
|
|
59
59
|
!loading && css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n transition: ", ";\n\n ", " {\n &:hover {\n background: ", ";\n }\n }\n "], ["\n transition: ", ";\n\n ", " {\n &:hover {\n background: ", ";\n }\n }\n "])), transition, nonTouchHoverMedia, buttonHoverColor), variantIs(['text', 'round', 'plainIcon']) && css(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n align-items: center;\n\n ", "\n "], ["\n align-items: center;\n\n ",
|
|
60
60
|
"\n "])), !disabled &&
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { RcClasses } from '../../../../foundation';
|
|
2
|
-
export var RcSplitButtonClasses = RcClasses([
|
|
2
|
+
export var RcSplitButtonClasses = RcClasses([
|
|
3
|
+
'root',
|
|
4
|
+
'groupedHorizontal',
|
|
5
|
+
'actionButton',
|
|
6
|
+
'controlButton',
|
|
7
|
+
'menuOpen',
|
|
8
|
+
'groupedContainedHorizontal',
|
|
9
|
+
], 'RcSplitButton');
|
|
3
10
|
export var RcSplitButtonTouchRippleClasses = RcClasses(['child', 'ripplePulsate'], 'RcSplitButton-TouchRipple');
|
|
4
11
|
export var getVariant = function (variant) {
|
|
5
12
|
switch (variant) {
|
|
@@ -188,7 +188,7 @@ var _RcDownshift = memo(forwardRef(function (inProps, ref) {
|
|
|
188
188
|
onKeyDown: onKeyDownProp,
|
|
189
189
|
disabledItemsHighlightable: disabledItemsHighlightable,
|
|
190
190
|
onGroupExpanded: onGroupExpanded,
|
|
191
|
-
}), focusInput = _10.focusInput, optionItems = _10.optionItems, optionsGroupList = _10.optionsGroupList, selectedItems = _10.tags, highlightedIndex = _10.highlightedIndex, getToggleButtonProps = _10.getToggleButtonProps, getTagProps = _10.getTagProps, getTagListBoxProps = _10.getTagListBoxProps, getMenuProps = _10.getMenuProps, getPopperProps = _10.getPopperProps, getInputProps = _10.getInputProps, getInputAriaProps = _10.getInputAriaProps, getLabelProps = _10.getLabelProps, getItemProps = _10.getItemProps, isOpen = _10.isOpen, inputValue = _10.inputValue, activeIndex = _10.activeIndex, setActiveIndex = _10.setActiveIndex, setHighlightedIndex = _10.setHighlightedIndex, onInputChange = _10.onInputChange, keepHighlightedIndex = _10.keepHighlightedIndex, changeHighlightedIndexReason = _10.changeHighlightedIndexReason, closeMenu = _10.closeMenu, openMenu = _10.openMenu, reset = _10.reset, getClearButtonProps = _10.getClearButtonProps, noOptionItem = _10.noOptionItem, getNoOptionsProps = _10.getNoOptionsProps, isKeepHighlightedIndex = _10.isKeepHighlightedIndex, isDownshiftFocused = _10.focused, autoCompleteSelectedIndex = _10.autoCompleteSelectedIndex;
|
|
191
|
+
}), focusInput = _10.focusInput, optionItems = _10.optionItems, optionsGroupList = _10.optionsGroupList, selectedItems = _10.tags, highlightedIndex = _10.highlightedIndex, getToggleButtonProps = _10.getToggleButtonProps, getTagProps = _10.getTagProps, getTagListBoxProps = _10.getTagListBoxProps, getMenuProps = _10.getMenuProps, getPopperProps = _10.getPopperProps, getInputProps = _10.getInputProps, getInputAriaProps = _10.getInputAriaProps, getLabelProps = _10.getLabelProps, getItemProps = _10.getItemProps, isOpen = _10.isOpen, inputValue = _10.inputValue, activeIndex = _10.activeIndex, setActiveIndex = _10.setActiveIndex, setHighlightedIndex = _10.setHighlightedIndex, onInputChange = _10.onInputChange, keepHighlightedIndex = _10.keepHighlightedIndex, changeHighlightedIndexReason = _10.changeHighlightedIndexReason, closeMenu = _10.closeMenu, openMenu = _10.openMenu, reset = _10.reset, getClearButtonProps = _10.getClearButtonProps, noOptionItem = _10.noOptionItem, getNoOptionsProps = _10.getNoOptionsProps, isKeepHighlightedIndex = _10.isKeepHighlightedIndex, isDownshiftFocused = _10.focused, autoCompleteSelectedIndex = _10.autoCompleteSelectedIndex, popperElementRef = _10.popperElementRef;
|
|
192
192
|
var open = Boolean((isOpen || noOptionItem) && textFieldRef.current);
|
|
193
193
|
var _11 = getInputProps(), onBlur = _11.onBlur, InputProps = __rest(_11, ["onBlur"]);
|
|
194
194
|
var helperText = isNew
|
|
@@ -303,7 +303,7 @@ var _RcDownshift = memo(forwardRef(function (inProps, ref) {
|
|
|
303
303
|
maxLength: maxLength, containerRef: inputContainerRef }, getInputAriaProps(TextFieldProps === null || TextFieldProps === void 0 ? void 0 : TextFieldProps.inputProps)),
|
|
304
304
|
}, rest), { value: inputValue, clearBtn: false })),
|
|
305
305
|
!helperText && screenReaderText && (React.createElement(RcVisuallyHidden, { id: describedbyId }, screenReaderText)),
|
|
306
|
-
React.createElement(StyledPopper, __assign({ open: open, position: position, component: PopperComponent, placement: "bottom-start", anchorEl: anchorElRef.current, "data-test-automation-id": "suggestions-list", popperRef: popperRef, modifiers: { fixOffsets: fixOffsetsModifer },
|
|
306
|
+
React.createElement(StyledPopper, __assign({ ref: popperElementRef, open: open, position: position, component: PopperComponent, placement: "bottom-start", anchorEl: anchorElRef.current, "data-test-automation-id": "suggestions-list", popperRef: popperRef, modifiers: { fixOffsets: fixOffsetsModifer },
|
|
307
307
|
// * view type in popper.js
|
|
308
308
|
popperOptions: {
|
|
309
309
|
onUpdate: function (e) {
|
|
@@ -116,9 +116,6 @@ export var useSuggestionList = function (_a) {
|
|
|
116
116
|
var groupOrder = (currGroup === null || currGroup === void 0 ? void 0 : currGroup.order) || 0;
|
|
117
117
|
return combineProps(__assign({ id: currUniqueId + "-option-" + index, onClick: function (e) {
|
|
118
118
|
selectItem(e, item);
|
|
119
|
-
}, onMouseDown: function (e) {
|
|
120
|
-
e.preventDefault();
|
|
121
|
-
e.stopPropagation();
|
|
122
119
|
}, onMouseOver: function () {
|
|
123
120
|
if (highlightedIndexRef.current !== index &&
|
|
124
121
|
getIsItemCanSelected(item)) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __assign, __awaiter, __generator, __read, __spread } from "tslib";
|
|
1
|
+
import { __assign, __awaiter, __generator, __read, __rest, __spread } from "tslib";
|
|
2
2
|
import { useCallback, useLayoutEffect, useMemo, useRef, } from 'react';
|
|
3
3
|
import { combineProps, getSelectionPosition, useChange, useControlled, useId, useSleep, } from '../../../foundation';
|
|
4
4
|
import { useSuggestionList } from '../SuggestionList/utils/useSuggestionList';
|
|
@@ -27,6 +27,7 @@ export var useDownshift = function (_a) {
|
|
|
27
27
|
var stopAutoSelectRef = useRef(false);
|
|
28
28
|
var fromPasteString = useRef('');
|
|
29
29
|
var keepHighlightedIndexRef = useRef(false);
|
|
30
|
+
var popperElementRef = useRef(null);
|
|
30
31
|
var _g = useSleep(), sleep = _g.sleep, getSleeping = _g.getSleeping;
|
|
31
32
|
// * when that is autocomplete, that will never be multiple
|
|
32
33
|
var multiple = isAutocomplete ? false : multipleProp;
|
|
@@ -144,7 +145,20 @@ export var useDownshift = function (_a) {
|
|
|
144
145
|
}
|
|
145
146
|
}
|
|
146
147
|
},
|
|
147
|
-
}), inputValue = _j.inputValue, optionItems = _j.optionItems, optionsGroupList = _j.optionsGroupList, highlightedIndexRef = _j.highlightedIndexRef, changeHighlightedIndexReasonRef = _j.changeHighlightedIndexReasonRef, forceUpdate = _j.forceUpdate, selectItem = _j.selectItem, handleF10KeyDown = _j.handleF10KeyDown, onKeyFocusedIndexHandle = _j.onKeyFocusedIndexHandle, setHighlightedIndex = _j.setHighlightedIndex, updateInputValue = _j.updateInputValue, clearInput = _j.clearInput, getNextFocusableOption = _j.getNextFocusableOption,
|
|
148
|
+
}), inputValue = _j.inputValue, optionItems = _j.optionItems, optionsGroupList = _j.optionsGroupList, highlightedIndexRef = _j.highlightedIndexRef, changeHighlightedIndexReasonRef = _j.changeHighlightedIndexReasonRef, forceUpdate = _j.forceUpdate, selectItem = _j.selectItem, handleF10KeyDown = _j.handleF10KeyDown, onKeyFocusedIndexHandle = _j.onKeyFocusedIndexHandle, setHighlightedIndex = _j.setHighlightedIndex, updateInputValue = _j.updateInputValue, clearInput = _j.clearInput, getNextFocusableOption = _j.getNextFocusableOption, getSuggestionListItemProps = _j.getItemProps, focusInput = _j.focusInput, resetSuggestionList = _j.reset, getSuggestionListInputProps = _j.getInputProps, getSuggestionListInputAriaProps = _j.getInputAriaProps, getSuggestionListClearButtonProps = _j.getClearButtonProps, getLabelProps = _j.getLabelProps, getMenuProps = _j.getMenuProps;
|
|
149
|
+
var getItemProps = function (props) {
|
|
150
|
+
var onMouseDown = props.onMouseDown, onMouseUp = props.onMouseUp, rest = __rest(props, ["onMouseDown", "onMouseUp"]);
|
|
151
|
+
return getSuggestionListItemProps(__assign(__assign({}, rest), { onMouseDown: function (e) {
|
|
152
|
+
// `getPopperProps` will prevent change focus when mouse down popper
|
|
153
|
+
// but suggestion item is an exception.
|
|
154
|
+
// so we need stop propagation to make sure focus can be changed
|
|
155
|
+
e.stopPropagation();
|
|
156
|
+
onMouseDown === null || onMouseDown === void 0 ? void 0 : onMouseDown(e);
|
|
157
|
+
}, onMouseUp: function (e) {
|
|
158
|
+
focusInput();
|
|
159
|
+
onMouseUp === null || onMouseUp === void 0 ? void 0 : onMouseUp(e);
|
|
160
|
+
} }));
|
|
161
|
+
};
|
|
148
162
|
var readOnly = !isAutocomplete && !multiple && tags.length >= 1 ? true : undefined;
|
|
149
163
|
var closeMenu = function (e, reason) {
|
|
150
164
|
keepHighlightedIndexRef.current = false;
|
|
@@ -280,8 +294,8 @@ export var useDownshift = function (_a) {
|
|
|
280
294
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
281
295
|
}, []);
|
|
282
296
|
var getInputProps = function (props) {
|
|
283
|
-
var
|
|
284
|
-
return combineProps(__assign(__assign({},
|
|
297
|
+
var suggestionListInputProps = getSuggestionListInputProps(props);
|
|
298
|
+
return combineProps(__assign(__assign({}, suggestionListInputProps), { onPaste: function (e) {
|
|
285
299
|
var _a;
|
|
286
300
|
if (freeSolo) {
|
|
287
301
|
var clipboardData = e.clipboardData;
|
|
@@ -318,7 +332,12 @@ export var useDownshift = function (_a) {
|
|
|
318
332
|
stopAutoSelectRef.current = false;
|
|
319
333
|
blurTags();
|
|
320
334
|
}, onBlur: function (e) {
|
|
335
|
+
var _a;
|
|
321
336
|
setInputFocused(false);
|
|
337
|
+
// mouse down suggestion item will change focus,
|
|
338
|
+
// but we don't want to close popper in this case
|
|
339
|
+
if ((_a = popperElementRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.relatedTarget))
|
|
340
|
+
return;
|
|
322
341
|
if (autoSelect && !stopAutoSelectRef.current) {
|
|
323
342
|
if (!freeSolo)
|
|
324
343
|
selectItem(e, optionItems[highlightedIndexRef.current]);
|
|
@@ -530,5 +549,6 @@ export var useDownshift = function (_a) {
|
|
|
530
549
|
id: downshiftId,
|
|
531
550
|
inputChanged: isInputValueChangedRef.current,
|
|
532
551
|
autoCompleteSelectedIndex: autoCompleteSelectedIndexRef.current,
|
|
552
|
+
popperElementRef: popperElementRef,
|
|
533
553
|
};
|
|
534
554
|
};
|
|
@@ -1,18 +1,29 @@
|
|
|
1
1
|
import { __assign, __makeTemplateObject, __rest } from "tslib";
|
|
2
|
-
import React, { forwardRef, useMemo } from 'react';
|
|
2
|
+
import React, { forwardRef, useMemo, useRef } from 'react';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import MuiSwitch from '@material-ui/core/Switch';
|
|
5
|
-
import { combineClasses, omit, useThemeProps, } from '../../../foundation';
|
|
5
|
+
import { combineClasses, omit, useThemeProps, useForkRef, } from '../../../foundation';
|
|
6
6
|
import styled from '../../../foundation/styled-components';
|
|
7
7
|
import { RcFormControlLabel } from '../FormControlLabel';
|
|
8
8
|
import { SwitchStyle } from './styles';
|
|
9
9
|
import { RcSwitchClasses } from './utils';
|
|
10
10
|
var _RcSwitch = forwardRef(function (inProps, ref) {
|
|
11
11
|
var props = useThemeProps({ props: inProps, name: 'RcSwitch' });
|
|
12
|
-
var label = props.label, _a = props.formControlLabelProps, formControlLabelProps = _a === void 0 ? {} : _a, focusVisibleClassNameProp = props.focusVisibleClassName, classesProp = props.classes, color = props.color, trackColor = props.trackColor, rest = __rest(props, ["label", "formControlLabelProps", "focusVisibleClassName", "classes", "color", "trackColor"]);
|
|
12
|
+
var label = props.label, _a = props.formControlLabelProps, formControlLabelProps = _a === void 0 ? {} : _a, focusVisibleClassNameProp = props.focusVisibleClassName, classesProp = props.classes, color = props.color, trackColor = props.trackColor, _b = props.inputRef, inputRefProp = _b === void 0 ? null : _b, onFocus = props.onFocus, onBlur = props.onBlur, rest = __rest(props, ["label", "formControlLabelProps", "focusVisibleClassName", "classes", "color", "trackColor", "inputRef", "onFocus", "onBlur"]);
|
|
13
13
|
var classes = useMemo(function () { return combineClasses(omit(RcSwitchClasses, ['focusVisible']), classesProp); }, [classesProp]);
|
|
14
14
|
var focusVisibleClassName = useMemo(function () { return clsx(RcSwitchClasses.focusVisible, focusVisibleClassNameProp); }, [focusVisibleClassNameProp]);
|
|
15
|
-
var
|
|
15
|
+
var inputRef = useRef(null);
|
|
16
|
+
var handleInputRef = useForkRef(inputRef, inputRefProp);
|
|
17
|
+
var Switch = (React.createElement(MuiSwitch, __assign({ ref: ref, inputRef: handleInputRef, focusVisibleClassName: focusVisibleClassName, classes: classes }, rest, { color: "default", size: "medium", disableRipple: true, disableTouchRipple: true, onFocus: function (e) {
|
|
18
|
+
var _a;
|
|
19
|
+
if ((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.matches('[data-focus-visible-added]')) {
|
|
20
|
+
e.currentTarget.parentElement.setAttribute('data-focus-visible-within', '');
|
|
21
|
+
}
|
|
22
|
+
onFocus === null || onFocus === void 0 ? void 0 : onFocus(e);
|
|
23
|
+
}, onBlur: function (e) {
|
|
24
|
+
e.currentTarget.parentElement.removeAttribute('data-focus-visible-within');
|
|
25
|
+
onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);
|
|
26
|
+
} })));
|
|
16
27
|
if (label) {
|
|
17
28
|
return (React.createElement(RcFormControlLabel, __assign({}, formControlLabelProps, { label: label, control: Switch })));
|
|
18
29
|
}
|
|
@@ -12,6 +12,6 @@ export var SwitchStyle = function (_a) {
|
|
|
12
12
|
var colorProp = _a.color, trackColorProp = _a.trackColor;
|
|
13
13
|
var checkedColor = getParsePaletteColor(colorProp);
|
|
14
14
|
var trackColor = getParsePaletteColor(trackColorProp, defaultTrackColorArray);
|
|
15
|
-
return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n &.", " {\n
|
|
15
|
+
return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n &.", " {\n padding: 0px;\n ", ";\n ", ";\n\n &[data-focus-visible-within] {\n border-radius: 100vw;\n ", "\n }\n\n .", " {\n ", ";\n ", ";\n padding: 0;\n background-color: transparent;\n transform: translateX(", ");\n\n &.", " {\n transform: translateX(", ");\n }\n }\n\n .", " {\n ", ";\n background-color: ", ";\n box-shadow: none;\n }\n\n .", " {\n ", ";\n opacity: 1;\n margin: 0;\n border-radius: ", ";\n background-color: ", ";\n }\n\n .", " + .", " {\n background-color: ", ";\n }\n\n .", " + .", " {\n background-color: ", ";\n }\n\n ", " {\n &:hover {\n ", ";\n }\n }\n\n &:active {\n ", ";\n }\n }\n "], ["\n &.", " {\n padding: 0px;\n ", ";\n ", ";\n\n &[data-focus-visible-within] {\n border-radius: 100vw;\n ", "\n }\n\n .", " {\n ", ";\n ", ";\n padding: 0;\n background-color: transparent;\n transform: translateX(", ");\n\n &.", " {\n transform: translateX(", ");\n }\n }\n\n .", " {\n ", ";\n background-color: ", ";\n box-shadow: none;\n }\n\n .", " {\n ", ";\n opacity: 1;\n margin: 0;\n border-radius: ", ";\n background-color: ", ";\n }\n\n .", " + .", " {\n background-color: ", ";\n }\n\n .", " + .", " {\n background-color: ", ";\n }\n\n ", " {\n &:hover {\n ", ";\n }\n }\n\n &:active {\n ", ";\n }\n }\n "])), RcSwitchClasses.root, widthCss, heightCss, focusRing('normal'), RcSwitchClasses.switchBase, widthCss, heightCss, spacing(-2), RcSwitchClasses.checked, spacing(2), RcSwitchClasses.thumb, thumbSize, thumbColor, RcSwitchClasses.track, heightCss, radius('round'), trackColor, RcSwitchClasses.checked, RcSwitchClasses.track, checkedColor, RcSwitchClasses.disabled, RcSwitchClasses.track, disabledColor, nonTouchHoverMedia, notDisabledSwitchBase('08', checkedColor, trackColor), notDisabledSwitchBase('24', checkedColor, trackColor));
|
|
16
16
|
};
|
|
17
17
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
|
|
@@ -1,10 +1,2 @@
|
|
|
1
1
|
import { RcClasses } from '../../../../foundation';
|
|
2
|
-
export var RcSwitchClasses = RcClasses([
|
|
3
|
-
'root',
|
|
4
|
-
'switchBase',
|
|
5
|
-
'thumb',
|
|
6
|
-
'track',
|
|
7
|
-
'checked',
|
|
8
|
-
'disabled',
|
|
9
|
-
'focusVisible',
|
|
10
|
-
], 'RcSwitch');
|
|
2
|
+
export var RcSwitchClasses = RcClasses(['root', 'switchBase', 'thumb', 'track', 'checked', 'disabled'], 'RcSwitch');
|
|
@@ -2,7 +2,7 @@ import { __assign, __makeTemplateObject, __read, __rest } from "tslib";
|
|
|
2
2
|
import React, { forwardRef, useEffect, useLayoutEffect, useMemo, useRef, useState, } from 'react';
|
|
3
3
|
import MuiTextField from '@material-ui/core/TextField';
|
|
4
4
|
import { DeleteCircle } from '@ringcentral/juno-icon';
|
|
5
|
-
import { clearReactReferencesInNode, combineClasses, combineProps, styled, useControlled, useDeprecatedCheck, useEventCallback, useForkRef, useThemeProps, } from '../../../foundation';
|
|
5
|
+
import { clearReactReferencesInNode, combineClasses, combineProps, styled, useControlled, useDeprecatedCheck, useEventCallback, useForkRef, useThemeProps, useId, } from '../../../foundation';
|
|
6
6
|
import { useRcFormContext } from '../Form/Form/FormContext';
|
|
7
7
|
import { ClearIconButton, TextFieldStyle } from './styles';
|
|
8
8
|
import { RcOutlineTextFieldIconSizes, RcOutlineTextFieldInputClasses, RcTextFieldClasses, RcTextFieldFormHelperTextClasses, RcTextFieldInputClasses, RcTextFieldInputLabelClasses, } from './utils';
|
|
@@ -41,7 +41,7 @@ var _RcTextField = forwardRef(function (inProps, ref) {
|
|
|
41
41
|
// TODO: remove when remove focusOnMount
|
|
42
42
|
autoFocusProp = _a === void 0 ? focusOnMount : _a, InputPropsProp = props.InputProps, error = props.error, helperText = props.helperText,
|
|
43
43
|
// no need assign to MuiTextField
|
|
44
|
-
defaultValue = props.defaultValue, inputRefProp = props.inputRef, _b = props.autoSelect, autoSelect = _b === void 0 ? selectOnMount : _b, autoFocusDelay = props.autoFocusDelay, clearLabel = props.clearLabel, clearButtonProps = props.clearButtonProps, clearBtn = props.clearBtn, validate = props.validate, onChange = props.onChange, onBlur = props.onBlur, onFocus = props.onFocus, onClear = props.onClear,
|
|
44
|
+
defaultValue = props.defaultValue, inputRefProp = props.inputRef, _b = props.autoSelect, autoSelect = _b === void 0 ? selectOnMount : _b, autoFocusDelay = props.autoFocusDelay, clearLabel = props.clearLabel, clearButtonProps = props.clearButtonProps, clearBtn = props.clearBtn, validate = props.validate, onChange = props.onChange, onBlur = props.onBlur, onFocus = props.onFocus, onClear = props.onClear, idProp = props.id,
|
|
45
45
|
// #region outline pick props
|
|
46
46
|
variant = props.variant, radius = props.radius, size = props.size, align = props.align, textVariant = props.textVariant, gutterBottom = props.gutterBottom, color = props.color,
|
|
47
47
|
// #endregion
|
|
@@ -65,7 +65,7 @@ var _RcTextField = forwardRef(function (inProps, ref) {
|
|
|
65
65
|
onChange === null || onChange === void 0 ? void 0 : onChange(fakeEvent);
|
|
66
66
|
setValidateMessage('');
|
|
67
67
|
});
|
|
68
|
-
var endAdornment =
|
|
68
|
+
var endAdornment = (function () {
|
|
69
69
|
var getCleanButton = function () {
|
|
70
70
|
var iconTitle = clearLabel || (clearButtonProps === null || clearButtonProps === void 0 ? void 0 : clearButtonProps.title);
|
|
71
71
|
var combineClearProps = combineProps({
|
|
@@ -86,48 +86,32 @@ var _RcTextField = forwardRef(function (inProps, ref) {
|
|
|
86
86
|
return InputPropsProp.endAdornment;
|
|
87
87
|
}
|
|
88
88
|
return clearBtn ? getCleanButton() : undefined;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
onFocus: function () {
|
|
104
|
-
if (validateMessage !== '') {
|
|
105
|
-
setValidateMessage('');
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
}, {
|
|
109
|
-
onBlur: onBlur,
|
|
110
|
-
onFocus: onFocus,
|
|
111
|
-
});
|
|
112
|
-
}, [onBlur, onFocus, runValidate, validateMessage]);
|
|
89
|
+
})();
|
|
90
|
+
var events = combineProps({
|
|
91
|
+
onBlur: function () {
|
|
92
|
+
runValidate();
|
|
93
|
+
},
|
|
94
|
+
onFocus: function () {
|
|
95
|
+
if (validateMessage !== '') {
|
|
96
|
+
setValidateMessage('');
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
}, {
|
|
100
|
+
onBlur: onBlur,
|
|
101
|
+
onFocus: onFocus,
|
|
102
|
+
});
|
|
113
103
|
var classes = useMemo(function () { return combineClasses(RcTextFieldClasses, classesProp); }, [classesProp]);
|
|
114
|
-
var
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
var FormHelperTextProps = useMemo(function () {
|
|
126
|
-
return combineProps({ classes: RcTextFieldFormHelperTextClasses }, FormHelperTextPropsProp);
|
|
127
|
-
}, [FormHelperTextPropsProp]);
|
|
128
|
-
var InputLabelProps = useMemo(function () {
|
|
129
|
-
return combineProps({ classes: RcTextFieldInputLabelClasses, shrink: true }, InputLabelPropsProp);
|
|
130
|
-
}, [InputLabelPropsProp]);
|
|
104
|
+
var additionClasses = {
|
|
105
|
+
outline: combineOutlineClasses,
|
|
106
|
+
borderLess: undefined,
|
|
107
|
+
standard: undefined,
|
|
108
|
+
}[variant];
|
|
109
|
+
var InputProps = combineProps({
|
|
110
|
+
classes: additionClasses || RcTextFieldInputClasses,
|
|
111
|
+
disableUnderline: ['outline', 'borderLess', 'inline'].includes(variant),
|
|
112
|
+
}, __assign(__assign({}, InputPropsProp), { endAdornment: endAdornment }));
|
|
113
|
+
var FormHelperTextProps = combineProps({ classes: RcTextFieldFormHelperTextClasses }, FormHelperTextPropsProp);
|
|
114
|
+
var InputLabelProps = combineProps({ classes: RcTextFieldInputLabelClasses, shrink: true }, InputLabelPropsProp);
|
|
131
115
|
useLayoutEffect(function () {
|
|
132
116
|
var inputElm = innerRef.current;
|
|
133
117
|
var autoFocus = autoFocusProp || (InputPropsProp === null || InputPropsProp === void 0 ? void 0 : InputPropsProp.autoFocus);
|
|
@@ -155,6 +139,8 @@ var _RcTextField = forwardRef(function (inProps, ref) {
|
|
|
155
139
|
};
|
|
156
140
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
157
141
|
}, []);
|
|
142
|
+
// TODO: remove this after upgrade to Mui5
|
|
143
|
+
var id = useId(idProp);
|
|
158
144
|
useEffect(function () {
|
|
159
145
|
if (id)
|
|
160
146
|
formContext.set(id, { validate: function () { return runValidate(); } });
|
|
@@ -6,8 +6,7 @@ import { combineClasses, combineProps, styled, useDeprecatedCheck, useThemeProps
|
|
|
6
6
|
import { withTooltip } from '../../Tooltip';
|
|
7
7
|
import { ListItemStyle } from './styles';
|
|
8
8
|
import { RcListItemClasses, RcListItemMultilineClassName, RcListItemRippleClasses, } from './utils';
|
|
9
|
-
var _RcListItem = forwardRef(function (
|
|
10
|
-
var props = useThemeProps({ props: inProps, name: 'RcListItem' });
|
|
9
|
+
var _RcListItem = forwardRef(function (props, ref) {
|
|
11
10
|
if (process.env.NODE_ENV !== 'production') {
|
|
12
11
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
13
12
|
useDeprecatedCheck(RcListItem, props, [
|
|
@@ -42,14 +41,18 @@ var _RcListItem = forwardRef(function (inProps, ref) {
|
|
|
42
41
|
}, [TouchRipplePropsProp, button]);
|
|
43
42
|
return (React.createElement(MuiListItem, __assign({}, rest, additionProps, { ref: ref, title: typeof title === 'string' ? title : undefined, classes: classes, className: ListItemClassName, button: button }), children));
|
|
44
43
|
});
|
|
45
|
-
var RcListItem = styled(withTooltip(_RcListItem))(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
44
|
+
var RcListItem = styled(withTooltip(_RcListItem)).attrs(function (inProps) {
|
|
45
|
+
var _a = useThemeProps({ props: inProps, name: 'RcListItem' }),
|
|
46
|
+
// @ts-ignore
|
|
47
|
+
theme = _a.theme,
|
|
48
|
+
// Omit className, prevent duplicate className
|
|
49
|
+
className = _a.className, _b = _a.singleLine, singleLine = _b === void 0 ? false : _b, _c = _a.button, button = _c === void 0 ? true : _c, _d = _a.canHover, canHover = _d === void 0 ? true : _d, _e = _a.size, size = _e === void 0 ? 'medium' : _e, _f = _a.focusVariant, focusVariant = _f === void 0 ? 'highlight' : _f, rest = __rest(_a, ["theme", "className", "singleLine", "button", "canHover", "size", "focusVariant"]);
|
|
50
|
+
return __assign({ singleLine: singleLine,
|
|
51
|
+
button: button,
|
|
52
|
+
canHover: canHover,
|
|
53
|
+
size: size,
|
|
54
|
+
focusVariant: focusVariant }, rest);
|
|
55
|
+
})(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), ListItemStyle);
|
|
53
56
|
RcListItem.displayName = 'RcListItem';
|
|
54
57
|
export { RcListItem };
|
|
55
58
|
var templateObject_1;
|
|
@@ -14,9 +14,8 @@ import { RcMenuListContext } from '../MenuList/MenuListContext';
|
|
|
14
14
|
import { RcSubMenuContext } from '../SubMenu/SubMenuContext';
|
|
15
15
|
import { MenuItemStyle, StyledCheckIcon } from './styles';
|
|
16
16
|
import { RcMenuItemClasses, RcMenuItemRippleClasses } from './utils';
|
|
17
|
-
var _RcMenuItem = forwardRef(function (
|
|
17
|
+
var _RcMenuItem = forwardRef(function (props, ref) {
|
|
18
18
|
var _a;
|
|
19
|
-
var props = useThemeProps({ props: inProps, name: 'RcMenuItem' });
|
|
20
19
|
var classesProp = props.classes, children = props.children, color = props.color, button = props.button, className = props.className, onMouseEnter = props.onMouseEnter, onClick = props.onClick, onFocus = props.onFocus, highlighted = props.highlighted, size = props.size, type = props.type, checked = props.checked, icon = props.icon, symbol = props.symbol, avatar = props.avatar, secondaryAction = props.secondaryAction, idRef = props.idRef, isSubMenuItem = props.isSubMenuItem, TouchRipplePropsProp = props.TouchRippleProps, title = props.title, focused = props.focused, focusVariant = props.focusVariant, rest = __rest(props, ["classes", "children", "color", "button", "className", "onMouseEnter", "onClick", "onFocus", "highlighted", "size", "type", "checked", "icon", "symbol", "avatar", "secondaryAction", "idRef", "isSubMenuItem", "TouchRippleProps", "title", "focused", "focusVariant"]);
|
|
21
20
|
var isCheckedType = type === 'checked';
|
|
22
21
|
var menuItemId = useId('menu-item', true);
|
|
@@ -105,12 +104,16 @@ var _RcMenuItem = forwardRef(function (inProps, ref) {
|
|
|
105
104
|
children,
|
|
106
105
|
itemSubAction));
|
|
107
106
|
});
|
|
108
|
-
var RcMenuItem = styled(withTooltip(_RcMenuItem))(
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
107
|
+
var RcMenuItem = styled(withTooltip(_RcMenuItem)).attrs(function (inProps) {
|
|
108
|
+
var _a = useThemeProps({ props: inProps, name: 'RcMenuItem' }),
|
|
109
|
+
// @ts-ignore
|
|
110
|
+
theme = _a.theme,
|
|
111
|
+
// Omit className, prevent duplicate className
|
|
112
|
+
className = _a.className, _b = _a.size, size = _b === void 0 ? 'medium' : _b, _c = _a.button, button = _c === void 0 ? true : _c, _d = _a.focusVariant, focusVariant = _d === void 0 ? 'highlight' : _d, rest = __rest(_a, ["theme", "className", "size", "button", "focusVariant"]);
|
|
113
|
+
return __assign({ size: size,
|
|
114
|
+
button: button,
|
|
115
|
+
focusVariant: focusVariant }, rest);
|
|
116
|
+
})(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), MenuItemStyle);
|
|
114
117
|
RcMenuItem.displayName = 'RcMenuItem';
|
|
115
118
|
export { RcMenuItem };
|
|
116
119
|
var templateObject_1;
|