tenjin-ui-kit 0.3.60 → 0.3.61
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.
|
@@ -1,25 +1,20 @@
|
|
|
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
|
});
|
|
7
6
|
exports.default = void 0;
|
|
8
7
|
var _material = require("@mui/material");
|
|
9
8
|
var _system = require("@mui/system");
|
|
10
|
-
var
|
|
11
|
-
var _button = _interopRequireDefault(require("../../button"));
|
|
12
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _react = require("react");
|
|
13
10
|
var _reactFeather = require("react-feather");
|
|
11
|
+
var _fi = require("react-icons/fi");
|
|
14
12
|
var _reactRouter = require("react-router");
|
|
13
|
+
var _tenjin40Logo = _interopRequireDefault(require("../../../assets/images/tenjin-4.0-logo.png"));
|
|
14
|
+
var _button = _interopRequireDefault(require("../../button"));
|
|
15
15
|
var _modal = _interopRequireDefault(require("../../modal"));
|
|
16
16
|
var _text = _interopRequireDefault(require("../../text"));
|
|
17
|
-
var
|
|
18
|
-
var _tenjin40Logo = _interopRequireDefault(require("../../../assets/images/tenjin-4.0-logo.png"));
|
|
19
|
-
var _fi = require("react-icons/fi");
|
|
20
|
-
var _bs = require("react-icons/bs");
|
|
21
|
-
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); }
|
|
22
|
-
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
|
+
var _UserAvatar = _interopRequireDefault(require("./UserAvatar"));
|
|
23
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
24
19
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
25
20
|
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."); }
|
|
@@ -31,6 +26,8 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
31
26
|
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; }
|
|
32
27
|
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; } }
|
|
33
28
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
29
|
+
// import { BsChatRightText } from "react-icons/bs";
|
|
30
|
+
|
|
34
31
|
var ANNOUNCEMENT_TYPES = {
|
|
35
32
|
success: {
|
|
36
33
|
backgroundColor: "#EDF7ED",
|
|
@@ -77,14 +74,12 @@ var ProjectTopbar = function ProjectTopbar(_ref) {
|
|
|
77
74
|
setOpenMenuIndex = _useState4[1];
|
|
78
75
|
var updatedActions = (0, _react.useMemo)(function () {
|
|
79
76
|
var base = _toConsumableArray(actions);
|
|
80
|
-
if (isChatEnabled) {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
});
|
|
87
|
-
}
|
|
77
|
+
// if (isChatEnabled) {
|
|
78
|
+
// base.push({
|
|
79
|
+
// icon: <BsChatRightText size="12px" />,
|
|
80
|
+
// title: "Tenjin Chat Bot",
|
|
81
|
+
// });
|
|
82
|
+
// }
|
|
88
83
|
return base;
|
|
89
84
|
}, [actions, isChatEnabled]);
|
|
90
85
|
var navigate = (0, _reactRouter.useNavigate)();
|
|
@@ -105,15 +100,16 @@ var ProjectTopbar = function ProjectTopbar(_ref) {
|
|
|
105
100
|
}
|
|
106
101
|
} else if (item.onClick) {
|
|
107
102
|
item.onClick();
|
|
108
|
-
} else {
|
|
109
|
-
if (localStorage.getItem("chatBot")) {
|
|
110
|
-
localStorage.removeItem("chatBot");
|
|
111
|
-
window.dispatchEvent(new Event("chatBotUpdate"));
|
|
112
|
-
} else {
|
|
113
|
-
localStorage.setItem("chatBot", "true");
|
|
114
|
-
window.dispatchEvent(new Event("chatBotUpdate"));
|
|
115
|
-
}
|
|
116
103
|
}
|
|
104
|
+
// else {
|
|
105
|
+
// if (localStorage.getItem("chatBot")) {
|
|
106
|
+
// localStorage.removeItem("chatBot");
|
|
107
|
+
// window.dispatchEvent(new Event("chatBotUpdate"));
|
|
108
|
+
// } else {
|
|
109
|
+
// localStorage.setItem("chatBot", "true");
|
|
110
|
+
// window.dispatchEvent(new Event("chatBotUpdate"));
|
|
111
|
+
// }
|
|
112
|
+
// }
|
|
117
113
|
};
|
|
118
114
|
|
|
119
115
|
// Logout related code starts
|
|
@@ -133,7 +129,7 @@ var ProjectTopbar = function ProjectTopbar(_ref) {
|
|
|
133
129
|
};
|
|
134
130
|
// Logout related code ends
|
|
135
131
|
|
|
136
|
-
return /*#__PURE__*/
|
|
132
|
+
return /*#__PURE__*/React.createElement(_material.Paper, null, /*#__PURE__*/React.createElement(_material.AppBar, {
|
|
137
133
|
position: "static",
|
|
138
134
|
sx: {
|
|
139
135
|
boxShadow: "0px 3px 10px rgba(102, 124, 188, 0.25) !important",
|
|
@@ -141,7 +137,7 @@ var ProjectTopbar = function ProjectTopbar(_ref) {
|
|
|
141
137
|
height: "48px !important",
|
|
142
138
|
justifyContent: "center"
|
|
143
139
|
}
|
|
144
|
-
}, /*#__PURE__*/
|
|
140
|
+
}, /*#__PURE__*/React.createElement(_material.Toolbar, null, /*#__PURE__*/React.createElement(_system.Box, {
|
|
145
141
|
sx: {
|
|
146
142
|
display: "flex",
|
|
147
143
|
justifyContent: "space-between",
|
|
@@ -149,20 +145,20 @@ var ProjectTopbar = function ProjectTopbar(_ref) {
|
|
|
149
145
|
alignItems: "center",
|
|
150
146
|
alignContent: "center"
|
|
151
147
|
}
|
|
152
|
-
}, /*#__PURE__*/
|
|
148
|
+
}, /*#__PURE__*/React.createElement(_system.Box, {
|
|
153
149
|
className: "Left",
|
|
154
150
|
sx: {
|
|
155
151
|
display: "flex",
|
|
156
152
|
flexDirection: "row",
|
|
157
153
|
alignItems: "center"
|
|
158
154
|
}
|
|
159
|
-
}, /*#__PURE__*/
|
|
155
|
+
}, /*#__PURE__*/React.createElement("a", {
|
|
160
156
|
href: hrefLink || "/home/projects/recentprojects",
|
|
161
157
|
style: {
|
|
162
158
|
marginRight: "1rem",
|
|
163
159
|
textDecoration: "none"
|
|
164
160
|
}
|
|
165
|
-
}, /*#__PURE__*/
|
|
161
|
+
}, /*#__PURE__*/React.createElement(_system.Box, {
|
|
166
162
|
sx: {
|
|
167
163
|
width: homeIcon ? 100 : 35,
|
|
168
164
|
height: homeIcon ? 90 : 30,
|
|
@@ -172,35 +168,35 @@ var ProjectTopbar = function ProjectTopbar(_ref) {
|
|
|
172
168
|
height: "inherit"
|
|
173
169
|
}
|
|
174
170
|
}
|
|
175
|
-
}, /*#__PURE__*/
|
|
171
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
176
172
|
src: homeIcon || _tenjin40Logo.default,
|
|
177
173
|
alt: "app png logo"
|
|
178
|
-
})))), /*#__PURE__*/
|
|
174
|
+
})))), /*#__PURE__*/React.createElement(_system.Box, {
|
|
179
175
|
className: "Center",
|
|
180
176
|
sx: {
|
|
181
177
|
marginRight: "auto",
|
|
182
178
|
color: "black"
|
|
183
179
|
}
|
|
184
|
-
}, updatedActions && /*#__PURE__*/
|
|
180
|
+
}, updatedActions && /*#__PURE__*/React.createElement(_system.Box, null, /*#__PURE__*/React.createElement(_material.Stack, {
|
|
185
181
|
direction: "row",
|
|
186
182
|
spacing: 1
|
|
187
183
|
}, updatedActions.map(function (action, index) {
|
|
188
|
-
return /*#__PURE__*/
|
|
184
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
189
185
|
key: action.title
|
|
190
|
-
}, /*#__PURE__*/
|
|
186
|
+
}, /*#__PURE__*/React.createElement(_button.default, {
|
|
191
187
|
variant: "text",
|
|
192
188
|
startIcon: action.icon,
|
|
193
|
-
endIcon: action.dropdown ? /*#__PURE__*/
|
|
189
|
+
endIcon: action.dropdown ? /*#__PURE__*/React.createElement(_reactFeather.ChevronDown, {
|
|
194
190
|
size: "0.9rem"
|
|
195
191
|
}) : null,
|
|
196
192
|
onClick: function onClick(event) {
|
|
197
193
|
return action.dropdown ? handleMenuOpen(event, index) : handleItemClick(action);
|
|
198
194
|
}
|
|
199
|
-
}, /*#__PURE__*/
|
|
195
|
+
}, /*#__PURE__*/React.createElement(_text.default, {
|
|
200
196
|
style: {
|
|
201
197
|
fontWeight: "600"
|
|
202
198
|
}
|
|
203
|
-
}, action.title)), action.dropdown && /*#__PURE__*/
|
|
199
|
+
}, action.title)), action.dropdown && /*#__PURE__*/React.createElement(_material.Menu, {
|
|
204
200
|
anchorEl: anchorEl,
|
|
205
201
|
open: openMenuIndex === index,
|
|
206
202
|
onClose: function onClose() {
|
|
@@ -208,7 +204,7 @@ var ProjectTopbar = function ProjectTopbar(_ref) {
|
|
|
208
204
|
handleMenuClose();
|
|
209
205
|
}
|
|
210
206
|
}, action.dropdown.map(function (item, index) {
|
|
211
|
-
return /*#__PURE__*/
|
|
207
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
212
208
|
key: item.title,
|
|
213
209
|
onClick: function onClick() {
|
|
214
210
|
if (item.clickable) {
|
|
@@ -222,29 +218,29 @@ var ProjectTopbar = function ProjectTopbar(_ref) {
|
|
|
222
218
|
cursor: item.clickable ? "pointer" : "default",
|
|
223
219
|
backgroundColor: item.heading ? "transparent" : "transparent"
|
|
224
220
|
}
|
|
225
|
-
}, item.heading ? /*#__PURE__*/
|
|
221
|
+
}, item.heading ? /*#__PURE__*/React.createElement(_text.default, {
|
|
226
222
|
variant: "subtitle1",
|
|
227
223
|
style: {
|
|
228
224
|
fontWeight: 600
|
|
229
225
|
}
|
|
230
|
-
}, item.title) : /*#__PURE__*/
|
|
226
|
+
}, item.title) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
231
227
|
style: {
|
|
232
228
|
display: "flex",
|
|
233
229
|
flexDirection: "column"
|
|
234
230
|
}
|
|
235
|
-
}, /*#__PURE__*/
|
|
231
|
+
}, /*#__PURE__*/React.createElement(_text.default, {
|
|
236
232
|
style: {
|
|
237
233
|
fontWeight: item.clickable || item.heading ? 600 : 400
|
|
238
234
|
}
|
|
239
|
-
}, item.title), item.subtitle && /*#__PURE__*/
|
|
235
|
+
}, item.title), item.subtitle && /*#__PURE__*/React.createElement(_text.default, {
|
|
240
236
|
variant: "body2",
|
|
241
237
|
color: "#ACACAC",
|
|
242
238
|
sx: {
|
|
243
239
|
marginLeft: "5px"
|
|
244
240
|
}
|
|
245
|
-
}, item.subtitle)), item.divider && index !== action.dropdown.length - 1 && /*#__PURE__*/
|
|
241
|
+
}, item.subtitle)), item.divider && index !== action.dropdown.length - 1 && /*#__PURE__*/React.createElement(_material.Divider, null)), item.divider && index === action.dropdown.length - 1 && /*#__PURE__*/React.createElement(_material.Divider, null));
|
|
246
242
|
})));
|
|
247
|
-
})))), /*#__PURE__*/
|
|
243
|
+
})))), /*#__PURE__*/React.createElement(_system.Box, {
|
|
248
244
|
className: "Right",
|
|
249
245
|
sx: {
|
|
250
246
|
justifySelf: "right",
|
|
@@ -252,7 +248,7 @@ var ProjectTopbar = function ProjectTopbar(_ref) {
|
|
|
252
248
|
},
|
|
253
249
|
display: "flex",
|
|
254
250
|
alignItems: "center"
|
|
255
|
-
}, announcement && /*#__PURE__*/
|
|
251
|
+
}, announcement && /*#__PURE__*/React.createElement(_system.Box, {
|
|
256
252
|
sx: {
|
|
257
253
|
backgroundColor: ANNOUNCEMENT_TYPES[announcement.type].backgroundColor,
|
|
258
254
|
borderLeft: ANNOUNCEMENT_TYPES[announcement.type].borderLeft,
|
|
@@ -268,13 +264,13 @@ var ProjectTopbar = function ProjectTopbar(_ref) {
|
|
|
268
264
|
alignItems: "center",
|
|
269
265
|
fontSize: "12px"
|
|
270
266
|
}
|
|
271
|
-
}, typeof announcement.message === "string" ? /*#__PURE__*/
|
|
267
|
+
}, typeof announcement.message === "string" ? /*#__PURE__*/React.createElement(_text.default, {
|
|
272
268
|
sx: {
|
|
273
269
|
fontSize: "12px"
|
|
274
270
|
}
|
|
275
|
-
}, announcement.message) : announcement.message), (loggedInUser === null || loggedInUser === void 0 ? void 0 : (_loggedInUser$role = loggedInUser.role) === null || _loggedInUser$role === void 0 ? void 0 : _loggedInUser$role.id) === 1 && /*#__PURE__*/
|
|
271
|
+
}, announcement.message) : announcement.message), (loggedInUser === null || loggedInUser === void 0 ? void 0 : (_loggedInUser$role = loggedInUser.role) === null || _loggedInUser$role === void 0 ? void 0 : _loggedInUser$role.id) === 1 && /*#__PURE__*/React.createElement(_button.default, {
|
|
276
272
|
variant: "text",
|
|
277
|
-
startIcon: /*#__PURE__*/
|
|
273
|
+
startIcon: /*#__PURE__*/React.createElement(_reactFeather.Settings, {
|
|
278
274
|
size: "1rem"
|
|
279
275
|
})
|
|
280
276
|
// onClick={() => (window.location.href = "/admin/users")}
|
|
@@ -282,40 +278,40 @@ var ProjectTopbar = function ProjectTopbar(_ref) {
|
|
|
282
278
|
onClick: function onClick() {
|
|
283
279
|
window.location.href = "/admin/users";
|
|
284
280
|
}
|
|
285
|
-
}, /*#__PURE__*/
|
|
281
|
+
}, /*#__PURE__*/React.createElement(_text.default, {
|
|
286
282
|
variant: "subtitle1",
|
|
287
283
|
style: {
|
|
288
284
|
fontWeight: "600"
|
|
289
285
|
}
|
|
290
|
-
}, "Administration")), /*#__PURE__*/
|
|
286
|
+
}, "Administration")), /*#__PURE__*/React.createElement(_button.default, {
|
|
291
287
|
variant: "text",
|
|
292
|
-
startIcon: /*#__PURE__*/
|
|
288
|
+
startIcon: /*#__PURE__*/React.createElement(_fi.FiInfo, {
|
|
293
289
|
size: "1rem"
|
|
294
290
|
}),
|
|
295
291
|
onClick: function onClick() {
|
|
296
292
|
window.open("/about", "_blank");
|
|
297
293
|
}
|
|
298
|
-
}, /*#__PURE__*/
|
|
294
|
+
}, /*#__PURE__*/React.createElement(_text.default, {
|
|
299
295
|
variant: "subtitle1",
|
|
300
296
|
style: {
|
|
301
297
|
fontWeight: "600"
|
|
302
298
|
}
|
|
303
|
-
}, "About")), /*#__PURE__*/
|
|
299
|
+
}, "About")), /*#__PURE__*/React.createElement(_system.Box, {
|
|
304
300
|
sx: {
|
|
305
301
|
marginLeft: theme.spacing(1)
|
|
306
302
|
}
|
|
307
|
-
}, /*#__PURE__*/
|
|
303
|
+
}, /*#__PURE__*/React.createElement(_UserAvatar.default, {
|
|
308
304
|
loggedInUser: loggedInUser,
|
|
309
305
|
onLogout: handleOpen,
|
|
310
306
|
onViewProfileClick: onViewProfileClick,
|
|
311
307
|
avatarItems: avatarItems
|
|
312
|
-
})))))), /*#__PURE__*/
|
|
308
|
+
})))))), /*#__PURE__*/React.createElement(_modal.default, {
|
|
313
309
|
title: "Log out",
|
|
314
310
|
open: open,
|
|
315
311
|
handleClose: handleClose,
|
|
316
312
|
onClose: handleClose,
|
|
317
313
|
width: "sm"
|
|
318
|
-
}, /*#__PURE__*/
|
|
314
|
+
}, /*#__PURE__*/React.createElement(_text.default, null, "Are you sure you want to log out?"), /*#__PURE__*/React.createElement(_material.Grid, {
|
|
319
315
|
container: true,
|
|
320
316
|
direction: "row",
|
|
321
317
|
justifyContent: "flex-end",
|
|
@@ -323,16 +319,16 @@ var ProjectTopbar = function ProjectTopbar(_ref) {
|
|
|
323
319
|
style: {
|
|
324
320
|
padding: "3rem 0rem 0rem 4rem"
|
|
325
321
|
}
|
|
326
|
-
}, /*#__PURE__*/
|
|
322
|
+
}, /*#__PURE__*/React.createElement(_material.Stack, {
|
|
327
323
|
direction: "row",
|
|
328
324
|
spacing: 2
|
|
329
|
-
}, /*#__PURE__*/
|
|
325
|
+
}, /*#__PURE__*/React.createElement(_button.default, {
|
|
330
326
|
variant: "outlined",
|
|
331
327
|
onClick: handleClose
|
|
332
|
-
}, /*#__PURE__*/
|
|
328
|
+
}, /*#__PURE__*/React.createElement(_text.default, null, "Cancel")), /*#__PURE__*/React.createElement(_button.default, {
|
|
333
329
|
color: "error",
|
|
334
330
|
onClick: logout
|
|
335
|
-
}, /*#__PURE__*/
|
|
331
|
+
}, /*#__PURE__*/React.createElement(_text.default, null, "Log out"))))));
|
|
336
332
|
};
|
|
337
333
|
ProjectTopbar.propTypes = {};
|
|
338
334
|
var _default = ProjectTopbar;
|