@ringcentral/juno 2.1.0 → 2.2.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.
@@ -11,8 +11,17 @@ declare type RcBadgeProps = {
11
11
  borderColor?: RcPaletteKeys;
12
12
  /** The component used for the root node. Either a string to use a HTML element or a component. */
13
13
  component?: ElementType;
14
- /** Wrapped shape the badge should overlap */
15
- overlap?: UnionPick<NonNullable<ComponentProps<typeof MuiBadge>['overlap']>, 'circular' | 'rectangular'> | 'none';
14
+ /**
15
+ * Wrapped shape the badge should overlap
16
+ * - `circular`: for circular children
17
+ * - `rectangular`: for rectangular children
18
+ * - `round`: for round radius rectangular children, like
19
+ * ```jsx
20
+ * <RcButton radius="round">click</RcButton>
21
+ * ```
22
+ * - `none`: not do any overlap on that badge
23
+ */
24
+ overlap?: UnionPick<NonNullable<ComponentProps<typeof MuiBadge>['overlap']>, 'circular' | 'rectangular'> | 'none' | 'round';
16
25
  /**
17
26
  * Custom dot render Component in `dot` mode
18
27
  * if you don't want any dot, you can set `null`
@@ -13,9 +13,31 @@ var utils_2 = require("./utils");
13
13
  var _RcBadge = react_1.forwardRef(function (inProps, ref) {
14
14
  var props = foundation_1.useThemeProps({ props: inProps, name: 'RcBadge' });
15
15
  var classesProp = props.classes, children = props.children, overlap = props.overlap, color = props.color, variant = props.variant, textColor = props.textColor, anchorOrigin = props.anchorOrigin, borderColor = props.borderColor, component = props.component, dotComponent = props.dotComponent, dotProps = props.dotProps, rest = tslib_1.__rest(props, ["classes", "children", "overlap", "color", "variant", "textColor", "anchorOrigin", "borderColor", "component", "dotComponent", "dotProps"]);
16
+ // * should never change overlap
17
+ if (process.env.NODE_ENV !== 'production') {
18
+ // eslint-disable-next-line react-hooks/rules-of-hooks
19
+ foundation_1.useChange(function (prev) {
20
+ if (!prev)
21
+ return;
22
+ foundation_1.logInDev({
23
+ component: 'RcBadge',
24
+ message: 'Should not change `overlap` prop after component render',
25
+ level: 'error',
26
+ });
27
+ }, function () { return overlap; });
28
+ }
29
+ var innerRef = react_1.useRef(null);
30
+ var badgeRef = foundation_1.useForkRef(innerRef, ref);
31
+ var isRound = overlap === 'round';
32
+ var isDot = variant === 'dot';
33
+ var notPassOverlapToMui = overlap !== 'none' && !isRound;
34
+ // overlap will never change in production mode
35
+ if (isRound) {
36
+ // eslint-disable-next-line react-hooks/rules-of-hooks
37
+ utils_2.useRoundBadgeOffset(innerRef);
38
+ }
16
39
  var classes = react_1.useMemo(function () { return foundation_1.combineProps(utils_2.RcBadgeClasses, classesProp); }, [classesProp]);
17
40
  var CustomDotBadge = react_1.useMemo(function () {
18
- var isDot = variant === 'dot';
19
41
  return isDot
20
42
  ? react_1.forwardRef(function (_a, ref) {
21
43
  var OmitChildren = _a.children, rest = tslib_1.__rest(_a, ["children"]);
@@ -29,8 +51,10 @@ var _RcBadge = react_1.forwardRef(function (inProps, ref) {
29
51
  react_1.default.createElement(DotComponent, tslib_1.__assign({}, applyDotProps))))));
30
52
  })
31
53
  : undefined;
32
- }, [anchorOrigin, children, dotComponent, dotProps, overlap, variant]);
33
- return (react_1.default.createElement(Badge_1.default, tslib_1.__assign({}, rest, { variant: variant, anchorOrigin: anchorOrigin, component: (component || CustomDotBadge), overlap: overlap !== 'none' ? overlap : undefined, ref: ref, classes: classes }), children));
54
+ }, [isDot, dotProps, overlap, anchorOrigin, children, dotComponent]);
55
+ return (react_1.default.createElement(Badge_1.default, tslib_1.__assign({}, rest, { variant: variant, anchorOrigin: anchorOrigin, component: (component || CustomDotBadge),
56
+ // TODO: that as any for ts v3.8 still not support pick variable out of if check
57
+ overlap: notPassOverlapToMui ? overlap : undefined, ref: badgeRef, classes: classes }), children));
34
58
  });
35
59
  var RcBadge = foundation_1.styled(_RcBadge)(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), styles_1.BadgeStyle);
36
60
  exports.RcBadge = RcBadge;
@@ -5,6 +5,7 @@ var foundation_1 = require("../../../foundation");
5
5
  var utils_1 = require("../utils");
6
6
  exports.BadgeStyle = function (_a) {
7
7
  var badgeContent = _a.badgeContent, overlap = _a.overlap, variant = _a.variant, textColor = _a.textColor, borderColor = _a.borderColor, max = _a.max, color = _a.color;
8
+ var overlapRound = overlap === 'round';
8
9
  var overlapNone = overlap === 'none';
9
10
  var isStandard = variant !== 'dot';
10
11
  var borderCurrColor = foundation_1.getParsePaletteColor(borderColor, null, false);
@@ -12,10 +13,10 @@ exports.BadgeStyle = function (_a) {
12
13
  var manyChar = (['number', 'string'].includes(typeof badgeContent) &&
13
14
  ("" + badgeContent).length !== 1) ||
14
15
  (max && max > 0 && +badgeContent > max);
15
- return foundation_1.css(templateObject_5 || (templateObject_5 = tslib_1.__makeTemplateObject(["\n .", " {\n color: ", ";\n background-color: ", ";\n\n ", ";\n\n ", "\n\n ", "\n }\n "], ["\n .", " {\n color: ", ";\n background-color: ", ";\n\n ",
16
+ return foundation_1.css(templateObject_5 || (templateObject_5 = tslib_1.__makeTemplateObject(["\n .", " {\n margin: ", ";\n color: ", ";\n background-color: ", ";\n\n ", ";\n\n ", "\n\n ", "\n }\n "], ["\n .", " {\n margin: ", ";\n color: ", ";\n background-color: ", ";\n\n ",
16
17
  ";\n\n ",
17
18
  "\n\n ",
18
- "\n }\n "])), utils_1.RcBadgeClasses.badge, foundation_1.getParsePaletteColor(textColor, null, false), foundation_1.getParsePaletteColor(color, null, false), borderColor && foundation_1.css(templateObject_2 || (templateObject_2 = tslib_1.__makeTemplateObject(["\n ", "\n "], ["\n ",
19
+ "\n }\n "])), utils_1.RcBadgeClasses.badge, overlapRound && "var(" + utils_1.roundBadgeMarginKey + ")", foundation_1.getParsePaletteColor(textColor, null, false), foundation_1.getParsePaletteColor(color, null, false), borderColor && foundation_1.css(templateObject_2 || (templateObject_2 = tslib_1.__makeTemplateObject(["\n ", "\n "], ["\n ",
19
20
  "\n "])), isStandard
20
21
  ? foundation_1.fakeBorder({ color: borderCurrColor, radius: 'round' })
21
22
  : foundation_1.css(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n border-color: ", ";\n "], ["\n border-color: ", ";\n "])), borderCurrColor)), isStandard && foundation_1.css(templateObject_3 || (templateObject_3 = tslib_1.__makeTemplateObject(["\n height: 18px;\n min-width: 18px;\n padding: ", ";\n "], ["\n height: 18px;\n min-width: 18px;\n padding: ", ";\n "])), !manyChar && 0), overlapNone && foundation_1.css(templateObject_4 || (templateObject_4 = tslib_1.__makeTemplateObject(["\n position: unset;\n transform: unset;\n\n &.", " {\n transform: scale(0);\n }\n "], ["\n position: unset;\n transform: unset;\n\n &.", " {\n transform: scale(0);\n }\n "])), utils_1.RcBadgeClasses.invisible));
@@ -1 +1,8 @@
1
1
  export declare const RcBadgeClasses: Partial<import("../../../foundation").UnitMap<import("@material-ui/core").BadgeClassKey, any>>;
2
+ export declare const roundBadgeMarginKey = "--badge-round-margin";
3
+ /**
4
+ * a circle inside square, that diagonal of a square to circle distance to be the round offset.
5
+ * @param x that circle r
6
+ * @returns the distance of that offset
7
+ */
8
+ export declare const getRoundOffset: (x: number) => number;
@@ -2,3 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var foundation_1 = require("../../../foundation");
4
4
  exports.RcBadgeClasses = foundation_1.RcClasses(['badge', 'invisible'], 'RcBadge');
5
+ exports.roundBadgeMarginKey = '--badge-round-margin';
6
+ var sqrt2 = Math.sqrt(2);
7
+ var powBy = sqrt2 - 1; // 0.292893218813452
8
+ /**
9
+ * a circle inside square, that diagonal of a square to circle distance to be the round offset.
10
+ * @param x that circle r
11
+ * @returns the distance of that offset
12
+ */
13
+ exports.getRoundOffset = function (x) {
14
+ return (x * powBy) / sqrt2;
15
+ };
@@ -1 +1,2 @@
1
1
  export * from './BadgeUtils';
2
+ export * from './useRoundBadgeOffset';
@@ -2,3 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./BadgeUtils"), exports);
5
+ tslib_1.__exportStar(require("./useRoundBadgeOffset"), exports);
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ /**
3
+ * modify round badge offset to correct position,
4
+ * only trigger when host element height change
5
+ * @param badgeRef badge
6
+ */
7
+ export declare const useRoundBadgeOffset: (badgeRef: React.RefObject<HTMLElement>) => void;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var tslib_1 = require("tslib");
4
+ var react_1 = require("react");
5
+ var foundation_1 = require("../../../foundation");
6
+ var BadgeUtils_1 = require("./BadgeUtils");
7
+ /**
8
+ * modify round badge offset to correct position,
9
+ * only trigger when host element height change
10
+ * @param badgeRef badge
11
+ */
12
+ exports.useRoundBadgeOffset = function (badgeRef) {
13
+ var currHeightRef = react_1.useRef(0);
14
+ // eslint-disable-next-line react-hooks/rules-of-hooks
15
+ foundation_1.useResizeObserver(badgeRef, function (_a) {
16
+ var _b = tslib_1.__read(_a, 1), badgeObsEntry = _b[0];
17
+ var height = badgeObsEntry.contentRect.height;
18
+ var element = badgeObsEntry.target;
19
+ if (currHeightRef.current === height)
20
+ return;
21
+ currHeightRef.current = height;
22
+ var offset = BadgeUtils_1.getRoundOffset(height / 2);
23
+ element.style.setProperty(BadgeUtils_1.roundBadgeMarginKey, foundation_1.px(offset));
24
+ }, { mode: 'throttle' });
25
+ };
@@ -40,8 +40,26 @@ declare type RcChipProps = {
40
40
  /** @deprecated should use `error` */
41
41
  isError?: boolean;
42
42
  } & RcBaseProps<ComponentProps<typeof MuiChip>, 'color' | 'size' | 'icon'> & RcChipClassProp;
43
- declare const RcChip: import("styled-components").StyledComponentClass<Pick<RcChipProps, "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" | "label" | "slot" | "title" | "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" | "variant" | "innerRef" | "disabled" | "focused" | "error" | "avatar" | "clickable" | "deleteIcon" | "onDelete" | "backgroundColor" | "isError" | "deleteIconProps" | "Avatar" | "deleteAutomationId" | "deleteTooltip"> & React.RefAttributes<any>, import("../../foundation").RcTheme, Pick<Pick<RcChipProps, "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" | "label" | "slot" | "title" | "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" | "variant" | "innerRef" | "disabled" | "focused" | "error" | "avatar" | "clickable" | "deleteIcon" | "onDelete" | "backgroundColor" | "isError" | "deleteIconProps" | "Avatar" | "deleteAutomationId" | "deleteTooltip"> & 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" | "label" | "slot" | "title" | "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" | "variant" | "innerRef" | "disabled" | "focused" | "error" | "avatar" | "clickable" | "deleteIcon" | "onDelete" | "backgroundColor" | "isError" | "deleteIconProps" | "Avatar" | "deleteAutomationId" | "deleteTooltip"> & {
44
- theme?: import("../../foundation").RcTheme | undefined;
45
- }>;
43
+ interface RcChipTypeMap<D extends React.ElementType = 'div'> {
44
+ props: RcChipProps;
45
+ defaultComponent: D;
46
+ }
47
+ declare const RcChip: (import("@material-ui/core/OverridableComponent").OverridableComponent<RcChipTypeMap<"div"> & {
48
+ classKey: "";
49
+ }> & string & React.FunctionComponent<RcChipProps>) | (import("@material-ui/core/OverridableComponent").OverridableComponent<RcChipTypeMap<"div"> & {
50
+ classKey: "";
51
+ }> & number & React.FunctionComponent<RcChipProps>) | (import("@material-ui/core/OverridableComponent").OverridableComponent<RcChipTypeMap<"div"> & {
52
+ classKey: "";
53
+ }> & false & React.FunctionComponent<RcChipProps>) | (import("@material-ui/core/OverridableComponent").OverridableComponent<RcChipTypeMap<"div"> & {
54
+ classKey: "";
55
+ }> & import("styled-components").Styles & React.FunctionComponent<RcChipProps>) | (import("@material-ui/core/OverridableComponent").OverridableComponent<RcChipTypeMap<"div"> & {
56
+ classKey: "";
57
+ }> & import("styled-components").Keyframes & React.FunctionComponent<RcChipProps>) | (import("@material-ui/core/OverridableComponent").OverridableComponent<RcChipTypeMap<"div"> & {
58
+ classKey: "";
59
+ }> & import("styled-components").StyledComponentClass<any, any, any> & React.FunctionComponent<RcChipProps>) | (import("@material-ui/core/OverridableComponent").OverridableComponent<RcChipTypeMap<"div"> & {
60
+ classKey: "";
61
+ }> & import("styled-components").InterpolationFunction<import("styled-components").ThemedStyledProps<RcChipProps, import("../../foundation").RcTheme>> & React.FunctionComponent<RcChipProps>) | (import("@material-ui/core/OverridableComponent").OverridableComponent<RcChipTypeMap<"div"> & {
62
+ classKey: "";
63
+ }> & readonly (string | number | false | import("styled-components").Styles | import("styled-components").Keyframes | import("styled-components").StyledComponentClass<any, any, any> | import("styled-components").InterpolationFunction<import("styled-components").ThemedStyledProps<RcChipProps, import("../../foundation").RcTheme>> | readonly import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<RcChipProps, import("../../foundation").RcTheme>>[] | null | undefined)[] & React.FunctionComponent<RcChipProps>);
46
64
  export { RcChip };
