@ringcentral/juno 2.35.2 → 2.35.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/Badge/Badge.d.ts +1 -1
- package/components/Badge/Badge.js +24 -25
- package/components/Badge/DotBadge.d.ts +4 -0
- package/components/Badge/DotBadge.js +34 -0
- package/components/Badge/styles/BadgeStyle.js +9 -2
- package/components/Forms/Picker/DatePicker/Calendar.js +9 -6
- package/components/Forms/Picker/DatePicker/utils/DatePickerUtils.d.ts +2 -2
- package/components/Forms/Picker/DatePicker/utils/DatePickerUtils.js +6 -4
- package/es6/components/Badge/Badge.js +23 -24
- package/es6/components/Badge/DotBadge.js +32 -0
- package/es6/components/Badge/styles/BadgeStyle.js +9 -2
- package/es6/components/Forms/Picker/DatePicker/Calendar.js +10 -7
- package/es6/components/Forms/Picker/DatePicker/utils/DatePickerUtils.js +6 -4
- package/package.json +1 -1
|
@@ -30,7 +30,7 @@ declare type RcBadgeProps = {
|
|
|
30
30
|
/** when mode is dot, that addition dotProps */
|
|
31
31
|
dotProps?: RcPresenceProps;
|
|
32
32
|
} & RcBaseProps<ComponentProps<typeof MuiBadge>, 'overlap' | 'color'>;
|
|
33
|
-
declare const RcBadge: import("styled-components").StyledComponentClass<Pick<RcBadgeProps, "key" | "className" | "color" | "id" | "lang" | "max" | "style" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "slot" | "title" | "classes" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "variant" | "innerRef" | "component" | "invisible" | "anchorOrigin" | "overlap" | "badgeContent" | "showZero" | "borderColor" | "textColor" | "dotComponent" | "dotProps"> & React.RefAttributes<any>, import("../../foundation").RcTheme, Pick<Pick<RcBadgeProps, "key" | "className" | "color" | "id" | "lang" | "max" | "style" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "slot" | "title" | "classes" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "variant" | "innerRef" | "component" | "invisible" | "anchorOrigin" | "overlap" | "badgeContent" | "showZero" | "borderColor" | "textColor" | "dotComponent" | "dotProps"> & React.RefAttributes<any>, "ref" | "key" | "className" | "color" | "id" | "lang" | "max" | "style" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "slot" | "title" | "classes" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "variant" | "innerRef" | "component" | "invisible" | "anchorOrigin" | "overlap" | "badgeContent" | "showZero" | "borderColor" | "textColor" | "dotComponent" | "dotProps"> & {
|
|
33
|
+
declare const RcBadge: import("styled-components").StyledComponentClass<Pick<RcBadgeProps, "key" | "className" | "color" | "id" | "lang" | "max" | "style" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "slot" | "title" | "classes" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "variant" | "innerRef" | "component" | "invisible" | "anchorOrigin" | "overlap" | "badgeContent" | "showZero" | "borderColor" | "textColor" | "dotProps" | "dotComponent"> & React.RefAttributes<any>, import("../../foundation").RcTheme, Pick<Pick<RcBadgeProps, "key" | "className" | "color" | "id" | "lang" | "max" | "style" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "slot" | "title" | "classes" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "variant" | "innerRef" | "component" | "invisible" | "anchorOrigin" | "overlap" | "badgeContent" | "showZero" | "borderColor" | "textColor" | "dotProps" | "dotComponent"> & React.RefAttributes<any>, "ref" | "key" | "className" | "color" | "id" | "lang" | "max" | "style" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "slot" | "title" | "classes" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "variant" | "innerRef" | "component" | "invisible" | "anchorOrigin" | "overlap" | "badgeContent" | "showZero" | "borderColor" | "textColor" | "dotProps" | "dotComponent"> & {
|
|
34
34
|
theme?: import("../../foundation").RcTheme | undefined;
|
|
35
35
|
}>;
|
|
36
36
|
export { RcBadge };
|
|
@@ -2,16 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
var tslib_1 = require("tslib");
|
|
4
4
|
var react_1 = tslib_1.__importStar(require("react"));
|
|
5
|
-
var clsx_1 = tslib_1.__importDefault(require("clsx"));
|
|
6
5
|
var Badge_1 = tslib_1.__importDefault(require("@material-ui/core/Badge"));
|
|
7
|
-
var utils_1 = require("@material-ui/core/utils");
|
|
8
6
|
var foundation_1 = require("../../foundation");
|
|
9
|
-
var Box_1 = require("../Box");
|
|
10
7
|
var styles_1 = require("./styles");
|
|
11
|
-
var
|
|
8
|
+
var utils_1 = require("./utils");
|
|
9
|
+
var DotBadge_1 = require("./DotBadge");
|
|
12
10
|
var _RcBadge = react_1.forwardRef(function (inProps, ref) {
|
|
13
11
|
var props = foundation_1.useThemeProps({ props: inProps, name: 'RcBadge' });
|
|
14
|
-
var classesProp = props.classes, children = props.children, overlap = props.overlap, color = props.color, variant = props.variant, textColor = props.textColor, anchorOrigin = props.anchorOrigin, borderColor = props.borderColor, component = props.component, dotComponent = props.dotComponent, dotProps = props.dotProps, rest = tslib_1.__rest(props, ["classes", "children", "overlap", "color", "variant", "textColor", "anchorOrigin", "borderColor", "component", "dotComponent", "dotProps"]);
|
|
12
|
+
var classesProp = props.classes, children = props.children, overlap = props.overlap, color = props.color, variant = props.variant, textColor = props.textColor, anchorOrigin = props.anchorOrigin, borderColor = props.borderColor, component = props.component, dotComponent = props.dotComponent, dotProps = props.dotProps, invisible = props.invisible, badgeContent = props.badgeContent, _a = props.showZero, showZero = _a === void 0 ? false : _a, rest = tslib_1.__rest(props, ["classes", "children", "overlap", "color", "variant", "textColor", "anchorOrigin", "borderColor", "component", "dotComponent", "dotProps", "invisible", "badgeContent", "showZero"]);
|
|
15
13
|
// * should never change overlap
|
|
16
14
|
if (process.env.NODE_ENV !== 'production') {
|
|
17
15
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
@@ -33,27 +31,28 @@ var _RcBadge = react_1.forwardRef(function (inProps, ref) {
|
|
|
33
31
|
// overlap will never change in production mode
|
|
34
32
|
if (isRound) {
|
|
35
33
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
36
|
-
|
|
34
|
+
utils_1.useRoundBadgeOffset(innerRef);
|
|
37
35
|
}
|
|
38
|
-
var classes = react_1.useMemo(function () { return foundation_1.combineClasses(
|
|
39
|
-
var
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
36
|
+
var classes = react_1.useMemo(function () { return foundation_1.combineClasses(utils_1.RcBadgeClasses, classesProp); }, [classesProp]);
|
|
37
|
+
var renderBadge = function (customComponent) {
|
|
38
|
+
if (customComponent === void 0) { customComponent = component; }
|
|
39
|
+
return (react_1.default.createElement(Badge_1.default, tslib_1.__assign({}, rest, { variant: variant, invisible: invisible, badgeContent: badgeContent, showZero: showZero, anchorOrigin: anchorOrigin, component: customComponent,
|
|
40
|
+
// TODO: that as any for ts v3.8 still not support pick variable out of if check
|
|
41
|
+
overlap: notPassOverlapToMui ? overlap : undefined, ref: badgeRef, classes: classes }), children));
|
|
42
|
+
};
|
|
43
|
+
if (isDot) {
|
|
44
|
+
return (react_1.default.createElement(DotBadge_1.DotBadgeContext.Provider, { value: {
|
|
45
|
+
anchorOrigin: anchorOrigin,
|
|
46
|
+
dotComponent: dotComponent,
|
|
47
|
+
dotProps: dotProps,
|
|
48
|
+
invisible: invisible,
|
|
49
|
+
overlap: overlap,
|
|
50
|
+
children: children,
|
|
51
|
+
badgeContent: badgeContent,
|
|
52
|
+
showZero: showZero,
|
|
53
|
+
} }, renderBadge(DotBadge_1.DotBadge)));
|
|
54
|
+
}
|
|
55
|
+
return renderBadge(component);
|
|
57
56
|
});
|
|
58
57
|
var RcBadge = foundation_1.styled(_RcBadge)(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), styles_1.BadgeStyle);
|
|
59
58
|
exports.RcBadge = RcBadge;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { RcBadgeProps } from './Badge';
|
|
3
|
+
export declare const DotBadgeContext: React.Context<Pick<RcBadgeProps, "children" | "invisible" | "anchorOrigin" | "overlap" | "badgeContent" | "showZero" | "dotProps" | "dotComponent">>;
|
|
4
|
+
export declare const DotBadge: React.ForwardRefExoticComponent<Pick<any, string | number | symbol> & React.RefAttributes<any>>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var tslib_1 = require("tslib");
|
|
4
|
+
var utils_1 = require("@material-ui/core/utils");
|
|
5
|
+
var clsx_1 = tslib_1.__importDefault(require("clsx"));
|
|
6
|
+
var react_1 = tslib_1.__importStar(require("react"));
|
|
7
|
+
var foundation_1 = require("../../foundation");
|
|
8
|
+
var Box_1 = require("../Box");
|
|
9
|
+
var styles_1 = require("./styles");
|
|
10
|
+
var utils_2 = require("./utils");
|
|
11
|
+
exports.DotBadgeContext = react_1.createContext({});
|
|
12
|
+
exports.DotBadge = react_1.forwardRef(function (_a, ref) {
|
|
13
|
+
var _b;
|
|
14
|
+
var OmitChildren = _a.children, rest = tslib_1.__rest(_a, ["children"]);
|
|
15
|
+
var _c = react_1.useContext(exports.DotBadgeContext), anchorOrigin = _c.anchorOrigin, dotComponent = _c.dotComponent, dotProps = _c.dotProps, invisibleProp = _c.invisible, badgeContent = _c.badgeContent, showZero = _c.showZero, overlap = _c.overlap, children = _c.children;
|
|
16
|
+
// sync with mui
|
|
17
|
+
var invisible = invisibleProp;
|
|
18
|
+
if (typeof invisibleProp !== 'boolean' && badgeContent === 0 && !showZero) {
|
|
19
|
+
invisible = true;
|
|
20
|
+
}
|
|
21
|
+
var _d = anchorOrigin, horizontal = _d.horizontal, vertical = _d.vertical;
|
|
22
|
+
var addClassName = "MuiBadge-anchorOrigin" + utils_1.capitalize(vertical) + utils_1.capitalize(horizontal) + utils_1.capitalize(overlap);
|
|
23
|
+
var DotComponent = dotComponent !== null && dotComponent !== void 0 ? dotComponent : styles_1.DefaultDotComponent;
|
|
24
|
+
var applyDotProps = foundation_1.combineProps({
|
|
25
|
+
className: clsx_1.default(addClassName, utils_2.RcBadgeClasses.badge, (_b = {},
|
|
26
|
+
_b[utils_2.RcBadgeClasses.invisible] = invisible,
|
|
27
|
+
_b['MuiBadge-invisible'] = invisible,
|
|
28
|
+
_b)),
|
|
29
|
+
}, dotProps);
|
|
30
|
+
return (react_1.default.createElement("div", tslib_1.__assign({}, rest, { ref: ref }),
|
|
31
|
+
children,
|
|
32
|
+
dotComponent !== null && (react_1.default.createElement(Box_1.RcBox, { position: "absolute", zIndex: "1", clone: true },
|
|
33
|
+
react_1.default.createElement(DotComponent, tslib_1.__assign({}, applyDotProps))))));
|
|
34
|
+
});
|
|
@@ -13,10 +13,17 @@ exports.BadgeStyle = function (_a) {
|
|
|
13
13
|
var manyChar = (['number', 'string'].includes(typeof badgeContent) &&
|
|
14
14
|
("" + badgeContent).length !== 1) ||
|
|
15
15
|
(max && max > 0 && +badgeContent > max);
|
|
16
|
-
return foundation_1.css(templateObject_5 || (templateObject_5 = tslib_1.__makeTemplateObject(["\n .", " {\n margin: ", ";\n color: ", ";\n background-color: ", ";\n\n ", ";\n\n ", "\n\n ", "\n }\n "], ["\n .", " {\n margin: ", ";\n color: ", ";\n background-color: ", ";\n
|
|
16
|
+
return foundation_1.css(templateObject_5 || (templateObject_5 = tslib_1.__makeTemplateObject(["\n .", " {\n margin: ", ";\n color: ", ";\n background-color: ", ";\n transition: ", ";\n\n ", ";\n\n ", "\n\n ", "\n }\n "], ["\n .", " {\n margin: ", ";\n color: ", ";\n background-color: ", ";\n transition: ",
|
|
17
|
+
";\n\n ",
|
|
17
18
|
";\n\n ",
|
|
18
19
|
"\n\n ",
|
|
19
|
-
"\n }\n "])), utils_1.RcBadgeClasses.badge, overlapRound && "var(" + utils_1.roundBadgeMarginKey + ")", foundation_1.getParsePaletteColor(textColor, null, false), foundation_1.getParsePaletteColor(color, null, false),
|
|
20
|
+
"\n }\n "])), utils_1.RcBadgeClasses.badge, overlapRound && "var(" + utils_1.roundBadgeMarginKey + ")", foundation_1.getParsePaletteColor(textColor, null, false), foundation_1.getParsePaletteColor(color, null, false), function (_a) {
|
|
21
|
+
var theme = _a.theme;
|
|
22
|
+
return theme.transitions.create('transform', {
|
|
23
|
+
easing: theme.transitions.easing.easeInOut,
|
|
24
|
+
duration: theme.transitions.duration.enteringScreen,
|
|
25
|
+
});
|
|
26
|
+
}, borderColor && foundation_1.css(templateObject_2 || (templateObject_2 = tslib_1.__makeTemplateObject(["\n ", "\n "], ["\n ",
|
|
20
27
|
"\n "])), isStandard
|
|
21
28
|
? foundation_1.fakeBorder({ color: borderCurrColor, radius: 'round' })
|
|
22
29
|
: foundation_1.css(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n border-color: ", ";\n "], ["\n border-color: ", ";\n "])), borderCurrColor)), isStandard && foundation_1.css(templateObject_3 || (templateObject_3 = tslib_1.__makeTemplateObject(["\n height: 18px;\n min-width: 18px;\n padding: ", ";\n "], ["\n height: 18px;\n min-width: 18px;\n padding: ", ";\n "])), !manyChar && 0), overlapNone && foundation_1.css(templateObject_4 || (templateObject_4 = tslib_1.__makeTemplateObject(["\n position: unset;\n transform: unset;\n\n &.", " {\n transform: scale(0);\n }\n "], ["\n position: unset;\n transform: unset;\n\n &.", " {\n transform: scale(0);\n }\n "])), utils_1.RcBadgeClasses.invisible));
|
|
@@ -20,6 +20,7 @@ var Calendar = react_1.forwardRef(function (_a, ref) {
|
|
|
20
20
|
var calendarRef = react_1.useRef(null);
|
|
21
21
|
var previousFocusDate = foundation_1.usePrevious(function () { return focusedDate; });
|
|
22
22
|
var previousView = foundation_1.usePrevious(function () { return view; });
|
|
23
|
+
var doc = foundation_1.useRcPortalWindowContext().document;
|
|
23
24
|
var weeks = react_1.useRef([]);
|
|
24
25
|
// * `getWeekdays` not set locale, need set locale before get
|
|
25
26
|
dayjs_1.default.locale(utils.locale);
|
|
@@ -152,19 +153,21 @@ var Calendar = react_1.forwardRef(function (_a, ref) {
|
|
|
152
153
|
// same month anchor switch
|
|
153
154
|
react_1.useLayoutEffect(function () {
|
|
154
155
|
if (sameMonthDate && !viewChange) {
|
|
155
|
-
utils_2.focusDayElement();
|
|
156
|
+
utils_2.focusDayElement(doc);
|
|
156
157
|
}
|
|
157
158
|
});
|
|
158
159
|
// when view change and current is day also focusDay again
|
|
159
160
|
react_1.useLayoutEffect(function () {
|
|
160
161
|
if (previousView && view === 'day' && viewChange) {
|
|
161
|
-
utils_2.focusDayElement();
|
|
162
|
+
utils_2.focusDayElement(doc);
|
|
162
163
|
}
|
|
163
|
-
}, [previousView, view, viewChange]);
|
|
164
|
+
}, [previousView, view, viewChange, doc]);
|
|
164
165
|
react_1.useLayoutEffect(function () {
|
|
165
|
-
utils_2.focusDayElement();
|
|
166
|
-
calendarRef.current =
|
|
167
|
-
var unsubscribe = utils_1.transitionendSubscriber(calendarRef.current,
|
|
166
|
+
utils_2.focusDayElement(doc);
|
|
167
|
+
calendarRef.current = doc.querySelector("." + utils_2.RcDatePickerClasses.popover + " ." + utils_2.RcDatePickerClasses.popoverPaper);
|
|
168
|
+
var unsubscribe = utils_1.transitionendSubscriber(calendarRef.current, function (event) {
|
|
169
|
+
utils_2.onTransitionEnd(event, doc);
|
|
170
|
+
});
|
|
168
171
|
return function () {
|
|
169
172
|
unsubscribe();
|
|
170
173
|
};
|
|
@@ -13,12 +13,12 @@ declare type DatePickerVolume = {
|
|
|
13
13
|
};
|
|
14
14
|
export declare const RcDatePickerSizes: UnitMap<RcDatePickerSize, DatePickerVolume>;
|
|
15
15
|
export declare const RcDatePickerIconWidths: UnitMap<RcDatePickerSize, string>;
|
|
16
|
-
export declare const focusDayElement: () => void;
|
|
16
|
+
export declare const focusDayElement: (doc?: Document) => void;
|
|
17
17
|
export declare const isSameYearAndMonth: ({ source, comparing }: {
|
|
18
18
|
source: MuiPickersDate;
|
|
19
19
|
comparing: MuiPickersDate;
|
|
20
20
|
}, utils: import("@date-io/core/IUtils").IUtils<MuiPickersDate>) => boolean;
|
|
21
|
-
export declare const onTransitionEnd: (event: any) => void;
|
|
21
|
+
export declare const onTransitionEnd: (event: any, doc?: Document) => void;
|
|
22
22
|
declare type ValidateDateInRange = {
|
|
23
23
|
now: MuiPickersDate;
|
|
24
24
|
} & Pick<CalendarProps, 'dateRange' | 'disableFuture' | 'disablePast'>;
|
|
@@ -33,8 +33,9 @@ exports.RcDatePickerIconWidths = {
|
|
|
33
33
|
small: '18px',
|
|
34
34
|
medium: '28px',
|
|
35
35
|
};
|
|
36
|
-
exports.focusDayElement = function () {
|
|
37
|
-
|
|
36
|
+
exports.focusDayElement = function (doc) {
|
|
37
|
+
if (doc === void 0) { doc = document; }
|
|
38
|
+
var elm = doc.querySelector('[data-picker-focused]');
|
|
38
39
|
elm === null || elm === void 0 ? void 0 : elm.focus();
|
|
39
40
|
};
|
|
40
41
|
exports.isSameYearAndMonth = function (_a, utils) {
|
|
@@ -48,8 +49,9 @@ exports.isSameYearAndMonth = function (_a, utils) {
|
|
|
48
49
|
var comparingYear = utils.getYear(comparing);
|
|
49
50
|
return thisMonth === comparingMonth && thisYear === comparingYear;
|
|
50
51
|
};
|
|
51
|
-
exports.onTransitionEnd = function (event) {
|
|
52
|
-
|
|
52
|
+
exports.onTransitionEnd = function (event, doc) {
|
|
53
|
+
if (doc === void 0) { doc = document; }
|
|
54
|
+
var activeElm = doc.activeElement;
|
|
53
55
|
if (event.target.dataset['transitionTag'] &&
|
|
54
56
|
// * check is not focus on other thing, like click next month
|
|
55
57
|
activeElm.dataset['pickerAction'] !== 'true') {
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { __assign, __makeTemplateObject, __rest } from "tslib";
|
|
2
2
|
import React, { forwardRef, useMemo, useRef, } from 'react';
|
|
3
|
-
import clsx from 'clsx';
|
|
4
3
|
import MuiBadge from '@material-ui/core/Badge';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { RcBox } from '../Box';
|
|
8
|
-
import { BadgeStyle, DefaultDotComponent } from './styles';
|
|
4
|
+
import { combineClasses, logInDev, styled, useChange, useForkRef, useThemeProps, } from '../../foundation';
|
|
5
|
+
import { BadgeStyle } from './styles';
|
|
9
6
|
import { RcBadgeClasses, useRoundBadgeOffset } from './utils';
|
|
7
|
+
import { DotBadgeContext, DotBadge } from './DotBadge';
|
|
10
8
|
var _RcBadge = forwardRef(function (inProps, ref) {
|
|
11
9
|
var props = useThemeProps({ props: inProps, name: 'RcBadge' });
|
|
12
|
-
var classesProp = props.classes, children = props.children, overlap = props.overlap, color = props.color, variant = props.variant, textColor = props.textColor, anchorOrigin = props.anchorOrigin, borderColor = props.borderColor, component = props.component, dotComponent = props.dotComponent, dotProps = props.dotProps, rest = __rest(props, ["classes", "children", "overlap", "color", "variant", "textColor", "anchorOrigin", "borderColor", "component", "dotComponent", "dotProps"]);
|
|
10
|
+
var classesProp = props.classes, children = props.children, overlap = props.overlap, color = props.color, variant = props.variant, textColor = props.textColor, anchorOrigin = props.anchorOrigin, borderColor = props.borderColor, component = props.component, dotComponent = props.dotComponent, dotProps = props.dotProps, invisible = props.invisible, badgeContent = props.badgeContent, _a = props.showZero, showZero = _a === void 0 ? false : _a, rest = __rest(props, ["classes", "children", "overlap", "color", "variant", "textColor", "anchorOrigin", "borderColor", "component", "dotComponent", "dotProps", "invisible", "badgeContent", "showZero"]);
|
|
13
11
|
// * should never change overlap
|
|
14
12
|
if (process.env.NODE_ENV !== 'production') {
|
|
15
13
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
@@ -34,24 +32,25 @@ var _RcBadge = forwardRef(function (inProps, ref) {
|
|
|
34
32
|
useRoundBadgeOffset(innerRef);
|
|
35
33
|
}
|
|
36
34
|
var classes = useMemo(function () { return combineClasses(RcBadgeClasses, classesProp); }, [classesProp]);
|
|
37
|
-
var
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
35
|
+
var renderBadge = function (customComponent) {
|
|
36
|
+
if (customComponent === void 0) { customComponent = component; }
|
|
37
|
+
return (React.createElement(MuiBadge, __assign({}, rest, { variant: variant, invisible: invisible, badgeContent: badgeContent, showZero: showZero, anchorOrigin: anchorOrigin, component: customComponent,
|
|
38
|
+
// TODO: that as any for ts v3.8 still not support pick variable out of if check
|
|
39
|
+
overlap: notPassOverlapToMui ? overlap : undefined, ref: badgeRef, classes: classes }), children));
|
|
40
|
+
};
|
|
41
|
+
if (isDot) {
|
|
42
|
+
return (React.createElement(DotBadgeContext.Provider, { value: {
|
|
43
|
+
anchorOrigin: anchorOrigin,
|
|
44
|
+
dotComponent: dotComponent,
|
|
45
|
+
dotProps: dotProps,
|
|
46
|
+
invisible: invisible,
|
|
47
|
+
overlap: overlap,
|
|
48
|
+
children: children,
|
|
49
|
+
badgeContent: badgeContent,
|
|
50
|
+
showZero: showZero,
|
|
51
|
+
} }, renderBadge(DotBadge)));
|
|
52
|
+
}
|
|
53
|
+
return renderBadge(component);
|
|
55
54
|
});
|
|
56
55
|
var RcBadge = styled(_RcBadge)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), BadgeStyle);
|
|
57
56
|
RcBadge.defaultProps = {
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { __assign, __rest } from "tslib";
|
|
2
|
+
import { capitalize } from '@material-ui/core/utils';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import React, { createContext, forwardRef, useContext } from 'react';
|
|
5
|
+
import { combineProps } from '../../foundation';
|
|
6
|
+
import { RcBox } from '../Box';
|
|
7
|
+
import { DefaultDotComponent } from './styles';
|
|
8
|
+
import { RcBadgeClasses } from './utils';
|
|
9
|
+
export var DotBadgeContext = createContext({});
|
|
10
|
+
export var DotBadge = forwardRef(function (_a, ref) {
|
|
11
|
+
var _b;
|
|
12
|
+
var OmitChildren = _a.children, rest = __rest(_a, ["children"]);
|
|
13
|
+
var _c = useContext(DotBadgeContext), anchorOrigin = _c.anchorOrigin, dotComponent = _c.dotComponent, dotProps = _c.dotProps, invisibleProp = _c.invisible, badgeContent = _c.badgeContent, showZero = _c.showZero, overlap = _c.overlap, children = _c.children;
|
|
14
|
+
// sync with mui
|
|
15
|
+
var invisible = invisibleProp;
|
|
16
|
+
if (typeof invisibleProp !== 'boolean' && badgeContent === 0 && !showZero) {
|
|
17
|
+
invisible = true;
|
|
18
|
+
}
|
|
19
|
+
var _d = anchorOrigin, horizontal = _d.horizontal, vertical = _d.vertical;
|
|
20
|
+
var addClassName = "MuiBadge-anchorOrigin" + capitalize(vertical) + capitalize(horizontal) + capitalize(overlap);
|
|
21
|
+
var DotComponent = dotComponent !== null && dotComponent !== void 0 ? dotComponent : DefaultDotComponent;
|
|
22
|
+
var applyDotProps = combineProps({
|
|
23
|
+
className: clsx(addClassName, RcBadgeClasses.badge, (_b = {},
|
|
24
|
+
_b[RcBadgeClasses.invisible] = invisible,
|
|
25
|
+
_b['MuiBadge-invisible'] = invisible,
|
|
26
|
+
_b)),
|
|
27
|
+
}, dotProps);
|
|
28
|
+
return (React.createElement("div", __assign({}, rest, { ref: ref }),
|
|
29
|
+
children,
|
|
30
|
+
dotComponent !== null && (React.createElement(RcBox, { position: "absolute", zIndex: "1", clone: true },
|
|
31
|
+
React.createElement(DotComponent, __assign({}, applyDotProps))))));
|
|
32
|
+
});
|
|
@@ -11,10 +11,17 @@ export var BadgeStyle = function (_a) {
|
|
|
11
11
|
var manyChar = (['number', 'string'].includes(typeof badgeContent) &&
|
|
12
12
|
("" + badgeContent).length !== 1) ||
|
|
13
13
|
(max && max > 0 && +badgeContent > max);
|
|
14
|
-
return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n .", " {\n margin: ", ";\n color: ", ";\n background-color: ", ";\n\n ", ";\n\n ", "\n\n ", "\n }\n "], ["\n .", " {\n margin: ", ";\n color: ", ";\n background-color: ", ";\n
|
|
14
|
+
return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n .", " {\n margin: ", ";\n color: ", ";\n background-color: ", ";\n transition: ", ";\n\n ", ";\n\n ", "\n\n ", "\n }\n "], ["\n .", " {\n margin: ", ";\n color: ", ";\n background-color: ", ";\n transition: ",
|
|
15
|
+
";\n\n ",
|
|
15
16
|
";\n\n ",
|
|
16
17
|
"\n\n ",
|
|
17
|
-
"\n }\n "])), RcBadgeClasses.badge, overlapRound && "var(" + roundBadgeMarginKey + ")", getParsePaletteColor(textColor, null, false), getParsePaletteColor(color, null, false),
|
|
18
|
+
"\n }\n "])), RcBadgeClasses.badge, overlapRound && "var(" + roundBadgeMarginKey + ")", getParsePaletteColor(textColor, null, false), getParsePaletteColor(color, null, false), function (_a) {
|
|
19
|
+
var theme = _a.theme;
|
|
20
|
+
return theme.transitions.create('transform', {
|
|
21
|
+
easing: theme.transitions.easing.easeInOut,
|
|
22
|
+
duration: theme.transitions.duration.enteringScreen,
|
|
23
|
+
});
|
|
24
|
+
}, borderColor && css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n "], ["\n ",
|
|
18
25
|
"\n "])), isStandard
|
|
19
26
|
? fakeBorder({ color: borderCurrColor, radius: 'round' })
|
|
20
27
|
: css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border-color: ", ";\n "], ["\n border-color: ", ";\n "])), borderCurrColor)), isStandard && css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n height: 18px;\n min-width: 18px;\n padding: ", ";\n "], ["\n height: 18px;\n min-width: 18px;\n padding: ", ";\n "])), !manyChar && 0), overlapNone && css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n position: unset;\n transform: unset;\n\n &.", " {\n transform: scale(0);\n }\n "], ["\n position: unset;\n transform: unset;\n\n &.", " {\n transform: scale(0);\n }\n "])), RcBadgeClasses.invisible));
|
|
@@ -4,7 +4,7 @@ import dayjs from 'dayjs';
|
|
|
4
4
|
import MuiCircularProgress from '@material-ui/core/CircularProgress';
|
|
5
5
|
import { useUtils as useMuiUtils } from '@material-ui/pickers';
|
|
6
6
|
import { runKeyHandler } from '@material-ui/pickers/_shared/hooks/useKeyDown';
|
|
7
|
-
import { pick, useEventCallback, usePrevious, useResultRef, } from '../../../../foundation';
|
|
7
|
+
import { pick, useEventCallback, usePrevious, useRcPortalWindowContext, useResultRef, } from '../../../../foundation';
|
|
8
8
|
import { RcButton } from '../../../Buttons';
|
|
9
9
|
import { transitionendSubscriber } from '../../../Transitions/utils';
|
|
10
10
|
import { DatePickerHeader, } from './DatePickerHeader';
|
|
@@ -18,6 +18,7 @@ var Calendar = forwardRef(function (_a, ref) {
|
|
|
18
18
|
var calendarRef = useRef(null);
|
|
19
19
|
var previousFocusDate = usePrevious(function () { return focusedDate; });
|
|
20
20
|
var previousView = usePrevious(function () { return view; });
|
|
21
|
+
var doc = useRcPortalWindowContext().document;
|
|
21
22
|
var weeks = useRef([]);
|
|
22
23
|
// * `getWeekdays` not set locale, need set locale before get
|
|
23
24
|
dayjs.locale(utils.locale);
|
|
@@ -150,19 +151,21 @@ var Calendar = forwardRef(function (_a, ref) {
|
|
|
150
151
|
// same month anchor switch
|
|
151
152
|
useLayoutEffect(function () {
|
|
152
153
|
if (sameMonthDate && !viewChange) {
|
|
153
|
-
focusDayElement();
|
|
154
|
+
focusDayElement(doc);
|
|
154
155
|
}
|
|
155
156
|
});
|
|
156
157
|
// when view change and current is day also focusDay again
|
|
157
158
|
useLayoutEffect(function () {
|
|
158
159
|
if (previousView && view === 'day' && viewChange) {
|
|
159
|
-
focusDayElement();
|
|
160
|
+
focusDayElement(doc);
|
|
160
161
|
}
|
|
161
|
-
}, [previousView, view, viewChange]);
|
|
162
|
+
}, [previousView, view, viewChange, doc]);
|
|
162
163
|
useLayoutEffect(function () {
|
|
163
|
-
focusDayElement();
|
|
164
|
-
calendarRef.current =
|
|
165
|
-
var unsubscribe = transitionendSubscriber(calendarRef.current,
|
|
164
|
+
focusDayElement(doc);
|
|
165
|
+
calendarRef.current = doc.querySelector("." + RcDatePickerClasses.popover + " ." + RcDatePickerClasses.popoverPaper);
|
|
166
|
+
var unsubscribe = transitionendSubscriber(calendarRef.current, function (event) {
|
|
167
|
+
onTransitionEnd(event, doc);
|
|
168
|
+
});
|
|
166
169
|
return function () {
|
|
167
170
|
unsubscribe();
|
|
168
171
|
};
|
|
@@ -31,8 +31,9 @@ export var RcDatePickerIconWidths = {
|
|
|
31
31
|
small: '18px',
|
|
32
32
|
medium: '28px',
|
|
33
33
|
};
|
|
34
|
-
export var focusDayElement = function () {
|
|
35
|
-
|
|
34
|
+
export var focusDayElement = function (doc) {
|
|
35
|
+
if (doc === void 0) { doc = document; }
|
|
36
|
+
var elm = doc.querySelector('[data-picker-focused]');
|
|
36
37
|
elm === null || elm === void 0 ? void 0 : elm.focus();
|
|
37
38
|
};
|
|
38
39
|
export var isSameYearAndMonth = function (_a, utils) {
|
|
@@ -46,8 +47,9 @@ export var isSameYearAndMonth = function (_a, utils) {
|
|
|
46
47
|
var comparingYear = utils.getYear(comparing);
|
|
47
48
|
return thisMonth === comparingMonth && thisYear === comparingYear;
|
|
48
49
|
};
|
|
49
|
-
export var onTransitionEnd = function (event) {
|
|
50
|
-
|
|
50
|
+
export var onTransitionEnd = function (event, doc) {
|
|
51
|
+
if (doc === void 0) { doc = document; }
|
|
52
|
+
var activeElm = doc.activeElement;
|
|
51
53
|
if (event.target.dataset['transitionTag'] &&
|
|
52
54
|
// * check is not focus on other thing, like click next month
|
|
53
55
|
activeElm.dataset['pickerAction'] !== 'true') {
|