@microsoft/omnichannel-chat-components 0.1.0-main.d899dd1 → 0.1.0-main.e170704
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.
|
@@ -34,17 +34,24 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
34
34
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
35
35
|
|
|
36
36
|
function NotificationBubble(props, parentId) {
|
|
37
|
-
var _props$styleProps, _props$controlProps
|
|
37
|
+
var _props$styleProps, _props$controlProps;
|
|
38
38
|
|
|
39
39
|
const notificationBubbleStyles = {
|
|
40
40
|
root: Object.assign({}, _defaultChatButtonNotificationBubbleStyles.defaultChatButtonNotificationBubbleStyles, (_props$styleProps = props.styleProps) === null || _props$styleProps === void 0 ? void 0 : _props$styleProps.notificationBubbleStyleProps)
|
|
41
41
|
};
|
|
42
42
|
const unreadMessageCount = ((_props$controlProps = props.controlProps) === null || _props$controlProps === void 0 ? void 0 : _props$controlProps.unreadMessageCount) ?? (_defaultChatButtonControlProps.defaultChatButtonControlProps === null || _defaultChatButtonControlProps.defaultChatButtonControlProps === void 0 ? void 0 : _defaultChatButtonControlProps.defaultChatButtonControlProps.unreadMessageCount);
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
|
|
44
|
+
if (unreadMessageCount !== "0") {
|
|
45
|
+
var _props$componentOverr, _props$styleProps2, _props$styleProps2$cl;
|
|
46
|
+
|
|
47
|
+
return (0, _decodeComponentString.decodeComponentString)((_props$componentOverr = props.componentOverrides) === null || _props$componentOverr === void 0 ? void 0 : _props$componentOverr.notificationBubble) || /*#__PURE__*/_react2.default.createElement(_react.Label, {
|
|
48
|
+
styles: notificationBubbleStyles,
|
|
49
|
+
className: (_props$styleProps2 = props.styleProps) === null || _props$styleProps2 === void 0 ? void 0 : (_props$styleProps2$cl = _props$styleProps2.classNames) === null || _props$styleProps2$cl === void 0 ? void 0 : _props$styleProps2$cl.notificationBubbleClassName,
|
|
50
|
+
id: parentId + "-notification-bubble"
|
|
51
|
+
}, unreadMessageCount);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return null;
|
|
48
55
|
}
|
|
49
56
|
|
|
50
57
|
function IconContainer(props, parentId) {
|
|
@@ -12,17 +12,24 @@ import { defaultChatButtonTextContainerStyles } from "./common/defaultStyles/def
|
|
|
12
12
|
import { defaultChatButtonTitleStyles } from "./common/defaultStyles/defaultChatButtonTitleStyles";
|
|
13
13
|
|
|
14
14
|
function NotificationBubble(props, parentId) {
|
|
15
|
-
var _props$styleProps, _props$controlProps
|
|
15
|
+
var _props$styleProps, _props$controlProps;
|
|
16
16
|
|
|
17
17
|
const notificationBubbleStyles = {
|
|
18
18
|
root: Object.assign({}, defaultChatButtonNotificationBubbleStyles, (_props$styleProps = props.styleProps) === null || _props$styleProps === void 0 ? void 0 : _props$styleProps.notificationBubbleStyleProps)
|
|
19
19
|
};
|
|
20
20
|
const unreadMessageCount = ((_props$controlProps = props.controlProps) === null || _props$controlProps === void 0 ? void 0 : _props$controlProps.unreadMessageCount) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.unreadMessageCount);
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
|
|
22
|
+
if (unreadMessageCount !== "0") {
|
|
23
|
+
var _props$componentOverr, _props$styleProps2, _props$styleProps2$cl;
|
|
24
|
+
|
|
25
|
+
return decodeComponentString((_props$componentOverr = props.componentOverrides) === null || _props$componentOverr === void 0 ? void 0 : _props$componentOverr.notificationBubble) || /*#__PURE__*/React.createElement(Label, {
|
|
26
|
+
styles: notificationBubbleStyles,
|
|
27
|
+
className: (_props$styleProps2 = props.styleProps) === null || _props$styleProps2 === void 0 ? void 0 : (_props$styleProps2$cl = _props$styleProps2.classNames) === null || _props$styleProps2$cl === void 0 ? void 0 : _props$styleProps2$cl.notificationBubbleClassName,
|
|
28
|
+
id: parentId + "-notification-bubble"
|
|
29
|
+
}, unreadMessageCount);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return null;
|
|
26
33
|
}
|
|
27
34
|
|
|
28
35
|
function IconContainer(props, parentId) {
|
package/package.json
CHANGED