47
65
  export type { RcChipProps };
@@ -48,7 +48,7 @@ var _RcChip = react_1.forwardRef(function (inProps, ref) {
48
48
  });
49
49
  return (react_1.default.createElement(Chip_1.default, tslib_1.__assign({ ref: chipRef, id: id, tabIndex: disabled ? -1 : tabIndex, label: label, disabled: disabled, classes: classes, className: clsx_1.default(className, focused ? combinedClasses.focused : undefined), avatar: avatar, deleteIcon: deleteIcon, "data-test-automation-class": "selected-item", "data-test-automation-value": id ? id : label, "data-is-error": error }, rest)));
50
50
  });
51
- var RcChip = foundation_1.styled(_RcChip)(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), styles_1.ChipStyle);
51
+ var RcChip = foundation_1.overridableStyled(_RcChip)(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), styles_1.ChipStyle);
52
52
  exports.RcChip = RcChip;
53
53
  RcChip.defaultProps = {
54
54
  tabIndex: 0,
@@ -1,11 +1,15 @@
1
- import React from 'react';
1
+ import React, { ComponentType } from 'react';
2
2
  import { RcBaseProps } from '../../../../foundation';
3
- import { RcMenuProps } from '../../../Menu';
3
+ import { RcMenuItemProps, RcMenuProps } from '../../../Menu';
4
4
  import { RcTooltipProps } from '../../../Tooltip';
5
5
  import { RcTabProps } from '../../Tab';
6
6
  declare type MoreMenuTabProps = {
7
7
  menuItems: RcBaseProps<RcTabProps>[];
8
8
  MenuProps?: RcBaseProps<RcMenuProps, 'anchorEl' | 'open' | 'variant'>;
9
+ /**
10
+ * custom MenuItem render component
11
+ */
12
+ MenuItemComponent?: ComponentType<RcMenuItemProps>;
9
13
  TooltipProps?: RcBaseProps<RcTooltipProps, 'children'>;
10
14
  onChange?: (event: React.MouseEvent<HTMLLIElement>, value: any) => void;
11
15
  orientation?: 'horizontal' | 'vertical';
@@ -13,7 +17,7 @@ declare type MoreMenuTabProps = {
13
17
  } & RcBaseProps<RcTabProps, 'onChange'>;
14
18
  declare const DEFAULT_MORE_MENU_TAB_LABEL = "more_menu_tab";
15
19
  /** inner component */
16
- declare const MoreMenuTab: import("styled-components").StyledComponentClass<Pick<MoreMenuTabProps, "key" | "className" | "color" | "id" | "lang" | "style" | "role" | "tabIndex" | "direction" | "orientation" | "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" | "label" | "slot" | "title" | "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" | "innerRef" | "disabled" | "action" | "buttonRef" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "onFocusVisible" | "TouchRippleProps" | "icon" | "disableFocusRipple" | "fullWidth" | "TooltipProps" | "selected" | "MenuProps" | "menuItems" | "MoreIcon"> & React.RefAttributes<any>, import("../../../../foundation").RcTheme, Pick<Pick<MoreMenuTabProps, "key" | "className" | "color" | "id" | "lang" | "style" | "role" | "tabIndex" | "direction" | "orientation" | "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" | "label" | "slot" | "title" | "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" | "innerRef" | "disabled" | "action" | "buttonRef" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "onFocusVisible" | "TouchRippleProps" | "icon" | "disableFocusRipple" | "fullWidth" | "TooltipProps" | "selected" | "MenuProps" | "menuItems" | "MoreIcon"> & React.RefAttributes<any>, "ref" | "key" | "className" | "color" | "id" | "lang" | "style" | "role" | "tabIndex" | "direction" | "orientation" | "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" | "label" | "slot" | "title" | "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" | "innerRef" | "disabled" | "action" | "buttonRef" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "onFocusVisible" | "TouchRippleProps" | "icon" | "disableFocusRipple" | "fullWidth" | "TooltipProps" | "selected" | "MenuProps" | "menuItems" | "MoreIcon"> & {
20
+ declare const MoreMenuTab: import("styled-components").StyledComponentClass<Pick<MoreMenuTabProps, "key" | "className" | "color" | "id" | "lang" | "style" | "role" | "tabIndex" | "direction" | "orientation" | "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" | "label" | "slot" | "title" | "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" | "innerRef" | "disabled" | "action" | "buttonRef" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "onFocusVisible" | "TouchRippleProps" | "icon" | "disableFocusRipple" | "fullWidth" | "TooltipProps" | "selected" | "MenuProps" | "menuItems" | "MenuItemComponent" | "MoreIcon"> & React.RefAttributes<any>, import("../../../../foundation").RcTheme, Pick<Pick<MoreMenuTabProps, "key" | "className" | "color" | "id" | "lang" | "style" | "role" | "tabIndex" | "direction" | "orientation" | "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" | "label" | "slot" | "title" | "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" | "innerRef" | "disabled" | "action" | "buttonRef" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "onFocusVisible" | "TouchRippleProps" | "icon" | "disableFocusRipple" | "fullWidth" | "TooltipProps" | "selected" | "MenuProps" | "menuItems" | "MenuItemComponent" | "MoreIcon"> & React.RefAttributes<any>, "ref" | "key" | "className" | "color" | "id" | "lang" | "style" | "role" | "tabIndex" | "direction" | "orientation" | "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" | "label" | "slot" | "title" | "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" | "innerRef" | "disabled" | "action" | "buttonRef" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "onFocusVisible" | "TouchRippleProps" | "icon" | "disableFocusRipple" | "fullWidth" | "TooltipProps" | "selected" | "MenuProps" | "menuItems" | "MenuItemComponent" | "MoreIcon"> & {
17
21
  theme?: import("../../../../foundation").RcTheme | undefined;
18
22
  }>;
19
23
  export { DEFAULT_MORE_MENU_TAB_LABEL, MoreMenuTab };
@@ -14,10 +14,10 @@ var styles_1 = require("./styles");
14
14
  var DEFAULT_MORE_MENU_TAB_LABEL = 'more_menu_tab';
15
15
  exports.DEFAULT_MORE_MENU_TAB_LABEL = DEFAULT_MORE_MENU_TAB_LABEL;
16
16
  var _MoreMenuTab = react_1.forwardRef(function (props, ref) {
17
- var menuItems = props.menuItems, _a = props.MenuProps, MenuProps = _a === void 0 ? {} : _a, TooltipProps = props.TooltipProps, onChange = props.onChange, MoreIconProp = props.MoreIcon, rest = tslib_1.__rest(props, ["menuItems", "MenuProps", "TooltipProps", "onChange", "MoreIcon"]);
17
+ var menuItems = props.menuItems, _a = props.MenuItemComponent, MenuItemComponent = _a === void 0 ? Menu_1.RcMenuItem : _a, _b = props.MenuProps, MenuProps = _b === void 0 ? {} : _b, TooltipProps = props.TooltipProps, onChange = props.onChange, MoreIconProp = props.MoreIcon, rest = tslib_1.__rest(props, ["menuItems", "MenuItemComponent", "MenuProps", "TooltipProps", "onChange", "MoreIcon"]);
18
18
  var menuIdProp = MenuProps.id, onMenuCloseProp = MenuProps.onClose, MenuPropsRest = tslib_1.__rest(MenuProps, ["id", "onClose"]);
19
19
  var menuId = foundation_1.useId(menuIdProp);
20
- var _b = tslib_1.__read(react_1.useState(null), 2), anchorEl = _b[0], setAnchorEl = _b[1];
20
+ var _c = tslib_1.__read(react_1.useState(null), 2), anchorEl = _c[0], setAnchorEl = _c[1];
21
21
  var MoreIcon = react_1.useMemo(function () {
22
22
  var Icon = MoreIconProp || (react_1.default.createElement(Icon_1.RcIcon, { size: "medium", color: "neutral.f04", symbol: juno_icon_1.MoreHoriz }));
23
23
  if (TooltipProps === null || TooltipProps === void 0 ? void 0 : TooltipProps.title) {
@@ -42,11 +42,11 @@ var _MoreMenuTab = react_1.forwardRef(function (props, ref) {
42
42
  onChange === null || onChange === void 0 ? void 0 : onChange(event, value);
43
43
  onClick === null || onClick === void 0 ? void 0 : onClick(event);
44
44
  };
45
- return (react_1.default.createElement(Menu_1.RcMenuItem, { key: utils_1.getKey(menuItemRest.key, idx), disabled: disabled, selected: selected, value: value, onClick: handleClick, "data-test-automation-id": menuItemRest['data-test-automation-id'] },
45
+ return (react_1.default.createElement(MenuItemComponent, { key: utils_1.getKey(menuItemRest.key, idx), disabled: disabled, selected: selected, value: value, onClick: handleClick, "data-test-automation-id": menuItemRest['data-test-automation-id'] },
46
46
  icon ? react_1.default.createElement(List_1.RcListItemIcon, null, icon) : null,
47
47
  react_1.default.createElement(List_1.RcListItemText, { primary: label || value })));
48
48
  });
49
- }, [menuItems, onChange]);
49
+ }, [MenuItemComponent, menuItems, onChange]);
50
50
  return (react_1.default.createElement(react_1.default.Fragment, null,
51
51
  react_1.default.createElement(Tab_1.RcTab, tslib_1.__assign({}, rest, { ref: ref, onClick: handleTabClick, label: MoreIcon, value: DEFAULT_MORE_MENU_TAB_LABEL, "aria-haspopup": "true", "aria-controls": menuId })),
52
52
  react_1.default.createElement(Menu_1.RcMenu, tslib_1.__assign({ autoClose: true }, MenuPropsRest, { id: menuId, anchorEl: anchorEl, open: Boolean(anchorEl), variant: "menu", onClose: handleMenuClose }), MenuList)));
@@ -22,7 +22,7 @@ exports.findChildrenByKey = function (childrenProp, key) {
22
22
  var _MoreMenuTabs = react_1.forwardRef(function (props, ref) {
23
23
  var orientation = props.orientation, childrenProp = props.children, valueProp = props.value, onChange = props.onChange, _a = props.MoreButtonProps, MoreButtonProps = _a === void 0 ? {} : _a, rest = tslib_1.__rest(props, ["orientation", "children", "value", "onChange", "MoreButtonProps"]);
24
24
  var onGroupInfoChange = MoreButtonProps.onGroupInfoChange, MoreButtonPropsRest = tslib_1.__rest(MoreButtonProps, ["onGroupInfoChange"]);
25
- var prevChildren = foundation_1.usePrevious(function () { return childrenProp; });
25
+ var prevChildrenProp = foundation_1.usePrevious(function () { return childrenProp; });
26
26
  var isVertical = orientation === 'vertical';
27
27
  var oriStr = isVertical ? 'height' : 'width';
28
28
  var innerRef = react_1.useRef(null);
@@ -54,42 +54,39 @@ var _MoreMenuTabs = react_1.forwardRef(function (props, ref) {
54
54
  throttleTabsSizeChange(obj);
55
55
  }, { mode: 'none' });
56
56
  var tabsSize = tabsSizeRef.current;
57
- // init all children elm
58
- if (tabRefsMapRef.current === undefined) {
59
- var getRefsMapAndSetDefaultTabChildren = function () {
60
- var tabRefs = new Map();
61
- var tabsTabDefaultChild = [];
62
- react_1.default.Children.forEach(childrenProp, function (child, index) {
63
- var _a = child.props, ref = _a.ref, value = _a.value;
64
- var innerRef = react_1.createRef();
65
- var tabRef = ref ? foundation_1.useForkRef(innerRef, ref) : innerRef;
66
- var childrenValue = value || index;
67
- var children = react_1.default.cloneElement(child, {
68
- ref: tabRef,
69
- value: childrenValue,
70
- });
71
- var keyString = typeof child.key === 'string' ? child.key : '';
72
- tabRefs.set(utils_1.getKey(keyString, index), {
73
- ref: tabRef,
74
- size: null,
75
- index: index,
76
- value: childrenValue,
77
- });
78
- tabsTabDefaultChild.push(children);
57
+ // initial tabRefsMapRef and tabsTabChildRef
58
+ if (tabRefsMapRef.current === undefined ||
59
+ prevChildrenProp !== childrenProp) {
60
+ var tabRefs_1 = new Map();
61
+ var tabsTabDefaultChild_1 = [];
62
+ react_1.default.Children.forEach(childrenProp, function (child, index) {
63
+ var _a = child.props, ref = _a.ref, value = _a.value;
64
+ var innerRef = react_1.createRef();
65
+ var tabRef = ref ? foundation_1.useForkRef(innerRef, ref) : innerRef;
66
+ var childrenValue = value || index;
67
+ var children = react_1.default.cloneElement(child, {
68
+ ref: tabRef,
69
+ value: childrenValue,
79
70
  });
80
- return {
81
- tabRefs: tabRefs,
82
- tabsTabDefaultChild: tabsTabDefaultChild,
83
- };
84
- };
85
- var _d = getRefsMapAndSetDefaultTabChildren(), tabRefs = _d.tabRefs, tabsTabDefaultChild = _d.tabsTabDefaultChild;
86
- tabRefsMapRef.current = tabRefs;
87
- tabsTabChildRef.current = tabsTabDefaultChild;
71
+ var keyString = typeof child.key === 'string' ? child.key : '';
72
+ tabRefs_1.set(utils_1.getKey(keyString, index), {
73
+ ref: tabRef,
74
+ size: null,
75
+ index: index,
76
+ value: childrenValue,
77
+ });
78
+ tabsTabDefaultChild_1.push(children);
79
+ });
80
+ tabRefsMapRef.current = tabRefs_1;
81
+ tabsTabChildRef.current = tabsTabDefaultChild_1;
88
82
  }
89
- // get all size when first render
83
+ // get real render size when render
90
84
  react_1.useEffect(function () {
85
+ if (childrenProp === prevChildrenProp) {
86
+ return;
87
+ }
91
88
  var tabRefsMap = tabRefsMapRef.current;
92
- if ((tabRefsMap === null || tabRefsMap === void 0 ? void 0 : tabRefsMap.size) !== undefined) {
89
+ if (tabRefsMap && tabRefsMap.size !== 0) {
93
90
  var allTabsSize_1 = tslib_1.__assign({}, utils_1.DEFAULT_SIZE);
94
91
  tabRefsMap.forEach(function (value, key) {
95
92
  var _a = utils_1.getDomBoundingClientSize(value.ref.current), width = _a.width, height = _a.height;
@@ -110,8 +107,7 @@ var _MoreMenuTabs = react_1.forwardRef(function (props, ref) {
110
107
  var size = utils_1.getDomBoundingClientSize(moreElm);
111
108
  moreTabSizeRef.current = size;
112
109
  }
113
- // eslint-disable-next-line react-hooks/exhaustive-deps
114
- }, []);
110
+ }, [childrenProp, prevChildrenProp]);
115
111
  react_1.useEffect(function () {
116
112
  var _a;
117
113
  var currSelectTabItem;
@@ -190,11 +186,11 @@ var _MoreMenuTabs = react_1.forwardRef(function (props, ref) {
190
186
  }
191
187
  };
192
188
  if (tabsSize.width !== 0 && tabsSize.height !== 0) {
193
- // computed: 1.resize 2. valueProp 3.moreMenuClick
189
+ // computed: 1.resize 2. valueProp 3.moreMenuClick 4.children change
194
190
  // not computed: visible tab change
195
191
  if (((_a = groupingRef.current) === null || _a === void 0 ? void 0 : _a.tabs.includes((currSelectTabItem === null || currSelectTabItem === void 0 ? void 0 : currSelectTabItem[0]) || '')) &&
196
192
  !hasResizeRef.current &&
197
- prevChildren === childrenProp) {
193
+ prevChildrenProp === childrenProp) {
198
194
  return;
199
195
  }
200
196
  computeTabChild(tabsSize);
@@ -202,10 +198,10 @@ var _MoreMenuTabs = react_1.forwardRef(function (props, ref) {
202
198
  }
203
199
  }, [
204
200
  childrenProp,
201
+ prevChildrenProp,
205
202
  isVertical,
206
203
  onGroupInfoChange,
207
204
  oriStr,
208
- prevChildren,
209
205
  tabsSize,
210
206
  valueProp,
211
207
  ]);
@@ -12,9 +12,11 @@ var _RcTabs = react_1.forwardRef(function (inProps, ref) {
12
12
  var classesProp = props.classes, childrenProp = props.children, variantProp = props.variant, size = props.size, MoreButtonProps = props.MoreButtonProps, rest = tslib_1.__rest(props, ["classes", "children", "variant", "size", "MoreButtonProps"]);
13
13
  var isMore = variantProp === 'moreMenu';
14
14
  var classes = react_1.useMemo(function () { return foundation_1.combineProps(utils_1.RcTabsClasses, classesProp); }, [classesProp]);
15
- var children = react_1.default.Children.map(childrenProp, function (child) {
16
- return react_1.default.cloneElement(child, { size: size });
17
- });
15
+ var children = react_1.useMemo(function () {
16
+ return react_1.default.Children.map(childrenProp, function (child) {
17
+ return react_1.default.cloneElement(child, { size: size });
18
+ });
19
+ }, [childrenProp, size]);
18
20
  if (isMore) {
19
21
  return (react_1.default.createElement(MoreMenuTabs_1.MoreMenuTabs, tslib_1.__assign({}, rest, { ref: ref, classes: classes, size: size, MoreButtonProps: MoreButtonProps }), children));
20
22
  }
@@ -1,19 +1,41 @@
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 MuiBadge from '@material-ui/core/Badge';
5
5
  import { capitalize } from '@material-ui/core/utils';
6
- import { combineProps, styled, useThemeProps, } from '../../foundation';
6
+ import { combineProps, logInDev, styled, useChange, useForkRef, useThemeProps, } from '../../foundation';
7
7
  import { RcBox } from '../Box';
8
8
  import { RcPresence } from '../Presence';
9
9
  import { BadgeStyle } from './styles';
10
- import { RcBadgeClasses } from './utils';
10
+ import { RcBadgeClasses, useRoundBadgeOffset } from './utils';
11
11
  var _RcBadge = forwardRef(function (inProps, ref) {
12
12
  var props = useThemeProps({ props: inProps, name: 'RcBadge' });
13
13
  var classesProp = props.classes, children = props.children, overlap = props.overlap, color = props.color, variant = props.variant, textColor = props.textColor, anchorOrigin = props.anchorOrigin, borderColor = props.borderColor, component = props.component, dotComponent = props.dotComponent, dotProps = props.dotProps, rest = __rest(props, ["classes", "children", "overlap", "color", "variant", "textColor", "anchorOrigin", "borderColor", "component", "dotComponent", "dotProps"]);
14
+ // * should never change overlap
15
+ if (process.env.NODE_ENV !== 'production') {
16
+ // eslint-disable-next-line react-hooks/rules-of-hooks
17
+ useChange(function (prev) {
18
+ if (!prev)
19
+ return;
20
+ logInDev({
21
+ component: 'RcBadge',
22
+ message: 'Should not change `overlap` prop after component render',
23
+ level: 'error',
24
+ });
25
+ }, function () { return overlap; });
26
+ }
27
+ var innerRef = useRef(null);
28
+ var badgeRef = useForkRef(innerRef, ref);
29
+ var isRound = overlap === 'round';
30
+ var isDot = variant === 'dot';
31
+ var notPassOverlapToMui = overlap !== 'none' && !isRound;
32
+ // overlap will never change in production mode
33
+ if (isRound) {
34
+ // eslint-disable-next-line react-hooks/rules-of-hooks
35
+ useRoundBadgeOffset(innerRef);
36
+ }
14
37
  var classes = useMemo(function () { return combineProps(RcBadgeClasses, classesProp); }, [classesProp]);
15
38
  var CustomDotBadge = useMemo(function () {
16
- var isDot = variant === 'dot';
17
39
  return isDot
18
40
  ? forwardRef(function (_a, ref) {
19
41
  var OmitChildren = _a.children, rest = __rest(_a, ["children"]);
@@ -27,8 +49,10 @@ var _RcBadge = forwardRef(function (inProps, ref) {
27
49
  React.createElement(DotComponent, __assign({}, applyDotProps))))));
28
50
  })
29
51
  : undefined;
30
- }, [anchorOrigin, children, dotComponent, dotProps, overlap, variant]);
31
- return (React.createElement(MuiBadge, __assign({}, rest, { variant: variant, anchorOrigin: anchorOrigin, component: (component || CustomDotBadge), overlap: overlap !== 'none' ? overlap : undefined, ref: ref, classes: classes }), children));
52
+ }, [isDot, dotProps, overlap, anchorOrigin, children, dotComponent]);
53
+ return (React.createElement(MuiBadge, __assign({}, rest, { variant: variant, anchorOrigin: anchorOrigin, component: (component || CustomDotBadge),
54
+ // TODO: that as any for ts v3.8 still not support pick variable out of if check
55
+ overlap: notPassOverlapToMui ? overlap : undefined, ref: badgeRef, classes: classes }), children));
32
56
  });
33
57
  var RcBadge = styled(_RcBadge)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), BadgeStyle);
34
58
  RcBadge.defaultProps = {
@@ -1,8 +1,9 @@
1
1
  import { __makeTemplateObject } from "tslib";
2
2
  import { css, fakeBorder, getParsePaletteColor, } from '../../../foundation';
3
- import { RcBadgeClasses } from '../utils';
3
+ import { RcBadgeClasses, roundBadgeMarginKey } from '../utils';
4
4
  export var BadgeStyle = function (_a) {
5
5
  var badgeContent = _a.badgeContent, overlap = _a.overlap, variant = _a.variant, textColor = _a.textColor, borderColor = _a.borderColor, max = _a.max, color = _a.color;
6
+ var overlapRound = overlap === 'round';
6
7
  var overlapNone = overlap === 'none';
7
8
  var isStandard = variant !== 'dot';
8
9
  var borderCurrColor = getParsePaletteColor(borderColor, null, false);
@@ -10,10 +11,10 @@ export var BadgeStyle = function (_a) {
10
11
  var manyChar = (['number', 'string'].includes(typeof badgeContent) &&
11
12
  ("" + badgeContent).length !== 1) ||
12
13
  (max && max > 0 && +badgeContent > max);
13
- return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n .", " {\n color: ", ";\n background-color: ", ";\n\n ", ";\n\n ", "\n\n ", "\n }\n "], ["\n .", " {\n color: ", ";\n background-color: ", ";\n\n ",
14
+ return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n .", " {\n margin: ", ";\n color: ", ";\n background-color: ", ";\n\n ", ";\n\n ", "\n\n ", "\n }\n "], ["\n .", " {\n margin: ", ";\n color: ", ";\n background-color: ", ";\n\n ",
14
15
  ";\n\n ",
15
16
  "\n\n ",
16
- "\n }\n "])), RcBadgeClasses.badge, getParsePaletteColor(textColor, null, false), getParsePaletteColor(color, null, false), borderColor && css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n "], ["\n ",
17
+ "\n }\n "])), RcBadgeClasses.badge, overlapRound && "var(" + roundBadgeMarginKey + ")", getParsePaletteColor(textColor, null, false), getParsePaletteColor(color, null, false), borderColor && css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n "], ["\n ",
17
18
  "\n "])), isStandard
18
19
  ? fakeBorder({ color: borderCurrColor, radius: 'round' })
19
20
  : css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border-color: ", ";\n "], ["\n border-color: ", ";\n "])), borderCurrColor)), isStandard && css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n height: 18px;\n min-width: 18px;\n padding: ", ";\n "], ["\n height: 18px;\n min-width: 18px;\n padding: ", ";\n "])), !manyChar && 0), overlapNone && css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n position: unset;\n transform: unset;\n\n &.", " {\n transform: scale(0);\n }\n "], ["\n position: unset;\n transform: unset;\n\n &.", " {\n transform: scale(0);\n }\n "])), RcBadgeClasses.invisible));
@@ -1,2 +1,13 @@
1
1
  import { RcClasses } from '../../../foundation';
2
2
  export var RcBadgeClasses = RcClasses(['badge', 'invisible'], 'RcBadge');
3
+ export var roundBadgeMarginKey = '--badge-round-margin';
4
+ var sqrt2 = Math.sqrt(2);
5
+ var powBy = sqrt2 - 1; // 0.292893218813452
6
+ /**
7
+ * a circle inside square, that diagonal of a square to circle distance to be the round offset.
8
+ * @param x that circle r
9
+ * @returns the distance of that offset
10
+ */
11
+ export var getRoundOffset = function (x) {
12
+ return (x * powBy) / sqrt2;
13
+ };
@@ -1 +1,2 @@
1
1
  export * from './BadgeUtils';
2
+ export * from './useRoundBadgeOffset';
@@ -0,0 +1,23 @@
1
+ import { __read } from "tslib";
2
+ import { useRef } from 'react';
3
+ import { px, useResizeObserver } from '../../../foundation';
4
+ import { getRoundOffset, roundBadgeMarginKey } from './BadgeUtils';
5
+ /**
6
+ * modify round badge offset to correct position,
7
+ * only trigger when host element height change
8
+ * @param badgeRef badge
9
+ */
10
+ export var useRoundBadgeOffset = function (badgeRef) {
11
+ var currHeightRef = useRef(0);
12
+ // eslint-disable-next-line react-hooks/rules-of-hooks
13
+ useResizeObserver(badgeRef, function (_a) {
14
+ var _b = __read(_a, 1), badgeObsEntry = _b[0];
15
+ var height = badgeObsEntry.contentRect.height;
16
+ var element = badgeObsEntry.target;
17
+ if (currHeightRef.current === height)
18
+ return;
19
+ currHeightRef.current = height;
20
+ var offset = getRoundOffset(height / 2);
21
+ element.style.setProperty(roundBadgeMarginKey, px(offset));
22
+ }, { mode: 'throttle' });
23
+ };
@@ -3,7 +3,7 @@ import React, { forwardRef, useLayoutEffect, useMemo, useRef, } from 'react';
3
3
  import clsx from 'clsx';
4
4
  import MuiChip from '@material-ui/core/Chip';
5
5
  import { DeleteCircle } from '@ringcentral/juno-icon';
6
- import { combineClasses, isRcElement, omit, removeClassName, styled, useForkRef, useThemeProps, } from '../../foundation';
6
+ import { combineClasses, isRcElement, omit, removeClassName, overridableStyled, useForkRef, useThemeProps, } from '../../foundation';
7
7
  import { RcIconButton } from '../Buttons/IconButton';
8
8
  import { ChipStyle } from './styles';
9
9
  import { RcChipClasses } from './utils';
@@ -46,7 +46,7 @@ var _RcChip = forwardRef(function (inProps, ref) {
46
46
  });
47
47
  return (React.createElement(MuiChip, __assign({ ref: chipRef, id: id, tabIndex: disabled ? -1 : tabIndex, label: label, disabled: disabled, classes: classes, className: clsx(className, focused ? combinedClasses.focused : undefined), avatar: avatar, deleteIcon: deleteIcon, "data-test-automation-class": "selected-item", "data-test-automation-value": id ? id : label, "data-is-error": error }, rest)));
48
48
  });
49
- var RcChip = styled(_RcChip)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), ChipStyle);
49
+ var RcChip = overridableStyled(_RcChip)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), ChipStyle);
50
50
  RcChip.defaultProps = {
51
51
  tabIndex: 0,
52
52
  // FIXME: after implement click state, that can be remove
@@ -4,17 +4,17 @@ import { MoreHoriz as MoreHorizIcon } from '@ringcentral/juno-icon';
4
4
  import { styled, useEventCallback, useId, } from '../../../../foundation';
5
5
  import { RcIcon } from '../../../Icon';
6
6
  import { RcListItemIcon, RcListItemText } from '../../../List';
7
- import { RcMenu, RcMenuItem } from '../../../Menu';
7
+ import { RcMenu, RcMenuItem, } from '../../../Menu';
8
8
  import { RcTooltip } from '../../../Tooltip';
9
9
  import { RcTab } from '../../Tab';
10
10
  import { getKey } from '../MoreMenuTabs/utils';
11
11
  import { MoreMenuTabStyle } from './styles';
12
12
  var DEFAULT_MORE_MENU_TAB_LABEL = 'more_menu_tab';
13
13
  var _MoreMenuTab = forwardRef(function (props, ref) {
14
- var menuItems = props.menuItems, _a = props.MenuProps, MenuProps = _a === void 0 ? {} : _a, TooltipProps = props.TooltipProps, onChange = props.onChange, MoreIconProp = props.MoreIcon, rest = __rest(props, ["menuItems", "MenuProps", "TooltipProps", "onChange", "MoreIcon"]);
14
+ var menuItems = props.menuItems, _a = props.MenuItemComponent, MenuItemComponent = _a === void 0 ? RcMenuItem : _a, _b = props.MenuProps, MenuProps = _b === void 0 ? {} : _b, TooltipProps = props.TooltipProps, onChange = props.onChange, MoreIconProp = props.MoreIcon, rest = __rest(props, ["menuItems", "MenuItemComponent", "MenuProps", "TooltipProps", "onChange", "MoreIcon"]);
15
15
  var menuIdProp = MenuProps.id, onMenuCloseProp = MenuProps.onClose, MenuPropsRest = __rest(MenuProps, ["id", "onClose"]);
16
16
  var menuId = useId(menuIdProp);
17
- var _b = __read(useState(null), 2), anchorEl = _b[0], setAnchorEl = _b[1];
17
+ var _c = __read(useState(null), 2), anchorEl = _c[0], setAnchorEl = _c[1];
18
18
  var MoreIcon = useMemo(function () {
19
19
  var Icon = MoreIconProp || (React.createElement(RcIcon, { size: "medium", color: "neutral.f04", symbol: MoreHorizIcon }));
20
20
  if (TooltipProps === null || TooltipProps === void 0 ? void 0 : TooltipProps.title) {
@@ -39,11 +39,11 @@ var _MoreMenuTab = forwardRef(function (props, ref) {
39
39
  onChange === null || onChange === void 0 ? void 0 : onChange(event, value);
40
40
  onClick === null || onClick === void 0 ? void 0 : onClick(event);
41
41
  };
42
- return (React.createElement(RcMenuItem, { key: getKey(menuItemRest.key, idx), disabled: disabled, selected: selected, value: value, onClick: handleClick, "data-test-automation-id": menuItemRest['data-test-automation-id'] },
42
+ return (React.createElement(MenuItemComponent, { key: getKey(menuItemRest.key, idx), disabled: disabled, selected: selected, value: value, onClick: handleClick, "data-test-automation-id": menuItemRest['data-test-automation-id'] },
43
43
  icon ? React.createElement(RcListItemIcon, null, icon) : null,
44
44
  React.createElement(RcListItemText, { primary: label || value })));
45
45
  });
46
- }, [menuItems, onChange]);
46
+ }, [MenuItemComponent, menuItems, onChange]);
47
47
  return (React.createElement(React.Fragment, null,
48
48
  React.createElement(RcTab, __assign({}, rest, { ref: ref, onClick: handleTabClick, label: MoreIcon, value: DEFAULT_MORE_MENU_TAB_LABEL, "aria-haspopup": "true", "aria-controls": menuId })),
49
49
  React.createElement(RcMenu, __assign({ autoClose: true }, MenuPropsRest, { id: menuId, anchorEl: anchorEl, open: Boolean(anchorEl), variant: "menu", onClose: handleMenuClose }), MenuList)));
@@ -20,7 +20,7 @@ export var findChildrenByKey = function (childrenProp, key) {
20
20
  var _MoreMenuTabs = forwardRef(function (props, ref) {
21
21
  var orientation = props.orientation, childrenProp = props.children, valueProp = props.value, onChange = props.onChange, _a = props.MoreButtonProps, MoreButtonProps = _a === void 0 ? {} : _a, rest = __rest(props, ["orientation", "children", "value", "onChange", "MoreButtonProps"]);
22
22
  var onGroupInfoChange = MoreButtonProps.onGroupInfoChange, MoreButtonPropsRest = __rest(MoreButtonProps, ["onGroupInfoChange"]);
23
- var prevChildren = usePrevious(function () { return childrenProp; });
23
+ var prevChildrenProp = usePrevious(function () { return childrenProp; });
24
24
  var isVertical = orientation === 'vertical';
25
25
  var oriStr = isVertical ? 'height' : 'width';
26
26
  var innerRef = useRef(null);
@@ -52,42 +52,39 @@ var _MoreMenuTabs = forwardRef(function (props, ref) {
52
52
  throttleTabsSizeChange(obj);
53
53
  }, { mode: 'none' });
54
54
  var tabsSize = tabsSizeRef.current;
55
- // init all children elm
56
- if (tabRefsMapRef.current === undefined) {
57
- var getRefsMapAndSetDefaultTabChildren = function () {
58
- var tabRefs = new Map();
59
- var tabsTabDefaultChild = [];
60
- React.Children.forEach(childrenProp, function (child, index) {
61
- var _a = child.props, ref = _a.ref, value = _a.value;
62
- var innerRef = createRef();
63
- var tabRef = ref ? useForkRef(innerRef, ref) : innerRef;
64
- var childrenValue = value || index;
65
- var children = React.cloneElement(child, {
66
- ref: tabRef,
67
- value: childrenValue,
68
- });
69
- var keyString = typeof child.key === 'string' ? child.key : '';
70
- tabRefs.set(getKey(keyString, index), {
71
- ref: tabRef,
72
- size: null,
73
- index: index,
74
- value: childrenValue,
75
- });
76
- tabsTabDefaultChild.push(children);
55
+ // initial tabRefsMapRef and tabsTabChildRef
56
+ if (tabRefsMapRef.current === undefined ||
57
+ prevChildrenProp !== childrenProp) {
58
+ var tabRefs_1 = new Map();
59
+ var tabsTabDefaultChild_1 = [];
60
+ React.Children.forEach(childrenProp, function (child, index) {
61
+ var _a = child.props, ref = _a.ref, value = _a.value;
62
+ var innerRef = createRef();
63
+ var tabRef = ref ? useForkRef(innerRef, ref) : innerRef;
64
+ var childrenValue = value || index;
65
+ var children = React.cloneElement(child, {
66
+ ref: tabRef,
67
+ value: childrenValue,
77
68
  });
78
- return {
79
- tabRefs: tabRefs,
80
- tabsTabDefaultChild: tabsTabDefaultChild,
81
- };
82
- };
83
- var _d = getRefsMapAndSetDefaultTabChildren(), tabRefs = _d.tabRefs, tabsTabDefaultChild = _d.tabsTabDefaultChild;
84
- tabRefsMapRef.current = tabRefs;
85
- tabsTabChildRef.current = tabsTabDefaultChild;
69
+ var keyString = typeof child.key === 'string' ? child.key : '';
70
+ tabRefs_1.set(getKey(keyString, index), {
71
+ ref: tabRef,
72
+ size: null,
73
+ index: index,
74
+ value: childrenValue,
75
+ });
76
+ tabsTabDefaultChild_1.push(children);
77
+ });
78
+ tabRefsMapRef.current = tabRefs_1;
79
+ tabsTabChildRef.current = tabsTabDefaultChild_1;
86
80
  }
87
- // get all size when first render
81
+ // get real render size when render
88
82
  useEffect(function () {
83
+ if (childrenProp === prevChildrenProp) {
84
+ return;
85
+ }
89
86
  var tabRefsMap = tabRefsMapRef.current;
90
- if ((tabRefsMap === null || tabRefsMap === void 0 ? void 0 : tabRefsMap.size) !== undefined) {
87
+ if (tabRefsMap && tabRefsMap.size !== 0) {
91
88
  var allTabsSize_1 = __assign({}, DEFAULT_SIZE);
92
89
  tabRefsMap.forEach(function (value, key) {
93
90
  var _a = getDomBoundingClientSize(value.ref.current), width = _a.width, height = _a.height;
@@ -108,8 +105,7 @@ var _MoreMenuTabs = forwardRef(function (props, ref) {
108
105
  var size = getDomBoundingClientSize(moreElm);
109
106
  moreTabSizeRef.current = size;
110
107
  }
111
- // eslint-disable-next-line react-hooks/exhaustive-deps
112
- }, []);
108
+ }, [childrenProp, prevChildrenProp]);
113
109
  useEffect(function () {
114
110
  var _a;
115
111
  var currSelectTabItem;
@@ -188,11 +184,11 @@ var _MoreMenuTabs = forwardRef(function (props, ref) {
188
184
  }
189
185
  };
190
186
  if (tabsSize.width !== 0 && tabsSize.height !== 0) {
191
- // computed: 1.resize 2. valueProp 3.moreMenuClick
187
+ // computed: 1.resize 2. valueProp 3.moreMenuClick 4.children change
192
188
  // not computed: visible tab change
193
189
  if (((_a = groupingRef.current) === null || _a === void 0 ? void 0 : _a.tabs.includes((currSelectTabItem === null || currSelectTabItem === void 0 ? void 0 : currSelectTabItem[0]) || '')) &&
194
190
  !hasResizeRef.current &&
195
- prevChildren === childrenProp) {
191
+ prevChildrenProp === childrenProp) {
196
192
  return;
197
193
  }
198
194
  computeTabChild(tabsSize);
@@ -200,10 +196,10 @@ var _MoreMenuTabs = forwardRef(function (props, ref) {
200
196
  }
201
197
  }, [
202
198
  childrenProp,
199
+ prevChildrenProp,
203
200
  isVertical,
204
201
  onGroupInfoChange,
205
202
  oriStr,
206
- prevChildren,
207
203
  tabsSize,
208
204
  valueProp,
209
205
  ]);
@@ -10,9 +10,11 @@ var _RcTabs = forwardRef(function (inProps, ref) {
10
10
  var classesProp = props.classes, childrenProp = props.children, variantProp = props.variant, size = props.size, MoreButtonProps = props.MoreButtonProps, rest = __rest(props, ["classes", "children", "variant", "size", "MoreButtonProps"]);
11
11
  var isMore = variantProp === 'moreMenu';
12
12
  var classes = useMemo(function () { return combineProps(RcTabsClasses, classesProp); }, [classesProp]);
13
- var children = React.Children.map(childrenProp, function (child) {
14
- return React.cloneElement(child, { size: size });
15
- });
13
+ var children = useMemo(function () {
14
+ return React.Children.map(childrenProp, function (child) {
15
+ return React.cloneElement(child, { size: size });
16
+ });
17
+ }, [childrenProp, size]);
16
18
  if (isMore) {
17
19
  return (React.createElement(MoreMenuTabs, __assign({}, rest, { ref: ref, classes: classes, size: size, MoreButtonProps: MoreButtonProps }), children));
18
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ringcentral/juno",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "author": "RingCentral",
5
5
  "license": "MIT",
6
6
  "bugs": {
@@ -45,12 +45,12 @@
45
45
  },
46
46
  "default": "./es6/index.js"
47
47
  },
48
- "./": {
48
+ "./*": {
49
49
  "node": {
50
- "module": "./es6/",
51
- "require": "./"
50
+ "module": "./es6/*",
51
+ "require": "./*"
52
52
  },
53
- "default": "./es6/"
53
+ "default": "./es6/*"
54
54
  }
55
55
  }
56
56
  }