@ringcentral/juno 1.12.4-beta.5835-b8c3da57 → 1.12.4-beta.5841-601f173e

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.
Files changed (37) hide show
  1. package/components/Forms/Picker/TimePicker/TimePicker.d.ts +13 -58
  2. package/components/Forms/Picker/TimePicker/TimePicker.js +15 -21
  3. package/components/Forms/Picker/TimePicker/index.d.ts +1 -0
  4. package/components/Forms/Picker/TimePicker/index.js +1 -0
  5. package/components/Forms/Picker/TimePicker/styles/StyledPickerPopperWrap.d.ts +8 -8
  6. package/components/Forms/Picker/TimePicker/utils/TimePickerHelper.d.ts +24 -0
  7. package/components/Forms/Picker/TimePicker/utils/TimePickerHelper.js +24 -0
  8. package/components/Toast/Toast.d.ts +30 -0
  9. package/components/Toast/Toast.js +49 -0
  10. package/components/Toast/ToastContainer.d.ts +12 -0
  11. package/components/Toast/ToastContainer.js +17 -0
  12. package/components/Toast/index.d.ts +3 -0
  13. package/components/Toast/index.js +7 -0
  14. package/components/Toast/styles/ToastStyle.d.ts +4 -0
  15. package/components/Toast/styles/ToastStyle.js +12 -0
  16. package/components/Toast/styles/index.d.ts +1 -0
  17. package/components/Toast/styles/index.js +4 -0
  18. package/components/Toast/utils/ToastUtils.d.ts +1 -0
  19. package/components/Toast/utils/ToastUtils.js +3 -0
  20. package/components/Toast/utils/index.d.ts +1 -0
  21. package/components/Toast/utils/index.js +4 -0
  22. package/es6/components/Forms/Picker/TimePicker/TimePicker.js +15 -21
  23. package/es6/components/Forms/Picker/TimePicker/index.js +1 -0
  24. package/es6/components/Forms/Picker/TimePicker/utils/TimePickerHelper.js +24 -0
  25. package/es6/components/Toast/Toast.js +47 -0
  26. package/es6/components/Toast/ToastContainer.js +15 -0
  27. package/es6/components/Toast/index.js +3 -0
  28. package/es6/components/Toast/styles/ToastStyle.js +10 -0
  29. package/es6/components/Toast/styles/index.js +1 -0
  30. package/es6/components/Toast/utils/ToastUtils.js +1 -0
  31. package/es6/components/Toast/utils/index.js +1 -0
  32. package/es6/foundation/theme/ThemeProvider.js +17 -4
  33. package/es6/foundation/theme/assets/zIndex.json +2 -1
  34. package/foundation/theme/ThemeProvider.d.ts +2 -0
  35. package/foundation/theme/ThemeProvider.js +15 -2
  36. package/foundation/theme/assets/zIndex.json +2 -1
  37. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import { RcBaseProps, RcBaseSize, RcClassesProps } from '../../../../foundation';
1
+ /// <reference types="react" />
2
+ import { CustomStyledComponentResult, RcBaseProps, RcBaseSize, RcClassesProps } from '../../../../foundation';
3
3
  import { PickerTextFieldProps } from '../utils';
4
4
  import { NumberPickerProps } from './NumberPicker';
5
5
  import { ToggleTextProps } from './ToggleText';
@@ -13,17 +13,17 @@ declare type RcClickFiledStyleProps = {
13
13
  disabled?: boolean;
14
14
  };
15
15
  declare type PickNumberPickerProps = RcBaseProps<Partial<NumberPickerProps>, 'size' | 'onUpdateValue' | 'onClose' | 'onClick' | 'onKeyDown' | 'value' | 'min' | 'max' | 'isTwelveHourSystem' | 'source' | 'step'>;
