oa-componentbook 0.18.9 → 0.18.11
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.
|
@@ -9,7 +9,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
10
|
var _antd = require("antd");
|
|
11
11
|
var _ColorVariablesMap = _interopRequireDefault(require("../../global-css/ColorVariablesMap"));
|
|
12
|
-
const _excluded = ["children", "contentHeight", "size", "spinning"];
|
|
12
|
+
const _excluded = ["children", "contentHeight", "delay", "size", "spinning"];
|
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
14
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
15
15
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
@@ -18,6 +18,7 @@ function CustomLoader(_ref) {
|
|
|
18
18
|
let {
|
|
19
19
|
children,
|
|
20
20
|
contentHeight,
|
|
21
|
+
delay,
|
|
21
22
|
size,
|
|
22
23
|
spinning
|
|
23
24
|
} = _ref,
|
|
@@ -34,7 +35,7 @@ function CustomLoader(_ref) {
|
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
37
|
}, /*#__PURE__*/_react.default.createElement(_antd.Spin, _extends({
|
|
37
|
-
delay:
|
|
38
|
+
delay: delay,
|
|
38
39
|
size: size,
|
|
39
40
|
spinning: spinning
|
|
40
41
|
}, antDesignProps), children));
|
|
@@ -42,11 +43,13 @@ function CustomLoader(_ref) {
|
|
|
42
43
|
CustomLoader.propTypes = {
|
|
43
44
|
children: _propTypes.default.node.isRequired,
|
|
44
45
|
contentHeight: _propTypes.default.string,
|
|
46
|
+
delay: _propTypes.default.number,
|
|
45
47
|
size: _propTypes.default.oneOf(['small', 'default', 'large']),
|
|
46
48
|
spinning: _propTypes.default.bool.isRequired
|
|
47
49
|
};
|
|
48
50
|
CustomLoader.defaultProps = {
|
|
49
51
|
contentHeight: 'none',
|
|
52
|
+
delay: 500,
|
|
50
53
|
size: 'default'
|
|
51
54
|
};
|
|
52
55
|
var _default = exports.default = CustomLoader;
|
|
@@ -1,37 +1,45 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
require("core-js/modules/es.symbol.description.js");
|
|
3
4
|
require("core-js/modules/es.weak-map.js");
|
|
4
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
|
|
8
|
+
exports.default = exports.StyledCustomDrawer = void 0;
|
|
9
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
var _antd = require("antd");
|
|
12
|
-
var
|
|
12
|
+
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
13
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
14
|
+
var _relativeTime = _interopRequireDefault(require("dayjs/plugin/relativeTime"));
|
|
15
|
+
var _lodash = require("lodash");
|
|
16
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
13
17
|
var _TextArea = _interopRequireDefault(require("../../components/oa-component-textarea/TextArea"));
|
|
18
|
+
var _icons = require("@material-ui/icons");
|
|
14
19
|
var _CustomButton = _interopRequireDefault(require("../../components/oa-component-button/CustomButton"));
|
|
15
20
|
var _CustomDrawer = _interopRequireDefault(require("../../components/oa-component-drawer/CustomDrawer"));
|
|
16
21
|
var _Typography = _interopRequireDefault(require("../../components/oa-component-typography/Typography"));
|
|
17
|
-
|
|
22
|
+
var _system = require("@material-ui/system");
|
|
23
|
+
var _templateObject;
|
|
18
24
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
19
25
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
28
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
29
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
30
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
31
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
32
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
33
|
+
_dayjs.default.extend(_relativeTime.default);
|
|
34
|
+
const StyledCustomDrawer = exports.StyledCustomDrawer = (0, _styledComponents.default)(_CustomDrawer.default)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n h3{\n margin: 0 0 4px;\n }\n .ant-drawer-footer span{\n margin: 0 0 4px;\n display: block;\n }\n .ant-drawer-footer aside{\n display: flex;\n justify-content: end;\n padding: 16px 0 0;\n }\n"])));
|
|
28
35
|
const stylesObj = {
|
|
29
36
|
chatUi: {
|
|
30
|
-
padding: '
|
|
31
|
-
backgroundColor: '
|
|
37
|
+
padding: '16px',
|
|
38
|
+
backgroundColor: 'var(--color-background-info)',
|
|
32
39
|
borderRadius: '4px',
|
|
33
|
-
|
|
34
|
-
marginTop: '
|
|
40
|
+
width: '440px',
|
|
41
|
+
marginTop: '20px',
|
|
42
|
+
marginBottom: '8px'
|
|
35
43
|
},
|
|
36
44
|
chatContainer: {
|
|
37
45
|
display: 'flex',
|
|
@@ -54,240 +62,130 @@ function ChatWidget(_ref) {
|
|
|
54
62
|
onMessageInput,
|
|
55
63
|
clearInput
|
|
56
64
|
} = _ref;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
//
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
//
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
// Info :
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
//
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
// >
|
|
182
|
-
// <div
|
|
183
|
-
// style={{
|
|
184
|
-
// display: 'flex',
|
|
185
|
-
// flexDirection: 'column',
|
|
186
|
-
// gap: '2px',
|
|
187
|
-
// maxWidth: '90%',
|
|
188
|
-
// ...stylesObj.chatUi,
|
|
189
|
-
// }}
|
|
190
|
-
// >
|
|
191
|
-
// <Typography />
|
|
192
|
-
// <Typography
|
|
193
|
-
// type="secondary"
|
|
194
|
-
// style={{
|
|
195
|
-
// fontSize: '10px',
|
|
196
|
-
// alignSelf: 'flex-end',
|
|
197
|
-
// width: 'fit-content',
|
|
198
|
-
// }}
|
|
199
|
-
// >
|
|
200
|
-
// {dayjs().fromNow()}
|
|
201
|
-
// </Typography>
|
|
202
|
-
// </div>
|
|
203
|
-
|
|
204
|
-
// </div>
|
|
205
|
-
// </Skeleton>
|
|
206
|
-
// )))
|
|
207
|
-
// ) : queryMessages?.length ? (
|
|
208
|
-
// queryMessages.map((message) => (message.isUser ? (
|
|
209
|
-
// // Info : This is the chat box of right side which will show messages from user.
|
|
210
|
-
// <div
|
|
211
|
-
// style={{
|
|
212
|
-
// display: 'flex',
|
|
213
|
-
// alignItems: 'flex-start',
|
|
214
|
-
// justifyContent: 'flex-end',
|
|
215
|
-
// }}
|
|
216
|
-
// >
|
|
217
|
-
// <div>
|
|
218
|
-
// <div
|
|
219
|
-
// style={{
|
|
220
|
-
// display: 'flex',
|
|
221
|
-
// flexDirection: 'column',
|
|
222
|
-
// gap: '2px',
|
|
223
|
-
// maxWidth: '90%',
|
|
224
|
-
// ...stylesObj.chatUi,
|
|
225
|
-
// backgroundColor: '#f6f6f6',
|
|
226
|
-
// }}
|
|
227
|
-
// >
|
|
228
|
-
// <Typography style={{ whiteSpace: 'pre-line' }}>
|
|
229
|
-
// {message.message}
|
|
230
|
-
// </Typography>
|
|
231
|
-
|
|
232
|
-
// </div>
|
|
233
|
-
// <Typography
|
|
234
|
-
// color="lightgray"
|
|
235
|
-
// style={{
|
|
236
|
-
// marginTop: '10px',
|
|
237
|
-
// fontSize: '10px',
|
|
238
|
-
// alignSelf: 'flex-end',
|
|
239
|
-
// width: 'fit-content',
|
|
240
|
-
// }}
|
|
241
|
-
// >
|
|
242
|
-
// {message.createdAt}
|
|
243
|
-
// </Typography>
|
|
244
|
-
|
|
245
|
-
// </div>
|
|
246
|
-
// </div>
|
|
247
|
-
// ) : (
|
|
248
|
-
// // Info : This is the chat box of left side which will show messages from other user.
|
|
249
|
-
// <div style={{
|
|
250
|
-
// display: 'flex',
|
|
251
|
-
// alignItems: 'flex-start',
|
|
252
|
-
// flexDirection: 'column',
|
|
253
|
-
// }}
|
|
254
|
-
// >
|
|
255
|
-
// <div
|
|
256
|
-
// style={{
|
|
257
|
-
// display: 'flex',
|
|
258
|
-
// flexDirection: 'column',
|
|
259
|
-
// gap: '2px',
|
|
260
|
-
// maxWidth: '90%',
|
|
261
|
-
// ...stylesObj.chatUi,
|
|
262
|
-
// }}
|
|
263
|
-
// >
|
|
264
|
-
// <Typography style={{ whiteSpace: 'pre-line' }}>
|
|
265
|
-
// {message.message}
|
|
266
|
-
// </Typography>
|
|
267
|
-
// </div>
|
|
268
|
-
// <Typography
|
|
269
|
-
// color="lightgray"
|
|
270
|
-
// style={{
|
|
271
|
-
// marginTop: '10px',
|
|
272
|
-
// fontSize: '10px',
|
|
273
|
-
// width: 'fit-content',
|
|
274
|
-
// }}
|
|
275
|
-
// >
|
|
276
|
-
// {message.createdAt}
|
|
277
|
-
// </Typography>
|
|
278
|
-
// </div>
|
|
279
|
-
// )))
|
|
280
|
-
// ) : (
|
|
281
|
-
// <Alert
|
|
282
|
-
// type="info"
|
|
283
|
-
// message="Send a chat to start your chat history for this ticket."
|
|
284
|
-
// />
|
|
285
|
-
// )}
|
|
286
|
-
// </div>
|
|
287
|
-
// </div>
|
|
288
|
-
|
|
289
|
-
// </CustomDrawer>
|
|
290
|
-
// );
|
|
65
|
+
const [message, setMessage] = (0, _react.useState)(initialMsg || '');
|
|
66
|
+
const onClearInput = () => {
|
|
67
|
+
clearInput && setMessage('');
|
|
68
|
+
};
|
|
69
|
+
const onMsgSend = () => {
|
|
70
|
+
onMessageInput(message);
|
|
71
|
+
onClearInput();
|
|
72
|
+
};
|
|
73
|
+
return /*#__PURE__*/_react.default.createElement(StyledCustomDrawer, {
|
|
74
|
+
open: show,
|
|
75
|
+
onClose: onClose,
|
|
76
|
+
closeIcon: null,
|
|
77
|
+
isBaseDrawer: true,
|
|
78
|
+
width: 860,
|
|
79
|
+
customTitle: true,
|
|
80
|
+
title: headerTitle,
|
|
81
|
+
footer: /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
82
|
+
className: "type-b2-400",
|
|
83
|
+
color: 'primary-content'
|
|
84
|
+
}, "Reply to Query"), /*#__PURE__*/_react.default.createElement(_TextArea.default, {
|
|
85
|
+
name: "message",
|
|
86
|
+
value: message,
|
|
87
|
+
placeholder: 'Type here...',
|
|
88
|
+
onChange: e => setMessage(e.target.value)
|
|
89
|
+
}), /*#__PURE__*/_react.default.createElement("aside", null, /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
90
|
+
onClick: onMsgSend,
|
|
91
|
+
size: 'medium',
|
|
92
|
+
label: 'Send Reply'
|
|
93
|
+
})))
|
|
94
|
+
}, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
95
|
+
color: "primary-content",
|
|
96
|
+
className: "type-t1-500"
|
|
97
|
+
}, bodyTitle), /*#__PURE__*/_react.default.createElement("div", null, isContentLoading ? [...Array((0, _lodash.random)(2, 5))].map((_, ind) => {
|
|
98
|
+
return ind % 2 ?
|
|
99
|
+
/*#__PURE__*/
|
|
100
|
+
// Info : This container is to show the loading of the chats (our chats) in the right side of chat body while chats are fetching.
|
|
101
|
+
_react.default.createElement(_antd.Skeleton, {
|
|
102
|
+
loading: isContentLoading,
|
|
103
|
+
avatar: true,
|
|
104
|
+
active: true,
|
|
105
|
+
title: false,
|
|
106
|
+
style: {
|
|
107
|
+
backgroundColor: "red"
|
|
108
|
+
}
|
|
109
|
+
}, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Typography.default, null, (0, _dayjs.default)().fromNow())))) :
|
|
110
|
+
/*#__PURE__*/
|
|
111
|
+
// Info : This container is to show the loading of the chats (other user) in the left side of chat body while chats are fetching.
|
|
112
|
+
_react.default.createElement(_antd.Skeleton, {
|
|
113
|
+
loading: isContentLoading,
|
|
114
|
+
avatar: true,
|
|
115
|
+
active: true,
|
|
116
|
+
title: false,
|
|
117
|
+
style: {
|
|
118
|
+
transform: "scale(-1, 1)"
|
|
119
|
+
}
|
|
120
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
121
|
+
flexDirection: "column",
|
|
122
|
+
style: _objectSpread({}, stylesObj.chatUi),
|
|
123
|
+
gap: "2px"
|
|
124
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
125
|
+
style: _objectSpread({
|
|
126
|
+
display: "flex",
|
|
127
|
+
flexDirection: "column",
|
|
128
|
+
gap: '2px'
|
|
129
|
+
}, stylesObj.chatUi)
|
|
130
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
131
|
+
type: "secondary",
|
|
132
|
+
style: {
|
|
133
|
+
fontSize: "10px",
|
|
134
|
+
alignSelf: "flex-end",
|
|
135
|
+
width: "fit-content"
|
|
136
|
+
}
|
|
137
|
+
}, (0, _dayjs.default)().fromNow()))));
|
|
138
|
+
}) : queryMessages !== null && queryMessages !== void 0 && queryMessages.length ? queryMessages.map(message => {
|
|
139
|
+
return message.isUser ?
|
|
140
|
+
/*#__PURE__*/
|
|
141
|
+
// Info : This is the chat box of right side which will show messages from user.
|
|
142
|
+
_react.default.createElement("div", {
|
|
143
|
+
style: {
|
|
144
|
+
display: 'flex',
|
|
145
|
+
alignItems: 'flex-start',
|
|
146
|
+
justifyContent: 'flex-end'
|
|
147
|
+
}
|
|
148
|
+
}, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
149
|
+
style: _objectSpread(_objectSpread({
|
|
150
|
+
display: "flex",
|
|
151
|
+
flexDirection: "column",
|
|
152
|
+
gap: '2px'
|
|
153
|
+
}, stylesObj.chatUi), {}, {
|
|
154
|
+
backgroundColor: '#f6f6f6'
|
|
155
|
+
})
|
|
156
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
157
|
+
className: "type-b1-400",
|
|
158
|
+
color: 'primary-content'
|
|
159
|
+
}, message.message)), /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
160
|
+
className: "type-sl1-700",
|
|
161
|
+
color: 'secondary-content'
|
|
162
|
+
}, message.createdAt))) :
|
|
163
|
+
/*#__PURE__*/
|
|
164
|
+
// Info : This is the chat box of left side which will show messages from other user.
|
|
165
|
+
_react.default.createElement("div", {
|
|
166
|
+
style: {
|
|
167
|
+
display: 'flex',
|
|
168
|
+
alignItems: 'flex-start',
|
|
169
|
+
flexDirection: 'column'
|
|
170
|
+
}
|
|
171
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
172
|
+
style: _objectSpread({
|
|
173
|
+
display: 'flex',
|
|
174
|
+
flexDirection: 'column',
|
|
175
|
+
gap: '2px'
|
|
176
|
+
}, stylesObj.chatUi)
|
|
177
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
178
|
+
className: "type-b1-400",
|
|
179
|
+
color: 'primary-content'
|
|
180
|
+
}, message.message)), /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
181
|
+
className: "type-sl1-700",
|
|
182
|
+
color: 'secondary-content'
|
|
183
|
+
}, message.createdAt));
|
|
184
|
+
}) : /*#__PURE__*/_react.default.createElement(_antd.Alert, {
|
|
185
|
+
type: "info",
|
|
186
|
+
message: "Send a chat to start your chat history for this ticket."
|
|
187
|
+
}))));
|
|
188
|
+
}
|
|
291
189
|
ChatWidget.propTypes = {
|
|
292
190
|
show: _propTypes.default.bool,
|
|
293
191
|
onClose: _propTypes.default.func,
|
|
@@ -303,9 +201,9 @@ ChatWidget.defaultProps = {
|
|
|
303
201
|
show: false,
|
|
304
202
|
onClose: () => {},
|
|
305
203
|
isContentLoading: true,
|
|
306
|
-
headerTitle: '
|
|
307
|
-
bodyTitle: '
|
|
308
|
-
onMessageInput: msg => alert(
|
|
204
|
+
headerTitle: 'VIEW OR REPLY TO QUERY',
|
|
205
|
+
bodyTitle: 'Purchase Invoice',
|
|
206
|
+
onMessageInput: msg => alert('This is your msg :' + msg),
|
|
309
207
|
initialMsg: '',
|
|
310
208
|
clearInput: true,
|
|
311
209
|
queryMessages: [{
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ChatUi = exports.ChatFooter = exports.ChatDrawer = exports.ChatContainer = void 0;
|
|
7
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
11
|
+
const ChatUi = exports.ChatUi = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding: 16px;\n background-color: var(--color-background-info);\n border-radius: 4px;\n max-width: 440px;\n margin-top: 12px;\n"])));
|
|
12
|
+
const ChatContainer = exports.ChatContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n width: 100%;\n height: 100%;\n position: relative;\n flex: 9;\n overflow: auto;\n"])));
|
|
13
|
+
const ChatDrawer = exports.ChatDrawer = (0, _styledComponents.default)(CustomDrawer)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n // Your CustomDrawer styles here\n"])));
|
|
14
|
+
const ChatFooter = exports.ChatFooter = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n gap: 8px;\n overflow: hidden;\n"])));
|
|
15
|
+
|
|
16
|
+
// Add more styled components as needed
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
|
+
var _Typography = _interopRequireDefault(require("../../components/oa-component-typography/Typography"));
|
|
10
|
+
var _templateObject;
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
13
|
+
const Container = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding: 16px;\n border: 1px solid var(--color-divider);\n background: var(--color-secondary-background);\n"])));
|
|
14
|
+
function CustomDetails(_ref) {
|
|
15
|
+
let {
|
|
16
|
+
text
|
|
17
|
+
} = _ref;
|
|
18
|
+
return /*#__PURE__*/_react.default.createElement(Container, null, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
19
|
+
className: "type-t1-500",
|
|
20
|
+
color: "primary-content"
|
|
21
|
+
}, text));
|
|
22
|
+
}
|
|
23
|
+
var _default = exports.default = CustomDetails;
|