tenjin-ui-kit 0.3.72-dev-1 → 0.3.73

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.
Files changed (104) hide show
  1. package/common/hooks/apiHooks.js +91 -199
  2. package/common/hooks/newApiHook.js +127 -258
  3. package/common/utils/security/index.js +2 -2
  4. package/common/utils/security/securityConfig.js +1 -2
  5. package/components/Canvas.js +172 -101
  6. package/components/DragBox/index.js +21 -31
  7. package/components/InputWithChip/index.js +178 -83
  8. package/components/RightContext/index.js +17 -41
  9. package/components/WorkFlow.js +19 -29
  10. package/components/WorkFlowBuilder.js +32 -56
  11. package/components/alert/Style.js +11 -14
  12. package/components/alert/index.js +8 -14
  13. package/components/attachment/index.js +26 -31
  14. package/components/authenticationProvider/AuthError.js +3 -4
  15. package/components/authenticationProvider/AuthLoader.js +3 -4
  16. package/components/authenticationProvider/index.js +58 -130
  17. package/components/avatar/index.js +24 -23
  18. package/components/avatar/styles.js +76 -77
  19. package/components/breadCrumbs/index.js +64 -89
  20. package/components/breadCrumbs/style.js +1 -4
  21. package/components/browsingTestCaseLayout/DetailsViewLayout/DetailsViewContent/index.js +7 -6
  22. package/components/browsingTestCaseLayout/DetailsViewLayout/DetailsViewContent/style.js +5 -8
  23. package/components/browsingTestCaseLayout/DetailsViewLayout/DetailsViewHeader/index.js +7 -6
  24. package/components/browsingTestCaseLayout/TreeViewLayout/TreeViewContent/Index.js +8 -7
  25. package/components/browsingTestCaseLayout/TreeViewLayout/TreeViewHeader/Index.js +8 -7
  26. package/components/browsingTestCaseLayout/TreeViewLayout/TreeViewHeader/style.js +16 -19
  27. package/components/browsingTestCaseLayout/index.js +30 -46
  28. package/components/button/index.js +47 -58
  29. package/components/chatBotModal/index.js +40 -61
  30. package/components/checkBox/index.js +8 -10
  31. package/components/combobox/index.js +66 -100
  32. package/components/divider/index.js +9 -18
  33. package/components/editableField/index.js +19 -46
  34. package/components/error/index.js +6 -12
  35. package/components/errorBoundary/index.js +74 -98
  36. package/components/fileUploader/index.js +46 -58
  37. package/components/fileUploader/style.js +46 -49
  38. package/components/filter/ValueSelector.js +149 -245
  39. package/components/filter/index.js +45 -71
  40. package/components/iconButton/index.js +3 -4
  41. package/components/input/index.js +60 -74
  42. package/components/layout/index.js +36 -49
  43. package/components/layout/main/index.js +13 -14
  44. package/components/layout/main/style.js +11 -14
  45. package/components/layout/pageContent/index.js +8 -7
  46. package/components/layout/sidebar/FlatMenu.js +51 -47
  47. package/components/layout/sidebar/GroupedIconMenu.js +169 -194
  48. package/components/layout/sidebar/GroupedMenu.js +45 -50
  49. package/components/layout/sidebar/ProjectMenu.js +165 -185
  50. package/components/layout/sidebar/index.js +27 -26
  51. package/components/layout/sidebar/style.js +138 -143
  52. package/components/layout/topBar/ProjectTopbar.js +91 -208
  53. package/components/layout/topBar/UserAvatar.js +53 -69
  54. package/components/layout/topBar/index.js +23 -41
  55. package/components/loader/index.js +9 -12
  56. package/components/menu/index.js +23 -42
  57. package/components/modal/Modal.js +5 -6
  58. package/components/modal/index.js +16 -20
  59. package/components/modal/style.js +53 -56
  60. package/components/optionMenu/index.js +32 -47
  61. package/components/pagination/index.js +23 -43
  62. package/components/pagination/style.js +25 -28
  63. package/components/paginationUpdated/index.js +22 -29
  64. package/components/paper/index.js +20 -22
  65. package/components/paper/style.js +24 -27
  66. package/components/reactSelect/index.js +64 -97
  67. package/components/reactSelect/style.js +131 -151
  68. package/components/richTextEditor/index.js +24 -48
  69. package/components/select/GroupedSelect.js +96 -99
  70. package/components/select/SimpleSelect.js +61 -103
  71. package/components/select/index.js +56 -69
  72. package/components/simpleSelect/index.js +18 -22
  73. package/components/sort/index.js +23 -36
  74. package/components/switch/index.js +14 -15
  75. package/components/switch/style.js +29 -32
  76. package/components/switch/switch.js +30 -47
  77. package/components/table/ReactTable.js +59 -83
  78. package/components/table/SimpleTable.js +67 -91
  79. package/components/table/index.js +300 -206
  80. package/components/text/index.js +22 -30
  81. package/components/timeStamp/index.js +4 -9
  82. package/components/timeStamp/style.js +12 -15
  83. package/components/topBar/index.js +86 -102
  84. package/components/tree/index.js +30 -58
  85. package/components/tree/style.js +20 -23
  86. package/components/valuePicker/ValueSelector.js +78 -160
  87. package/components/valuePicker/index.js +30 -50
  88. package/components/wrapperLayout/layout/index.js +8 -7
  89. package/components/wrapperLayout/main/index.js +8 -7
  90. package/components/wrapperLayout/main/pageContainer/index.js +6 -5
  91. package/components/wrapperLayout/main/sideBar/index.js +171 -175
  92. package/components/wrapperLayout/main/sideBar/style.js +177 -183
  93. package/components/wrapperLayout/topBar/UserAvatar.js +6 -5
  94. package/components/wrapperLayout/topBar/avatar.js +15 -18
  95. package/components/wrapperLayout/topBar/index.js +115 -107
  96. package/components/wrapperLayout/topBar/menuIcon.js +6 -5
  97. package/components/wrapperLayout/topBar/style.js +63 -64
  98. package/http/index.js +92 -188
  99. package/index.js +53 -55
  100. package/package.json +3 -3
  101. package/templates/listPage/index.js +168 -196
  102. package/themes/default.js +5 -7
  103. package/themes/defaultSmall.js +2 -3
  104. package/themes/responsiveTheme.js +6 -8
