@microsoft/omnichannel-chat-components 1.0.5-main.fb181a2 → 1.0.5
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 +1 -1
- package/lib/cjs/components/inputvalidationpane/InputValidationPane.js +14 -13
- package/lib/cjs/components/inputvalidationpane/common/default/defaultProps/defaultInputValidationPaneControlProps.js +1 -0
- package/lib/cjs/components/inputvalidationpane/common/presetTwo/presetTwoProps/presetTwoInputValidationPaneControlProps.js +1 -0
- package/lib/esm/common/Constants.js +1 -1
- package/lib/esm/components/inputvalidationpane/InputValidationPane.js +14 -13
- package/lib/esm/components/inputvalidationpane/common/default/defaultProps/defaultInputValidationPaneControlProps.js +1 -0
- package/lib/esm/components/inputvalidationpane/common/presetTwo/presetTwoProps/presetTwoInputValidationPaneControlProps.js +1 -0
- package/lib/types/common/Constants.d.ts +1 -0
- package/lib/types/components/inputvalidationpane/interfaces/IInputValidationPaneControlProps.d.ts +1 -0
- package/package.json +1 -1
|
@@ -62,5 +62,5 @@ const AriaLabels = (_class6 = class AriaLabels {}, _defineProperty(_class6, "End
|
|
|
62
62
|
exports.AriaLabels = AriaLabels;
|
|
63
63
|
const EventNames = (_class7 = class EventNames {}, _defineProperty(_class7, "OnClick", "OnClick"), _defineProperty(_class7, "OnEscapeKeyDown", "OnEscapeKeyDown"), _defineProperty(_class7, "IncomingCallEnded", "IncomingCallEnded"), _class7);
|
|
64
64
|
exports.EventNames = EventNames;
|
|
65
|
-
const Texts = (_class8 = class Texts {}, _defineProperty(_class8, "IncomingCallTitle", "Incoming Call"), _defineProperty(_class8, "ChatButtonTitle", "Let's Chat!"), _defineProperty(_class8, "ChatButtonSubtitle", "We're online."), _defineProperty(_class8, "ChatButtonUnreadMessageString", "new messages"), _defineProperty(_class8, "ChatButtonLargeUnreadMessageString", "99+"), _defineProperty(_class8, "CloseButtonText", "Close"), _defineProperty(_class8, "ConfirmationPaneTitle", "Close chat"), _defineProperty(_class8, "ConfirmationPaneSubtitle", "Do you really want to close this chat?"), _defineProperty(_class8, "ConfirmButtonText", "Close"), _defineProperty(_class8, "CancelButtonText", "Cancel"), _defineProperty(_class8, "DownloadChatTranscriptText", "Download chat transcript"), _defineProperty(_class8, "EmailTranscriptText", "Email Transcript"), _defineProperty(_class8, "HeaderIcon", "Chat Icon"), _defineProperty(_class8, "HeaderTitle", "Let's Chat"), _defineProperty(_class8, "MinimizeText", "Minimize"), _defineProperty(_class8, "InputValidationPaneTitleText", "Email this chat transcript"), _defineProperty(_class8, "InputValidationPaneSubtitleText", "This will be sent after your chat ends."), _defineProperty(_class8, "InvalidInputErrorMessageText", "Enter a valid email address."), _defineProperty(_class8, "SendButtonText", "Send"), _defineProperty(_class8, "LoadingPaneTitleText", "Welcome to"), _defineProperty(_class8, "LoadingPaneSubtitleText", "live chat support ..."), _defineProperty(_class8, "LoadingPaneSpinnerText", "Loading ..."), _defineProperty(_class8, "OOOHPaneTitleText", "Thanks for contacting us. You have reached us outside of our operating hours. An agent will respond when we open."), _defineProperty(_class8, "PostChatSurveyPaneTitleText", "Post chat survey pane"), _defineProperty(_class8, "ProactiveChatPaneTitleText", "Welcome to"), _defineProperty(_class8, "ProactiveChatPaneSubtitleText", "Live chat support!"), _defineProperty(_class8, "ProactiveChatPaneBodyTitleText", "Hi! Have any questions? I am here to help."), _defineProperty(_class8, "ProactiveChatPaneStartButtonText", "Chat Now"), _defineProperty(_class8, "ReconnectChatPaneTitleText", "Previous session detected"), _defineProperty(_class8, "ReconnectChatPaneSubtitleText", "We have detected a previous chat session. Would you like to continue with your previous session?"), _defineProperty(_class8, "ReconnectChatPaneContinueChatButtonText", "Continue conversation"), _defineProperty(_class8, "ReconnectChatPaneStartNewChatButtonText", "Start new conversation"), _class8);
|
|
65
|
+
const Texts = (_class8 = class Texts {}, _defineProperty(_class8, "IncomingCallTitle", "Incoming Call"), _defineProperty(_class8, "ChatButtonTitle", "Let's Chat!"), _defineProperty(_class8, "ChatButtonSubtitle", "We're online."), _defineProperty(_class8, "ChatButtonUnreadMessageString", "new messages"), _defineProperty(_class8, "ChatButtonLargeUnreadMessageString", "99+"), _defineProperty(_class8, "CloseButtonText", "Close"), _defineProperty(_class8, "ConfirmationPaneTitle", "Close chat"), _defineProperty(_class8, "ConfirmationPaneSubtitle", "Do you really want to close this chat?"), _defineProperty(_class8, "ConfirmButtonText", "Close"), _defineProperty(_class8, "EmailPlaceHolderText", "johnsmith@outlook.com"), _defineProperty(_class8, "CancelButtonText", "Cancel"), _defineProperty(_class8, "DownloadChatTranscriptText", "Download chat transcript"), _defineProperty(_class8, "EmailTranscriptText", "Email Transcript"), _defineProperty(_class8, "HeaderIcon", "Chat Icon"), _defineProperty(_class8, "HeaderTitle", "Let's Chat"), _defineProperty(_class8, "MinimizeText", "Minimize"), _defineProperty(_class8, "InputValidationPaneTitleText", "Email this chat transcript"), _defineProperty(_class8, "InputValidationPaneSubtitleText", "This will be sent after your chat ends."), _defineProperty(_class8, "InvalidInputErrorMessageText", "Enter a valid email address."), _defineProperty(_class8, "SendButtonText", "Send"), _defineProperty(_class8, "LoadingPaneTitleText", "Welcome to"), _defineProperty(_class8, "LoadingPaneSubtitleText", "live chat support ..."), _defineProperty(_class8, "LoadingPaneSpinnerText", "Loading ..."), _defineProperty(_class8, "OOOHPaneTitleText", "Thanks for contacting us. You have reached us outside of our operating hours. An agent will respond when we open."), _defineProperty(_class8, "PostChatSurveyPaneTitleText", "Post chat survey pane"), _defineProperty(_class8, "ProactiveChatPaneTitleText", "Welcome to"), _defineProperty(_class8, "ProactiveChatPaneSubtitleText", "Live chat support!"), _defineProperty(_class8, "ProactiveChatPaneBodyTitleText", "Hi! Have any questions? I am here to help."), _defineProperty(_class8, "ProactiveChatPaneStartButtonText", "Chat Now"), _defineProperty(_class8, "ReconnectChatPaneTitleText", "Previous session detected"), _defineProperty(_class8, "ReconnectChatPaneSubtitleText", "We have detected a previous chat session. Would you like to continue with your previous session?"), _defineProperty(_class8, "ReconnectChatPaneContinueChatButtonText", "Continue conversation"), _defineProperty(_class8, "ReconnectChatPaneStartNewChatButtonText", "Start new conversation"), _class8);
|
|
66
66
|
exports.Texts = Texts;
|
|
@@ -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$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$
|
|
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$controlProps25, _props$componentOverr4, _props$styleProps22, _props$styleProps22$c, _props$controlProps26, _props$controlProps27, _props$controlProps28, _props$styleProps23, _props$styleProps23$c, _props$controlProps29, _props$componentOverr5, _props$styleProps24, _props$styleProps24$c, _props$controlProps30, _props$controlProps31, _props$controlProps32, _props$controlProps33, _props$componentOverr6, _props$styleProps25, _props$styleProps25$c, _props$controlProps34, _props$controlProps35, _props$controlProps36;
|
|
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)("");
|
|
@@ -244,39 +244,40 @@ function InputValidationPane(props) {
|
|
|
244
244
|
ariaLabel: ((_props$controlProps24 = props.controlProps) === null || _props$controlProps24 === void 0 ? void 0 : _props$controlProps24.inputAriaLabel) || _defaultInputValidationPaneControlProps.defaultInputValidationPaneControlProps.inputAriaLabel,
|
|
245
245
|
borderless: isInvalidInput,
|
|
246
246
|
onChange: handleInputChange,
|
|
247
|
-
onKeyUp: handleInputKeyUp
|
|
247
|
+
onKeyUp: handleInputKeyUp,
|
|
248
|
+
placeholder: ((_props$controlProps25 = props.controlProps) === null || _props$controlProps25 === void 0 ? void 0 : _props$controlProps25.inputPlaceHolder) || _defaultInputValidationPaneControlProps.defaultInputValidationPaneControlProps.inputPlaceHolder
|
|
248
249
|
})), isInvalidInput && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr4 = props.componentOverrides) === null || _props$componentOverr4 === void 0 ? void 0 : _props$componentOverr4.invalidInputErrorMessage) || /*#__PURE__*/_react2.default.createElement(_react.Stack, {
|
|
249
250
|
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,
|
|
250
251
|
styles: invalidInputErrorMessageStyles,
|
|
251
|
-
"aria-label": ((_props$
|
|
252
|
+
"aria-label": ((_props$controlProps26 = props.controlProps) === null || _props$controlProps26 === void 0 ? void 0 : _props$controlProps26.invalidInputErrorMessageText) || _defaultInputValidationPaneControlProps.defaultInputValidationPaneControlProps.invalidInputErrorMessageText,
|
|
252
253
|
tabIndex: -1,
|
|
253
254
|
role: "alert",
|
|
254
255
|
id: elementId + "-invalidinputerrormessage"
|
|
255
|
-
}, ((_props$
|
|
256
|
-
horizontal: ((_props$
|
|
256
|
+
}, ((_props$controlProps27 = props.controlProps) === null || _props$controlProps27 === void 0 ? void 0 : _props$controlProps27.invalidInputErrorMessageText) || _defaultInputValidationPaneControlProps.defaultInputValidationPaneControlProps.invalidInputErrorMessageText))), /*#__PURE__*/_react2.default.createElement(_react.Stack, {
|
|
257
|
+
horizontal: ((_props$controlProps28 = props.controlProps) === null || _props$controlProps28 === void 0 ? void 0 : _props$controlProps28.isButtonGroupHorizontal) ?? _defaultInputValidationPaneControlProps.defaultInputValidationPaneControlProps.isButtonGroupHorizontal,
|
|
257
258
|
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,
|
|
258
259
|
styles: buttonGroupStyles,
|
|
259
260
|
tabIndex: -1,
|
|
260
261
|
id: elementId + "-buttongroup"
|
|
261
|
-
}, !((_props$
|
|
262
|
+
}, !((_props$controlProps29 = props.controlProps) !== null && _props$controlProps29 !== void 0 && _props$controlProps29.hideSendButton) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr5 = props.componentOverrides) === null || _props$componentOverr5 === void 0 ? void 0 : _props$componentOverr5.sendButton) || /*#__PURE__*/_react2.default.createElement(_Button.PrimaryButton, {
|
|
262
263
|
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,
|
|
263
264
|
styles: sendButtonStyles,
|
|
264
|
-
title: ((_props$
|
|
265
|
+
title: ((_props$controlProps30 = props.controlProps) === null || _props$controlProps30 === void 0 ? void 0 : _props$controlProps30.sendButtonText) || _defaultInputValidationPaneControlProps.defaultInputValidationPaneControlProps.sendButtonText,
|
|
265
266
|
tabIndex: 0,
|
|
266
267
|
disabled: !isSendButtonEnabled,
|
|
267
|
-
text: ((_props$
|
|
268
|
+
text: ((_props$controlProps31 = props.controlProps) === null || _props$controlProps31 === void 0 ? void 0 : _props$controlProps31.sendButtonText) || _defaultInputValidationPaneControlProps.defaultInputValidationPaneControlProps.sendButtonText,
|
|
268
269
|
onClick: handleSendClick,
|
|
269
270
|
id: elementId + "-sendbutton",
|
|
270
|
-
ariaLabel: ((_props$
|
|
271
|
-
})), !((_props$
|
|
271
|
+
ariaLabel: ((_props$controlProps32 = props.controlProps) === null || _props$controlProps32 === void 0 ? void 0 : _props$controlProps32.sendButtonAriaLabel) || _defaultInputValidationPaneControlProps.defaultInputValidationPaneControlProps.sendButtonAriaLabel
|
|
272
|
+
})), !((_props$controlProps33 = props.controlProps) !== null && _props$controlProps33 !== void 0 && _props$controlProps33.hideCancelButton) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr6 = props.componentOverrides) === null || _props$componentOverr6 === void 0 ? void 0 : _props$componentOverr6.cancelButton) || /*#__PURE__*/_react2.default.createElement(_Button.DefaultButton, {
|
|
272
273
|
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,
|
|
273
274
|
styles: cancelButtonStyles,
|
|
274
|
-
title: ((_props$
|
|
275
|
+
title: ((_props$controlProps34 = props.controlProps) === null || _props$controlProps34 === void 0 ? void 0 : _props$controlProps34.cancelButtonText) || _defaultInputValidationPaneControlProps.defaultInputValidationPaneControlProps.cancelButtonText,
|
|
275
276
|
tabIndex: 0,
|
|
276
|
-
text: ((_props$
|
|
277
|
+
text: ((_props$controlProps35 = props.controlProps) === null || _props$controlProps35 === void 0 ? void 0 : _props$controlProps35.cancelButtonText) || _defaultInputValidationPaneControlProps.defaultInputValidationPaneControlProps.cancelButtonText,
|
|
277
278
|
onClick: handleCancelClick,
|
|
278
279
|
id: elementId + "-cancelbutton",
|
|
279
|
-
ariaLabel: ((_props$
|
|
280
|
+
ariaLabel: ((_props$controlProps36 = props.controlProps) === null || _props$controlProps36 === void 0 ? void 0 : _props$controlProps36.cancelButtonAriaLabel) || _defaultInputValidationPaneControlProps.defaultInputValidationPaneControlProps.cancelButtonAriaLabel
|
|
280
281
|
})))));
|
|
281
282
|
}
|
|
282
283
|
|
|
@@ -18,6 +18,7 @@ const defaultInputValidationPaneControlProps = {
|
|
|
18
18
|
subtitleText: _Constants.Texts.InputValidationPaneSubtitleText,
|
|
19
19
|
inputId: _Constants.Ids.DefaultInputValidationPaneInputId,
|
|
20
20
|
inputInitialText: "",
|
|
21
|
+
inputPlaceHolder: _Constants.Texts.EmailPlaceHolderText,
|
|
21
22
|
hideInput: false,
|
|
22
23
|
inputAriaLabel: _Constants.AriaLabels.InputValidationPaneInput,
|
|
23
24
|
inputWithErrorMessageBorderColor: "rgb(164, 38, 44)",
|
|
@@ -20,6 +20,7 @@ const presetTwoInputValidationPaneControlProps = {
|
|
|
20
20
|
hideInput: false,
|
|
21
21
|
inputAriaLabel: _Constants.AriaLabels.InputValidationPaneInput,
|
|
22
22
|
inputWithErrorMessageBorderColor: "rgb(164, 38, 44)",
|
|
23
|
+
inputPlaceHolder: _Constants.Texts.EmailPlaceHolderText,
|
|
23
24
|
invalidInputErrorMessageText: _Constants.Texts.InvalidInputErrorMessageText,
|
|
24
25
|
isButtonGroupHorizontal: false,
|
|
25
26
|
hideSendButton: false,
|
|
@@ -45,4 +45,4 @@ export const ButtonTypes = (_class4 = class ButtonTypes {}, _defineProperty(_cla
|
|
|
45
45
|
export const IconNames = (_class5 = class IconNames {}, _defineProperty(_class5, "DeclineCall", "DeclineCall"), _defineProperty(_class5, "Microphone", "Microphone"), _defineProperty(_class5, "MicOff2", "MicOff2"), _defineProperty(_class5, "Video", "Video"), _defineProperty(_class5, "VideoOff", "VideoOff"), _defineProperty(_class5, "IncomingCall", "IncomingCall"), _defineProperty(_class5, "ChromeClose", "ChromeClose"), _defineProperty(_class5, "Download", "Download"), _defineProperty(_class5, "Mail", "Mail"), _defineProperty(_class5, "Volume3", "Volume3"), _defineProperty(_class5, "Volume0", "Volume0"), _defineProperty(_class5, "ChromeMinimize", "ChromeMinimize"), _class5);
|
|
46
46
|
export const AriaLabels = (_class6 = class AriaLabels {}, _defineProperty(_class6, "EndCall", "End Call"), _defineProperty(_class6, "MicMute", "Mute"), _defineProperty(_class6, "MicUnmute", "Unmute"), _defineProperty(_class6, "VideoTurnCameraOn", "Turn camera on"), _defineProperty(_class6, "VideoTurnCameraOff", "Turn camera off"), _defineProperty(_class6, "IncomingCallArea", "Incoming call area"), _defineProperty(_class6, "RejectCall", "Reject call"), _defineProperty(_class6, "AcceptVoiceCall", "Accept voice call"), _defineProperty(_class6, "AcceptVideoCall", "Accept video Call"), _defineProperty(_class6, "DeclineCall", "Decline Call"), _defineProperty(_class6, "AudioCall", "Audio Call"), _defineProperty(_class6, "VideoCall", "Video Call"), _defineProperty(_class6, "LetsChatWeAreOnline", "Let's chat we are online"), _defineProperty(_class6, "UnreadMessageString", "you have new messages"), _defineProperty(_class6, "Close", "Close"), _defineProperty(_class6, "ConfirmationPaneConfirm", "Close Chat"), _defineProperty(_class6, "ConfirmationPaneCancel", "Cancel. Return to Chat"), _defineProperty(_class6, "DownloadChatTranscript", "Download chat transcript"), _defineProperty(_class6, "EmailTranscript", "Email Transcript"), _defineProperty(_class6, "TurnSoundOff", "Turn sound off"), _defineProperty(_class6, "TurnSoundOn", "Turn sound on"), _defineProperty(_class6, "Minimize", "Minimize"), _defineProperty(_class6, "EmailChatTranscriptPane", "Email Chat Transcript Pane"), _defineProperty(_class6, "InputValidationPaneInput", "Email this chat transcript. This will be sent after your chat ends. Email address text area"), _defineProperty(_class6, "Send", "Send"), _defineProperty(_class6, "Cancel", "Cancel"), _defineProperty(_class6, "ProactiveChatPane", "Proactive Chat Pane"), _defineProperty(_class6, "ChatNow", "Chat Now"), _defineProperty(_class6, "ReconnectChatPane", "Reconnect Chat Pane"), _defineProperty(_class6, "ReconnectChatPaneIcon", "Reconnect Chat Pane Icon"), _defineProperty(_class6, "ContinueConversation", "Continue conversation"), _defineProperty(_class6, "StartNewConversation", "Start new conversation"), _class6);
|
|
47
47
|
export const EventNames = (_class7 = class EventNames {}, _defineProperty(_class7, "OnClick", "OnClick"), _defineProperty(_class7, "OnEscapeKeyDown", "OnEscapeKeyDown"), _defineProperty(_class7, "IncomingCallEnded", "IncomingCallEnded"), _class7);
|
|
48
|
-
export const Texts = (_class8 = class Texts {}, _defineProperty(_class8, "IncomingCallTitle", "Incoming Call"), _defineProperty(_class8, "ChatButtonTitle", "Let's Chat!"), _defineProperty(_class8, "ChatButtonSubtitle", "We're online."), _defineProperty(_class8, "ChatButtonUnreadMessageString", "new messages"), _defineProperty(_class8, "ChatButtonLargeUnreadMessageString", "99+"), _defineProperty(_class8, "CloseButtonText", "Close"), _defineProperty(_class8, "ConfirmationPaneTitle", "Close chat"), _defineProperty(_class8, "ConfirmationPaneSubtitle", "Do you really want to close this chat?"), _defineProperty(_class8, "ConfirmButtonText", "Close"), _defineProperty(_class8, "CancelButtonText", "Cancel"), _defineProperty(_class8, "DownloadChatTranscriptText", "Download chat transcript"), _defineProperty(_class8, "EmailTranscriptText", "Email Transcript"), _defineProperty(_class8, "HeaderIcon", "Chat Icon"), _defineProperty(_class8, "HeaderTitle", "Let's Chat"), _defineProperty(_class8, "MinimizeText", "Minimize"), _defineProperty(_class8, "InputValidationPaneTitleText", "Email this chat transcript"), _defineProperty(_class8, "InputValidationPaneSubtitleText", "This will be sent after your chat ends."), _defineProperty(_class8, "InvalidInputErrorMessageText", "Enter a valid email address."), _defineProperty(_class8, "SendButtonText", "Send"), _defineProperty(_class8, "LoadingPaneTitleText", "Welcome to"), _defineProperty(_class8, "LoadingPaneSubtitleText", "live chat support ..."), _defineProperty(_class8, "LoadingPaneSpinnerText", "Loading ..."), _defineProperty(_class8, "OOOHPaneTitleText", "Thanks for contacting us. You have reached us outside of our operating hours. An agent will respond when we open."), _defineProperty(_class8, "PostChatSurveyPaneTitleText", "Post chat survey pane"), _defineProperty(_class8, "ProactiveChatPaneTitleText", "Welcome to"), _defineProperty(_class8, "ProactiveChatPaneSubtitleText", "Live chat support!"), _defineProperty(_class8, "ProactiveChatPaneBodyTitleText", "Hi! Have any questions? I am here to help."), _defineProperty(_class8, "ProactiveChatPaneStartButtonText", "Chat Now"), _defineProperty(_class8, "ReconnectChatPaneTitleText", "Previous session detected"), _defineProperty(_class8, "ReconnectChatPaneSubtitleText", "We have detected a previous chat session. Would you like to continue with your previous session?"), _defineProperty(_class8, "ReconnectChatPaneContinueChatButtonText", "Continue conversation"), _defineProperty(_class8, "ReconnectChatPaneStartNewChatButtonText", "Start new conversation"), _class8);
|
|
48
|
+
export const Texts = (_class8 = class Texts {}, _defineProperty(_class8, "IncomingCallTitle", "Incoming Call"), _defineProperty(_class8, "ChatButtonTitle", "Let's Chat!"), _defineProperty(_class8, "ChatButtonSubtitle", "We're online."), _defineProperty(_class8, "ChatButtonUnreadMessageString", "new messages"), _defineProperty(_class8, "ChatButtonLargeUnreadMessageString", "99+"), _defineProperty(_class8, "CloseButtonText", "Close"), _defineProperty(_class8, "ConfirmationPaneTitle", "Close chat"), _defineProperty(_class8, "ConfirmationPaneSubtitle", "Do you really want to close this chat?"), _defineProperty(_class8, "ConfirmButtonText", "Close"), _defineProperty(_class8, "EmailPlaceHolderText", "johnsmith@outlook.com"), _defineProperty(_class8, "CancelButtonText", "Cancel"), _defineProperty(_class8, "DownloadChatTranscriptText", "Download chat transcript"), _defineProperty(_class8, "EmailTranscriptText", "Email Transcript"), _defineProperty(_class8, "HeaderIcon", "Chat Icon"), _defineProperty(_class8, "HeaderTitle", "Let's Chat"), _defineProperty(_class8, "MinimizeText", "Minimize"), _defineProperty(_class8, "InputValidationPaneTitleText", "Email this chat transcript"), _defineProperty(_class8, "InputValidationPaneSubtitleText", "This will be sent after your chat ends."), _defineProperty(_class8, "InvalidInputErrorMessageText", "Enter a valid email address."), _defineProperty(_class8, "SendButtonText", "Send"), _defineProperty(_class8, "LoadingPaneTitleText", "Welcome to"), _defineProperty(_class8, "LoadingPaneSubtitleText", "live chat support ..."), _defineProperty(_class8, "LoadingPaneSpinnerText", "Loading ..."), _defineProperty(_class8, "OOOHPaneTitleText", "Thanks for contacting us. You have reached us outside of our operating hours. An agent will respond when we open."), _defineProperty(_class8, "PostChatSurveyPaneTitleText", "Post chat survey pane"), _defineProperty(_class8, "ProactiveChatPaneTitleText", "Welcome to"), _defineProperty(_class8, "ProactiveChatPaneSubtitleText", "Live chat support!"), _defineProperty(_class8, "ProactiveChatPaneBodyTitleText", "Hi! Have any questions? I am here to help."), _defineProperty(_class8, "ProactiveChatPaneStartButtonText", "Chat Now"), _defineProperty(_class8, "ReconnectChatPaneTitleText", "Previous session detected"), _defineProperty(_class8, "ReconnectChatPaneSubtitleText", "We have detected a previous chat session. Would you like to continue with your previous session?"), _defineProperty(_class8, "ReconnectChatPaneContinueChatButtonText", "Continue conversation"), _defineProperty(_class8, "ReconnectChatPaneStartNewChatButtonText", "Start new conversation"), _class8);
|
|
@@ -19,7 +19,7 @@ import { defaultInputValidationPaneTitleStyles } from "./common/default/defaultS
|
|
|
19
19
|
import { generateEventName } from "../../common/utils";
|
|
20
20
|
|
|
21
21
|
function InputValidationPane(props) {
|
|
22
|
-
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$
|
|
22
|
+
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$controlProps25, _props$componentOverr4, _props$styleProps22, _props$styleProps22$c, _props$controlProps26, _props$controlProps27, _props$controlProps28, _props$styleProps23, _props$styleProps23$c, _props$controlProps29, _props$componentOverr5, _props$styleProps24, _props$styleProps24$c, _props$controlProps30, _props$controlProps31, _props$controlProps32, _props$controlProps33, _props$componentOverr6, _props$styleProps25, _props$styleProps25$c, _props$controlProps34, _props$controlProps35, _props$controlProps36;
|
|
23
23
|
|
|
24
24
|
const elementId = ((_props$controlProps = props.controlProps) === null || _props$controlProps === void 0 ? void 0 : _props$controlProps.id) ?? defaultInputValidationPaneControlProps.id;
|
|
25
25
|
const [inputValue, setInputValue] = useState("");
|
|
@@ -211,39 +211,40 @@ function InputValidationPane(props) {
|
|
|
211
211
|
ariaLabel: ((_props$controlProps24 = props.controlProps) === null || _props$controlProps24 === void 0 ? void 0 : _props$controlProps24.inputAriaLabel) || defaultInputValidationPaneControlProps.inputAriaLabel,
|
|
212
212
|
borderless: isInvalidInput,
|
|
213
213
|
onChange: handleInputChange,
|
|
214
|
-
onKeyUp: handleInputKeyUp
|
|
214
|
+
onKeyUp: handleInputKeyUp,
|
|
215
|
+
placeholder: ((_props$controlProps25 = props.controlProps) === null || _props$controlProps25 === void 0 ? void 0 : _props$controlProps25.inputPlaceHolder) || defaultInputValidationPaneControlProps.inputPlaceHolder
|
|
215
216
|
})), isInvalidInput && (decodeComponentString((_props$componentOverr4 = props.componentOverrides) === null || _props$componentOverr4 === void 0 ? void 0 : _props$componentOverr4.invalidInputErrorMessage) || /*#__PURE__*/React.createElement(Stack, {
|
|
216
217
|
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,
|
|
217
218
|
styles: invalidInputErrorMessageStyles,
|
|
218
|
-
"aria-label": ((_props$
|
|
219
|
+
"aria-label": ((_props$controlProps26 = props.controlProps) === null || _props$controlProps26 === void 0 ? void 0 : _props$controlProps26.invalidInputErrorMessageText) || defaultInputValidationPaneControlProps.invalidInputErrorMessageText,
|
|
219
220
|
tabIndex: -1,
|
|
220
221
|
role: "alert",
|
|
221
222
|
id: elementId + "-invalidinputerrormessage"
|
|
222
|
-
}, ((_props$
|
|
223
|
-
horizontal: ((_props$
|
|
223
|
+
}, ((_props$controlProps27 = props.controlProps) === null || _props$controlProps27 === void 0 ? void 0 : _props$controlProps27.invalidInputErrorMessageText) || defaultInputValidationPaneControlProps.invalidInputErrorMessageText))), /*#__PURE__*/React.createElement(Stack, {
|
|
224
|
+
horizontal: ((_props$controlProps28 = props.controlProps) === null || _props$controlProps28 === void 0 ? void 0 : _props$controlProps28.isButtonGroupHorizontal) ?? defaultInputValidationPaneControlProps.isButtonGroupHorizontal,
|
|
224
225
|
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,
|
|
225
226
|
styles: buttonGroupStyles,
|
|
226
227
|
tabIndex: -1,
|
|
227
228
|
id: elementId + "-buttongroup"
|
|
228
|
-
}, !((_props$
|
|
229
|
+
}, !((_props$controlProps29 = props.controlProps) !== null && _props$controlProps29 !== void 0 && _props$controlProps29.hideSendButton) && (decodeComponentString((_props$componentOverr5 = props.componentOverrides) === null || _props$componentOverr5 === void 0 ? void 0 : _props$componentOverr5.sendButton) || /*#__PURE__*/React.createElement(PrimaryButton, {
|
|
229
230
|
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,
|
|
230
231
|
styles: sendButtonStyles,
|
|
231
|
-
title: ((_props$
|
|
232
|
+
title: ((_props$controlProps30 = props.controlProps) === null || _props$controlProps30 === void 0 ? void 0 : _props$controlProps30.sendButtonText) || defaultInputValidationPaneControlProps.sendButtonText,
|
|
232
233
|
tabIndex: 0,
|
|
233
234
|
disabled: !isSendButtonEnabled,
|
|
234
|
-
text: ((_props$
|
|
235
|
+
text: ((_props$controlProps31 = props.controlProps) === null || _props$controlProps31 === void 0 ? void 0 : _props$controlProps31.sendButtonText) || defaultInputValidationPaneControlProps.sendButtonText,
|
|
235
236
|
onClick: handleSendClick,
|
|
236
237
|
id: elementId + "-sendbutton",
|
|
237
|
-
ariaLabel: ((_props$
|
|
238
|
-
})), !((_props$
|
|
238
|
+
ariaLabel: ((_props$controlProps32 = props.controlProps) === null || _props$controlProps32 === void 0 ? void 0 : _props$controlProps32.sendButtonAriaLabel) || defaultInputValidationPaneControlProps.sendButtonAriaLabel
|
|
239
|
+
})), !((_props$controlProps33 = props.controlProps) !== null && _props$controlProps33 !== void 0 && _props$controlProps33.hideCancelButton) && (decodeComponentString((_props$componentOverr6 = props.componentOverrides) === null || _props$componentOverr6 === void 0 ? void 0 : _props$componentOverr6.cancelButton) || /*#__PURE__*/React.createElement(DefaultButton, {
|
|
239
240
|
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,
|
|
240
241
|
styles: cancelButtonStyles,
|
|
241
|
-
title: ((_props$
|
|
242
|
+
title: ((_props$controlProps34 = props.controlProps) === null || _props$controlProps34 === void 0 ? void 0 : _props$controlProps34.cancelButtonText) || defaultInputValidationPaneControlProps.cancelButtonText,
|
|
242
243
|
tabIndex: 0,
|
|
243
|
-
text: ((_props$
|
|
244
|
+
text: ((_props$controlProps35 = props.controlProps) === null || _props$controlProps35 === void 0 ? void 0 : _props$controlProps35.cancelButtonText) || defaultInputValidationPaneControlProps.cancelButtonText,
|
|
244
245
|
onClick: handleCancelClick,
|
|
245
246
|
id: elementId + "-cancelbutton",
|
|
246
|
-
ariaLabel: ((_props$
|
|
247
|
+
ariaLabel: ((_props$controlProps36 = props.controlProps) === null || _props$controlProps36 === void 0 ? void 0 : _props$controlProps36.cancelButtonAriaLabel) || defaultInputValidationPaneControlProps.cancelButtonAriaLabel
|
|
247
248
|
})))));
|
|
248
249
|
}
|
|
249
250
|
|
|
@@ -10,6 +10,7 @@ export const defaultInputValidationPaneControlProps = {
|
|
|
10
10
|
subtitleText: Texts.InputValidationPaneSubtitleText,
|
|
11
11
|
inputId: Ids.DefaultInputValidationPaneInputId,
|
|
12
12
|
inputInitialText: "",
|
|
13
|
+
inputPlaceHolder: Texts.EmailPlaceHolderText,
|
|
13
14
|
hideInput: false,
|
|
14
15
|
inputAriaLabel: AriaLabels.InputValidationPaneInput,
|
|
15
16
|
inputWithErrorMessageBorderColor: "rgb(164, 38, 44)",
|
|
@@ -12,6 +12,7 @@ export const presetTwoInputValidationPaneControlProps = {
|
|
|
12
12
|
hideInput: false,
|
|
13
13
|
inputAriaLabel: AriaLabels.InputValidationPaneInput,
|
|
14
14
|
inputWithErrorMessageBorderColor: "rgb(164, 38, 44)",
|
|
15
|
+
inputPlaceHolder: Texts.EmailPlaceHolderText,
|
|
15
16
|
invalidInputErrorMessageText: Texts.InvalidInputErrorMessageText,
|
|
16
17
|
isButtonGroupHorizontal: false,
|
|
17
18
|
hideSendButton: false,
|
|
@@ -164,6 +164,7 @@ export declare const Texts: {
|
|
|
164
164
|
readonly ConfirmationPaneTitle: "Close chat";
|
|
165
165
|
readonly ConfirmationPaneSubtitle: "Do you really want to close this chat?";
|
|
166
166
|
readonly ConfirmButtonText: "Close";
|
|
167
|
+
readonly EmailPlaceHolderText: "johnsmith@outlook.com";
|
|
167
168
|
readonly CancelButtonText: "Cancel";
|
|
168
169
|
readonly DownloadChatTranscriptText: "Download chat transcript";
|
|
169
170
|
readonly EmailTranscriptText: "Email Transcript";
|
package/lib/types/components/inputvalidationpane/interfaces/IInputValidationPaneControlProps.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export interface IInputValidationPaneControlProps {
|
|
|
12
12
|
hideInput?: boolean;
|
|
13
13
|
inputAriaLabel?: string;
|
|
14
14
|
inputWithErrorMessageBorderColor?: string;
|
|
15
|
+
inputPlaceHolder?: string;
|
|
15
16
|
invalidInputErrorMessageText?: string;
|
|
16
17
|
isButtonGroupHorizontal?: boolean;
|
|
17
18
|
hideSendButton?: boolean;
|