@ringcentral/juno 1.12.1 → 1.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/Dialog/Dialog.js +1 -1
- package/components/PopupBox/PopupBox.js +11 -3
- package/components/Snackbar/Snackbar.js +1 -1
- package/es6/components/Dialog/Dialog.js +2 -2
- package/es6/components/PopupBox/PopupBox.js +13 -5
- package/es6/components/Snackbar/Snackbar.js +2 -2
- package/package.json +1 -1
|
@@ -32,7 +32,7 @@ var _RcDialog = react_1.forwardRef(function (inProps, ref) {
|
|
|
32
32
|
}, [maxWidthProp, size]);
|
|
33
33
|
var contextValue = react_1.useMemo(function () { return ({ size: childrenSize }); }, [childrenSize]);
|
|
34
34
|
var onExited = PortalHost_1.useUnmountPortalHandler(TransitionPropsProp === null || TransitionPropsProp === void 0 ? void 0 : TransitionPropsProp.onExited);
|
|
35
|
-
var TransitionProps =
|
|
35
|
+
var TransitionProps = tslib_1.__assign(tslib_1.__assign({}, TransitionPropsProp), { onExited: onExited });
|
|
36
36
|
return (react_1.default.createElement(Dialog_1.default, tslib_1.__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, TransitionProps: TransitionProps }, rest),
|
|
37
37
|
react_1.default.createElement(DialogContext_1.RcDialogContext.Provider, { value: contextValue }, children)));
|
|
38
38
|
});
|
|
@@ -12,10 +12,18 @@ var _RcPopupBox = react_1.forwardRef(function (inProps, ref) {
|
|
|
12
12
|
// ok btn
|
|
13
13
|
confirmButtonText = props.confirmButtonText, confirmButtonProps = props.confirmButtonProps, onConfirm = props.onConfirm,
|
|
14
14
|
// cancel btn
|
|
15
|
-
cancelButtonText = props.cancelButtonText, cancelButtonProps = props.cancelButtonProps, onCancel = props.onCancel, TitleProps = props.TitleProps, ContentProps = props.ContentProps, ActionsProps = props.ActionsProps, children = props.children, onClose = props.onClose, open = props.open, rest = tslib_1.__rest(props, ["childrenSize", "title", "footer", "loadingOverlay", "loading", "confirmButtonText", "confirmButtonProps", "onConfirm", "cancelButtonText", "cancelButtonProps", "onCancel", "TitleProps", "ContentProps", "ActionsProps", "children", "onClose", "open"]);
|
|
15
|
+
cancelButtonText = props.cancelButtonText, cancelButtonProps = props.cancelButtonProps, onCancel = props.onCancel, TitleProps = props.TitleProps, ContentProps = props.ContentProps, disableBackdropClickProp = props.disableBackdropClick, ActionsProps = props.ActionsProps, children = props.children, onClose = props.onClose, open = props.open, rest = tslib_1.__rest(props, ["childrenSize", "title", "footer", "loadingOverlay", "loading", "confirmButtonText", "confirmButtonProps", "onConfirm", "cancelButtonText", "cancelButtonProps", "onCancel", "TitleProps", "ContentProps", "disableBackdropClick", "ActionsProps", "children", "onClose", "open"]);
|
|
16
16
|
var isXsmall = childrenSize === 'small';
|
|
17
|
-
var
|
|
18
|
-
|
|
17
|
+
var isLoading = loading || loadingOverlay;
|
|
18
|
+
var disableBackdropClick = disableBackdropClickProp !== null && disableBackdropClickProp !== void 0 ? disableBackdropClickProp : isLoading;
|
|
19
|
+
var handleClose = foundation_1.useEventCallback(function (e, reason) {
|
|
20
|
+
if (reason === 'backdropClick' && disableBackdropClick) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
onClose === null || onClose === void 0 ? void 0 : onClose(e, reason);
|
|
24
|
+
onCancel === null || onCancel === void 0 ? void 0 : onCancel(e, reason);
|
|
25
|
+
});
|
|
26
|
+
return (react_1.default.createElement(Dialog_1.RcDialog, tslib_1.__assign({ ref: ref, childrenSize: childrenSize, disableEscapeKeyDown: isLoading, onClose: handleClose, open: open }, rest),
|
|
19
27
|
react_1.default.createElement(Loading_1.RcLoading, { loading: loadingOverlay },
|
|
20
28
|
react_1.default.createElement(Dialog_1.RcDialogTitle, tslib_1.__assign({ "data-test-automation-id": 'DialogTitle' }, TitleProps), title),
|
|
21
29
|
react_1.default.createElement(Dialog_1.RcDialogContent, tslib_1.__assign({ "data-test-automation-id": 'DialogContent' }, ContentProps), typeof children === 'string' ? (react_1.default.createElement(Dialog_1.RcDialogContentText, null, children)) : (children)),
|
|
@@ -14,7 +14,7 @@ var _RcSnackbar = react_1.forwardRef(function (inProps, ref) {
|
|
|
14
14
|
var classesProp = props.classes, size = props.size, type = props.type, message = props.message, action = props.action, ContentProps = props.ContentProps, children = props.children, TransitionPropsProp = props.TransitionProps, rest = tslib_1.__rest(props, ["classes", "size", "type", "message", "action", "ContentProps", "children", "TransitionProps"]);
|
|
15
15
|
var classes = react_1.useMemo(function () { return foundation_1.combineClasses(utils_1.RcSnackbarClasses, classesProp); }, [classesProp]);
|
|
16
16
|
var onExited = PortalHost_1.useUnmountPortalHandler(TransitionPropsProp === null || TransitionPropsProp === void 0 ? void 0 : TransitionPropsProp.onExited);
|
|
17
|
-
var TransitionProps =
|
|
17
|
+
var TransitionProps = tslib_1.__assign(tslib_1.__assign({}, TransitionPropsProp), { onExited: onExited });
|
|
18
18
|
return (react_1.default.createElement(Snackbar_1.default, tslib_1.__assign({ ref: ref, classes: classes, TransitionProps: TransitionProps }, rest), children || (react_1.default.createElement(SnackbarContent_1.RcSnackbarContent, tslib_1.__assign({ size: size, type: type, message: message, action: action }, ContentProps)))));
|
|
19
19
|
});
|
|
20
20
|
var RcSnackbar = foundation_1.styled(_RcSnackbar)(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), styles_1.SnackbarStyle);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __assign, __makeTemplateObject, __rest } from "tslib";
|
|
2
2
|
import React, { forwardRef, useMemo } from 'react';
|
|
3
3
|
import MuiDialog from '@material-ui/core/Dialog';
|
|
4
|
-
import { combineClasses,
|
|
4
|
+
import { combineClasses, styled, useRcPortalWindowContext, useThemeProps, withDeprecatedCheck, } from '../../foundation';
|
|
5
5
|
import { useUnmountPortalHandler } from '../PortalHost';
|
|
6
6
|
import { DialogStyle } from './styles';
|
|
7
7
|
import { RcDialogClasses } from './utils';
|
|
@@ -29,7 +29,7 @@ var _RcDialog = forwardRef(function (inProps, ref) {
|
|
|
29
29
|
}, [maxWidthProp, size]);
|
|
30
30
|
var contextValue = useMemo(function () { return ({ size: childrenSize }); }, [childrenSize]);
|
|
31
31
|
var onExited = useUnmountPortalHandler(TransitionPropsProp === null || TransitionPropsProp === void 0 ? void 0 : TransitionPropsProp.onExited);
|
|
32
|
-
var TransitionProps =
|
|
32
|
+
var TransitionProps = __assign(__assign({}, TransitionPropsProp), { onExited: onExited });
|
|
33
33
|
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, TransitionProps: TransitionProps }, rest),
|
|
34
34
|
React.createElement(RcDialogContext.Provider, { value: contextValue }, children)));
|
|
35
35
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __assign, __makeTemplateObject, __rest } from "tslib";
|
|
2
|
-
import React, { forwardRef
|
|
3
|
-
import {
|
|
2
|
+
import React, { forwardRef } from 'react';
|
|
3
|
+
import { styled, useEventCallback, useThemeProps, } from '../../foundation';
|
|
4
4
|
import { RcButton } from '../Buttons/Button';
|
|
5
5
|
import { RcDialog, RcDialogActions, RcDialogContent, RcDialogContentText, RcDialogTitle, } from '../Dialog';
|
|
6
6
|
import { RcLoading } from '../Loading';
|
|
@@ -10,10 +10,18 @@ var _RcPopupBox = forwardRef(function (inProps, ref) {
|
|
|
10
10
|
// ok btn
|
|
11
11
|
confirmButtonText = props.confirmButtonText, confirmButtonProps = props.confirmButtonProps, onConfirm = props.onConfirm,
|
|
12
12
|
// cancel btn
|
|
13
|
-
cancelButtonText = props.cancelButtonText, cancelButtonProps = props.cancelButtonProps, onCancel = props.onCancel, TitleProps = props.TitleProps, ContentProps = props.ContentProps, ActionsProps = props.ActionsProps, children = props.children, onClose = props.onClose, open = props.open, rest = __rest(props, ["childrenSize", "title", "footer", "loadingOverlay", "loading", "confirmButtonText", "confirmButtonProps", "onConfirm", "cancelButtonText", "cancelButtonProps", "onCancel", "TitleProps", "ContentProps", "ActionsProps", "children", "onClose", "open"]);
|
|
13
|
+
cancelButtonText = props.cancelButtonText, cancelButtonProps = props.cancelButtonProps, onCancel = props.onCancel, TitleProps = props.TitleProps, ContentProps = props.ContentProps, disableBackdropClickProp = props.disableBackdropClick, ActionsProps = props.ActionsProps, children = props.children, onClose = props.onClose, open = props.open, rest = __rest(props, ["childrenSize", "title", "footer", "loadingOverlay", "loading", "confirmButtonText", "confirmButtonProps", "onConfirm", "cancelButtonText", "cancelButtonProps", "onCancel", "TitleProps", "ContentProps", "disableBackdropClick", "ActionsProps", "children", "onClose", "open"]);
|
|
14
14
|
var isXsmall = childrenSize === 'small';
|
|
15
|
-
var
|
|
16
|
-
|
|
15
|
+
var isLoading = loading || loadingOverlay;
|
|
16
|
+
var disableBackdropClick = disableBackdropClickProp !== null && disableBackdropClickProp !== void 0 ? disableBackdropClickProp : isLoading;
|
|
17
|
+
var handleClose = useEventCallback(function (e, reason) {
|
|
18
|
+
if (reason === 'backdropClick' && disableBackdropClick) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
onClose === null || onClose === void 0 ? void 0 : onClose(e, reason);
|
|
22
|
+
onCancel === null || onCancel === void 0 ? void 0 : onCancel(e, reason);
|
|
23
|
+
});
|
|
24
|
+
return (React.createElement(RcDialog, __assign({ ref: ref, childrenSize: childrenSize, disableEscapeKeyDown: isLoading, onClose: handleClose, open: open }, rest),
|
|
17
25
|
React.createElement(RcLoading, { loading: loadingOverlay },
|
|
18
26
|
React.createElement(RcDialogTitle, __assign({ "data-test-automation-id": 'DialogTitle' }, TitleProps), title),
|
|
19
27
|
React.createElement(RcDialogContent, __assign({ "data-test-automation-id": 'DialogContent' }, ContentProps), typeof children === 'string' ? (React.createElement(RcDialogContentText, null, children)) : (children)),
|
|
@@ -2,7 +2,7 @@ import { __assign, __makeTemplateObject, __rest } from "tslib";
|
|
|
2
2
|
import React, { forwardRef, useMemo } from 'react';
|
|
3
3
|
import Slide from '@material-ui/core/Slide';
|
|
4
4
|
import MuiSnackbar from '@material-ui/core/Snackbar';
|
|
5
|
-
import { combineClasses,
|
|
5
|
+
import { combineClasses, styled, useThemeProps, } from '../../foundation';
|
|
6
6
|
import { useUnmountPortalHandler } from '../PortalHost';
|
|
7
7
|
import { RcSnackbarContent } from './SnackbarContent';
|
|
8
8
|
import { SnackbarStyle } from './styles';
|
|
@@ -12,7 +12,7 @@ var _RcSnackbar = forwardRef(function (inProps, ref) {
|
|
|
12
12
|
var classesProp = props.classes, size = props.size, type = props.type, message = props.message, action = props.action, ContentProps = props.ContentProps, children = props.children, TransitionPropsProp = props.TransitionProps, rest = __rest(props, ["classes", "size", "type", "message", "action", "ContentProps", "children", "TransitionProps"]);
|
|
13
13
|
var classes = useMemo(function () { return combineClasses(RcSnackbarClasses, classesProp); }, [classesProp]);
|
|
14
14
|
var onExited = useUnmountPortalHandler(TransitionPropsProp === null || TransitionPropsProp === void 0 ? void 0 : TransitionPropsProp.onExited);
|
|
15
|
-
var TransitionProps =
|
|
15
|
+
var TransitionProps = __assign(__assign({}, TransitionPropsProp), { onExited: onExited });
|
|
16
16
|
return (React.createElement(MuiSnackbar, __assign({ ref: ref, classes: classes, TransitionProps: TransitionProps }, rest), children || (React.createElement(RcSnackbarContent, __assign({ size: size, type: type, message: message, action: action }, ContentProps)))));
|
|
17
17
|
});
|
|
18
18
|
var RcSnackbar = styled(_RcSnackbar)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), SnackbarStyle);
|