@@ -6,191 +6,185 @@ 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(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
- 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); }
11
- 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; }
12
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
13
- 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); }
14
- var drawerWidth = 248;
15
- var useStyles = (0, _styles.makeStyles)(function () {
16
- return {
17
- drawerClose: _defineProperty({
18
- transition: _default2.default.transitions.create('width', {
19
- easing: _default2.default.transitions.easing.sharp,
20
- duration: _default2.default.transitions.duration.leavingScreen
21
- }),
22
- overflowX: 'hidden',
23
- width: _default2.default.spacing(7) + '1px'
24
- }, _default2.default.breakpoints.up('sm'), {
25
- width: _default2.default.spacing(8.75) + '2px'
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
+ const drawerWidth = 248;
11
+ const useStyles = (0, _styles.makeStyles)(() => ({
12
+ drawerClose: {
13
+ transition: _default2.default.transitions.create('width', {
14
+ easing: _default2.default.transitions.easing.sharp,
15
+ duration: _default2.default.transitions.duration.leavingScreen
26
16
  }),
27
- drawerOpen: {
28
- width: drawerWidth,
29
- transition: _default2.default.transitions.create('width', {
30
- easing: _default2.default.transitions.easing.sharp,
31
- duration: _default2.default.transitions.duration.enteringScreen
32
- })
33
- },
34
- drawer: {
35
- flexShrink: 0,
36
- whiteSpace: 'nowrap',
37
- boxShadow: '0px 3px 30px #667CBC30',
38
- '& .MuiPaper-root': {
39
- borderRadius: '.3rem',
40
- position: 'relative',
41
- display: 'flex',
42
- flexFlow: 'column'
43
- }
44
- },
45
- toolbar: {
17
+ overflowX: 'hidden',
18
+ width: _default2.default.spacing(7) + '1px',
19
+ [_default2.default.breakpoints.up('sm')]: {
20
+ width: _default2.default.spacing(8.75) + '2px'
21
+ }
22
+ },
23
+ drawerOpen: {
24
+ width: drawerWidth,
25
+ transition: _default2.default.transitions.create('width', {
26
+ easing: _default2.default.transitions.easing.sharp,
27
+ duration: _default2.default.transitions.duration.enteringScreen
28
+ })
29
+ },
30
+ drawer: {
31
+ flexShrink: 0,
32
+ whiteSpace: 'nowrap',
33
+ boxShadow: '0px 3px 30px #667CBC30',
34
+ '& .MuiPaper-root': {
35
+ borderRadius: '.3rem',
36
+ position: 'relative',
46
37
  display: 'flex',
47
- justifyContent: 'center',
48
- flexDirection: 'column',
49
- height: '100%'
50
- },
51
- navigationArrow: {
52
- transition: '.5s'
53
- },
54
- rightArrow: {
55
- transform: 'rotate(-180deg)'
56
- },
57
- list: {
58
- margin: _default2.default.spacing(2.5, 0.8),
59
- overflow: 'hidden'
60
- },
61
- listItem: {
38
+ flexFlow: 'column'
39
+ }
40
+ },
41
+ toolbar: {
42
+ display: 'flex',
43
+ justifyContent: 'center',
44
+ flexDirection: 'column',
45
+ height: '100%'
46
+ },
47
+ navigationArrow: {
48
+ transition: '.5s'
49
+ },
50
+ rightArrow: {
51
+ transform: 'rotate(-180deg)'
52
+ },
53
+ list: {
54
+ margin: _default2.default.spacing(2.5, 0.8),
55
+ overflow: 'hidden'
56
+ },
57
+ listItem: {
58
+ display: 'flex',
59
+ textDecoration: 'none',
60
+ transition: '.3s',
61
+ color: _default2.default.palette.text.main,
62
+ alignItems: 'center',
63
+ borderRadius: '.3rem',
64
+ marginBottom: _default2.default.spacing(2),
65
+ '& .MuiListItemIcon-root': {
66
+ marginLeft: _default2.default.spacing(0.5),
67
+ minHeight: '30px',
68
+ minWidth: '0px',
62
69
  display: 'flex',
63
- textDecoration: 'none',
64
- transition: '.3s',
65
- color: _default2.default.palette.text.main,
66
70
  alignItems: 'center',
67
- borderRadius: '.3rem',
68
- marginBottom: _default2.default.spacing(2),
69
- '& .MuiListItemIcon-root': {
70
- marginLeft: _default2.default.spacing(0.5),
71
- minHeight: '30px',
72
- minWidth: '0px',
73
- display: 'flex',
74
- alignItems: 'center',
75
- justifyContent: 'center'
76
- },
77
- '& .MuiListItemIcon-root .icon': {
78
- transition: '.5s',
79
- color: _default2.default.palette.primary.main,
80
- fontSize: "1rem"
81
- },
82
- '& .MuiTypography-root': {
83
- fontWeight: 600,
84
- fontSize: '1vw',
85
- // fontFamily: theme.typography.fontFamily,
86
- marginLeft: '1rem'
87
- }
88
- },
89
- listItemActive: {
90
- background: 'linear-gradient(180deg, rgba(97,94,173,1) 29%, rgba(71,66,156,1) 100%)',
91
- color: 'white',
92
- width: '100%',
93
- '& .MuiListItemIcon-root .icon': {
94
- color: 'white'
95
- },
96
- '& .MuiListItemIcon-root': {
97
- color: 'white'
98
- }
99
- },
100
- sideBarIcon: {
101
- margin: 'auto .8rem .8rem .8rem',
102
- width: 'calc(100% - 1.4rem)',
103
- backgroundColor: '#EEF3FC',
104
- borderRadius: '7px !important',
105
- display: 'flex',
106
- justifyContent: 'center',
107
- alignItems: 'center'
108
- },
109
- sidebarMenuContainer: {
110
- flexGrow: 1
111
- },
112
- scrollableList: {
113
- height: '100%',
114
- maxHeight: '100%',
115
- overflowY: 'auto',
116
- padding: '0.5rem 0.5rem 0.5rem 0.6rem'
117
- },
118
- tooltip: {
119
- fontSize: _default2.default.typography.fontSize
120
- },
121
- wrapper: {
122
- backgroundColor: '#fff !important',
123
- // margin: '0.5rem !important',
124
- marginRight: '0.5rem !important',
125
- height: 'calc(100vh - 76.5px) !important',
126
- overflowY: 'auto !important',
127
- borderRadius: '7px !important',
128
- width: '304px !important',
129
- padding: '8px !important',
130
- minWidth: '304px !important'
131
- },
132
- wrapper___webkit_scrollbar: {
133
- width: '1px',
134
- height: '1px !important'
135
- },
136
- wrapper___webkit_scrollbar_thumb: {
137
- background: '#c5c5c5'
138
- },
139
- headstyle: {
140
- display: 'flex !important',
141
- flexDirection: 'column !important',
142
- paddingLeft: '0.4rem'
143
- },
144
- menustyle: {
145
- color: '#d6d9e0',
146
- fontSize: '12px',
147
- fontFamily: '"Segoe UI"',
148
- textTransform: 'uppercase',
149
- opacity: '1',
150
- fontWeight: '600',
151
- padding: '0.5rem'
152
- },
153
- menuItem: {
154
- color: '#44409a !important',
155
- opacity: '1 !important',
156
- fontFamily: '"Segoe UI" !important',
157
- fontWeight: '600 !important',
158
- fontSize: '10px !important'
159
- },
160
- menuTitle: {
161
- marginBottom: '0.5rem'
162
- },
163
- headTitle: {
164
- top: '191px',
165
- left: '36px',
166
- width: '130px',
167
- height: '19px',
168
- // font: 'normal normal 600 14px/19px Segoe UI',
169
- font: 'normal normal 600 13px/14px Segoe UI',
170
- letterSpacing: '0px',
171
- color: '#d6d9e0',
172
- textAlign: 'left',
173
- textTransform: 'uppercase',
174
- opacity: '1'
175
- },
176
- menuOptionsTitle: {
177
- top: '236px',
178
- left: '36px',
179
- width: '150px',
180
- height: '24px',
181
- font: 'normal normal 600 13px/14px Segoe UI',
182
- letterSpacing: '0px',
183
- color: '#44409a',
184
- textAlign: 'left',
185
- opacity: '1',
186
- textTransform: 'none',
187
- padding: '0.3rem',
188
- cursor: 'pointer'
189
- },
190
- label: {
191
- fontSize: '0.8rem'
71
+ justifyContent: 'center'
72
+ },
73
+ '& .MuiListItemIcon-root .icon': {
74
+ transition: '.5s',
75
+ color: _default2.default.palette.primary.main,
76
+ fontSize: `1rem`
77
+ },
78
+ '& .MuiTypography-root': {
79
+ fontWeight: 600,
80
+ fontSize: '1vw',
81
+ // fontFamily: theme.typography.fontFamily,
82
+ marginLeft: '1rem'
192
83
  }
193
- };
194
- });
195
- var _default = useStyles;
196
- exports.default = _default;
84
+ },
85
+ listItemActive: {
86
+ background: 'linear-gradient(180deg, rgba(97,94,173,1) 29%, rgba(71,66,156,1) 100%)',
87
+ color: 'white',
88
+ width: '100%',
89
+ '& .MuiListItemIcon-root .icon': {
90
+ color: 'white'
91
+ },
92
+ '& .MuiListItemIcon-root': {
93
+ color: 'white'
94
+ }
95
+ },
96
+ sideBarIcon: {
97
+ margin: 'auto .8rem .8rem .8rem',
98
+ width: 'calc(100% - 1.4rem)',
99
+ backgroundColor: '#EEF3FC',
100
+ borderRadius: '7px !important',
101
+ display: 'flex',
102
+ justifyContent: 'center',
103
+ alignItems: 'center'
104
+ },
105
+ sidebarMenuContainer: {
106
+ flexGrow: 1
107
+ },
108
+ scrollableList: {
109
+ height: '100%',
110
+ maxHeight: '100%',
111
+ overflowY: 'auto',
112
+ padding: '0.5rem 0.5rem 0.5rem 0.6rem'
113
+ },
114
+ tooltip: {
115
+ fontSize: _default2.default.typography.fontSize
116
+ },
117
+ wrapper: {
118
+ backgroundColor: '#fff !important',
119
+ // margin: '0.5rem !important',
120
+ marginRight: '0.5rem !important',
121
+ height: 'calc(100vh - 76.5px) !important',
122
+ overflowY: 'auto !important',
123
+ borderRadius: '7px !important',
124
+ width: '304px !important',
125
+ padding: '8px !important',
126
+ minWidth: '304px !important'
127
+ },
128
+ wrapper___webkit_scrollbar: {
129
+ width: '1px',
130
+ height: '1px !important'
131
+ },
132
+ wrapper___webkit_scrollbar_thumb: {
133
+ background: '#c5c5c5'
134
+ },
135
+ headstyle: {
136
+ display: 'flex !important',
137
+ flexDirection: 'column !important',
138
+ paddingLeft: '0.4rem'
139
+ },
140
+ menustyle: {
141
+ color: '#d6d9e0',
142
+ fontSize: '12px',
143
+ fontFamily: '"Segoe UI"',
144
+ textTransform: 'uppercase',
145
+ opacity: '1',
146
+ fontWeight: '600',
147
+ padding: '0.5rem'
148
+ },
149
+ menuItem: {
150
+ color: '#44409a !important',
151
+ opacity: '1 !important',
152
+ fontFamily: '"Segoe UI" !important',
153
+ fontWeight: '600 !important',
154
+ fontSize: '10px !important'
155
+ },
156
+ menuTitle: {
157
+ marginBottom: '0.5rem'
158
+ },
159
+ headTitle: {
160
+ top: '191px',
161
+ left: '36px',
162
+ width: '130px',
163
+ height: '19px',
164
+ // font: 'normal normal 600 14px/19px Segoe UI',
165
+ font: 'normal normal 600 13px/14px Segoe UI',
166
+ letterSpacing: '0px',
167
+ color: '#d6d9e0',
168
+ textAlign: 'left',
169
+ textTransform: 'uppercase',
170
+ opacity: '1'
171
+ },
172
+ menuOptionsTitle: {
173
+ top: '236px',
174
+ left: '36px',
175
+ width: '150px',
176
+ height: '24px',
177
+ font: 'normal normal 600 13px/14px Segoe UI',
178
+ letterSpacing: '0px',
179
+ color: '#44409a',
180
+ textAlign: 'left',
181
+ opacity: '1',
182
+ textTransform: 'none',
183
+ padding: '0.3rem',
184
+ cursor: 'pointer'
185
+ },
186
+ label: {
187
+ fontSize: '0.8rem'
188
+ }
189
+ }));
190
+ var _default = exports.default = useStyles;
@@ -7,11 +7,12 @@ exports.default = void 0;
7
7
  var _react = _interopRequireDefault(require("react"));
8
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
  var _text = _interopRequireDefault(require("../../text"));
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
- var UserAvatar = function UserAvatar(_ref) {
12
- var loggedInUser = _ref.loggedInUser;
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
+ const UserAvatar = _ref => {
12
+ let {
13
+ loggedInUser
14
+ } = _ref;
13
15
  return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_text.default, null, "UserAvatar"));
14
16
  };
15
17
  UserAvatar.propTypes = {};
16
- var _default = UserAvatar;
17
- exports.default = _default;
18
+ var _default = exports.default = UserAvatar;
@@ -9,21 +9,19 @@ var _material = require("@mui/material");
9
9
  var _Stack = _interopRequireDefault(require("@mui/material/Stack"));
10
10
  var _style = _interopRequireDefault(require("./style"));
11
11
  var _clsx = _interopRequireDefault(require("clsx"));
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
- 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); }
14
- 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; }
15
- 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); }
16
- 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); }
12
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
14
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
17
15
  function stringToColor(string) {
18
- var hash = 0;
19
- var i;
16
+ let hash = 0;
17
+ let i;
20
18
  for (i = 0; i < string.length; i += 1) {
21
19
  hash = string.charCodeAt(i) + ((hash << 5) - hash);
22
20
  }
23
- var color = "#";
21
+ let color = "#";
24
22
  for (i = 0; i < 3; i += 1) {
25
- var value = hash >> i * 8 & 0xff;
26
- color += "00".concat(value.toString(16)).slice(-2);
23
+ const value = hash >> i * 8 & 0xff;
24
+ color += `00${value.toString(16)}`.slice(-2);
27
25
  }
28
26
  return color;
29
27
  }
