@microsoft/omnichannel-chat-components 0.1.0-main.2eda736 → 0.1.0-main.353ecff
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/lib/cjs/common/Constants.js +11 -2
- package/lib/cjs/components/callingcontainer/subcomponents/CurrentCall/CurrentCall.js +30 -0
- package/lib/cjs/components/callingcontainer/subcomponents/CurrentCall/common/defaultStyles/customizedCurrentCallStyleProps.js +0 -12
- package/lib/cjs/components/callingcontainer/subcomponents/CurrentCall/common/defaultStyles/defaultCurrentCallStyleProps.js +0 -12
- package/lib/cjs/components/callingcontainer/subcomponents/IncomingCall/IncomingCall.js +30 -0
- package/lib/cjs/components/chatbutton/ChatButton.js +36 -26
- package/lib/cjs/components/chatbutton/common/defaultProps/defaultChatButtonControlProps.js +3 -1
- package/lib/cjs/components/common/commandbutton/CommandButton.js +6 -8
- package/lib/cjs/components/confirmationpane/ConfirmationPane.js +12 -10
- package/lib/cjs/components/footer/subcomponents/AudioNotificationButton.js +4 -9
- package/lib/cjs/components/inputvalidationpane/InputValidationPane.js +48 -18
- package/lib/cjs/components/prechatsurveypane/PreChatSurveyPane.js +5 -4
- package/lib/cjs/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneButtonStyles.js +2 -1
- package/lib/cjs/components/proactivechatpane/ProactiveChatPane.js +17 -15
- package/lib/cjs/components/reconnectchatpane/ReconnectChatPane.js +14 -12
- package/lib/esm/common/Constants.js +9 -1
- package/lib/esm/components/callingcontainer/subcomponents/CurrentCall/CurrentCall.js +32 -2
- package/lib/esm/components/callingcontainer/subcomponents/CurrentCall/common/defaultStyles/customizedCurrentCallStyleProps.js +0 -12
- package/lib/esm/components/callingcontainer/subcomponents/CurrentCall/common/defaultStyles/defaultCurrentCallStyleProps.js +0 -12
- package/lib/esm/components/callingcontainer/subcomponents/IncomingCall/IncomingCall.js +32 -2
- package/lib/esm/components/chatbutton/ChatButton.js +36 -26
- package/lib/esm/components/chatbutton/common/defaultProps/defaultChatButtonControlProps.js +3 -1
- package/lib/esm/components/common/commandbutton/CommandButton.js +6 -8
- package/lib/esm/components/confirmationpane/ConfirmationPane.js +12 -10
- package/lib/esm/components/footer/subcomponents/AudioNotificationButton.js +4 -9
- package/lib/esm/components/inputvalidationpane/InputValidationPane.js +48 -18
- package/lib/esm/components/prechatsurveypane/PreChatSurveyPane.js +5 -4
- package/lib/esm/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneButtonStyles.js +2 -1
- package/lib/esm/components/proactivechatpane/ProactiveChatPane.js +17 -15
- package/lib/esm/components/reconnectchatpane/ReconnectChatPane.js +14 -12
- package/lib/types/common/Constants.d.ts +7 -0
- package/lib/types/components/callingcontainer/subcomponents/CurrentCall/interfaces/ICurrentCallStyleProps.d.ts +0 -4
- package/lib/types/components/chatbutton/interfaces/IChatButtonControlProps.d.ts +2 -0
- package/lib/types/components/prechatsurveypane/interfaces/IPreChatSurveyPaneButtonStyles.d.ts +1 -0
- package/package.json +3 -6
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.Regex = exports.KeyCodes = exports.ElementType = exports.BROADCAST_CHANNEL_NAME = exports.AccessibilityBrightnessRatio = void 0;
|
|
6
|
+
exports.Regex = exports.KeyCodes = exports.HiddenTextStyles = exports.ElementType = exports.BROADCAST_CHANNEL_NAME = exports.AccessibilityBrightnessRatio = void 0;
|
|
7
7
|
|
|
8
8
|
var _class, _class2;
|
|
9
9
|
|
|
@@ -16,7 +16,16 @@ const AccessibilityBrightnessRatio = 1.2;
|
|
|
16
16
|
exports.AccessibilityBrightnessRatio = AccessibilityBrightnessRatio;
|
|
17
17
|
const BROADCAST_CHANNEL_NAME = "omnichannel_broadcast_channel";
|
|
18
18
|
exports.BROADCAST_CHANNEL_NAME = BROADCAST_CHANNEL_NAME;
|
|
19
|
-
const
|
|
19
|
+
const HiddenTextStyles = {
|
|
20
|
+
position: "absolute",
|
|
21
|
+
height: "1px",
|
|
22
|
+
width: "1px",
|
|
23
|
+
overflow: "hidden",
|
|
24
|
+
clip: "rect(1px, 1px, 1px, 1px)",
|
|
25
|
+
whiteSpace: "nowrap"
|
|
26
|
+
};
|
|
27
|
+
exports.HiddenTextStyles = HiddenTextStyles;
|
|
28
|
+
const KeyCodes = (_class = class KeyCodes {}, _defineProperty(_class, "ENTER", "Enter"), _defineProperty(_class, "ESCAPE", "Escape"), _defineProperty(_class, "SPACE", "Space"), _defineProperty(_class, "DeclineCallHotKey", "D"), _defineProperty(_class, "AcceptAudioCallHotKey", "S"), _defineProperty(_class, "AcceptVideoCallHotKey", "A"), _defineProperty(_class, "ToggleMicHotKey", "M"), _defineProperty(_class, "ToggleCameraHotKey", "O"), _class);
|
|
20
29
|
exports.KeyCodes = KeyCodes;
|
|
21
30
|
const Regex = (_class2 = class Regex {}, _defineProperty(_class2, "EmailRegex", "(?:[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-zA-Z0-9-]*[a-zA-Z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])"), _defineProperty(_class2, "URLRegex", /(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})/gi), _class2);
|
|
22
31
|
exports.Regex = Regex;
|
|
@@ -213,6 +213,36 @@ function CurrentCall(props) {
|
|
|
213
213
|
}
|
|
214
214
|
}, []);
|
|
215
215
|
const hideCallTimer = ((_props$controlProps68 = props.controlProps) === null || _props$controlProps68 === void 0 ? void 0 : _props$controlProps68.hideCallTimer) ?? ((_defaultCurrentCallPr72 = _defaultCurrentCallProps.defaultCurrentCallProps.controlProps) === null || _defaultCurrentCallPr72 === void 0 ? void 0 : _defaultCurrentCallPr72.hideCallTimer);
|
|
216
|
+
(0, React.useEffect)(() => {
|
|
217
|
+
const endCallShortcut = e => e.key === _Constants.KeyCodes.ENTER;
|
|
218
|
+
|
|
219
|
+
const toggleMicShortcut = e => e.ctrlKey && e.shiftKey && e.key === _Constants.KeyCodes.ToggleMicHotKey;
|
|
220
|
+
|
|
221
|
+
const toggleVideoShortcut = e => e.ctrlKey && e.shiftKey && e.key === _Constants.KeyCodes.ToggleCameraHotKey;
|
|
222
|
+
|
|
223
|
+
const shortcutKeysHandler = e => {
|
|
224
|
+
if (endCallShortcut(e)) {
|
|
225
|
+
handleEndCallClick();
|
|
226
|
+
} else if (toggleMicShortcut(e)) {
|
|
227
|
+
handleMicClick();
|
|
228
|
+
} else if (toggleVideoShortcut(e)) {
|
|
229
|
+
handleVideoOffClick();
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
const ignoreDefault = e => {
|
|
234
|
+
if (endCallShortcut(e) || toggleMicShortcut(e) || toggleVideoShortcut(e)) {
|
|
235
|
+
e.preventDefault();
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
window.addEventListener("keyup", shortcutKeysHandler);
|
|
240
|
+
window.addEventListener("keydown", ignoreDefault);
|
|
241
|
+
return () => {
|
|
242
|
+
window.removeEventListener("keyup", shortcutKeysHandler);
|
|
243
|
+
window.removeEventListener("keydown", ignoreDefault);
|
|
244
|
+
};
|
|
245
|
+
}, []);
|
|
216
246
|
return /*#__PURE__*/React.createElement(_react2.Stack, {
|
|
217
247
|
className: (_props$styleProps13 = props.styleProps) === null || _props$styleProps13 === void 0 ? void 0 : (_props$styleProps13$c = _props$styleProps13.classNames) === null || _props$styleProps13$c === void 0 ? void 0 : _props$styleProps13$c.currentCallComponentClassName,
|
|
218
248
|
horizontalAlign: "space-between",
|
|
@@ -53,18 +53,6 @@ const customizedCurrentCallStyleProps = {
|
|
|
53
53
|
width: "50px",
|
|
54
54
|
margin: "1px"
|
|
55
55
|
},
|
|
56
|
-
currentCallTimerStyleProps: {
|
|
57
|
-
borderRadius: "2px",
|
|
58
|
-
margin: "1px",
|
|
59
|
-
color: "white",
|
|
60
|
-
paddingTop: "18px",
|
|
61
|
-
fontSize: 12,
|
|
62
|
-
fontFamily: "Segoe UI, Arial, sans-serif",
|
|
63
|
-
backgroundColor: "transparent",
|
|
64
|
-
height: "50px",
|
|
65
|
-
width: "55px",
|
|
66
|
-
textAlign: "center"
|
|
67
|
-
},
|
|
68
56
|
videoTileStyleProps: {
|
|
69
57
|
minHeight: "180px",
|
|
70
58
|
height: "300px",
|
|
@@ -45,18 +45,6 @@ const defaultCurrentCallStyleProps = {
|
|
|
45
45
|
width: "50px",
|
|
46
46
|
fontSize: "18px"
|
|
47
47
|
},
|
|
48
|
-
currentCallTimerStyleProps: {
|
|
49
|
-
borderRadius: "2px",
|
|
50
|
-
margin: "1px",
|
|
51
|
-
color: "#FFFFFF",
|
|
52
|
-
paddingTop: "18px",
|
|
53
|
-
fontSize: 12,
|
|
54
|
-
fontFamily: "Segoe UI, Arial, sans-serif",
|
|
55
|
-
backgroundColor: "darkgrey",
|
|
56
|
-
height: "45px",
|
|
57
|
-
width: "50px",
|
|
58
|
-
textAlign: "center"
|
|
59
|
-
},
|
|
60
48
|
videoTileStyleProps: {
|
|
61
49
|
width: "100%",
|
|
62
50
|
marginLeft: "auto",
|
|
@@ -102,6 +102,36 @@ function IncomingCall(props) {
|
|
|
102
102
|
(_props$controlProps17 = props.controlProps) === null || _props$controlProps17 === void 0 ? void 0 : _props$controlProps17.onAudioCallClick();
|
|
103
103
|
}
|
|
104
104
|
}, []);
|
|
105
|
+
(0, React.useEffect)(() => {
|
|
106
|
+
const declineCallShortcut = e => e.ctrlKey && e.shiftKey && e.key === _Constants.KeyCodes.DeclineCallHotKey;
|
|
107
|
+
|
|
108
|
+
const acceptAudioCallShortcut = e => e.ctrlKey && e.shiftKey && e.key === _Constants.KeyCodes.AcceptAudioCallHotKey;
|
|
109
|
+
|
|
110
|
+
const acceptVideoCallShortcut = e => e.ctrlKey && e.shiftKey && e.key === _Constants.KeyCodes.AcceptVideoCallHotKey;
|
|
111
|
+
|
|
112
|
+
const shortcutKeysHandler = e => {
|
|
113
|
+
if (declineCallShortcut(e)) {
|
|
114
|
+
handleDeclineCallClick();
|
|
115
|
+
} else if (acceptAudioCallShortcut(e)) {
|
|
116
|
+
handleAudioCallClick();
|
|
117
|
+
} else if (acceptVideoCallShortcut(e)) {
|
|
118
|
+
handleVideoCallClick();
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
const ignoreDefault = e => {
|
|
123
|
+
if (declineCallShortcut(e) || acceptAudioCallShortcut(e) || acceptVideoCallShortcut(e)) {
|
|
124
|
+
e.preventDefault();
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
window.addEventListener("keyup", shortcutKeysHandler);
|
|
129
|
+
window.addEventListener("keydown", ignoreDefault);
|
|
130
|
+
return () => {
|
|
131
|
+
window.removeEventListener("keyup", shortcutKeysHandler);
|
|
132
|
+
window.removeEventListener("keydown", ignoreDefault);
|
|
133
|
+
};
|
|
134
|
+
}, []);
|
|
105
135
|
return /*#__PURE__*/React.createElement(_react2.Stack, {
|
|
106
136
|
horizontal: true,
|
|
107
137
|
className: (_props$styleProps10 = props.styleProps) === null || _props$styleProps10 === void 0 ? void 0 : _props$styleProps10.className,
|
|
@@ -34,17 +34,27 @@ 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, _props$controlProps2;
|
|
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.Stack, {
|
|
48
|
+
role: "alert",
|
|
49
|
+
styles: notificationBubbleStyles,
|
|
50
|
+
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,
|
|
51
|
+
id: parentId + "-notification-bubble"
|
|
52
|
+
}, unreadMessageCount, /*#__PURE__*/_react2.default.createElement("span", {
|
|
53
|
+
style: _Constants.HiddenTextStyles
|
|
54
|
+
}, (_props$controlProps2 = props.controlProps) === null || _props$controlProps2 === void 0 ? void 0 : _props$controlProps2.unreadMessageString));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return null;
|
|
48
58
|
}
|
|
49
59
|
|
|
50
60
|
function IconContainer(props, parentId) {
|
|
@@ -61,7 +71,7 @@ function IconContainer(props, parentId) {
|
|
|
61
71
|
}
|
|
62
72
|
|
|
63
73
|
function TextContainer(props, parentId) {
|
|
64
|
-
var _props$styleProps5, _props$styleProps6, _props$styleProps7, _props$
|
|
74
|
+
var _props$styleProps5, _props$styleProps6, _props$styleProps7, _props$controlProps3, _props$controlProps4, _props$controlProps5, _props$controlProps6, _props$controlProps7, _props$controlProps8, _props$componentOverr3, _props$styleProps8, _props$styleProps8$cl, _props$componentOverr4, _props$styleProps9, _props$styleProps9$cl, _props$componentOverr5, _props$styleProps10, _props$styleProps10$c;
|
|
65
75
|
|
|
66
76
|
const textContainerStyles = {
|
|
67
77
|
root: Object.assign({}, _defaultChatButtonTextContainerStyles.defaultChatButtonTextContainerStyles, (_props$styleProps5 = props.styleProps) === null || _props$styleProps5 === void 0 ? void 0 : _props$styleProps5.textContainerStyleProps)
|
|
@@ -72,12 +82,12 @@ function TextContainer(props, parentId) {
|
|
|
72
82
|
const subtitleStyles = {
|
|
73
83
|
root: Object.assign({}, _defaultChatButtonSubTitleStyles.defaultChatButtonSubTitleStyles, (_props$styleProps7 = props.styleProps) === null || _props$styleProps7 === void 0 ? void 0 : _props$styleProps7.subtitleStyleProps)
|
|
74
84
|
};
|
|
75
|
-
const hideChatTitle = ((_props$
|
|
76
|
-
const hideChatSubtitle = ((_props$
|
|
77
|
-
const titleDir = ((_props$
|
|
78
|
-
const titleText = ((_props$
|
|
79
|
-
const subtitleDir = ((_props$
|
|
80
|
-
const subtitleText = ((_props$
|
|
85
|
+
const hideChatTitle = ((_props$controlProps3 = props.controlProps) === null || _props$controlProps3 === void 0 ? void 0 : _props$controlProps3.hideChatTitle) ?? (_defaultChatButtonControlProps.defaultChatButtonControlProps === null || _defaultChatButtonControlProps.defaultChatButtonControlProps === void 0 ? void 0 : _defaultChatButtonControlProps.defaultChatButtonControlProps.hideChatTitle);
|
|
86
|
+
const hideChatSubtitle = ((_props$controlProps4 = props.controlProps) === null || _props$controlProps4 === void 0 ? void 0 : _props$controlProps4.hideChatSubtitle) ?? (_defaultChatButtonControlProps.defaultChatButtonControlProps === null || _defaultChatButtonControlProps.defaultChatButtonControlProps === void 0 ? void 0 : _defaultChatButtonControlProps.defaultChatButtonControlProps.hideChatSubtitle);
|
|
87
|
+
const titleDir = ((_props$controlProps5 = props.controlProps) === null || _props$controlProps5 === void 0 ? void 0 : _props$controlProps5.dir) ?? (_defaultChatButtonControlProps.defaultChatButtonControlProps === null || _defaultChatButtonControlProps.defaultChatButtonControlProps === void 0 ? void 0 : _defaultChatButtonControlProps.defaultChatButtonControlProps.dir);
|
|
88
|
+
const titleText = ((_props$controlProps6 = props.controlProps) === null || _props$controlProps6 === void 0 ? void 0 : _props$controlProps6.titleText) ?? (_defaultChatButtonControlProps.defaultChatButtonControlProps === null || _defaultChatButtonControlProps.defaultChatButtonControlProps === void 0 ? void 0 : _defaultChatButtonControlProps.defaultChatButtonControlProps.titleText);
|
|
89
|
+
const subtitleDir = ((_props$controlProps7 = props.controlProps) === null || _props$controlProps7 === void 0 ? void 0 : _props$controlProps7.dir) ?? (_defaultChatButtonControlProps.defaultChatButtonControlProps === null || _defaultChatButtonControlProps.defaultChatButtonControlProps === void 0 ? void 0 : _defaultChatButtonControlProps.defaultChatButtonControlProps.dir);
|
|
90
|
+
const subtitleText = ((_props$controlProps8 = props.controlProps) === null || _props$controlProps8 === void 0 ? void 0 : _props$controlProps8.subtitleText) ?? (_defaultChatButtonControlProps.defaultChatButtonControlProps === null || _defaultChatButtonControlProps.defaultChatButtonControlProps === void 0 ? void 0 : _defaultChatButtonControlProps.defaultChatButtonControlProps.subtitleText);
|
|
81
91
|
return (0, _decodeComponentString.decodeComponentString)((_props$componentOverr3 = props.componentOverrides) === null || _props$componentOverr3 === void 0 ? void 0 : _props$componentOverr3.textContainer) || /*#__PURE__*/_react2.default.createElement(_react.Stack, {
|
|
82
92
|
styles: textContainerStyles,
|
|
83
93
|
className: (_props$styleProps8 = props.styleProps) === null || _props$styleProps8 === void 0 ? void 0 : (_props$styleProps8$cl = _props$styleProps8.classNames) === null || _props$styleProps8$cl === void 0 ? void 0 : _props$styleProps8$cl.textContainerClassName,
|
|
@@ -98,23 +108,23 @@ function TextContainer(props, parentId) {
|
|
|
98
108
|
}
|
|
99
109
|
|
|
100
110
|
function ChatButton(props) {
|
|
101
|
-
var _props$
|
|
102
|
-
|
|
103
|
-
const elementId = ((_props$
|
|
104
|
-
const defaultAriaLabel = ((_props$
|
|
105
|
-
const defaultRole = ((_props$
|
|
106
|
-
const containersDir = ((_props$
|
|
107
|
-
const hideChatButton = ((_props$
|
|
108
|
-
const hideChatIcon = ((_props$
|
|
109
|
-
const hideChatTextContainer = ((_props$
|
|
110
|
-
const hideNotificationBubble = ((_props$
|
|
111
|
+
var _props$controlProps9, _props$controlProps10, _props$controlProps11, _props$controlProps12, _props$controlProps13, _props$controlProps14, _props$controlProps15, _props$controlProps16, _props$styleProps11;
|
|
112
|
+
|
|
113
|
+
const elementId = ((_props$controlProps9 = props.controlProps) === null || _props$controlProps9 === void 0 ? void 0 : _props$controlProps9.id) ?? "lcw-components-chat-button";
|
|
114
|
+
const defaultAriaLabel = ((_props$controlProps10 = props.controlProps) === null || _props$controlProps10 === void 0 ? void 0 : _props$controlProps10.ariaLabel) ?? "live chat button";
|
|
115
|
+
const defaultRole = ((_props$controlProps11 = props.controlProps) === null || _props$controlProps11 === void 0 ? void 0 : _props$controlProps11.role) ?? (_defaultChatButtonControlProps.defaultChatButtonControlProps === null || _defaultChatButtonControlProps.defaultChatButtonControlProps === void 0 ? void 0 : _defaultChatButtonControlProps.defaultChatButtonControlProps.role);
|
|
116
|
+
const containersDir = ((_props$controlProps12 = props.controlProps) === null || _props$controlProps12 === void 0 ? void 0 : _props$controlProps12.dir) ?? (_defaultChatButtonControlProps.defaultChatButtonControlProps === null || _defaultChatButtonControlProps.defaultChatButtonControlProps === void 0 ? void 0 : _defaultChatButtonControlProps.defaultChatButtonControlProps.dir);
|
|
117
|
+
const hideChatButton = ((_props$controlProps13 = props.controlProps) === null || _props$controlProps13 === void 0 ? void 0 : _props$controlProps13.hideChatButton) ?? (_defaultChatButtonControlProps.defaultChatButtonControlProps === null || _defaultChatButtonControlProps.defaultChatButtonControlProps === void 0 ? void 0 : _defaultChatButtonControlProps.defaultChatButtonControlProps.hideChatButton);
|
|
118
|
+
const hideChatIcon = ((_props$controlProps14 = props.controlProps) === null || _props$controlProps14 === void 0 ? void 0 : _props$controlProps14.hideChatIcon) ?? (_defaultChatButtonControlProps.defaultChatButtonControlProps === null || _defaultChatButtonControlProps.defaultChatButtonControlProps === void 0 ? void 0 : _defaultChatButtonControlProps.defaultChatButtonControlProps.hideChatIcon);
|
|
119
|
+
const hideChatTextContainer = ((_props$controlProps15 = props.controlProps) === null || _props$controlProps15 === void 0 ? void 0 : _props$controlProps15.hideChatTextContainer) ?? (_defaultChatButtonControlProps.defaultChatButtonControlProps === null || _defaultChatButtonControlProps.defaultChatButtonControlProps === void 0 ? void 0 : _defaultChatButtonControlProps.defaultChatButtonControlProps.hideChatTextContainer);
|
|
120
|
+
const hideNotificationBubble = ((_props$controlProps16 = props.controlProps) === null || _props$controlProps16 === void 0 ? void 0 : _props$controlProps16.hideNotificationBubble) ?? (_defaultChatButtonControlProps.defaultChatButtonControlProps === null || _defaultChatButtonControlProps.defaultChatButtonControlProps === void 0 ? void 0 : _defaultChatButtonControlProps.defaultChatButtonControlProps.hideNotificationBubble);
|
|
111
121
|
const chatButtonGroupStyles = {
|
|
112
122
|
root: Object.assign({}, _defaultChatButtonGeneralStyles.defaultChatButtonGeneralStyles, (_props$styleProps11 = props.styleProps) === null || _props$styleProps11 === void 0 ? void 0 : _props$styleProps11.generalStyleProps)
|
|
113
123
|
};
|
|
114
124
|
const handleInitiateChatClick = (0, _react2.useCallback)(() => {
|
|
115
|
-
var _props$
|
|
125
|
+
var _props$controlProps17;
|
|
116
126
|
|
|
117
|
-
if ((_props$
|
|
127
|
+
if ((_props$controlProps17 = props.controlProps) !== null && _props$controlProps17 !== void 0 && _props$controlProps17.onClick) {
|
|
118
128
|
const customEvent = {
|
|
119
129
|
elementType: _Constants.ElementType.ChatButton,
|
|
120
130
|
elementId: elementId,
|
|
@@ -143,7 +153,7 @@ function ChatButton(props) {
|
|
|
143
153
|
onClick: handleInitiateChatClick,
|
|
144
154
|
onKeyDown: handleInputKeyDown,
|
|
145
155
|
"aria-label": defaultAriaLabel
|
|
146
|
-
}, !hideChatIcon && IconContainer(props, elementId), !
|
|
156
|
+
}, !hideChatIcon && IconContainer(props, elementId), !hideNotificationBubble && NotificationBubble(props, elementId), !hideChatTextContainer && TextContainer(props, elementId)));
|
|
147
157
|
}
|
|
148
158
|
|
|
149
159
|
var _default = ChatButton;
|
|
@@ -20,6 +20,8 @@ const defaultChatButtonControlProps = {
|
|
|
20
20
|
hideChatTextContainer: false,
|
|
21
21
|
hideChatSubtitle: false,
|
|
22
22
|
hideChatTitle: false,
|
|
23
|
-
hideNotificationBubble: true
|
|
23
|
+
hideNotificationBubble: true,
|
|
24
|
+
unreadMessageString: "new messages",
|
|
25
|
+
largeUnreadMessageString: "99+"
|
|
24
26
|
};
|
|
25
27
|
exports.defaultChatButtonControlProps = defaultChatButtonControlProps;
|
|
@@ -22,15 +22,13 @@ function CommandButton(props) {
|
|
|
22
22
|
const iconProp = props.imageIconProps ? {
|
|
23
23
|
imageProps: props.imageIconProps
|
|
24
24
|
} : {
|
|
25
|
-
iconName: props.iconName
|
|
26
|
-
styles: {
|
|
27
|
-
root: props.styles
|
|
28
|
-
}
|
|
25
|
+
iconName: props.iconName
|
|
29
26
|
};
|
|
30
|
-
const
|
|
27
|
+
const buttonStyles = {
|
|
31
28
|
root: props.styles,
|
|
32
29
|
rootHovered: props.hoverStyles,
|
|
33
|
-
rootFocused: props.focusStyles
|
|
30
|
+
rootFocused: props.focusStyles,
|
|
31
|
+
rootPressed: props.hoverStyles
|
|
34
32
|
};
|
|
35
33
|
const handleOnClick = (0, _react2.useCallback)(() => {
|
|
36
34
|
if (props !== null && props !== void 0 && props.onClick) {
|
|
@@ -52,14 +50,14 @@ function CommandButton(props) {
|
|
|
52
50
|
onClick: handleOnClick,
|
|
53
51
|
disabled: props.disabled,
|
|
54
52
|
className: props.className,
|
|
55
|
-
styles:
|
|
53
|
+
styles: buttonStyles
|
|
56
54
|
}), props.type === "icon" && /*#__PURE__*/_react2.default.createElement(_react.IconButton, {
|
|
57
55
|
id: props.id,
|
|
58
56
|
iconProps: iconProp,
|
|
59
57
|
title: props.ariaLabel,
|
|
60
58
|
ariaLabel: props.ariaLabel,
|
|
61
59
|
disabled: props.disabled,
|
|
62
|
-
styles:
|
|
60
|
+
styles: buttonStyles,
|
|
63
61
|
onClick: handleOnClick,
|
|
64
62
|
className: props.className
|
|
65
63
|
}));
|
|
@@ -44,7 +44,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
44
44
|
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; }
|
|
45
45
|
|
|
46
46
|
function ConfirmationPane(props) {
|
|
47
|
-
var _props$controlProps, _props$styleProps, _props$styleProps2, _props$styleProps3, _props$styleProps4, _props$styleProps5, _props$styleProps6, _props$styleProps7, _props$styleProps8, _props$styleProps9, _props$styleProps10, _props$controlProps6, _props$controlProps7, _props$controlProps8, _props$componentOverr, _props$
|
|
47
|
+
var _props$controlProps, _props$styleProps, _props$styleProps2, _props$styleProps3, _props$styleProps4, _props$styleProps5, _props$styleProps6, _props$styleProps7, _props$styleProps8, _props$styleProps9, _props$styleProps10, _props$styleProps11, _props$styleProps12, _props$controlProps6, _props$controlProps7, _props$controlProps8, _props$componentOverr, _props$styleProps13, _props$styleProps13$c, _props$controlProps9, _props$controlProps10, _props$componentOverr2, _props$styleProps14, _props$styleProps14$c, _props$controlProps11, _props$styleProps15, _props$styleProps15$c, _props$controlProps12, _props$componentOverr3, _props$styleProps16, _props$styleProps16$c, _props$controlProps13, _props$controlProps14, _props$controlProps15, _props$componentOverr4, _props$styleProps17, _props$styleProps17$c, _props$controlProps16, _props$controlProps17;
|
|
48
48
|
|
|
49
49
|
const elementId = ((_props$controlProps = props.controlProps) === null || _props$controlProps === void 0 ? void 0 : _props$controlProps.id) ?? _defaultConfirmationPaneControlProps.defaultConfirmationPaneControlProps.id;
|
|
50
50
|
const handleConfirmClick = (0, _react2.useCallback)(() => {
|
|
@@ -96,12 +96,14 @@ function ConfirmationPane(props) {
|
|
|
96
96
|
const confirmButtonStyles = {
|
|
97
97
|
root: Object.assign({}, _defaultConfirmationPaneConfirmButtonStyles.defaultConfirmationPaneConfirmButtonStyles, (_props$styleProps5 = props.styleProps) === null || _props$styleProps5 === void 0 ? void 0 : _props$styleProps5.confirmButtonStyleProps),
|
|
98
98
|
rootHovered: Object.assign({}, _defaultConfirmationPaneConfirmButtonHoveredStyles.defaultConfirmationPaneConfirmButtonHoveredStyles, (_props$styleProps6 = props.styleProps) === null || _props$styleProps6 === void 0 ? void 0 : _props$styleProps6.confirmButtonHoveredStyleProps),
|
|
99
|
-
rootFocused: Object.assign({}, _defaultConfirmationPaneConfirmButtonFocusedStyles.defaultConfirmationPaneConfirmButtonFocusedStyles, (_props$styleProps7 = props.styleProps) === null || _props$styleProps7 === void 0 ? void 0 : _props$styleProps7.confirmButtonFocusedStyleProps)
|
|
99
|
+
rootFocused: Object.assign({}, _defaultConfirmationPaneConfirmButtonFocusedStyles.defaultConfirmationPaneConfirmButtonFocusedStyles, (_props$styleProps7 = props.styleProps) === null || _props$styleProps7 === void 0 ? void 0 : _props$styleProps7.confirmButtonFocusedStyleProps),
|
|
100
|
+
rootPressed: Object.assign({}, _defaultConfirmationPaneConfirmButtonHoveredStyles.defaultConfirmationPaneConfirmButtonHoveredStyles, (_props$styleProps8 = props.styleProps) === null || _props$styleProps8 === void 0 ? void 0 : _props$styleProps8.confirmButtonHoveredStyleProps)
|
|
100
101
|
};
|
|
101
102
|
const cancelButtonStyles = {
|
|
102
|
-
root: Object.assign({}, _defaultConfirmationPaneCancelButtonStyles.defaultConfirmationPaneCancelButtonStyles, (_props$
|
|
103
|
-
rootHovered: Object.assign({}, _defaultConfirmationPaneCancelButtonHoveredStyles.defaultConfirmationPaneCancelButtonHoveredStyles, (_props$
|
|
104
|
-
rootFocused: Object.assign({}, _defaultConfirmationPaneCancelButtonFocusedStyles.defaultConfirmationPaneCancelButtonFocusedStyles, (_props$
|
|
103
|
+
root: Object.assign({}, _defaultConfirmationPaneCancelButtonStyles.defaultConfirmationPaneCancelButtonStyles, (_props$styleProps9 = props.styleProps) === null || _props$styleProps9 === void 0 ? void 0 : _props$styleProps9.cancelButtonStyleProps),
|
|
104
|
+
rootHovered: Object.assign({}, _defaultConfirmationPaneCancelButtonHoveredStyles.defaultConfirmationPaneCancelButtonHoveredStyles, (_props$styleProps10 = props.styleProps) === null || _props$styleProps10 === void 0 ? void 0 : _props$styleProps10.cancelButtonHoveredStyleProps),
|
|
105
|
+
rootFocused: Object.assign({}, _defaultConfirmationPaneCancelButtonFocusedStyles.defaultConfirmationPaneCancelButtonFocusedStyles, (_props$styleProps11 = props.styleProps) === null || _props$styleProps11 === void 0 ? void 0 : _props$styleProps11.cancelButtonFocusedStyleProps),
|
|
106
|
+
rootPressed: Object.assign({}, _defaultConfirmationPaneCancelButtonHoveredStyles.defaultConfirmationPaneCancelButtonHoveredStyles, (_props$styleProps12 = props.styleProps) === null || _props$styleProps12 === void 0 ? void 0 : _props$styleProps12.cancelButtonHoveredStyleProps)
|
|
105
107
|
};
|
|
106
108
|
return /*#__PURE__*/_react2.default.createElement(_react2.default.Fragment, null, !((_props$controlProps6 = props.controlProps) !== null && _props$controlProps6 !== void 0 && _props$controlProps6.hideConfirmationPane) && /*#__PURE__*/_react2.default.createElement(_react.Stack, {
|
|
107
109
|
id: elementId,
|
|
@@ -112,29 +114,29 @@ function ConfirmationPane(props) {
|
|
|
112
114
|
"aria-labelledby": elementId + "-title",
|
|
113
115
|
"aria-describedby": elementId + "-subtitle"
|
|
114
116
|
}, !((_props$controlProps8 = props.controlProps) !== null && _props$controlProps8 !== void 0 && _props$controlProps8.hideTitle) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr = props.componentOverrides) === null || _props$componentOverr === void 0 ? void 0 : _props$componentOverr.title) || /*#__PURE__*/_react2.default.createElement(_react.Label, {
|
|
115
|
-
className: (_props$
|
|
117
|
+
className: (_props$styleProps13 = props.styleProps) === null || _props$styleProps13 === void 0 ? void 0 : (_props$styleProps13$c = _props$styleProps13.classNames) === null || _props$styleProps13$c === void 0 ? void 0 : _props$styleProps13$c.titleClassName,
|
|
116
118
|
styles: titleStyles,
|
|
117
119
|
tabIndex: -1,
|
|
118
120
|
id: elementId + "-title"
|
|
119
121
|
}, ((_props$controlProps9 = props.controlProps) === null || _props$controlProps9 === void 0 ? void 0 : _props$controlProps9.titleText) || _defaultConfirmationPaneControlProps.defaultConfirmationPaneControlProps.titleText)), !((_props$controlProps10 = props.controlProps) !== null && _props$controlProps10 !== void 0 && _props$controlProps10.hideSubtitle) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr2 = props.componentOverrides) === null || _props$componentOverr2 === void 0 ? void 0 : _props$componentOverr2.subtitle) || /*#__PURE__*/_react2.default.createElement(_react.Label, {
|
|
120
|
-
className: (_props$
|
|
122
|
+
className: (_props$styleProps14 = props.styleProps) === null || _props$styleProps14 === void 0 ? void 0 : (_props$styleProps14$c = _props$styleProps14.classNames) === null || _props$styleProps14$c === void 0 ? void 0 : _props$styleProps14$c.subtitleClassName,
|
|
121
123
|
styles: subtitleStyles,
|
|
122
124
|
tabIndex: -1,
|
|
123
125
|
id: elementId + "-subtitle"
|
|
124
126
|
}, ((_props$controlProps11 = props.controlProps) === null || _props$controlProps11 === void 0 ? void 0 : _props$controlProps11.subtitleText) || _defaultConfirmationPaneControlProps.defaultConfirmationPaneControlProps.subtitleText)), /*#__PURE__*/_react2.default.createElement(_react.Stack, {
|
|
125
127
|
horizontal: true,
|
|
126
|
-
className: (_props$
|
|
128
|
+
className: (_props$styleProps15 = props.styleProps) === null || _props$styleProps15 === void 0 ? void 0 : (_props$styleProps15$c = _props$styleProps15.classNames) === null || _props$styleProps15$c === void 0 ? void 0 : _props$styleProps15$c.buttonGroupClassName,
|
|
127
129
|
styles: buttonGroupStyles,
|
|
128
130
|
id: elementId + "-buttongroup"
|
|
129
131
|
}, !((_props$controlProps12 = props.controlProps) !== null && _props$controlProps12 !== void 0 && _props$controlProps12.hideConfirmButton) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr3 = props.componentOverrides) === null || _props$componentOverr3 === void 0 ? void 0 : _props$componentOverr3.confirmButton) || /*#__PURE__*/_react2.default.createElement(_Button.PrimaryButton, {
|
|
130
|
-
className: (_props$
|
|
132
|
+
className: (_props$styleProps16 = props.styleProps) === null || _props$styleProps16 === void 0 ? void 0 : (_props$styleProps16$c = _props$styleProps16.classNames) === null || _props$styleProps16$c === void 0 ? void 0 : _props$styleProps16$c.confirmButtonClassName,
|
|
131
133
|
styles: confirmButtonStyles,
|
|
132
134
|
text: ((_props$controlProps13 = props.controlProps) === null || _props$controlProps13 === void 0 ? void 0 : _props$controlProps13.confirmButtonText) || _defaultConfirmationPaneControlProps.defaultConfirmationPaneControlProps.confirmButtonText,
|
|
133
135
|
onClick: handleConfirmClick,
|
|
134
136
|
id: elementId + "-confirmbutton",
|
|
135
137
|
ariaLabel: ((_props$controlProps14 = props.controlProps) === null || _props$controlProps14 === void 0 ? void 0 : _props$controlProps14.confirmButtonAriaLabel) || _defaultConfirmationPaneControlProps.defaultConfirmationPaneControlProps.confirmButtonAriaLabel
|
|
136
138
|
})), !((_props$controlProps15 = props.controlProps) !== null && _props$controlProps15 !== void 0 && _props$controlProps15.hideCancelButton) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr4 = props.componentOverrides) === null || _props$componentOverr4 === void 0 ? void 0 : _props$componentOverr4.cancelButton) || /*#__PURE__*/_react2.default.createElement(_Button.DefaultButton, {
|
|
137
|
-
className: (_props$
|
|
139
|
+
className: (_props$styleProps17 = props.styleProps) === null || _props$styleProps17 === void 0 ? void 0 : (_props$styleProps17$c = _props$styleProps17.classNames) === null || _props$styleProps17$c === void 0 ? void 0 : _props$styleProps17$c.cancelButtonClassName,
|
|
138
140
|
styles: cancelButtonStyles,
|
|
139
141
|
text: ((_props$controlProps16 = props.controlProps) === null || _props$controlProps16 === void 0 ? void 0 : _props$controlProps16.cancelButtonText) || _defaultConfirmationPaneControlProps.defaultConfirmationPaneControlProps.cancelButtonText,
|
|
140
142
|
onClick: handleCancelClick,
|
|
@@ -25,24 +25,19 @@ function AudioNotificationButton(props) {
|
|
|
25
25
|
const iconButtonStyles = {
|
|
26
26
|
root: props === null || props === void 0 ? void 0 : props.styles,
|
|
27
27
|
rootHovered: props === null || props === void 0 ? void 0 : props.hoverStyles,
|
|
28
|
-
rootFocused: props === null || props === void 0 ? void 0 : props.focusStyles
|
|
28
|
+
rootFocused: props === null || props === void 0 ? void 0 : props.focusStyles,
|
|
29
|
+
rootPressed: props === null || props === void 0 ? void 0 : props.hoverStyles
|
|
29
30
|
}; //imageIconProps > iconName
|
|
30
31
|
|
|
31
32
|
const volume0Icon = props.imageToggleIconProps ? {
|
|
32
33
|
imageProps: props === null || props === void 0 ? void 0 : props.imageToggleIconProps
|
|
33
34
|
} : {
|
|
34
|
-
iconName: (props === null || props === void 0 ? void 0 : props.toggleIconName) ?? "Volume0"
|
|
35
|
-
styles: {
|
|
36
|
-
root: props.styles
|
|
37
|
-
}
|
|
35
|
+
iconName: (props === null || props === void 0 ? void 0 : props.toggleIconName) ?? "Volume0"
|
|
38
36
|
};
|
|
39
37
|
const volume3Icon = props.imageIconProps ? {
|
|
40
38
|
imageProps: props === null || props === void 0 ? void 0 : props.imageIconProps
|
|
41
39
|
} : {
|
|
42
|
-
iconName: (props === null || props === void 0 ? void 0 : props.iconName) ?? "Volume3"
|
|
43
|
-
styles: {
|
|
44
|
-
root: props.styles
|
|
45
|
-
}
|
|
40
|
+
iconName: (props === null || props === void 0 ? void 0 : props.iconName) ?? "Volume3"
|
|
46
41
|
};
|
|
47
42
|
const handleOnClick = (0, _react2.useCallback)(() => {
|
|
48
43
|
setMuted(!muted);
|
|
@@ -48,7 +48,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
48
48
|
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; }
|
|
49
49
|
|
|
50
50
|
function InputValidationPane(props) {
|
|
51
|
-
var _props$controlProps, _props$styleProps, _props$styleProps2, _props$styleProps3, _props$styleProps4, _props$controlProps14, _props$styleProps5, _props$styleProps6, _props$styleProps7, _props$styleProps8, _props$styleProps9, _props$styleProps10, _props$styleProps11, _props$styleProps12, _props$controlProps15, _props$
|
|
51
|
+
var _props$controlProps, _props$styleProps, _props$styleProps2, _props$styleProps3, _props$styleProps4, _props$controlProps14, _props$styleProps5, _props$styleProps6, _props$styleProps7, _props$styleProps8, _props$styleProps9, _props$styleProps10, _props$styleProps11, _props$styleProps12, _props$styleProps13, _props$styleProps14, _props$styleProps15, _props$styleProps16, _props$controlProps15, _props$styleProps17, _props$styleProps17$c, _props$controlProps16, _props$controlProps17, _props$styleProps18, _props$styleProps18$c, _props$controlProps18, _props$componentOverr, _props$styleProps19, _props$styleProps19$c, _props$controlProps19, _props$controlProps20, _props$componentOverr2, _props$styleProps20, _props$styleProps20$c, _props$controlProps21, _props$controlProps22, _props$componentOverr3, _props$styleProps21, _props$styleProps21$c, _props$controlProps23, _props$controlProps24, _props$componentOverr4, _props$styleProps22, _props$styleProps22$c, _props$controlProps25, _props$controlProps26, _props$controlProps27, _props$styleProps23, _props$styleProps23$c, _props$controlProps28, _props$componentOverr5, _props$styleProps24, _props$styleProps24$c, _props$controlProps29, _props$controlProps30, _props$controlProps31, _props$controlProps32, _props$componentOverr6, _props$styleProps25, _props$styleProps25$c, _props$controlProps33, _props$controlProps34, _props$controlProps35;
|
|
52
52
|
|
|
53
53
|
const elementId = ((_props$controlProps = props.controlProps) === null || _props$controlProps === void 0 ? void 0 : _props$controlProps.id) ?? _defaultInputValidationPaneControlProps.defaultInputValidationPaneControlProps.id;
|
|
54
54
|
const [inputValue, setInputValue] = (0, _react2.useState)("");
|
|
@@ -163,27 +163,57 @@ function InputValidationPane(props) {
|
|
|
163
163
|
borderStyle: "solid"
|
|
164
164
|
};
|
|
165
165
|
const inputStyles = {
|
|
166
|
-
root: Object.assign({}, _defaultInputValidationPaneInputStyles.defaultInputValidationPaneInputStyles, (_props$styleProps5 = props.styleProps) === null || _props$styleProps5 === void 0 ? void 0 : _props$styleProps5.inputStyleProps)
|
|
166
|
+
root: Object.assign({}, _defaultInputValidationPaneInputStyles.defaultInputValidationPaneInputStyles, (_props$styleProps5 = props.styleProps) === null || _props$styleProps5 === void 0 ? void 0 : _props$styleProps5.inputStyleProps),
|
|
167
|
+
field: Object.assign({}, _defaultInputValidationPaneInputStyles.defaultInputValidationPaneInputStyles, (_props$styleProps6 = props.styleProps) === null || _props$styleProps6 === void 0 ? void 0 : _props$styleProps6.inputStyleProps),
|
|
168
|
+
fieldGroup: undefined,
|
|
169
|
+
prefix: undefined,
|
|
170
|
+
suffix: undefined,
|
|
171
|
+
icon: undefined,
|
|
172
|
+
description: undefined,
|
|
173
|
+
wrapper: undefined,
|
|
174
|
+
errorMessage: undefined,
|
|
175
|
+
subComponentStyles: {
|
|
176
|
+
label: {}
|
|
177
|
+
},
|
|
178
|
+
revealButton: undefined,
|
|
179
|
+
revealSpan: undefined,
|
|
180
|
+
revealIcon: undefined
|
|
167
181
|
};
|
|
168
182
|
const inputWithErrorMessageStyles = {
|
|
169
|
-
root: Object.assign({}, _defaultInputValidationPaneInputStyles.defaultInputValidationPaneInputStyles, redBorderStyles, (_props$
|
|
183
|
+
root: Object.assign({}, _defaultInputValidationPaneInputStyles.defaultInputValidationPaneInputStyles, redBorderStyles, (_props$styleProps7 = props.styleProps) === null || _props$styleProps7 === void 0 ? void 0 : _props$styleProps7.inputStyleProps),
|
|
184
|
+
field: Object.assign({}, _defaultInputValidationPaneInputStyles.defaultInputValidationPaneInputStyles, redBorderStyles, (_props$styleProps8 = props.styleProps) === null || _props$styleProps8 === void 0 ? void 0 : _props$styleProps8.inputStyleProps),
|
|
185
|
+
fieldGroup: undefined,
|
|
186
|
+
prefix: undefined,
|
|
187
|
+
suffix: undefined,
|
|
188
|
+
icon: undefined,
|
|
189
|
+
description: undefined,
|
|
190
|
+
wrapper: undefined,
|
|
191
|
+
errorMessage: undefined,
|
|
192
|
+
subComponentStyles: {
|
|
193
|
+
label: {}
|
|
194
|
+
},
|
|
195
|
+
revealButton: undefined,
|
|
196
|
+
revealSpan: undefined,
|
|
197
|
+
revealIcon: undefined
|
|
170
198
|
};
|
|
171
199
|
const invalidInputErrorMessageStyles = {
|
|
172
|
-
root: Object.assign({}, _defaultInputValidationPaneInvalidInputErrorMessageStyles.defaultInputValidationPaneInvalidInputErrorMessageStyles, (_props$
|
|
200
|
+
root: Object.assign({}, _defaultInputValidationPaneInvalidInputErrorMessageStyles.defaultInputValidationPaneInvalidInputErrorMessageStyles, (_props$styleProps9 = props.styleProps) === null || _props$styleProps9 === void 0 ? void 0 : _props$styleProps9.invalidInputErrorMessageStyleProps)
|
|
173
201
|
};
|
|
174
202
|
const buttonGroupStyles = {
|
|
175
|
-
root: Object.assign({}, _defaultInputValidationPaneButtonGroupStyles.defaultInputValidationPaneButtonGroupStyles, (_props$
|
|
203
|
+
root: Object.assign({}, _defaultInputValidationPaneButtonGroupStyles.defaultInputValidationPaneButtonGroupStyles, (_props$styleProps10 = props.styleProps) === null || _props$styleProps10 === void 0 ? void 0 : _props$styleProps10.buttonGroupStyleProps)
|
|
176
204
|
};
|
|
177
205
|
const sendButtonStyles = {
|
|
178
|
-
root: Object.assign({}, _defaultInputValidationPaneSendButtonStyles.defaultInputValidationPaneSendButtonStyles, (_props$
|
|
179
|
-
rootHovered: Object.assign({}, _defaultInputValidationPaneSendButtonHoveredStyles.defaultInputValidationPaneSendButtonHoveredStyles, (_props$
|
|
206
|
+
root: Object.assign({}, _defaultInputValidationPaneSendButtonStyles.defaultInputValidationPaneSendButtonStyles, (_props$styleProps11 = props.styleProps) === null || _props$styleProps11 === void 0 ? void 0 : _props$styleProps11.sendButtonStyleProps),
|
|
207
|
+
rootHovered: Object.assign({}, _defaultInputValidationPaneSendButtonHoveredStyles.defaultInputValidationPaneSendButtonHoveredStyles, (_props$styleProps12 = props.styleProps) === null || _props$styleProps12 === void 0 ? void 0 : _props$styleProps12.sendButtonHoveredStyleProps),
|
|
208
|
+
rootPressed: Object.assign({}, _defaultInputValidationPaneSendButtonHoveredStyles.defaultInputValidationPaneSendButtonHoveredStyles, (_props$styleProps13 = props.styleProps) === null || _props$styleProps13 === void 0 ? void 0 : _props$styleProps13.sendButtonHoveredStyleProps)
|
|
180
209
|
};
|
|
181
210
|
const cancelButtonStyles = {
|
|
182
|
-
root: Object.assign({}, _defaultInputValidationPaneCancelButtonStyles.defaultInputValidationPaneCancelButtonStyles, (_props$
|
|
183
|
-
rootHovered: Object.assign({}, _defaultInputValidationPaneCancelButtonHoveredStyles.defaultInputValidationPaneCancelButtonHoveredStyles, (_props$
|
|
211
|
+
root: Object.assign({}, _defaultInputValidationPaneCancelButtonStyles.defaultInputValidationPaneCancelButtonStyles, (_props$styleProps14 = props.styleProps) === null || _props$styleProps14 === void 0 ? void 0 : _props$styleProps14.cancelButtonStyleProps),
|
|
212
|
+
rootHovered: Object.assign({}, _defaultInputValidationPaneCancelButtonHoveredStyles.defaultInputValidationPaneCancelButtonHoveredStyles, (_props$styleProps15 = props.styleProps) === null || _props$styleProps15 === void 0 ? void 0 : _props$styleProps15.cancelButtonHoveredStyleProps),
|
|
213
|
+
rootPressed: Object.assign({}, _defaultInputValidationPaneCancelButtonHoveredStyles.defaultInputValidationPaneCancelButtonHoveredStyles, (_props$styleProps16 = props.styleProps) === null || _props$styleProps16 === void 0 ? void 0 : _props$styleProps16.cancelButtonHoveredStyleProps)
|
|
184
214
|
};
|
|
185
215
|
return /*#__PURE__*/_react2.default.createElement(_react2.default.Fragment, null, !((_props$controlProps15 = props.controlProps) !== null && _props$controlProps15 !== void 0 && _props$controlProps15.hideInputValidationPane) && /*#__PURE__*/_react2.default.createElement(_react.Stack, {
|
|
186
|
-
className: (_props$
|
|
216
|
+
className: (_props$styleProps17 = props.styleProps) === null || _props$styleProps17 === void 0 ? void 0 : (_props$styleProps17$c = _props$styleProps17.classNames) === null || _props$styleProps17$c === void 0 ? void 0 : _props$styleProps17$c.containerClassName,
|
|
187
217
|
id: elementId,
|
|
188
218
|
tabIndex: -1,
|
|
189
219
|
onKeyDown: handleEscKeyDown,
|
|
@@ -191,22 +221,22 @@ function InputValidationPane(props) {
|
|
|
191
221
|
"aria-label": ((_props$controlProps17 = props.controlProps) === null || _props$controlProps17 === void 0 ? void 0 : _props$controlProps17.inputValidationPaneAriaLabel) || _defaultInputValidationPaneControlProps.defaultInputValidationPaneControlProps.inputValidationPaneAriaLabel,
|
|
192
222
|
styles: containerStyles
|
|
193
223
|
}, /*#__PURE__*/_react2.default.createElement(_react.Stack, {
|
|
194
|
-
className: (_props$
|
|
224
|
+
className: (_props$styleProps18 = props.styleProps) === null || _props$styleProps18 === void 0 ? void 0 : (_props$styleProps18$c = _props$styleProps18.classNames) === null || _props$styleProps18$c === void 0 ? void 0 : _props$styleProps18$c.headerGroupClassName,
|
|
195
225
|
styles: headerGroupStyles,
|
|
196
226
|
tabIndex: -1,
|
|
197
227
|
id: elementId + "-headergroup"
|
|
198
228
|
}, !((_props$controlProps18 = props.controlProps) !== null && _props$controlProps18 !== void 0 && _props$controlProps18.hideTitle) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr = props.componentOverrides) === null || _props$componentOverr === void 0 ? void 0 : _props$componentOverr.title) || /*#__PURE__*/_react2.default.createElement(_react.Label, {
|
|
199
|
-
className: (_props$
|
|
229
|
+
className: (_props$styleProps19 = props.styleProps) === null || _props$styleProps19 === void 0 ? void 0 : (_props$styleProps19$c = _props$styleProps19.classNames) === null || _props$styleProps19$c === void 0 ? void 0 : _props$styleProps19$c.titleClassName,
|
|
200
230
|
styles: titleStyles,
|
|
201
231
|
tabIndex: -1,
|
|
202
232
|
id: elementId + "-title"
|
|
203
233
|
}, ((_props$controlProps19 = props.controlProps) === null || _props$controlProps19 === void 0 ? void 0 : _props$controlProps19.titleText) || _defaultInputValidationPaneControlProps.defaultInputValidationPaneControlProps.titleText)), !((_props$controlProps20 = props.controlProps) !== null && _props$controlProps20 !== void 0 && _props$controlProps20.hideSubtitle) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr2 = props.componentOverrides) === null || _props$componentOverr2 === void 0 ? void 0 : _props$componentOverr2.subtitle) || /*#__PURE__*/_react2.default.createElement(_react.Label, {
|
|
204
|
-
className: (_props$
|
|
234
|
+
className: (_props$styleProps20 = props.styleProps) === null || _props$styleProps20 === void 0 ? void 0 : (_props$styleProps20$c = _props$styleProps20.classNames) === null || _props$styleProps20$c === void 0 ? void 0 : _props$styleProps20$c.subtitleClassName,
|
|
205
235
|
styles: subtitleStyles,
|
|
206
236
|
tabIndex: -1,
|
|
207
237
|
id: elementId + "-subtitle"
|
|
208
238
|
}, ((_props$controlProps21 = props.controlProps) === null || _props$controlProps21 === void 0 ? void 0 : _props$controlProps21.subtitleText) || _defaultInputValidationPaneControlProps.defaultInputValidationPaneControlProps.subtitleText)), !((_props$controlProps22 = props.controlProps) !== null && _props$controlProps22 !== void 0 && _props$controlProps22.hideInput) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr3 = props.componentOverrides) === null || _props$componentOverr3 === void 0 ? void 0 : _props$componentOverr3.input) || /*#__PURE__*/_react2.default.createElement(_react.TextField, {
|
|
209
|
-
className: (_props$
|
|
239
|
+
className: (_props$styleProps21 = props.styleProps) === null || _props$styleProps21 === void 0 ? void 0 : (_props$styleProps21$c = _props$styleProps21.classNames) === null || _props$styleProps21$c === void 0 ? void 0 : _props$styleProps21$c.inputClassName,
|
|
210
240
|
styles: isInvalidInput ? inputWithErrorMessageStyles : inputStyles,
|
|
211
241
|
tabIndex: 0,
|
|
212
242
|
value: inputValue ?? _defaultInputValidationPaneControlProps.defaultInputValidationPaneControlProps.inputInitialText,
|
|
@@ -216,7 +246,7 @@ function InputValidationPane(props) {
|
|
|
216
246
|
onChange: handleInputChange,
|
|
217
247
|
onKeyDown: handleInputKeyDown
|
|
218
248
|
})), isInvalidInput && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr4 = props.componentOverrides) === null || _props$componentOverr4 === void 0 ? void 0 : _props$componentOverr4.invalidInputErrorMessage) || /*#__PURE__*/_react2.default.createElement(_react.Stack, {
|
|
219
|
-
className: (_props$
|
|
249
|
+
className: (_props$styleProps22 = props.styleProps) === null || _props$styleProps22 === void 0 ? void 0 : (_props$styleProps22$c = _props$styleProps22.classNames) === null || _props$styleProps22$c === void 0 ? void 0 : _props$styleProps22$c.invalidInputErrorMessageClassName,
|
|
220
250
|
styles: invalidInputErrorMessageStyles,
|
|
221
251
|
"aria-label": ((_props$controlProps25 = props.controlProps) === null || _props$controlProps25 === void 0 ? void 0 : _props$controlProps25.invalidInputErrorMessageText) || _defaultInputValidationPaneControlProps.defaultInputValidationPaneControlProps.invalidInputErrorMessageText,
|
|
222
252
|
tabIndex: -1,
|
|
@@ -224,12 +254,12 @@ function InputValidationPane(props) {
|
|
|
224
254
|
id: elementId + "-invalidinputerrormessage"
|
|
225
255
|
}, ((_props$controlProps26 = props.controlProps) === null || _props$controlProps26 === void 0 ? void 0 : _props$controlProps26.invalidInputErrorMessageText) || _defaultInputValidationPaneControlProps.defaultInputValidationPaneControlProps.invalidInputErrorMessageText))), /*#__PURE__*/_react2.default.createElement(_react.Stack, {
|
|
226
256
|
horizontal: ((_props$controlProps27 = props.controlProps) === null || _props$controlProps27 === void 0 ? void 0 : _props$controlProps27.isButtonGroupHorizontal) ?? _defaultInputValidationPaneControlProps.defaultInputValidationPaneControlProps.isButtonGroupHorizontal,
|
|
227
|
-
className: (_props$
|
|
257
|
+
className: (_props$styleProps23 = props.styleProps) === null || _props$styleProps23 === void 0 ? void 0 : (_props$styleProps23$c = _props$styleProps23.classNames) === null || _props$styleProps23$c === void 0 ? void 0 : _props$styleProps23$c.buttonGroupClassName,
|
|
228
258
|
styles: buttonGroupStyles,
|
|
229
259
|
tabIndex: -1,
|
|
230
260
|
id: elementId + "-buttongroup"
|
|
231
261
|
}, !((_props$controlProps28 = props.controlProps) !== null && _props$controlProps28 !== void 0 && _props$controlProps28.hideSendButton) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr5 = props.componentOverrides) === null || _props$componentOverr5 === void 0 ? void 0 : _props$componentOverr5.sendButton) || /*#__PURE__*/_react2.default.createElement(_Button.PrimaryButton, {
|
|
232
|
-
className: (_props$
|
|
262
|
+
className: (_props$styleProps24 = props.styleProps) === null || _props$styleProps24 === void 0 ? void 0 : (_props$styleProps24$c = _props$styleProps24.classNames) === null || _props$styleProps24$c === void 0 ? void 0 : _props$styleProps24$c.sendButtonClassName,
|
|
233
263
|
styles: sendButtonStyles,
|
|
234
264
|
title: ((_props$controlProps29 = props.controlProps) === null || _props$controlProps29 === void 0 ? void 0 : _props$controlProps29.sendButtonText) || _defaultInputValidationPaneControlProps.defaultInputValidationPaneControlProps.sendButtonText,
|
|
235
265
|
tabIndex: 0,
|
|
@@ -239,7 +269,7 @@ function InputValidationPane(props) {
|
|
|
239
269
|
id: elementId + "-sendbutton",
|
|
240
270
|
ariaLabel: ((_props$controlProps31 = props.controlProps) === null || _props$controlProps31 === void 0 ? void 0 : _props$controlProps31.sendButtonAriaLabel) || _defaultInputValidationPaneControlProps.defaultInputValidationPaneControlProps.sendButtonAriaLabel
|
|
241
271
|
})), !((_props$controlProps32 = props.controlProps) !== null && _props$controlProps32 !== void 0 && _props$controlProps32.hideCancelButton) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr6 = props.componentOverrides) === null || _props$componentOverr6 === void 0 ? void 0 : _props$componentOverr6.cancelButton) || /*#__PURE__*/_react2.default.createElement(_Button.DefaultButton, {
|
|
242
|
-
className: (_props$
|
|
272
|
+
className: (_props$styleProps25 = props.styleProps) === null || _props$styleProps25 === void 0 ? void 0 : (_props$styleProps25$c = _props$styleProps25.classNames) === null || _props$styleProps25$c === void 0 ? void 0 : _props$styleProps25$c.cancelButtonClassName,
|
|
243
273
|
styles: cancelButtonStyles,
|
|
244
274
|
title: ((_props$controlProps33 = props.controlProps) === null || _props$controlProps33 === void 0 ? void 0 : _props$controlProps33.cancelButtonText) || _defaultInputValidationPaneControlProps.defaultInputValidationPaneControlProps.cancelButtonText,
|
|
245
275
|
tabIndex: 0,
|