@ringcentral/juno 1.11.2 → 1.11.3-beta.5620-d9154e6b
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/README.md +0 -10
- package/components/Dialog/Dialog.d.ts +17 -4
- package/components/Dialog/Dialog.js +21 -8
- package/components/Dialog/DialogActions/DialogActions.d.ts +15 -5
- package/components/Dialog/DialogActions/DialogActions.js +13 -7
- package/components/Dialog/DialogActions/styles/DialogActionsStyle.js +20 -8
- package/components/Dialog/DialogActions/utils/DialogActionsUtils.d.ts +2 -2
- package/components/Dialog/DialogActions/utils/DialogActionsUtils.js +2 -5
- package/components/Dialog/DialogContent/DialogContent.d.ts +4 -4
- package/components/Dialog/DialogContent/DialogContent.js +5 -6
- package/components/Dialog/DialogContent/styles/DialogContentStyle.js +2 -4
- package/components/Dialog/DialogContent/utils/DialogContentUtils.d.ts +1 -2
- package/components/Dialog/DialogContent/utils/DialogContentUtils.js +6 -6
- package/components/Dialog/DialogContentText/DialogContentText.d.ts +4 -3
- package/components/Dialog/DialogContentText/DialogContentText.js +9 -8
- package/components/Dialog/DialogContentText/styles/DialogContentTextStyle.js +4 -2
- package/components/Dialog/DialogTitle/DialogTitle.d.ts +4 -4
- package/components/Dialog/DialogTitle/DialogTitle.js +6 -7
- package/components/Dialog/DialogTitle/styles/DialogTitleStyle.js +4 -5
- package/components/Dialog/DialogTitle/utils/DialogTitleUtils.d.ts +4 -2
- package/components/Dialog/DialogTitle/utils/DialogTitleUtils.js +6 -5
- package/components/Dialog/utils/DialogContext.d.ts +15 -0
- package/components/Dialog/utils/DialogContext.js +33 -0
- package/components/Dialog/utils/index.d.ts +1 -0
- package/components/Dialog/utils/index.js +1 -0
- package/components/Downshift/Downshift.d.ts +23 -2
- package/components/Downshift/Downshift.js +11 -8
- package/components/Downshift/SuggestionList/SuggestionList.d.ts +6 -4
- package/components/Downshift/SuggestionList/SuggestionList.js +17 -10
- package/components/Downshift/SuggestionList/utils/SuggestionListUtils.d.ts +1 -1
- package/components/Downshift/SuggestionList/utils/SuggestionListUtils.js +1 -1
- package/components/Downshift/utils/useDownshift.d.ts +3 -2
- package/components/Downshift/utils/useDownshift.js +7 -3
- package/components/Downshift/utils/useDownshiftGroup.d.ts +6 -4
- package/components/Downshift/utils/useDownshiftGroup.js +31 -9
- package/components/Forms/Picker/DatePicker/Calendar.js +5 -4
- package/components/Forms/Picker/DatePicker/DatePickerHeader.js +1 -1
- package/components/Forms/Picker/DatePicker/styles/StyledDatePickerHeader.d.ts +1 -1
- package/components/Forms/Picker/DatePicker/styles/StyledDatePickerHeader.js +1 -1
- package/components/Forms/Switch/styles/SwitchStyle.js +1 -1
- package/components/Icon/assets/icon-add-reactions.svg +5 -1
- package/components/Icon/assets/icon-connect.svg +5 -0
- package/components/Icon/assets/icon-customize-tabs.svg +5 -0
- package/components/Icon/icon-symbol.d.ts +1 -1
- package/components/Icon/icon-symbol.js +1 -1
- package/components/List/ListItem/ListItem.js +0 -1
- package/components/List/ListItem/styles/ListItemStyle.js +1 -1
- package/components/PopupBox/PopupBox.d.ts +2 -2
- package/components/PopupBox/PopupBox.js +8 -10
- package/components/PortalHost/Connectable/Connectable.d.ts +11 -0
- package/components/PortalHost/Connectable/Connectable.js +50 -0
- package/components/PortalHost/Connectable/ThrottleScheduler.d.ts +8 -0
- package/components/PortalHost/Connectable/ThrottleScheduler.js +27 -0
- package/components/PortalHost/Connectable/index.d.ts +3 -0
- package/components/PortalHost/Connectable/index.js +8 -0
- package/components/PortalHost/Connectable/types.d.ts +7 -0
- package/components/PortalHost/Connectable/types.js +3 -0
- package/components/PortalHost/PortalHost.d.ts +7 -0
- package/components/PortalHost/PortalHost.js +44 -0
- package/components/PortalHost/PortalManager/PortalManager.d.ts +65 -0
- package/components/PortalHost/PortalManager/PortalManager.js +274 -0
- package/components/PortalHost/PortalManager/PortalStore.d.ts +20 -0
- package/components/PortalHost/PortalManager/PortalStore.js +134 -0
- package/components/PortalHost/PortalManager/index.d.ts +4 -0
- package/components/PortalHost/PortalManager/index.js +9 -0
- package/components/PortalHost/PortalManager/types.d.ts +86 -0
- package/components/PortalHost/PortalManager/types.js +3 -0
- package/components/PortalHost/PortalManager/utils.d.ts +8 -0
- package/components/PortalHost/PortalManager/utils.js +19 -0
- package/components/PortalHost/PortalRenderer.d.ts +10 -0
- package/components/PortalHost/PortalRenderer.js +43 -0
- package/components/PortalHost/context/PortalIDContext.d.ts +5 -0
- package/components/PortalHost/context/PortalIDContext.js +5 -0
- package/components/PortalHost/context/PortalManagerContext.d.ts +6 -0
- package/components/PortalHost/context/PortalManagerContext.js +5 -0
- package/components/PortalHost/context/index.d.ts +2 -0
- package/components/PortalHost/context/index.js +7 -0
- package/components/PortalHost/index.d.ts +4 -0
- package/components/PortalHost/index.js +9 -0
- package/components/PortalHost/utils/index.d.ts +2 -0
- package/components/PortalHost/utils/index.js +7 -0
- package/components/PortalHost/utils/usePortalManagerWithID.d.ts +8 -0
- package/components/PortalHost/utils/usePortalManagerWithID.js +12 -0
- package/components/PortalHost/utils/useUnmountPortalHandler.d.ts +5 -0
- package/components/PortalHost/utils/useUnmountPortalHandler.js +16 -0
- package/components/Snackbar/Snackbar.js +4 -2
- package/components/Virtuoso/utils/useHighlightScroll.d.ts +2 -1
- package/components/Virtuoso/utils/useHighlightScroll.js +4 -2
- package/components/index.d.ts +2 -1
- package/components/index.js +2 -1
- package/es6/components/Dialog/Dialog.js +22 -10
- package/es6/components/Dialog/DialogActions/DialogActions.js +11 -5
- package/es6/components/Dialog/DialogActions/styles/DialogActionsStyle.js +19 -7
- package/es6/components/Dialog/DialogActions/utils/DialogActionsUtils.js +2 -5
- package/es6/components/Dialog/DialogContent/DialogContent.js +3 -4
- package/es6/components/Dialog/DialogContent/styles/DialogContentStyle.js +3 -5
- package/es6/components/Dialog/DialogContent/utils/DialogContentUtils.js +6 -6
- package/es6/components/Dialog/DialogContentText/DialogContentText.js +7 -6
- package/es6/components/Dialog/DialogContentText/styles/DialogContentTextStyle.js +4 -2
- package/es6/components/Dialog/DialogTitle/DialogTitle.js +5 -6
- package/es6/components/Dialog/DialogTitle/styles/DialogTitleStyle.js +4 -5
- package/es6/components/Dialog/DialogTitle/utils/DialogTitleUtils.js +6 -5
- package/es6/components/Dialog/utils/DialogContext.js +31 -0
- package/es6/components/Dialog/utils/index.js +1 -0
- package/es6/components/Downshift/Downshift.js +11 -8
- package/es6/components/Downshift/SuggestionList/SuggestionList.js +17 -10
- package/es6/components/Downshift/SuggestionList/utils/SuggestionListUtils.js +1 -1
- package/es6/components/Downshift/utils/useDownshift.js +7 -3
- package/es6/components/Downshift/utils/useDownshiftGroup.js +33 -11
- package/es6/components/Forms/Picker/DatePicker/Calendar.js +6 -5
- package/es6/components/Forms/Picker/DatePicker/DatePickerHeader.js +1 -1
- package/es6/components/Forms/Picker/DatePicker/styles/StyledDatePickerHeader.js +2 -2
- package/es6/components/Forms/Switch/styles/SwitchStyle.js +1 -1
- package/es6/components/Icon/assets/icon-add-reactions.svg +5 -1
- package/es6/components/Icon/assets/icon-connect.svg +5 -0
- package/es6/components/Icon/assets/icon-customize-tabs.svg +5 -0
- package/es6/components/Icon/icon-symbol.js +1 -1
- package/es6/components/List/ListItem/ListItem.js +0 -1
- package/es6/components/List/ListItem/styles/ListItemStyle.js +1 -1
- package/es6/components/PopupBox/PopupBox.js +8 -10
- package/es6/components/PortalHost/Connectable/Connectable.js +48 -0
- package/es6/components/PortalHost/Connectable/ThrottleScheduler.js +25 -0
- package/es6/components/PortalHost/Connectable/index.js +3 -0
- package/es6/components/PortalHost/Connectable/types.js +1 -0
- package/es6/components/PortalHost/PortalHost.js +35 -0
- package/es6/components/PortalHost/PortalManager/PortalManager.js +272 -0
- package/es6/components/PortalHost/PortalManager/PortalStore.js +132 -0
- package/es6/components/PortalHost/PortalManager/index.js +4 -0
- package/es6/components/PortalHost/PortalManager/types.js +1 -0
- package/es6/components/PortalHost/PortalManager/utils.js +17 -0
- package/es6/components/PortalHost/PortalRenderer.js +34 -0
- package/es6/components/PortalHost/context/PortalIDContext.js +3 -0
- package/es6/components/PortalHost/context/PortalManagerContext.js +3 -0
- package/es6/components/PortalHost/context/index.js +2 -0
- package/es6/components/PortalHost/index.js +4 -0
- package/es6/components/PortalHost/utils/index.js +2 -0
- package/es6/components/PortalHost/utils/usePortalManagerWithID.js +10 -0
- package/es6/components/PortalHost/utils/useUnmountPortalHandler.js +14 -0
- package/es6/components/Snackbar/Snackbar.js +4 -2
- package/es6/components/Virtuoso/utils/useHighlightScroll.js +4 -2
- package/es6/components/index.js +2 -1
- package/es6/icon/AddReactions.js +3 -1
- package/es6/icon/Connect.js +17 -0
- package/es6/icon/CustomizeTabs.js +17 -0
- package/es6/icon/index.js +2 -1
- package/es6/icons/icon-add-reactions.svg +5 -1
- package/es6/icons/icon-connect.svg +5 -0
- package/es6/icons/icon-customize-tabs.svg +5 -0
- package/icon/AddReactions.js +3 -1
- package/icon/{MenuFax.d.ts → Connect.d.ts} +2 -2
- package/icon/{MenuFax.js → Connect.js} +5 -5
- package/icon/CustomizeTabs.d.ts +3 -0
- package/icon/CustomizeTabs.js +26 -0
- package/icon/index.d.ts +2 -1
- package/icon/index.js +4 -2
- package/icons/icon-add-reactions.svg +5 -1
- package/icons/icon-connect.svg +5 -0
- package/icons/icon-customize-tabs.svg +5 -0
- package/package.json +1 -1
- package/components/Icon/assets/icon-menu-fax.svg +0 -5
- package/es6/components/Icon/assets/icon-menu-fax.svg +0 -5
- package/es6/icon/MenuFax.js +0 -17
- package/es6/icons/icon-menu-fax.svg +0 -5
- package/icons/icon-menu-fax.svg +0 -5
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var foundation_1 = require("../../../foundation");
|
|
4
|
+
var PortalManager_1 = require("../PortalManager");
|
|
5
|
+
var usePortalManagerWithID_1 = require("./usePortalManagerWithID");
|
|
6
|
+
exports.useUnmountPortalHandler = function (handler) {
|
|
7
|
+
var managerWithID = usePortalManagerWithID_1.usePortalManagerWithID();
|
|
8
|
+
var handleExited = foundation_1.useEventCallback(function (node) {
|
|
9
|
+
handler === null || handler === void 0 ? void 0 : handler(node);
|
|
10
|
+
if (managerWithID) {
|
|
11
|
+
var manager = managerWithID.manager, id = managerWithID.id;
|
|
12
|
+
manager[PortalManager_1.UnmountSymbol](id);
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
return handleExited;
|
|
16
|
+
};
|
|
@@ -40,14 +40,16 @@ var Slide_1 = __importDefault(require("@material-ui/core/Slide"));
|
|
|
40
40
|
var Snackbar_1 = __importDefault(require("@material-ui/core/Snackbar"));
|
|
41
41
|
var react_1 = __importStar(require("react"));
|
|
42
42
|
var foundation_1 = require("../../foundation");
|
|
43
|
+
var PortalHost_1 = require("../PortalHost");
|
|
43
44
|
var SnackbarContent_1 = require("./SnackbarContent");
|
|
44
45
|
var styles_1 = require("./styles");
|
|
45
46
|
var utils_1 = require("./utils");
|
|
46
47
|
var _RcSnackbar = react_1.forwardRef(function (inProps, ref) {
|
|
47
48
|
var props = foundation_1.useThemeProps({ props: inProps, name: 'RcSnackbar' });
|
|
48
|
-
var classesProp = props.classes, size = props.size, type = props.type, message = props.message, action = props.action, ContentProps = props.ContentProps, children = props.children, rest = __rest(props, ["classes", "size", "type", "message", "action", "ContentProps", "children"]);
|
|
49
|
+
var classesProp = props.classes, size = props.size, type = props.type, message = props.message, action = props.action, ContentProps = props.ContentProps, children = props.children, onExitedProp = props.onExited, rest = __rest(props, ["classes", "size", "type", "message", "action", "ContentProps", "children", "onExited"]);
|
|
49
50
|
var classes = react_1.useMemo(function () { return foundation_1.combineClasses(utils_1.RcSnackbarClasses, classesProp); }, [classesProp]);
|
|
50
|
-
|
|
51
|
+
var onExited = PortalHost_1.useUnmountPortalHandler(onExitedProp);
|
|
52
|
+
return (react_1.default.createElement(Snackbar_1.default, __assign({ ref: ref, classes: classes }, rest, { onExited: onExited }), children || (react_1.default.createElement(SnackbarContent_1.RcSnackbarContent, __assign({ size: size, type: type, message: message, action: action }, ContentProps)))));
|
|
51
53
|
});
|
|
52
54
|
var RcSnackbar = foundation_1.styled(_RcSnackbar)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), styles_1.SnackbarStyle);
|
|
53
55
|
exports.RcSnackbar = RcSnackbar;
|
|
@@ -18,8 +18,9 @@ export declare function useHighlightScroll({ containerHeighRef, scrollToIndex, }
|
|
|
18
18
|
* Scroll to target highlighted index
|
|
19
19
|
* @param prevHighlightedIndex previous highlightedIndex
|
|
20
20
|
* @param currHighlightedIndex current highlightedIndex
|
|
21
|
+
* @param topHighlightIndex top highlighIndex for check should scroll when init
|
|
21
22
|
*/
|
|
22
|
-
scrollToHighlightedIndex: (prevHighlightedIndex: number, currHighlightedIndex: number) => void;
|
|
23
|
+
scrollToHighlightedIndex: (prevHighlightedIndex: number, currHighlightedIndex: number, topHighlightIndex?: number) => void;
|
|
23
24
|
/**
|
|
24
25
|
* set to virtuoso `scrollerRef` prop, auto bind inner `scrollerRef`
|
|
25
26
|
*/
|
|
@@ -8,9 +8,10 @@ function useHighlightScroll(_a) {
|
|
|
8
8
|
var containerHeighRef = _a.containerHeighRef, scrollToIndex = _a.scrollToIndex;
|
|
9
9
|
var renderedItemsRef = react_1.useRef([]);
|
|
10
10
|
var scrollerRef = react_1.useRef();
|
|
11
|
-
var scrollToHighlightedIndex = function (prevHighlightedIndex, currHighlightedIndex) {
|
|
11
|
+
var scrollToHighlightedIndex = function (prevHighlightedIndex, currHighlightedIndex, topHighlightIndex) {
|
|
12
|
+
if (topHighlightIndex === void 0) { topHighlightIndex = 0; }
|
|
12
13
|
if (!scrollerRef.current) {
|
|
13
|
-
if (currHighlightedIndex !==
|
|
14
|
+
if (currHighlightedIndex !== topHighlightIndex) {
|
|
14
15
|
setTimeout(function () {
|
|
15
16
|
scrollToIndex({
|
|
16
17
|
index: currHighlightedIndex,
|
|
@@ -86,6 +87,7 @@ function useHighlightScroll(_a) {
|
|
|
86
87
|
* Scroll to target highlighted index
|
|
87
88
|
* @param prevHighlightedIndex previous highlightedIndex
|
|
88
89
|
* @param currHighlightedIndex current highlightedIndex
|
|
90
|
+
* @param topHighlightIndex top highlighIndex for check should scroll when init
|
|
89
91
|
*/
|
|
90
92
|
scrollToHighlightedIndex: scrollToHighlightedIndex,
|
|
91
93
|
/**
|
package/components/index.d.ts
CHANGED
|
@@ -33,6 +33,7 @@ export * from './Popover';
|
|
|
33
33
|
export * from './Popper';
|
|
34
34
|
export * from './PopupBox';
|
|
35
35
|
export * from './Portal';
|
|
36
|
+
export * from './PortalHost';
|
|
36
37
|
export * from './Presence';
|
|
37
38
|
export * from './Progress';
|
|
38
39
|
export * from './Rating';
|
|
@@ -49,6 +50,6 @@ export * from './Toolbar';
|
|
|
49
50
|
export * from './Tooltip';
|
|
50
51
|
export * from './Transitions';
|
|
51
52
|
export * from './Typography';
|
|
52
|
-
export * from './Virtuoso';
|
|
53
53
|
export * from './VirtualizedMenu';
|
|
54
|
+
export * from './Virtuoso';
|
|
54
55
|
export * from './VisuallyHidden';
|
package/components/index.js
CHANGED
|
@@ -38,6 +38,7 @@ __export(require("./Popover"));
|
|
|
38
38
|
__export(require("./Popper"));
|
|
39
39
|
__export(require("./PopupBox"));
|
|
40
40
|
__export(require("./Portal"));
|
|
41
|
+
__export(require("./PortalHost"));
|
|
41
42
|
__export(require("./Presence"));
|
|
42
43
|
__export(require("./Progress"));
|
|
43
44
|
__export(require("./Rating"));
|
|
@@ -54,6 +55,6 @@ __export(require("./Toolbar"));
|
|
|
54
55
|
__export(require("./Tooltip"));
|
|
55
56
|
__export(require("./Transitions"));
|
|
56
57
|
__export(require("./Typography"));
|
|
57
|
-
__export(require("./Virtuoso"));
|
|
58
58
|
__export(require("./VirtualizedMenu"));
|
|
59
|
+
__export(require("./Virtuoso"));
|
|
59
60
|
__export(require("./VisuallyHidden"));
|
|
@@ -26,15 +26,20 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
26
26
|
};
|
|
27
27
|
import MuiDialog from '@material-ui/core/Dialog';
|
|
28
28
|
import React, { forwardRef, useMemo } from 'react';
|
|
29
|
-
import { combineClasses, styled, useRcPortalWindowContext, useThemeProps, } from '../../foundation';
|
|
29
|
+
import { combineClasses, styled, useRcPortalWindowContext, useThemeProps, withDeprecatedCheck, } from '../../foundation';
|
|
30
|
+
import { useUnmountPortalHandler } from '../PortalHost';
|
|
30
31
|
import { DialogStyle } from './styles';
|
|
31
32
|
import { RcDialogClasses } from './utils';
|
|
33
|
+
import { RcDialogContext } from './utils/DialogContext';
|
|
32
34
|
var _RcDialog = forwardRef(function (inProps, ref) {
|
|
33
35
|
var props = useThemeProps({ props: inProps, name: 'RcDialog' });
|
|
34
|
-
var classesProp = props.classes,
|
|
36
|
+
var classesProp = props.classes, _a = props.size, size = _a === void 0 ? 'medium' : _a, maxWidthProp = props.maxWidth, _b = props.fullWidth, fullWidth = _b === void 0 ? true : _b, childrenSize = props.childrenSize, children = props.children, onExitedProp = props.onExited, rest = __rest(props, ["classes", "size", "maxWidth", "fullWidth", "childrenSize", "children", "onExited"]);
|
|
35
37
|
var classes = useMemo(function () { return combineClasses(RcDialogClasses, classesProp); }, [classesProp]);
|
|
36
38
|
var externalWindow = useRcPortalWindowContext().externalWindow;
|
|
39
|
+
var onExited = useUnmountPortalHandler(onExitedProp);
|
|
37
40
|
var maxWidth = useMemo(function () {
|
|
41
|
+
if (maxWidthProp)
|
|
42
|
+
return maxWidthProp;
|
|
38
43
|
switch (size) {
|
|
39
44
|
case 'fullScreen':
|
|
40
45
|
case 'xsmall':
|
|
@@ -47,14 +52,21 @@ var _RcDialog = forwardRef(function (inProps, ref) {
|
|
|
47
52
|
default:
|
|
48
53
|
return 'xs';
|
|
49
54
|
}
|
|
50
|
-
}, [size]);
|
|
51
|
-
|
|
55
|
+
}, [maxWidthProp, size]);
|
|
56
|
+
var contextValue = useMemo(function () { return ({ size: childrenSize }); }, [
|
|
57
|
+
childrenSize,
|
|
58
|
+
]);
|
|
59
|
+
return (React.createElement(MuiDialog, __assign({ ref: ref, fullWidth: fullWidth, container: externalWindow === null || externalWindow === void 0 ? void 0 : externalWindow.document.body, maxWidth: maxWidth, fullScreen: size === 'fullScreen' ? true : undefined, classes: classes }, rest, { onExited: onExited }),
|
|
60
|
+
React.createElement(RcDialogContext.Provider, { value: contextValue }, children)));
|
|
52
61
|
});
|
|
53
|
-
var RcDialog = styled(_RcDialog
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
62
|
+
var RcDialog = styled(withDeprecatedCheck(_RcDialog, [
|
|
63
|
+
{
|
|
64
|
+
prop: 'size',
|
|
65
|
+
time: '2021-11',
|
|
66
|
+
comment: "\n * please use `maxWidth` and `fullScreen` directly\n *\n * - 'fullScreen' => false\n * - 'large' => `md`\n * - 'medium' => `sm`\n * - 'small' => `xs`\n * - 'xsmall' => no longer exist, should custom by yourself\n */",
|
|
67
|
+
},
|
|
68
|
+
], 'RcDialog'))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), DialogStyle);
|
|
69
|
+
RcDialog.defaultProps = {};
|
|
58
70
|
RcDialog.displayName = 'RcDialog';
|
|
59
|
-
export { RcDialog };
|
|
71
|
+
export { RcDialog, RcDialogContext };
|
|
60
72
|
var templateObject_1;
|
|
@@ -27,18 +27,24 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
27
27
|
import MuiDialogActions from '@material-ui/core/DialogActions';
|
|
28
28
|
import React, { forwardRef, useMemo } from 'react';
|
|
29
29
|
import { combineClasses, styled, useThemeProps, } from '../../../foundation';
|
|
30
|
+
import { useDialogDefaultProps } from '../utils';
|
|
30
31
|
import { DialogActionsStyle } from './styles';
|
|
31
32
|
import { RcDialogActionsClasses } from './utils';
|
|
32
33
|
var _RcDialogActions = forwardRef(function (inProps, ref) {
|
|
33
34
|
var props = useThemeProps({ props: inProps, name: 'RcDialogActions' });
|
|
34
|
-
var classesProp = props.classes, size = props.size, children = props.children, rest = __rest(props, ["classes", "size", "children"]);
|
|
35
|
+
var classesProp = props.classes, size = props.size, children = props.children, reverse = props.reverse, rest = __rest(props, ["classes", "size", "children", "reverse"]);
|
|
35
36
|
var classes = useMemo(function () { return combineClasses(RcDialogActionsClasses, classesProp); }, [classesProp]);
|
|
36
37
|
return (React.createElement(MuiDialogActions, __assign({}, rest, { ref: ref, classes: classes, disableSpacing: true }), children));
|
|
37
38
|
});
|
|
38
|
-
var RcDialogActions = styled(_RcDialogActions)(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
var RcDialogActions = styled(_RcDialogActions).attrs(function (props) {
|
|
40
|
+
var _a, _b;
|
|
41
|
+
var toProps = useDialogDefaultProps(props);
|
|
42
|
+
var direction = (_a = toProps.direction) !== null && _a !== void 0 ? _a : (toProps.size === 'small' ? 'vertical' : 'horizontal');
|
|
43
|
+
var reverse = (_b = toProps.reverse) !== null && _b !== void 0 ? _b : direction === 'vertical';
|
|
44
|
+
return __assign(__assign({}, toProps), { direction: direction,
|
|
45
|
+
reverse: reverse });
|
|
46
|
+
})(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), DialogActionsStyle);
|
|
47
|
+
RcDialogActions.defaultProps = {};
|
|
42
48
|
RcDialogActions.displayName = 'RcDialogActions';
|
|
43
49
|
export { RcDialogActions };
|
|
44
50
|
var templateObject_1;
|
|
@@ -23,15 +23,27 @@ var __spread = (this && this.__spread) || function () {
|
|
|
23
23
|
return ar;
|
|
24
24
|
};
|
|
25
25
|
import { css, spacing } from '../../../../foundation';
|
|
26
|
+
import { RcDialogContentClasses } from '../../DialogContent/utils';
|
|
26
27
|
import { RcDialogActionsSizes } from '../utils';
|
|
28
|
+
var itemSpace = spacing(2);
|
|
27
29
|
export var DialogActionsStyle = function (props) {
|
|
28
|
-
var size = props.size, direction = props.direction, disableSpacing = props.disableSpacing;
|
|
29
|
-
var args = RcDialogActionsSizes[size];
|
|
30
|
-
var paddingValue = args.length > 0 ? spacing.apply(void 0, __spread(args)) : spacing(2, 6, 6);
|
|
30
|
+
var size = props.size, reverse = props.reverse, direction = props.direction, disableSpacing = props.disableSpacing;
|
|
31
31
|
var isVertical = direction === 'vertical';
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
var columnDirection = reverse ? 'column-reverse' : 'column';
|
|
33
|
+
var rowDirection = reverse ? 'row-reverse' : 'row';
|
|
34
|
+
return css(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n padding: ", ";\n flex-direction: ", ";\n\n ", "\n\n ", ";\n "], ["\n padding: ", ";\n flex-direction: ", ";\n\n ",
|
|
35
|
+
"\n\n ",
|
|
36
|
+
";\n "])), spacing.apply(void 0, __spread(RcDialogActionsSizes[size])), isVertical ? columnDirection : rowDirection, size === 'medium' &&
|
|
37
|
+
/**
|
|
38
|
+
* use && because first is component selector, second one is dynamic selector with different props
|
|
39
|
+
* @see https://styled-components.com/docs/faqs#why-do-my-dom-nodes-have-two-classes
|
|
40
|
+
*/
|
|
41
|
+
css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .", " + && {\n padding-top: ", ";\n }\n "], ["\n .", " + && {\n padding-top: ", ";\n }\n "])), RcDialogContentClasses.dividers, spacing(5)), !disableSpacing && css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n > * + * {\n ", ";\n }\n "], ["\n > * + * {\n ",
|
|
34
42
|
";\n }\n "])), isVertical
|
|
35
|
-
? css(
|
|
43
|
+
? css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n ", "\n "], ["\n ",
|
|
44
|
+
"\n "])), reverse
|
|
45
|
+
? css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n margin-bottom: ", ";\n "], ["\n margin-bottom: ", ";\n "])), itemSpace) : css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n margin-top: ", ";\n "], ["\n margin-top: ", ";\n "])), itemSpace)) : css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n ", "\n "], ["\n ",
|
|
46
|
+
"\n "])), reverse
|
|
47
|
+
? css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n margin-right: ", ";\n "], ["\n margin-right: ", ";\n "])), itemSpace) : css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n margin-left: ", ";\n "], ["\n margin-left: ", ";\n "])), itemSpace))));
|
|
36
48
|
};
|
|
37
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
49
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { RcClasses } from '../../../../foundation';
|
|
2
2
|
export var RcDialogActionsClasses = RcClasses([], 'RcDialogActions');
|
|
3
3
|
export var RcDialogActionsSizes = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
medium: [],
|
|
7
|
-
large: [],
|
|
8
|
-
fullScreen: [],
|
|
4
|
+
small: [4],
|
|
5
|
+
medium: [3, 6, 6],
|
|
9
6
|
};
|
|
@@ -27,6 +27,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
27
27
|
import MuiDialogContent from '@material-ui/core/DialogContent';
|
|
28
28
|
import React, { forwardRef, useMemo } from 'react';
|
|
29
29
|
import { combineClasses, styled, useThemeProps, } from '../../../foundation';
|
|
30
|
+
import { useDialogDefaultProps } from '../utils';
|
|
30
31
|
import { DialogContentStyle } from './styles';
|
|
31
32
|
import { RcDialogContentClasses } from './utils';
|
|
32
33
|
var _RcDialogContent = forwardRef(function (inProps, ref) {
|
|
@@ -35,10 +36,8 @@ var _RcDialogContent = forwardRef(function (inProps, ref) {
|
|
|
35
36
|
var classes = useMemo(function () { return combineClasses(RcDialogContentClasses, classesProp); }, [classesProp]);
|
|
36
37
|
return (React.createElement(MuiDialogContent, __assign({}, rest, { ref: ref, classes: classes }), children));
|
|
37
38
|
});
|
|
38
|
-
var RcDialogContent = styled(_RcDialogContent)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), DialogContentStyle);
|
|
39
|
-
RcDialogContent.defaultProps = {
|
|
40
|
-
size: 'medium',
|
|
41
|
-
};
|
|
39
|
+
var RcDialogContent = styled(_RcDialogContent).attrs(useDialogDefaultProps)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), DialogContentStyle);
|
|
40
|
+
RcDialogContent.defaultProps = {};
|
|
42
41
|
RcDialogContent.displayName = 'RcDialogContent';
|
|
43
42
|
export { RcDialogContent };
|
|
44
43
|
var templateObject_1;
|
|
@@ -23,11 +23,9 @@ var __spread = (this && this.__spread) || function () {
|
|
|
23
23
|
return ar;
|
|
24
24
|
};
|
|
25
25
|
import { css, palette2, spacing } from '../../../../foundation';
|
|
26
|
-
import { RcDialogContentClasses,
|
|
26
|
+
import { RcDialogContentClasses, getRcDialogContentSpacings } from '../utils';
|
|
27
27
|
export var DialogContentStyle = function (props) {
|
|
28
|
-
var size = props.size;
|
|
29
|
-
|
|
30
|
-
var paddingValue = args.length > 0 ? spacing.apply(void 0, __spread(args)) : spacing(0, 6, 3);
|
|
31
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: ", ";\n\n &.", " {\n border-color: ", ";\n }\n "], ["\n padding: ", ";\n\n &.", " {\n border-color: ", ";\n }\n "])), paddingValue, RcDialogContentClasses.dividers, palette2('neutral', 'l02'));
|
|
28
|
+
var size = props.size, dividers = props.dividers;
|
|
29
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: ", ";\n\n &.", " {\n border-color: ", ";\n }\n "], ["\n padding: ", ";\n\n &.", " {\n border-color: ", ";\n }\n "])), spacing.apply(void 0, __spread(getRcDialogContentSpacings(dividers)[size])), RcDialogContentClasses.dividers, palette2('neutral', 'l02'));
|
|
32
30
|
};
|
|
33
31
|
var templateObject_1;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { RcClasses } from '../../../../foundation';
|
|
2
2
|
export var RcDialogContentClasses = RcClasses(['dividers'], 'RcDialogContent');
|
|
3
|
-
export var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
export var getRcDialogContentSpacings = function (isDividers) {
|
|
4
|
+
var spacings = {
|
|
5
|
+
small: isDividers ? [3, 4] : [0, 4, 1],
|
|
6
|
+
medium: isDividers ? [3, 6] : [0, 6, 3],
|
|
7
|
+
};
|
|
8
|
+
return spacings;
|
|
9
9
|
};
|
|
@@ -29,6 +29,7 @@ import React, { forwardRef, useMemo } from 'react';
|
|
|
29
29
|
import { combineClasses, styled, useThemeProps, } from '../../../foundation';
|
|
30
30
|
import { TypographyStyle } from '../../Typography/styles';
|
|
31
31
|
import { MuiDefaultColor, RcCustomTypographyVariant, } from '../../Typography/utils';
|
|
32
|
+
import { useDialogDefaultProps } from '../utils';
|
|
32
33
|
import { DialogContentTextStyle } from './styles';
|
|
33
34
|
import { RcDialogContentTextClasses } from './utils';
|
|
34
35
|
var _RcDialogContentText = forwardRef(function (inProps, ref) {
|
|
@@ -36,7 +37,7 @@ var _RcDialogContentText = forwardRef(function (inProps, ref) {
|
|
|
36
37
|
props: inProps,
|
|
37
38
|
name: 'RcDialogContentText',
|
|
38
39
|
});
|
|
39
|
-
var colorProp = props.color, componentProp = props.component, classesProp = props.classes, variant = props.variant, weight = props.weight, children = props.children, rest = __rest(props, ["color", "component", "classes", "variant", "weight", "children"]);
|
|
40
|
+
var colorProp = props.color, componentProp = props.component, classesProp = props.classes, variant = props.variant, weight = props.weight, size = props.size, children = props.children, rest = __rest(props, ["color", "component", "classes", "variant", "weight", "size", "children"]);
|
|
40
41
|
var component = componentProp || RcCustomTypographyVariant[variant];
|
|
41
42
|
var classes = useMemo(function () { return combineClasses(RcDialogContentTextClasses, classesProp); }, [classesProp]);
|
|
42
43
|
var color = useMemo(function () {
|
|
@@ -46,11 +47,11 @@ var _RcDialogContentText = forwardRef(function (inProps, ref) {
|
|
|
46
47
|
// * for use html view variant
|
|
47
48
|
, __assign({ "data-variant": variant, "data-color": color, color: color, ref: ref, classes: classes, component: component }, rest), children));
|
|
48
49
|
});
|
|
49
|
-
var RcDialogContentText = styled(_RcDialogContentText)(
|
|
50
|
-
|
|
51
|
-
color: 'neutral.f04',
|
|
52
|
-
|
|
53
|
-
};
|
|
50
|
+
var RcDialogContentText = styled(_RcDialogContentText).attrs(function (props) {
|
|
51
|
+
var toProps = useDialogDefaultProps(props);
|
|
52
|
+
return __assign({ variant: toProps.size === 'small' ? 'caption1' : 'body1', color: 'neutral.f04' }, toProps);
|
|
53
|
+
})(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n ", "\n"], ["\n ", "\n ", "\n"])), DialogContentTextStyle, TypographyStyle);
|
|
54
|
+
RcDialogContentText.defaultProps = {};
|
|
54
55
|
RcDialogContentText.displayName = 'RcDialogContentText';
|
|
55
56
|
export { RcDialogContentText };
|
|
56
57
|
var templateObject_1;
|
|
@@ -3,7 +3,9 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
3
3
|
return cooked;
|
|
4
4
|
};
|
|
5
5
|
import { css } from '../../../../foundation';
|
|
6
|
-
export var DialogContentTextStyle = function () {
|
|
7
|
-
|
|
6
|
+
export var DialogContentTextStyle = function (_a) {
|
|
7
|
+
var gutterBottom = _a.gutterBottom;
|
|
8
|
+
// that is mui but, that not work with gutterBottom set
|
|
9
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin-bottom: ", ";\n "], ["\n margin-bottom: ", ";\n "])), gutterBottom === false && 0);
|
|
8
10
|
};
|
|
9
11
|
var templateObject_1;
|
|
@@ -28,18 +28,17 @@ import MuiDialogTitle from '@material-ui/core/DialogTitle';
|
|
|
28
28
|
import React, { forwardRef, useMemo } from 'react';
|
|
29
29
|
import { combineClasses, styled, useThemeProps, } from '../../../foundation';
|
|
30
30
|
import { RcTypography } from '../../Typography';
|
|
31
|
+
import { useDialogDefaultProps } from '../utils';
|
|
31
32
|
import { DialogTitleStyle } from './styles';
|
|
32
|
-
import { RcDialogTitleClasses } from './utils';
|
|
33
|
+
import { RcDialogTitleClasses, RcDialogTitleTypographyVariant } from './utils';
|
|
33
34
|
var _RcDialogTitle = forwardRef(function (inProps, ref) {
|
|
34
35
|
var props = useThemeProps({ props: inProps, name: 'RcDialogTitle' });
|
|
35
36
|
var classesProp = props.classes, display = props.display, space = props.space, children = props.children, disableTypography = props.disableTypography, size = props.size, rest = __rest(props, ["classes", "display", "space", "children", "disableTypography", "size"]);
|
|
36
37
|
var classes = useMemo(function () { return combineClasses(RcDialogTitleClasses, classesProp); }, [classesProp]);
|
|
37
|
-
return (React.createElement(MuiDialogTitle, __assign({}, rest, { disableTypography: true, ref: ref, classes: classes }), disableTypography ? (children) : (React.createElement(RcTypography, { variant:
|
|
38
|
+
return (React.createElement(MuiDialogTitle, __assign({}, rest, { disableTypography: true, ref: ref, classes: classes }), disableTypography ? (children) : (React.createElement(RcTypography, { variant: RcDialogTitleTypographyVariant[size], component: "h2" }, children))));
|
|
38
39
|
});
|
|
39
|
-
var RcDialogTitle = styled(_RcDialogTitle)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), DialogTitleStyle);
|
|
40
|
-
RcDialogTitle.defaultProps = {
|
|
41
|
-
size: 'medium',
|
|
42
|
-
};
|
|
40
|
+
var RcDialogTitle = styled(_RcDialogTitle).attrs(useDialogDefaultProps)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), DialogTitleStyle);
|
|
41
|
+
RcDialogTitle.defaultProps = {};
|
|
43
42
|
RcDialogTitle.displayName = 'RcDialogTitle';
|
|
44
43
|
export { RcDialogTitle };
|
|
45
44
|
var templateObject_1;
|
|
@@ -26,12 +26,11 @@ import { css, palette2, spacing } from '../../../../foundation';
|
|
|
26
26
|
import { RcDialogTitleSpacings } from '../utils';
|
|
27
27
|
export var DialogTitleStyle = function (props) {
|
|
28
28
|
var size = props.size, spaceProp = props.space, display = props.display;
|
|
29
|
-
var sizeSpacing = RcDialogTitleSpacings[size];
|
|
30
29
|
var paddingValue = spaceProp !== undefined
|
|
31
30
|
? spaceProp instanceof Array
|
|
32
|
-
?
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n color: ", ";\n\n padding: ", ";\n\n display: ", ";\n "], ["\n color: ", ";\n\n padding: ", ";\n\n display: ", ";\n "])), palette2('neutral', 'f06'), paddingValue, display);
|
|
31
|
+
? spaceProp
|
|
32
|
+
: [spaceProp]
|
|
33
|
+
: RcDialogTitleSpacings[size];
|
|
34
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n color: ", ";\n\n padding: ", ";\n\n display: ", ";\n "], ["\n color: ", ";\n\n padding: ", ";\n\n display: ", ";\n "])), palette2('neutral', 'f06'), spacing.apply(void 0, __spread(paddingValue)), display);
|
|
36
35
|
};
|
|
37
36
|
var templateObject_1;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { RcClasses } from '../../../../foundation';
|
|
2
2
|
export var RcDialogTitleClasses = RcClasses([], 'RcDialogTitle');
|
|
3
3
|
export var RcDialogTitleSpacings = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
small: [4],
|
|
5
|
+
medium: [4, 6],
|
|
6
|
+
};
|
|
7
|
+
export var RcDialogTitleTypographyVariant = {
|
|
8
|
+
small: 'subheading2',
|
|
9
|
+
medium: 'title2',
|
|
9
10
|
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import { createContext, useContext } from 'react';
|
|
24
|
+
export var RcDialogContext = createContext({});
|
|
25
|
+
export var useRcDialogContext = function () { return useContext(RcDialogContext); };
|
|
26
|
+
export var useDialogDefaultProps = function (_a) {
|
|
27
|
+
var theme = _a.theme, props = __rest(_a, ["theme"]);
|
|
28
|
+
var context = useRcDialogContext();
|
|
29
|
+
var _b = props.size, size = _b === void 0 ? context.size || 'medium' : _b;
|
|
30
|
+
return __assign(__assign({}, props), { size: size });
|
|
31
|
+
};
|
|
@@ -52,8 +52,8 @@ import { RcSuggestionList } from './SuggestionList';
|
|
|
52
52
|
import { DEFAULT_GET_OPTION_LABEL, DEFAULT_KEY_TO_CHIPS, DEFAULT_LIMIT_CHIPS, RcDownshiftDefaultFilterOptions, RcDownshiftInputClasses, useDownshift, useDownshiftError, } from './utils';
|
|
53
53
|
var _RcDownshift = memo(forwardRef(function (inProps, ref) {
|
|
54
54
|
var props = useThemeProps({ props: inProps, name: 'RcDownshift' });
|
|
55
|
-
var _a = props.itemToString, itemToString = _a === void 0 ? DEFAULT_GET_OPTION_LABEL : _a, _b = props.keyToChips, keyToChips = _b === void 0 ? DEFAULT_KEY_TO_CHIPS : _b, _c = props.limitOfFreeChips, limitOfFreeChips = _c === void 0 ? DEFAULT_LIMIT_CHIPS : _c, minRowHeight = props.minRowHeight, suggestionItems = props.suggestionItems, messageRef = props.messageRef, MenuItem = props.MenuItem, inputLabel = props.inputLabel, nameError = props.nameError, maxLength = props.maxLength, InputItem = props.InputItem, emailError = props.emailError, autoSwitchEmail = props.autoSwitchEmail, enableFreeChips = props.enableFreeChips, inputPlaceholder = props.inputPlaceholder, errorSelectedItems = props.errorSelectedItems, enableAutoTransform = props.enableAutoTransform, allowPlainHelperText = props.allowPlainHelperText, TextFieldProps = props.TextFieldProps, selectedItemsProp = props.selectedItems, automationId = props.automationId, screenReader = props.screenReader, onSelectChange = props.onSelectChange, variant = props.variant, getExpandIconProps = props.getExpandIconProps, groupBy = props.groupBy,
|
|
56
|
-
var
|
|
55
|
+
var _a = props.itemToString, itemToString = _a === void 0 ? DEFAULT_GET_OPTION_LABEL : _a, _b = props.keyToChips, keyToChips = _b === void 0 ? DEFAULT_KEY_TO_CHIPS : _b, _c = props.limitOfFreeChips, limitOfFreeChips = _c === void 0 ? DEFAULT_LIMIT_CHIPS : _c, minRowHeight = props.minRowHeight, suggestionItems = props.suggestionItems, messageRef = props.messageRef, MenuItem = props.MenuItem, inputLabel = props.inputLabel, nameError = props.nameError, maxLength = props.maxLength, InputItem = props.InputItem, emailError = props.emailError, autoSwitchEmail = props.autoSwitchEmail, enableFreeChips = props.enableFreeChips, inputPlaceholder = props.inputPlaceholder, errorSelectedItems = props.errorSelectedItems, enableAutoTransform = props.enableAutoTransform, allowPlainHelperText = props.allowPlainHelperText, TextFieldProps = props.TextFieldProps, selectedItemsProp = props.selectedItems, automationId = props.automationId, screenReader = props.screenReader, onSelectChange = props.onSelectChange, variant = props.variant, groupExpanded = props.groupExpanded, _d = props.groupVariant, groupVariant = _d === void 0 ? 'normal' : _d, getExpandIconProps = props.getExpandIconProps, groupBy = props.groupBy, _e = props.value, valueProp = _e === void 0 ? selectedItemsProp : _e, _f = props.autoHighlight, autoHighlight = _f === void 0 ? true : _f, _g = props.fullWidth, fullWidth = _g === void 0 ? true : _g, _h = props.clearBtn, clearBtn = _h === void 0 ? false : _h, _j = props.toggleButton, toggleButton = _j === void 0 ? false : _j, _k = props.multiple, multiple = _k === void 0 ? false : _k, clearButtonProps = props.clearButtonProps, onClear = props.onClear, ToggleButtonProps = props.ToggleButtonProps, inputValueProp = props.inputValue, onKeyDownProp = props.onKeyDown, helperTextProp = props.helperText, options = props.options, openOnFocus = props.openOnFocus, _l = props.getOptionLabel, getOptionLabel = _l === void 0 ? itemToString : _l, renderInput = props.renderInput, _m = props.label, label = _m === void 0 ? inputLabel : _m, _o = props.inputRef, inputRefProp = _o === void 0 ? messageRef : _o, _p = props.error, error = _p === void 0 ? nameError : _p, _q = props.placeholder, placeholder = _q === void 0 ? inputPlaceholder : _q, _r = props.freeSolo, freeSolo = _r === void 0 ? enableFreeChips : _r, _s = props.keyToTags, keyToTags = _s === void 0 ? keyToChips : _s, _t = props.maxFreeSolo, maxFreeSolo = _t === void 0 ? limitOfFreeChips : _t, SuggestionListProps = props.SuggestionListProps, _u = props.autoSelect, autoSelect = _u === void 0 ? enableAutoTransform : _u, PopperProps = props.PopperProps, initialIsOpen = props.initialIsOpen, disabled = props.disabled, requiredProp = props.required, _v = props.defaultIsOpen, defaultIsOpen = _v === void 0 ? openOnFocus : _v, _w = props.disableCloseOnSelect, disableCloseOnSelect = _w === void 0 ? defaultIsOpen : _w, _x = props.onChange, onChangeProp = _x === void 0 ? onSelectChange : _x, onInputChangeProp = props.onInputChange, onMaxFreeSolo = props.onMaxFreeSolo, FormHelperTextPropsProp = props.FormHelperTextProps, action = props.action, filterOptions = props.filterOptions, renderOption = props.renderOption, renderTags = props.renderTags, getOptionDisabled = props.getOptionDisabled, renderGroup = props.renderGroup, onGroupExpanded = props.onGroupExpanded, renderNoOptions = props.renderNoOptions, InputPropsProp = props.InputProps, debug = props.debug, disabledItemsHighlightable = props.disabledItemsHighlightable, openProp = props.open, onOpen = props.onOpen, onClose = props.onClose, rest = __rest(props, ["itemToString", "keyToChips", "limitOfFreeChips", "minRowHeight", "suggestionItems", "messageRef", "MenuItem", "inputLabel", "nameError", "maxLength", "InputItem", "emailError", "autoSwitchEmail", "enableFreeChips", "inputPlaceholder", "errorSelectedItems", "enableAutoTransform", "allowPlainHelperText", "TextFieldProps", "selectedItems", "automationId", "screenReader", "onSelectChange", "variant", "groupExpanded", "groupVariant", "getExpandIconProps", "groupBy", "value", "autoHighlight", "fullWidth", "clearBtn", "toggleButton", "multiple", "clearButtonProps", "onClear", "ToggleButtonProps", "inputValue", "onKeyDown", "helperText", "options", "openOnFocus", "getOptionLabel", "renderInput", "label", "inputRef", "error", "placeholder", "freeSolo", "keyToTags", "maxFreeSolo", "SuggestionListProps", "autoSelect", "PopperProps", "initialIsOpen", "disabled", "required", "defaultIsOpen", "disableCloseOnSelect", "onChange", "onInputChange", "onMaxFreeSolo", "FormHelperTextProps", "action", "filterOptions", "renderOption", "renderTags", "getOptionDisabled", "renderGroup", "onGroupExpanded", "renderNoOptions", "InputProps", "debug", "disabledItemsHighlightable", "open", "onOpen", "onClose"]);
|
|
56
|
+
var _y = __read(useState('bottom'), 2), position = _y[0], setPosition = _y[1];
|
|
57
57
|
var innerInputRef = useRef(null);
|
|
58
58
|
var textFieldRef = useRef(null);
|
|
59
59
|
var inputRef = useForkRef(inputRefProp, innerInputRef);
|
|
@@ -63,7 +63,7 @@ var _RcDownshift = memo(forwardRef(function (inProps, ref) {
|
|
|
63
63
|
var oneOfTagError = false;
|
|
64
64
|
useDownshiftError({ isNew: isNew, MenuItem: MenuItem, InputItem: InputItem });
|
|
65
65
|
var required = requiredProp || (TextFieldProps === null || TextFieldProps === void 0 ? void 0 : TextFieldProps.required);
|
|
66
|
-
var
|
|
66
|
+
var _z = useDownshift({
|
|
67
67
|
open: openProp,
|
|
68
68
|
variant: variant,
|
|
69
69
|
onOpen: onOpen,
|
|
@@ -74,6 +74,7 @@ var _RcDownshift = memo(forwardRef(function (inProps, ref) {
|
|
|
74
74
|
value: valueProp,
|
|
75
75
|
inputValue: inputValueProp,
|
|
76
76
|
getOptionDisabled: getOptionDisabled,
|
|
77
|
+
groupExpanded: groupVariant === 'normal' ? true : groupExpanded,
|
|
77
78
|
getExpandIconProps: getExpandIconProps,
|
|
78
79
|
options: suggestionItems || options,
|
|
79
80
|
freeSolo: freeSolo,
|
|
@@ -89,6 +90,7 @@ var _RcDownshift = memo(forwardRef(function (inProps, ref) {
|
|
|
89
90
|
openOnFocus: openOnFocus,
|
|
90
91
|
autoHighlight: autoHighlight,
|
|
91
92
|
groupBy: groupBy,
|
|
93
|
+
groupVariant: groupVariant,
|
|
92
94
|
onChange: onChangeProp,
|
|
93
95
|
onInputChange: onInputChangeProp,
|
|
94
96
|
getOptionLabel: getOptionLabel,
|
|
@@ -98,9 +100,9 @@ var _RcDownshift = memo(forwardRef(function (inProps, ref) {
|
|
|
98
100
|
onKeyDown: onKeyDownProp,
|
|
99
101
|
disabledItemsHighlightable: disabledItemsHighlightable,
|
|
100
102
|
onGroupExpanded: onGroupExpanded,
|
|
101
|
-
}), focusInput =
|
|
103
|
+
}), focusInput = _z.focusInput, optionItems = _z.optionItems, optionsGroupList = _z.optionsGroupList, selectedItems = _z.selectedItems, highlightedIndex = _z.highlightedIndex, getToggleButtonProps = _z.getToggleButtonProps, getTagProps = _z.getTagProps, getTagListBoxProps = _z.getTagListBoxProps, getMenuProps = _z.getMenuProps, getPopperProps = _z.getPopperProps, getInputProps = _z.getInputProps, getInputAriaProps = _z.getInputAriaProps, getLabelProps = _z.getLabelProps, getItemProps = _z.getItemProps, isOpen = _z.isOpen, inputValue = _z.inputValue, isTagsFocus = _z.isTagsFocus, activeIndex = _z.activeIndex, setActiveIndex = _z.setActiveIndex, setHighlightedIndex = _z.setHighlightedIndex, onInputChange = _z.onInputChange, keepHighlightedIndex = _z.keepHighlightedIndex, changeHighlightedIndexReason = _z.changeHighlightedIndexReason, closeMenu = _z.closeMenu, openMenu = _z.openMenu, reset = _z.reset, getClearButtonProps = _z.getClearButtonProps, noOptionItem = _z.noOptionItem, getNoOptionsProps = _z.getNoOptionsProps, isKeepHighlightedIndex = _z.isKeepHighlightedIndex;
|
|
102
104
|
var open = Boolean((isOpen || noOptionItem) && textFieldRef.current);
|
|
103
|
-
var
|
|
105
|
+
var _0 = getInputProps(), onBlur = _0.onBlur, InputProps = __rest(_0, ["onBlur"]);
|
|
104
106
|
var helperText = isNew
|
|
105
107
|
? helperTextProp
|
|
106
108
|
: nameError || allowPlainHelperText
|
|
@@ -161,17 +163,18 @@ var _RcDownshift = memo(forwardRef(function (inProps, ref) {
|
|
|
161
163
|
var endAdornment = (toggleButton || clearBtn) && (React.createElement(EndAdornment, null,
|
|
162
164
|
clearBtn && (React.createElement(ClearIconButton, __assign({}, getClearButtonProps(clearButtonProps)))),
|
|
163
165
|
toggleButton && (React.createElement(ArrowDownButton, __assign({ variant: "plain", "aria-hidden": true, color: error ? 'danger.f02' : 'neutral.f04', size: "large", symbol: isOpen ? ArrowUp : ArrowDown }, getToggleButtonProps(ToggleButtonProps))))));
|
|
164
|
-
var
|
|
166
|
+
var _1 = (function () {
|
|
165
167
|
var _a = InputPropsProp || {}, classes = _a.classes, restInputPropsProp = __rest(_a, ["classes"]);
|
|
166
168
|
var toClasses = combineClasses(classes, RcDownshiftInputClasses);
|
|
167
169
|
return {
|
|
168
170
|
containerClassName: toClasses.container,
|
|
169
171
|
TextFieldInputProps: combineProps(__assign(__assign(__assign({ classes: omit(toClasses, ['container']), endAdornment: endAdornment, inputComponent: RcDownshiftInput }, getTagListBoxProps()), InputProps), { onBlur: debug ? undefined : onBlur }), restInputPropsProp),
|
|
170
172
|
};
|
|
171
|
-
})(), containerClassName =
|
|
173
|
+
})(), containerClassName = _1.containerClassName, TextFieldInputProps = _1.TextFieldInputProps;
|
|
172
174
|
useImperativeHandle(action, function () { return ({
|
|
173
175
|
getActiveIndex: function () { return activeIndex; },
|
|
174
176
|
setActiveIndex: setActiveIndex,
|
|
177
|
+
getFilterResultItems: function () { return optionItems; },
|
|
175
178
|
getHighlightedIndex: function () { return highlightedIndex; },
|
|
176
179
|
setHighlightedIndex: function (index) {
|
|
177
180
|
return setHighlightedIndex(index, { reason: 'auto', reRender: true });
|
|
@@ -210,7 +213,7 @@ var _RcDownshift = memo(forwardRef(function (inProps, ref) {
|
|
|
210
213
|
}
|
|
211
214
|
},
|
|
212
215
|
} }, getPopperProps(PopperProps)),
|
|
213
|
-
isOpen && (React.createElement(RcSuggestionList, __assign({ highlightedIndex: highlightedIndex, options: optionItems,
|
|
216
|
+
isOpen && (React.createElement(RcSuggestionList, __assign({ highlightedIndex: highlightedIndex, optionsGroupList: optionsGroupList, options: optionItems, groupVariant: groupVariant, groupExpanded: groupExpanded, renderGroup: renderGroup, MenuItem: MenuItem, renderOption: renderOption, inputValue: inputValue, getItemProps: getItemProps, getMenuProps: getMenuProps, changeHighlightedIndexReason: changeHighlightedIndexReason, getOptionDisabled: getOptionDisabled, isKeepHighlightedIndex: isKeepHighlightedIndex, onUpdatePopper: handleUpdatePopper, maxContainerHeight: 180, getOptionLabel: getOptionLabel }, SuggestionListProps))),
|
|
214
217
|
isRenderNoOptions && (renderNoOptions === null || renderNoOptions === void 0 ? void 0 : renderNoOptions(getNoOptionsProps, noOptionItem)))));
|
|
215
218
|
}));
|
|
216
219
|
var RcDownshift = styled(withDeprecatedCheck(_RcDownshift, [
|