@ringcentral/juno 2.35.4 → 2.36.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/Menu/SubMenu/SubMenu.js +38 -24
- package/components/Presence/assets/Check.js +3 -1
- package/components/Presence/assets/Dnd.js +2 -1
- package/components/Presence/assets/Unattended.js +2 -1
- package/components/Presence/styles/StyledPresence.js +2 -3
- package/components/Presence/utils/RcPresenceUtils.d.ts +0 -1
- package/components/Presence/utils/RcPresenceUtils.js +0 -14
- package/es6/components/Menu/SubMenu/SubMenu.js +39 -25
- package/es6/components/Presence/assets/Check.js +3 -1
- package/es6/components/Presence/assets/Dnd.js +2 -1
- package/es6/components/Presence/assets/Unattended.js +2 -1
- package/es6/components/Presence/styles/StyledPresence.js +2 -3
- package/es6/components/Presence/utils/RcPresenceUtils.js +0 -14
- package/es6/foundation/utils/index.js +1 -0
- package/es6/foundation/utils/isTap.js +11 -0
- package/foundation/utils/index.d.ts +1 -0
- package/foundation/utils/index.js +1 -0
- package/foundation/utils/isTap.d.ts +5 -0
- package/foundation/utils/isTap.js +13 -0
- package/package.json +1 -1
|
@@ -21,7 +21,7 @@ var POPPER_OFFSET = 2;
|
|
|
21
21
|
var MemoMenuList = react_1.memo(MenuList_1.RcMenuList);
|
|
22
22
|
var _RcSubMenu = react_1.forwardRef(function (inProps, ref) {
|
|
23
23
|
var props = foundation_1.useThemeProps({ props: inProps, name: 'RcSubMenu' });
|
|
24
|
-
var classesProp = props.classes, children = props.children, titleProp = props.title, disabled = props.disabled, onKeyDown = props.onKeyDown, onMouseEnter = props.onMouseEnter, onMouseLeave = props.onMouseLeave, MenuListProps = props.MenuListProps, _a = props.PopperProps, PopperProps = _a === void 0 ? {} : _a, onClose = props.onClose, rest = tslib_1.__rest(props, ["classes", "children", "title", "disabled", "onKeyDown", "onMouseEnter", "onMouseLeave", "MenuListProps", "PopperProps", "onClose"]);
|
|
24
|
+
var classesProp = props.classes, children = props.children, titleProp = props.title, disabled = props.disabled, onKeyDown = props.onKeyDown, onTouchStart = props.onTouchStart, onTouchEnd = props.onTouchEnd, onMouseEnter = props.onMouseEnter, onMouseLeave = props.onMouseLeave, MenuListProps = props.MenuListProps, _a = props.PopperProps, PopperProps = _a === void 0 ? {} : _a, onClose = props.onClose, rest = tslib_1.__rest(props, ["classes", "children", "title", "disabled", "onKeyDown", "onTouchStart", "onTouchEnd", "onMouseEnter", "onMouseLeave", "MenuListProps", "PopperProps", "onClose"]);
|
|
25
25
|
var _popperRef = react_1.useRef(null);
|
|
26
26
|
var popperRef = foundation_1.useForkRef(_popperRef, PopperProps.ref || null);
|
|
27
27
|
var popperId = foundation_1.useId(PopperProps.id);
|
|
@@ -31,25 +31,41 @@ var _RcSubMenu = react_1.forwardRef(function (inProps, ref) {
|
|
|
31
31
|
var menuListContext = react_1.useContext(MenuListContext_1.RcMenuListContext);
|
|
32
32
|
var menuContext = react_1.useContext(MenuContext_1.RcMenuContext);
|
|
33
33
|
var subMenuContext = react_1.useContext(SubMenuContext_1.RcSubMenuContext);
|
|
34
|
+
var ignoreMouseEventRef = react_1.useRef(false);
|
|
34
35
|
var externalWindow = foundation_1.useRcPortalWindowContext().externalWindow;
|
|
35
|
-
var handleClose =
|
|
36
|
+
var handleClose = function (e, reason) {
|
|
36
37
|
var _a;
|
|
37
38
|
onClose === null || onClose === void 0 ? void 0 : onClose(e, reason);
|
|
38
39
|
(_a = menuListContext === null || menuListContext === void 0 ? void 0 : menuListContext.onClose) === null || _a === void 0 ? void 0 : _a.call(menuListContext, e, reason);
|
|
39
|
-
}
|
|
40
|
-
var handleItemKeyDown =
|
|
40
|
+
};
|
|
41
|
+
var handleItemKeyDown = function (e) {
|
|
41
42
|
var key = e.key;
|
|
42
43
|
var ArrowRight = foundation_1.a11yKeyboard.ArrowRight, Space = foundation_1.a11yKeyboard.Space, Enter = foundation_1.a11yKeyboard.Enter;
|
|
43
44
|
if ([ArrowRight, Space, Enter].includes(key)) {
|
|
44
45
|
openPopper(e);
|
|
45
46
|
}
|
|
46
47
|
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e);
|
|
47
|
-
}
|
|
48
|
-
var
|
|
49
|
-
|
|
48
|
+
};
|
|
49
|
+
var handleItemTouchStart = function (e) {
|
|
50
|
+
ignoreMouseEventRef.current = true;
|
|
51
|
+
onTouchStart === null || onTouchStart === void 0 ? void 0 : onTouchStart(e);
|
|
52
|
+
};
|
|
53
|
+
var handleItemTouchEnd = function (e) {
|
|
54
|
+
if (foundation_1.isTap(e)) {
|
|
55
|
+
openPopper(e);
|
|
56
|
+
}
|
|
57
|
+
onTouchEnd === null || onTouchEnd === void 0 ? void 0 : onTouchEnd(e);
|
|
58
|
+
};
|
|
59
|
+
var handleItemMouseEnter = function (e) {
|
|
60
|
+
if (!ignoreMouseEventRef.current) {
|
|
61
|
+
openPopper(e);
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
ignoreMouseEventRef.current = false;
|
|
65
|
+
}
|
|
50
66
|
onMouseEnter === null || onMouseEnter === void 0 ? void 0 : onMouseEnter(e);
|
|
51
|
-
}
|
|
52
|
-
var handleItemMouseLeave =
|
|
67
|
+
};
|
|
68
|
+
var handleItemMouseLeave = function (e) {
|
|
53
69
|
onMouseLeave === null || onMouseLeave === void 0 ? void 0 : onMouseLeave(e);
|
|
54
70
|
if (!_popperRef.current || !e.currentTarget) {
|
|
55
71
|
return;
|
|
@@ -62,27 +78,27 @@ var _RcSubMenu = react_1.forwardRef(function (inProps, ref) {
|
|
|
62
78
|
closePopper();
|
|
63
79
|
handleClose(e, 'subMenuItemAnchorMouseLeave');
|
|
64
80
|
}
|
|
65
|
-
}
|
|
81
|
+
};
|
|
66
82
|
var classes = react_1.useMemo(function () { return foundation_1.combineClasses(utils_1.RcSubMenuClasses, classesProp); }, [classesProp]);
|
|
67
83
|
var title = react_1.useMemo(function () {
|
|
68
84
|
return typeof titleProp === 'string' ? (react_1.default.createElement(ListItemText_1.RcListItemText, null, titleProp)) : (titleProp);
|
|
69
85
|
}, [titleProp]);
|
|
70
86
|
var onPopperKeyDown = PopperProps.onKeyDown, onPopperMouseLeave = PopperProps.onMouseLeave, restPopperProps = tslib_1.__rest(PopperProps, ["onKeyDown", "onMouseLeave"]);
|
|
71
|
-
var openPopper =
|
|
87
|
+
var openPopper = function (event) {
|
|
72
88
|
if (!disabled && event.currentTarget) {
|
|
73
89
|
setAnchorEl(event.currentTarget);
|
|
74
90
|
setOpen(true);
|
|
75
91
|
}
|
|
76
|
-
}
|
|
77
|
-
var closePopper =
|
|
92
|
+
};
|
|
93
|
+
var closePopper = function () {
|
|
78
94
|
setOpen(false);
|
|
79
95
|
setAnchorEl(null);
|
|
80
|
-
}
|
|
96
|
+
};
|
|
81
97
|
var handleCloseSubMenu = foundation_1.useEventCallback(function () {
|
|
82
98
|
anchorEl === null || anchorEl === void 0 ? void 0 : anchorEl.focus();
|
|
83
99
|
closePopper();
|
|
84
100
|
});
|
|
85
|
-
var handlePopperKeyDown =
|
|
101
|
+
var handlePopperKeyDown = function (e) {
|
|
86
102
|
var _a;
|
|
87
103
|
var key = e.key;
|
|
88
104
|
var ArrowLeft = foundation_1.a11yKeyboard.ArrowLeft, Escape = foundation_1.a11yKeyboard.Escape, Tab = foundation_1.a11yKeyboard.Tab;
|
|
@@ -99,16 +115,14 @@ var _RcSubMenu = react_1.forwardRef(function (inProps, ref) {
|
|
|
99
115
|
handleClose(e, reason);
|
|
100
116
|
}
|
|
101
117
|
onPopperKeyDown === null || onPopperKeyDown === void 0 ? void 0 : onPopperKeyDown(e);
|
|
102
|
-
}
|
|
103
|
-
var handlePopperClickAway =
|
|
104
|
-
if (anchorEl &&
|
|
105
|
-
e.target &&
|
|
106
|
-
!anchorEl.contains(e.target)) {
|
|
118
|
+
};
|
|
119
|
+
var handlePopperClickAway = function (e) {
|
|
120
|
+
if (anchorEl && e.target && !anchorEl.contains(e.target)) {
|
|
107
121
|
closePopper();
|
|
108
122
|
handleClose(e, 'backdropClick');
|
|
109
123
|
}
|
|
110
|
-
}
|
|
111
|
-
var handlePopperMouseLeave =
|
|
124
|
+
};
|
|
125
|
+
var handlePopperMouseLeave = function (e) {
|
|
112
126
|
closePopper();
|
|
113
127
|
onPopperMouseLeave === null || onPopperMouseLeave === void 0 ? void 0 : onPopperMouseLeave(e);
|
|
114
128
|
if (!anchorEl || !e.currentTarget) {
|
|
@@ -121,7 +135,7 @@ var _RcSubMenu = react_1.forwardRef(function (inProps, ref) {
|
|
|
121
135
|
if (!isMoveToAnchor) {
|
|
122
136
|
handleClose(e, 'popperMouseLeave');
|
|
123
137
|
}
|
|
124
|
-
}
|
|
138
|
+
};
|
|
125
139
|
react_1.useLayoutEffect(function () {
|
|
126
140
|
if (open &&
|
|
127
141
|
menuListContext.menuListId !== '' &&
|
|
@@ -177,7 +191,7 @@ var _RcSubMenu = react_1.forwardRef(function (inProps, ref) {
|
|
|
177
191
|
},
|
|
178
192
|
}); }, [externalWindow]);
|
|
179
193
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
180
|
-
react_1.default.createElement(MenuItem_1.RcMenuItem, tslib_1.__assign({ "aria-controls": popperId }, rest, { ref: ref, disabled: disabled, classes: classes, onKeyDown: handleItemKeyDown, onMouseEnter: handleItemMouseEnter, onMouseLeave: handleItemMouseLeave, idRef: menuItemIdRef, isSubMenuItem: true, "aria-haspopup": "true", "aria-expanded": open }),
|
|
194
|
+
react_1.default.createElement(MenuItem_1.RcMenuItem, tslib_1.__assign({ "aria-controls": popperId }, rest, { ref: ref, disabled: disabled, classes: classes, onKeyDown: handleItemKeyDown, onTouchStart: handleItemTouchStart, onTouchEnd: handleItemTouchEnd, onMouseEnter: handleItemMouseEnter, onMouseLeave: handleItemMouseLeave, idRef: menuItemIdRef, isSubMenuItem: true, "aria-haspopup": "true", "aria-expanded": open }),
|
|
181
195
|
title,
|
|
182
196
|
react_1.default.createElement(styles_1.StyledListItemSecondaryAction, null,
|
|
183
197
|
react_1.default.createElement(Icon_1.RcIcon, { size: "medium", color: "neutral.f04", symbol: juno_icon_1.ArrowRight }))),
|
|
@@ -3,7 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
var tslib_1 = require("tslib");
|
|
4
4
|
var react_1 = tslib_1.__importStar(require("react"));
|
|
5
5
|
var Check = react_1.memo(react_1.forwardRef(function (props, svgRef) { return (react_1.default.createElement("svg", tslib_1.__assign({ xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", ref: svgRef }, props),
|
|
6
|
-
react_1.default.createElement("
|
|
6
|
+
react_1.default.createElement("g", { id: "Available" },
|
|
7
|
+
react_1.default.createElement("path", { id: "Shape", fill: "#3c9949", d: "M16,0A16,16,0,1,0,32,16,16,16,0,0,0,16,0Z" })),
|
|
8
|
+
react_1.default.createElement("path", { fill: "#fff", d: "M24.62,10.38,17.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,2,2,0,0,1,.39.32L14.9,19.2,20.71,8.3a2.22,2.22,0,0,1,2.94-1.07h0a2.15,2.15,0,0,1,1.15,1.25,2.23,2.23,0,0,1-.08,1.7l-.11.21Z" }))); }));
|
|
7
9
|
Check.displayName = 'Check';
|
|
8
10
|
Check['iconName'] = 'check';
|
|
9
11
|
exports.default = Check;
|
|
@@ -3,7 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
var tslib_1 = require("tslib");
|
|
4
4
|
var react_1 = tslib_1.__importStar(require("react"));
|
|
5
5
|
var Dnd = react_1.memo(react_1.forwardRef(function (props, svgRef) { return (react_1.default.createElement("svg", tslib_1.__assign({ xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", ref: svgRef }, props),
|
|
6
|
-
react_1.default.createElement("path", { d: "M16,0A16,16,0,1,0,32,16,16,16,0,0,0,16,
|
|
6
|
+
react_1.default.createElement("path", { fill: '#dd6057', d: "M16,0A16,16,0,1,0,32,16,16,16,0,0,0,16,0Z" }),
|
|
7
|
+
react_1.default.createElement("path", { fill: "#fff", d: "M24.44,18.22H7.56a2.22,2.22,0,1,1,0-4.44H24.44a2.22,2.22,0,0,1,0,4.44Z" }))); }));
|
|
7
8
|
Dnd.displayName = 'Dnd';
|
|
8
9
|
Dnd['iconName'] = 'dnd';
|
|
9
10
|
exports.default = Dnd;
|
|
@@ -3,7 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
var tslib_1 = require("tslib");
|
|
4
4
|
var react_1 = tslib_1.__importStar(require("react"));
|
|
5
5
|
var Unattended = react_1.memo(react_1.forwardRef(function (props, svgRef) { return (react_1.default.createElement("svg", tslib_1.__assign({ xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", ref: svgRef }, props),
|
|
6
|
-
react_1.default.createElement("path", { d: "M16,0A16,16,0,1,0,32,16,16,16,0,0,0,16,
|
|
6
|
+
react_1.default.createElement("path", { fill: "#dd6057", d: "M16,0A16,16,0,1,0,32,16,16,16,0,0,0,16,0Z" }),
|
|
7
|
+
react_1.default.createElement("path", { fill: "#fff", d: "M23.54,20.39a2.23,2.23,0,0,1-3.15,3.15h0L16,19.15l-4.39,4.39a2.23,2.23,0,0,1-3.15-3.15h0L12.85,16,8.46,11.61a2.23,2.23,0,0,1,3.15-3.15L16,12.85l4.39-4.39a2.23,2.23,0,0,1,3.15,3.15h0L19.15,16Z" }))); }));
|
|
7
8
|
Unattended.displayName = 'Unattended';
|
|
8
9
|
Unattended['iconName'] = 'unattended';
|
|
9
10
|
exports.default = Unattended;
|
|
@@ -4,19 +4,18 @@ var tslib_1 = require("tslib");
|
|
|
4
4
|
var react_1 = tslib_1.__importStar(require("react"));
|
|
5
5
|
var foundation_1 = require("../../../foundation");
|
|
6
6
|
var Icon_1 = require("../../Icon");
|
|
7
|
-
var utils_1 = require("../utils");
|
|
8
7
|
exports._StyledPresence = react_1.forwardRef(function (_a, ref) {
|
|
9
8
|
var color = _a.color, type = _a.type, iconSizeValue = _a.iconSizeValue, borderSizeValue = _a.borderSizeValue, rest = tslib_1.__rest(_a, ["color", "type", "iconSizeValue", "borderSizeValue"]);
|
|
10
9
|
return (react_1.default.createElement("div", tslib_1.__assign({ ref: ref }, rest)));
|
|
11
10
|
});
|
|
12
11
|
exports.StyledPresence = foundation_1.styled(exports._StyledPresence)(templateObject_2 || (templateObject_2 = 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
12
|
";\n"])), function (_a) {
|
|
14
|
-
var
|
|
13
|
+
var iconSizeValue = _a.iconSizeValue, borderSizeValue = _a.borderSizeValue, color = _a.color;
|
|
15
14
|
return foundation_1.css(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n width: ", "px;\n height: ", "px;\n background: ", ";\n ", ";\n ", " {\n svg {\n width: ", "px;\n height: ", "px;\n }\n }\n "], ["\n width: ", "px;\n height: ", "px;\n background: ",
|
|
16
15
|
";\n ",
|
|
17
16
|
";\n ", " {\n svg {\n width: ", "px;\n height: ", "px;\n }\n }\n "])), iconSizeValue, iconSizeValue, color
|
|
18
17
|
? foundation_1.getParsePaletteColor(color)
|
|
19
|
-
:
|
|
18
|
+
: foundation_1.palette2('neutral', 'l01'), foundation_1.fakeBorder({
|
|
20
19
|
inset: false,
|
|
21
20
|
color: foundation_1.palette2('neutral', 'l01'),
|
|
22
21
|
size: borderSizeValue,
|
|
@@ -2,4 +2,3 @@ import { UnitMap } from '../../../foundation';
|
|
|
2
2
|
import { RcPresenceSize, RcPresenceType } from '../Presence';
|
|
3
3
|
export declare const RcPresenceSizes: UnitMap<RcPresenceSize, [number, number]>;
|
|
4
4
|
export declare const RcPresenceColors: UnitMap<RcPresenceType>;
|
|
5
|
-
export declare const RcPresenceBackgroundColors: UnitMap<RcPresenceType>;
|
|
@@ -28,17 +28,3 @@ exports.RcPresenceColors = {
|
|
|
28
28
|
notReady: presenceOff,
|
|
29
29
|
offline: presenceOff,
|
|
30
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
|
-
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __assign, __makeTemplateObject, __read, __rest } from "tslib";
|
|
2
2
|
import React, { forwardRef, memo, useContext, useLayoutEffect, useMemo, useRef, useState, } from 'react';
|
|
3
3
|
import { ArrowRight } from '@ringcentral/juno-icon';
|
|
4
|
-
import { a11yKeyboard, combineClasses, styled, useEventCallback, useForkRef, useId, useRcPortalWindowContext, useThemeProps, } from '../../../foundation';
|
|
4
|
+
import { a11yKeyboard, combineClasses, styled, useEventCallback, useForkRef, useId, useRcPortalWindowContext, useThemeProps, isTap, } from '../../../foundation';
|
|
5
5
|
import { ClickAwayListener } from '../../ClickAwayListener';
|
|
6
6
|
import { RcIcon } from '../../Icon';
|
|
7
7
|
import { RcListItemText } from '../../List/ListItemText';
|
|
@@ -18,7 +18,7 @@ var POPPER_OFFSET = 2;
|
|
|
18
18
|
var MemoMenuList = memo(RcMenuList);
|
|
19
19
|
var _RcSubMenu = forwardRef(function (inProps, ref) {
|
|
20
20
|
var props = useThemeProps({ props: inProps, name: 'RcSubMenu' });
|
|
21
|
-
var classesProp = props.classes, children = props.children, titleProp = props.title, disabled = props.disabled, onKeyDown = props.onKeyDown, onMouseEnter = props.onMouseEnter, onMouseLeave = props.onMouseLeave, MenuListProps = props.MenuListProps, _a = props.PopperProps, PopperProps = _a === void 0 ? {} : _a, onClose = props.onClose, rest = __rest(props, ["classes", "children", "title", "disabled", "onKeyDown", "onMouseEnter", "onMouseLeave", "MenuListProps", "PopperProps", "onClose"]);
|
|
21
|
+
var classesProp = props.classes, children = props.children, titleProp = props.title, disabled = props.disabled, onKeyDown = props.onKeyDown, onTouchStart = props.onTouchStart, onTouchEnd = props.onTouchEnd, onMouseEnter = props.onMouseEnter, onMouseLeave = props.onMouseLeave, MenuListProps = props.MenuListProps, _a = props.PopperProps, PopperProps = _a === void 0 ? {} : _a, onClose = props.onClose, rest = __rest(props, ["classes", "children", "title", "disabled", "onKeyDown", "onTouchStart", "onTouchEnd", "onMouseEnter", "onMouseLeave", "MenuListProps", "PopperProps", "onClose"]);
|
|
22
22
|
var _popperRef = useRef(null);
|
|
23
23
|
var popperRef = useForkRef(_popperRef, PopperProps.ref || null);
|
|
24
24
|
var popperId = useId(PopperProps.id);
|
|
@@ -28,25 +28,41 @@ var _RcSubMenu = forwardRef(function (inProps, ref) {
|
|
|
28
28
|
var menuListContext = useContext(RcMenuListContext);
|
|
29
29
|
var menuContext = useContext(RcMenuContext);
|
|
30
30
|
var subMenuContext = useContext(RcSubMenuContext);
|
|
31
|
+
var ignoreMouseEventRef = useRef(false);
|
|
31
32
|
var externalWindow = useRcPortalWindowContext().externalWindow;
|
|
32
|
-
var handleClose =
|
|
33
|
+
var handleClose = function (e, reason) {
|
|
33
34
|
var _a;
|
|
34
35
|
onClose === null || onClose === void 0 ? void 0 : onClose(e, reason);
|
|
35
36
|
(_a = menuListContext === null || menuListContext === void 0 ? void 0 : menuListContext.onClose) === null || _a === void 0 ? void 0 : _a.call(menuListContext, e, reason);
|
|
36
|
-
}
|
|
37
|
-
var handleItemKeyDown =
|
|
37
|
+
};
|
|
38
|
+
var handleItemKeyDown = function (e) {
|
|
38
39
|
var key = e.key;
|
|
39
40
|
var ArrowRight = a11yKeyboard.ArrowRight, Space = a11yKeyboard.Space, Enter = a11yKeyboard.Enter;
|
|
40
41
|
if ([ArrowRight, Space, Enter].includes(key)) {
|
|
41
42
|
openPopper(e);
|
|
42
43
|
}
|
|
43
44
|
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e);
|
|
44
|
-
}
|
|
45
|
-
var
|
|
46
|
-
|
|
45
|
+
};
|
|
46
|
+
var handleItemTouchStart = function (e) {
|
|
47
|
+
ignoreMouseEventRef.current = true;
|
|
48
|
+
onTouchStart === null || onTouchStart === void 0 ? void 0 : onTouchStart(e);
|
|
49
|
+
};
|
|
50
|
+
var handleItemTouchEnd = function (e) {
|
|
51
|
+
if (isTap(e)) {
|
|
52
|
+
openPopper(e);
|
|
53
|
+
}
|
|
54
|
+
onTouchEnd === null || onTouchEnd === void 0 ? void 0 : onTouchEnd(e);
|
|
55
|
+
};
|
|
56
|
+
var handleItemMouseEnter = function (e) {
|
|
57
|
+
if (!ignoreMouseEventRef.current) {
|
|
58
|
+
openPopper(e);
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
ignoreMouseEventRef.current = false;
|
|
62
|
+
}
|
|
47
63
|
onMouseEnter === null || onMouseEnter === void 0 ? void 0 : onMouseEnter(e);
|
|
48
|
-
}
|
|
49
|
-
var handleItemMouseLeave =
|
|
64
|
+
};
|
|
65
|
+
var handleItemMouseLeave = function (e) {
|
|
50
66
|
onMouseLeave === null || onMouseLeave === void 0 ? void 0 : onMouseLeave(e);
|
|
51
67
|
if (!_popperRef.current || !e.currentTarget) {
|
|
52
68
|
return;
|
|
@@ -59,27 +75,27 @@ var _RcSubMenu = forwardRef(function (inProps, ref) {
|
|
|
59
75
|
closePopper();
|
|
60
76
|
handleClose(e, 'subMenuItemAnchorMouseLeave');
|
|
61
77
|
}
|
|
62
|
-
}
|
|
78
|
+
};
|
|
63
79
|
var classes = useMemo(function () { return combineClasses(RcSubMenuClasses, classesProp); }, [classesProp]);
|
|
64
80
|
var title = useMemo(function () {
|
|
65
81
|
return typeof titleProp === 'string' ? (React.createElement(RcListItemText, null, titleProp)) : (titleProp);
|
|
66
82
|
}, [titleProp]);
|
|
67
83
|
var onPopperKeyDown = PopperProps.onKeyDown, onPopperMouseLeave = PopperProps.onMouseLeave, restPopperProps = __rest(PopperProps, ["onKeyDown", "onMouseLeave"]);
|
|
68
|
-
var openPopper =
|
|
84
|
+
var openPopper = function (event) {
|
|
69
85
|
if (!disabled && event.currentTarget) {
|
|
70
86
|
setAnchorEl(event.currentTarget);
|
|
71
87
|
setOpen(true);
|
|
72
88
|
}
|
|
73
|
-
}
|
|
74
|
-
var closePopper =
|
|
89
|
+
};
|
|
90
|
+
var closePopper = function () {
|
|
75
91
|
setOpen(false);
|
|
76
92
|
setAnchorEl(null);
|
|
77
|
-
}
|
|
93
|
+
};
|
|
78
94
|
var handleCloseSubMenu = useEventCallback(function () {
|
|
79
95
|
anchorEl === null || anchorEl === void 0 ? void 0 : anchorEl.focus();
|
|
80
96
|
closePopper();
|
|
81
97
|
});
|
|
82
|
-
var handlePopperKeyDown =
|
|
98
|
+
var handlePopperKeyDown = function (e) {
|
|
83
99
|
var _a;
|
|
84
100
|
var key = e.key;
|
|
85
101
|
var ArrowLeft = a11yKeyboard.ArrowLeft, Escape = a11yKeyboard.Escape, Tab = a11yKeyboard.Tab;
|
|
@@ -96,16 +112,14 @@ var _RcSubMenu = forwardRef(function (inProps, ref) {
|
|
|
96
112
|
handleClose(e, reason);
|
|
97
113
|
}
|
|
98
114
|
onPopperKeyDown === null || onPopperKeyDown === void 0 ? void 0 : onPopperKeyDown(e);
|
|
99
|
-
}
|
|
100
|
-
var handlePopperClickAway =
|
|
101
|
-
if (anchorEl &&
|
|
102
|
-
e.target &&
|
|
103
|
-
!anchorEl.contains(e.target)) {
|
|
115
|
+
};
|
|
116
|
+
var handlePopperClickAway = function (e) {
|
|
117
|
+
if (anchorEl && e.target && !anchorEl.contains(e.target)) {
|
|
104
118
|
closePopper();
|
|
105
119
|
handleClose(e, 'backdropClick');
|
|
106
120
|
}
|
|
107
|
-
}
|
|
108
|
-
var handlePopperMouseLeave =
|
|
121
|
+
};
|
|
122
|
+
var handlePopperMouseLeave = function (e) {
|
|
109
123
|
closePopper();
|
|
110
124
|
onPopperMouseLeave === null || onPopperMouseLeave === void 0 ? void 0 : onPopperMouseLeave(e);
|
|
111
125
|
if (!anchorEl || !e.currentTarget) {
|
|
@@ -118,7 +132,7 @@ var _RcSubMenu = forwardRef(function (inProps, ref) {
|
|
|
118
132
|
if (!isMoveToAnchor) {
|
|
119
133
|
handleClose(e, 'popperMouseLeave');
|
|
120
134
|
}
|
|
121
|
-
}
|
|
135
|
+
};
|
|
122
136
|
useLayoutEffect(function () {
|
|
123
137
|
if (open &&
|
|
124
138
|
menuListContext.menuListId !== '' &&
|
|
@@ -174,7 +188,7 @@ var _RcSubMenu = forwardRef(function (inProps, ref) {
|
|
|
174
188
|
},
|
|
175
189
|
}); }, [externalWindow]);
|
|
176
190
|
return (React.createElement(React.Fragment, null,
|
|
177
|
-
React.createElement(RcMenuItem, __assign({ "aria-controls": popperId }, rest, { ref: ref, disabled: disabled, classes: classes, onKeyDown: handleItemKeyDown, onMouseEnter: handleItemMouseEnter, onMouseLeave: handleItemMouseLeave, idRef: menuItemIdRef, isSubMenuItem: true, "aria-haspopup": "true", "aria-expanded": open }),
|
|
191
|
+
React.createElement(RcMenuItem, __assign({ "aria-controls": popperId }, rest, { ref: ref, disabled: disabled, classes: classes, onKeyDown: handleItemKeyDown, onTouchStart: handleItemTouchStart, onTouchEnd: handleItemTouchEnd, onMouseEnter: handleItemMouseEnter, onMouseLeave: handleItemMouseLeave, idRef: menuItemIdRef, isSubMenuItem: true, "aria-haspopup": "true", "aria-expanded": open }),
|
|
178
192
|
title,
|
|
179
193
|
React.createElement(StyledListItemSecondaryAction, null,
|
|
180
194
|
React.createElement(RcIcon, { size: "medium", color: "neutral.f04", symbol: ArrowRight }))),
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { __assign } from "tslib";
|
|
2
2
|
import React, { forwardRef, memo } from 'react';
|
|
3
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("
|
|
4
|
+
React.createElement("g", { id: "Available" },
|
|
5
|
+
React.createElement("path", { id: "Shape", fill: "#3c9949", d: "M16,0A16,16,0,1,0,32,16,16,16,0,0,0,16,0Z" })),
|
|
6
|
+
React.createElement("path", { fill: "#fff", d: "M24.62,10.38,17.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,2,2,0,0,1,.39.32L14.9,19.2,20.71,8.3a2.22,2.22,0,0,1,2.94-1.07h0a2.15,2.15,0,0,1,1.15,1.25,2.23,2.23,0,0,1-.08,1.7l-.11.21Z" }))); }));
|
|
5
7
|
Check.displayName = 'Check';
|
|
6
8
|
Check['iconName'] = 'check';
|
|
7
9
|
export default Check;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { __assign } from "tslib";
|
|
2
2
|
import React, { forwardRef, memo } from 'react';
|
|
3
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,
|
|
4
|
+
React.createElement("path", { fill: '#dd6057', d: "M16,0A16,16,0,1,0,32,16,16,16,0,0,0,16,0Z" }),
|
|
5
|
+
React.createElement("path", { fill: "#fff", d: "M24.44,18.22H7.56a2.22,2.22,0,1,1,0-4.44H24.44a2.22,2.22,0,0,1,0,4.44Z" }))); }));
|
|
5
6
|
Dnd.displayName = 'Dnd';
|
|
6
7
|
Dnd['iconName'] = 'dnd';
|
|
7
8
|
export default Dnd;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { __assign } from "tslib";
|
|
2
2
|
import React, { forwardRef, memo } from 'react';
|
|
3
3
|
var Unattended = 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,
|
|
4
|
+
React.createElement("path", { fill: "#dd6057", d: "M16,0A16,16,0,1,0,32,16,16,16,0,0,0,16,0Z" }),
|
|
5
|
+
React.createElement("path", { fill: "#fff", d: "M23.54,20.39a2.23,2.23,0,0,1-3.15,3.15h0L16,19.15l-4.39,4.39a2.23,2.23,0,0,1-3.15-3.15h0L12.85,16,8.46,11.61a2.23,2.23,0,0,1,3.15-3.15L16,12.85l4.39-4.39a2.23,2.23,0,0,1,3.15,3.15h0L19.15,16Z" }))); }));
|
|
5
6
|
Unattended.displayName = 'Unattended';
|
|
6
7
|
Unattended['iconName'] = 'unattended';
|
|
7
8
|
export default Unattended;
|
|
@@ -2,19 +2,18 @@ import { __assign, __makeTemplateObject, __rest } from "tslib";
|
|
|
2
2
|
import React, { forwardRef } from 'react';
|
|
3
3
|
import { css, getParsePaletteColor, palette2, styled, fakeBorder, } from '../../../foundation';
|
|
4
4
|
import { RcIcon } from '../../Icon';
|
|
5
|
-
import { RcPresenceBackgroundColors } from '../utils';
|
|
6
5
|
export var _StyledPresence = forwardRef(function (_a, ref) {
|
|
7
6
|
var color = _a.color, type = _a.type, iconSizeValue = _a.iconSizeValue, borderSizeValue = _a.borderSizeValue, rest = __rest(_a, ["color", "type", "iconSizeValue", "borderSizeValue"]);
|
|
8
7
|
return (React.createElement("div", __assign({ ref: ref }, rest)));
|
|
9
8
|
});
|
|
10
9
|
export var StyledPresence = styled(_StyledPresence)(templateObject_2 || (templateObject_2 = __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 ",
|
|
11
10
|
";\n"])), function (_a) {
|
|
12
|
-
var
|
|
11
|
+
var iconSizeValue = _a.iconSizeValue, borderSizeValue = _a.borderSizeValue, color = _a.color;
|
|
13
12
|
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: ", "px;\n height: ", "px;\n background: ", ";\n ", ";\n ", " {\n svg {\n width: ", "px;\n height: ", "px;\n }\n }\n "], ["\n width: ", "px;\n height: ", "px;\n background: ",
|
|
14
13
|
";\n ",
|
|
15
14
|
";\n ", " {\n svg {\n width: ", "px;\n height: ", "px;\n }\n }\n "])), iconSizeValue, iconSizeValue, color
|
|
16
15
|
? getParsePaletteColor(color)
|
|
17
|
-
:
|
|
16
|
+
: palette2('neutral', 'l01'), fakeBorder({
|
|
18
17
|
inset: false,
|
|
19
18
|
color: palette2('neutral', 'l01'),
|
|
20
19
|
size: borderSizeValue,
|
|
@@ -26,17 +26,3 @@ export var RcPresenceColors = {
|
|
|
26
26
|
notReady: presenceOff,
|
|
27
27
|
offline: presenceOff,
|
|
28
28
|
};
|
|
29
|
-
export var RcPresenceBackgroundColors = {
|
|
30
|
-
// positive
|
|
31
|
-
available: '#FFFFFF',
|
|
32
|
-
attended: '#FFFFFF',
|
|
33
|
-
// negative
|
|
34
|
-
unAttended: '#FFFFFF',
|
|
35
|
-
onCall: '#FFFFFF',
|
|
36
|
-
inMeeting: '#FFFFFF',
|
|
37
|
-
DND: '#FFFFFF',
|
|
38
|
-
busy: '#FFFFFF',
|
|
39
|
-
unavailable: palette2('neutral', 'l01'),
|
|
40
|
-
notReady: palette2('neutral', 'l01'),
|
|
41
|
-
offline: palette2('neutral', 'l01'),
|
|
42
|
-
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param event TouchEndEvent
|
|
3
|
+
*/
|
|
4
|
+
export var isTap = function (event) {
|
|
5
|
+
if (event.touches.length < 2 && event.changedTouches.length < 2) {
|
|
6
|
+
var touch = event.touches[0] || event.changedTouches[0];
|
|
7
|
+
var elm = document.elementFromPoint(touch.clientX, touch.clientY);
|
|
8
|
+
return event.currentTarget === elm || event.currentTarget.contains(elm);
|
|
9
|
+
}
|
|
10
|
+
return false;
|
|
11
|
+
};
|
|
@@ -24,3 +24,4 @@ tslib_1.__exportStar(require("./shallowEqual"), exports);
|
|
|
24
24
|
tslib_1.__exportStar(require("./styleParser"), exports);
|
|
25
25
|
tslib_1.__exportStar(require("./swapArrayLocs"), exports);
|
|
26
26
|
tslib_1.__exportStar(require("./withDeprecatedCheck"), exports);
|
|
27
|
+
tslib_1.__exportStar(require("./isTap"), exports);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* @param event TouchEndEvent
|
|
5
|
+
*/
|
|
6
|
+
exports.isTap = function (event) {
|
|
7
|
+
if (event.touches.length < 2 && event.changedTouches.length < 2) {
|
|
8
|
+
var touch = event.touches[0] || event.changedTouches[0];
|
|
9
|
+
var elm = document.elementFromPoint(touch.clientX, touch.clientY);
|
|
10
|
+
return event.currentTarget === elm || event.currentTarget.contains(elm);
|
|
11
|
+
}
|
|
12
|
+
return false;
|
|
13
|
+
};
|