tenjin-ui-kit 0.3.67 → 0.3.69
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/.dockerignore +6 -0
- package/.storybook/main.js +16 -0
- package/.storybook/preview.js +11 -0
- package/Dockerfile +17 -0
- package/Jenkinsfile +66 -0
- package/build/asset-manifest.json +16 -0
- package/build/favicon.ico +0 -0
- package/build/index.html +1 -0
- package/build/logo192.png +0 -0
- package/build/logo512.png +0 -0
- package/build/manifest.json +25 -0
- package/build/robots.txt +3 -0
- package/build/static/css/main.e7366529.css +2 -0
- package/build/static/css/main.e7366529.css.map +1 -0
- package/build/static/js/453.900c81c3.chunk.js +2 -0
- package/build/static/js/453.900c81c3.chunk.js.map +1 -0
- package/build/static/js/main.8abb72fa.js +3 -0
- package/build/static/js/main.8abb72fa.js.LICENSE.txt +61 -0
- package/build/static/js/main.8abb72fa.js.map +1 -0
- package/build/static/media/logo.6ce24c58023cc2f8fd88fe9d219db6c6.svg +1 -0
- package/build/tenjinLogo.png +0 -0
- package/dist/README.md +13 -0
- package/dist/common/hooks/apiHooks.js +155 -0
- package/dist/common/hooks/newApiHook.js +188 -0
- package/{common → dist/common}/utils/security/index.js +2 -2
- package/{common → dist/common}/utils/security/securityConfig.js +1 -2
- package/dist/components/Canvas.js +330 -0
- package/dist/components/DragBox/index.js +40 -0
- package/dist/components/InputWithChip/index.js +294 -0
- package/{components → dist/components}/RightContext/index.js +19 -28
- package/dist/components/WorkFlow.js +42 -0
- package/dist/components/WorkFlowBuilder.js +115 -0
- package/dist/components/alert/Style.js +20 -0
- package/dist/components/alert/index.js +67 -0
- package/{components → dist/components}/attachment/index.js +21 -28
- package/{components → dist/components}/authenticationProvider/AuthError.js +3 -4
- package/{components → dist/components}/authenticationProvider/AuthLoader.js +3 -4
- package/dist/components/authenticationProvider/index.js +110 -0
- package/{components → dist/components}/avatar/index.js +13 -14
- package/dist/components/avatar/styles.js +91 -0
- package/dist/components/breadCrumbs/index.js +169 -0
- package/{components → dist/components}/breadCrumbs/style.js +1 -4
- package/{components → dist/components}/browsingTestCaseLayout/DetailsViewLayout/DetailsViewContent/index.js +5 -6
- package/{components → dist/components}/browsingTestCaseLayout/DetailsViewLayout/DetailsViewContent/style.js +5 -8
- package/{components → dist/components}/browsingTestCaseLayout/DetailsViewLayout/DetailsViewHeader/index.js +4 -5
- package/{components → dist/components}/browsingTestCaseLayout/TreeViewLayout/TreeViewContent/Index.js +4 -5
- package/{components → dist/components}/browsingTestCaseLayout/TreeViewLayout/TreeViewHeader/Index.js +5 -6
- package/dist/components/browsingTestCaseLayout/TreeViewLayout/TreeViewHeader/style.js +23 -0
- package/{components → dist/components}/browsingTestCaseLayout/index.js +25 -30
- package/dist/components/button/index.js +133 -0
- package/{components → dist/components}/chatBotModal/index.js +36 -45
- package/dist/components/checkBox/index.js +29 -0
- package/{components → dist/components}/combobox/index.js +51 -72
- package/dist/components/divider/index.js +37 -0
- package/{components → dist/components}/editableField/index.js +19 -28
- package/{components → dist/components}/error/index.js +6 -12
- package/dist/components/errorBoundary/index.js +140 -0
- package/dist/components/fileUploader/index.js +151 -0
- package/dist/components/fileUploader/style.js +57 -0
- package/dist/components/filter/ValueSelector.js +333 -0
- package/{components → dist/components}/filter/index.js +31 -36
- package/{components → dist/components}/iconButton/index.js +3 -4
- package/dist/components/input/index.js +167 -0
- package/dist/components/layout/index.js +94 -0
- package/dist/components/layout/main/index.js +24 -0
- package/dist/components/layout/main/style.js +19 -0
- package/{components → dist/components}/layout/pageContent/index.js +6 -7
- package/dist/components/layout/sidebar/FlatMenu.js +64 -0
- package/dist/components/layout/sidebar/GroupedIconMenu.js +233 -0
- package/dist/components/layout/sidebar/GroupedMenu.js +57 -0
- package/dist/components/layout/sidebar/ProjectMenu.js +223 -0
- package/dist/components/layout/sidebar/index.js +88 -0
- package/dist/components/layout/sidebar/style.js +149 -0
- package/{components → dist/components}/layout/topBar/ProjectTopbar.js +81 -98
- package/dist/components/layout/topBar/UserAvatar.js +138 -0
- package/dist/components/layout/topBar/index.js +121 -0
- package/{components → dist/components}/loader/index.js +9 -12
- package/dist/components/menu/index.js +71 -0
- package/{components → dist/components}/modal/Modal.js +5 -6
- package/dist/components/modal/index.js +88 -0
- package/dist/components/modal/style.js +65 -0
- package/dist/components/optionMenu/index.js +105 -0
- package/dist/components/pagination/index.js +114 -0
- package/dist/components/pagination/style.js +33 -0
- package/dist/components/paginationUpdated/index.js +73 -0
- package/dist/components/paper/index.js +43 -0
- package/dist/components/paper/style.js +31 -0
- package/dist/components/reactSelect/index.js +195 -0
- package/dist/components/reactSelect/style.js +130 -0
- package/dist/components/richTextEditor/index.js +64 -0
- package/dist/components/select/GroupedSelect.js +167 -0
- package/dist/components/select/SimpleSelect.js +184 -0
- package/{components → dist/components}/select/index.js +38 -54
- package/dist/components/simpleSelect/index.js +53 -0
- package/{components → dist/components}/sort/index.js +19 -22
- package/{components → dist/components}/switch/index.js +10 -11
- package/dist/components/switch/style.js +39 -0
- package/{components → dist/components}/switch/switch.js +17 -23
- package/dist/components/table/ReactTable.js +101 -0
- package/dist/components/table/SimpleTable.js +117 -0
- package/dist/components/table/index.js +381 -0
- package/dist/components/text/index.js +65 -0
- package/{components → dist/components}/timeStamp/index.js +4 -6
- package/dist/components/timeStamp/style.js +20 -0
- package/dist/components/topBar/index.js +169 -0
- package/{components → dist/components}/tree/index.js +29 -47
- package/dist/components/tree/style.js +29 -0
- package/dist/components/valuePicker/ValueSelector.js +205 -0
- package/{components → dist/components}/valuePicker/index.js +19 -26
- package/{components → dist/components}/wrapperLayout/layout/index.js +4 -5
- package/{components → dist/components}/wrapperLayout/main/index.js +4 -5
- package/{components → dist/components}/wrapperLayout/main/pageContainer/index.js +4 -5
- package/dist/components/wrapperLayout/main/sideBar/index.js +272 -0
- package/dist/components/wrapperLayout/main/sideBar/style.js +190 -0
- package/{components → dist/components}/wrapperLayout/topBar/UserAvatar.js +4 -5
- package/dist/components/wrapperLayout/topBar/avatar.js +55 -0
- package/dist/components/wrapperLayout/topBar/index.js +196 -0
- package/{components → dist/components}/wrapperLayout/topBar/menuIcon.js +4 -5
- package/dist/components/wrapperLayout/topBar/style.js +74 -0
- package/dist/http/index.js +133 -0
- package/{index.js → dist/index.js} +53 -55
- package/dist/package.json +127 -0
- package/{templates → dist/templates}/listPage/index.js +36 -57
- package/{themes → dist/themes}/default.js +5 -7
- package/{themes → dist/themes}/defaultSmall.js +2 -3
- package/{themes → dist/themes}/responsiveTheme.js +6 -8
- package/package.json +4 -1
- package/public/favicon.ico +0 -0
- package/public/index.html +43 -0
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/manifest.json +25 -0
- package/public/robots.txt +3 -0
- package/public/tenjinLogo.png +0 -0
- package/common/hooks/apiHooks.js +0 -223
- package/common/hooks/newApiHook.js +0 -270
- package/components/Canvas.js +0 -254
- package/components/DragBox/index.js +0 -45
- package/components/InputWithChip/index.js +0 -187
- package/components/WorkFlow.js +0 -47
- package/components/WorkFlowBuilder.js +0 -130
- package/components/alert/Style.js +0 -23
- package/components/alert/index.js +0 -69
- package/components/authenticationProvider/index.js +0 -166
- package/components/avatar/styles.js +0 -94
- package/components/breadCrumbs/index.js +0 -180
- package/components/browsingTestCaseLayout/TreeViewLayout/TreeViewHeader/style.js +0 -26
- package/components/button/index.js +0 -135
- package/components/checkBox/index.js +0 -30
- package/components/divider/index.js +0 -41
- package/components/errorBoundary/index.js +0 -160
- package/components/fileUploader/index.js +0 -156
- package/components/fileUploader/style.js +0 -60
- package/components/filter/ValueSelector.js +0 -350
- package/components/input/index.js +0 -174
- package/components/layout/index.js +0 -98
- package/components/layout/main/index.js +0 -27
- package/components/layout/main/style.js +0 -22
- package/components/layout/sidebar/FlatMenu.js +0 -64
- package/components/layout/sidebar/GroupedIconMenu.js +0 -246
- package/components/layout/sidebar/GroupedMenu.js +0 -67
- package/components/layout/sidebar/ProjectMenu.js +0 -230
- package/components/layout/sidebar/index.js +0 -91
- package/components/layout/sidebar/style.js +0 -154
- package/components/layout/topBar/UserAvatar.js +0 -145
- package/components/layout/topBar/index.js +0 -132
- package/components/menu/index.js +0 -80
- package/components/modal/index.js +0 -91
- package/components/modal/style.js +0 -68
- package/components/optionMenu/index.js +0 -112
- package/components/pagination/index.js +0 -129
- package/components/pagination/style.js +0 -36
- package/components/paginationUpdated/index.js +0 -75
- package/components/paper/index.js +0 -44
- package/components/paper/style.js +0 -34
- package/components/reactSelect/index.js +0 -212
- package/components/reactSelect/style.js +0 -163
- package/components/richTextEditor/index.js +0 -83
- package/components/select/GroupedSelect.js +0 -183
- package/components/select/SimpleSelect.js +0 -212
- package/components/simpleSelect/index.js +0 -56
- package/components/switch/style.js +0 -42
- package/components/table/ReactTable.js +0 -118
- package/components/table/SimpleTable.js +0 -136
- package/components/table/index.js +0 -256
- package/components/text/index.js +0 -67
- package/components/timeStamp/style.js +0 -23
- package/components/topBar/index.js +0 -176
- package/components/tree/style.js +0 -32
- package/components/valuePicker/ValueSelector.js +0 -273
- package/components/wrapperLayout/main/sideBar/index.js +0 -262
- package/components/wrapperLayout/main/sideBar/style.js +0 -196
- package/components/wrapperLayout/topBar/avatar.js +0 -57
- package/components/wrapperLayout/topBar/index.js +0 -182
- package/components/wrapperLayout/topBar/style.js +0 -77
- package/http/index.js +0 -226
- /package/{assets → dist/assets}/images/MicrosoftTeams-image (1).png +0 -0
- /package/{assets → dist/assets}/images/tenjin-4.0-logo.png +0 -0
- /package/{components → dist/components}/RightContext/index.css +0 -0
- /package/{components → dist/components}/browsingTestCaseLayout/style.css +0 -0
- /package/{components → dist/components}/errorBoundary/Error.jpg +0 -0
- /package/{components → dist/components}/iconButton/style.js +0 -0
- /package/{components → dist/components}/richTextEditor/style.js +0 -0
- /package/{components → dist/components}/wrapperLayout/layout/style.js +0 -0
|
@@ -1,6 +1,5 @@
|
|
|
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); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -9,31 +8,30 @@ var _material = require("@mui/material");
|
|
|
9
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
9
|
var _Edit = _interopRequireDefault(require("@mui/icons-material/Edit"));
|
|
11
10
|
var _text = _interopRequireDefault(require("../text"));
|
|
12
|
-
function _interopRequireDefault(
|
|
13
|
-
function
|
|
14
|
-
function
|
|
15
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
13
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
16
14
|
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."); }
|
|
17
|
-
function _unsupportedIterableToArray(
|
|
18
|
-
function _arrayLikeToArray(
|
|
19
|
-
function _iterableToArrayLimit(
|
|
20
|
-
function _arrayWithHoles(
|
|
15
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
16
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
17
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
18
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
21
19
|
// import Select from "../select";
|
|
22
20
|
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
const EditableField = props => {
|
|
22
|
+
const _useState = (0, _react.useState)(props.editableData || "N/A"),
|
|
25
23
|
_useState2 = _slicedToArray(_useState, 2),
|
|
26
24
|
name = _useState2[0],
|
|
27
25
|
setName = _useState2[1];
|
|
28
|
-
|
|
26
|
+
const _useState3 = (0, _react.useState)(false),
|
|
29
27
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
30
28
|
isNameFocused = _useState4[0],
|
|
31
29
|
setIsNameFocused = _useState4[1];
|
|
32
|
-
|
|
30
|
+
const _useState5 = (0, _react.useState)(false),
|
|
33
31
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
34
32
|
show = _useState6[0],
|
|
35
33
|
isShow = _useState6[1];
|
|
36
|
-
|
|
34
|
+
const handleKeyDown = event => {
|
|
37
35
|
// if (name?.length > 0 || typeof name === "number") {
|
|
38
36
|
// if (event.key === "Enter") {
|
|
39
37
|
// setIsNameFocused(false);
|
|
@@ -54,7 +52,7 @@ var EditableField = function EditableField(props) {
|
|
|
54
52
|
}
|
|
55
53
|
}
|
|
56
54
|
};
|
|
57
|
-
|
|
55
|
+
const onBLurHandeler = () => {
|
|
58
56
|
if ((name === null || name === void 0 ? void 0 : name.length) > 0 || typeof name === "number") {
|
|
59
57
|
setIsNameFocused(false);
|
|
60
58
|
isShow(false);
|
|
@@ -68,7 +66,7 @@ var EditableField = function EditableField(props) {
|
|
|
68
66
|
};
|
|
69
67
|
|
|
70
68
|
//Select Type
|
|
71
|
-
|
|
69
|
+
const onSelectBLurHandeler = () => {
|
|
72
70
|
if (props.value === null) {
|
|
73
71
|
var _props$value;
|
|
74
72
|
window.alert("Sorry, data should be selected");
|
|
@@ -93,15 +91,9 @@ var EditableField = function EditableField(props) {
|
|
|
93
91
|
cursor: "pointer"
|
|
94
92
|
} : {}
|
|
95
93
|
}, /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
96
|
-
onClick:
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
onMouseEnter: function onMouseEnter() {
|
|
100
|
-
return isShow(true);
|
|
101
|
-
},
|
|
102
|
-
onMouseLeave: function onMouseLeave() {
|
|
103
|
-
return isShow(false);
|
|
104
|
-
},
|
|
94
|
+
onClick: () => setIsNameFocused(true),
|
|
95
|
+
onMouseEnter: () => isShow(true),
|
|
96
|
+
onMouseLeave: () => isShow(false),
|
|
105
97
|
style: {
|
|
106
98
|
display: "flex",
|
|
107
99
|
alignItems: "center",
|
|
@@ -113,7 +105,7 @@ var EditableField = function EditableField(props) {
|
|
|
113
105
|
variant: "standard",
|
|
114
106
|
autoFocus: true,
|
|
115
107
|
value: name,
|
|
116
|
-
onChange:
|
|
108
|
+
onChange: e => {
|
|
117
109
|
setName(e.target.value);
|
|
118
110
|
props.onChange(e.target.value);
|
|
119
111
|
},
|
|
@@ -131,5 +123,4 @@ var EditableField = function EditableField(props) {
|
|
|
131
123
|
}
|
|
132
124
|
})));
|
|
133
125
|
};
|
|
134
|
-
var _default = EditableField;
|
|
135
|
-
exports.default = _default;
|
|
126
|
+
var _default = exports.default = EditableField;
|
|
@@ -7,17 +7,16 @@ 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
|
-
function _interopRequireDefault(
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
11
|
/* eslint-disable jsx-a11y/anchor-is-valid */
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
const Error = () => {
|
|
14
|
+
const handleGoBack = () => {
|
|
15
15
|
window.history.back();
|
|
16
16
|
// window.setTimeout(() => {
|
|
17
17
|
// window.location.reload();
|
|
18
18
|
// }, 10);
|
|
19
19
|
};
|
|
20
|
-
|
|
21
20
|
return /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
22
21
|
container: true
|
|
23
22
|
}, /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
@@ -39,18 +38,13 @@ var Error = function Error() {
|
|
|
39
38
|
cursor: "pointer",
|
|
40
39
|
color: "blue"
|
|
41
40
|
},
|
|
42
|
-
onClick:
|
|
43
|
-
return window.location.reload();
|
|
44
|
-
}
|
|
41
|
+
onClick: () => window.location.reload()
|
|
45
42
|
}, "Reloading", " "), "the page OR", /*#__PURE__*/_react.default.createElement("a", {
|
|
46
43
|
style: {
|
|
47
44
|
cursor: "pointer",
|
|
48
45
|
color: "blue"
|
|
49
46
|
},
|
|
50
|
-
onClick:
|
|
51
|
-
return handleGoBack();
|
|
52
|
-
}
|
|
47
|
+
onClick: () => handleGoBack()
|
|
53
48
|
}, " ", "Go Back")))));
|
|
54
49
|
};
|
|
55
|
-
var _default = Error;
|
|
56
|
-
exports.default = _default;
|
|
50
|
+
var _default = exports.default = Error;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _material = require("@mui/material");
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _Error = _interopRequireDefault(require("./Error.jpg"));
|
|
10
|
+
var _text = _interopRequireDefault(require("../text"));
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
13
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
14
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
15
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
16
|
+
// const ErrorBoundary = (props) => {
|
|
17
|
+
// const { homePage } = props;
|
|
18
|
+
// const [hasError, setHasError] = useState(false);
|
|
19
|
+
|
|
20
|
+
// useEffect(() => {
|
|
21
|
+
// const handleError = (error) => {
|
|
22
|
+
// window.alert("coming");
|
|
23
|
+
// // console.error(error);
|
|
24
|
+
// setHasError(true);
|
|
25
|
+
// };
|
|
26
|
+
|
|
27
|
+
// window.addEventListener("error", handleError);
|
|
28
|
+
// return () => {
|
|
29
|
+
// window.removeEventListener("error", handleError);
|
|
30
|
+
// };
|
|
31
|
+
// }, []);
|
|
32
|
+
|
|
33
|
+
// if (hasError) {
|
|
34
|
+
// return (
|
|
35
|
+
// <Grid container>
|
|
36
|
+
// <Grid item xs={6} margin="auto">
|
|
37
|
+
// <Grid container justifyContent="center">
|
|
38
|
+
// <h1>Oops! Something went wrong.</h1>
|
|
39
|
+
// </Grid>
|
|
40
|
+
|
|
41
|
+
// <Grid container justifyContent="center">
|
|
42
|
+
// <Stack direction="row" spacing={2}>
|
|
43
|
+
// <Button
|
|
44
|
+
// variant="outlined"
|
|
45
|
+
// onClick={() => window.location.reload()}
|
|
46
|
+
// >
|
|
47
|
+
// Reload
|
|
48
|
+
// </Button>
|
|
49
|
+
// <Button variant="outlined">
|
|
50
|
+
// <a href={homePage ?? "/"}> Bak to Home</a>
|
|
51
|
+
// </Button>
|
|
52
|
+
// </Stack>
|
|
53
|
+
// </Grid>
|
|
54
|
+
// </Grid>
|
|
55
|
+
// <Grid item xs={6}>
|
|
56
|
+
// <img
|
|
57
|
+
// style={{ height: "100vh", width: "100%", overflow: "hidden" }}
|
|
58
|
+
// src={error_image}
|
|
59
|
+
// />
|
|
60
|
+
// </Grid>
|
|
61
|
+
// </Grid>
|
|
62
|
+
// );
|
|
63
|
+
// } else {
|
|
64
|
+
// return <>{props.children}</>;
|
|
65
|
+
// }
|
|
66
|
+
// };
|
|
67
|
+
|
|
68
|
+
// export default ErrorBoundary;
|
|
69
|
+
|
|
70
|
+
class ErrorBoundary extends _react.Component {
|
|
71
|
+
constructor(props) {
|
|
72
|
+
super(props);
|
|
73
|
+
_defineProperty(this, "handleGoBack", () => {
|
|
74
|
+
window.history.back();
|
|
75
|
+
window.setTimeout(() => {
|
|
76
|
+
window.location.reload();
|
|
77
|
+
}, 10);
|
|
78
|
+
});
|
|
79
|
+
this.state = {
|
|
80
|
+
hasError: false
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
componentDidCatch(error, errorInfo) {
|
|
84
|
+
this.setState({
|
|
85
|
+
hasError: true
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
render() {
|
|
89
|
+
if (this.state.hasError) {
|
|
90
|
+
var _this$props$homePage;
|
|
91
|
+
return /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
92
|
+
container: true
|
|
93
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
94
|
+
item: true,
|
|
95
|
+
xs: 6,
|
|
96
|
+
margin: "auto"
|
|
97
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
98
|
+
container: true,
|
|
99
|
+
justifyContent: "center",
|
|
100
|
+
textAlign: "center"
|
|
101
|
+
}, /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
102
|
+
variant: "title",
|
|
103
|
+
bold: true
|
|
104
|
+
}, "Oops! Something went wrong."), /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
105
|
+
variant: "body1"
|
|
106
|
+
}, "Please Reload the page or Refresh the page or return Home to try again.")), /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
107
|
+
container: true,
|
|
108
|
+
justifyContent: "center"
|
|
109
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Stack, {
|
|
110
|
+
direction: "row",
|
|
111
|
+
spacing: 2
|
|
112
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Button, {
|
|
113
|
+
variant: "contained",
|
|
114
|
+
onClick: () => window.location.reload()
|
|
115
|
+
}, "Reload"), /*#__PURE__*/_react.default.createElement(_material.Button, {
|
|
116
|
+
variant: "contained",
|
|
117
|
+
onClick: this.handleGoBack
|
|
118
|
+
}, "Go Back"), /*#__PURE__*/_react.default.createElement(_material.Button, {
|
|
119
|
+
variant: "outlined"
|
|
120
|
+
}, /*#__PURE__*/_react.default.createElement("a", {
|
|
121
|
+
style: {
|
|
122
|
+
textDecoration: "none"
|
|
123
|
+
},
|
|
124
|
+
href: (_this$props$homePage = this.props.homePage) !== null && _this$props$homePage !== void 0 ? _this$props$homePage : "/"
|
|
125
|
+
}, " ", "Go Home"))))), /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
126
|
+
item: true,
|
|
127
|
+
xs: 6
|
|
128
|
+
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
129
|
+
style: {
|
|
130
|
+
height: "100vh",
|
|
131
|
+
width: "100%",
|
|
132
|
+
overflow: "hidden"
|
|
133
|
+
},
|
|
134
|
+
src: _Error.default
|
|
135
|
+
})));
|
|
136
|
+
}
|
|
137
|
+
return this.props.children;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
var _default = exports.default = ErrorBoundary;
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _material = require("@mui/material");
|
|
9
|
+
var _styles = require("@mui/material/styles");
|
|
10
|
+
var _fi = require("react-icons/fi");
|
|
11
|
+
var _text = _interopRequireDefault(require("../text"));
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
14
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
15
|
+
const FileInput = (0, _styles.styled)("input")({
|
|
16
|
+
display: "none"
|
|
17
|
+
});
|
|
18
|
+
const DropzoneContainer = (0, _styles.styled)(_material.Container)({
|
|
19
|
+
width: "27.3rem",
|
|
20
|
+
height: "9.3rem",
|
|
21
|
+
display: "flex",
|
|
22
|
+
flexDirection: "column",
|
|
23
|
+
alignItems: "center",
|
|
24
|
+
justifyContent: "center",
|
|
25
|
+
padding: "2rem",
|
|
26
|
+
border: "1.5px dashed #ACACAC",
|
|
27
|
+
borderRadius: "0.5rem",
|
|
28
|
+
"&:hover": {
|
|
29
|
+
cursor: "pointer",
|
|
30
|
+
backgroundColor: "#f5f5f5"
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
const DropzoneText = (0, _styles.styled)("p")({
|
|
34
|
+
margin: "1rem",
|
|
35
|
+
display: "flex",
|
|
36
|
+
justifyContent: "center",
|
|
37
|
+
alignItems: "center",
|
|
38
|
+
flexDirection: "column",
|
|
39
|
+
gap: "1rem"
|
|
40
|
+
});
|
|
41
|
+
const FileUploader = props => {
|
|
42
|
+
var _selectedFile$, _selectedFile$2, _selectedFile$3;
|
|
43
|
+
const selectedFile = props.selectedFile,
|
|
44
|
+
setSelectedFile = props.setSelectedFile,
|
|
45
|
+
key = props.key;
|
|
46
|
+
const fileInputRef = (0, _react.useRef)(null);
|
|
47
|
+
|
|
48
|
+
// const handleFileInput = (e) => {
|
|
49
|
+
// e.target.files[0] && setSelectedFile(e.target.files);
|
|
50
|
+
// };
|
|
51
|
+
const handleFileInput = e => {
|
|
52
|
+
// e.target.files[0] && setSelectedFile(e.target.files);
|
|
53
|
+
const selectedFile = e.target.files[0];
|
|
54
|
+
if (selectedFile) {
|
|
55
|
+
var _selectedFile$name;
|
|
56
|
+
const excludedExtensions = [".zip", ".exe", ".batch", ".webm", ".mp4", ".mp3", ".bat", ".js", ".vbs", ".html", ".scr", ".cmd", ".rar", ".svg", ".lnk"];
|
|
57
|
+
const fileExtension = selectedFile === null || selectedFile === void 0 || (_selectedFile$name = selectedFile.name) === null || _selectedFile$name === void 0 || (_selectedFile$name = _selectedFile$name.split(".")) === null || _selectedFile$name === void 0 || (_selectedFile$name = _selectedFile$name.pop()) === null || _selectedFile$name === void 0 ? void 0 : _selectedFile$name.toLowerCase();
|
|
58
|
+
if (excludedExtensions.some(ext => selectedFile.name.endsWith(ext))) {
|
|
59
|
+
alert("Selected file type .".concat(fileExtension, " is not allowed."));
|
|
60
|
+
e.target.value = null;
|
|
61
|
+
} else {
|
|
62
|
+
e.target.files[0] && setSelectedFile(e.target.files);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
const handleDrop = e => {
|
|
67
|
+
e.preventDefault();
|
|
68
|
+
e.stopPropagation();
|
|
69
|
+
// setSelectedFile(e.dataTransfer.files);
|
|
70
|
+
const droppedFiles = e.dataTransfer.files;
|
|
71
|
+
if (droppedFiles.length > 0) {
|
|
72
|
+
var _droppedFiles$;
|
|
73
|
+
const excludedExtensions = [".zip", ".exe", ".batch", ".webm", ".mp4", ".mp3", ".bat", ".js", ".vbs", ".html", ".scr", ".cmd", ".rar", ".svg", ".lnk"];
|
|
74
|
+
const fileExtension = (_droppedFiles$ = droppedFiles[0]) === null || _droppedFiles$ === void 0 || (_droppedFiles$ = _droppedFiles$.name) === null || _droppedFiles$ === void 0 || (_droppedFiles$ = _droppedFiles$.split(".")) === null || _droppedFiles$ === void 0 || (_droppedFiles$ = _droppedFiles$.pop()) === null || _droppedFiles$ === void 0 ? void 0 : _droppedFiles$.toLowerCase();
|
|
75
|
+
if (excludedExtensions !== null && excludedExtensions !== void 0 && excludedExtensions.some(ext => {
|
|
76
|
+
var _droppedFiles$2;
|
|
77
|
+
return (_droppedFiles$2 = droppedFiles[0]) === null || _droppedFiles$2 === void 0 || (_droppedFiles$2 = _droppedFiles$2.name) === null || _droppedFiles$2 === void 0 ? void 0 : _droppedFiles$2.endsWith(ext);
|
|
78
|
+
})) {
|
|
79
|
+
alert("Selected file type .".concat(fileExtension, " is not allowed."));
|
|
80
|
+
} else {
|
|
81
|
+
setSelectedFile(droppedFiles);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
const handleDragOver = e => {
|
|
86
|
+
e.preventDefault();
|
|
87
|
+
e.stopPropagation();
|
|
88
|
+
};
|
|
89
|
+
const handleClick = e => {
|
|
90
|
+
e.preventDefault();
|
|
91
|
+
fileInputRef.current.click();
|
|
92
|
+
};
|
|
93
|
+
return /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
94
|
+
container: true,
|
|
95
|
+
justifyContent: "center"
|
|
96
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
97
|
+
item: true,
|
|
98
|
+
xs: 12
|
|
99
|
+
}, /*#__PURE__*/_react.default.createElement(DropzoneContainer, {
|
|
100
|
+
onClick: handleClick,
|
|
101
|
+
onDrop: handleDrop,
|
|
102
|
+
onDragOver: handleDragOver
|
|
103
|
+
}, /*#__PURE__*/_react.default.createElement(DropzoneText, null, !(selectedFile !== null && selectedFile !== void 0 && selectedFile.length) > 0 ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_fi.FiUpload, {
|
|
104
|
+
size: "1.9rem",
|
|
105
|
+
color: "#44409A"
|
|
106
|
+
}), /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
107
|
+
bold: true,
|
|
108
|
+
fontWeight: "400",
|
|
109
|
+
fontSize: "1rem"
|
|
110
|
+
}, "Drag and Drop or ", /*#__PURE__*/_react.default.createElement("b", null, "Choose File"), " to Upload")) : (selectedFile === null || selectedFile === void 0 ? void 0 : selectedFile.length) > 1 ? /*#__PURE__*/_react.default.createElement("ul", null, Array.from(selectedFile).map((file, index) => {
|
|
111
|
+
var _file$name;
|
|
112
|
+
return /*#__PURE__*/_react.default.createElement(_material.Tooltip, {
|
|
113
|
+
arrow: true,
|
|
114
|
+
placement: "top",
|
|
115
|
+
title: (file === null || file === void 0 || (_file$name = file.name) === null || _file$name === void 0 ? void 0 : _file$name.length) > 25 ? file === null || file === void 0 ? void 0 : file.name : ""
|
|
116
|
+
}, /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
117
|
+
sx: {
|
|
118
|
+
width: "220px",
|
|
119
|
+
whiteSpace: "nowrap",
|
|
120
|
+
overflow: "hidden",
|
|
121
|
+
textOverflow: "ellipsis",
|
|
122
|
+
fontWeight: 400,
|
|
123
|
+
fontSize: "1rem"
|
|
124
|
+
},
|
|
125
|
+
key: index
|
|
126
|
+
}, file === null || file === void 0 ? void 0 : file.name));
|
|
127
|
+
})) : /*#__PURE__*/_react.default.createElement(_material.Tooltip, {
|
|
128
|
+
arrow: true,
|
|
129
|
+
placement: "top",
|
|
130
|
+
title: ((_selectedFile$ = selectedFile[0]) === null || _selectedFile$ === void 0 || (_selectedFile$ = _selectedFile$.name) === null || _selectedFile$ === void 0 ? void 0 : _selectedFile$.length) > 25 ? (_selectedFile$2 = selectedFile[0]) === null || _selectedFile$2 === void 0 ? void 0 : _selectedFile$2.name : ""
|
|
131
|
+
}, /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
132
|
+
sx: {
|
|
133
|
+
width: "220px",
|
|
134
|
+
whiteSpace: "nowrap",
|
|
135
|
+
overflow: "hidden",
|
|
136
|
+
textOverflow: "ellipsis",
|
|
137
|
+
fontWeight: 400,
|
|
138
|
+
fontSize: "1rem",
|
|
139
|
+
display: "flex",
|
|
140
|
+
justifyContent: "center"
|
|
141
|
+
}
|
|
142
|
+
}, (_selectedFile$3 = selectedFile[0]) === null || _selectedFile$3 === void 0 ? void 0 : _selectedFile$3.name)))), /*#__PURE__*/_react.default.createElement(FileInput, _extends({
|
|
143
|
+
type: "file",
|
|
144
|
+
accept: "image/*",
|
|
145
|
+
onChange: handleFileInput,
|
|
146
|
+
id: "fileInput",
|
|
147
|
+
ref: fileInputRef,
|
|
148
|
+
key: key
|
|
149
|
+
}, props))));
|
|
150
|
+
};
|
|
151
|
+
var _default = exports.default = FileUploader;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _styles = require("@mui/styles");
|
|
8
|
+
var _default2 = _interopRequireDefault(require("../../themes/default"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
var _default = exports.default = (0, _styles.makeStyles)(() => ({
|
|
11
|
+
modalContentWrapper: {
|
|
12
|
+
position: "absolute",
|
|
13
|
+
backgroundColor: _default2.default.palette.background.paper,
|
|
14
|
+
borderRadius: "3px",
|
|
15
|
+
boxShadow: _default2.default.shadows[5],
|
|
16
|
+
top: "10%",
|
|
17
|
+
"&:focus": {
|
|
18
|
+
outline: "none"
|
|
19
|
+
},
|
|
20
|
+
margin: "auto"
|
|
21
|
+
},
|
|
22
|
+
default: {
|
|
23
|
+
width: "400px",
|
|
24
|
+
left: "calc(50% - 400px / 2)"
|
|
25
|
+
},
|
|
26
|
+
large: {
|
|
27
|
+
width: "600px",
|
|
28
|
+
left: "calc(50% - 600px / 2)"
|
|
29
|
+
},
|
|
30
|
+
xlarge: {
|
|
31
|
+
width: "800px",
|
|
32
|
+
left: "calc(50% - 800px / 2)"
|
|
33
|
+
},
|
|
34
|
+
fullscreen: {
|
|
35
|
+
width: "98%",
|
|
36
|
+
left: "1%",
|
|
37
|
+
top: "10px"
|
|
38
|
+
},
|
|
39
|
+
header: {
|
|
40
|
+
display: "flex",
|
|
41
|
+
alignItems: "center",
|
|
42
|
+
padding: "0.4rem 1rem",
|
|
43
|
+
borderBottom: "1px solid #ccc",
|
|
44
|
+
"& .title": {
|
|
45
|
+
flexGrow: 1,
|
|
46
|
+
fontWeight: 500
|
|
47
|
+
},
|
|
48
|
+
"& .modalCloseTrigger": {
|
|
49
|
+
cursor: "pointer"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
content: {
|
|
53
|
+
padding: "0.4rem 1rem",
|
|
54
|
+
maxHeight: "calc(100vh - 170px)",
|
|
55
|
+
overflowY: "auto"
|
|
56
|
+
}
|
|
57
|
+
}));
|