@ringcentral/juno 2.35.0 → 2.35.2
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/Presence/Presence.js +0 -1
- package/components/Presence/styles/StyledPresence.d.ts +1 -1
- package/components/Presence/styles/StyledPresence.js +9 -9
- package/components/Tabs/Tabs/MoreMenuTabs/MoreMenuTabs.js +28 -26
- package/es6/components/Presence/Presence.js +0 -1
- package/es6/components/Presence/styles/StyledPresence.js +9 -9
- package/es6/components/Tabs/Tabs/MoreMenuTabs/MoreMenuTabs.js +28 -26
- package/es6/foundation/hooks/useTouchMouseEvent/useTouchMouseEvent.js +1 -1
- package/foundation/hooks/useTouchMouseEvent/useTouchMouseEvent.js +1 -1
- package/package.json +1 -1
|
@@ -13,7 +13,6 @@ var _RcPresence = react_1.forwardRef(function (inProps, ref) {
|
|
|
13
13
|
var sizeProps = {
|
|
14
14
|
iconSizeValue: utils_1.RcPresenceSizes[size][0],
|
|
15
15
|
borderSizeValue: utils_1.RcPresenceSizes[borderSize || size][1],
|
|
16
|
-
borderSize: borderSize,
|
|
17
16
|
type: type,
|
|
18
17
|
};
|
|
19
18
|
var symbol = (function () {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
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
3
|
export declare const _StyledPresence: React.ForwardRefExoticComponent<PresenceSizeProps & React.RefAttributes<any>>;
|
|
5
4
|
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"> & {
|
|
6
5
|
theme?: import("../../../foundation").RcTheme | undefined;
|
|
7
6
|
} & PresenceSizeProps>;
|
|
7
|
+
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>;
|
|
@@ -5,19 +5,14 @@ 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
|
-
});
|
|
13
8
|
exports._StyledPresence = react_1.forwardRef(function (_a, ref) {
|
|
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));
|
|
9
|
+
var color = _a.color, type = _a.type, iconSizeValue = _a.iconSizeValue, borderSizeValue = _a.borderSizeValue, rest = tslib_1.__rest(_a, ["color", "type", "iconSizeValue", "borderSizeValue"]);
|
|
10
|
+
return (react_1.default.createElement("div", tslib_1.__assign({ ref: ref }, rest)));
|
|
16
11
|
});
|
|
17
|
-
exports.StyledPresence = foundation_1.styled(exports._StyledPresence)(
|
|
12
|
+
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 ",
|
|
18
13
|
";\n"])), function (_a) {
|
|
19
14
|
var type = _a.type, iconSizeValue = _a.iconSizeValue, borderSizeValue = _a.borderSizeValue, color = _a.color;
|
|
20
|
-
return foundation_1.css(
|
|
15
|
+
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: ",
|
|
21
16
|
";\n ",
|
|
22
17
|
";\n ", " {\n svg {\n width: ", "px;\n height: ", "px;\n }\n }\n "])), iconSizeValue, iconSizeValue, color
|
|
23
18
|
? foundation_1.getParsePaletteColor(color)
|
|
@@ -27,4 +22,9 @@ exports.StyledPresence = foundation_1.styled(exports._StyledPresence)(templateOb
|
|
|
27
22
|
size: borderSizeValue,
|
|
28
23
|
}), Icon_1.RcIcon, iconSizeValue, iconSizeValue);
|
|
29
24
|
});
|
|
25
|
+
exports.PresenceContainer = foundation_1.styled.div(templateObject_4 || (templateObject_4 = tslib_1.__makeTemplateObject(["\n ", "\n"], ["\n ",
|
|
26
|
+
"\n"])), function (_a) {
|
|
27
|
+
var iconSizeValue = _a.iconSizeValue, borderSizeValue = _a.borderSizeValue;
|
|
28
|
+
return foundation_1.css(templateObject_3 || (templateObject_3 = 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);
|
|
29
|
+
});
|
|
30
30
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
@@ -208,40 +208,42 @@ var _MoreMenuTabs = react_1.forwardRef(function (props, ref) {
|
|
|
208
208
|
throttleCalculateGroupInfo();
|
|
209
209
|
}, [value], false);
|
|
210
210
|
foundation_1.useOnReRender(function () {
|
|
211
|
-
var e_4, _a;
|
|
212
211
|
var tabsInfo = getTabsInfoFromChildren(childrenProp);
|
|
213
212
|
var newGroupInfo = {
|
|
214
213
|
all: tabsInfo,
|
|
215
214
|
tab: [],
|
|
216
215
|
menu: [],
|
|
217
216
|
};
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
for (var tabsInfo_1 = tslib_1.__values(tabsInfo), tabsInfo_1_1 = tabsInfo_1.next(); !tabsInfo_1_1.done; tabsInfo_1_1 = tabsInfo_1.next()) {
|
|
233
|
-
var tabInfo = tabsInfo_1_1.value;
|
|
234
|
-
_loop_1(tabInfo);
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
238
|
-
finally {
|
|
217
|
+
setGroupInfo(function (preGroupInfo) {
|
|
218
|
+
var e_4, _a;
|
|
219
|
+
var _loop_1 = function (tabInfo) {
|
|
220
|
+
if (preGroupInfo.tab.some(function (_a) {
|
|
221
|
+
var key = _a.key;
|
|
222
|
+
return tabInfo.key === key;
|
|
223
|
+
})) {
|
|
224
|
+
newGroupInfo.tab.push(tabInfo);
|
|
225
|
+
}
|
|
226
|
+
else {
|
|
227
|
+
// push new tab or invisible old tab to menu group
|
|
228
|
+
newGroupInfo.menu.push(tabInfo);
|
|
229
|
+
}
|
|
230
|
+
};
|
|
239
231
|
try {
|
|
240
|
-
|
|
232
|
+
// Prevent moreButton from flickering after children update
|
|
233
|
+
for (var tabsInfo_1 = tslib_1.__values(tabsInfo), tabsInfo_1_1 = tabsInfo_1.next(); !tabsInfo_1_1.done; tabsInfo_1_1 = tabsInfo_1.next()) {
|
|
234
|
+
var tabInfo = tabsInfo_1_1.value;
|
|
235
|
+
_loop_1(tabInfo);
|
|
236
|
+
}
|
|
241
237
|
}
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
238
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
239
|
+
finally {
|
|
240
|
+
try {
|
|
241
|
+
if (tabsInfo_1_1 && !tabsInfo_1_1.done && (_a = tabsInfo_1.return)) _a.call(tabsInfo_1);
|
|
242
|
+
}
|
|
243
|
+
finally { if (e_4) throw e_4.error; }
|
|
244
|
+
}
|
|
245
|
+
return newGroupInfo;
|
|
246
|
+
});
|
|
245
247
|
}, [childrenProp], false);
|
|
246
248
|
react_1.useEffect(function () {
|
|
247
249
|
onGroupInfoChange === null || onGroupInfoChange === void 0 ? void 0 : onGroupInfoChange([
|
|
@@ -3,19 +3,14 @@ import React, { forwardRef } from 'react';
|
|
|
3
3
|
import { css, getParsePaletteColor, palette2, styled, fakeBorder, } from '../../../foundation';
|
|
4
4
|
import { RcIcon } from '../../Icon';
|
|
5
5
|
import { RcPresenceBackgroundColors } from '../utils';
|
|
6
|
-
export var PresenceContainer = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n"], ["\n ",
|
|
7
|
-
"\n"])), function (_a) {
|
|
8
|
-
var iconSizeValue = _a.iconSizeValue, borderSizeValue = _a.borderSizeValue;
|
|
9
|
-
return css(templateObject_1 || (templateObject_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);
|
|
10
|
-
});
|
|
11
6
|
export var _StyledPresence = forwardRef(function (_a, ref) {
|
|
12
|
-
var color = _a.color, type = _a.type, rest = __rest(_a, ["color", "type"]);
|
|
13
|
-
return React.createElement("div", __assign({ ref: ref }, rest));
|
|
7
|
+
var color = _a.color, type = _a.type, iconSizeValue = _a.iconSizeValue, borderSizeValue = _a.borderSizeValue, rest = __rest(_a, ["color", "type", "iconSizeValue", "borderSizeValue"]);
|
|
8
|
+
return (React.createElement("div", __assign({ ref: ref }, rest)));
|
|
14
9
|
});
|
|
15
|
-
export var StyledPresence = styled(_StyledPresence)(
|
|
10
|
+
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 ",
|
|
16
11
|
";\n"])), function (_a) {
|
|
17
12
|
var type = _a.type, iconSizeValue = _a.iconSizeValue, borderSizeValue = _a.borderSizeValue, color = _a.color;
|
|
18
|
-
return css(
|
|
13
|
+
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: ",
|
|
19
14
|
";\n ",
|
|
20
15
|
";\n ", " {\n svg {\n width: ", "px;\n height: ", "px;\n }\n }\n "])), iconSizeValue, iconSizeValue, color
|
|
21
16
|
? getParsePaletteColor(color)
|
|
@@ -25,4 +20,9 @@ export var StyledPresence = styled(_StyledPresence)(templateObject_4 || (templat
|
|
|
25
20
|
size: borderSizeValue,
|
|
26
21
|
}), RcIcon, iconSizeValue, iconSizeValue);
|
|
27
22
|
});
|
|
23
|
+
export var PresenceContainer = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n ", "\n"], ["\n ",
|
|
24
|
+
"\n"])), function (_a) {
|
|
25
|
+
var iconSizeValue = _a.iconSizeValue, borderSizeValue = _a.borderSizeValue;
|
|
26
|
+
return css(templateObject_3 || (templateObject_3 = __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);
|
|
27
|
+
});
|
|
28
28
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
@@ -206,40 +206,42 @@ var _MoreMenuTabs = forwardRef(function (props, ref) {
|
|
|
206
206
|
throttleCalculateGroupInfo();
|
|
207
207
|
}, [value], false);
|
|
208
208
|
useOnReRender(function () {
|
|
209
|
-
var e_4, _a;
|
|
210
209
|
var tabsInfo = getTabsInfoFromChildren(childrenProp);
|
|
211
210
|
var newGroupInfo = {
|
|
212
211
|
all: tabsInfo,
|
|
213
212
|
tab: [],
|
|
214
213
|
menu: [],
|
|
215
214
|
};
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
for (var tabsInfo_1 = __values(tabsInfo), tabsInfo_1_1 = tabsInfo_1.next(); !tabsInfo_1_1.done; tabsInfo_1_1 = tabsInfo_1.next()) {
|
|
231
|
-
var tabInfo = tabsInfo_1_1.value;
|
|
232
|
-
_loop_1(tabInfo);
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
236
|
-
finally {
|
|
215
|
+
setGroupInfo(function (preGroupInfo) {
|
|
216
|
+
var e_4, _a;
|
|
217
|
+
var _loop_1 = function (tabInfo) {
|
|
218
|
+
if (preGroupInfo.tab.some(function (_a) {
|
|
219
|
+
var key = _a.key;
|
|
220
|
+
return tabInfo.key === key;
|
|
221
|
+
})) {
|
|
222
|
+
newGroupInfo.tab.push(tabInfo);
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
// push new tab or invisible old tab to menu group
|
|
226
|
+
newGroupInfo.menu.push(tabInfo);
|
|
227
|
+
}
|
|
228
|
+
};
|
|
237
229
|
try {
|
|
238
|
-
|
|
230
|
+
// Prevent moreButton from flickering after children update
|
|
231
|
+
for (var tabsInfo_1 = __values(tabsInfo), tabsInfo_1_1 = tabsInfo_1.next(); !tabsInfo_1_1.done; tabsInfo_1_1 = tabsInfo_1.next()) {
|
|
232
|
+
var tabInfo = tabsInfo_1_1.value;
|
|
233
|
+
_loop_1(tabInfo);
|
|
234
|
+
}
|
|
239
235
|
}
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
236
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
237
|
+
finally {
|
|
238
|
+
try {
|
|
239
|
+
if (tabsInfo_1_1 && !tabsInfo_1_1.done && (_a = tabsInfo_1.return)) _a.call(tabsInfo_1);
|
|
240
|
+
}
|
|
241
|
+
finally { if (e_4) throw e_4.error; }
|
|
242
|
+
}
|
|
243
|
+
return newGroupInfo;
|
|
244
|
+
});
|
|
243
245
|
}, [childrenProp], false);
|
|
244
246
|
useEffect(function () {
|
|
245
247
|
onGroupInfoChange === null || onGroupInfoChange === void 0 ? void 0 : onGroupInfoChange([
|
|
@@ -44,7 +44,7 @@ export var useTouchMouseEvent = function (_a, _b) {
|
|
|
44
44
|
var isInside;
|
|
45
45
|
if (actionRef && e.touches.length < 2 && e.changedTouches.length < 2) {
|
|
46
46
|
var touch = e.touches[0] || e.changedTouches[0];
|
|
47
|
-
var elm = document.elementFromPoint(touch.
|
|
47
|
+
var elm = document.elementFromPoint(touch.clientX, touch.clientY);
|
|
48
48
|
isInside = !!elm && checkInside(elm);
|
|
49
49
|
}
|
|
50
50
|
onTouchEndArg === null || onTouchEndArg === void 0 ? void 0 : onTouchEndArg(e, isInside);
|
|
@@ -46,7 +46,7 @@ exports.useTouchMouseEvent = function (_a, _b) {
|
|
|
46
46
|
var isInside;
|
|
47
47
|
if (actionRef && e.touches.length < 2 && e.changedTouches.length < 2) {
|
|
48
48
|
var touch = e.touches[0] || e.changedTouches[0];
|
|
49
|
-
var elm = document.elementFromPoint(touch.
|
|
49
|
+
var elm = document.elementFromPoint(touch.clientX, touch.clientY);
|
|
50
50
|
isInside = !!elm && checkInside(elm);
|
|
51
51
|
}
|
|
52
52
|
onTouchEndArg === null || onTouchEndArg === void 0 ? void 0 : onTouchEndArg(e, isInside);
|