@@ -31,19 +29,18 @@ function stringAvatar(name, height, width) {
31
29
  return {
32
30
  sx: {
33
31
  bgcolor: stringToColor(name),
34
- height: "".concat(height, "vh"),
35
- width: "".concat(width, "vw"),
32
+ height: `${height}vh`,
33
+ width: `${width}vw`,
36
34
  fontSize: "1.2vw",
37
35
  padding: "1.2rem 1.2rem"
38
36
  },
39
- children: "".concat(name.split(" ")[0][0]).concat(name.split(" ")[1][0] === undefined ? "" : "".concat(name.split(" ")[1][0]))
37
+ children: `${name.split(" ")[0][0]}${name.split(" ")[1][0] === undefined ? "" : `${name.split(" ")[1][0]}`}`
40
38
  };
41
39
  }
42
40
  function Avatar(props) {
43
- var _props$loggedInUser, _props$loggedInUser2;
44
- var name = _typeof(props.loggedInUser) !== "object" ? props.loggedInUser : (_props$loggedInUser = props.loggedInUser) === null || _props$loggedInUser === void 0 ? void 0 : _props$loggedInUser.firstName;
45
- var lastName = ((_props$loggedInUser2 = props.loggedInUser) === null || _props$loggedInUser2 === void 0 ? void 0 : _props$loggedInUser2.lastName) !== undefined ? props.loggedInUser.lastName : "";
46
- var classes = (0, _style.default)();
41
+ let name = typeof props.loggedInUser !== "object" ? props.loggedInUser : props.loggedInUser?.firstName;
42
+ let lastName = props.loggedInUser?.lastName !== undefined ? props.loggedInUser.lastName : "";
43
+ const classes = (0, _style.default)();
47
44
  return /*#__PURE__*/React.createElement(_Stack.default, {
48
45
  direction: "row",
49
46
  spacing: 2
@@ -53,5 +50,5 @@ function Avatar(props) {
53
50
  ,
54
51
  className: (0, _clsx.default)(classes.avatar, "avatar", classes[props.size]),
55
52
  size: props.size
56
- }, stringAvatar((name === null || name === void 0 ? void 0 : name.toUpperCase()) + " " + (lastName === null || lastName === void 0 ? void 0 : lastName.toUpperCase()), props.height, props.width))));
53
+ }, stringAvatar(name?.toUpperCase() + " " + lastName?.toUpperCase(), props.height, props.width))));
57
54
  }