16
- declare type RcTimePickerProps = {
16
+ declare type RcTimePickerProps<T = false> = {
17
17
  /** with two size: 'small' | 'medium', default with medium. */
18
18
  size?: RcTimePickerSize;
19
19
  /** Is 12 hours system */
20
20
  isTwelveHourSystem?: boolean;
21
21
  /** Date or timestamp */
22
- value?: number | Date;
22
+ value?: (T extends true ? Date : number) | null;
23
23
  /** When all using date, this props will be remove, */
24
- dateMode?: boolean;
24
+ dateMode?: T;
25
25
  /** when user change time */
26
- onChange?: (time?: RcTimePickerProps['value']) => void;
26
+ onChange?: (time: NonNullable<RcTimePickerProps<T>['value']> | null) => void;
27
27
  /** min time */
28
28
  min?: number | Date;
29
29
  /** max time */
@@ -35,57 +35,12 @@ declare type RcTimePickerProps = {
35
35
  /** props for periodToggle component */
36
36
  PeriodToggleProps?: RcBaseProps<Partial<ToggleTextProps>, 'disabled' | 'isTwelveHourSystem' | 'size' | 'value' | 'onUpdateValue' | 'children'>;
37
37
  /** @deprecated this props will be removed, using value to replace that */
38
- times?: RcTimePickerProps['value'];
38
+ times?: RcTimePickerProps<T>['value'];
39
39
  } & RcBaseProps<PickerTextFieldProps, 'onClick' | 'value' | 'children'> & RcClassesProps<'popover' | 'popoverPaper'>;
40
- /** @release */
41
- declare const RcTimePicker: import("styled-components").StyledComponentClass<{
42
- /** with two size: 'small' | 'medium', default with medium. */
43
- size?: "small" | "medium" | undefined;
44
- /** Is 12 hours system */
45
- isTwelveHourSystem?: boolean | undefined;
46
- /** Date or timestamp */
47
- value?: number | Date | undefined;
48
- /** When all using date, this props will be remove, */
49
- dateMode?: boolean | undefined;
50
- /** when user change time */
51
- onChange?: ((time?: number | Date | undefined) => void) | undefined;
52
- /** min time */
53
- min?: number | Date | undefined;
54
- /** max time */
55
- max?: number | Date | undefined;
56
- /** props for hourPicker component */
57
- HourPickerProps?: Pick<Partial<NumberPickerProps>, "className" | "color" | "id" | "lang" | "style" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "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" | "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" | "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" | "disabled" | "onInnerChange" | "automationId" | "getScreenReaderLabel" | "renderValue"> | undefined;
58
- /** props for minutePicker component */
59
- MinutePickerProps?: Pick<Partial<NumberPickerProps>, "className" | "color" | "id" | "lang" | "style" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "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" | "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" | "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" | "disabled" | "onInnerChange" | "automationId" | "getScreenReaderLabel" | "renderValue"> | undefined;
60
- /** props for periodToggle component */
61
- PeriodToggleProps?: Pick<Partial<ToggleTextProps>, "form" | "className" | "color" | "id" | "lang" | "name" | "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" | "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" | "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" | "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" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "onClose" | "onInnerChange" | "getScreenReaderLabel"> | undefined;
62
- /** @deprecated this props will be removed, using value to replace that */
63
- times?: number | Date | undefined;
64
- } & Pick<PickerTextFieldProps, "className" | "id" | "radius" | "onFocus" | "onBlur" | "onKeyDown" | "label" | "placeholder" | "size" | "variant" | "disabled" | "action" | "autoFocus" | "fullWidth" | "error" | "inputProps" | "inputRef" | "required" | "InputProps" | "helperText" | "gutterBottom" | "onClear" | "clearBtn" | "clearButtonProps" | "validate" | "PopoverProps" | "ActionSymbol"> & RcClassesProps<"popover" | "popoverPaper"> & React.RefAttributes<any>, import("../../../../foundation").RcTheme, Pick<{
65
- /** with two size: 'small' | 'medium', default with medium. */
66
- size?: "small" | "medium" | undefined;
67
- /** Is 12 hours system */
68
- isTwelveHourSystem?: boolean | undefined;
69
- /** Date or timestamp */
70
- value?: number | Date | undefined;
71
- /** When all using date, this props will be remove, */
72
- dateMode?: boolean | undefined;
73
- /** when user change time */
74
- onChange?: ((time?: number | Date | undefined) => void) | undefined;
75
- /** min time */
76
- min?: number | Date | undefined;
77
- /** max time */
78
- max?: number | Date | undefined;
79
- /** props for hourPicker component */
80
- HourPickerProps?: Pick<Partial<NumberPickerProps>, "className" | "color" | "id" | "lang" | "style" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "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" | "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" | "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" | "disabled" | "onInnerChange" | "automationId" | "getScreenReaderLabel" | "renderValue"> | undefined;
81
- /** props for minutePicker component */
82
- MinutePickerProps?: Pick<Partial<NumberPickerProps>, "className" | "color" | "id" | "lang" | "style" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "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" | "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" | "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" | "disabled" | "onInnerChange" | "automationId" | "getScreenReaderLabel" | "renderValue"> | undefined;
83
- /** props for periodToggle component */
84
- PeriodToggleProps?: Pick<Partial<ToggleTextProps>, "form" | "className" | "color" | "id" | "lang" | "name" | "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" | "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" | "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" | "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" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "onClose" | "onInnerChange" | "getScreenReaderLabel"> | undefined;
85
- /** @deprecated this props will be removed, using value to replace that */
86
- times?: number | Date | undefined;
87
- } & Pick<PickerTextFieldProps, "className" | "id" | "radius" | "onFocus" | "onBlur" | "onKeyDown" | "label" | "placeholder" | "size" | "variant" | "disabled" | "action" | "autoFocus" | "fullWidth" | "error" | "inputProps" | "inputRef" | "required" | "InputProps" | "helperText" | "gutterBottom" | "onClear" | "clearBtn" | "clearButtonProps" | "validate" | "PopoverProps" | "ActionSymbol"> & RcClassesProps<"popover" | "popoverPaper"> & React.RefAttributes<any>, "ref" | "key" | "className" | "id" | "max" | "min" | "radius" | "onFocus" | "onBlur" | "onChange" | "onKeyDown" | "label" | "classes" | "placeholder" | "size" | "value" | "variant" | "disabled" | "action" | "autoFocus" | "fullWidth" | "error" | "inputProps" | "inputRef" | "required" | "InputProps" | "helperText" | "gutterBottom" | "onClear" | "clearBtn" | "clearButtonProps" | "validate" | "PopoverProps" | "ActionSymbol" | "isTwelveHourSystem" | "dateMode" | "HourPickerProps" | "MinutePickerProps" | "PeriodToggleProps" | "times"> & {
88
- theme?: import("../../../../foundation").RcTheme | undefined;
89
- }>;
90
- export { RcTimePicker };
40
+ /**
41
+ * when `dateMode={true}` that onChange will return `Date` object,
42
+ * otherwise return timestamp `number`
43
+ */
44
+ declare const ExportType: <T extends boolean = false>(props: RcTimePickerProps<T>) => JSX.Element & CustomStyledComponentResult<RcTimePickerProps<T>>;
45
+ export { ExportType as RcTimePicker };
91
46
  export type { RcClickFiledStyleProps, RcTimePickerProps, RcTimePickerSize };
@@ -14,6 +14,7 @@ var styles_1 = require("./styles");
14
14
  var ToggleText_1 = require("./ToggleText");
15
15
  var utils_2 = require("./utils");
16
16
  var _RcTimePicker = react_1.forwardRef(function (inProps, ref) {
17
+ var _a;
17
18
  var props = foundation_1.useThemeProps({ props: inProps, name: 'RcTimePicker' });
18
19
  var isTwelveHourSystem = props.isTwelveHourSystem, value = props.value, times = props.times, onChange = props.onChange, disabled = props.disabled, dateMode = props.dateMode, min = props.min, max = props.max, size = props.size, onKeyDown = props.onKeyDown, onClear = props.onClear, HourPickerProps = props.HourPickerProps, MinutePickerProps = props.MinutePickerProps, PeriodToggleProps = props.PeriodToggleProps, PopoverPropsProp = props.PopoverProps, InputPropsProp = props.InputProps, classes = props.classes, rest = tslib_1.__rest(props, ["isTwelveHourSystem", "value", "times", "onChange", "disabled", "dateMode", "min", "max", "size", "onKeyDown", "onClear", "HourPickerProps", "MinutePickerProps", "PeriodToggleProps", "PopoverProps", "InputProps", "classes"]);
19
20
  // TODO: when props remove clear that code, not use forwardRef for Jupiter test issue
@@ -30,8 +31,8 @@ var _RcTimePicker = react_1.forwardRef(function (inProps, ref) {
30
31
  var minuteRef = react_1.useRef(null);
31
32
  var periodRef = react_1.useRef(null);
32
33
  var textFiledValueRef = react_1.useRef('');
33
- var _a = tslib_1.__read(react_1.useState('none'), 2), selectionShowType = _a[0], setSelectionType = _a[1];
34
- var nowTime = value || times;
34
+ var _b = tslib_1.__read(react_1.useState('none'), 2), selectionShowType = _b[0], setSelectionType = _b[1];
35
+ var nowTime = (_a = value) !== null && _a !== void 0 ? _a : times;
35
36
  var isHaveValue = nowTime !== undefined;
36
37
  var isDateMode = nowTime instanceof Date || dateMode;
37
38
  var currentTimestamp = utils_2.getTimestamp(nowTime);
@@ -65,8 +66,8 @@ var _RcTimePicker = react_1.forwardRef(function (inProps, ref) {
65
66
  onChange(toValue);
66
67
  }
67
68
  else {
68
- // * when time is zero emit undefined
69
- onChange(toValue ? utils_2.getTimestampFromDate(toValue) : undefined);
69
+ // * when time is zero emit null
70
+ onChange(toValue ? utils_2.getTimestampFromDate(toValue) : null);
70
71
  }
71
72
  }
72
73
  }, [isDateMode, onChange]);
@@ -112,22 +113,8 @@ var _RcTimePicker = react_1.forwardRef(function (inProps, ref) {
112
113
  return updateTime({ period: period });
113
114
  });
114
115
  var handleClear = foundation_1.useEventCallback(function (e) {
115
- var time;
116
- // if that is date format, we couldn't reset to undefined, that will miss that date information.
117
- if (isDateMode) {
118
- if (range.min.date) {
119
- time = getEmitInitDate();
120
- time.setHours(range.min.hour);
121
- time.setMinutes(range.min.minute);
122
- }
123
- else {
124
- time = new Date(nowTime);
125
- time.setHours(0);
126
- time.setMinutes(0);
127
- }
128
- }
129
116
  onClear === null || onClear === void 0 ? void 0 : onClear(e);
130
- handleChange(time);
117
+ handleChange(null);
131
118
  });
132
119
  var handleSelectionViewClick = foundation_1.useEventCallback(function (toValue) {
133
120
  updateTime(isHourView ? { hour: toValue } : { minute: toValue });
@@ -137,7 +124,9 @@ var _RcTimePicker = react_1.forwardRef(function (inProps, ref) {
137
124
  var _a;
138
125
  (_a = actionRef.current) === null || _a === void 0 ? void 0 : _a.close();
139
126
  });
140
- var setHourSelectionShow = foundation_1.useEventCallback(function () { return setSelectionType('hour'); });
127
+ var setHourSelectionShow = foundation_1.useEventCallback(function () {
128
+ return setSelectionType('hour');
129
+ });
141
130
  var setMinuteSelectionShow = foundation_1.useEventCallback(function () {
142
131
  return setSelectionType('minute');
143
132
  });
@@ -299,7 +288,6 @@ var RcTimePicker = foundation_1.styled(foundation_1.withDeprecatedCheck(_RcTimeP
299
288
  comment: "@deprecated this props will be removed, using value to replace that",
300
289
  },
301
290
  ], 'RcTimePicker'))(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject([""], [""])));
302
- exports.RcTimePicker = RcTimePicker;
303
291
  RcTimePicker.defaultProps = {
304
292
  clearBtn: true,
305
293
  dateMode: false,
@@ -321,4 +309,10 @@ RcTimePicker.defaultProps = {
321
309
  },
322
310
  };
323
311
  RcTimePicker.displayName = 'RcTimePicker';
312
+ /**
313
+ * when `dateMode={true}` that onChange will return `Date` object,
314
+ * otherwise return timestamp `number`
315
+ */
316
+ var ExportType = RcTimePicker;
317
+ exports.RcTimePicker = ExportType;
324
318
  var templateObject_1;
@@ -2,3 +2,4 @@ export * from './NumberPicker';
2
2
  export * from './ToggleText';
3
3
  export * from './SelectionView';
4
4
  export * from './TimePicker';
5
+ export * from './utils';
@@ -5,3 +5,4 @@ tslib_1.__exportStar(require("./NumberPicker"), exports);
5
5
  tslib_1.__exportStar(require("./ToggleText"), exports);
6
6
  tslib_1.__exportStar(require("./SelectionView"), exports);
7
7
  tslib_1.__exportStar(require("./TimePicker"), exports);
8
+ tslib_1.__exportStar(require("./utils"), exports);
@@ -3,25 +3,25 @@
3
3
  export declare const StyledPickerPopperWrap: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
4
4
  size?: "small" | "medium" | undefined;
5
5
  isTwelveHourSystem?: boolean | undefined;
6
- value?: number | Date | undefined;
7
- dateMode?: boolean | undefined;
8
- onChange?: ((time?: number | Date | undefined) => void) | undefined;
6
+ value?: number | null | undefined;
7
+ dateMode?: false | undefined;
8
+ onChange?: ((time: number | null) => void) | undefined;
9
9
  min?: number | Date | undefined;
10
10
  max?: number | Date | undefined;
11
11
  HourPickerProps?: Pick<Partial<import("../NumberPicker").NumberPickerProps>, "className" | "color" | "id" | "lang" | "style" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "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" | "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" | "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" | "disabled" | "onInnerChange" | "automationId" | "getScreenReaderLabel" | "renderValue"> | undefined;
12
12
  MinutePickerProps?: Pick<Partial<import("../NumberPicker").NumberPickerProps>, "className" | "color" | "id" | "lang" | "style" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "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" | "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" | "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" | "disabled" | "onInnerChange" | "automationId" | "getScreenReaderLabel" | "renderValue"> | undefined;
13
13
  PeriodToggleProps?: Pick<Partial<import("../ToggleText").ToggleTextProps>, "form" | "className" | "color" | "id" | "lang" | "name" | "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" | "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" | "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" | "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" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "onClose" | "onInnerChange" | "getScreenReaderLabel"> | undefined;
14
- times?: number | Date | undefined;
14
+ times?: number | null | undefined;
15
15
  } & Pick<import("../../utils/PickerTextField/PickerTextField").PickerTextFieldProps, "className" | "id" | "radius" | "onFocus" | "onBlur" | "onKeyDown" | "label" | "placeholder" | "size" | "variant" | "disabled" | "action" | "autoFocus" | "fullWidth" | "error" | "inputProps" | "inputRef" | "required" | "InputProps" | "helperText" | "gutterBottom" | "onClear" | "clearBtn" | "clearButtonProps" | "validate" | "PopoverProps" | "ActionSymbol"> & import("../../../../../foundation").RcClassesProps<"popover" | "popoverPaper">, import("../../../../../foundation").RcTheme, import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
16
16
  size?: "small" | "medium" | undefined;
17
17
  isTwelveHourSystem?: boolean | undefined;
18
- value?: number | Date | undefined;
19
- dateMode?: boolean | undefined;
20
- onChange?: ((time?: number | Date | undefined) => void) | undefined;
18
+ value?: number | null | undefined;
19
+ dateMode?: false | undefined;
20
+ onChange?: ((time: number | null) => void) | undefined;
21
21
  min?: number | Date | undefined;
22
22
  max?: number | Date | undefined;
23
23
  HourPickerProps?: Pick<Partial<import("../NumberPicker").NumberPickerProps>, "className" | "color" | "id" | "lang" | "style" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "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" | "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" | "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" | "disabled" | "onInnerChange" | "automationId" | "getScreenReaderLabel" | "renderValue"> | undefined;
24
24
  MinutePickerProps?: Pick<Partial<import("../NumberPicker").NumberPickerProps>, "className" | "color" | "id" | "lang" | "style" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "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" | "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" | "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" | "disabled" | "onInnerChange" | "automationId" | "getScreenReaderLabel" | "renderValue"> | undefined;
25
25
  PeriodToggleProps?: Pick<Partial<import("../ToggleText").ToggleTextProps>, "form" | "className" | "color" | "id" | "lang" | "name" | "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" | "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" | "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" | "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" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "onClose" | "onInnerChange" | "getScreenReaderLabel"> | undefined;
26
- times?: number | Date | undefined;
26
+ times?: number | null | undefined;
27
27
  } & Pick<import("../../utils/PickerTextField/PickerTextField").PickerTextFieldProps, "className" | "id" | "radius" | "onFocus" | "onBlur" | "onKeyDown" | "label" | "placeholder" | "size" | "variant" | "disabled" | "action" | "autoFocus" | "fullWidth" | "error" | "inputProps" | "inputRef" | "required" | "InputProps" | "helperText" | "gutterBottom" | "onClear" | "clearBtn" | "clearButtonProps" | "validate" | "PopoverProps" | "ActionSymbol"> & import("../../../../../foundation").RcClassesProps<"popover" | "popoverPaper">>;
@@ -8,6 +8,12 @@ declare type GetFormattedTimeOption = {
8
8
  minute: number;
9
9
  period: TIME_SYSTEM_TEXT;
10
10
  };
11
+ /**
12
+ * get formatted time hh:mm
13
+ * @param option `{hour, min, period}`
14
+ * @param isTwelveHourSystem boolean
15
+ * @returns `hh:mm AM` or `hh:mm PM` or `hh:mm`
16
+ */
11
17
  declare const getFormattedTime: ({ hour, minute, period }: GetFormattedTimeOption, isTwelveHourSystem?: boolean | undefined) => string;
12
18
  declare const HALF_DAY_HOURS = 12;
13
19
  declare const HOUR_MINUTES = 60;
@@ -17,16 +23,34 @@ declare const twelveHourSystemSource: number[];
17
23
  declare const twentyFourHourSystemSource: number[];
18
24
  declare const minuteSource: number[];
19
25
  declare const lastMinute = 45;
26
+ /**
27
+ * hour and minute timestamp
28
+ */
20
29
  declare const getTimestampFromDate: (date: Date) => number;
30
+ /**
31
+ * hour and minute number
32
+ */
21
33
  declare const getHourAndMinute: (times?: number | undefined) => {
22
34
  hour: number;
23
35
  minute: number;
24
36
  };
37
+ /**
38
+ * timestamp to date
39
+ */
25
40
  declare const timestampToDate: (times?: number | undefined) => Date;
41
+ /**
42
+ * get timestamp from date or timestamp
43
+ */
26
44
  declare function getTimestamp(nowTime: number | Date): number;
45
+ /**
46
+ * hour and min object to timestamp
47
+ */
27
48
  declare const getTimestampFromHourAndMin: (option: {
28
49
  hour: number;
29
50
  minute: number;
30
51
  }) => number;
52
+ /**
53
+ * get period, `PM` or `AM`
54
+ */
31
55
  declare function getPeriod(currHour: number): TIME_SYSTEM_TEXT;
32
56
  export { getFormattedTime, getHourAndMinute, getPeriod, getTimestamp, getTimestampFromDate, getTimestampFromHourAndMin, HALF_DAY_HOURS, HOUR_MINUTES, lastMinute, minuteSource, ONE_HOUR, pad, parseNumber, parseNumberToString, TIME_GAP, timestampToDate, twelveHourSystemSource, twentyFourHourSystemSource, };
@@ -23,6 +23,12 @@ var pad = function (num, size) {
23
23
  return s;
24
24
  };
25
25
  exports.pad = pad;
26
+ /**
27
+ * get formatted time hh:mm
28
+ * @param option `{hour, min, period}`
29
+ * @param isTwelveHourSystem boolean
30
+ * @returns `hh:mm AM` or `hh:mm PM` or `hh:mm`
31
+ */
26
32
  var getFormattedTime = function (_a, isTwelveHourSystem) {
27
33
  var hour = _a.hour, minute = _a.minute, period = _a.period;
28
34
  var formattedHour = parseNumberToString(hour, isTwelveHourSystem);
@@ -59,10 +65,16 @@ var minuteSource = [0, 15, 30, 45];
59
65
  exports.minuteSource = minuteSource;
60
66
  var lastMinute = 45;
61
67
  exports.lastMinute = lastMinute;
68
+ /**
69
+ * hour and minute timestamp
70
+ */
62
71
  var getTimestampFromDate = function (date) {
63
72
  return date.getHours() * ONE_HOUR + date.getMinutes() * ONE_MINUTE;
64
73
  };
65
74
  exports.getTimestampFromDate = getTimestampFromDate;
75
+ /**
76
+ * hour and minute number
77
+ */
66
78
  var getHourAndMinute = function (times) {
67
79
  if (!times) {
68
80
  return {
@@ -78,6 +90,9 @@ var getHourAndMinute = function (times) {
78
90
  };
79
91
  };
80
92
  exports.getHourAndMinute = getHourAndMinute;
93
+ /**
94
+ * timestamp to date
95
+ */
81
96
  var timestampToDate = function (times) {
82
97
  var _a = getHourAndMinute(times), hour = _a.hour, minute = _a.minute;
83
98
  var date = new Date();
@@ -85,14 +100,23 @@ var timestampToDate = function (times) {
85
100
  return date;
86
101
  };
87
102
  exports.timestampToDate = timestampToDate;
103
+ /**
104
+ * get timestamp from date or timestamp
105
+ */
88
106
  function getTimestamp(nowTime) {
89
107
  return nowTime instanceof Date ? getTimestampFromDate(nowTime) : nowTime;
90
108
  }
91
109
  exports.getTimestamp = getTimestamp;
110
+ /**
111
+ * hour and min object to timestamp
112
+ */
92
113
  var getTimestampFromHourAndMin = function (option) {
93
114
  return option.hour * ONE_HOUR + option.minute * ONE_MINUTE;
94
115
  };
95
116
  exports.getTimestampFromHourAndMin = getTimestampFromHourAndMin;
117
+ /**
118
+ * get period, `PM` or `AM`
119
+ */
96
120
  function getPeriod(currHour) {
97
121
  return currHour >= HALF_DAY_HOURS ? constant_1.TIME_SYSTEM_TEXT.PM : constant_1.TIME_SYSTEM_TEXT.AM;
98
122
  }
@@ -0,0 +1,30 @@
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 };
@@ -0,0 +1,49 @@
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;
@@ -0,0 +1,12 @@
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 };
@@ -0,0 +1,17 @@
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;
@@ -0,0 +1,3 @@
1
+ export * from './Toast';
2
+ export * from './ToastContainer';
3
+ export { ToastContainerStyle } from './styles';
@@ -0,0 +1,7 @@
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;
@@ -0,0 +1,4 @@
1
+ import { RcThemedStyled } from '../../../foundation';
2
+ import { RcToastProps } from '../Toast';
3
+ export declare const ToastStyle: RcThemedStyled<RcToastProps, any>;
4
+ export declare const ToastContainerStyle: RcThemedStyled<RcToastProps, any>;
@@ -0,0 +1,12 @@
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;
@@ -0,0 +1 @@
1
+ export * from './ToastStyle';
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./ToastStyle"), exports);
@@ -0,0 +1 @@
1
+ export declare const RC_TOAST_CONTAINER_ID = "RC_TOAST_CONTAINER";
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RC_TOAST_CONTAINER_ID = 'RC_TOAST_CONTAINER';
@@ -0,0 +1 @@
1
+ export * from './ToastUtils';
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./ToastUtils"), exports);
@@ -12,6 +12,7 @@ import { StyledPickerPopperWrap } from './styles';
12
12
  import { ToggleText } from './ToggleText';
13
13
  import { getFormattedTime, getHourAndMinute, getNumberPickerBoundary, getPeriod, getRangeBoundary, getTimestamp, getTimestampFromDate, HALF_DAY_HOURS, minuteSource, parseNumberToString, RcTimePickerClasses, TIME_GAP, timestampToDate, twelveHourSystemSource, twentyFourHourSystemSource, } from './utils';
14
14
  var _RcTimePicker = forwardRef(function (inProps, ref) {
15
+ var _a;
15
16
  var props = useThemeProps({ props: inProps, name: 'RcTimePicker' });
16
17
  var isTwelveHourSystem = props.isTwelveHourSystem, value = props.value, times = props.times, onChange = props.onChange, disabled = props.disabled, dateMode = props.dateMode, min = props.min, max = props.max, size = props.size, onKeyDown = props.onKeyDown, onClear = props.onClear, HourPickerProps = props.HourPickerProps, MinutePickerProps = props.MinutePickerProps, PeriodToggleProps = props.PeriodToggleProps, PopoverPropsProp = props.PopoverProps, InputPropsProp = props.InputProps, classes = props.classes, rest = __rest(props, ["isTwelveHourSystem", "value", "times", "onChange", "disabled", "dateMode", "min", "max", "size", "onKeyDown", "onClear", "HourPickerProps", "MinutePickerProps", "PeriodToggleProps", "PopoverProps", "InputProps", "classes"]);
17
18
  // TODO: when props remove clear that code, not use forwardRef for Jupiter test issue
@@ -28,8 +29,8 @@ var _RcTimePicker = forwardRef(function (inProps, ref) {
28
29
  var minuteRef = useRef(null);
29
30
  var periodRef = useRef(null);
30
31
  var textFiledValueRef = useRef('');
31
- var _a = __read(useState('none'), 2), selectionShowType = _a[0], setSelectionType = _a[1];
32
- var nowTime = value || times;
32
+ var _b = __read(useState('none'), 2), selectionShowType = _b[0], setSelectionType = _b[1];
33
+ var nowTime = (_a = value) !== null && _a !== void 0 ? _a : times;
33
34
  var isHaveValue = nowTime !== undefined;
34
35
  var isDateMode = nowTime instanceof Date || dateMode;
35
36
  var currentTimestamp = getTimestamp(nowTime);
@@ -63,8 +64,8 @@ var _RcTimePicker = forwardRef(function (inProps, ref) {
63
64
  onChange(toValue);
64
65
  }
65
66
  else {
66
- // * when time is zero emit undefined
67
- onChange(toValue ? getTimestampFromDate(toValue) : undefined);
67
+ // * when time is zero emit null
68
+ onChange(toValue ? getTimestampFromDate(toValue) : null);
68
69
  }
69
70
  }
70
71
  }, [isDateMode, onChange]);
@@ -110,22 +111,8 @@ var _RcTimePicker = forwardRef(function (inProps, ref) {
110
111
  return updateTime({ period: period });
111
112
  });
112
113
  var handleClear = useEventCallback(function (e) {
113
- var time;
114
- // if that is date format, we couldn't reset to undefined, that will miss that date information.
115
- if (isDateMode) {
116
- if (range.min.date) {
117
- time = getEmitInitDate();
118
- time.setHours(range.min.hour);
119
- time.setMinutes(range.min.minute);
120
- }
121
- else {
122
- time = new Date(nowTime);
123
- time.setHours(0);
124
- time.setMinutes(0);
125
- }
126
- }
127
114
  onClear === null || onClear === void 0 ? void 0 : onClear(e);
128
- handleChange(time);
115
+ handleChange(null);
129
116
  });
130
117
  var handleSelectionViewClick = useEventCallback(function (toValue) {
131
118
  updateTime(isHourView ? { hour: toValue } : { minute: toValue });
@@ -135,7 +122,9 @@ var _RcTimePicker = forwardRef(function (inProps, ref) {
135
122
  var _a;
136
123
  (_a = actionRef.current) === null || _a === void 0 ? void 0 : _a.close();
137
124
  });
138
- var setHourSelectionShow = useEventCallback(function () { return setSelectionType('hour'); });
125
+ var setHourSelectionShow = useEventCallback(function () {
126
+ return setSelectionType('hour');
127
+ });
139
128
  var setMinuteSelectionShow = useEventCallback(function () {
140
129
  return setSelectionType('minute');
141
130
  });
@@ -318,5 +307,10 @@ RcTimePicker.defaultProps = {
318
307
  },
319
308
  };
320
309
  RcTimePicker.displayName = 'RcTimePicker';
321
- export { RcTimePicker };
310
+ /**
311
+ * when `dateMode={true}` that onChange will return `Date` object,
312
+ * otherwise return timestamp `number`
313
+ */
314
+ var ExportType = RcTimePicker;
315
+ export { ExportType as RcTimePicker };
322
316
  var templateObject_1;
@@ -2,3 +2,4 @@ export * from './NumberPicker';
2
2
  export * from './ToggleText';
3
3
  export * from './SelectionView';
4
4
  export * from './TimePicker';
5
+ export * from './utils';
@@ -18,6 +18,12 @@ var pad = function (num, size) {
18
18
  }
19
19
  return s;
20
20
  };
21
+ /**
22
+ * get formatted time hh:mm
23
+ * @param option `{hour, min, period}`
24
+ * @param isTwelveHourSystem boolean
25
+ * @returns `hh:mm AM` or `hh:mm PM` or `hh:mm`
26
+ */
21
27
  var getFormattedTime = function (_a, isTwelveHourSystem) {
22
28
  var hour = _a.hour, minute = _a.minute, period = _a.period;
23
29
  var formattedHour = parseNumberToString(hour, isTwelveHourSystem);
@@ -45,9 +51,15 @@ var twelveHourSystemSource = buildConsecutiveNumberToArray(0, 11);
45
51
  var twentyFourHourSystemSource = buildConsecutiveNumberToArray(0, 23);
46
52
  var minuteSource = [0, 15, 30, 45];
47
53
  var lastMinute = 45;
54
+ /**
55
+ * hour and minute timestamp
56
+ */
48
57
  var getTimestampFromDate = function (date) {
49
58
  return date.getHours() * ONE_HOUR + date.getMinutes() * ONE_MINUTE;
50
59
  };
60
+ /**
61
+ * hour and minute number
62
+ */
51
63
  var getHourAndMinute = function (times) {
52
64
  if (!times) {
53
65
  return {
@@ -62,18 +74,30 @@ var getHourAndMinute = function (times) {
62
74
  minute: Math.floor(minute / ONE_MINUTE),
63
75
  };
64
76
  };
77
+ /**
78
+ * timestamp to date
79
+ */
65
80
  var timestampToDate = function (times) {
66
81
  var _a = getHourAndMinute(times), hour = _a.hour, minute = _a.minute;
67
82
  var date = new Date();
68
83
  date.setHours(hour, minute, 0, 0);
69
84
  return date;
70
85
  };
86
+ /**
87
+ * get timestamp from date or timestamp
88
+ */
71
89
  function getTimestamp(nowTime) {
72
90
  return nowTime instanceof Date ? getTimestampFromDate(nowTime) : nowTime;
73
91
  }
92
+ /**
93
+ * hour and min object to timestamp
94
+ */
74
95
  var getTimestampFromHourAndMin = function (option) {
75
96
  return option.hour * ONE_HOUR + option.minute * ONE_MINUTE;
76
97
  };
98
+ /**
99
+ * get period, `PM` or `AM`
100
+ */
77
101
  function getPeriod(currHour) {
78
102
  return currHour >= HALF_DAY_HOURS ? TIME_SYSTEM_TEXT.PM : TIME_SYSTEM_TEXT.AM;
79
103
  }
@@ -0,0 +1,47 @@
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;
@@ -0,0 +1,15 @@
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;
@@ -0,0 +1,3 @@
1
+ export * from './Toast';
2
+ export * from './ToastContainer';
3
+ export { ToastContainerStyle } from './styles';
@@ -0,0 +1,10 @@
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;
@@ -0,0 +1 @@
1
+ export * from './ToastStyle';
@@ -0,0 +1 @@
1
+ export var RC_TOAST_CONTAINER_ID = 'RC_TOAST_CONTAINER';
@@ -0,0 +1 @@
1
+ export * from './ToastUtils';
@@ -1,9 +1,10 @@
1
- import { __assign } from "tslib";
1
+ import { __assign, __rest } from "tslib";
2
2
  import 'focus-visible';
3
3
  import React from 'react';
4
- import { MuiThemeProvider, StylesProvider } from '@material-ui/core/styles';
4
+ import { MuiThemeProvider, StylesProvider, createGenerateClassName, } from '@material-ui/core/styles';
5
5
  import { ThemeProvider as StyledThemeProvider, useTheme, } from '../styled-components';
6
6
  import createTheme from './createTheme';
7
+ import { useResultRef } from '../hooks';
7
8
  /**
8
9
  * sub theme provider,
9
10
  * that will use when you want use multiple theme in one app
@@ -24,6 +25,18 @@ export var RcSubThemeProvider = function (_a) {
24
25
  * each app should always have one `RcThemeProvider` at root,
25
26
  * if you need multiple, use `RcSubThemeProvider` inside that `RcThemeProvider` */
26
27
  export var RcThemeProvider = function (props) {
27
- return (React.createElement(StylesProvider, { injectFirst: true },
28
- React.createElement(RcSubThemeProvider, __assign({}, props))));
28
+ var prefixGlobalClass = props.prefixGlobalClass, rest = __rest(props, ["prefixGlobalClass"]);
29
+ // cannot pass `generateClassName: undefine`
30
+ // otherwise global class will be random
31
+ var stylesProviderProps = useResultRef(function () {
32
+ return prefixGlobalClass
33
+ ? {
34
+ generateClassName: createGenerateClassName({
35
+ seed: prefixGlobalClass,
36
+ }),
37
+ }
38
+ : {};
39
+ });
40
+ return (React.createElement(StylesProvider, __assign({ injectFirst: true }, stylesProviderProps.current),
41
+ React.createElement(RcSubThemeProvider, __assign({}, rest))));
29
42
  };
@@ -5,5 +5,6 @@
5
5
  "modal": 1300,
6
6
  "snackbar": 1400,
7
7
  "speedDial": 1050,
8
- "tooltip": 1500
8
+ "tooltip": 1500,
9
+ "toast": 3000
9
10
  }
@@ -5,6 +5,8 @@ export declare type RcThemeProviderProps = {
5
5
  /** custom theme */
6
6
  theme?: RcThemeInput;
7
7
  children?: ReactNode;
8
+ /** prefix the mui global class */
9
+ prefixGlobalClass?: string;
8
10
  };
9
11
  /**
10
12
  * sub theme provider,
@@ -6,6 +6,7 @@ var react_1 = tslib_1.__importDefault(require("react"));
6
6
  var styles_1 = require("@material-ui/core/styles");
7
7
  var styled_components_1 = require("../styled-components");
8
8
  var createTheme_1 = tslib_1.__importDefault(require("./createTheme"));
9
+ var hooks_1 = require("../hooks");
9
10
  /**
10
11
  * sub theme provider,
11
12
  * that will use when you want use multiple theme in one app
@@ -26,6 +27,18 @@ exports.RcSubThemeProvider = function (_a) {
26
27
  * each app should always have one `RcThemeProvider` at root,
27
28
  * if you need multiple, use `RcSubThemeProvider` inside that `RcThemeProvider` */
28
29
  exports.RcThemeProvider = function (props) {
29
- return (react_1.default.createElement(styles_1.StylesProvider, { injectFirst: true },
30
- react_1.default.createElement(exports.RcSubThemeProvider, tslib_1.__assign({}, props))));
30
+ var prefixGlobalClass = props.prefixGlobalClass, rest = tslib_1.__rest(props, ["prefixGlobalClass"]);
31
+ // cannot pass `generateClassName: undefine`
32
+ // otherwise global class will be random
33
+ var stylesProviderProps = hooks_1.useResultRef(function () {
34
+ return prefixGlobalClass
35
+ ? {
36
+ generateClassName: styles_1.createGenerateClassName({
37
+ seed: prefixGlobalClass,
38
+ }),
39
+ }
40
+ : {};
41
+ });
42
+ return (react_1.default.createElement(styles_1.StylesProvider, tslib_1.__assign({ injectFirst: true }, stylesProviderProps.current),
43
+ react_1.default.createElement(exports.RcSubThemeProvider, tslib_1.__assign({}, rest))));
31
44
  };
@@ -5,5 +5,6 @@
5
5
  "modal": 1300,
6
6
  "snackbar": 1400,
7
7
  "speedDial": 1050,
8
- "tooltip": 1500
8
+ "tooltip": 1500,
9
+ "toast": 3000
9
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ringcentral/juno",
3
- "version": "1.12.4-beta.5835-b8c3da57",
3
+ "version": "1.12.4-beta.5841-601f173e",
4
4
  "main": "./index.js",
5
5
  "module": "./es6/index.js",
6
6
  "author": "RingCentral",