@microsoft/omnichannel-chat-components 0.1.0-main.cb39af7 → 0.1.0-main.d066b23
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/components/callingcontainer/subcomponents/IncomingCall/IncomingCall.js +3 -1
- package/lib/cjs/components/confirmationpane/ConfirmationPane.js +7 -0
- package/lib/cjs/components/inputvalidationpane/InputValidationPane.js +28 -28
- package/lib/cjs/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneCancelButtonStyles.js +2 -1
- package/lib/cjs/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneInvalidInputErrorMessageStyles.js +1 -1
- package/lib/cjs/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneSendButtonStyles.js +2 -1
- package/lib/cjs/components/prechatsurveypane/PreChatSurveyPane.js +1 -0
- package/lib/esm/components/callingcontainer/subcomponents/IncomingCall/IncomingCall.js +3 -1
- package/lib/esm/components/confirmationpane/ConfirmationPane.js +8 -1
- package/lib/esm/components/inputvalidationpane/InputValidationPane.js +29 -29
- package/lib/esm/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneCancelButtonStyles.js +2 -1
- package/lib/esm/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneInvalidInputErrorMessageStyles.js +1 -1
- package/lib/esm/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneSendButtonStyles.js +2 -1
- package/lib/esm/components/prechatsurveypane/PreChatSurveyPane.js +1 -0
- package/package.json +1 -1
|
@@ -137,7 +137,9 @@ function IncomingCall(props) {
|
|
|
137
137
|
className: (_props$styleProps10 = props.styleProps) === null || _props$styleProps10 === void 0 ? void 0 : _props$styleProps10.className,
|
|
138
138
|
horizontalAlign: "space-between",
|
|
139
139
|
styles: stackStyles,
|
|
140
|
-
dir: ((_props$controlProps18 = props.controlProps) === null || _props$controlProps18 === void 0 ? void 0 : _props$controlProps18.dir) ?? ((_defaultIncomingCallP27 = _defaultIncomingCallProps.defaultIncomingCallProps.controlProps) === null || _defaultIncomingCallP27 === void 0 ? void 0 : _defaultIncomingCallP27.dir)
|
|
140
|
+
dir: ((_props$controlProps18 = props.controlProps) === null || _props$controlProps18 === void 0 ? void 0 : _props$controlProps18.dir) ?? ((_defaultIncomingCallP27 = _defaultIncomingCallProps.defaultIncomingCallProps.controlProps) === null || _defaultIncomingCallP27 === void 0 ? void 0 : _defaultIncomingCallP27.dir),
|
|
141
|
+
role: "alert",
|
|
142
|
+
"aria-label": incomingCallTitleProps === null || incomingCallTitleProps === void 0 ? void 0 : incomingCallTitleProps.text
|
|
141
143
|
}, /*#__PURE__*/React.createElement(_react2.Stack, {
|
|
142
144
|
horizontal: true,
|
|
143
145
|
id: "incomingCallLeftGroup",
|
|
@@ -80,6 +80,12 @@ function ConfirmationPane(props) {
|
|
|
80
80
|
|
|
81
81
|
(_props$controlProps5 = props.controlProps) === null || _props$controlProps5 === void 0 ? void 0 : _props$controlProps5.onCancel();
|
|
82
82
|
}
|
|
83
|
+
}, []); // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
84
|
+
|
|
85
|
+
const handleEscKeyDown = (0, _react2.useCallback)(e => {
|
|
86
|
+
if (e.code === _Constants.KeyCodes.ESCAPE) {
|
|
87
|
+
handleCancelClick();
|
|
88
|
+
}
|
|
83
89
|
}, []);
|
|
84
90
|
const containerStyles = {
|
|
85
91
|
root: Object.assign({}, _defaultConfirmationPaneGeneralStyles.defaultConfirmationPaneGeneralStyles, (_props$styleProps = props.styleProps) === null || _props$styleProps === void 0 ? void 0 : _props$styleProps.generalStyleProps)
|
|
@@ -107,6 +113,7 @@ function ConfirmationPane(props) {
|
|
|
107
113
|
};
|
|
108
114
|
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, {
|
|
109
115
|
id: elementId,
|
|
116
|
+
onKeyDown: handleEscKeyDown,
|
|
110
117
|
tabIndex: -1,
|
|
111
118
|
dir: ((_props$controlProps7 = props.controlProps) === null || _props$controlProps7 === void 0 ? void 0 : _props$controlProps7.dir) || _defaultConfirmationPaneControlProps.defaultConfirmationPaneControlProps.dir,
|
|
112
119
|
styles: containerStyles,
|
|
@@ -55,23 +55,28 @@ function InputValidationPane(props) {
|
|
|
55
55
|
const [isInitialRendering, setIsInitialRendering] = (0, _react2.useState)(true);
|
|
56
56
|
const [isInvalidInput, setIsInvalidInput] = (0, _react2.useState)(false);
|
|
57
57
|
const [isSendButtonEnabled, setIsSendButtonEnabled] = (0, _react2.useState)(false);
|
|
58
|
-
|
|
59
|
-
const isValidInput = () => {
|
|
58
|
+
const isValidInput = (0, _react2.useCallback)(() => {
|
|
60
59
|
var _props$controlProps2, _props$controlProps3;
|
|
61
60
|
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
if (!((_props$controlProps2 = props.controlProps) !== null && _props$controlProps2 !== void 0 && _props$controlProps2.checkInput)) {
|
|
62
|
+
return true;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (!inputValue) {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
64
68
|
|
|
69
|
+
return (_props$controlProps3 = props.controlProps) === null || _props$controlProps3 === void 0 ? void 0 : _props$controlProps3.checkInput(inputValue);
|
|
70
|
+
}, [inputValue]); // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
65
71
|
|
|
66
|
-
const handleInputChange = e => {
|
|
72
|
+
const handleInputChange = (0, _react2.useCallback)(e => {
|
|
67
73
|
var _props$controlProps4, _props$controlProps5;
|
|
68
74
|
|
|
69
75
|
setInputValue(e.target.value);
|
|
70
76
|
e.target.value ? setIsSendButtonEnabled(((_props$controlProps4 = props.controlProps) === null || _props$controlProps4 === void 0 ? void 0 : _props$controlProps4.enableSendButton) || e.target.value !== "") : setIsSendButtonEnabled(((_props$controlProps5 = props.controlProps) === null || _props$controlProps5 === void 0 ? void 0 : _props$controlProps5.enableSendButton) ?? false);
|
|
71
77
|
setIsInvalidInput(false);
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
const send = (controlId, suffix) => {
|
|
78
|
+
}, []);
|
|
79
|
+
const send = (0, _react2.useCallback)((controlId, suffix) => {
|
|
75
80
|
var _props$controlProps6;
|
|
76
81
|
|
|
77
82
|
if ((_props$controlProps6 = props.controlProps) !== null && _props$controlProps6 !== void 0 && _props$controlProps6.onSend) {
|
|
@@ -90,20 +95,17 @@ function InputValidationPane(props) {
|
|
|
90
95
|
setIsInvalidInput(true);
|
|
91
96
|
}
|
|
92
97
|
}
|
|
93
|
-
}; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
98
|
+
}, [inputValue]); // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
94
99
|
|
|
95
|
-
|
|
96
|
-
const handleInputKeyDown = e => {
|
|
100
|
+
const handleInputKeyUp = (0, _react2.useCallback)(e => {
|
|
97
101
|
if (e.code === _Constants.KeyCodes.ENTER) {
|
|
98
|
-
send(elementId + "-textField", "
|
|
102
|
+
send(elementId + "-textField", "KeyUp");
|
|
99
103
|
}
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
const handleSendClick = () => {
|
|
104
|
+
}, [inputValue]);
|
|
105
|
+
const handleSendClick = (0, _react2.useCallback)(() => {
|
|
103
106
|
send(elementId + "-sendbutton", "Click");
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
const cancel = (controlId, suffix) => {
|
|
107
|
+
}, [inputValue]);
|
|
108
|
+
const cancel = (0, _react2.useCallback)((controlId, suffix) => {
|
|
107
109
|
var _props$controlProps8;
|
|
108
110
|
|
|
109
111
|
if ((_props$controlProps8 = props.controlProps) !== null && _props$controlProps8 !== void 0 && _props$controlProps8.onCancel) {
|
|
@@ -121,19 +123,16 @@ function InputValidationPane(props) {
|
|
|
121
123
|
|
|
122
124
|
(_props$controlProps10 = props.controlProps) === null || _props$controlProps10 === void 0 ? void 0 : _props$controlProps10.onCancel();
|
|
123
125
|
}
|
|
124
|
-
}; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
125
|
-
|
|
126
|
+
}, []); // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
126
127
|
|
|
127
|
-
const handleEscKeyDown = e => {
|
|
128
|
+
const handleEscKeyDown = (0, _react2.useCallback)(e => {
|
|
128
129
|
if (e.code === _Constants.KeyCodes.ESCAPE) {
|
|
129
130
|
cancel(elementId, "KeyDown");
|
|
130
131
|
}
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
const handleCancelClick = () => {
|
|
132
|
+
}, []);
|
|
133
|
+
const handleCancelClick = (0, _react2.useCallback)(() => {
|
|
134
134
|
cancel(elementId + "-cancelbutton", "Click");
|
|
135
|
-
};
|
|
136
|
-
|
|
135
|
+
}, []);
|
|
137
136
|
(0, _react2.useEffect)(() => {
|
|
138
137
|
var _props$controlProps11, _props$controlProps12, _props$controlProps13;
|
|
139
138
|
|
|
@@ -160,7 +159,8 @@ function InputValidationPane(props) {
|
|
|
160
159
|
const redBorderStyles = {
|
|
161
160
|
borderColor: ((_props$controlProps14 = props.controlProps) === null || _props$controlProps14 === void 0 ? void 0 : _props$controlProps14.inputWithErrorMessageBorderColor) ?? _defaultInputValidationPaneControlProps.defaultInputValidationPaneControlProps.inputWithErrorMessageBorderColor,
|
|
162
161
|
borderRadius: "1px",
|
|
163
|
-
borderStyle: "solid"
|
|
162
|
+
borderStyle: "solid",
|
|
163
|
+
borderWidth: "1px"
|
|
164
164
|
};
|
|
165
165
|
const inputStyles = {
|
|
166
166
|
root: Object.assign({}, _defaultInputValidationPaneInputStyles.defaultInputValidationPaneInputStyles, (_props$styleProps5 = props.styleProps) === null || _props$styleProps5 === void 0 ? void 0 : _props$styleProps5.inputStyleProps),
|
|
@@ -244,7 +244,7 @@ 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
|
-
|
|
247
|
+
onKeyUp: handleInputKeyUp
|
|
248
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, {
|
|
249
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,
|
|
250
250
|
styles: invalidInputErrorMessageStyles,
|
|
@@ -16,6 +16,7 @@ const defaultInputValidationPaneCancelButtonStyles = {
|
|
|
16
16
|
fontWeight: "500",
|
|
17
17
|
lineHeight: "19px",
|
|
18
18
|
textOverflow: "ellipsis",
|
|
19
|
-
whiteSpace: "nowrap"
|
|
19
|
+
whiteSpace: "nowrap",
|
|
20
|
+
width: "80px"
|
|
20
21
|
};
|
|
21
22
|
exports.defaultInputValidationPaneCancelButtonStyles = defaultInputValidationPaneCancelButtonStyles;
|
|
@@ -12,6 +12,7 @@ const defaultInputValidationPaneSendButtonStyles = {
|
|
|
12
12
|
fontWeight: "500",
|
|
13
13
|
lineHeight: "19px",
|
|
14
14
|
textOverflow: "ellipsis",
|
|
15
|
-
whiteSpace: "nowrap"
|
|
15
|
+
whiteSpace: "nowrap",
|
|
16
|
+
width: "80px"
|
|
16
17
|
};
|
|
17
18
|
exports.defaultInputValidationPaneSendButtonStyles = defaultInputValidationPaneSendButtonStyles;
|
|
@@ -82,6 +82,7 @@ function PreChatSurveyPane(props) {
|
|
|
82
82
|
}
|
|
83
83
|
}, []); //Adaptive Card Initilializations
|
|
84
84
|
|
|
85
|
+
AdaptiveCards.GlobalSettings.setTabIndexAtCardRoot = false;
|
|
85
86
|
const adaptiveCard = new AdaptiveCards.AdaptiveCard();
|
|
86
87
|
adaptiveCard.hostConfig = new AdaptiveCards.HostConfig(adaptiveCardHostConfig);
|
|
87
88
|
adaptiveCard.parse(adpativeCardPayload);
|
|
@@ -119,7 +119,9 @@ function IncomingCall(props) {
|
|
|
119
119
|
className: (_props$styleProps10 = props.styleProps) === null || _props$styleProps10 === void 0 ? void 0 : _props$styleProps10.className,
|
|
120
120
|
horizontalAlign: "space-between",
|
|
121
121
|
styles: stackStyles,
|
|
122
|
-
dir: ((_props$controlProps18 = props.controlProps) === null || _props$controlProps18 === void 0 ? void 0 : _props$controlProps18.dir) ?? ((_defaultIncomingCallP27 = defaultIncomingCallProps.controlProps) === null || _defaultIncomingCallP27 === void 0 ? void 0 : _defaultIncomingCallP27.dir)
|
|
122
|
+
dir: ((_props$controlProps18 = props.controlProps) === null || _props$controlProps18 === void 0 ? void 0 : _props$controlProps18.dir) ?? ((_defaultIncomingCallP27 = defaultIncomingCallProps.controlProps) === null || _defaultIncomingCallP27 === void 0 ? void 0 : _defaultIncomingCallP27.dir),
|
|
123
|
+
role: "alert",
|
|
124
|
+
"aria-label": incomingCallTitleProps === null || incomingCallTitleProps === void 0 ? void 0 : incomingCallTitleProps.text
|
|
123
125
|
}, /*#__PURE__*/React.createElement(Stack, {
|
|
124
126
|
horizontal: true,
|
|
125
127
|
id: "incomingCallLeftGroup",
|
|
@@ -2,7 +2,7 @@ import { DefaultButton, PrimaryButton } from "@fluentui/react/lib/Button";
|
|
|
2
2
|
import { Label, Stack } from "@fluentui/react";
|
|
3
3
|
import React, { useCallback } from "react";
|
|
4
4
|
import { BroadcastService } from "../../services/BroadcastService";
|
|
5
|
-
import { ElementType } from "../../common/Constants";
|
|
5
|
+
import { ElementType, KeyCodes } from "../../common/Constants";
|
|
6
6
|
import { decodeComponentString } from "../../common/decodeComponentString";
|
|
7
7
|
import { defaultConfirmationPaneButtonGroupStyles } from "./common/defaultStyles/defaultConfirmationPaneButtonGroupStyles";
|
|
8
8
|
import { defaultConfirmationPaneCancelButtonHoveredStyles } from "./common/defaultStyles/defaultConfirmationPaneCancelButtonHoveredStyles";
|
|
@@ -49,6 +49,12 @@ function ConfirmationPane(props) {
|
|
|
49
49
|
BroadcastService.postMessage(customEvent);
|
|
50
50
|
(_props$controlProps5 = props.controlProps) === null || _props$controlProps5 === void 0 ? void 0 : _props$controlProps5.onCancel();
|
|
51
51
|
}
|
|
52
|
+
}, []); // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
53
|
+
|
|
54
|
+
const handleEscKeyDown = useCallback(e => {
|
|
55
|
+
if (e.code === KeyCodes.ESCAPE) {
|
|
56
|
+
handleCancelClick();
|
|
57
|
+
}
|
|
52
58
|
}, []);
|
|
53
59
|
const containerStyles = {
|
|
54
60
|
root: Object.assign({}, defaultConfirmationPaneGeneralStyles, (_props$styleProps = props.styleProps) === null || _props$styleProps === void 0 ? void 0 : _props$styleProps.generalStyleProps)
|
|
@@ -76,6 +82,7 @@ function ConfirmationPane(props) {
|
|
|
76
82
|
};
|
|
77
83
|
return /*#__PURE__*/React.createElement(React.Fragment, null, !((_props$controlProps6 = props.controlProps) !== null && _props$controlProps6 !== void 0 && _props$controlProps6.hideConfirmationPane) && /*#__PURE__*/React.createElement(Stack, {
|
|
78
84
|
id: elementId,
|
|
85
|
+
onKeyDown: handleEscKeyDown,
|
|
79
86
|
tabIndex: -1,
|
|
80
87
|
dir: ((_props$controlProps7 = props.controlProps) === null || _props$controlProps7 === void 0 ? void 0 : _props$controlProps7.dir) || defaultConfirmationPaneControlProps.dir,
|
|
81
88
|
styles: containerStyles,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DefaultButton, PrimaryButton } from "@fluentui/react/lib/Button";
|
|
2
2
|
import { Label, Stack, TextField } from "@fluentui/react";
|
|
3
|
-
import React, { useEffect, useState } from "react";
|
|
3
|
+
import React, { useCallback, useEffect, useState } from "react";
|
|
4
4
|
import { BroadcastService } from "../../services/BroadcastService";
|
|
5
5
|
import { KeyCodes } from "../../common/Constants";
|
|
6
6
|
import { decodeComponentString } from "../../common/decodeComponentString";
|
|
@@ -26,23 +26,28 @@ function InputValidationPane(props) {
|
|
|
26
26
|
const [isInitialRendering, setIsInitialRendering] = useState(true);
|
|
27
27
|
const [isInvalidInput, setIsInvalidInput] = useState(false);
|
|
28
28
|
const [isSendButtonEnabled, setIsSendButtonEnabled] = useState(false);
|
|
29
|
-
|
|
30
|
-
const isValidInput = () => {
|
|
29
|
+
const isValidInput = useCallback(() => {
|
|
31
30
|
var _props$controlProps2, _props$controlProps3;
|
|
32
31
|
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
if (!((_props$controlProps2 = props.controlProps) !== null && _props$controlProps2 !== void 0 && _props$controlProps2.checkInput)) {
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (!inputValue) {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
35
39
|
|
|
40
|
+
return (_props$controlProps3 = props.controlProps) === null || _props$controlProps3 === void 0 ? void 0 : _props$controlProps3.checkInput(inputValue);
|
|
41
|
+
}, [inputValue]); // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
36
42
|
|
|
37
|
-
const handleInputChange = e => {
|
|
43
|
+
const handleInputChange = useCallback(e => {
|
|
38
44
|
var _props$controlProps4, _props$controlProps5;
|
|
39
45
|
|
|
40
46
|
setInputValue(e.target.value);
|
|
41
47
|
e.target.value ? setIsSendButtonEnabled(((_props$controlProps4 = props.controlProps) === null || _props$controlProps4 === void 0 ? void 0 : _props$controlProps4.enableSendButton) || e.target.value !== "") : setIsSendButtonEnabled(((_props$controlProps5 = props.controlProps) === null || _props$controlProps5 === void 0 ? void 0 : _props$controlProps5.enableSendButton) ?? false);
|
|
42
48
|
setIsInvalidInput(false);
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
const send = (controlId, suffix) => {
|
|
49
|
+
}, []);
|
|
50
|
+
const send = useCallback((controlId, suffix) => {
|
|
46
51
|
var _props$controlProps6;
|
|
47
52
|
|
|
48
53
|
if ((_props$controlProps6 = props.controlProps) !== null && _props$controlProps6 !== void 0 && _props$controlProps6.onSend) {
|
|
@@ -59,20 +64,17 @@ function InputValidationPane(props) {
|
|
|
59
64
|
setIsInvalidInput(true);
|
|
60
65
|
}
|
|
61
66
|
}
|
|
62
|
-
}; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
67
|
+
}, [inputValue]); // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
63
68
|
|
|
64
|
-
|
|
65
|
-
const handleInputKeyDown = e => {
|
|
69
|
+
const handleInputKeyUp = useCallback(e => {
|
|
66
70
|
if (e.code === KeyCodes.ENTER) {
|
|
67
|
-
send(elementId + "-textField", "
|
|
71
|
+
send(elementId + "-textField", "KeyUp");
|
|
68
72
|
}
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
const handleSendClick = () => {
|
|
73
|
+
}, [inputValue]);
|
|
74
|
+
const handleSendClick = useCallback(() => {
|
|
72
75
|
send(elementId + "-sendbutton", "Click");
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
const cancel = (controlId, suffix) => {
|
|
76
|
+
}, [inputValue]);
|
|
77
|
+
const cancel = useCallback((controlId, suffix) => {
|
|
76
78
|
var _props$controlProps8;
|
|
77
79
|
|
|
78
80
|
if ((_props$controlProps8 = props.controlProps) !== null && _props$controlProps8 !== void 0 && _props$controlProps8.onCancel) {
|
|
@@ -88,19 +90,16 @@ function InputValidationPane(props) {
|
|
|
88
90
|
BroadcastService.postMessage(customEvent);
|
|
89
91
|
(_props$controlProps10 = props.controlProps) === null || _props$controlProps10 === void 0 ? void 0 : _props$controlProps10.onCancel();
|
|
90
92
|
}
|
|
91
|
-
}; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
92
|
-
|
|
93
|
+
}, []); // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
93
94
|
|
|
94
|
-
const handleEscKeyDown = e => {
|
|
95
|
+
const handleEscKeyDown = useCallback(e => {
|
|
95
96
|
if (e.code === KeyCodes.ESCAPE) {
|
|
96
97
|
cancel(elementId, "KeyDown");
|
|
97
98
|
}
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
const handleCancelClick = () => {
|
|
99
|
+
}, []);
|
|
100
|
+
const handleCancelClick = useCallback(() => {
|
|
101
101
|
cancel(elementId + "-cancelbutton", "Click");
|
|
102
|
-
};
|
|
103
|
-
|
|
102
|
+
}, []);
|
|
104
103
|
useEffect(() => {
|
|
105
104
|
var _props$controlProps11, _props$controlProps12, _props$controlProps13;
|
|
106
105
|
|
|
@@ -127,7 +126,8 @@ function InputValidationPane(props) {
|
|
|
127
126
|
const redBorderStyles = {
|
|
128
127
|
borderColor: ((_props$controlProps14 = props.controlProps) === null || _props$controlProps14 === void 0 ? void 0 : _props$controlProps14.inputWithErrorMessageBorderColor) ?? defaultInputValidationPaneControlProps.inputWithErrorMessageBorderColor,
|
|
129
128
|
borderRadius: "1px",
|
|
130
|
-
borderStyle: "solid"
|
|
129
|
+
borderStyle: "solid",
|
|
130
|
+
borderWidth: "1px"
|
|
131
131
|
};
|
|
132
132
|
const inputStyles = {
|
|
133
133
|
root: Object.assign({}, defaultInputValidationPaneInputStyles, (_props$styleProps5 = props.styleProps) === null || _props$styleProps5 === void 0 ? void 0 : _props$styleProps5.inputStyleProps),
|
|
@@ -211,7 +211,7 @@ 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
|
-
|
|
214
|
+
onKeyUp: handleInputKeyUp
|
|
215
215
|
})), isInvalidInput && (decodeComponentString((_props$componentOverr4 = props.componentOverrides) === null || _props$componentOverr4 === void 0 ? void 0 : _props$componentOverr4.invalidInputErrorMessage) || /*#__PURE__*/React.createElement(Stack, {
|
|
216
216
|
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
217
|
styles: invalidInputErrorMessageStyles,
|
|
@@ -60,6 +60,7 @@ function PreChatSurveyPane(props) {
|
|
|
60
60
|
}
|
|
61
61
|
}, []); //Adaptive Card Initilializations
|
|
62
62
|
|
|
63
|
+
AdaptiveCards.GlobalSettings.setTabIndexAtCardRoot = false;
|
|
63
64
|
const adaptiveCard = new AdaptiveCards.AdaptiveCard();
|
|
64
65
|
adaptiveCard.hostConfig = new AdaptiveCards.HostConfig(adaptiveCardHostConfig);
|
|
65
66
|
adaptiveCard.parse(adpativeCardPayload);
|
package/package.json
CHANGED