tenjin-ui-kit 0.3.73 → 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 +199 -91
- package/common/hooks/newApiHook.js +258 -127
- package/common/utils/security/index.js +2 -2
- package/common/utils/security/securityConfig.js +2 -1
- package/components/Canvas.js +101 -172
- package/components/DragBox/index.js +31 -21
- package/components/InputWithChip/index.js +83 -178
- package/components/RightContext/index.css +20 -20
- package/components/RightContext/index.js +41 -17
- package/components/WorkFlow.js +29 -19
- package/components/WorkFlowBuilder.js +56 -32
- package/components/alert/Style.js +14 -11
- package/components/alert/index.js +14 -8
- package/components/attachment/index.js +31 -26
- package/components/authenticationProvider/AuthError.js +4 -3
- package/components/authenticationProvider/AuthLoader.js +4 -3
- package/components/authenticationProvider/index.js +130 -58
- package/components/avatar/index.js +23 -24
- package/components/avatar/styles.js +77 -76
- package/components/breadCrumbs/index.js +89 -64
- package/components/breadCrumbs/style.js +4 -1
- package/components/browsingTestCaseLayout/DetailsViewLayout/DetailsViewContent/index.js +6 -7
- package/components/browsingTestCaseLayout/DetailsViewLayout/DetailsViewContent/style.js +8 -5
- package/components/browsingTestCaseLayout/DetailsViewLayout/DetailsViewHeader/index.js +6 -7
- package/components/browsingTestCaseLayout/TreeViewLayout/TreeViewContent/Index.js +7 -8
- package/components/browsingTestCaseLayout/TreeViewLayout/TreeViewHeader/Index.js +7 -8
- package/components/browsingTestCaseLayout/TreeViewLayout/TreeViewHeader/style.js +19 -16
- package/components/browsingTestCaseLayout/index.js +46 -30
- package/components/browsingTestCaseLayout/style.css +82 -82
- package/components/button/index.js +58 -47
- package/components/chatBotModal/index.js +61 -40
- package/components/checkBox/index.js +10 -8
- package/components/combobox/index.js +216 -182
- package/components/divider/index.js +18 -9
- package/components/editableField/index.js +46 -19
- package/components/error/index.js +12 -6
- package/components/errorBoundary/index.js +98 -74
- package/components/fileUploader/index.js +58 -46
- package/components/fileUploader/style.js +49 -46
- package/components/filter/ValueSelector.js +243 -148
- package/components/filter/index.js +66 -43
- package/components/iconButton/index.js +4 -3
- package/components/input/index.js +74 -60
- package/components/layout/index.js +49 -36
- package/components/layout/main/index.js +14 -13
- package/components/layout/main/style.js +14 -11
- package/components/layout/pageContent/index.js +7 -8
- package/components/layout/sidebar/FlatMenu.js +47 -51
- package/components/layout/sidebar/GroupedIconMenu.js +194 -169
- package/components/layout/sidebar/GroupedMenu.js +50 -45
- package/components/layout/sidebar/ProjectMenu.js +185 -165
- package/components/layout/sidebar/index.js +26 -27
- package/components/layout/sidebar/style.js +143 -138
- package/components/layout/topBar/ProjectTopbar.js +119 -86
- package/components/layout/topBar/UserAvatar.js +65 -51
- package/components/layout/topBar/index.js +41 -23
- package/components/loader/index.js +12 -9
- package/components/menu/index.js +42 -23
- package/components/modal/Modal.js +6 -5
- package/components/modal/index.js +20 -16
- package/components/modal/style.js +56 -53
- package/components/optionMenu/index.js +72 -57
- package/components/pagination/index.js +43 -23
- package/components/pagination/style.js +28 -25
- package/components/paginationUpdated/index.js +26 -19
- package/components/paper/index.js +22 -20
- package/components/paper/style.js +27 -24
- package/components/reactSelect/index.js +97 -64
- package/components/reactSelect/style.js +151 -131
- package/components/richTextEditor/index.js +48 -24
- package/components/select/GroupedSelect.js +100 -56
- package/components/select/SimpleSelect.js +99 -59
- package/components/select/index.js +69 -56
- package/components/simpleSelect/index.js +22 -18
- package/components/sort/index.js +36 -23
- package/components/switch/index.js +15 -14
- package/components/switch/style.js +32 -29
- package/components/switch/switch.js +47 -30
- package/components/table/ReactTable.js +83 -59
- package/components/table/SimpleTable.js +91 -67
- package/components/table/index.js +206 -300
- package/components/text/index.js +30 -22
- package/components/timeStamp/index.js +6 -4
- package/components/timeStamp/style.js +15 -12
- package/components/topBar/index.js +102 -86
- package/components/tree/index.js +58 -30
- package/components/tree/style.js +23 -20
- package/components/valuePicker/ValueSelector.js +160 -78
- package/components/valuePicker/index.js +50 -30
- package/components/wrapperLayout/layout/index.js +7 -8
- package/components/wrapperLayout/main/index.js +7 -8
- package/components/wrapperLayout/main/pageContainer/index.js +5 -6
- package/components/wrapperLayout/main/sideBar/index.js +175 -171
- package/components/wrapperLayout/main/sideBar/style.js +183 -177
- package/components/wrapperLayout/topBar/UserAvatar.js +5 -6
- package/components/wrapperLayout/topBar/avatar.js +18 -15
- package/components/wrapperLayout/topBar/index.js +107 -115
- package/components/wrapperLayout/topBar/menuIcon.js +5 -6
- package/components/wrapperLayout/topBar/style.js +64 -63
- package/http/index.js +188 -92
- package/index.js +55 -53
- package/package.json +124 -125
- package/templates/listPage/index.js +196 -168
- 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,53 +15,65 @@ 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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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(); }
|
|
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."); }
|
|
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,
|
|
29
|
+
hasExtraContent = _ref.hasExtraContent,
|
|
30
|
+
children = _ref.children,
|
|
31
|
+
leftHandle = _ref.leftHandle,
|
|
32
|
+
onlyRightHandle = _ref.onlyRightHandle,
|
|
33
|
+
leftHandelerDetails = _ref.leftHandelerDetails;
|
|
30
34
|
// return <div className="browsing-test-case-layout">{children}</div>;
|
|
31
35
|
// console.log("Browser", children);
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
var _useState = (0, _react.useState)(false),
|
|
37
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
38
|
+
isHandlerDragging = _useState2[0],
|
|
39
|
+
setIsHandlerDragging = _useState2[1];
|
|
40
|
+
var _useState3 = (0, _react.useState)(200),
|
|
41
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
42
|
+
boxAWidth = _useState4[0],
|
|
43
|
+
setBoxAWidth = _useState4[1];
|
|
44
|
+
var _useState5 = (0, _react.useState)(true),
|
|
45
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
46
|
+
expand = _useState6[0],
|
|
47
|
+
setExpand = _useState6[1];
|
|
48
|
+
var wrapperRef = (0, _react.useRef)(null);
|
|
49
|
+
var boxARef = (0, _react.useRef)(null);
|
|
50
|
+
var handleMouseDown = function handleMouseDown(e) {
|
|
38
51
|
setIsHandlerDragging(true);
|
|
39
52
|
};
|
|
40
|
-
|
|
53
|
+
var handleMouseMove = function handleMouseMove(e) {
|
|
41
54
|
if (!isHandlerDragging) {
|
|
42
55
|
return false;
|
|
43
56
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
57
|
+
var containerOffsetLeft = wrapperRef.current.offsetLeft;
|
|
58
|
+
var pointerRelativeXpos = e.clientX - containerOffsetLeft;
|
|
59
|
+
var boxAminWidth = 60;
|
|
47
60
|
setBoxAWidth(Math.max(boxAminWidth, pointerRelativeXpos - 8));
|
|
48
61
|
};
|
|
49
|
-
|
|
62
|
+
var handleMouseUp = function handleMouseUp(e) {
|
|
50
63
|
setIsHandlerDragging(false);
|
|
51
64
|
};
|
|
52
|
-
_react.default.useEffect(()
|
|
65
|
+
_react.default.useEffect(function () {
|
|
53
66
|
if (collapse) {
|
|
54
67
|
setExpand(false);
|
|
55
68
|
} else {
|
|
56
69
|
setExpand(true);
|
|
57
70
|
}
|
|
58
71
|
}, [collapse]);
|
|
59
|
-
_react.default.useEffect(()
|
|
72
|
+
_react.default.useEffect(function () {
|
|
60
73
|
if (expand) {
|
|
61
74
|
document.addEventListener("mousemove", handleMouseMove);
|
|
62
75
|
document.addEventListener("mouseup", handleMouseUp);
|
|
63
|
-
return ()
|
|
76
|
+
return function () {
|
|
64
77
|
document.removeEventListener("mousemove", handleMouseMove);
|
|
65
78
|
document.removeEventListener("mouseup", handleMouseUp);
|
|
66
79
|
};
|
|
@@ -68,7 +81,7 @@ const BrowsingTestCaseLayout = _ref => {
|
|
|
68
81
|
setBoxAWidth(50);
|
|
69
82
|
}
|
|
70
83
|
}, [isHandlerDragging, expand]);
|
|
71
|
-
document.documentElement.style.setProperty("--box-width",
|
|
84
|
+
document.documentElement.style.setProperty("--box-width", "".concat(boxAWidth, "px"));
|
|
72
85
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
73
86
|
class: "wrapper",
|
|
74
87
|
ref: wrapperRef
|
|
@@ -110,7 +123,9 @@ const BrowsingTestCaseLayout = _ref => {
|
|
|
110
123
|
height: "20px"
|
|
111
124
|
}
|
|
112
125
|
}),
|
|
113
|
-
onClick: ()
|
|
126
|
+
onClick: function onClick() {
|
|
127
|
+
return setExpand(!expand);
|
|
128
|
+
}
|
|
114
129
|
}), " "), /*#__PURE__*/_react.default.createElement("div", {
|
|
115
130
|
class: "handler",
|
|
116
131
|
onMouseDown: handleMouseDown
|
|
@@ -168,4 +183,5 @@ BrowsingTestCaseLayout.TreeViewContent = _Index.default;
|
|
|
168
183
|
BrowsingTestCaseLayout.TreeViewHeader = _Index2.default;
|
|
169
184
|
BrowsingTestCaseLayout.DetailsViewContent = _DetailsViewContent.default;
|
|
170
185
|
BrowsingTestCaseLayout.DetailsViewHeader = _DetailsViewHeader.default;
|
|
171
|
-
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,44 +11,51 @@ 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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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(); }
|
|
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."); }
|
|
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,
|
|
29
|
+
loadingText = props.loadingText,
|
|
30
|
+
children = props.children,
|
|
31
|
+
size = props.size,
|
|
32
|
+
onClick = props.onClick,
|
|
33
|
+
color = props.color,
|
|
34
|
+
fixedWidth = props.fixedWidth,
|
|
35
|
+
type = props.type;
|
|
36
|
+
var _ = props.loading,
|
|
37
|
+
propsSansLoading = _objectWithoutProperties(props, _excluded);
|
|
38
|
+
var handleClick = function handleClick(e) {
|
|
32
39
|
if (loading) {
|
|
33
40
|
e.preventDefault();
|
|
34
41
|
} else {
|
|
35
42
|
onClick && onClick(e);
|
|
36
43
|
}
|
|
37
44
|
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
+
var menuItems = props.menuItems,
|
|
46
|
+
setSelectedMenu = props.setSelectedMenu;
|
|
47
|
+
var _React$useState = _react.default.useState(null),
|
|
48
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
49
|
+
anchorEl = _React$useState2[0],
|
|
50
|
+
setAnchorEl = _React$useState2[1];
|
|
51
|
+
var open = Boolean(anchorEl);
|
|
52
|
+
var handleMenuClick = function handleMenuClick(event) {
|
|
45
53
|
setAnchorEl(event.currentTarget);
|
|
46
54
|
};
|
|
47
|
-
|
|
55
|
+
var handleClose = function handleClose(e) {
|
|
48
56
|
setAnchorEl(null);
|
|
49
57
|
};
|
|
50
|
-
|
|
58
|
+
var handleMenuItemClick = function handleMenuItemClick(value) {
|
|
51
59
|
setSelectedMenu(value);
|
|
52
60
|
handleClose();
|
|
53
61
|
};
|
|
@@ -69,20 +77,24 @@ const Button = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
69
77
|
id: "basic-menu",
|
|
70
78
|
anchorEl: anchorEl,
|
|
71
79
|
open: open,
|
|
72
|
-
onClose:
|
|
80
|
+
onClose: function onClose(e) {
|
|
81
|
+
return handleClose(e);
|
|
82
|
+
},
|
|
73
83
|
MenuListProps: {
|
|
74
84
|
"aria-labelledby": "basic-button"
|
|
75
85
|
},
|
|
76
86
|
sx: {
|
|
77
87
|
mt: "0.7rem"
|
|
78
88
|
}
|
|
79
|
-
}, menuItems && menuItems
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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({
|
|
86
98
|
ref: ref,
|
|
87
99
|
onClick: handleClick
|
|
88
100
|
}, props, {
|
|
@@ -94,18 +106,16 @@ const Button = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
94
106
|
size: size,
|
|
95
107
|
loadingText: loadingText
|
|
96
108
|
}), loadingText && {
|
|
97
|
-
loadingText
|
|
109
|
+
loadingText: loadingText
|
|
98
110
|
}) : children));
|
|
99
111
|
});
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
const resolvedButtonColor = theme.palette[buttonColor] ? theme.palette[buttonColor].main : theme.palette.primary.main;
|
|
108
|
-
const textColor = theme.palette.getContrastText(resolvedButtonColor);
|
|
112
|
+
var ButtonLoader = function ButtonLoader(_ref) {
|
|
113
|
+
var buttonColor = _ref.buttonColor,
|
|
114
|
+
size = _ref.size,
|
|
115
|
+
loadingText = _ref.loadingText;
|
|
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);
|
|
109
119
|
return /*#__PURE__*/_react.default.createElement(_material.CircularProgress, {
|
|
110
120
|
size: size === "small" ? 20 : size === "large" ? 24 : 22,
|
|
111
121
|
sx: {
|
|
@@ -126,4 +136,5 @@ Button.propTypes = {
|
|
|
126
136
|
onClick: _propTypes.default.func,
|
|
127
137
|
color: _propTypes.default.string
|
|
128
138
|
};
|
|
129
|
-
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,24 +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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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(); }
|
|
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."); }
|
|
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) {
|
|
26
|
+
var _theme$breakpoints;
|
|
27
|
+
var open = _ref.open,
|
|
28
|
+
onClose = _ref.onClose,
|
|
29
|
+
messages = _ref.messages,
|
|
30
|
+
inputValue = _ref.inputValue,
|
|
31
|
+
setInputValue = _ref.setInputValue,
|
|
32
|
+
handleSend = _ref.handleSend,
|
|
33
|
+
loading = _ref.loading;
|
|
34
|
+
var _useState = (0, _react.useState)(false),
|
|
35
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
36
|
+
isFullscreen = _useState2[0],
|
|
37
|
+
setIsFullscreen = _useState2[1];
|
|
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 () {
|
|
42
|
+
var _messagesEndRef$curre;
|
|
43
|
+
messagesEndRef === null || messagesEndRef === void 0 ? void 0 : (_messagesEndRef$curre = messagesEndRef.current) === null || _messagesEndRef$curre === void 0 ? void 0 : _messagesEndRef$curre.scrollIntoView({
|
|
33
44
|
behavior: "smooth"
|
|
34
45
|
});
|
|
35
46
|
}, [messages]);
|
|
@@ -93,7 +104,11 @@ const ChatBotModal = _ref => {
|
|
|
93
104
|
variant: "h6",
|
|
94
105
|
semibold: true
|
|
95
106
|
}, "Chat with Tenjin"), /*#__PURE__*/_react.default.createElement(_material.Box, null, /*#__PURE__*/_react.default.createElement(_material.IconButton, {
|
|
96
|
-
onClick: ()
|
|
107
|
+
onClick: function onClick() {
|
|
108
|
+
return setIsFullscreen(function (prev) {
|
|
109
|
+
return !prev;
|
|
110
|
+
});
|
|
111
|
+
},
|
|
97
112
|
size: "small"
|
|
98
113
|
}, isFullscreen ? /*#__PURE__*/_react.default.createElement(_fi.FiMinimize, null) : /*#__PURE__*/_react.default.createElement(_fa.FaExpand, null)), /*#__PURE__*/_react.default.createElement(_material.IconButton, {
|
|
99
114
|
onClick: onClose,
|
|
@@ -111,22 +126,24 @@ const ChatBotModal = _ref => {
|
|
|
111
126
|
position: "relative",
|
|
112
127
|
zIndex: 1
|
|
113
128
|
}
|
|
114
|
-
}, messages
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
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, {
|
|
130
147
|
sx: {
|
|
131
148
|
alignSelf: "flex-start",
|
|
132
149
|
backgroundColor: "#f5f5f5",
|
|
@@ -158,9 +175,12 @@ const ChatBotModal = _ref => {
|
|
|
158
175
|
fullWidth: true,
|
|
159
176
|
placeholder: "Type your message...",
|
|
160
177
|
value: inputValue,
|
|
161
|
-
onChange:
|
|
162
|
-
|
|
163
|
-
|
|
178
|
+
onChange: function onChange(e) {
|
|
179
|
+
var _e$target;
|
|
180
|
+
return setInputValue(e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value);
|
|
181
|
+
},
|
|
182
|
+
onKeyDown: function onKeyDown(e) {
|
|
183
|
+
if ((e === null || e === void 0 ? void 0 : e.key) === "Enter") handleSend();
|
|
164
184
|
},
|
|
165
185
|
sx: {
|
|
166
186
|
fontSize: "0.9rem",
|
|
@@ -173,7 +193,8 @@ const ChatBotModal = _ref => {
|
|
|
173
193
|
ml: 1
|
|
174
194
|
},
|
|
175
195
|
color: "primary",
|
|
176
|
-
disabled: !inputValue
|
|
196
|
+
disabled: !(inputValue !== null && inputValue !== void 0 && inputValue.trim())
|
|
177
197
|
}, /*#__PURE__*/_react.default.createElement(_Send.default, null))))));
|
|
178
198
|
};
|
|
179
|
-
var _default =
|
|
199
|
+
var _default = ChatBotModal;
|
|
200
|
+
exports.default = _default;
|
|
@@ -7,13 +7,14 @@ 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
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
17
18
|
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_material.FormControlLabel, _extends({
|
|
18
19
|
control: /*#__PURE__*/_react.default.createElement(_material.Checkbox, rest),
|
|
19
20
|
label: /*#__PURE__*/_react.default.createElement(_text.default, null, label)
|
|
@@ -25,4 +26,5 @@ CheckBox.defaultProps = {
|
|
|
25
26
|
defaultChecked: true,
|
|
26
27
|
labelPlacement: "right"
|
|
27
28
|
};
|
|
28
|
-
var _default =
|
|
29
|
+
var _default = CheckBox;
|
|
30
|
+
exports.default = _default;
|