@ringcentral/juno 1.12.4-beta.5841-601f173e → 1.12.4-beta.5847-6a74475d
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/es6/foundation/theme/assets/zIndex.json +1 -2
- package/foundation/theme/assets/zIndex.json +1 -2
- package/package.json +1 -1
- package/components/Toast/Toast.d.ts +0 -30
- package/components/Toast/Toast.js +0 -49
- package/components/Toast/ToastContainer.d.ts +0 -12
- package/components/Toast/ToastContainer.js +0 -17
- package/components/Toast/index.d.ts +0 -3
- package/components/Toast/index.js +0 -7
- package/components/Toast/styles/ToastStyle.d.ts +0 -4
- package/components/Toast/styles/ToastStyle.js +0 -12
- package/components/Toast/styles/index.d.ts +0 -1
- package/components/Toast/styles/index.js +0 -4
- package/components/Toast/utils/ToastUtils.d.ts +0 -1
- package/components/Toast/utils/ToastUtils.js +0 -3
- package/components/Toast/utils/index.d.ts +0 -1
- package/components/Toast/utils/index.js +0 -4
- package/es6/components/Toast/Toast.js +0 -47
- package/es6/components/Toast/ToastContainer.js +0 -15
- package/es6/components/Toast/index.js +0 -3
- package/es6/components/Toast/styles/ToastStyle.js +0 -10
- package/es6/components/Toast/styles/index.js +0 -1
- package/es6/components/Toast/utils/ToastUtils.js +0 -1
- package/es6/components/Toast/utils/index.js +0 -1
package/package.json
CHANGED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { SnackbarCloseReason } from '@material-ui/core';
|
|
2
|
-
import React, { ComponentProps } from 'react';
|
|
3
|
-
import { RcBaseProps } from '../../foundation';
|
|
4
|
-
import { RcPortalProps } from '../Portal';
|
|
5
|
-
import { RcSnackbar } from '../Snackbar';
|
|
6
|
-
declare type ToastCloseReason = Exclude<SnackbarCloseReason, 'clickaway'> | 'dismissButton';
|
|
7
|
-
declare type RcToastProps = {
|
|
8
|
-
/**
|
|
9
|
-
* @default 'RC_TOAST_CONTAINER_ID'
|
|
10
|
-
* like `container` of RcPortal, but you can pass a element id either.
|
|
11
|
-
*/
|
|
12
|
-
container?: RcPortalProps['container'] | 'string';
|
|
13
|
-
/**
|
|
14
|
-
* if you pass id to `container` prop
|
|
15
|
-
* you can use this prop to specify a window
|
|
16
|
-
*/
|
|
17
|
-
getWindow?: () => Window;
|
|
18
|
-
/** If `true`, `toast` is open */
|
|
19
|
-
open: boolean;
|
|
20
|
-
/** trigger when toast close */
|
|
21
|
-
onClose: (event: React.SyntheticEvent<any>, reason: ToastCloseReason) => void;
|
|
22
|
-
/**
|
|
23
|
-
* @default false
|
|
24
|
-
*/
|
|
25
|
-
dismissButton?: boolean;
|
|
26
|
-
} & RcBaseProps<ComponentProps<typeof RcSnackbar>, 'open' | 'onClose' | 'anchorOrigin'>;
|
|
27
|
-
declare const RcToast: import("styled-components").StyledComponentClass<Pick<RcToastProps, "key" | "className" | "color" | "id" | "lang" | "style" | "type" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "slot" | "title" | "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" | "innerRef" | "theme" | "TransitionComponent" | "TransitionProps" | "action" | "message" | "onClose" | "onEnter" | "onEntering" | "onEntered" | "onExit" | "onExiting" | "onExited" | "open" | "transitionDuration" | "container" | "as" | "autoHideDuration" | "ClickAwayListenerProps" | "ContentProps" | "disableWindowBlurListener" | "resumeHideDuration" | "getWindow" | "dismissButton"> & React.RefAttributes<any>, import("../../foundation").RcTheme, Pick<Pick<RcToastProps, "key" | "className" | "color" | "id" | "lang" | "style" | "type" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "slot" | "title" | "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" | "innerRef" | "theme" | "TransitionComponent" | "TransitionProps" | "action" | "message" | "onClose" | "onEnter" | "onEntering" | "onEntered" | "onExit" | "onExiting" | "onExited" | "open" | "transitionDuration" | "container" | "as" | "autoHideDuration" | "ClickAwayListenerProps" | "ContentProps" | "disableWindowBlurListener" | "resumeHideDuration" | "getWindow" | "dismissButton"> & React.RefAttributes<any>, "ref" | "key" | "className" | "color" | "id" | "lang" | "style" | "type" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "slot" | "title" | "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" | "innerRef" | "TransitionComponent" | "TransitionProps" | "action" | "message" | "onClose" | "onEnter" | "onEntering" | "onEntered" | "onExit" | "onExiting" | "onExited" | "open" | "transitionDuration" | "container" | "as" | "autoHideDuration" | "ClickAwayListenerProps" | "ContentProps" | "disableWindowBlurListener" | "resumeHideDuration" | "getWindow" | "dismissButton"> & {
|
|
28
|
-
theme?: import("../../foundation").RcTheme | undefined;
|
|
29
|
-
}>;
|
|
30
|
-
export { RcToast, RcToastProps, ToastCloseReason };
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var tslib_1 = require("tslib");
|
|
4
|
-
var react_1 = tslib_1.__importStar(require("react"));
|
|
5
|
-
var foundation_1 = require("../../foundation");
|
|
6
|
-
var icon_1 = require("../../icon");
|
|
7
|
-
var Portal_1 = require("../Portal");
|
|
8
|
-
var Snackbar_1 = require("../Snackbar");
|
|
9
|
-
var styles_1 = require("./styles");
|
|
10
|
-
var utils_1 = require("./utils");
|
|
11
|
-
var _RcToast = react_1.forwardRef(function (_a, ref) {
|
|
12
|
-
var children = _a.children, _b = _a.container, containerProp = _b === void 0 ? utils_1.RC_TOAST_CONTAINER_ID : _b, getWindow = _a.getWindow, onClose = _a.onClose, _c = _a.ContentProps, ContentPropsInput = _c === void 0 ? {} : _c, _d = _a.dismissButton, dismissButton = _d === void 0 ? false : _d, _e = _a.autoHideDuration, autoHideDuration = _e === void 0 ? 3000 : _e, rest = tslib_1.__rest(_a, ["children", "container", "getWindow", "onClose", "ContentProps", "dismissButton", "autoHideDuration"]);
|
|
13
|
-
var container = (function () {
|
|
14
|
-
var _a;
|
|
15
|
-
// mean containerProp is id
|
|
16
|
-
if (typeof containerProp === 'string') {
|
|
17
|
-
var targetWindow = (_a = getWindow === null || getWindow === void 0 ? void 0 : getWindow()) !== null && _a !== void 0 ? _a : window;
|
|
18
|
-
return targetWindow.document.getElementById(containerProp);
|
|
19
|
-
}
|
|
20
|
-
return containerProp;
|
|
21
|
-
})();
|
|
22
|
-
var action = (function () {
|
|
23
|
-
var originActions = react_1.default.Children.toArray(ContentPropsInput.action);
|
|
24
|
-
if (dismissButton) {
|
|
25
|
-
var closeAction = (react_1.default.createElement(Snackbar_1.RcSnackbarAction, { key: "dismiss-action", variant: "icon", "aria-label": "Dismiss", symbol: icon_1.Close, onClick: function (e) { return handleClose(e, 'dismissButton'); } }));
|
|
26
|
-
return tslib_1.__spread(originActions, [closeAction]);
|
|
27
|
-
}
|
|
28
|
-
return originActions.length === 0 ? null : originActions;
|
|
29
|
-
})();
|
|
30
|
-
var messageAlign = (function () {
|
|
31
|
-
if (action === null || action === void 0 ? void 0 : action.length) {
|
|
32
|
-
return 'left';
|
|
33
|
-
}
|
|
34
|
-
return 'center';
|
|
35
|
-
})();
|
|
36
|
-
var ContentProps = tslib_1.__assign(tslib_1.__assign({}, ContentPropsInput), { action: action,
|
|
37
|
-
messageAlign: messageAlign });
|
|
38
|
-
var handleClose = function (e, reason) {
|
|
39
|
-
if (reason === 'clickaway')
|
|
40
|
-
return;
|
|
41
|
-
onClose(e, reason);
|
|
42
|
-
};
|
|
43
|
-
return (react_1.default.createElement(Portal_1.RcPortal, { container: container },
|
|
44
|
-
react_1.default.createElement(Snackbar_1.RcSnackbar, tslib_1.__assign({}, rest, { autoHideDuration: autoHideDuration, onClose: handleClose, ref: ref, ContentProps: ContentProps }), children)));
|
|
45
|
-
});
|
|
46
|
-
var RcToast = foundation_1.styled(_RcToast)(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), styles_1.ToastStyle);
|
|
47
|
-
exports.RcToast = RcToast;
|
|
48
|
-
RcToast.displayName = 'RcToast';
|
|
49
|
-
var templateObject_1;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { RcPortalProps } from '../Portal';
|
|
3
|
-
declare type RcToastContainerProps = {
|
|
4
|
-
container?: RcPortalProps['container'];
|
|
5
|
-
className?: string;
|
|
6
|
-
/** container id, RcToast can render by this id */
|
|
7
|
-
id?: string;
|
|
8
|
-
};
|
|
9
|
-
declare const RcToastContainer: import("styled-components").StyledComponentClass<RcToastContainerProps & React.RefAttributes<any>, import("../../foundation").RcTheme, Pick<RcToastContainerProps & React.RefAttributes<any>, "ref" | "key" | "className" | "id" | "container"> & {
|
|
10
|
-
theme?: import("../../foundation").RcTheme | undefined;
|
|
11
|
-
}>;
|
|
12
|
-
export { RcToastContainer, RcToastContainerProps };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var tslib_1 = require("tslib");
|
|
4
|
-
var react_1 = tslib_1.__importStar(require("react"));
|
|
5
|
-
var foundation_1 = require("../../foundation");
|
|
6
|
-
var Portal_1 = require("../Portal");
|
|
7
|
-
var styles_1 = require("./styles");
|
|
8
|
-
var utils_1 = require("./utils");
|
|
9
|
-
var _RcToastContainer = react_1.forwardRef(function (props, ref) {
|
|
10
|
-
var _a = props.container, container = _a === void 0 ? document.body : _a, _b = props.id, id = _b === void 0 ? utils_1.RC_TOAST_CONTAINER_ID : _b, rest = tslib_1.__rest(props, ["container", "id"]);
|
|
11
|
-
return (react_1.default.createElement(Portal_1.RcPortal, { container: container },
|
|
12
|
-
react_1.default.createElement("div", tslib_1.__assign({}, rest, { id: id, ref: ref }))));
|
|
13
|
-
});
|
|
14
|
-
var RcToastContainer = foundation_1.styled(_RcToastContainer)(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), styles_1.ToastContainerStyle);
|
|
15
|
-
exports.RcToastContainer = RcToastContainer;
|
|
16
|
-
RcToastContainer.displayName = 'RcToastContainer';
|
|
17
|
-
var templateObject_1;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./Toast"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./ToastContainer"), exports);
|
|
6
|
-
var styles_1 = require("./styles");
|
|
7
|
-
exports.ToastContainerStyle = styles_1.ToastContainerStyle;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var tslib_1 = require("tslib");
|
|
4
|
-
var foundation_1 = require("../../../foundation");
|
|
5
|
-
var utils_1 = require("../utils");
|
|
6
|
-
exports.ToastStyle = function () {
|
|
7
|
-
return foundation_1.css(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n &:last-of-type {\n margin-bottom: 0;\n }\n\n margin-bottom: ", ";\n\n ", "\n position: static;\n transform: none;\n "], ["\n &:last-of-type {\n margin-bottom: 0;\n }\n\n margin-bottom: ", ";\n\n ", /** clean snackbar style about anchorOrigin */ "\n position: static;\n transform: none;\n "])), foundation_1.spacing(3), '' /** clean snackbar style about anchorOrigin */);
|
|
8
|
-
};
|
|
9
|
-
exports.ToastContainerStyle = function () {
|
|
10
|
-
return foundation_1.css(templateObject_2 || (templateObject_2 = tslib_1.__makeTemplateObject(["\n #", " {\n padding-left: ", ";\n padding-right: ", ";\n\n position: fixed;\n top: ", ";\n left: 0;\n right: 0;\n\n z-index: ", ";\n box-sizing: border-box;\n pointer-events: none;\n }\n "], ["\n #", " {\n padding-left: ", ";\n padding-right: ", ";\n\n position: fixed;\n top: ", ";\n left: 0;\n right: 0;\n\n z-index: ", ";\n box-sizing: border-box;\n pointer-events: none;\n }\n "])), utils_1.RC_TOAST_CONTAINER_ID, foundation_1.spacing(4), foundation_1.spacing(4), foundation_1.spacing(22), foundation_1.zIndex('toast'));
|
|
11
|
-
};
|
|
12
|
-
var templateObject_1, templateObject_2;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './ToastStyle';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const RC_TOAST_CONTAINER_ID = "RC_TOAST_CONTAINER";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './ToastUtils';
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { __assign, __makeTemplateObject, __read, __rest, __spread } from "tslib";
|
|
2
|
-
import React, { forwardRef } from 'react';
|
|
3
|
-
import { styled } from '../../foundation';
|
|
4
|
-
import { Close as CloseIcon } from '../../icon';
|
|
5
|
-
import { RcPortal } from '../Portal';
|
|
6
|
-
import { RcSnackbar, RcSnackbarAction } from '../Snackbar';
|
|
7
|
-
import { ToastStyle } from './styles';
|
|
8
|
-
import { RC_TOAST_CONTAINER_ID } from './utils';
|
|
9
|
-
var _RcToast = forwardRef(function (_a, ref) {
|
|
10
|
-
var children = _a.children, _b = _a.container, containerProp = _b === void 0 ? RC_TOAST_CONTAINER_ID : _b, getWindow = _a.getWindow, onClose = _a.onClose, _c = _a.ContentProps, ContentPropsInput = _c === void 0 ? {} : _c, _d = _a.dismissButton, dismissButton = _d === void 0 ? false : _d, _e = _a.autoHideDuration, autoHideDuration = _e === void 0 ? 3000 : _e, rest = __rest(_a, ["children", "container", "getWindow", "onClose", "ContentProps", "dismissButton", "autoHideDuration"]);
|
|
11
|
-
var container = (function () {
|
|
12
|
-
var _a;
|
|
13
|
-
// mean containerProp is id
|
|
14
|
-
if (typeof containerProp === 'string') {
|
|
15
|
-
var targetWindow = (_a = getWindow === null || getWindow === void 0 ? void 0 : getWindow()) !== null && _a !== void 0 ? _a : window;
|
|
16
|
-
return targetWindow.document.getElementById(containerProp);
|
|
17
|
-
}
|
|
18
|
-
return containerProp;
|
|
19
|
-
})();
|
|
20
|
-
var action = (function () {
|
|
21
|
-
var originActions = React.Children.toArray(ContentPropsInput.action);
|
|
22
|
-
if (dismissButton) {
|
|
23
|
-
var closeAction = (React.createElement(RcSnackbarAction, { key: "dismiss-action", variant: "icon", "aria-label": "Dismiss", symbol: CloseIcon, onClick: function (e) { return handleClose(e, 'dismissButton'); } }));
|
|
24
|
-
return __spread(originActions, [closeAction]);
|
|
25
|
-
}
|
|
26
|
-
return originActions.length === 0 ? null : originActions;
|
|
27
|
-
})();
|
|
28
|
-
var messageAlign = (function () {
|
|
29
|
-
if (action === null || action === void 0 ? void 0 : action.length) {
|
|
30
|
-
return 'left';
|
|
31
|
-
}
|
|
32
|
-
return 'center';
|
|
33
|
-
})();
|
|
34
|
-
var ContentProps = __assign(__assign({}, ContentPropsInput), { action: action,
|
|
35
|
-
messageAlign: messageAlign });
|
|
36
|
-
var handleClose = function (e, reason) {
|
|
37
|
-
if (reason === 'clickaway')
|
|
38
|
-
return;
|
|
39
|
-
onClose(e, reason);
|
|
40
|
-
};
|
|
41
|
-
return (React.createElement(RcPortal, { container: container },
|
|
42
|
-
React.createElement(RcSnackbar, __assign({}, rest, { autoHideDuration: autoHideDuration, onClose: handleClose, ref: ref, ContentProps: ContentProps }), children)));
|
|
43
|
-
});
|
|
44
|
-
var RcToast = styled(_RcToast)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), ToastStyle);
|
|
45
|
-
RcToast.displayName = 'RcToast';
|
|
46
|
-
export { RcToast };
|
|
47
|
-
var templateObject_1;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { __assign, __makeTemplateObject, __rest } from "tslib";
|
|
2
|
-
import React, { forwardRef } from 'react';
|
|
3
|
-
import { styled } from '../../foundation';
|
|
4
|
-
import { RcPortal } from '../Portal';
|
|
5
|
-
import { ToastContainerStyle } from './styles';
|
|
6
|
-
import { RC_TOAST_CONTAINER_ID } from './utils';
|
|
7
|
-
var _RcToastContainer = forwardRef(function (props, ref) {
|
|
8
|
-
var _a = props.container, container = _a === void 0 ? document.body : _a, _b = props.id, id = _b === void 0 ? RC_TOAST_CONTAINER_ID : _b, rest = __rest(props, ["container", "id"]);
|
|
9
|
-
return (React.createElement(RcPortal, { container: container },
|
|
10
|
-
React.createElement("div", __assign({}, rest, { id: id, ref: ref }))));
|
|
11
|
-
});
|
|
12
|
-
var RcToastContainer = styled(_RcToastContainer)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), ToastContainerStyle);
|
|
13
|
-
RcToastContainer.displayName = 'RcToastContainer';
|
|
14
|
-
export { RcToastContainer };
|
|
15
|
-
var templateObject_1;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { __makeTemplateObject } from "tslib";
|
|
2
|
-
import { css, spacing, zIndex } from '../../../foundation';
|
|
3
|
-
import { RC_TOAST_CONTAINER_ID } from '../utils';
|
|
4
|
-
export var ToastStyle = function () {
|
|
5
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n &:last-of-type {\n margin-bottom: 0;\n }\n\n margin-bottom: ", ";\n\n ", "\n position: static;\n transform: none;\n "], ["\n &:last-of-type {\n margin-bottom: 0;\n }\n\n margin-bottom: ", ";\n\n ", /** clean snackbar style about anchorOrigin */ "\n position: static;\n transform: none;\n "])), spacing(3), '' /** clean snackbar style about anchorOrigin */);
|
|
6
|
-
};
|
|
7
|
-
export var ToastContainerStyle = function () {
|
|
8
|
-
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n #", " {\n padding-left: ", ";\n padding-right: ", ";\n\n position: fixed;\n top: ", ";\n left: 0;\n right: 0;\n\n z-index: ", ";\n box-sizing: border-box;\n pointer-events: none;\n }\n "], ["\n #", " {\n padding-left: ", ";\n padding-right: ", ";\n\n position: fixed;\n top: ", ";\n left: 0;\n right: 0;\n\n z-index: ", ";\n box-sizing: border-box;\n pointer-events: none;\n }\n "])), RC_TOAST_CONTAINER_ID, spacing(4), spacing(4), spacing(22), zIndex('toast'));
|
|
9
|
-
};
|
|
10
|
-
var templateObject_1, templateObject_2;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './ToastStyle';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export var RC_TOAST_CONTAINER_ID = 'RC_TOAST_CONTAINER';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './ToastUtils';
|