@ringcentral/juno 2.31.0 → 2.33.0
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.js +1 -2
- package/components/Badge/styles/BadgeStyle.d.ts +3 -0
- package/components/Badge/styles/BadgeStyle.js +2 -1
- package/components/Forms/Picker/TimePicker/TimePicker.d.ts +4 -1
- package/components/Forms/Picker/TimePicker/TimePicker.js +12 -5
- package/components/Forms/Picker/TimePicker/ToggleText.d.ts +16 -1
- package/components/Forms/Picker/TimePicker/ToggleText.js +2 -2
- package/components/Forms/Picker/TimePicker/types.d.ts +4 -0
- package/components/Forms/Picker/TimePicker/types.js +2 -0
- package/components/Forms/Picker/TimePicker/utils/TimePickerHelper.d.ts +5 -1
- package/components/Forms/Picker/TimePicker/utils/TimePickerHelper.js +2 -2
- package/components/Presence/Presence.d.ts +11 -1
- package/components/Presence/Presence.js +22 -8
- package/components/Presence/assets/Check.d.ts +3 -0
- package/components/Presence/assets/Check.js +9 -0
- package/components/Presence/assets/Default.d.ts +3 -0
- package/components/Presence/assets/Default.js +9 -0
- package/components/Presence/assets/Dnd.d.ts +3 -0
- package/components/Presence/assets/Dnd.js +9 -0
- package/components/Presence/assets/Offline.d.ts +3 -0
- package/components/Presence/assets/Offline.js +9 -0
- package/components/Presence/assets/Unattended.js +1 -1
- package/components/Presence/assets/index.d.ts +4 -1
- package/components/Presence/assets/index.js +8 -2
- package/components/Presence/styles/StyledPresence.d.ts +5 -18
- package/components/Presence/styles/StyledPresence.js +18 -12
- package/components/Presence/styles/index.d.ts +0 -1
- package/components/Presence/styles/index.js +0 -1
- package/components/Presence/utils/RcPresenceUtils.d.ts +1 -2
- package/components/Presence/utils/RcPresenceUtils.js +17 -22
- package/components/Tabs/TabList/TabList.js +8 -6
- package/components/Tabs/Tabs/MoreMenuTab/MoreMenuTab.d.ts +1 -1
- package/components/Tabs/Tabs/MoreMenuTab/MoreMenuTab.js +14 -4
- package/components/VirtualizedMenu/VirtualizedMenu.js +14 -3
- package/components/VirtualizedMenu/useNextFrame.d.ts +1 -0
- package/components/VirtualizedMenu/useNextFrame.js +22 -0
- package/es6/components/Badge/Badge.js +2 -3
- package/es6/components/Badge/styles/BadgeStyle.js +3 -2
- package/es6/components/Forms/Picker/TimePicker/TimePicker.js +12 -5
- package/es6/components/Forms/Picker/TimePicker/ToggleText.js +2 -2
- package/es6/components/Forms/Picker/TimePicker/types.js +0 -0
- package/es6/components/Forms/Picker/TimePicker/utils/TimePickerHelper.js +2 -2
- package/es6/components/Presence/Presence.js +26 -12
- package/es6/components/Presence/assets/Check.js +7 -0
- package/es6/components/Presence/assets/Default.js +7 -0
- package/es6/components/Presence/assets/Dnd.js +7 -0
- package/es6/components/Presence/assets/Offline.js +7 -0
- package/es6/components/Presence/assets/Unattended.js +1 -1
- package/es6/components/Presence/assets/index.js +4 -1
- package/es6/components/Presence/styles/StyledPresence.js +20 -14
- package/es6/components/Presence/styles/index.js +0 -1
- package/es6/components/Presence/utils/RcPresenceUtils.js +17 -22
- package/es6/components/Tabs/TabList/TabList.js +8 -6
- package/es6/components/Tabs/Tabs/MoreMenuTab/MoreMenuTab.js +14 -4
- package/es6/components/VirtualizedMenu/VirtualizedMenu.js +14 -3
- package/es6/components/VirtualizedMenu/useNextFrame.js +20 -0
- package/es6/foundation/styles/focusRing.js +2 -2
- package/foundation/styles/focusRing.js +2 -2
- package/package.json +1 -1
- package/components/Presence/assets/Attended.d.ts +0 -3
- package/components/Presence/assets/Attended.js +0 -9
- package/components/Presence/styles/StyledDND.d.ts +0 -13
- package/components/Presence/styles/StyledDND.js +0 -12
- package/es6/components/Presence/assets/Attended.js +0 -7
- package/es6/components/Presence/styles/StyledDND.js +0 -10
|
@@ -1,20 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
color?: (string & Record<never, never>) | "action.grayDark" | "action.grayLight" | "action.primary" | "avatar.ash" | "avatar.blueberry" | "avatar.brass" | "avatar.global" | "avatar.gold" | "avatar.lake" | "avatar.oasis" | "avatar.pear" | "avatar.persimmon" | "avatar.sage" | "avatar.tomato" | "content.brand" | "danger.b01" | "danger.b02" | "danger.b03" | "danger.b04" | "danger.f01" | "danger.f02" | "danger.f11" | "dialHeader.avatarBg" | "dialHeader.avatarIcon" | "dialHeader.bg" | "dialHeader.focusBorder" | "dialHeader.icon" | "dialHeader.text" | "dialHeader.textHint" | "disabled.b01" | "disabled.f01" | "disabled.f02" | "header.bgLeft" | "header.bgOverlay" | "header.bgOverlayDisabled" | "header.bgRight" | "header.border" | "header.divider" | "header.fabBg" | "header.fabIcon" | "header.focusBorder" | "header.icon" | "header.iconDisabled" | "header.text" | "header.textHint" | "highContrast" | "highlight.b01" | "highlight.b02" | "highlight.b03" | "highlight.f01" | "highlight.f02" | "informative.b01" | "informative.f01" | "informative.f02" | "interactive.b01" | "interactive.b02" | "interactive.f01" | "label.black02" | "label.blue01" | "label.blue02" | "label.green01" | "label.green02" | "label.orange01" | "label.orange02" | "label.purple01" | "label.purple02" | "label.red01" | "label.red02" | "label.teal01" | "label.teal02" | "label.yellow01" | "label.yellow02" | "nav.b01" | "nav.b02" | "nav.bookmark" | "nav.ctlDefault" | "nav.ctlSelected" | "nav.f01" | "nav.f02" | "nav.f03" | "nav.f04" | "nav.iconDefault" | "nav.iconSelected" | "nav.line" | "nav.mention" | "nav.menuBg" | "nav.menuText" | "neutral.b01" | "neutral.b02" | "neutral.b03" | "neutral.b04" | "neutral.b05" | "neutral.b06" | "neutral.elevation" | "neutral.f01" | "neutral.f02" | "neutral.f03" | "neutral.f04" | "neutral.f05" | "neutral.f06" | "neutral.f07" | "neutral.f11" | "neutral.l01" | "neutral.l02" | "neutral.l03" | "neutral.l04" | "neutral.transparent" | "presence.available" | "presence.busy" | "presence.invisible" | "subAction" | "success.b01" | "success.b02" | "success.b03" | "success.b04" | "success.b05" | "success.f01" | "success.f02" | "success.f11" | "tab.default" | "tab.selected" | "umi.bg" | "umi.mentioned" | "umi.text" | "warning.b01" | "warning.b02" | "warning.b03" | "warning.f01" | "warning.f02" | "warning.f11" | string[] | import("../../../foundation/styles/newPalette").PaletteReturnType | undefined;
|
|
7
|
-
} & Pick<React.HTMLAttributes<HTMLDivElement>, "className" | "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" | "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" | "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"> & React.RefAttributes<any>>;
|
|
8
|
-
export declare const StyledPresence: import("styled-components").StyledComponentClass<{
|
|
9
|
-
type?: "notReady" | "unavailable" | "available" | "onCall" | "DND" | "inMeeting" | "busy" | "offline" | "attended" | "unAttended" | undefined;
|
|
10
|
-
size?: "small" | "xxsmall" | "xsmall" | "medium" | "large" | "xlarge" | undefined;
|
|
11
|
-
borderSize?: "small" | "xxsmall" | "xsmall" | "medium" | "large" | "xlarge" | undefined;
|
|
12
|
-
color?: (string & Record<never, never>) | "action.grayDark" | "action.grayLight" | "action.primary" | "avatar.ash" | "avatar.blueberry" | "avatar.brass" | "avatar.global" | "avatar.gold" | "avatar.lake" | "avatar.oasis" | "avatar.pear" | "avatar.persimmon" | "avatar.sage" | "avatar.tomato" | "content.brand" | "danger.b01" | "danger.b02" | "danger.b03" | "danger.b04" | "danger.f01" | "danger.f02" | "danger.f11" | "dialHeader.avatarBg" | "dialHeader.avatarIcon" | "dialHeader.bg" | "dialHeader.focusBorder" | "dialHeader.icon" | "dialHeader.text" | "dialHeader.textHint" | "disabled.b01" | "disabled.f01" | "disabled.f02" | "header.bgLeft" | "header.bgOverlay" | "header.bgOverlayDisabled" | "header.bgRight" | "header.border" | "header.divider" | "header.fabBg" | "header.fabIcon" | "header.focusBorder" | "header.icon" | "header.iconDisabled" | "header.text" | "header.textHint" | "highContrast" | "highlight.b01" | "highlight.b02" | "highlight.b03" | "highlight.f01" | "highlight.f02" | "informative.b01" | "informative.f01" | "informative.f02" | "interactive.b01" | "interactive.b02" | "interactive.f01" | "label.black02" | "label.blue01" | "label.blue02" | "label.green01" | "label.green02" | "label.orange01" | "label.orange02" | "label.purple01" | "label.purple02" | "label.red01" | "label.red02" | "label.teal01" | "label.teal02" | "label.yellow01" | "label.yellow02" | "nav.b01" | "nav.b02" | "nav.bookmark" | "nav.ctlDefault" | "nav.ctlSelected" | "nav.f01" | "nav.f02" | "nav.f03" | "nav.f04" | "nav.iconDefault" | "nav.iconSelected" | "nav.line" | "nav.mention" | "nav.menuBg" | "nav.menuText" | "neutral.b01" | "neutral.b02" | "neutral.b03" | "neutral.b04" | "neutral.b05" | "neutral.b06" | "neutral.elevation" | "neutral.f01" | "neutral.f02" | "neutral.f03" | "neutral.f04" | "neutral.f05" | "neutral.f06" | "neutral.f07" | "neutral.f11" | "neutral.l01" | "neutral.l02" | "neutral.l03" | "neutral.l04" | "neutral.transparent" | "presence.available" | "presence.busy" | "presence.invisible" | "subAction" | "success.b01" | "success.b02" | "success.b03" | "success.b04" | "success.b05" | "success.f01" | "success.f02" | "success.f11" | "tab.default" | "tab.selected" | "umi.bg" | "umi.mentioned" | "umi.text" | "warning.b01" | "warning.b02" | "warning.b03" | "warning.f01" | "warning.f02" | "warning.f11" | string[] | import("../../../foundation/styles/newPalette").PaletteReturnType | undefined;
|
|
13
|
-
} & Pick<React.HTMLAttributes<HTMLDivElement>, "className" | "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" | "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" | "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"> & React.RefAttributes<any>, import("../../../foundation").RcTheme, Pick<{
|
|
14
|
-
type?: "notReady" | "unavailable" | "available" | "onCall" | "DND" | "inMeeting" | "busy" | "offline" | "attended" | "unAttended" | undefined;
|
|
15
|
-
size?: "small" | "xxsmall" | "xsmall" | "medium" | "large" | "xlarge" | undefined;
|
|
16
|
-
borderSize?: "small" | "xxsmall" | "xsmall" | "medium" | "large" | "xlarge" | undefined;
|
|
17
|
-
color?: (string & Record<never, never>) | "action.grayDark" | "action.grayLight" | "action.primary" | "avatar.ash" | "avatar.blueberry" | "avatar.brass" | "avatar.global" | "avatar.gold" | "avatar.lake" | "avatar.oasis" | "avatar.pear" | "avatar.persimmon" | "avatar.sage" | "avatar.tomato" | "content.brand" | "danger.b01" | "danger.b02" | "danger.b03" | "danger.b04" | "danger.f01" | "danger.f02" | "danger.f11" | "dialHeader.avatarBg" | "dialHeader.avatarIcon" | "dialHeader.bg" | "dialHeader.focusBorder" | "dialHeader.icon" | "dialHeader.text" | "dialHeader.textHint" | "disabled.b01" | "disabled.f01" | "disabled.f02" | "header.bgLeft" | "header.bgOverlay" | "header.bgOverlayDisabled" | "header.bgRight" | "header.border" | "header.divider" | "header.fabBg" | "header.fabIcon" | "header.focusBorder" | "header.icon" | "header.iconDisabled" | "header.text" | "header.textHint" | "highContrast" | "highlight.b01" | "highlight.b02" | "highlight.b03" | "highlight.f01" | "highlight.f02" | "informative.b01" | "informative.f01" | "informative.f02" | "interactive.b01" | "interactive.b02" | "interactive.f01" | "label.black02" | "label.blue01" | "label.blue02" | "label.green01" | "label.green02" | "label.orange01" | "label.orange02" | "label.purple01" | "label.purple02" | "label.red01" | "label.red02" | "label.teal01" | "label.teal02" | "label.yellow01" | "label.yellow02" | "nav.b01" | "nav.b02" | "nav.bookmark" | "nav.ctlDefault" | "nav.ctlSelected" | "nav.f01" | "nav.f02" | "nav.f03" | "nav.f04" | "nav.iconDefault" | "nav.iconSelected" | "nav.line" | "nav.mention" | "nav.menuBg" | "nav.menuText" | "neutral.b01" | "neutral.b02" | "neutral.b03" | "neutral.b04" | "neutral.b05" | "neutral.b06" | "neutral.elevation" | "neutral.f01" | "neutral.f02" | "neutral.f03" | "neutral.f04" | "neutral.f05" | "neutral.f06" | "neutral.f07" | "neutral.f11" | "neutral.l01" | "neutral.l02" | "neutral.l03" | "neutral.l04" | "neutral.transparent" | "presence.available" | "presence.busy" | "presence.invisible" | "subAction" | "success.b01" | "success.b02" | "success.b03" | "success.b04" | "success.b05" | "success.f01" | "success.f02" | "success.f11" | "tab.default" | "tab.selected" | "umi.bg" | "umi.mentioned" | "umi.text" | "warning.b01" | "warning.b02" | "warning.b03" | "warning.f01" | "warning.f02" | "warning.f11" | string[] | import("../../../foundation/styles/newPalette").PaletteReturnType | undefined;
|
|
18
|
-
} & Pick<React.HTMLAttributes<HTMLDivElement>, "className" | "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" | "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" | "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"> & 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" | "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" | "borderSize"> & {
|
|
2
|
+
import { PresenceSizeProps } from '../Presence';
|
|
3
|
+
export declare const PresenceContainer: import("styled-components").StyledComponentClass<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & PresenceSizeProps, import("../../../foundation").RcTheme, React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & PresenceSizeProps>;
|
|
4
|
+
export declare const _StyledPresence: React.ForwardRefExoticComponent<PresenceSizeProps & React.RefAttributes<any>>;
|
|
5
|
+
export declare const StyledPresence: import("styled-components").StyledComponentClass<PresenceSizeProps & React.RefAttributes<any>, import("../../../foundation").RcTheme, Pick<PresenceSizeProps & React.RefAttributes<any>, "ref" | "key" | "color" | "type" | "iconSizeValue" | "borderSizeValue"> & {
|
|
19
6
|
theme?: import("../../../foundation").RcTheme | undefined;
|
|
20
|
-
}>;
|
|
7
|
+
} & PresenceSizeProps>;
|
|
@@ -5,20 +5,26 @@ var react_1 = tslib_1.__importStar(require("react"));
|
|
|
5
5
|
var foundation_1 = require("../../../foundation");
|
|
6
6
|
var Icon_1 = require("../../Icon");
|
|
7
7
|
var utils_1 = require("../utils");
|
|
8
|
+
exports.PresenceContainer = foundation_1.styled.div(templateObject_2 || (templateObject_2 = tslib_1.__makeTemplateObject(["\n ", "\n"], ["\n ",
|
|
9
|
+
"\n"])), function (_a) {
|
|
10
|
+
var iconSizeValue = _a.iconSizeValue, borderSizeValue = _a.borderSizeValue;
|
|
11
|
+
return foundation_1.css(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n display: flex;\n justify-content: center;\n width: ", "px;\n height: ", "px;\n padding: ", "px;\n "], ["\n display: flex;\n justify-content: center;\n width: ", "px;\n height: ", "px;\n padding: ", "px;\n "])), iconSizeValue, iconSizeValue, borderSizeValue);
|
|
12
|
+
});
|
|
8
13
|
exports._StyledPresence = react_1.forwardRef(function (_a, ref) {
|
|
9
|
-
var color = _a.color,
|
|
10
|
-
return
|
|
14
|
+
var color = _a.color, type = _a.type, rest = tslib_1.__rest(_a, ["color", "type"]);
|
|
15
|
+
return react_1.default.createElement("div", tslib_1.__assign({ ref: ref }, rest));
|
|
11
16
|
});
|
|
12
|
-
exports.StyledPresence = foundation_1.styled(exports._StyledPresence)(
|
|
17
|
+
exports.StyledPresence = foundation_1.styled(exports._StyledPresence)(templateObject_4 || (templateObject_4 = tslib_1.__makeTemplateObject(["\n display: flex;\n flex-shrink: 0;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n box-sizing: content-box;\n\n ", ";\n"], ["\n display: flex;\n flex-shrink: 0;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n box-sizing: content-box;\n\n ",
|
|
13
18
|
";\n"])), function (_a) {
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var scaleRate = availableSize[1];
|
|
19
|
-
return foundation_1.css(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n width: ", ";\n height: ", ";\n border: ", "px solid\n ", ";\n background: ", ";\n\n ", " {\n transform: ", ";\n\n svg {\n width: ", ";\n height: ", ";\n }\n }\n "], ["\n width: ", ";\n height: ", ";\n border: ", "px solid\n ", ";\n background: ",
|
|
20
|
-
";\n\n ", " {\n transform: ", ";\n\n svg {\n width: ", ";\n height: ", ";\n }\n }\n "])), sizeValue, sizeValue, utils_1.RcPresenceSizes[borderSize || size][1], foundation_1.palette2('neutral', 'l01'), color
|
|
19
|
+
var type = _a.type, iconSizeValue = _a.iconSizeValue, borderSizeValue = _a.borderSizeValue, color = _a.color;
|
|
20
|
+
return foundation_1.css(templateObject_3 || (templateObject_3 = tslib_1.__makeTemplateObject(["\n width: ", "px;\n height: ", "px;\n background: ", ";\n margin: ", "px;\n ", ";\n ", " {\n svg {\n width: ", "px;\n height: ", "px;\n }\n }\n "], ["\n width: ", "px;\n height: ", "px;\n background: ",
|
|
21
|
+
";\n margin: ", "px;\n ",
|
|
22
|
+
";\n ", " {\n svg {\n width: ", "px;\n height: ", "px;\n }\n }\n "])), iconSizeValue, iconSizeValue, color
|
|
21
23
|
? foundation_1.getParsePaletteColor(color)
|
|
22
|
-
: utils_1.
|
|
24
|
+
: utils_1.RcPresenceBackgroundColors[type] || foundation_1.palette2('neutral', 'l01'), borderSizeValue, foundation_1.fakeBorder({
|
|
25
|
+
inset: false,
|
|
26
|
+
color: foundation_1.palette2('neutral', 'l01'),
|
|
27
|
+
size: borderSizeValue,
|
|
28
|
+
}), Icon_1.RcIcon, iconSizeValue, iconSizeValue);
|
|
23
29
|
});
|
|
24
|
-
var templateObject_1, templateObject_2;
|
|
30
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { UnitMap } from '../../../foundation';
|
|
2
2
|
import { RcPresenceSize, RcPresenceType } from '../Presence';
|
|
3
3
|
export declare const RcPresenceSizes: UnitMap<RcPresenceSize, [number, number]>;
|
|
4
|
-
export declare const RcPresenceInnerIconSizes: UnitMap<RcPresenceSize, [number, number]>;
|
|
5
|
-
export declare const RcPresenceAvailableIconSizes: UnitMap<RcPresenceSize, [number, number | undefined]>;
|
|
6
4
|
export declare const RcPresenceColors: UnitMap<RcPresenceType>;
|
|
5
|
+
export declare const RcPresenceBackgroundColors: UnitMap<RcPresenceType>;
|
|
@@ -6,28 +6,9 @@ exports.RcPresenceSizes = {
|
|
|
6
6
|
xxsmall: [8, 1],
|
|
7
7
|
xsmall: [8, 2],
|
|
8
8
|
small: [10, 2],
|
|
9
|
-
medium: [
|
|
10
|
-
large: [
|
|
11
|
-
xlarge: [
|
|
12
|
-
};
|
|
13
|
-
// width, height
|
|
14
|
-
exports.RcPresenceInnerIconSizes = {
|
|
15
|
-
xxsmall: [4, 2],
|
|
16
|
-
xsmall: [6, 2],
|
|
17
|
-
small: [6, 2],
|
|
18
|
-
medium: [6, 2],
|
|
19
|
-
large: [10, 4],
|
|
20
|
-
xlarge: [14, 4],
|
|
21
|
-
};
|
|
22
|
-
// use scale rate to make that be odd value
|
|
23
|
-
// width, scaleRate
|
|
24
|
-
exports.RcPresenceAvailableIconSizes = {
|
|
25
|
-
xxsmall: [10, 0.5],
|
|
26
|
-
xsmall: [10, 0.5],
|
|
27
|
-
small: [6, undefined],
|
|
28
|
-
medium: [6, undefined],
|
|
29
|
-
large: [10, undefined],
|
|
30
|
-
xlarge: [12, undefined],
|
|
9
|
+
medium: [12, 2],
|
|
10
|
+
large: [16, 2],
|
|
11
|
+
xlarge: [20, 2],
|
|
31
12
|
};
|
|
32
13
|
var presenceOn = foundation_1.palette2('presence', 'available');
|
|
33
14
|
var presenceBusy = foundation_1.palette2('presence', 'busy');
|
|
@@ -47,3 +28,17 @@ exports.RcPresenceColors = {
|
|
|
47
28
|
notReady: presenceOff,
|
|
48
29
|
offline: presenceOff,
|
|
49
30
|
};
|
|
31
|
+
exports.RcPresenceBackgroundColors = {
|
|
32
|
+
// positive
|
|
33
|
+
available: '#FFFFFF',
|
|
34
|
+
attended: '#FFFFFF',
|
|
35
|
+
// negative
|
|
36
|
+
unAttended: '#FFFFFF',
|
|
37
|
+
onCall: '#FFFFFF',
|
|
38
|
+
inMeeting: '#FFFFFF',
|
|
39
|
+
DND: '#FFFFFF',
|
|
40
|
+
busy: '#FFFFFF',
|
|
41
|
+
unavailable: foundation_1.palette2('neutral', 'l01'),
|
|
42
|
+
notReady: foundation_1.palette2('neutral', 'l01'),
|
|
43
|
+
offline: foundation_1.palette2('neutral', 'l01'),
|
|
44
|
+
};
|
|
@@ -20,13 +20,15 @@ var _RcTabList = react_1.forwardRef(function (inProps, ref) {
|
|
|
20
20
|
if (context === null) {
|
|
21
21
|
throw new TypeError('[RcTabList] No TabContext provided');
|
|
22
22
|
}
|
|
23
|
-
var children = react_1.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
var children = react_1.useMemo(function () {
|
|
24
|
+
return react_1.default.Children.map(childrenProp, function (child) {
|
|
25
|
+
var value = child.props.value;
|
|
26
|
+
return react_1.default.cloneElement(child, {
|
|
27
|
+
'aria-controls': TabContext_1.getPanelId(context, value),
|
|
28
|
+
id: TabContext_1.getTabId(context, value),
|
|
29
|
+
});
|
|
28
30
|
});
|
|
29
|
-
});
|
|
31
|
+
}, [childrenProp, context]);
|
|
30
32
|
return (react_1.default.createElement(Tabs_1.RcTabs, tslib_1.__assign({}, rest, { ref: ref, classes: classes, value: context.value }), children));
|
|
31
33
|
});
|
|
32
34
|
var RcTabList = foundation_1.styled(_RcTabList)(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), styles_1.TabListStyle);
|
|
@@ -13,7 +13,7 @@ declare type MoreMenuTabProps = {
|
|
|
13
13
|
TooltipProps?: RcBaseProps<RcTooltipProps, 'children'>;
|
|
14
14
|
onChange?: (event: React.MouseEvent<HTMLLIElement>, value: any) => void;
|
|
15
15
|
orientation?: 'horizontal' | 'vertical';
|
|
16
|
-
MoreIcon?: JSX.Element;
|
|
16
|
+
MoreIcon?: JSX.Element | ((isMenuOpen: boolean) => JSX.Element);
|
|
17
17
|
} & RcBaseProps<RcTabProps, 'onChange'>;
|
|
18
18
|
declare const DEFAULT_MORE_MENU_TAB_LABEL = "more_menu_tab";
|
|
19
19
|
/** inner component */
|
|
@@ -18,13 +18,23 @@ var _MoreMenuTab = react_1.forwardRef(function (props, ref) {
|
|
|
18
18
|
var menuIdProp = MenuProps.id, onMenuCloseProp = MenuProps.onClose, MenuPropsRest = tslib_1.__rest(MenuProps, ["id", "onClose"]);
|
|
19
19
|
var menuId = foundation_1.useId(menuIdProp);
|
|
20
20
|
var _c = tslib_1.__read(react_1.useState(null), 2), anchorEl = _c[0], setAnchorEl = _c[1];
|
|
21
|
-
var
|
|
22
|
-
|
|
21
|
+
var open = Boolean(anchorEl);
|
|
22
|
+
var MoreIcon = (function () {
|
|
23
|
+
var Icon;
|
|
24
|
+
if (!MoreIconProp) {
|
|
25
|
+
Icon = (react_1.default.createElement(Icon_1.RcIcon, { size: "medium", color: "neutral.f04", symbol: juno_icon_1.MoreHoriz }));
|
|
26
|
+
}
|
|
27
|
+
else if (typeof MoreIconProp === 'function') {
|
|
28
|
+
Icon = MoreIconProp(open);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
Icon = MoreIconProp;
|
|
32
|
+
}
|
|
23
33
|
if (TooltipProps === null || TooltipProps === void 0 ? void 0 : TooltipProps.title) {
|
|
24
34
|
return react_1.default.createElement(Tooltip_1.RcTooltip, tslib_1.__assign({}, TooltipProps), Icon);
|
|
25
35
|
}
|
|
26
36
|
return Icon;
|
|
27
|
-
}
|
|
37
|
+
})();
|
|
28
38
|
var handleTabClick = foundation_1.useEventCallback(function (event) {
|
|
29
39
|
setAnchorEl(event.currentTarget);
|
|
30
40
|
});
|
|
@@ -49,7 +59,7 @@ var _MoreMenuTab = react_1.forwardRef(function (props, ref) {
|
|
|
49
59
|
}, [MenuItemComponent, menuItems, onChange]);
|
|
50
60
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
51
61
|
react_1.default.createElement(Tab_1.RcTab, tslib_1.__assign({}, rest, { ref: ref, onClick: handleTabClick, label: MoreIcon, value: DEFAULT_MORE_MENU_TAB_LABEL, "aria-haspopup": "true", "aria-controls": menuId })),
|
|
52
|
-
react_1.default.createElement(Menu_1.RcMenu, tslib_1.__assign({ autoClose: true }, MenuPropsRest, { id: menuId, anchorEl: anchorEl, open:
|
|
62
|
+
react_1.default.createElement(Menu_1.RcMenu, tslib_1.__assign({ autoClose: true }, MenuPropsRest, { id: menuId, anchorEl: anchorEl, open: open, variant: "menu", onClose: handleMenuClose }), MenuList)));
|
|
53
63
|
});
|
|
54
64
|
/** inner component */
|
|
55
65
|
var MoreMenuTab = foundation_1.styled(_MoreMenuTab)(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), styles_1.MoreMenuTabStyle);
|
|
@@ -9,12 +9,15 @@ var Transitions_1 = require("../Transitions");
|
|
|
9
9
|
var styles_1 = require("./styles");
|
|
10
10
|
var utils_1 = require("./utils");
|
|
11
11
|
var VirtualizedMenuList_1 = require("./VirtualizedMenuList");
|
|
12
|
+
var useNextFrame_1 = require("./useNextFrame");
|
|
12
13
|
var _RcVirtualizedMenu = react_1.forwardRef(function (inProps, ref) {
|
|
13
14
|
var props = foundation_1.useThemeProps({ props: inProps, name: 'RcVirtualizedMenu' });
|
|
14
|
-
var _a = props.autoFocus, autoFocus = _a === void 0 ? true : _a, children = props.children, classesProp = props.classes, _b = props.disableAutoFocusItem, disableAutoFocusItem = _b === void 0 ? false : _b, _c = props.MenuListProps, _d = _c === void 0 ? {} : _c, _e = _d.maxHeight, maxHeight = _e === void 0 ? 416 : _e, onKeyDown = _d.onKeyDown, MenuListProps = tslib_1.__rest(_d, ["maxHeight", "onKeyDown"]), onClose = props.onClose, open = props.open, TransitionPropsProp = props.TransitionProps, _f = props.PaperProps, PaperPropsProp = _f === void 0 ? {} : _f, PopoverClasses = props.PopoverClasses, _g = props.transitionDuration, transitionDuration = _g === void 0 ? 'auto' : _g, _h = props.variant, variant = _h === void 0 ? 'selectedMenu' : _h, rest = tslib_1.__rest(props, ["autoFocus", "children", "classes", "disableAutoFocusItem", "MenuListProps", "onClose", "open", "TransitionProps", "PaperProps", "PopoverClasses", "transitionDuration", "variant"]);
|
|
15
|
+
var _a = props.autoFocus, autoFocus = _a === void 0 ? true : _a, children = props.children, classesProp = props.classes, _b = props.disableAutoFocusItem, disableAutoFocusItem = _b === void 0 ? false : _b, _c = props.MenuListProps, _d = _c === void 0 ? {} : _c, _e = _d.maxHeight, maxHeight = _e === void 0 ? 416 : _e, onKeyDown = _d.onKeyDown, VirtuosoProps = _d.VirtuosoProps, MenuListProps = tslib_1.__rest(_d, ["maxHeight", "onKeyDown", "VirtuosoProps"]), onClose = props.onClose, open = props.open, TransitionPropsProp = props.TransitionProps, _f = props.PaperProps, PaperPropsProp = _f === void 0 ? {} : _f, PopoverClasses = props.PopoverClasses, _g = props.transitionDuration, transitionDuration = _g === void 0 ? 'auto' : _g, _h = props.variant, variant = _h === void 0 ? 'selectedMenu' : _h, _j = props.action, popoverActionProp = _j === void 0 ? null : _j, rest = tslib_1.__rest(props, ["autoFocus", "children", "classes", "disableAutoFocusItem", "MenuListProps", "onClose", "open", "TransitionProps", "PaperProps", "PopoverClasses", "transitionDuration", "variant", "action"]);
|
|
15
16
|
var document = foundation_1.useRcPortalWindowContext().document;
|
|
16
17
|
var popoverRef = react_1.useRef(null);
|
|
17
18
|
var handleRef = foundation_1.useForkRef(ref, popoverRef);
|
|
19
|
+
var popoverAction = react_1.useRef(null);
|
|
20
|
+
var handlePopoverAction = foundation_1.useForkRef(popoverAction, popoverActionProp);
|
|
18
21
|
var menuListActionRef = react_1.useRef(null);
|
|
19
22
|
var classes = react_1.useMemo(function () { return foundation_1.combineClasses(utils_1.RcVirtualizedMenuClasses, classesProp); }, [classesProp]);
|
|
20
23
|
var autoFocusItem = autoFocus && !disableAutoFocusItem && open;
|
|
@@ -51,10 +54,18 @@ var _RcVirtualizedMenu = react_1.forwardRef(function (inProps, ref) {
|
|
|
51
54
|
}
|
|
52
55
|
}
|
|
53
56
|
});
|
|
54
|
-
|
|
57
|
+
var runInNextFrame = useNextFrame_1.useNextFrame();
|
|
58
|
+
return (react_1.default.createElement(Popover_1.RcPopover, tslib_1.__assign({ ref: handleRef, action: handlePopoverAction, container: document.body, classes: PopoverClasses, onClose: onClose, open: open,
|
|
55
59
|
// FIXME: workaround for virtualized menu height incorrect issue
|
|
56
60
|
TransitionComponent: Transitions_1.RcFade, transitionDuration: transitionDuration, PaperProps: PaperProps, TransitionProps: TransitionProps }, rest),
|
|
57
|
-
react_1.default.createElement(VirtualizedMenuList_1.RcVirtualizedMenuList, tslib_1.__assign({ position: "unset", action: menuListActionRef, autoFocus: autoFocus, autoFocusItem: autoFocusItem, maxHeight: maxHeight, variant: variant, onKeyDown: handleListKeyDown },
|
|
61
|
+
react_1.default.createElement(VirtualizedMenuList_1.RcVirtualizedMenuList, tslib_1.__assign({ position: "unset", action: menuListActionRef, autoFocus: autoFocus, autoFocusItem: autoFocusItem, maxHeight: maxHeight, variant: variant, onKeyDown: handleListKeyDown, VirtuosoProps: tslib_1.__assign(tslib_1.__assign({}, VirtuosoProps), { totalListHeightChanged: function (height) {
|
|
62
|
+
var _a;
|
|
63
|
+
(_a = VirtuosoProps === null || VirtuosoProps === void 0 ? void 0 : VirtuosoProps.totalListHeightChanged) === null || _a === void 0 ? void 0 : _a.call(VirtuosoProps, height);
|
|
64
|
+
runInNextFrame(function () {
|
|
65
|
+
var _a;
|
|
66
|
+
(_a = popoverAction.current) === null || _a === void 0 ? void 0 : _a.updatePosition();
|
|
67
|
+
});
|
|
68
|
+
} }) }, MenuListProps, { className: clsx_1.default(classes.list, MenuListProps.className) }), children)));
|
|
58
69
|
});
|
|
59
70
|
var RcVirtualizedMenu = foundation_1.styled(_RcVirtualizedMenu)(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), styles_1.VirtualizedMenuStyle);
|
|
60
71
|
exports.RcVirtualizedMenu = RcVirtualizedMenu;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useNextFrame: () => (task: Function) => void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var react_1 = require("react");
|
|
4
|
+
exports.useNextFrame = function () {
|
|
5
|
+
var rafIdRef = react_1.useRef(null);
|
|
6
|
+
react_1.useLayoutEffect(function () {
|
|
7
|
+
if (rafIdRef.current !== null) {
|
|
8
|
+
cancelAnimationFrame(rafIdRef.current);
|
|
9
|
+
}
|
|
10
|
+
}, []);
|
|
11
|
+
return function (task) {
|
|
12
|
+
if (rafIdRef.current !== null) {
|
|
13
|
+
cancelAnimationFrame(rafIdRef.current);
|
|
14
|
+
}
|
|
15
|
+
rafIdRef.current = requestAnimationFrame(function () {
|
|
16
|
+
rafIdRef.current = requestAnimationFrame(function () {
|
|
17
|
+
rafIdRef.current = null;
|
|
18
|
+
task();
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -5,8 +5,7 @@ import MuiBadge from '@material-ui/core/Badge';
|
|
|
5
5
|
import { capitalize } from '@material-ui/core/utils';
|
|
6
6
|
import { combineClasses, combineProps, logInDev, styled, useChange, useForkRef, useThemeProps, } from '../../foundation';
|
|
7
7
|
import { RcBox } from '../Box';
|
|
8
|
-
import {
|
|
9
|
-
import { BadgeStyle } from './styles';
|
|
8
|
+
import { BadgeStyle, DefaultDotComponent } from './styles';
|
|
10
9
|
import { RcBadgeClasses, useRoundBadgeOffset } from './utils';
|
|
11
10
|
var _RcBadge = forwardRef(function (inProps, ref) {
|
|
12
11
|
var props = useThemeProps({ props: inProps, name: 'RcBadge' });
|
|
@@ -41,7 +40,7 @@ var _RcBadge = forwardRef(function (inProps, ref) {
|
|
|
41
40
|
var OmitChildren = _a.children, rest = __rest(_a, ["children"]);
|
|
42
41
|
var _b = anchorOrigin, horizontal = _b.horizontal, vertical = _b.vertical;
|
|
43
42
|
var addClassName = "MuiBadge-anchorOrigin" + capitalize(vertical) + capitalize(horizontal) + capitalize(overlap);
|
|
44
|
-
var DotComponent = dotComponent !== null && dotComponent !== void 0 ? dotComponent :
|
|
43
|
+
var DotComponent = dotComponent !== null && dotComponent !== void 0 ? dotComponent : DefaultDotComponent;
|
|
45
44
|
var applyDotProps = combineProps({ className: clsx(addClassName, RcBadgeClasses.badge) }, dotProps);
|
|
46
45
|
return (React.createElement("div", __assign({}, rest, { ref: ref }),
|
|
47
46
|
children,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __makeTemplateObject } from "tslib";
|
|
2
|
-
import { css, fakeBorder, getParsePaletteColor, } from '../../../foundation';
|
|
2
|
+
import { css, fakeBorder, getParsePaletteColor, palette2, styled, } from '../../../foundation';
|
|
3
3
|
import { RcBadgeClasses, roundBadgeMarginKey } from '../utils';
|
|
4
4
|
export var BadgeStyle = function (_a) {
|
|
5
5
|
var badgeContent = _a.badgeContent, overlap = _a.overlap, variant = _a.variant, textColor = _a.textColor, borderColor = _a.borderColor, max = _a.max, color = _a.color;
|
|
@@ -19,4 +19,5 @@ export var BadgeStyle = function (_a) {
|
|
|
19
19
|
? fakeBorder({ color: borderCurrColor, radius: 'round' })
|
|
20
20
|
: 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));
|
|
21
21
|
};
|
|
22
|
-
var
|
|
22
|
+
export var DefaultDotComponent = styled.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n border-radius: 50%;\n width: 8px;\n height: 8px;\n border: 2px solid ", ";\n"], ["\n border-radius: 50%;\n width: 8px;\n height: 8px;\n border: 2px solid ", ";\n"])), palette2('neutral', 'l01'));
|
|
23
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
@@ -11,22 +11,26 @@ import { SelectionView } from './SelectionView';
|
|
|
11
11
|
import { StyledPickerPopperWrap } from './styles';
|
|
12
12
|
import { ToggleText } from './ToggleText';
|
|
13
13
|
import { getFormattedTime, getHourAndMinute, getNumberPickerBoundary, getPeriod, getRangeBoundary, getRecoupHour, getTimestamp, getTimestampFromDate, HALF_DAY_HOURS, minuteSource, parseNumberToString, RcTimePickerClasses, TIME_GAP, twelveHourSystemSource, twentyFourHourSystemSource, } from './utils';
|
|
14
|
+
var defaultPeriodTexts = {
|
|
15
|
+
input: { AM: 'AM', PM: 'PM' },
|
|
16
|
+
toggle: { AM: 'AM', PM: 'PM' },
|
|
17
|
+
};
|
|
14
18
|
var _RcTimePicker = forwardRef(function (inProps, ref) {
|
|
15
19
|
var props = useThemeProps({ props: inProps, name: 'RcTimePicker' });
|
|
16
|
-
var isTwelveHourSystem = props.isTwelveHourSystem, value = props.value, 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, defaultPickerValue = props.defaultPickerValue, rest = __rest(props, ["isTwelveHourSystem", "value", "onChange", "disabled", "dateMode", "min", "max", "size", "onKeyDown", "onClear", "HourPickerProps", "MinutePickerProps", "PeriodToggleProps", "PopoverProps", "InputProps", "classes", "defaultPickerValue"]);
|
|
20
|
+
var isTwelveHourSystem = props.isTwelveHourSystem, value = props.value, 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, defaultPickerValue = props.defaultPickerValue, _a = props.periodTexts, periodTexts = _a === void 0 ? defaultPeriodTexts : _a, rest = __rest(props, ["isTwelveHourSystem", "value", "onChange", "disabled", "dateMode", "min", "max", "size", "onKeyDown", "onClear", "HourPickerProps", "MinutePickerProps", "PeriodToggleProps", "PopoverProps", "InputProps", "classes", "defaultPickerValue", "periodTexts"]);
|
|
17
21
|
var actionRef = useRef(null);
|
|
18
22
|
var hourRef = useRef(null);
|
|
19
23
|
var minuteRef = useRef(null);
|
|
20
24
|
var periodRef = useRef(null);
|
|
21
25
|
var textFiledValueRef = useRef('');
|
|
22
|
-
var
|
|
23
|
-
var
|
|
26
|
+
var _b = __read(useState('none'), 2), selectionShowType = _b[0], setSelectionType = _b[1];
|
|
27
|
+
var _c = (function () {
|
|
24
28
|
if (value !== null)
|
|
25
29
|
return { nowTime: value, isShowTextfieldValue: true };
|
|
26
30
|
if (defaultPickerValue)
|
|
27
31
|
return { nowTime: defaultPickerValue, isShowTextfieldValue: false };
|
|
28
32
|
return { nowTime: null, isShowTextfieldValue: false };
|
|
29
|
-
})(), nowTime =
|
|
33
|
+
})(), nowTime = _c.nowTime, isShowTextfieldValue = _c.isShowTextfieldValue;
|
|
30
34
|
var isHaveValue = nowTime !== null;
|
|
31
35
|
var isDateMode = nowTime instanceof Date || dateMode;
|
|
32
36
|
var currentTimestamp = getTimestamp(nowTime);
|
|
@@ -193,6 +197,7 @@ var _RcTimePicker = forwardRef(function (inProps, ref) {
|
|
|
193
197
|
hour: hour,
|
|
194
198
|
minute: minute,
|
|
195
199
|
period: currentPeriod,
|
|
200
|
+
periodTexts: periodTexts.input,
|
|
196
201
|
}, isTwelveHourSystem);
|
|
197
202
|
textFiledValueRef.current = formattedTime;
|
|
198
203
|
}, [
|
|
@@ -201,6 +206,8 @@ var _RcTimePicker = forwardRef(function (inProps, ref) {
|
|
|
201
206
|
currentTimestamp,
|
|
202
207
|
isTwelveHourSystem,
|
|
203
208
|
currentPeriod,
|
|
209
|
+
periodTexts.input.AM,
|
|
210
|
+
periodTexts.input.PM,
|
|
204
211
|
]);
|
|
205
212
|
// * when no value, open menu use min as value
|
|
206
213
|
var originalHourValue = isHaveValue
|
|
@@ -242,7 +249,7 @@ var _RcTimePicker = forwardRef(function (inProps, ref) {
|
|
|
242
249
|
React.createElement(RcBox, { textAlign: "center", width: "48px" }, ":"),
|
|
243
250
|
React.createElement(NumberPicker, __assign({ ref: minuteRef, size: size }, boundary.minute, { onUpdateValue: handleMinuteChange, onClick: setMinuteSelectionShow, onClose: closeMenu, value: minuteValue, source: minuteSource, step: TIME_GAP, automationId: "time-picker-minute" }, MinutePickerProps)),
|
|
244
251
|
isTwelveHourSystem && (React.createElement("div", null,
|
|
245
|
-
React.createElement(ToggleText, __assign({ ref: periodRef, size: size, disabled: toggleTextDisabled, onUpdateValue: onTogglePeriod, onInnerChange: handlePeriodInnerChange, onClose: closeMenu, value: periodValue }, PeriodToggleProps)))))) : (React.createElement(SelectionView, __assign({ size: size }, (isHourView ? boundary.hour : boundary.minute), { source: isHourView
|
|
252
|
+
React.createElement(ToggleText, __assign({ periodTexts: periodTexts.toggle, ref: periodRef, size: size, disabled: toggleTextDisabled, onUpdateValue: onTogglePeriod, onInnerChange: handlePeriodInnerChange, onClose: closeMenu, value: periodValue }, PeriodToggleProps)))))) : (React.createElement(SelectionView, __assign({ size: size }, (isHourView ? boundary.hour : boundary.minute), { source: isHourView
|
|
246
253
|
? isTwelveHourSystem
|
|
247
254
|
? twelveHourSystemSource
|
|
248
255
|
: twentyFourHourSystemSource
|
|
@@ -7,7 +7,7 @@ import { StyledTimeIconButton } from './styles';
|
|
|
7
7
|
import { RcTimePickerUtils } from './utils';
|
|
8
8
|
import { isClick } from './utils/A11yUtils';
|
|
9
9
|
var _ToggleText = memo(forwardRef(function (_a, ref) {
|
|
10
|
-
var onUpdateValue = _a.onUpdateValue, onInnerChange = _a.onInnerChange, value = _a.value, size = _a.size, disabled = _a.disabled, getScreenReaderLabel = _a.getScreenReaderLabel, onClose = _a.onClose, rest = __rest(_a, ["onUpdateValue", "onInnerChange", "value", "size", "disabled", "getScreenReaderLabel", "onClose"]);
|
|
10
|
+
var onUpdateValue = _a.onUpdateValue, onInnerChange = _a.onInnerChange, value = _a.value, size = _a.size, disabled = _a.disabled, getScreenReaderLabel = _a.getScreenReaderLabel, onClose = _a.onClose, periodTexts = _a.periodTexts, rest = __rest(_a, ["onUpdateValue", "onInnerChange", "value", "size", "disabled", "getScreenReaderLabel", "onClose", "periodTexts"]);
|
|
11
11
|
var _b = __read(useRefState(value), 2), innerValueRef = _b[0], setInnerValue = _b[1];
|
|
12
12
|
useChange(function () {
|
|
13
13
|
if (innerValueRef.current !== value) {
|
|
@@ -48,7 +48,7 @@ var _ToggleText = memo(forwardRef(function (_a, ref) {
|
|
|
48
48
|
value: innerValue,
|
|
49
49
|
}); }, [innerValue]);
|
|
50
50
|
return (React.createElement(StyledTimeIconButton, __assign({ wrapperSize: size, onClick: handleClick, onKeyDown: handleToggleKeyDown, disabled: disabled, color: "informative.f02", "aria-live": "assertive", "aria-label": label }, rest),
|
|
51
|
-
React.createElement(React.Fragment, null, innerValue)));
|
|
51
|
+
React.createElement(React.Fragment, null, periodTexts[innerValue])));
|
|
52
52
|
}));
|
|
53
53
|
var ToggleText = styled(_ToggleText)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin-left: ", ";\n"], ["\n margin-left: ", ";\n"])), function (_a) {
|
|
54
54
|
var size = _a.size;
|
|
File without changes
|
|
@@ -25,10 +25,10 @@ var pad = function (num, size) {
|
|
|
25
25
|
* @returns `hh:mm AM` or `hh:mm PM` or `hh:mm`
|
|
26
26
|
*/
|
|
27
27
|
var getFormattedTime = function (_a, isTwelveHourSystem) {
|
|
28
|
-
var hour = _a.hour, minute = _a.minute, period = _a.period;
|
|
28
|
+
var hour = _a.hour, minute = _a.minute, period = _a.period, periodTexts = _a.periodTexts;
|
|
29
29
|
var formattedHour = parseNumberToString(hour, isTwelveHourSystem);
|
|
30
30
|
var formattedMinute = parseNumberToString(minute);
|
|
31
|
-
var periodText = isTwelveHourSystem ? " " + period : '';
|
|
31
|
+
var periodText = isTwelveHourSystem ? " " + periodTexts[period] : '';
|
|
32
32
|
return formattedHour + ":" + formattedMinute + periodText;
|
|
33
33
|
};
|
|
34
34
|
var HALF_DAY_HOURS = 12;
|
|
@@ -1,25 +1,39 @@
|
|
|
1
|
-
import { __assign, __makeTemplateObject } from "tslib";
|
|
2
|
-
import React, { forwardRef
|
|
1
|
+
import { __assign, __makeTemplateObject, __rest } from "tslib";
|
|
2
|
+
import React, { forwardRef } from 'react';
|
|
3
3
|
import { styled, useThemeProps, } from '../../foundation';
|
|
4
4
|
import { RcIcon } from '../Icon';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { Unattended, Dnd, Check, Offline, Default } from './assets';
|
|
6
|
+
import { StyledPresence, PresenceContainer } from './styles';
|
|
7
|
+
import { RcPresenceColors, RcPresenceSizes } from './utils';
|
|
7
8
|
var _RcPresence = forwardRef(function (inProps, ref) {
|
|
8
9
|
var props = useThemeProps({ props: inProps, name: 'RcPresence' });
|
|
9
|
-
var type = props.type, size = props.size;
|
|
10
|
-
var
|
|
10
|
+
var type = props.type, color = props.color, size = props.size, borderSize = props.borderSize, rest = __rest(props, ["type", "color", "size", "borderSize"]);
|
|
11
|
+
var sizeProps = {
|
|
12
|
+
iconSizeValue: RcPresenceSizes[size][0],
|
|
13
|
+
borderSizeValue: RcPresenceSizes[borderSize || size][1],
|
|
14
|
+
borderSize: borderSize,
|
|
15
|
+
type: type,
|
|
16
|
+
};
|
|
17
|
+
var symbol = (function () {
|
|
11
18
|
switch (type) {
|
|
12
19
|
case 'DND':
|
|
13
|
-
return
|
|
20
|
+
return Dnd;
|
|
21
|
+
case 'available':
|
|
14
22
|
case 'attended':
|
|
15
|
-
return
|
|
23
|
+
return Check;
|
|
16
24
|
case 'unAttended':
|
|
17
|
-
return
|
|
25
|
+
return Unattended;
|
|
26
|
+
case 'offline':
|
|
27
|
+
case 'unavailable':
|
|
28
|
+
case 'notReady':
|
|
29
|
+
return Offline;
|
|
18
30
|
default:
|
|
19
|
-
return
|
|
31
|
+
return Default;
|
|
20
32
|
}
|
|
21
|
-
}
|
|
22
|
-
return (React.createElement(
|
|
33
|
+
})();
|
|
34
|
+
return (React.createElement(PresenceContainer, __assign({ ref: ref }, sizeProps, rest),
|
|
35
|
+
React.createElement(StyledPresence, __assign({}, sizeProps, { color: color }),
|
|
36
|
+
React.createElement(RcIcon, { symbol: symbol, color: color || RcPresenceColors[type], size: "inherit" }))));
|
|
23
37
|
});
|
|
24
38
|
/** @release */
|
|
25
39
|
var RcPresence = styled(_RcPresence)(templateObject_1 || (templateObject_1 = __makeTemplateObject([""], [""])));
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { __assign } from "tslib";
|
|
2
|
+
import React, { forwardRef, memo } from 'react';
|
|
3
|
+
var Check = memo(forwardRef(function (props, svgRef) { return (React.createElement("svg", __assign({ xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", ref: svgRef }, props),
|
|
4
|
+
React.createElement("path", { id: "Shape", d: "M16,0A16,16,0,1,0,32,16,16,16,0,0,0,16,0Zm8.62,10.38L17.51,23.72A2.19,2.19,0,0,1,16,24.89h-.41a2.17,2.17,0,0,1-1.37-.53L8,19a2.22,2.22,0,0,1,2.38-3.7,1.76,1.76,0,0,1,.39.32L14.9,19.2,20.71,8.3a2.21,2.21,0,0,1,2.95-1.06,2.15,2.15,0,0,1,1.15,1.25,2.23,2.23,0,0,1-.08,1.7l-.11.21Z" }))); }));
|
|
5
|
+
Check.displayName = 'Check';
|
|
6
|
+
Check['iconName'] = 'check';
|
|
7
|
+
export default Check;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { __assign } from "tslib";
|
|
2
|
+
import React, { forwardRef, memo } from 'react';
|
|
3
|
+
var Default = memo(forwardRef(function (props, svgRef) { return (React.createElement("svg", __assign({ xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", ref: svgRef }, props),
|
|
4
|
+
React.createElement("circle", { cx: "16", cy: "16", r: "16" }))); }));
|
|
5
|
+
Default.displayName = 'Default';
|
|
6
|
+
Default['iconName'] = 'default';
|
|
7
|
+
export default Default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { __assign } from "tslib";
|
|
2
|
+
import React, { forwardRef, memo } from 'react';
|
|
3
|
+
var Dnd = memo(forwardRef(function (props, svgRef) { return (React.createElement("svg", __assign({ xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", ref: svgRef }, props),
|
|
4
|
+
React.createElement("path", { d: "M16,0A16,16,0,1,0,32,16,16,16,0,0,0,16,0Zm8.44,18.22H7.56a2.22,2.22,0,1,1,0-4.44H24.44a2.22,2.22,0,1,1,0,4.44Z" }))); }));
|
|
5
|
+
Dnd.displayName = 'Dnd';
|
|
6
|
+
Dnd['iconName'] = 'dnd';
|
|
7
|
+
export default Dnd;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { __assign } from "tslib";
|
|
2
|
+
import React, { forwardRef, memo } from 'react';
|
|
3
|
+
var Offline = memo(forwardRef(function (props, svgRef) { return (React.createElement("svg", __assign({ viewBox: "0 0 32 32", ref: svgRef }, props),
|
|
4
|
+
React.createElement("path", { d: "M16,0A16,16,0,1,0,32,16,16,16,0,0,0,16,0Zm0,27.2A11.2,11.2,0,1,1,27.2,16,11.19,11.19,0,0,1,16,27.2Z" }))); }));
|
|
5
|
+
Offline.displayName = 'Offline';
|
|
6
|
+
Offline['iconName'] = 'offline';
|
|
7
|
+
export default Offline;
|