tenjin-ui-kit 0.3.74 → 0.3.76
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/common/hooks/apiHooks.js +91 -199
- package/common/hooks/newApiHook.js +127 -258
- package/common/utils/security/index.js +2 -2
- package/common/utils/security/securityConfig.js +1 -2
- package/components/Canvas.js +172 -101
- package/components/DragBox/index.js +21 -31
- package/components/InputWithChip/index.js +178 -83
- package/components/RightContext/index.js +17 -41
- package/components/WorkFlow.js +19 -29
- package/components/WorkFlowBuilder.js +32 -56
- package/components/alert/Style.js +11 -14
- package/components/alert/index.js +8 -14
- package/components/attachment/index.js +26 -31
- package/components/authenticationProvider/AuthError.js +3 -4
- package/components/authenticationProvider/AuthLoader.js +3 -4
- package/components/authenticationProvider/index.js +58 -130
- package/components/avatar/index.js +24 -23
- package/components/avatar/styles.js +76 -77
- package/components/breadCrumbs/index.js +64 -89
- package/components/breadCrumbs/style.js +1 -4
- package/components/browsingTestCaseLayout/DetailsViewLayout/DetailsViewContent/index.js +7 -6
- package/components/browsingTestCaseLayout/DetailsViewLayout/DetailsViewContent/style.js +5 -8
- package/components/browsingTestCaseLayout/DetailsViewLayout/DetailsViewHeader/index.js +7 -6
- package/components/browsingTestCaseLayout/TreeViewLayout/TreeViewContent/Index.js +8 -7
- package/components/browsingTestCaseLayout/TreeViewLayout/TreeViewHeader/Index.js +8 -7
- package/components/browsingTestCaseLayout/TreeViewLayout/TreeViewHeader/style.js +16 -19
- package/components/browsingTestCaseLayout/index.js +30 -46
- package/components/button/index.js +47 -58
- package/components/chatBotModal/index.js +40 -61
- package/components/checkBox/index.js +8 -10
- package/components/combobox/index.js +66 -100
- package/components/divider/index.js +9 -18
- package/components/editableField/index.js +19 -46
- package/components/error/index.js +6 -12
- package/components/errorBoundary/index.js +74 -98
- package/components/fileUploader/index.js +46 -58
- package/components/fileUploader/style.js +46 -49
- package/components/filter/ValueSelector.js +148 -243
- package/components/filter/index.js +43 -66
- package/components/iconButton/index.js +3 -4
- package/components/input/index.js +70 -90
- package/components/layout/index.js +36 -49
- package/components/layout/main/index.js +13 -14
- package/components/layout/main/style.js +11 -14
- package/components/layout/pageContent/index.js +8 -7
- package/components/layout/sidebar/FlatMenu.js +51 -47
- package/components/layout/sidebar/GroupedIconMenu.js +169 -194
- package/components/layout/sidebar/GroupedMenu.js +45 -50
- package/components/layout/sidebar/ProjectMenu.js +165 -185
- package/components/layout/sidebar/index.js +27 -26
- package/components/layout/sidebar/style.js +138 -143
- package/components/layout/topBar/ProjectTopbar.js +86 -119
- package/components/layout/topBar/UserAvatar.js +51 -65
- package/components/layout/topBar/index.js +23 -41
- package/components/loader/index.js +9 -12
- package/components/menu/index.js +23 -42
- package/components/modal/Modal.js +5 -6
- package/components/modal/index.js +16 -20
- package/components/modal/style.js +53 -56
- package/components/optionMenu/index.js +32 -47
- package/components/pagination/index.js +23 -43
- package/components/pagination/style.js +25 -28
- package/components/paginationUpdated/index.js +19 -26
- package/components/paper/index.js +20 -22
- package/components/paper/style.js +24 -27
- package/components/reactSelect/index.js +64 -97
- package/components/reactSelect/style.js +131 -151
- package/components/richTextEditor/index.js +24 -48
- package/components/select/GroupedSelect.js +56 -100
- package/components/select/SimpleSelect.js +59 -99
- package/components/select/index.js +56 -69
- package/components/simpleSelect/index.js +18 -22
- package/components/sort/index.js +23 -36
- package/components/switch/index.js +14 -15
- package/components/switch/style.js +29 -32
- package/components/switch/switch.js +30 -47
- package/components/table/ReactTable.js +59 -83
- package/components/table/SimpleTable.js +67 -91
- package/components/table/index.js +300 -206
- package/components/text/index.js +22 -30
- package/components/timeStamp/index.js +4 -6
- package/components/timeStamp/style.js +12 -15
- package/components/topBar/index.js +86 -102
- package/components/tree/index.js +30 -58
- package/components/tree/style.js +20 -23
- package/components/valuePicker/ValueSelector.js +78 -160
- package/components/valuePicker/index.js +30 -50
- package/components/wrapperLayout/layout/index.js +8 -7
- package/components/wrapperLayout/main/index.js +8 -7
- package/components/wrapperLayout/main/pageContainer/index.js +6 -5
- package/components/wrapperLayout/main/sideBar/index.js +171 -175
- package/components/wrapperLayout/main/sideBar/style.js +177 -183
- package/components/wrapperLayout/topBar/UserAvatar.js +6 -5
- package/components/wrapperLayout/topBar/avatar.js +15 -18
- package/components/wrapperLayout/topBar/index.js +115 -107
- package/components/wrapperLayout/topBar/menuIcon.js +6 -5
- package/components/wrapperLayout/topBar/style.js +63 -64
- package/http/index.js +92 -188
- package/index.js +53 -55
- package/package.json +6 -3
- package/templates/listPage/index.js +168 -196
- package/themes/default.js +5 -7
- package/themes/defaultSmall.js +2 -3
- package/themes/responsiveTheme.js +6 -8
|
@@ -8,147 +8,142 @@ var _iconsMaterial = require("@mui/icons-material");
|
|
|
8
8
|
var _styles = require("@mui/styles");
|
|
9
9
|
var _system = require("@mui/system");
|
|
10
10
|
var _responsiveTheme = _interopRequireDefault(require("../../../themes/responsiveTheme"));
|
|
11
|
-
function _interopRequireDefault(
|
|
12
|
-
var _default = (0, _styles.makeStyles)(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
minWidth: "10px"
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
collapsedFlatMenuItemText: {
|
|
44
|
-
display: "none !important"
|
|
45
|
-
},
|
|
46
|
-
flatMenuItem: {
|
|
47
|
-
height: "48px",
|
|
48
|
-
borderRadius: "7px !important"
|
|
49
|
-
},
|
|
50
|
-
selectedFlatMenuItem: {
|
|
51
|
-
backgroundColor: "".concat(_responsiveTheme.default.palette.primary.main, " !important"),
|
|
52
|
-
color: "#fff !important"
|
|
53
|
-
},
|
|
54
|
-
selectedGroupMenuItem: {
|
|
55
|
-
backgroundColor: "".concat(_responsiveTheme.default.palette.primary.main, " !important"),
|
|
56
|
-
color: "#fff !important",
|
|
57
|
-
borderRadius: "5px !important"
|
|
58
|
-
},
|
|
59
|
-
selectedFlatMenuIcon: {
|
|
60
|
-
color: "#fff !important"
|
|
61
|
-
},
|
|
62
|
-
selectedFlatMenuItemText: {
|
|
63
|
-
color: "#fff !important"
|
|
64
|
-
},
|
|
65
|
-
projectMenuMainWrapper: {
|
|
66
|
-
paddingTop: "0.5rem",
|
|
67
|
-
// padding: "7px",
|
|
68
|
-
display: "inline-block",
|
|
69
|
-
width: "100%"
|
|
70
|
-
},
|
|
71
|
-
projectMenuHeader: {
|
|
72
|
-
color: "#44409A",
|
|
73
|
-
fontFamily: "sans-serif",
|
|
74
|
-
fontSize: "18px !important",
|
|
75
|
-
lineHeight: "24px",
|
|
76
|
-
display: "flex",
|
|
77
|
-
justifyContent: "center",
|
|
78
|
-
VerticalAlignCenter: true
|
|
79
|
-
},
|
|
80
|
-
selectedProjectMenuItem: {
|
|
81
|
-
backgroundColor: "".concat(_responsiveTheme.default.palette.primary.main, " !important"),
|
|
82
|
-
color: "#fff !important",
|
|
83
|
-
borderRadius: "5px !important",
|
|
84
|
-
fontWeight: 600
|
|
85
|
-
// fontSize: "16px !important",
|
|
86
|
-
},
|
|
87
|
-
|
|
88
|
-
projectListText: {
|
|
89
|
-
color: "".concat(_responsiveTheme.default.palette.primary.main, " !important"),
|
|
90
|
-
marginLeft: "24px",
|
|
91
|
-
fontSize: "14px !important",
|
|
92
|
-
fontWeight: 600
|
|
93
|
-
},
|
|
94
|
-
projectListIcon: {
|
|
95
|
-
color: "".concat(_responsiveTheme.default.palette.primary.main, " !important"),
|
|
96
|
-
display: "flex",
|
|
97
|
-
alignItems: "center",
|
|
98
|
-
width: "1rem",
|
|
99
|
-
height: "1rem"
|
|
100
|
-
},
|
|
101
|
-
selectedProjectMenuItemText: {
|
|
102
|
-
color: "#fff !important"
|
|
103
|
-
// fontSize: "14px !important",
|
|
104
|
-
// fontWeight: 600,
|
|
105
|
-
},
|
|
106
|
-
|
|
107
|
-
selectedProjectMenuItemIcon: {
|
|
108
|
-
color: "#fff !important",
|
|
109
|
-
display: "flex",
|
|
110
|
-
alignItems: "center",
|
|
111
|
-
width: "1rem",
|
|
112
|
-
height: "1rem"
|
|
113
|
-
},
|
|
114
|
-
subHeaderIcon: {
|
|
115
|
-
color: "#44409A",
|
|
116
|
-
display: "flex",
|
|
117
|
-
alignItems: "center",
|
|
118
|
-
width: "0.8rem",
|
|
119
|
-
height: "0.8rem"
|
|
120
|
-
},
|
|
121
|
-
sidebar: {
|
|
122
|
-
display: "inline-block",
|
|
123
|
-
position: "relative"
|
|
124
|
-
},
|
|
125
|
-
buttonIcon: {
|
|
126
|
-
position: "relative",
|
|
127
|
-
padding: "16px",
|
|
128
|
-
fontSize: "16px"
|
|
129
|
-
},
|
|
130
|
-
menuItem: {
|
|
131
|
-
zIndex: 1300,
|
|
132
|
-
display: "none",
|
|
133
|
-
position: "absolute",
|
|
134
|
-
backgroundColor: "#f1f1f1",
|
|
135
|
-
minWidth: "160px",
|
|
136
|
-
boxShadow: "0px 8px 16px 0px rgba(0,0,0,0.2)",
|
|
137
|
-
left: "10%",
|
|
138
|
-
top: "auto"
|
|
139
|
-
},
|
|
140
|
-
menuItemOpen: {
|
|
141
|
-
zIndex: 1300,
|
|
142
|
-
display: "block",
|
|
143
|
-
position: "absolute",
|
|
144
|
-
backgroundColor: "#f1f1f1",
|
|
145
|
-
minWidth: "160px",
|
|
146
|
-
boxShadow: "0px 8px 16px 0px rgba(0,0,0,0.2)",
|
|
147
|
-
left: "92px",
|
|
148
|
-
top: "auto",
|
|
149
|
-
bottom: "auto",
|
|
150
|
-
marginTop: "-3.5rem"
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
var _default = exports.default = (0, _styles.makeStyles)(() => ({
|
|
13
|
+
subHeader: {
|
|
14
|
+
textTransform: "uppercase",
|
|
15
|
+
fontSize: _responsiveTheme.default.typography.fontSize - 2,
|
|
16
|
+
color: "rgba(0,0,0,0.5)",
|
|
17
|
+
fontWeight: 500
|
|
18
|
+
},
|
|
19
|
+
link: {
|
|
20
|
+
textDecoration: "none"
|
|
21
|
+
},
|
|
22
|
+
listItemText: {
|
|
23
|
+
color: `${_responsiveTheme.default.palette.primary.main} !important`,
|
|
24
|
+
fontWeight: "500 !important"
|
|
25
|
+
},
|
|
26
|
+
expanded: {
|
|
27
|
+
width: "200px"
|
|
28
|
+
},
|
|
29
|
+
collapsed: {
|
|
30
|
+
width: "72px"
|
|
31
|
+
},
|
|
32
|
+
collapsedFlatMenuItem: {
|
|
33
|
+
paddingLeft: "0",
|
|
34
|
+
paddingRight: "0",
|
|
35
|
+
display: "flex !important",
|
|
36
|
+
alignItems: "center !important",
|
|
37
|
+
justifyContent: "center !important",
|
|
38
|
+
"& .MuiListItemIcon-root": {
|
|
39
|
+
minWidth: "10px"
|
|
151
40
|
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
|
|
41
|
+
},
|
|
42
|
+
collapsedFlatMenuItemText: {
|
|
43
|
+
display: "none !important"
|
|
44
|
+
},
|
|
45
|
+
flatMenuItem: {
|
|
46
|
+
height: "48px",
|
|
47
|
+
borderRadius: "7px !important"
|
|
48
|
+
},
|
|
49
|
+
selectedFlatMenuItem: {
|
|
50
|
+
backgroundColor: `${_responsiveTheme.default.palette.primary.main} !important`,
|
|
51
|
+
color: "#fff !important"
|
|
52
|
+
},
|
|
53
|
+
selectedGroupMenuItem: {
|
|
54
|
+
backgroundColor: `${_responsiveTheme.default.palette.primary.main} !important`,
|
|
55
|
+
color: "#fff !important",
|
|
56
|
+
borderRadius: "5px !important"
|
|
57
|
+
},
|
|
58
|
+
selectedFlatMenuIcon: {
|
|
59
|
+
color: "#fff !important"
|
|
60
|
+
},
|
|
61
|
+
selectedFlatMenuItemText: {
|
|
62
|
+
color: "#fff !important"
|
|
63
|
+
},
|
|
64
|
+
projectMenuMainWrapper: {
|
|
65
|
+
paddingTop: "0.5rem",
|
|
66
|
+
// padding: "7px",
|
|
67
|
+
display: "inline-block",
|
|
68
|
+
width: "100%"
|
|
69
|
+
},
|
|
70
|
+
projectMenuHeader: {
|
|
71
|
+
color: "#44409A",
|
|
72
|
+
fontFamily: "sans-serif",
|
|
73
|
+
fontSize: "18px !important",
|
|
74
|
+
lineHeight: "24px",
|
|
75
|
+
display: "flex",
|
|
76
|
+
justifyContent: "center",
|
|
77
|
+
VerticalAlignCenter: true
|
|
78
|
+
},
|
|
79
|
+
selectedProjectMenuItem: {
|
|
80
|
+
backgroundColor: `${_responsiveTheme.default.palette.primary.main} !important`,
|
|
81
|
+
color: "#fff !important",
|
|
82
|
+
borderRadius: "5px !important",
|
|
83
|
+
fontWeight: 600
|
|
84
|
+
// fontSize: "16px !important",
|
|
85
|
+
},
|
|
86
|
+
projectListText: {
|
|
87
|
+
color: `${_responsiveTheme.default.palette.primary.main} !important`,
|
|
88
|
+
marginLeft: "24px",
|
|
89
|
+
fontSize: "14px !important",
|
|
90
|
+
fontWeight: 600
|
|
91
|
+
},
|
|
92
|
+
projectListIcon: {
|
|
93
|
+
color: `${_responsiveTheme.default.palette.primary.main} !important`,
|
|
94
|
+
display: "flex",
|
|
95
|
+
alignItems: "center",
|
|
96
|
+
width: "1rem",
|
|
97
|
+
height: "1rem"
|
|
98
|
+
},
|
|
99
|
+
selectedProjectMenuItemText: {
|
|
100
|
+
color: "#fff !important"
|
|
101
|
+
// fontSize: "14px !important",
|
|
102
|
+
// fontWeight: 600,
|
|
103
|
+
},
|
|
104
|
+
selectedProjectMenuItemIcon: {
|
|
105
|
+
color: "#fff !important",
|
|
106
|
+
display: "flex",
|
|
107
|
+
alignItems: "center",
|
|
108
|
+
width: "1rem",
|
|
109
|
+
height: "1rem"
|
|
110
|
+
},
|
|
111
|
+
subHeaderIcon: {
|
|
112
|
+
color: "#44409A",
|
|
113
|
+
display: "flex",
|
|
114
|
+
alignItems: "center",
|
|
115
|
+
width: "0.8rem",
|
|
116
|
+
height: "0.8rem"
|
|
117
|
+
},
|
|
118
|
+
sidebar: {
|
|
119
|
+
display: "inline-block",
|
|
120
|
+
position: "relative"
|
|
121
|
+
},
|
|
122
|
+
buttonIcon: {
|
|
123
|
+
position: "relative",
|
|
124
|
+
padding: "16px",
|
|
125
|
+
fontSize: "16px"
|
|
126
|
+
},
|
|
127
|
+
menuItem: {
|
|
128
|
+
zIndex: 1300,
|
|
129
|
+
display: "none",
|
|
130
|
+
position: "absolute",
|
|
131
|
+
backgroundColor: "#f1f1f1",
|
|
132
|
+
minWidth: "160px",
|
|
133
|
+
boxShadow: "0px 8px 16px 0px rgba(0,0,0,0.2)",
|
|
134
|
+
left: "10%",
|
|
135
|
+
top: "auto"
|
|
136
|
+
},
|
|
137
|
+
menuItemOpen: {
|
|
138
|
+
zIndex: 1300,
|
|
139
|
+
display: "block",
|
|
140
|
+
position: "absolute",
|
|
141
|
+
backgroundColor: "#f1f1f1",
|
|
142
|
+
minWidth: "160px",
|
|
143
|
+
boxShadow: "0px 8px 16px 0px rgba(0,0,0,0.2)",
|
|
144
|
+
left: "92px",
|
|
145
|
+
top: "auto",
|
|
146
|
+
bottom: "auto",
|
|
147
|
+
marginTop: "-3.5rem"
|
|
148
|
+
}
|
|
149
|
+
}));
|
|
@@ -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
|
});
|
|
@@ -16,22 +15,11 @@ var _button = _interopRequireDefault(require("../../button"));
|
|
|
16
15
|
var _modal = _interopRequireDefault(require("../../modal"));
|
|
17
16
|
var _text = _interopRequireDefault(require("../../text"));
|
|
18
17
|
var _UserAvatar = _interopRequireDefault(require("./UserAvatar"));
|
|
19
|
-
function _interopRequireDefault(
|
|
20
|
-
function
|
|
21
|
-
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; }
|
|
22
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
23
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
24
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
25
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
26
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
27
|
-
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."); }
|
|
28
|
-
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); }
|
|
29
|
-
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; }
|
|
30
|
-
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; } }
|
|
31
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
18
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
19
|
+
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); }
|
|
32
20
|
// import { BsChatRightText } from "react-icons/bs";
|
|
33
21
|
|
|
34
|
-
|
|
22
|
+
const ANNOUNCEMENT_TYPES = {
|
|
35
23
|
success: {
|
|
36
24
|
backgroundColor: "#EDF7ED",
|
|
37
25
|
borderLeft: "6px solid #4CAF50",
|
|
@@ -53,30 +41,23 @@ var ANNOUNCEMENT_TYPES = {
|
|
|
53
41
|
color: "#0D47A1"
|
|
54
42
|
}
|
|
55
43
|
};
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
loggedInUser
|
|
60
|
-
actions
|
|
61
|
-
onLogout
|
|
62
|
-
onViewProfileClick
|
|
63
|
-
hrefLink
|
|
64
|
-
avatarItems
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
setAnchorEl = _useState2[1];
|
|
74
|
-
var _useState3 = (0, _react.useState)(null),
|
|
75
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
76
|
-
openMenuIndex = _useState4[0],
|
|
77
|
-
setOpenMenuIndex = _useState4[1];
|
|
78
|
-
var updatedActions = (0, _react.useMemo)(function () {
|
|
79
|
-
var base = _toConsumableArray(actions);
|
|
44
|
+
const ProjectTopbar = _ref => {
|
|
45
|
+
let {
|
|
46
|
+
homeIcon,
|
|
47
|
+
loggedInUser,
|
|
48
|
+
actions,
|
|
49
|
+
onLogout,
|
|
50
|
+
onViewProfileClick,
|
|
51
|
+
hrefLink,
|
|
52
|
+
avatarItems,
|
|
53
|
+
announcement = null,
|
|
54
|
+
isChatEnabled = false
|
|
55
|
+
} = _ref;
|
|
56
|
+
const theme = (0, _system.useTheme)();
|
|
57
|
+
const [anchorEl, setAnchorEl] = (0, _react.useState)(null);
|
|
58
|
+
const [openMenuIndex, setOpenMenuIndex] = (0, _react.useState)(null);
|
|
59
|
+
const updatedActions = (0, _react.useMemo)(() => {
|
|
60
|
+
const base = [...actions];
|
|
80
61
|
// if (isChatEnabled) {
|
|
81
62
|
// base.push({
|
|
82
63
|
// icon: <BsChatRightText size="12px" />,
|
|
@@ -85,16 +66,16 @@ var ProjectTopbar = function ProjectTopbar(_ref) {
|
|
|
85
66
|
// }
|
|
86
67
|
return base;
|
|
87
68
|
}, [actions, isChatEnabled]);
|
|
88
|
-
|
|
89
|
-
|
|
69
|
+
const navigate = (0, _reactRouter.useNavigate)();
|
|
70
|
+
const handleMenuOpen = (event, index) => {
|
|
90
71
|
setAnchorEl(event.currentTarget);
|
|
91
72
|
setOpenMenuIndex(index);
|
|
92
73
|
};
|
|
93
|
-
|
|
74
|
+
const handleMenuClose = () => {
|
|
94
75
|
setAnchorEl(null);
|
|
95
76
|
setOpenMenuIndex(null);
|
|
96
77
|
};
|
|
97
|
-
|
|
78
|
+
const handleItemClick = item => {
|
|
98
79
|
if (item.href) {
|
|
99
80
|
if (item.serverSide) {
|
|
100
81
|
window.location.href = item.href;
|
|
@@ -116,17 +97,10 @@ var ProjectTopbar = function ProjectTopbar(_ref) {
|
|
|
116
97
|
};
|
|
117
98
|
|
|
118
99
|
// Logout related code starts
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
var handleOpen = function handleOpen() {
|
|
124
|
-
return setOpen(true);
|
|
125
|
-
};
|
|
126
|
-
var handleClose = function handleClose() {
|
|
127
|
-
return setOpen(false);
|
|
128
|
-
};
|
|
129
|
-
var logout = function logout() {
|
|
100
|
+
const [open, setOpen] = (0, _react.useState)(false);
|
|
101
|
+
const handleOpen = () => setOpen(true);
|
|
102
|
+
const handleClose = () => setOpen(false);
|
|
103
|
+
const logout = () => {
|
|
130
104
|
onLogout();
|
|
131
105
|
setOpen(false);
|
|
132
106
|
};
|
|
@@ -183,67 +157,61 @@ var ProjectTopbar = function ProjectTopbar(_ref) {
|
|
|
183
157
|
}, updatedActions && /*#__PURE__*/_react.default.createElement(_system.Box, null, /*#__PURE__*/_react.default.createElement(_material.Stack, {
|
|
184
158
|
direction: "row",
|
|
185
159
|
spacing: 1
|
|
186
|
-
}, updatedActions.map(
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
160
|
+
}, updatedActions.map((action, index) => /*#__PURE__*/_react.default.createElement("div", {
|
|
161
|
+
key: action.title
|
|
162
|
+
}, /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
163
|
+
variant: "text",
|
|
164
|
+
startIcon: action.icon,
|
|
165
|
+
endIcon: action.dropdown ? /*#__PURE__*/_react.default.createElement(_reactFeather.ChevronDown, {
|
|
166
|
+
size: "0.9rem"
|
|
167
|
+
}) : null,
|
|
168
|
+
onClick: event => action.dropdown ? handleMenuOpen(event, index) : handleItemClick(action)
|
|
169
|
+
}, /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
170
|
+
style: {
|
|
171
|
+
fontWeight: "600"
|
|
172
|
+
}
|
|
173
|
+
}, action.title)), action.dropdown && /*#__PURE__*/_react.default.createElement(_material.Menu, {
|
|
174
|
+
anchorEl: anchorEl,
|
|
175
|
+
open: openMenuIndex === index,
|
|
176
|
+
onClose: () => {
|
|
177
|
+
setOpenMenuIndex(null);
|
|
178
|
+
handleMenuClose();
|
|
179
|
+
}
|
|
180
|
+
}, action.dropdown.map((item, index) => /*#__PURE__*/_react.default.createElement("div", {
|
|
181
|
+
key: item.title,
|
|
182
|
+
onClick: () => {
|
|
183
|
+
if (item.clickable) {
|
|
184
|
+
handleItemClick(item);
|
|
208
185
|
}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
}, item.title), item.subtitle && /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
239
|
-
variant: "body2",
|
|
240
|
-
color: "#ACACAC",
|
|
241
|
-
sx: {
|
|
242
|
-
marginLeft: "5px"
|
|
243
|
-
}
|
|
244
|
-
}, item.subtitle)), item.divider && index !== action.dropdown.length - 1 && /*#__PURE__*/_react.default.createElement(_material.Divider, null)), item.divider && index === action.dropdown.length - 1 && /*#__PURE__*/_react.default.createElement(_material.Divider, null));
|
|
245
|
-
})));
|
|
246
|
-
})))), /*#__PURE__*/_react.default.createElement(_system.Box, {
|
|
186
|
+
handleMenuClose();
|
|
187
|
+
},
|
|
188
|
+
style: {
|
|
189
|
+
margin: "10px",
|
|
190
|
+
paddingRight: "10px",
|
|
191
|
+
cursor: item.clickable ? "pointer" : "default",
|
|
192
|
+
backgroundColor: item.heading ? "transparent" : "transparent"
|
|
193
|
+
}
|
|
194
|
+
}, item.heading ? /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
195
|
+
variant: "subtitle1",
|
|
196
|
+
style: {
|
|
197
|
+
fontWeight: 600
|
|
198
|
+
}
|
|
199
|
+
}, item.title) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
200
|
+
style: {
|
|
201
|
+
display: "flex",
|
|
202
|
+
flexDirection: "column"
|
|
203
|
+
}
|
|
204
|
+
}, /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
205
|
+
style: {
|
|
206
|
+
fontWeight: item.clickable || item.heading ? 600 : 400
|
|
207
|
+
}
|
|
208
|
+
}, item.title), item.subtitle && /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
209
|
+
variant: "body2",
|
|
210
|
+
color: "#ACACAC",
|
|
211
|
+
sx: {
|
|
212
|
+
marginLeft: "5px"
|
|
213
|
+
}
|
|
214
|
+
}, item.subtitle)), item.divider && index !== action.dropdown.length - 1 && /*#__PURE__*/_react.default.createElement(_material.Divider, null)), item.divider && index === action.dropdown.length - 1 && /*#__PURE__*/_react.default.createElement(_material.Divider, null))))))))), /*#__PURE__*/_react.default.createElement(_system.Box, {
|
|
247
215
|
className: "Right",
|
|
248
216
|
sx: {
|
|
249
217
|
justifySelf: "right",
|
|
@@ -271,14 +239,14 @@ var ProjectTopbar = function ProjectTopbar(_ref) {
|
|
|
271
239
|
sx: {
|
|
272
240
|
fontSize: "12px"
|
|
273
241
|
}
|
|
274
|
-
}, announcement.message) : announcement.message),
|
|
242
|
+
}, announcement.message) : announcement.message), loggedInUser?.role?.id === 1 && /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
275
243
|
variant: "text",
|
|
276
244
|
startIcon: /*#__PURE__*/_react.default.createElement(_reactFeather.Settings, {
|
|
277
245
|
size: "1rem"
|
|
278
246
|
})
|
|
279
247
|
// onClick={() => (window.location.href = "/admin/users")}
|
|
280
248
|
,
|
|
281
|
-
onClick:
|
|
249
|
+
onClick: () => {
|
|
282
250
|
window.location.href = "/admin/users";
|
|
283
251
|
}
|
|
284
252
|
}, /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
@@ -291,7 +259,7 @@ var ProjectTopbar = function ProjectTopbar(_ref) {
|
|
|
291
259
|
startIcon: /*#__PURE__*/_react.default.createElement(_fi.FiInfo, {
|
|
292
260
|
size: "1rem"
|
|
293
261
|
}),
|
|
294
|
-
onClick:
|
|
262
|
+
onClick: () => {
|
|
295
263
|
window.open("/about", "_blank");
|
|
296
264
|
}
|
|
297
265
|
}, /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
@@ -334,5 +302,4 @@ var ProjectTopbar = function ProjectTopbar(_ref) {
|
|
|
334
302
|
}, /*#__PURE__*/_react.default.createElement(_text.default, null, "Log out"))))));
|
|
335
303
|
};
|
|
336
304
|
ProjectTopbar.propTypes = {};
|
|
337
|
-
var _default = ProjectTopbar;
|
|
338
|
-
exports.default = _default;
|
|
305
|
+
var _default = exports.default = ProjectTopbar;
|