tenjin-ui-kit 0.3.72 → 0.3.74
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/README.md +13 -13
- package/common/hooks/apiHooks.js +182 -114
- package/common/hooks/newApiHook.js +225 -143
- package/common/utils/security/index.js +2 -2
- package/common/utils/security/securityConfig.js +2 -1
- package/components/Canvas.js +88 -164
- package/components/DragBox/index.js +26 -21
- package/components/InputWithChip/index.js +57 -164
- package/components/RightContext/index.css +20 -20
- package/components/RightContext/index.js +28 -19
- package/components/WorkFlow.js +23 -18
- package/components/WorkFlowBuilder.js +48 -33
- package/components/alert/Style.js +14 -11
- package/components/alert/index.js +12 -10
- package/components/attachment/index.js +28 -21
- package/components/authenticationProvider/AuthError.js +4 -3
- package/components/authenticationProvider/AuthLoader.js +4 -3
- package/components/authenticationProvider/index.js +116 -60
- package/components/avatar/index.js +14 -13
- package/components/avatar/styles.js +77 -74
- package/components/breadCrumbs/index.js +53 -42
- package/components/breadCrumbs/style.js +4 -1
- package/components/browsingTestCaseLayout/DetailsViewLayout/DetailsViewContent/index.js +6 -5
- package/components/browsingTestCaseLayout/DetailsViewLayout/DetailsViewContent/style.js +8 -5
- package/components/browsingTestCaseLayout/DetailsViewLayout/DetailsViewHeader/index.js +5 -4
- package/components/browsingTestCaseLayout/TreeViewLayout/TreeViewContent/Index.js +5 -4
- package/components/browsingTestCaseLayout/TreeViewLayout/TreeViewHeader/Index.js +6 -5
- package/components/browsingTestCaseLayout/TreeViewLayout/TreeViewHeader/style.js +19 -16
- package/components/browsingTestCaseLayout/index.js +30 -25
- package/components/browsingTestCaseLayout/style.css +82 -82
- package/components/button/index.js +43 -36
- package/components/chatBotModal/index.js +45 -36
- package/components/checkBox/index.js +9 -8
- package/components/combobox/index.js +188 -167
- package/components/divider/index.js +18 -14
- package/components/editableField/index.js +28 -19
- package/components/error/index.js +12 -6
- package/components/errorBoundary/index.js +94 -74
- package/components/fileUploader/index.js +35 -30
- package/components/fileUploader/style.js +49 -46
- package/components/filter/ValueSelector.js +207 -135
- package/components/filter/index.js +33 -26
- package/components/iconButton/index.js +4 -3
- package/components/input/index.js +38 -31
- package/components/layout/index.js +31 -27
- package/components/layout/main/index.js +13 -10
- package/components/layout/main/style.js +14 -11
- package/components/layout/pageContent/index.js +7 -6
- package/components/layout/sidebar/FlatMenu.js +43 -43
- package/components/layout/sidebar/GroupedIconMenu.js +108 -95
- package/components/layout/sidebar/GroupedMenu.js +48 -38
- package/components/layout/sidebar/ProjectMenu.js +116 -109
- package/components/layout/sidebar/index.js +18 -15
- package/components/layout/sidebar/style.js +143 -138
- package/components/layout/topBar/ProjectTopbar.js +98 -81
- package/components/layout/topBar/UserAvatar.js +55 -48
- package/components/layout/topBar/index.js +33 -22
- package/components/loader/index.js +12 -9
- package/components/menu/index.js +35 -26
- package/components/modal/Modal.js +6 -5
- package/components/modal/index.js +13 -10
- package/components/modal/style.js +56 -53
- package/components/optionMenu/index.js +66 -59
- package/components/pagination/index.js +39 -24
- package/components/pagination/style.js +28 -25
- package/components/paginationUpdated/index.js +18 -15
- package/components/paper/index.js +16 -15
- package/components/paper/style.js +27 -24
- package/components/reactSelect/index.js +63 -46
- package/components/reactSelect/style.js +150 -117
- package/components/richTextEditor/index.js +44 -25
- package/components/select/GroupedSelect.js +121 -64
- package/components/select/SimpleSelect.js +78 -50
- package/components/select/index.js +54 -38
- package/components/simpleSelect/index.js +15 -12
- package/components/sort/index.js +22 -19
- package/components/switch/index.js +11 -10
- package/components/switch/style.js +32 -29
- package/components/switch/switch.js +23 -17
- package/components/table/ReactTable.js +71 -54
- package/components/table/SimpleTable.js +78 -59
- package/components/table/index.js +186 -311
- package/components/text/index.js +17 -15
- package/components/timeStamp/index.js +6 -4
- package/components/timeStamp/style.js +15 -12
- package/components/topBar/index.js +92 -85
- package/components/tree/index.js +47 -29
- package/components/tree/style.js +23 -20
- package/components/valuePicker/ValueSelector.js +138 -70
- package/components/valuePicker/index.js +26 -19
- package/components/wrapperLayout/layout/index.js +5 -4
- package/components/wrapperLayout/main/index.js +5 -4
- package/components/wrapperLayout/main/pageContainer/index.js +5 -4
- package/components/wrapperLayout/main/sideBar/index.js +110 -120
- package/components/wrapperLayout/main/sideBar/style.js +183 -177
- package/components/wrapperLayout/topBar/UserAvatar.js +5 -4
- package/components/wrapperLayout/topBar/avatar.js +12 -10
- package/components/wrapperLayout/topBar/index.js +97 -111
- package/components/wrapperLayout/topBar/menuIcon.js +5 -4
- package/components/wrapperLayout/topBar/style.js +64 -61
- package/http/index.js +183 -90
- package/index.js +55 -53
- package/package.json +124 -124
- package/templates/listPage/index.js +57 -36
- package/themes/default.js +7 -5
- package/themes/defaultSmall.js +3 -2
- package/themes/responsiveTheme.js +8 -6
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
@@ -14,16 +15,17 @@ var _material = require("@mui/material");
|
|
|
14
15
|
var _bs = require("react-icons/bs");
|
|
15
16
|
var _iconButton = _interopRequireDefault(require("../iconButton"));
|
|
16
17
|
var _text = _interopRequireDefault(require("../text"));
|
|
17
|
-
function _interopRequireDefault(
|
|
18
|
-
function
|
|
19
|
-
function
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
20
|
+
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; }
|
|
21
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
20
22
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
21
|
-
function _unsupportedIterableToArray(
|
|
22
|
-
function _arrayLikeToArray(
|
|
23
|
-
function _iterableToArrayLimit(
|
|
24
|
-
function _arrayWithHoles(
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
24
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
25
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
26
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
27
|
+
var BrowsingTestCaseLayout = function BrowsingTestCaseLayout(_ref) {
|
|
28
|
+
var collapse = _ref.collapse,
|
|
27
29
|
hasExtraContent = _ref.hasExtraContent,
|
|
28
30
|
children = _ref.children,
|
|
29
31
|
leftHandle = _ref.leftHandle,
|
|
@@ -31,47 +33,47 @@ const BrowsingTestCaseLayout = _ref => {
|
|
|
31
33
|
leftHandelerDetails = _ref.leftHandelerDetails;
|
|
32
34
|
// return <div className="browsing-test-case-layout">{children}</div>;
|
|
33
35
|
// console.log("Browser", children);
|
|
34
|
-
|
|
36
|
+
var _useState = (0, _react.useState)(false),
|
|
35
37
|
_useState2 = _slicedToArray(_useState, 2),
|
|
36
38
|
isHandlerDragging = _useState2[0],
|
|
37
39
|
setIsHandlerDragging = _useState2[1];
|
|
38
|
-
|
|
40
|
+
var _useState3 = (0, _react.useState)(200),
|
|
39
41
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
40
42
|
boxAWidth = _useState4[0],
|
|
41
43
|
setBoxAWidth = _useState4[1];
|
|
42
|
-
|
|
44
|
+
var _useState5 = (0, _react.useState)(true),
|
|
43
45
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
44
46
|
expand = _useState6[0],
|
|
45
47
|
setExpand = _useState6[1];
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
48
|
+
var wrapperRef = (0, _react.useRef)(null);
|
|
49
|
+
var boxARef = (0, _react.useRef)(null);
|
|
50
|
+
var handleMouseDown = function handleMouseDown(e) {
|
|
49
51
|
setIsHandlerDragging(true);
|
|
50
52
|
};
|
|
51
|
-
|
|
53
|
+
var handleMouseMove = function handleMouseMove(e) {
|
|
52
54
|
if (!isHandlerDragging) {
|
|
53
55
|
return false;
|
|
54
56
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
57
|
+
var containerOffsetLeft = wrapperRef.current.offsetLeft;
|
|
58
|
+
var pointerRelativeXpos = e.clientX - containerOffsetLeft;
|
|
59
|
+
var boxAminWidth = 60;
|
|
58
60
|
setBoxAWidth(Math.max(boxAminWidth, pointerRelativeXpos - 8));
|
|
59
61
|
};
|
|
60
|
-
|
|
62
|
+
var handleMouseUp = function handleMouseUp(e) {
|
|
61
63
|
setIsHandlerDragging(false);
|
|
62
64
|
};
|
|
63
|
-
_react.default.useEffect(()
|
|
65
|
+
_react.default.useEffect(function () {
|
|
64
66
|
if (collapse) {
|
|
65
67
|
setExpand(false);
|
|
66
68
|
} else {
|
|
67
69
|
setExpand(true);
|
|
68
70
|
}
|
|
69
71
|
}, [collapse]);
|
|
70
|
-
_react.default.useEffect(()
|
|
72
|
+
_react.default.useEffect(function () {
|
|
71
73
|
if (expand) {
|
|
72
74
|
document.addEventListener("mousemove", handleMouseMove);
|
|
73
75
|
document.addEventListener("mouseup", handleMouseUp);
|
|
74
|
-
return ()
|
|
76
|
+
return function () {
|
|
75
77
|
document.removeEventListener("mousemove", handleMouseMove);
|
|
76
78
|
document.removeEventListener("mouseup", handleMouseUp);
|
|
77
79
|
};
|
|
@@ -121,7 +123,9 @@ const BrowsingTestCaseLayout = _ref => {
|
|
|
121
123
|
height: "20px"
|
|
122
124
|
}
|
|
123
125
|
}),
|
|
124
|
-
onClick: ()
|
|
126
|
+
onClick: function onClick() {
|
|
127
|
+
return setExpand(!expand);
|
|
128
|
+
}
|
|
125
129
|
}), " "), /*#__PURE__*/_react.default.createElement("div", {
|
|
126
130
|
class: "handler",
|
|
127
131
|
onMouseDown: handleMouseDown
|
|
@@ -179,4 +183,5 @@ BrowsingTestCaseLayout.TreeViewContent = _Index.default;
|
|
|
179
183
|
BrowsingTestCaseLayout.TreeViewHeader = _Index2.default;
|
|
180
184
|
BrowsingTestCaseLayout.DetailsViewContent = _DetailsViewContent.default;
|
|
181
185
|
BrowsingTestCaseLayout.DetailsViewHeader = _DetailsViewHeader.default;
|
|
182
|
-
var _default =
|
|
186
|
+
var _default = BrowsingTestCaseLayout;
|
|
187
|
+
exports.default = _default;
|
|
@@ -1,82 +1,82 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
--box-width: 200px;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
body {
|
|
6
|
-
margin: 40px;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.wrapper {
|
|
10
|
-
background-color: #fff;
|
|
11
|
-
color: #444;
|
|
12
|
-
display: flex;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.box {
|
|
16
|
-
background-color: #444;
|
|
17
|
-
color: #fff;
|
|
18
|
-
border-radius: 5px;
|
|
19
|
-
padding: 20px;
|
|
20
|
-
font-size: 12px;
|
|
21
|
-
|
|
22
|
-
box-sizing: border-box;
|
|
23
|
-
|
|
24
|
-
flex: 1 1 auto;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.handler {
|
|
28
|
-
width: 20px;
|
|
29
|
-
padding: 0;
|
|
30
|
-
cursor: ew-resize;
|
|
31
|
-
flex: 0 0 auto;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.handler::before {
|
|
35
|
-
content: "";
|
|
36
|
-
display: block;
|
|
37
|
-
width: 2px;
|
|
38
|
-
height: calc(100vh - 34px);
|
|
39
|
-
background: #c0c0c0;
|
|
40
|
-
margin: 0 auto;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.arrowButton {
|
|
44
|
-
display: flex;
|
|
45
|
-
justify-content: flex-end;
|
|
46
|
-
/* transition: 0.4s; */
|
|
47
|
-
width: 100%;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.verticalText {
|
|
51
|
-
display: flex;
|
|
52
|
-
flex-direction: column;
|
|
53
|
-
justify-content: center;
|
|
54
|
-
writing-mode: vertical-lr;
|
|
55
|
-
text-orientation: mixed;
|
|
56
|
-
transform: rotate(180deg);
|
|
57
|
-
font-size: 1.3rem;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.leftWrapper {
|
|
61
|
-
background-color: #fff;
|
|
62
|
-
color: black;
|
|
63
|
-
border-radius: 5px;
|
|
64
|
-
padding: 0rem 0.5rem;
|
|
65
|
-
font-size: 12px;
|
|
66
|
-
box-sizing: border-box;
|
|
67
|
-
flex: 1 1 auto;
|
|
68
|
-
min-width: var(--box-width);
|
|
69
|
-
flex-grow: 0;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.rightWrapper {
|
|
73
|
-
background-color: #fff;
|
|
74
|
-
color: black;
|
|
75
|
-
border-radius: 5px;
|
|
76
|
-
padding: 0rem 0.5rem;
|
|
77
|
-
font-size: 12px;
|
|
78
|
-
box-sizing: border-box;
|
|
79
|
-
flex: 1 1 auto;
|
|
80
|
-
min-width: var(--box-width);
|
|
81
|
-
flex-grow: 1;
|
|
82
|
-
}
|
|
1
|
+
:root {
|
|
2
|
+
--box-width: 200px;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
body {
|
|
6
|
+
margin: 40px;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.wrapper {
|
|
10
|
+
background-color: #fff;
|
|
11
|
+
color: #444;
|
|
12
|
+
display: flex;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.box {
|
|
16
|
+
background-color: #444;
|
|
17
|
+
color: #fff;
|
|
18
|
+
border-radius: 5px;
|
|
19
|
+
padding: 20px;
|
|
20
|
+
font-size: 12px;
|
|
21
|
+
|
|
22
|
+
box-sizing: border-box;
|
|
23
|
+
|
|
24
|
+
flex: 1 1 auto;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.handler {
|
|
28
|
+
width: 20px;
|
|
29
|
+
padding: 0;
|
|
30
|
+
cursor: ew-resize;
|
|
31
|
+
flex: 0 0 auto;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.handler::before {
|
|
35
|
+
content: "";
|
|
36
|
+
display: block;
|
|
37
|
+
width: 2px;
|
|
38
|
+
height: calc(100vh - 34px);
|
|
39
|
+
background: #c0c0c0;
|
|
40
|
+
margin: 0 auto;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.arrowButton {
|
|
44
|
+
display: flex;
|
|
45
|
+
justify-content: flex-end;
|
|
46
|
+
/* transition: 0.4s; */
|
|
47
|
+
width: 100%;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.verticalText {
|
|
51
|
+
display: flex;
|
|
52
|
+
flex-direction: column;
|
|
53
|
+
justify-content: center;
|
|
54
|
+
writing-mode: vertical-lr;
|
|
55
|
+
text-orientation: mixed;
|
|
56
|
+
transform: rotate(180deg);
|
|
57
|
+
font-size: 1.3rem;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.leftWrapper {
|
|
61
|
+
background-color: #fff;
|
|
62
|
+
color: black;
|
|
63
|
+
border-radius: 5px;
|
|
64
|
+
padding: 0rem 0.5rem;
|
|
65
|
+
font-size: 12px;
|
|
66
|
+
box-sizing: border-box;
|
|
67
|
+
flex: 1 1 auto;
|
|
68
|
+
min-width: var(--box-width);
|
|
69
|
+
flex-grow: 0;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.rightWrapper {
|
|
73
|
+
background-color: #fff;
|
|
74
|
+
color: black;
|
|
75
|
+
border-radius: 5px;
|
|
76
|
+
padding: 0rem 0.5rem;
|
|
77
|
+
font-size: 12px;
|
|
78
|
+
box-sizing: border-box;
|
|
79
|
+
flex: 1 1 auto;
|
|
80
|
+
min-width: var(--box-width);
|
|
81
|
+
flex-grow: 1;
|
|
82
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
@@ -10,20 +11,21 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
10
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
12
|
var _Menu = _interopRequireDefault(require("@mui/material/Menu"));
|
|
12
13
|
var _MenuItem = _interopRequireDefault(require("@mui/material/MenuItem"));
|
|
13
|
-
|
|
14
|
-
function
|
|
15
|
-
function
|
|
16
|
-
function
|
|
17
|
-
function
|
|
14
|
+
var _excluded = ["loading"];
|
|
15
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
16
|
+
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; }
|
|
17
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
|
+
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); }
|
|
19
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
18
20
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
19
|
-
function _unsupportedIterableToArray(
|
|
20
|
-
function _arrayLikeToArray(
|
|
21
|
-
function _iterableToArrayLimit(
|
|
22
|
-
function _arrayWithHoles(
|
|
23
|
-
function _objectWithoutProperties(
|
|
24
|
-
function _objectWithoutPropertiesLoose(
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
22
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
23
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
24
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
25
|
+
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; }
|
|
26
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
27
|
+
var Button = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
28
|
+
var loading = props.loading,
|
|
27
29
|
loadingText = props.loadingText,
|
|
28
30
|
children = props.children,
|
|
29
31
|
size = props.size,
|
|
@@ -31,29 +33,29 @@ const Button = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
31
33
|
color = props.color,
|
|
32
34
|
fixedWidth = props.fixedWidth,
|
|
33
35
|
type = props.type;
|
|
34
|
-
|
|
36
|
+
var _ = props.loading,
|
|
35
37
|
propsSansLoading = _objectWithoutProperties(props, _excluded);
|
|
36
|
-
|
|
38
|
+
var handleClick = function handleClick(e) {
|
|
37
39
|
if (loading) {
|
|
38
40
|
e.preventDefault();
|
|
39
41
|
} else {
|
|
40
42
|
onClick && onClick(e);
|
|
41
43
|
}
|
|
42
44
|
};
|
|
43
|
-
|
|
45
|
+
var menuItems = props.menuItems,
|
|
44
46
|
setSelectedMenu = props.setSelectedMenu;
|
|
45
|
-
|
|
47
|
+
var _React$useState = _react.default.useState(null),
|
|
46
48
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
47
49
|
anchorEl = _React$useState2[0],
|
|
48
50
|
setAnchorEl = _React$useState2[1];
|
|
49
|
-
|
|
50
|
-
|
|
51
|
+
var open = Boolean(anchorEl);
|
|
52
|
+
var handleMenuClick = function handleMenuClick(event) {
|
|
51
53
|
setAnchorEl(event.currentTarget);
|
|
52
54
|
};
|
|
53
|
-
|
|
55
|
+
var handleClose = function handleClose(e) {
|
|
54
56
|
setAnchorEl(null);
|
|
55
57
|
};
|
|
56
|
-
|
|
58
|
+
var handleMenuItemClick = function handleMenuItemClick(value) {
|
|
57
59
|
setSelectedMenu(value);
|
|
58
60
|
handleClose();
|
|
59
61
|
};
|
|
@@ -75,20 +77,24 @@ const Button = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
75
77
|
id: "basic-menu",
|
|
76
78
|
anchorEl: anchorEl,
|
|
77
79
|
open: open,
|
|
78
|
-
onClose:
|
|
80
|
+
onClose: function onClose(e) {
|
|
81
|
+
return handleClose(e);
|
|
82
|
+
},
|
|
79
83
|
MenuListProps: {
|
|
80
84
|
"aria-labelledby": "basic-button"
|
|
81
85
|
},
|
|
82
86
|
sx: {
|
|
83
87
|
mt: "0.7rem"
|
|
84
88
|
}
|
|
85
|
-
}, menuItems && (menuItems === null || menuItems === void 0 ? void 0 : menuItems.map((item, key)
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
}, menuItems && (menuItems === null || menuItems === void 0 ? void 0 : menuItems.map(function (item, key) {
|
|
90
|
+
return /*#__PURE__*/_react.default.createElement(_MenuItem.default, {
|
|
91
|
+
onClick: function onClick(e) {
|
|
92
|
+
handleClose(e);
|
|
93
|
+
handleMenuItemClick(item);
|
|
94
|
+
},
|
|
95
|
+
key: item.item
|
|
96
|
+
}, item.item);
|
|
97
|
+
})))) : /*#__PURE__*/_react.default.createElement(_material.Button, _extends({
|
|
92
98
|
ref: ref,
|
|
93
99
|
onClick: handleClick
|
|
94
100
|
}, props, {
|
|
@@ -100,16 +106,16 @@ const Button = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
100
106
|
size: size,
|
|
101
107
|
loadingText: loadingText
|
|
102
108
|
}), loadingText && {
|
|
103
|
-
loadingText
|
|
109
|
+
loadingText: loadingText
|
|
104
110
|
}) : children));
|
|
105
111
|
});
|
|
106
|
-
|
|
107
|
-
|
|
112
|
+
var ButtonLoader = function ButtonLoader(_ref) {
|
|
113
|
+
var buttonColor = _ref.buttonColor,
|
|
108
114
|
size = _ref.size,
|
|
109
115
|
loadingText = _ref.loadingText;
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
116
|
+
var theme = (0, _styles.useTheme)();
|
|
117
|
+
var resolvedButtonColor = theme.palette[buttonColor] ? theme.palette[buttonColor].main : theme.palette.primary.main;
|
|
118
|
+
var textColor = theme.palette.getContrastText(resolvedButtonColor);
|
|
113
119
|
return /*#__PURE__*/_react.default.createElement(_material.CircularProgress, {
|
|
114
120
|
size: size === "small" ? 20 : size === "large" ? 24 : 22,
|
|
115
121
|
sx: {
|
|
@@ -130,4 +136,5 @@ Button.propTypes = {
|
|
|
130
136
|
onClick: _propTypes.default.func,
|
|
131
137
|
color: _propTypes.default.string
|
|
132
138
|
};
|
|
133
|
-
var _default =
|
|
139
|
+
var _default = Button;
|
|
140
|
+
exports.default = _default;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
@@ -12,33 +13,34 @@ var _fa = require("react-icons/fa");
|
|
|
12
13
|
var _fi = require("react-icons/fi");
|
|
13
14
|
var _input = _interopRequireDefault(require("../input"));
|
|
14
15
|
var _text = _interopRequireDefault(require("../text"));
|
|
15
|
-
function _interopRequireDefault(
|
|
16
|
-
function
|
|
17
|
-
function
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
18
|
+
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; }
|
|
19
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
18
20
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
19
|
-
function _unsupportedIterableToArray(
|
|
20
|
-
function _arrayLikeToArray(
|
|
21
|
-
function _iterableToArrayLimit(
|
|
22
|
-
function _arrayWithHoles(
|
|
23
|
-
|
|
21
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
22
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
23
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
24
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
25
|
+
var ChatBotModal = function ChatBotModal(_ref) {
|
|
24
26
|
var _theme$breakpoints;
|
|
25
|
-
|
|
27
|
+
var open = _ref.open,
|
|
26
28
|
onClose = _ref.onClose,
|
|
27
29
|
messages = _ref.messages,
|
|
28
30
|
inputValue = _ref.inputValue,
|
|
29
31
|
setInputValue = _ref.setInputValue,
|
|
30
32
|
handleSend = _ref.handleSend,
|
|
31
33
|
loading = _ref.loading;
|
|
32
|
-
|
|
34
|
+
var _useState = (0, _react.useState)(false),
|
|
33
35
|
_useState2 = _slicedToArray(_useState, 2),
|
|
34
36
|
isFullscreen = _useState2[0],
|
|
35
37
|
setIsFullscreen = _useState2[1];
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
(0, _react.useEffect)(()
|
|
38
|
+
var messagesEndRef = (0, _react.useRef)(null);
|
|
39
|
+
var theme = (0, _material.useTheme)();
|
|
40
|
+
var isNotExpanded = (0, _material.useMediaQuery)(theme === null || theme === void 0 ? void 0 : (_theme$breakpoints = theme.breakpoints) === null || _theme$breakpoints === void 0 ? void 0 : _theme$breakpoints.down("sm"));
|
|
41
|
+
(0, _react.useEffect)(function () {
|
|
40
42
|
var _messagesEndRef$curre;
|
|
41
|
-
messagesEndRef === null || messagesEndRef === void 0
|
|
43
|
+
messagesEndRef === null || messagesEndRef === void 0 ? void 0 : (_messagesEndRef$curre = messagesEndRef.current) === null || _messagesEndRef$curre === void 0 ? void 0 : _messagesEndRef$curre.scrollIntoView({
|
|
42
44
|
behavior: "smooth"
|
|
43
45
|
});
|
|
44
46
|
}, [messages]);
|
|
@@ -102,7 +104,11 @@ const ChatBotModal = _ref => {
|
|
|
102
104
|
variant: "h6",
|
|
103
105
|
semibold: true
|
|
104
106
|
}, "Chat with Tenjin"), /*#__PURE__*/_react.default.createElement(_material.Box, null, /*#__PURE__*/_react.default.createElement(_material.IconButton, {
|
|
105
|
-
onClick: ()
|
|
107
|
+
onClick: function onClick() {
|
|
108
|
+
return setIsFullscreen(function (prev) {
|
|
109
|
+
return !prev;
|
|
110
|
+
});
|
|
111
|
+
},
|
|
106
112
|
size: "small"
|
|
107
113
|
}, isFullscreen ? /*#__PURE__*/_react.default.createElement(_fi.FiMinimize, null) : /*#__PURE__*/_react.default.createElement(_fa.FaExpand, null)), /*#__PURE__*/_react.default.createElement(_material.IconButton, {
|
|
108
114
|
onClick: onClose,
|
|
@@ -120,22 +126,24 @@ const ChatBotModal = _ref => {
|
|
|
120
126
|
position: "relative",
|
|
121
127
|
zIndex: 1
|
|
122
128
|
}
|
|
123
|
-
}, messages === null || messages === void 0 ? void 0 : messages.map((msg, idx)
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
129
|
+
}, messages === null || messages === void 0 ? void 0 : messages.map(function (msg, idx) {
|
|
130
|
+
return /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
131
|
+
key: idx,
|
|
132
|
+
sx: {
|
|
133
|
+
alignSelf: msg.sender === "user" ? "flex-end" : "flex-start",
|
|
134
|
+
backgroundColor: "#f5f5f5",
|
|
135
|
+
color: "#000",
|
|
136
|
+
px: 2,
|
|
137
|
+
py: 1,
|
|
138
|
+
borderRadius: 2,
|
|
139
|
+
boxShadow: 1,
|
|
140
|
+
maxWidth: "80%",
|
|
141
|
+
fontSize: "0.9rem",
|
|
142
|
+
wordBreak: "break-word",
|
|
143
|
+
whiteSpace: "pre-wrap"
|
|
144
|
+
}
|
|
145
|
+
}, msg.text);
|
|
146
|
+
}), loading && /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
139
147
|
sx: {
|
|
140
148
|
alignSelf: "flex-start",
|
|
141
149
|
backgroundColor: "#f5f5f5",
|
|
@@ -167,11 +175,11 @@ const ChatBotModal = _ref => {
|
|
|
167
175
|
fullWidth: true,
|
|
168
176
|
placeholder: "Type your message...",
|
|
169
177
|
value: inputValue,
|
|
170
|
-
onChange: e
|
|
178
|
+
onChange: function onChange(e) {
|
|
171
179
|
var _e$target;
|
|
172
|
-
return setInputValue(e === null || e === void 0
|
|
180
|
+
return setInputValue(e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value);
|
|
173
181
|
},
|
|
174
|
-
onKeyDown: e
|
|
182
|
+
onKeyDown: function onKeyDown(e) {
|
|
175
183
|
if ((e === null || e === void 0 ? void 0 : e.key) === "Enter") handleSend();
|
|
176
184
|
},
|
|
177
185
|
sx: {
|
|
@@ -188,4 +196,5 @@ const ChatBotModal = _ref => {
|
|
|
188
196
|
disabled: !(inputValue !== null && inputValue !== void 0 && inputValue.trim())
|
|
189
197
|
}, /*#__PURE__*/_react.default.createElement(_Send.default, null))))));
|
|
190
198
|
};
|
|
191
|
-
var _default =
|
|
199
|
+
var _default = ChatBotModal;
|
|
200
|
+
exports.default = _default;
|
|
@@ -7,13 +7,13 @@ exports.default = void 0;
|
|
|
7
7
|
var _material = require("@mui/material");
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _text = _interopRequireDefault(require("../text"));
|
|
10
|
-
|
|
11
|
-
function _interopRequireDefault(
|
|
12
|
-
function _extends() {
|
|
13
|
-
function _objectWithoutProperties(
|
|
14
|
-
function _objectWithoutPropertiesLoose(
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
var _excluded = ["label"];
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
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); }
|
|
13
|
+
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; }
|
|
14
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
15
|
+
var CheckBox = function CheckBox(props) {
|
|
16
|
+
var label = props.label,
|
|
17
17
|
rest = _objectWithoutProperties(props, _excluded);
|
|
18
18
|
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_material.FormControlLabel, _extends({
|
|
19
19
|
control: /*#__PURE__*/_react.default.createElement(_material.Checkbox, rest),
|
|
@@ -26,4 +26,5 @@ CheckBox.defaultProps = {
|
|
|
26
26
|
defaultChecked: true,
|
|
27
27
|
labelPlacement: "right"
|
|
28
28
|
};
|
|
29
|
-
var _default =
|
|
29
|
+
var _default = CheckBox;
|
|
30
|
+
exports.default = _default;
|