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
|
@@ -5,64 +5,60 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _material = require("@mui/material");
|
|
8
|
-
var
|
|
8
|
+
var _clsx4 = _interopRequireDefault(require("clsx"));
|
|
9
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _reactRouterDom = require("react-router-dom");
|
|
12
12
|
var _ = require("..");
|
|
13
13
|
var _style = _interopRequireDefault(require("./style"));
|
|
14
14
|
var _text = _interopRequireDefault(require("../../text"));
|
|
15
|
-
function
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
[classes.collapsedFlatMenuItemText]: collapsed,
|
|
60
|
-
[classes.selectedFlatMenuItemText]: selectedSidebarKey === i.key
|
|
61
|
-
}),
|
|
62
|
-
disableTypography: true
|
|
63
|
-
}, /*#__PURE__*/_react.default.createElement(_text.default, null, i.display)))))) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null);
|
|
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 _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); }
|
|
19
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
20
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
21
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
22
|
+
var FlatMenu = function FlatMenu(_ref) {
|
|
23
|
+
var items = _ref.items;
|
|
24
|
+
var _useContext = (0, _react.useContext)(_.LayoutContext),
|
|
25
|
+
_useContext$layoutSta = _useContext.layoutState,
|
|
26
|
+
collapsed = _useContext$layoutSta.sidebarCollapsed,
|
|
27
|
+
selectedSidebarKey = _useContext$layoutSta.selectedSidebarKey,
|
|
28
|
+
setSelectedSidebarKey = _useContext.setSelectedSidebarKey;
|
|
29
|
+
var classes = (0, _style.default)();
|
|
30
|
+
return items ? /*#__PURE__*/_react.default.createElement(_material.List, null, items.map(function (i, index) {
|
|
31
|
+
var _clsx, _clsx2, _clsx3;
|
|
32
|
+
return /*#__PURE__*/_react.default.createElement(_material.Tooltip, {
|
|
33
|
+
key: index,
|
|
34
|
+
title: collapsed ? i.display : null,
|
|
35
|
+
placement: "right"
|
|
36
|
+
}, /*#__PURE__*/_react.default.createElement(_material.ListItemButton, {
|
|
37
|
+
disableRipple: true,
|
|
38
|
+
disableTouchRipple: true,
|
|
39
|
+
key: index,
|
|
40
|
+
selected: selectedSidebarKey === i.key,
|
|
41
|
+
className: (0, _clsx4.default)((_clsx = {}, _defineProperty(_clsx, classes.flatMenuItem, true), _defineProperty(_clsx, classes.collapsedFlatMenuItem, collapsed), _clsx))
|
|
42
|
+
// component={i.serverSide ? "a" : Link}
|
|
43
|
+
// href={i.href}
|
|
44
|
+
// to={i.href}
|
|
45
|
+
,
|
|
46
|
+
onClick: function onClick() {
|
|
47
|
+
return setSelectedSidebarKey(i.key);
|
|
48
|
+
},
|
|
49
|
+
classes: {
|
|
50
|
+
selected: classes.selectedFlatMenuItem
|
|
51
|
+
}
|
|
52
|
+
}, /*#__PURE__*/_react.default.createElement(_material.ListItemIcon, {
|
|
53
|
+
className: (0, _clsx4.default)((_clsx2 = {}, _defineProperty(_clsx2, classes.listItemText, true), _defineProperty(_clsx2, classes.flatMenuItemIcon, true), _defineProperty(_clsx2, classes.selectedFlatMenuIcon, selectedSidebarKey === i.key), _clsx2))
|
|
54
|
+
}, i.icon), /*#__PURE__*/_react.default.createElement(_material.ListItemText, {
|
|
55
|
+
className: (0, _clsx4.default)((_clsx3 = {}, _defineProperty(_clsx3, classes.listItemText, true), _defineProperty(_clsx3, classes.collapsedFlatMenuItemText, collapsed), _defineProperty(_clsx3, classes.selectedFlatMenuItemText, selectedSidebarKey === i.key), _clsx3)),
|
|
56
|
+
disableTypography: true
|
|
57
|
+
}, /*#__PURE__*/_react.default.createElement(_text.default, null, i.display))));
|
|
58
|
+
})) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null);
|
|
64
59
|
};
|
|
65
60
|
FlatMenu.propTypes = {
|
|
66
61
|
items: _propTypes.default.array.isRequired
|
|
67
62
|
};
|
|
68
|
-
var _default =
|
|
63
|
+
var _default = FlatMenu;
|
|
64
|
+
exports.default = _default;
|
|
@@ -1,80 +1,97 @@
|
|
|
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
|
});
|
|
6
7
|
exports.default = void 0;
|
|
7
8
|
var _material = require("@mui/material");
|
|
8
|
-
var
|
|
9
|
+
var _clsx2 = _interopRequireDefault(require("clsx"));
|
|
9
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
12
|
var _reactRouterDom = require("react-router-dom");
|
|
12
13
|
var _style = _interopRequireDefault(require("./style"));
|
|
13
14
|
var _text = _interopRequireDefault(require("../../text"));
|
|
14
15
|
var _ = require("..");
|
|
15
|
-
function
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
selected: selected
|
|
49
|
-
}));
|
|
50
|
-
};
|
|
51
|
-
const handleClose = () => {
|
|
52
|
-
setselectedItem(prev => ({
|
|
53
|
-
...prev,
|
|
16
|
+
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); }
|
|
17
|
+
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; }
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
20
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
21
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
22
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
23
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
24
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
25
|
+
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."); }
|
|
26
|
+
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); }
|
|
27
|
+
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; }
|
|
28
|
+
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; } }
|
|
29
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
30
|
+
var GroupedIconMenu = function GroupedIconMenu(_ref) {
|
|
31
|
+
var groups = _ref.groups,
|
|
32
|
+
icon = _ref.icon,
|
|
33
|
+
title = _ref.title,
|
|
34
|
+
pointer = _ref.pointer,
|
|
35
|
+
href = _ref.href;
|
|
36
|
+
var classes = (0, _style.default)();
|
|
37
|
+
var popupRef = (0, _react.useRef)(null);
|
|
38
|
+
var navigate = (0, _reactRouterDom.useNavigate)();
|
|
39
|
+
var _useContext = (0, _react.useContext)(_.LayoutContext),
|
|
40
|
+
_useContext$layoutSta = _useContext.layoutState,
|
|
41
|
+
collapsed = _useContext$layoutSta.sidebarCollapsed,
|
|
42
|
+
selectedSidebarKey = _useContext$layoutSta.selectedSidebarKey,
|
|
43
|
+
setSelectedSidebarKey = _useContext.setSelectedSidebarKey;
|
|
44
|
+
var _useState = (0, _react.useState)({}),
|
|
45
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
46
|
+
selectedCollapsedSidebar = _useState2[0],
|
|
47
|
+
setselectedCollapsedSidebar = _useState2[1];
|
|
48
|
+
var _useState3 = (0, _react.useState)({
|
|
54
49
|
index: null,
|
|
55
|
-
open: false
|
|
56
|
-
|
|
57
|
-
|
|
50
|
+
open: false
|
|
51
|
+
}),
|
|
52
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
53
|
+
selectedItem = _useState4[0],
|
|
54
|
+
setselectedItem = _useState4[1];
|
|
55
|
+
var handleClick = function handleClick(event, index, selected) {
|
|
56
|
+
setselectedItem(function (prev) {
|
|
57
|
+
return _objectSpread(_objectSpread({}, prev), {}, {
|
|
58
|
+
index: index,
|
|
59
|
+
open: true,
|
|
60
|
+
anchorE1: event.currentTarget,
|
|
61
|
+
selected: selected
|
|
62
|
+
});
|
|
63
|
+
});
|
|
58
64
|
};
|
|
59
|
-
|
|
65
|
+
var handleClose = function handleClose() {
|
|
66
|
+
setselectedItem(function (prev) {
|
|
67
|
+
return _objectSpread(_objectSpread({}, prev), {}, {
|
|
68
|
+
index: null,
|
|
69
|
+
open: false,
|
|
70
|
+
anchorE1: null
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
(0, _react.useEffect)(function () {
|
|
60
75
|
function handleClickOutside(event) {
|
|
61
76
|
if (popupRef.current && !popupRef.current.contains(event.target)) {
|
|
62
77
|
handleClose();
|
|
63
78
|
}
|
|
64
79
|
}
|
|
65
80
|
document.addEventListener("mousedown", handleClickOutside);
|
|
66
|
-
return ()
|
|
81
|
+
return function () {
|
|
67
82
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
68
83
|
};
|
|
69
84
|
}, [popupRef]);
|
|
70
|
-
|
|
85
|
+
var theme = (0, _material.useTheme)();
|
|
71
86
|
return groups ? /*#__PURE__*/_react.default.createElement("div", {
|
|
72
87
|
className: classes.projectMenuMainWrapper
|
|
73
88
|
}, /*#__PURE__*/_react.default.createElement("div", null, !collapsed && /*#__PURE__*/_react.default.createElement("div", {
|
|
74
89
|
style: {
|
|
75
90
|
cursor: pointer && "pointer"
|
|
76
91
|
},
|
|
77
|
-
onClick: ()
|
|
92
|
+
onClick: function onClick() {
|
|
93
|
+
return window.location = href;
|
|
94
|
+
}
|
|
78
95
|
}, /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
79
96
|
className: classes.projectMenuHeader,
|
|
80
97
|
fontWeight: 600,
|
|
@@ -86,136 +103,144 @@ const GroupedIconMenu = _ref => {
|
|
|
86
103
|
marginRight: "0.5rem",
|
|
87
104
|
paddingTop: "0.2rem"
|
|
88
105
|
}
|
|
89
|
-
}, icon), title))), /*#__PURE__*/_react.default.createElement("div", null, groups.map((group, index)
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
position: "relative",
|
|
95
|
-
width: "100%",
|
|
96
|
-
height: "100%"
|
|
97
|
-
},
|
|
98
|
-
subheader: /*#__PURE__*/_react.default.createElement(_material.ListSubheader, {
|
|
99
|
-
className: "sidebar",
|
|
106
|
+
}, icon), title))), /*#__PURE__*/_react.default.createElement("div", null, groups.map(function (group, index) {
|
|
107
|
+
var _group$items$filter$, _group$items$filter$2, _clsx, _group$groupName, _group$groupName2;
|
|
108
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
109
|
+
key: group.groupName
|
|
110
|
+
}, /*#__PURE__*/_react.default.createElement(_material.List, {
|
|
100
111
|
sx: {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
marginTop: !collapsed && (index == 0 ? "0rem" : "1rem"),
|
|
106
|
-
padding: !collapsed ? "0.8rem 0rem" : 0,
|
|
107
|
-
justifyContent: collapsed && "center",
|
|
108
|
-
alignItems: "center"
|
|
109
|
-
}
|
|
110
|
-
}, collapsed ? /*#__PURE__*/_react.default.createElement("div", {
|
|
111
|
-
className: "buttonIcon"
|
|
112
|
-
}, /*#__PURE__*/_react.default.createElement(_material.Tooltip, {
|
|
113
|
-
key: index,
|
|
114
|
-
title: collapsed ? group.groupName : null,
|
|
115
|
-
placement: "right"
|
|
116
|
-
}, /*#__PURE__*/_react.default.createElement(_material.ListItemButton, {
|
|
117
|
-
id: "account-button",
|
|
118
|
-
selected: group?.items.filter(item => item.key === selectedSidebarKey)[0]?.key === selectedSidebarKey,
|
|
119
|
-
classes: {
|
|
120
|
-
selected: classes.selectedProjectMenuItem
|
|
112
|
+
display: "inline-block",
|
|
113
|
+
position: "relative",
|
|
114
|
+
width: "100%",
|
|
115
|
+
height: "100%"
|
|
121
116
|
},
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
117
|
+
subheader: /*#__PURE__*/_react.default.createElement(_material.ListSubheader, {
|
|
118
|
+
className: "sidebar",
|
|
119
|
+
sx: {
|
|
120
|
+
// padding: 0,
|
|
121
|
+
display: "flex",
|
|
122
|
+
fontWeight: 600,
|
|
123
|
+
lineHeight: collapsed && 0,
|
|
124
|
+
marginTop: !collapsed && (index == 0 ? "0rem" : "1rem"),
|
|
125
|
+
padding: !collapsed ? "0.8rem 0rem" : 0,
|
|
126
|
+
justifyContent: collapsed && "center",
|
|
127
|
+
alignItems: "center"
|
|
128
|
+
}
|
|
129
|
+
}, collapsed ? /*#__PURE__*/_react.default.createElement("div", {
|
|
130
|
+
className: "buttonIcon"
|
|
131
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Tooltip, {
|
|
132
|
+
key: index,
|
|
133
|
+
title: collapsed ? group.groupName : null,
|
|
134
|
+
placement: "right"
|
|
135
|
+
}, /*#__PURE__*/_react.default.createElement(_material.ListItemButton, {
|
|
136
|
+
id: "account-button",
|
|
137
|
+
selected: (group === null || group === void 0 ? void 0 : (_group$items$filter$ = group.items.filter(function (item) {
|
|
138
|
+
return item.key === selectedSidebarKey;
|
|
139
|
+
})[0]) === null || _group$items$filter$ === void 0 ? void 0 : _group$items$filter$.key) === selectedSidebarKey,
|
|
140
|
+
classes: {
|
|
141
|
+
selected: classes.selectedProjectMenuItem
|
|
142
|
+
},
|
|
143
|
+
key: selectedCollapsedSidebar === null || selectedCollapsedSidebar === void 0 ? void 0 : selectedCollapsedSidebar.key,
|
|
144
|
+
onClick: function onClick(e) {
|
|
145
|
+
selectedItem.open ? handleClose() : handleClick(e, index, group);
|
|
146
|
+
}
|
|
147
|
+
}, /*#__PURE__*/_react.default.createElement(_material.ListItemText, {
|
|
148
|
+
disableTypography: true,
|
|
149
|
+
className: (0, _clsx2.default)((_clsx = {}, _defineProperty(_clsx, classes.projectListIcon, true), _defineProperty(_clsx, "selected", {
|
|
131
150
|
color: "#fff !important"
|
|
151
|
+
}), _defineProperty(_clsx, classes.selectedProjectMenuItemIcon, (group === null || group === void 0 ? void 0 : (_group$items$filter$2 = group.items.filter(function (item) {
|
|
152
|
+
return item.key === selectedSidebarKey;
|
|
153
|
+
})[0]) === null || _group$items$filter$2 === void 0 ? void 0 : _group$items$filter$2.key) === selectedSidebarKey), _clsx))
|
|
154
|
+
}, group.icon)))) : /*#__PURE__*/_react.default.createElement("span", {
|
|
155
|
+
className: classes.subHeaderIcon
|
|
156
|
+
}, group.icon), /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
157
|
+
fontSize: theme.typography.fontSize - 2,
|
|
158
|
+
semibold: true,
|
|
159
|
+
sx: {
|
|
160
|
+
marginLeft: theme.spacing(1),
|
|
161
|
+
alignItems: "center",
|
|
162
|
+
height: "100%",
|
|
163
|
+
display: collapsed ? "none !important" : "flex"
|
|
164
|
+
}
|
|
165
|
+
}, (_group$groupName = group.groupName) === null || _group$groupName === void 0 ? void 0 : _group$groupName.toUpperCase()))
|
|
166
|
+
}, !collapsed && group.items.map(function (i) {
|
|
167
|
+
return /*#__PURE__*/_react.default.createElement(_material.ListItemButton, {
|
|
168
|
+
disableRipple: true,
|
|
169
|
+
disableTouchRipple: true,
|
|
170
|
+
component: i.serverSide ? "a" : _reactRouterDom.Link,
|
|
171
|
+
href: i.href,
|
|
172
|
+
to: i.href,
|
|
173
|
+
selected: i.key === selectedSidebarKey,
|
|
174
|
+
sidebarKey: i.key,
|
|
175
|
+
key: i.key,
|
|
176
|
+
onClick: function onClick() {
|
|
177
|
+
setSelectedSidebarKey(i.key);
|
|
178
|
+
setselectedCollapsedSidebar(i);
|
|
179
|
+
},
|
|
180
|
+
classes: {
|
|
181
|
+
selected: classes.selectedProjectMenuItem
|
|
182
|
+
}
|
|
183
|
+
}, /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
184
|
+
semibold: true,
|
|
185
|
+
sx: {
|
|
186
|
+
marginLeft: theme.spacing(1)
|
|
132
187
|
},
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
}, group.icon), /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
138
|
-
fontSize: theme.typography.fontSize - 2,
|
|
139
|
-
semibold: true,
|
|
188
|
+
fontSize: theme.typography.fontSize,
|
|
189
|
+
color: i.key === selectedSidebarKey ? "#fff" : theme.palette.primary.main
|
|
190
|
+
}, i.display));
|
|
191
|
+
})), !collapsed && index < groups.length - 1 && /*#__PURE__*/_react.default.createElement(_material.Divider, {
|
|
140
192
|
sx: {
|
|
141
|
-
|
|
142
|
-
alignItems: "center",
|
|
143
|
-
height: "100%",
|
|
144
|
-
display: collapsed ? "none !important" : "flex"
|
|
193
|
+
height: "initial !important"
|
|
145
194
|
}
|
|
146
|
-
},
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
setselectedCollapsedSidebar(i);
|
|
159
|
-
},
|
|
160
|
-
classes: {
|
|
161
|
-
selected: classes.selectedProjectMenuItem
|
|
162
|
-
}
|
|
163
|
-
}, /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
164
|
-
semibold: true,
|
|
165
|
-
sx: {
|
|
166
|
-
marginLeft: theme.spacing(1)
|
|
167
|
-
},
|
|
168
|
-
fontSize: theme.typography.fontSize,
|
|
169
|
-
color: i.key === selectedSidebarKey ? "#fff" : theme.palette.primary.main
|
|
170
|
-
}, i.display)))), !collapsed && index < groups.length - 1 && /*#__PURE__*/_react.default.createElement(_material.Divider, {
|
|
171
|
-
sx: {
|
|
172
|
-
height: "initial !important"
|
|
173
|
-
}
|
|
174
|
-
}), selectedItem.index === index && /*#__PURE__*/_react.default.createElement("div", {
|
|
175
|
-
ref: popupRef,
|
|
176
|
-
className: selectedItem.open ? classes.menuItemOpen : classes.menuItem
|
|
177
|
-
}, /*#__PURE__*/_react.default.createElement(_material.Paper, {
|
|
178
|
-
sx: {
|
|
179
|
-
width: "13rem",
|
|
180
|
-
padding: "0.7rem",
|
|
181
|
-
// maxHeight: "14.5rem",
|
|
182
|
-
// overflow: "auto !important",
|
|
183
|
-
maxHeight: "14.5rem",
|
|
184
|
-
display: "flex",
|
|
185
|
-
flexDirection: "column"
|
|
186
|
-
}
|
|
187
|
-
}, /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
188
|
-
fontWeight: "600",
|
|
189
|
-
pl: "0.3rem",
|
|
190
|
-
color: "#7D7D7D"
|
|
191
|
-
}, group.groupName?.toUpperCase()), /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
192
|
-
flex: 1,
|
|
193
|
-
height: "0px",
|
|
194
|
-
overflow: "auto"
|
|
195
|
-
}, group.items.map(i => /*#__PURE__*/_react.default.createElement(_material.ListItemText, {
|
|
196
|
-
disableTypography: true,
|
|
197
|
-
sx: {
|
|
198
|
-
color: "#44409A !important",
|
|
199
|
-
fontWeight: 600,
|
|
200
|
-
p: "0.3rem",
|
|
201
|
-
cursor: "pointer",
|
|
202
|
-
fontSize: "14px !important",
|
|
203
|
-
backgroundColor: i.key === selectedSidebarKey ? "#f5f6f7" : "none",
|
|
204
|
-
"&:hover": {
|
|
205
|
-
backgroundColor: "#f5f6f7"
|
|
195
|
+
}), selectedItem.index === index && /*#__PURE__*/_react.default.createElement("div", {
|
|
196
|
+
ref: popupRef,
|
|
197
|
+
className: selectedItem.open ? classes.menuItemOpen : classes.menuItem
|
|
198
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Paper, {
|
|
199
|
+
sx: {
|
|
200
|
+
width: "13rem",
|
|
201
|
+
padding: "0.7rem",
|
|
202
|
+
// maxHeight: "14.5rem",
|
|
203
|
+
// overflow: "auto !important",
|
|
204
|
+
maxHeight: "14.5rem",
|
|
205
|
+
display: "flex",
|
|
206
|
+
flexDirection: "column"
|
|
206
207
|
}
|
|
207
|
-
},
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
208
|
+
}, /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
209
|
+
fontWeight: "600",
|
|
210
|
+
pl: "0.3rem",
|
|
211
|
+
color: "#7D7D7D"
|
|
212
|
+
}, (_group$groupName2 = group.groupName) === null || _group$groupName2 === void 0 ? void 0 : _group$groupName2.toUpperCase()), /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
213
|
+
flex: 1,
|
|
214
|
+
height: "0px",
|
|
215
|
+
overflow: "auto"
|
|
216
|
+
}, group.items.map(function (i) {
|
|
217
|
+
return /*#__PURE__*/_react.default.createElement(_material.ListItemText, {
|
|
218
|
+
disableTypography: true,
|
|
219
|
+
sx: {
|
|
220
|
+
color: "#44409A !important",
|
|
221
|
+
fontWeight: 600,
|
|
222
|
+
p: "0.3rem",
|
|
223
|
+
cursor: "pointer",
|
|
224
|
+
fontSize: "14px !important",
|
|
225
|
+
backgroundColor: i.key === selectedSidebarKey ? "#f5f6f7" : "none",
|
|
226
|
+
"&:hover": {
|
|
227
|
+
backgroundColor: "#f5f6f7"
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
onClick: function onClick() {
|
|
231
|
+
setSelectedSidebarKey(i.key);
|
|
232
|
+
setselectedCollapsedSidebar(i);
|
|
233
|
+
handleClose();
|
|
234
|
+
i.serverSide ? window.location.href = i.href : navigate(i.href);
|
|
235
|
+
}
|
|
236
|
+
}, /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
237
|
+
semibold: true
|
|
238
|
+
}, i.display));
|
|
239
|
+
})))));
|
|
240
|
+
}))) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null);
|
|
217
241
|
};
|
|
218
242
|
GroupedIconMenu.propTypes = {
|
|
219
243
|
groups: _propTypes.default.array.isRequired
|
|
220
244
|
};
|
|
221
|
-
var _default =
|
|
245
|
+
var _default = GroupedIconMenu;
|
|
246
|
+
exports.default = _default;
|