tenjin-ui-kit 0.3.72-dev → 0.3.72-dev-1
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 +182 -114
- package/common/hooks/newApiHook.js +225 -143
- package/common/utils/security/index.js +2 -2
- package/common/utils/security/securityConfig.js +2 -1
- package/components/Canvas.js +88 -164
- package/components/DragBox/index.js +26 -21
- package/components/InputWithChip/index.js +57 -164
- package/components/RightContext/index.js +28 -19
- package/components/WorkFlow.js +23 -18
- package/components/WorkFlowBuilder.js +48 -33
- package/components/alert/Style.js +14 -11
- package/components/alert/index.js +12 -10
- package/components/attachment/index.js +28 -21
- package/components/authenticationProvider/AuthError.js +4 -3
- package/components/authenticationProvider/AuthLoader.js +4 -3
- package/components/authenticationProvider/index.js +116 -60
- package/components/avatar/index.js +14 -13
- package/components/avatar/styles.js +77 -74
- package/components/breadCrumbs/index.js +53 -42
- package/components/breadCrumbs/style.js +4 -1
- package/components/browsingTestCaseLayout/DetailsViewLayout/DetailsViewContent/index.js +6 -5
- package/components/browsingTestCaseLayout/DetailsViewLayout/DetailsViewContent/style.js +8 -5
- package/components/browsingTestCaseLayout/DetailsViewLayout/DetailsViewHeader/index.js +5 -4
- package/components/browsingTestCaseLayout/TreeViewLayout/TreeViewContent/Index.js +5 -4
- package/components/browsingTestCaseLayout/TreeViewLayout/TreeViewHeader/Index.js +6 -5
- package/components/browsingTestCaseLayout/TreeViewLayout/TreeViewHeader/style.js +19 -16
- package/components/browsingTestCaseLayout/index.js +30 -25
- package/components/button/index.js +43 -36
- package/components/chatBotModal/index.js +45 -36
- package/components/checkBox/index.js +9 -8
- package/components/combobox/index.js +72 -51
- package/components/divider/index.js +18 -14
- package/components/editableField/index.js +28 -19
- package/components/error/index.js +12 -6
- package/components/errorBoundary/index.js +94 -74
- package/components/fileUploader/index.js +35 -30
- package/components/fileUploader/style.js +49 -46
- package/components/filter/ValueSelector.js +210 -137
- package/components/filter/index.js +39 -29
- package/components/iconButton/index.js +4 -3
- package/components/input/index.js +38 -31
- package/components/layout/index.js +31 -27
- package/components/layout/main/index.js +13 -10
- package/components/layout/main/style.js +14 -11
- package/components/layout/pageContent/index.js +7 -6
- package/components/layout/sidebar/FlatMenu.js +43 -43
- package/components/layout/sidebar/GroupedIconMenu.js +108 -95
- package/components/layout/sidebar/GroupedMenu.js +48 -38
- package/components/layout/sidebar/ProjectMenu.js +116 -109
- package/components/layout/sidebar/index.js +18 -15
- package/components/layout/sidebar/style.js +143 -138
- package/components/layout/topBar/ProjectTopbar.js +138 -104
- package/components/layout/topBar/UserAvatar.js +60 -51
- package/components/layout/topBar/index.js +33 -22
- package/components/loader/index.js +12 -9
- package/components/menu/index.js +35 -26
- package/components/modal/Modal.js +6 -5
- package/components/modal/index.js +13 -10
- package/components/modal/style.js +56 -53
- package/components/optionMenu/index.js +41 -34
- package/components/pagination/index.js +39 -24
- package/components/pagination/style.js +28 -25
- package/components/paginationUpdated/index.js +16 -14
- package/components/paper/index.js +16 -15
- package/components/paper/style.js +27 -24
- package/components/reactSelect/index.js +63 -46
- package/components/reactSelect/style.js +150 -117
- package/components/richTextEditor/index.js +44 -25
- package/components/select/GroupedSelect.js +61 -45
- package/components/select/SimpleSelect.js +82 -52
- package/components/select/index.js +54 -38
- package/components/simpleSelect/index.js +15 -12
- package/components/sort/index.js +22 -19
- package/components/switch/index.js +11 -10
- package/components/switch/style.js +32 -29
- package/components/switch/switch.js +23 -17
- package/components/table/ReactTable.js +71 -54
- package/components/table/SimpleTable.js +78 -59
- package/components/table/index.js +186 -311
- package/components/text/index.js +17 -15
- package/components/timeStamp/index.js +9 -4
- package/components/timeStamp/style.js +15 -12
- package/components/topBar/index.js +92 -85
- package/components/tree/index.js +47 -29
- package/components/tree/style.js +23 -20
- package/components/valuePicker/ValueSelector.js +138 -70
- package/components/valuePicker/index.js +26 -19
- package/components/wrapperLayout/layout/index.js +5 -4
- package/components/wrapperLayout/main/index.js +5 -4
- package/components/wrapperLayout/main/pageContainer/index.js +5 -4
- package/components/wrapperLayout/main/sideBar/index.js +110 -120
- package/components/wrapperLayout/main/sideBar/style.js +183 -177
- package/components/wrapperLayout/topBar/UserAvatar.js +5 -4
- package/components/wrapperLayout/topBar/avatar.js +12 -10
- package/components/wrapperLayout/topBar/index.js +97 -111
- package/components/wrapperLayout/topBar/menuIcon.js +5 -4
- package/components/wrapperLayout/topBar/style.js +64 -61
- package/http/index.js +184 -91
- package/index.js +55 -53
- package/package.json +2 -4
- package/templates/listPage/index.js +57 -36
- package/themes/default.js +7 -5
- package/themes/defaultSmall.js +3 -2
- package/themes/responsiveTheme.js +8 -6
|
@@ -5,60 +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
|
-
|
|
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),
|
|
20
25
|
_useContext$layoutSta = _useContext.layoutState,
|
|
21
26
|
collapsed = _useContext$layoutSta.sidebarCollapsed,
|
|
22
27
|
selectedSidebarKey = _useContext$layoutSta.selectedSidebarKey,
|
|
23
28
|
setSelectedSidebarKey = _useContext.setSelectedSidebarKey;
|
|
24
|
-
|
|
25
|
-
return items ? /*#__PURE__*/_react.default.createElement(_material.List, null, items.map((i, index)
|
|
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
|
-
[classes.listItemText]: true,
|
|
55
|
-
[classes.collapsedFlatMenuItemText]: collapsed,
|
|
56
|
-
[classes.selectedFlatMenuItemText]: selectedSidebarKey === i.key
|
|
57
|
-
}),
|
|
58
|
-
disableTypography: true
|
|
59
|
-
}, /*#__PURE__*/_react.default.createElement(_text.default, null, i.display)))))) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null);
|
|
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);
|
|
60
59
|
};
|
|
61
60
|
FlatMenu.propTypes = {
|
|
62
61
|
items: _propTypes.default.array.isRequired
|
|
63
62
|
};
|
|
64
|
-
var _default =
|
|
63
|
+
var _default = FlatMenu;
|
|
64
|
+
exports.default = _default;
|
|
@@ -1,89 +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
|
-
function
|
|
18
|
-
function
|
|
19
|
-
function
|
|
20
|
-
function
|
|
21
|
-
function
|
|
22
|
-
function
|
|
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(); }
|
|
23
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."); }
|
|
24
|
-
function _unsupportedIterableToArray(
|
|
25
|
-
function _arrayLikeToArray(
|
|
26
|
-
function _iterableToArrayLimit(
|
|
27
|
-
function _arrayWithHoles(
|
|
28
|
-
|
|
29
|
-
|
|
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,
|
|
30
32
|
icon = _ref.icon,
|
|
31
33
|
title = _ref.title,
|
|
32
34
|
pointer = _ref.pointer,
|
|
33
35
|
href = _ref.href;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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),
|
|
38
40
|
_useContext$layoutSta = _useContext.layoutState,
|
|
39
41
|
collapsed = _useContext$layoutSta.sidebarCollapsed,
|
|
40
42
|
selectedSidebarKey = _useContext$layoutSta.selectedSidebarKey,
|
|
41
43
|
setSelectedSidebarKey = _useContext.setSelectedSidebarKey;
|
|
42
|
-
|
|
44
|
+
var _useState = (0, _react.useState)({}),
|
|
43
45
|
_useState2 = _slicedToArray(_useState, 2),
|
|
44
46
|
selectedCollapsedSidebar = _useState2[0],
|
|
45
47
|
setselectedCollapsedSidebar = _useState2[1];
|
|
46
|
-
|
|
48
|
+
var _useState3 = (0, _react.useState)({
|
|
47
49
|
index: null,
|
|
48
50
|
open: false
|
|
49
51
|
}),
|
|
50
52
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
51
53
|
selectedItem = _useState4[0],
|
|
52
54
|
setselectedItem = _useState4[1];
|
|
53
|
-
|
|
54
|
-
setselectedItem(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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
|
+
});
|
|
60
64
|
};
|
|
61
|
-
|
|
62
|
-
setselectedItem(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|
+
});
|
|
67
73
|
};
|
|
68
|
-
(0, _react.useEffect)(()
|
|
74
|
+
(0, _react.useEffect)(function () {
|
|
69
75
|
function handleClickOutside(event) {
|
|
70
76
|
if (popupRef.current && !popupRef.current.contains(event.target)) {
|
|
71
77
|
handleClose();
|
|
72
78
|
}
|
|
73
79
|
}
|
|
74
80
|
document.addEventListener("mousedown", handleClickOutside);
|
|
75
|
-
return ()
|
|
81
|
+
return function () {
|
|
76
82
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
77
83
|
};
|
|
78
84
|
}, [popupRef]);
|
|
79
|
-
|
|
85
|
+
var theme = (0, _material.useTheme)();
|
|
80
86
|
return groups ? /*#__PURE__*/_react.default.createElement("div", {
|
|
81
87
|
className: classes.projectMenuMainWrapper
|
|
82
88
|
}, /*#__PURE__*/_react.default.createElement("div", null, !collapsed && /*#__PURE__*/_react.default.createElement("div", {
|
|
83
89
|
style: {
|
|
84
90
|
cursor: pointer && "pointer"
|
|
85
91
|
},
|
|
86
|
-
onClick: ()
|
|
92
|
+
onClick: function onClick() {
|
|
93
|
+
return window.location = href;
|
|
94
|
+
}
|
|
87
95
|
}, /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
88
96
|
className: classes.projectMenuHeader,
|
|
89
97
|
fontWeight: 600,
|
|
@@ -95,8 +103,8 @@ const GroupedIconMenu = _ref => {
|
|
|
95
103
|
marginRight: "0.5rem",
|
|
96
104
|
paddingTop: "0.2rem"
|
|
97
105
|
}
|
|
98
|
-
}, icon), title))), /*#__PURE__*/_react.default.createElement("div", null, groups.map((group, index)
|
|
99
|
-
var _group$items$filter$, _group$items$filter$2, _group$groupName, _group$groupName2;
|
|
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;
|
|
100
108
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
101
109
|
key: group.groupName
|
|
102
110
|
}, /*#__PURE__*/_react.default.createElement(_material.List, {
|
|
@@ -126,23 +134,23 @@ const GroupedIconMenu = _ref => {
|
|
|
126
134
|
placement: "right"
|
|
127
135
|
}, /*#__PURE__*/_react.default.createElement(_material.ListItemButton, {
|
|
128
136
|
id: "account-button",
|
|
129
|
-
selected: (group === null || group === void 0
|
|
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,
|
|
130
140
|
classes: {
|
|
131
141
|
selected: classes.selectedProjectMenuItem
|
|
132
142
|
},
|
|
133
143
|
key: selectedCollapsedSidebar === null || selectedCollapsedSidebar === void 0 ? void 0 : selectedCollapsedSidebar.key,
|
|
134
|
-
onClick: e
|
|
144
|
+
onClick: function onClick(e) {
|
|
135
145
|
selectedItem.open ? handleClose() : handleClick(e, index, group);
|
|
136
146
|
}
|
|
137
147
|
}, /*#__PURE__*/_react.default.createElement(_material.ListItemText, {
|
|
138
148
|
disableTypography: true,
|
|
139
|
-
className: (0,
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
[classes.selectedProjectMenuItemIcon]: (group === null || group === void 0 || (_group$items$filter$2 = group.items.filter(item => item.key === selectedSidebarKey)[0]) === null || _group$items$filter$2 === void 0 ? void 0 : _group$items$filter$2.key) === selectedSidebarKey
|
|
145
|
-
})
|
|
149
|
+
className: (0, _clsx2.default)((_clsx = {}, _defineProperty(_clsx, classes.projectListIcon, true), _defineProperty(_clsx, "selected", {
|
|
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))
|
|
146
154
|
}, group.icon)))) : /*#__PURE__*/_react.default.createElement("span", {
|
|
147
155
|
className: classes.subHeaderIcon
|
|
148
156
|
}, group.icon), /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
@@ -155,30 +163,32 @@ const GroupedIconMenu = _ref => {
|
|
|
155
163
|
display: collapsed ? "none !important" : "flex"
|
|
156
164
|
}
|
|
157
165
|
}, (_group$groupName = group.groupName) === null || _group$groupName === void 0 ? void 0 : _group$groupName.toUpperCase()))
|
|
158
|
-
}, !collapsed && group.items.map(
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
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)
|
|
187
|
+
},
|
|
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, {
|
|
182
192
|
sx: {
|
|
183
193
|
height: "initial !important"
|
|
184
194
|
}
|
|
@@ -203,31 +213,34 @@ const GroupedIconMenu = _ref => {
|
|
|
203
213
|
flex: 1,
|
|
204
214
|
height: "0px",
|
|
205
215
|
overflow: "auto"
|
|
206
|
-
}, group.items.map(
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
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);
|
|
217
235
|
}
|
|
218
|
-
},
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
handleClose();
|
|
223
|
-
i.serverSide ? window.location.href = i.href : navigate(i.href);
|
|
224
|
-
}
|
|
225
|
-
}, /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
226
|
-
semibold: true
|
|
227
|
-
}, i.display)))))));
|
|
236
|
+
}, /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
237
|
+
semibold: true
|
|
238
|
+
}, i.display));
|
|
239
|
+
})))));
|
|
228
240
|
}))) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null);
|
|
229
241
|
};
|
|
230
242
|
GroupedIconMenu.propTypes = {
|
|
231
243
|
groups: _propTypes.default.array.isRequired
|
|
232
244
|
};
|
|
233
|
-
var _default =
|
|
245
|
+
var _default = GroupedIconMenu;
|
|
246
|
+
exports.default = _default;
|
|
@@ -10,48 +10,58 @@ var _material = require("@mui/material");
|
|
|
10
10
|
var _reactRouterDom = require("react-router-dom");
|
|
11
11
|
var _style = _interopRequireDefault(require("./style"));
|
|
12
12
|
var _ = require("..");
|
|
13
|
-
var
|
|
13
|
+
var _clsx2 = _interopRequireDefault(require("clsx"));
|
|
14
14
|
var _text = _interopRequireDefault(require("../../text"));
|
|
15
|
-
function _interopRequireDefault(
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
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 _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 GroupedMenu = function GroupedMenu(_ref) {
|
|
23
|
+
var groups = _ref.groups;
|
|
24
|
+
var classes = (0, _style.default)();
|
|
25
|
+
var _useContext = (0, _react.useContext)(_.LayoutContext),
|
|
21
26
|
selectedSidebarKey = _useContext.layoutState.selectedSidebarKey,
|
|
22
27
|
setSelectedSidebarKey = _useContext.setSelectedSidebarKey;
|
|
23
|
-
return groups ? groups.map((group, index)
|
|
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
|
-
|
|
28
|
+
return groups ? groups.map(function (group, index) {
|
|
29
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
30
|
+
key: group.groupName
|
|
31
|
+
}, /*#__PURE__*/_react.default.createElement(_material.List, {
|
|
32
|
+
subheader: /*#__PURE__*/_react.default.createElement(_material.ListSubheader, {
|
|
33
|
+
className: classes.subHeader
|
|
34
|
+
}, /*#__PURE__*/_react.default.createElement(_text.default, null, group.groupName))
|
|
35
|
+
}, group.items.map(function (i) {
|
|
36
|
+
var _clsx;
|
|
37
|
+
return /*#__PURE__*/_react.default.createElement(_material.ListItemButton, {
|
|
38
|
+
disableRipple: true,
|
|
39
|
+
disableTouchRipple: true,
|
|
40
|
+
component: i.serverSide ? "a" : _reactRouterDom.Link,
|
|
41
|
+
href: i.href,
|
|
42
|
+
to: i.href,
|
|
43
|
+
selected: i.key === selectedSidebarKey,
|
|
44
|
+
sidebarKey: i.key,
|
|
45
|
+
key: i.key,
|
|
46
|
+
onClick: function onClick() {
|
|
47
|
+
return setSelectedSidebarKey(i.key);
|
|
48
|
+
},
|
|
49
|
+
classes: {
|
|
50
|
+
selected: classes.selectedGroupMenuItem
|
|
51
|
+
}
|
|
52
|
+
}, /*#__PURE__*/_react.default.createElement(_material.ListItemText, {
|
|
53
|
+
disableTypography: true,
|
|
54
|
+
className: (0, _clsx2.default)((_clsx = {}, _defineProperty(_clsx, classes.listItemText, true), _defineProperty(_clsx, classes.selectedFlatMenuItemText, selectedSidebarKey === i.key), _clsx))
|
|
55
|
+
}, /*#__PURE__*/_react.default.createElement(_text.default, null, i.display)));
|
|
56
|
+
})), index < groups.length - 1 && /*#__PURE__*/_react.default.createElement(_material.Divider, {
|
|
57
|
+
sx: {
|
|
58
|
+
height: "initial !important"
|
|
59
|
+
}
|
|
60
|
+
}));
|
|
61
|
+
}) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null);
|
|
53
62
|
};
|
|
54
63
|
GroupedMenu.propTypes = {
|
|
55
64
|
groups: _propTypes.default.array.isRequired
|
|
56
65
|
};
|
|
57
|
-
var _default =
|
|
66
|
+
var _default = GroupedMenu;
|
|
67
|
+
exports.default = _default;
|