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
package/components/text/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
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
|
});
|
|
@@ -7,9 +8,17 @@ exports.default = void 0;
|
|
|
7
8
|
var _react = _interopRequireDefault(require("react"));
|
|
8
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
10
|
var _material = require("@mui/material");
|
|
10
|
-
|
|
11
|
-
function
|
|
12
|
-
|
|
11
|
+
var _excluded = ["children", "bold", "semibold", "color", "variant", "link", "fontWeight", "sx", "component"];
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
14
|
+
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; }
|
|
15
|
+
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; }
|
|
16
|
+
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; }
|
|
17
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
18
|
+
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); }
|
|
19
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
20
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
21
|
+
var getColor = function getColor(color, theme) {
|
|
13
22
|
switch (color) {
|
|
14
23
|
default:
|
|
15
24
|
return color;
|
|
@@ -25,30 +34,28 @@ const getColor = (color, theme) => {
|
|
|
25
34
|
return "GrayText";
|
|
26
35
|
}
|
|
27
36
|
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
component = "p",
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const theme = (0, _material.useTheme)();
|
|
37
|
+
var Text = function Text(_ref) {
|
|
38
|
+
var children = _ref.children,
|
|
39
|
+
bold = _ref.bold,
|
|
40
|
+
semibold = _ref.semibold,
|
|
41
|
+
color = _ref.color,
|
|
42
|
+
variant = _ref.variant,
|
|
43
|
+
link = _ref.link,
|
|
44
|
+
fontWeight = _ref.fontWeight,
|
|
45
|
+
sx = _ref.sx,
|
|
46
|
+
_ref$component = _ref.component,
|
|
47
|
+
component = _ref$component === void 0 ? "p" : _ref$component,
|
|
48
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
49
|
+
var theme = (0, _material.useTheme)();
|
|
42
50
|
return /*#__PURE__*/_react.default.createElement(_material.Typography, _extends({
|
|
43
51
|
component: component,
|
|
44
52
|
variant: variant === "title" ? "h6" : variant === "subtitle" ? "body2" : variant,
|
|
45
53
|
fontWeight: bold ? "bold" : semibold || variant === "title" ? 600 : fontWeight,
|
|
46
54
|
color: link ? "primary" : getColor(color, theme)
|
|
47
55
|
}, rest, {
|
|
48
|
-
sx: {
|
|
49
|
-
textDecoration: link ? "none !important" : "inherit"
|
|
50
|
-
|
|
51
|
-
}
|
|
56
|
+
sx: _objectSpread({
|
|
57
|
+
textDecoration: link ? "none !important" : "inherit"
|
|
58
|
+
}, sx)
|
|
52
59
|
}), children);
|
|
53
60
|
};
|
|
54
61
|
Text.propTypes = {
|
|
@@ -56,4 +63,5 @@ Text.propTypes = {
|
|
|
56
63
|
semibold: _propTypes.default.bool,
|
|
57
64
|
variant: _propTypes.default.oneOf(["body1", "body2", "button", "caption", "h1", "h2", "h3", "h4", "h5", "h6", "inherit", "overline", "subtitle1", "subtitle2", "subtitle", "title"])
|
|
58
65
|
};
|
|
59
|
-
var _default =
|
|
66
|
+
var _default = Text;
|
|
67
|
+
exports.default = _default;
|
|
@@ -8,15 +8,15 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _reactMoment = _interopRequireDefault(require("react-moment"));
|
|
10
10
|
var _text = _interopRequireDefault(require("../text"));
|
|
11
|
-
function _interopRequireDefault(
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
12
|
// import useStyles from "./style";
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
var formats = {
|
|
15
15
|
long: "DD MMMM yyyy, HH24:mm:ss",
|
|
16
16
|
short: "DD-MM-yyyy",
|
|
17
17
|
default: "DD MMM yyyy, hh:mm a"
|
|
18
18
|
};
|
|
19
|
-
|
|
19
|
+
var TimeStamp = function TimeStamp(props) {
|
|
20
20
|
// const classes = useStyles();
|
|
21
21
|
|
|
22
22
|
return !props.value ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null) : props.format !== "interval" ? /*#__PURE__*/_react.default.createElement(_text.default, null, /*#__PURE__*/_react.default.createElement(_reactMoment.default, {
|
|
@@ -34,9 +34,11 @@ TimeStamp.defaultProps = {
|
|
|
34
34
|
format: "default"
|
|
35
35
|
// size: PropTypes.oneOf(["small", "medium", "large"]),
|
|
36
36
|
};
|
|
37
|
+
|
|
37
38
|
TimeStamp.propTypes = {
|
|
38
39
|
value: _propTypes.default.any,
|
|
39
40
|
format: _propTypes.default.oneOf(["default", "long", "short", "interval"]),
|
|
40
41
|
local: _propTypes.default.bool
|
|
41
42
|
};
|
|
42
|
-
var _default =
|
|
43
|
+
var _default = TimeStamp;
|
|
44
|
+
exports.default = _default;
|
|
@@ -6,15 +6,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _styles = require("@mui/styles");
|
|
8
8
|
var _default2 = _interopRequireDefault(require("../../themes/default"));
|
|
9
|
-
function _interopRequireDefault(
|
|
10
|
-
var _default =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
var _default = (0, _styles.makeStyles)(function () {
|
|
11
|
+
return {
|
|
12
|
+
small: {
|
|
13
|
+
fontSize: _default2.default.spacing(1.25)
|
|
14
|
+
},
|
|
15
|
+
medium: {
|
|
16
|
+
fontSize: _default2.default.spacing(1.5)
|
|
17
|
+
},
|
|
18
|
+
large: {
|
|
19
|
+
fontSize: _default2.default.spacing(1.875)
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
exports.default = _default;
|
|
@@ -1,5 +1,6 @@
|
|
|
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
|
});
|
|
@@ -11,24 +12,34 @@ var _avatar = _interopRequireDefault(require("../wrapperLayout/topBar/avatar"));
|
|
|
11
12
|
var _propTypes = _interopRequireWildcard(require("prop-types"));
|
|
12
13
|
var _style = _interopRequireDefault(require("../wrapperLayout/topBar/style"));
|
|
13
14
|
var _text = _interopRequireDefault(require("../text"));
|
|
14
|
-
function
|
|
15
|
-
function
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
19
|
+
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."); }
|
|
20
|
+
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); }
|
|
21
|
+
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; }
|
|
22
|
+
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; } }
|
|
23
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
24
|
+
var TopBar = function TopBar(props) {
|
|
25
|
+
var _props$menuDetails, _concatedMenu$clicked, _concatedMenu$clicked2;
|
|
26
|
+
var classes = (0, _style.default)();
|
|
27
|
+
var open = Boolean(props.anchorElUser);
|
|
28
|
+
var _React$useState = _react.default.useState(null),
|
|
29
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
30
|
+
anchorEl = _React$useState2[0],
|
|
31
|
+
setAnchorEl = _React$useState2[1];
|
|
32
|
+
var _React$useState3 = _react.default.useState(null),
|
|
33
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
34
|
+
clickedState = _React$useState4[0],
|
|
35
|
+
setClickedState = _React$useState4[1];
|
|
36
|
+
var handleOpenUserMenu = function handleOpenUserMenu(event) {
|
|
37
|
+
setAnchorEl(event === null || event === void 0 ? void 0 : event.currentTarget);
|
|
27
38
|
};
|
|
28
|
-
|
|
39
|
+
var handleCloseUserMenu = function handleCloseUserMenu() {
|
|
29
40
|
setAnchorEl(null);
|
|
30
41
|
};
|
|
31
|
-
|
|
42
|
+
var userMenuObject = [{
|
|
32
43
|
name: 'User',
|
|
33
44
|
icon: /*#__PURE__*/_react.default.createElement(_avatar.default, {
|
|
34
45
|
loggedInUser: props.loggedInUser,
|
|
@@ -37,7 +48,7 @@ const TopBar = props => {
|
|
|
37
48
|
}),
|
|
38
49
|
listOfItems: props.userMenu
|
|
39
50
|
}];
|
|
40
|
-
|
|
51
|
+
var concatedMenu = (_props$menuDetails = props.menuDetails) === null || _props$menuDetails === void 0 ? void 0 : _props$menuDetails.concat(userMenuObject);
|
|
41
52
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
42
53
|
sx: {
|
|
43
54
|
flexGrow: 1
|
|
@@ -48,7 +59,7 @@ const TopBar = props => {
|
|
|
48
59
|
}, /*#__PURE__*/_react.default.createElement(_material.Toolbar, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
49
60
|
className: classes.logoContent
|
|
50
61
|
}, /*#__PURE__*/_react.default.createElement("a", {
|
|
51
|
-
href:
|
|
62
|
+
href: "/".concat(props.location)
|
|
52
63
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
53
64
|
className: classes.appLogo
|
|
54
65
|
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
@@ -60,35 +71,37 @@ const TopBar = props => {
|
|
|
60
71
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
61
72
|
className: classes.breadCrumbs
|
|
62
73
|
}, /*#__PURE__*/_react.default.createElement(_breadCrumbs.default, {
|
|
63
|
-
crumbInfo: props
|
|
64
|
-
})), concatedMenu && concatedMenu.map((menu, key)
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
74
|
+
crumbInfo: props === null || props === void 0 ? void 0 : props.crumbInfo
|
|
75
|
+
})), concatedMenu && concatedMenu.map(function (menu, key) {
|
|
76
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
77
|
+
style: {
|
|
78
|
+
display: 'flex',
|
|
79
|
+
alignItems: 'center',
|
|
80
|
+
padding: concatedMenu.length - 1 === key ? '0rem 0rem 0rem 1rem' : '0rem 1rem 0rem 0rem'
|
|
81
|
+
}
|
|
82
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Box, null, /*#__PURE__*/_react.default.createElement(_material.Tooltip, {
|
|
83
|
+
title: menu.name
|
|
84
|
+
}, /*#__PURE__*/_react.default.createElement(_material.IconButton, {
|
|
85
|
+
key: key,
|
|
86
|
+
onClick: function onClick(e) {
|
|
87
|
+
handleOpenUserMenu(e);
|
|
88
|
+
setClickedState(key);
|
|
89
|
+
},
|
|
90
|
+
size: "small",
|
|
91
|
+
sx: {
|
|
92
|
+
ml: 2
|
|
93
|
+
}
|
|
94
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
95
|
+
style: {
|
|
96
|
+
fontSize: '2vw',
|
|
97
|
+
display: 'flex',
|
|
98
|
+
alignItems: 'center'
|
|
99
|
+
}
|
|
100
|
+
}, menu.icon))))), concatedMenu.length - 1 !== key && /*#__PURE__*/_react.default.createElement(_material.Divider, {
|
|
101
|
+
orientation: "vertical",
|
|
102
|
+
flexItem: true
|
|
103
|
+
}));
|
|
104
|
+
}), /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_material.Menu, {
|
|
92
105
|
anchorEl: anchorEl,
|
|
93
106
|
id: "basic-menu",
|
|
94
107
|
disableRipple: true,
|
|
@@ -105,45 +118,47 @@ const TopBar = props => {
|
|
|
105
118
|
//width: 160,
|
|
106
119
|
maxWidth: '100%'
|
|
107
120
|
}
|
|
108
|
-
}, concatedMenu && concatedMenu[clickedState]
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
121
|
+
}, concatedMenu && ((_concatedMenu$clicked = concatedMenu[clickedState]) === null || _concatedMenu$clicked === void 0 ? void 0 : (_concatedMenu$clicked2 = _concatedMenu$clicked.listOfItems) === null || _concatedMenu$clicked2 === void 0 ? void 0 : _concatedMenu$clicked2.map(function (item, index) {
|
|
122
|
+
return /*#__PURE__*/_react.default.createElement(_material.MenuItem, {
|
|
123
|
+
onClick: handleCloseUserMenu,
|
|
124
|
+
key: index,
|
|
125
|
+
style: {
|
|
126
|
+
display: 'flex',
|
|
127
|
+
flexGrow: 1
|
|
128
|
+
}
|
|
129
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
130
|
+
style: {
|
|
131
|
+
display: 'flex',
|
|
132
|
+
flexGrow: 1
|
|
133
|
+
}
|
|
134
|
+
}, item.icon && /*#__PURE__*/_react.default.createElement("div", {
|
|
135
|
+
style: {
|
|
136
|
+
display: 'flex',
|
|
137
|
+
alignItems: 'center',
|
|
138
|
+
paddingRight: '1.5rem',
|
|
139
|
+
fontSize: '1.1rem',
|
|
140
|
+
color: '#44409A'
|
|
141
|
+
}
|
|
142
|
+
}, item.icon), /*#__PURE__*/_react.default.createElement("div", {
|
|
143
|
+
style: {
|
|
144
|
+
display: 'flex',
|
|
145
|
+
flexDirection: 'column'
|
|
146
|
+
}
|
|
147
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
148
|
+
style: {
|
|
149
|
+
fontWeight: 600,
|
|
150
|
+
color: '#000000DE',
|
|
151
|
+
// fontSize: "0.9rem",
|
|
152
|
+
fontSize: '80%'
|
|
153
|
+
}
|
|
154
|
+
}, /*#__PURE__*/_react.default.createElement(_text.default, null, item.name)), /*#__PURE__*/_react.default.createElement("div", {
|
|
155
|
+
style: {
|
|
156
|
+
color: '#000000DE',
|
|
157
|
+
// fontSize: "13px",
|
|
158
|
+
fontSize: '80%'
|
|
159
|
+
}
|
|
160
|
+
}, /*#__PURE__*/_react.default.createElement(_text.default, null, item.description)))));
|
|
161
|
+
})))))))));
|
|
147
162
|
};
|
|
148
163
|
TopBar.propTypes = {
|
|
149
164
|
logo: _propTypes.default.string.isRequired,
|
|
@@ -157,4 +172,5 @@ TopBar.propTypes = {
|
|
|
157
172
|
userMenu: _propTypes.default.array,
|
|
158
173
|
crumbInfo: _propTypes.default.array
|
|
159
174
|
};
|
|
160
|
-
var _default =
|
|
175
|
+
var _default = TopBar;
|
|
176
|
+
exports.default = _default;
|
package/components/tree/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
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
|
});
|
|
@@ -21,21 +22,36 @@ var _fi = require("react-icons/fi");
|
|
|
21
22
|
var _style = _interopRequireDefault(require("./style"));
|
|
22
23
|
var _ri = require("react-icons/ri");
|
|
23
24
|
var _text = _interopRequireDefault(require("../text"));
|
|
24
|
-
function _interopRequireDefault(
|
|
25
|
-
function
|
|
25
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
26
|
+
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); }
|
|
27
|
+
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; }
|
|
28
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
29
|
+
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."); }
|
|
30
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
31
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
32
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
33
|
+
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."); }
|
|
34
|
+
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); }
|
|
35
|
+
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; }
|
|
36
|
+
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; } }
|
|
37
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
26
38
|
// /color:"#03c988"
|
|
27
39
|
// color: '#90a17d'
|
|
28
40
|
|
|
29
41
|
function Tree(props) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
42
|
+
var folder = props.folder,
|
|
43
|
+
projectName = props.projectName,
|
|
44
|
+
apiCallFunc = props.apiCallFunc;
|
|
45
|
+
var _React$useState = React.useState(null),
|
|
46
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
47
|
+
contextMenu = _React$useState2[0],
|
|
48
|
+
setContextMenu = _React$useState2[1];
|
|
49
|
+
var classes = (0, _style.default)();
|
|
37
50
|
//
|
|
38
|
-
|
|
51
|
+
var _React$useState3 = React.useState([]),
|
|
52
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
53
|
+
expandedNodeIds = _React$useState4[0],
|
|
54
|
+
setExpandedNodeIds = _React$useState4[1];
|
|
39
55
|
function handleContextMenu(event, nodeId) {
|
|
40
56
|
event.preventDefault();
|
|
41
57
|
setContextMenu(contextMenu === null ? {
|
|
@@ -43,17 +59,17 @@ function Tree(props) {
|
|
|
43
59
|
mouseY: event.clientY - 35
|
|
44
60
|
} : null);
|
|
45
61
|
}
|
|
46
|
-
|
|
62
|
+
var handleClose = function handleClose() {
|
|
47
63
|
setContextMenu(null);
|
|
48
64
|
};
|
|
49
|
-
|
|
50
|
-
for (
|
|
51
|
-
|
|
65
|
+
var getParentNode = function getParentNode(node, treeData) {
|
|
66
|
+
for (var i = 0; i < treeData.length; i++) {
|
|
67
|
+
var currentNode = treeData[i];
|
|
52
68
|
if (currentNode.children && currentNode.children.includes(node)) {
|
|
53
69
|
return currentNode;
|
|
54
70
|
}
|
|
55
71
|
if (currentNode.children) {
|
|
56
|
-
|
|
72
|
+
var parent = getParentNode(node, currentNode.children);
|
|
57
73
|
if (parent) {
|
|
58
74
|
return parent;
|
|
59
75
|
}
|
|
@@ -61,8 +77,8 @@ function Tree(props) {
|
|
|
61
77
|
}
|
|
62
78
|
return null;
|
|
63
79
|
};
|
|
64
|
-
|
|
65
|
-
|
|
80
|
+
var renderTree = function renderTree(nodes) {
|
|
81
|
+
var isFirstLevel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
66
82
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_material.ThemeProvider, {
|
|
67
83
|
theme: _default.default
|
|
68
84
|
}, /*#__PURE__*/React.createElement(_material.CssBaseline, null), /*#__PURE__*/React.createElement(React.Fragment, {
|
|
@@ -74,16 +90,18 @@ function Tree(props) {
|
|
|
74
90
|
}, /*#__PURE__*/React.createElement(_TreeItem.default, {
|
|
75
91
|
key: nodes.folderId,
|
|
76
92
|
nodeId: nodes.folderId,
|
|
77
|
-
onClick: ()
|
|
78
|
-
|
|
93
|
+
onClick: function onClick() {
|
|
94
|
+
var isExpanded = expandedNodeIds.includes(nodes.folderId);
|
|
79
95
|
if (isExpanded) {
|
|
80
|
-
setExpandedNodeIds(expandedNodeIds.filter(
|
|
96
|
+
setExpandedNodeIds(expandedNodeIds.filter(function (id) {
|
|
97
|
+
return id !== nodes.folderId;
|
|
98
|
+
}));
|
|
81
99
|
} else {
|
|
82
|
-
|
|
100
|
+
var parent = getParentNode(nodes, folder);
|
|
83
101
|
if (parent) {
|
|
84
|
-
setExpandedNodeIds([
|
|
102
|
+
setExpandedNodeIds([].concat(_toConsumableArray(expandedNodeIds), [parent.folderId, nodes.folderId]));
|
|
85
103
|
} else {
|
|
86
|
-
setExpandedNodeIds([
|
|
104
|
+
setExpandedNodeIds([].concat(_toConsumableArray(expandedNodeIds), [nodes.folderId]));
|
|
87
105
|
}
|
|
88
106
|
}
|
|
89
107
|
},
|
|
@@ -101,7 +119,9 @@ function Tree(props) {
|
|
|
101
119
|
fontFamily: "sans-serif segoe ui",
|
|
102
120
|
padding: nodes.classificationType === "sc" ? "inherit" : "6px"
|
|
103
121
|
},
|
|
104
|
-
onClick: ()
|
|
122
|
+
onClick: function onClick() {
|
|
123
|
+
return apiCallFunc(nodes.folderId);
|
|
124
|
+
}
|
|
105
125
|
}, nodes.classificationType === "project" ? expandedNodeIds.includes(nodes.nodeId) ?
|
|
106
126
|
/*#__PURE__*/
|
|
107
127
|
// <FcOpenedFolder style={{ marginRight: "10px" }} />
|
|
@@ -149,11 +169,17 @@ function Tree(props) {
|
|
|
149
169
|
color: "#90a17d"
|
|
150
170
|
}
|
|
151
171
|
}), nodes.name)),
|
|
152
|
-
onContextMenu:
|
|
153
|
-
|
|
172
|
+
onContextMenu: function onContextMenu(event) {
|
|
173
|
+
return handleContextMenu(event, nodes.folderId);
|
|
174
|
+
}
|
|
175
|
+
}, Array.isArray(nodes.children) ? nodes.children.map(function (node) {
|
|
176
|
+
return renderTree(node, false);
|
|
177
|
+
}) : null)))));
|
|
154
178
|
};
|
|
155
179
|
return /*#__PURE__*/React.createElement("div", {
|
|
156
|
-
onContextMenu:
|
|
180
|
+
onContextMenu: function onContextMenu(event) {
|
|
181
|
+
return handleContextMenu(event, null);
|
|
182
|
+
},
|
|
157
183
|
style: {
|
|
158
184
|
cursor: "context-menu"
|
|
159
185
|
}
|
|
@@ -166,13 +192,15 @@ function Tree(props) {
|
|
|
166
192
|
root: classes.treeView
|
|
167
193
|
},
|
|
168
194
|
sx: {
|
|
169
|
-
height:
|
|
195
|
+
height: "calc(100vh - 118px)",
|
|
170
196
|
flexGrow: 1,
|
|
171
197
|
minWidth: 450,
|
|
172
198
|
overflowY: "auto",
|
|
173
199
|
overflowX: "hidden"
|
|
174
200
|
}
|
|
175
|
-
}, folder.map(
|
|
201
|
+
}, folder.map(function (node) {
|
|
202
|
+
return renderTree(node, true);
|
|
203
|
+
})), /*#__PURE__*/React.createElement(_Menu.default, {
|
|
176
204
|
open: contextMenu !== null,
|
|
177
205
|
onClose: handleClose,
|
|
178
206
|
anchorReference: "anchorPosition",
|
|
@@ -184,7 +212,7 @@ function Tree(props) {
|
|
|
184
212
|
// elevation: 3,
|
|
185
213
|
sx: {
|
|
186
214
|
overflow: "visible",
|
|
187
|
-
filter:
|
|
215
|
+
filter: "drop-shadow(0 0 -1rem #667cbc)",
|
|
188
216
|
mt: 1.5,
|
|
189
217
|
"& .MuiPaper-root-MuiMenu-paper-MuiPaper-root-MuiPopover-paper": {
|
|
190
218
|
top: "6px !important"
|
package/components/tree/style.js
CHANGED
|
@@ -5,25 +5,28 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _styles = require("@mui/styles");
|
|
8
|
-
var _default =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
8
|
+
var _default = (0, _styles.makeStyles)(function (theme) {
|
|
9
|
+
return {
|
|
10
|
+
treeView: {
|
|
11
|
+
height: "calc(100vh - 118px)",
|
|
12
|
+
flexGrow: 1,
|
|
13
|
+
overflowY: "auto",
|
|
14
|
+
overflowX: "hidden",
|
|
15
|
+
"&::-webkit-scrollbar": {
|
|
16
|
+
width: "6px"
|
|
17
|
+
},
|
|
18
|
+
"&::-webkit-scrollbar-track": {
|
|
19
|
+
background: "#f1f1f1"
|
|
20
|
+
},
|
|
21
|
+
"&::-webkit-scrollbar-thumb": {
|
|
22
|
+
backgroundColor: "#e4e4e4",
|
|
23
|
+
borderRadius: "3px",
|
|
24
|
+
opacity: 0.5,
|
|
25
|
+
"&:hover": {
|
|
26
|
+
background: "#555"
|
|
27
|
+
}
|
|
26
28
|
}
|
|
27
29
|
}
|
|
28
|
-
}
|
|
29
|
-
})
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
exports.default = _default;
|