tenjin-ui-kit 0.3.70 → 0.3.72-dev
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 +155 -0
- package/common/hooks/newApiHook.js +188 -0
- package/{dist/common → common}/utils/security/index.js +2 -2
- package/{dist/common → common}/utils/security/securityConfig.js +1 -2
- package/components/Canvas.js +330 -0
- package/components/DragBox/index.js +40 -0
- package/components/InputWithChip/index.js +294 -0
- package/{dist/components → components}/RightContext/index.js +19 -28
- package/components/WorkFlow.js +42 -0
- package/components/WorkFlowBuilder.js +115 -0
- package/components/alert/Style.js +20 -0
- package/components/alert/index.js +67 -0
- package/{dist/components → components}/attachment/index.js +21 -28
- package/{dist/components → components}/authenticationProvider/AuthError.js +3 -4
- package/{dist/components → components}/authenticationProvider/AuthLoader.js +3 -4
- package/components/authenticationProvider/index.js +110 -0
- package/{dist/components → components}/avatar/index.js +13 -14
- package/components/avatar/styles.js +91 -0
- package/components/breadCrumbs/index.js +169 -0
- package/{dist/components → components}/breadCrumbs/style.js +1 -4
- package/{dist/components → components}/browsingTestCaseLayout/DetailsViewLayout/DetailsViewContent/index.js +5 -6
- package/{dist/components → components}/browsingTestCaseLayout/DetailsViewLayout/DetailsViewContent/style.js +5 -8
- package/{dist/components → components}/browsingTestCaseLayout/DetailsViewLayout/DetailsViewHeader/index.js +4 -5
- package/{dist/components → components}/browsingTestCaseLayout/TreeViewLayout/TreeViewContent/Index.js +4 -5
- package/{dist/components → components}/browsingTestCaseLayout/TreeViewLayout/TreeViewHeader/Index.js +5 -6
- package/components/browsingTestCaseLayout/TreeViewLayout/TreeViewHeader/style.js +23 -0
- package/{dist/components → components}/browsingTestCaseLayout/index.js +25 -30
- package/components/button/index.js +133 -0
- package/{dist/components → components}/chatBotModal/index.js +36 -45
- package/components/checkBox/index.js +29 -0
- package/{dist/components → components}/combobox/index.js +51 -72
- package/components/divider/index.js +37 -0
- package/{dist/components → components}/editableField/index.js +19 -28
- package/{dist/components → components}/error/index.js +6 -12
- package/components/errorBoundary/index.js +140 -0
- package/components/fileUploader/index.js +151 -0
- package/components/fileUploader/style.js +57 -0
- package/components/filter/ValueSelector.js +333 -0
- package/{dist/components → components}/filter/index.js +26 -33
- package/{dist/components → components}/iconButton/index.js +3 -4
- package/components/input/index.js +167 -0
- package/components/layout/index.js +94 -0
- package/components/layout/main/index.js +24 -0
- package/components/layout/main/style.js +19 -0
- package/{dist/components → components}/layout/pageContent/index.js +6 -7
- package/components/layout/sidebar/FlatMenu.js +64 -0
- package/components/layout/sidebar/GroupedIconMenu.js +233 -0
- package/components/layout/sidebar/GroupedMenu.js +57 -0
- package/components/layout/sidebar/ProjectMenu.js +223 -0
- package/components/layout/sidebar/index.js +88 -0
- package/components/layout/sidebar/style.js +149 -0
- package/components/layout/topBar/ProjectTopbar.js +388 -0
- package/components/layout/topBar/UserAvatar.js +138 -0
- package/components/layout/topBar/index.js +121 -0
- package/{dist/components → components}/loader/index.js +9 -12
- package/components/menu/index.js +71 -0
- package/{dist/components → components}/modal/Modal.js +5 -6
- package/components/modal/index.js +88 -0
- package/components/modal/style.js +65 -0
- package/components/optionMenu/index.js +105 -0
- package/components/pagination/index.js +114 -0
- package/components/pagination/style.js +33 -0
- package/components/paginationUpdated/index.js +74 -0
- package/components/paper/index.js +43 -0
- package/components/paper/style.js +31 -0
- package/components/reactSelect/index.js +195 -0
- package/components/reactSelect/style.js +130 -0
- package/components/richTextEditor/index.js +64 -0
- package/components/select/GroupedSelect.js +167 -0
- package/components/select/SimpleSelect.js +184 -0
- package/{dist/components → components}/select/index.js +38 -54
- package/components/simpleSelect/index.js +53 -0
- package/{dist/components → components}/sort/index.js +19 -22
- package/{dist/components → components}/switch/index.js +10 -11
- package/components/switch/style.js +39 -0
- package/{dist/components → components}/switch/switch.js +17 -23
- package/components/table/ReactTable.js +101 -0
- package/components/table/SimpleTable.js +117 -0
- package/components/table/index.js +381 -0
- package/components/text/index.js +65 -0
- package/{dist/components → components}/timeStamp/index.js +4 -6
- package/components/timeStamp/style.js +20 -0
- package/components/topBar/index.js +169 -0
- package/{dist/components → components}/tree/index.js +29 -47
- package/components/tree/style.js +29 -0
- package/components/valuePicker/ValueSelector.js +205 -0
- package/{dist/components → components}/valuePicker/index.js +19 -26
- package/{dist/components → components}/wrapperLayout/layout/index.js +4 -5
- package/{dist/components → components}/wrapperLayout/main/index.js +4 -5
- package/{dist/components → components}/wrapperLayout/main/pageContainer/index.js +4 -5
- package/components/wrapperLayout/main/sideBar/index.js +272 -0
- package/components/wrapperLayout/main/sideBar/style.js +190 -0
- package/{dist/components → components}/wrapperLayout/topBar/UserAvatar.js +4 -5
- package/components/wrapperLayout/topBar/avatar.js +55 -0
- package/components/wrapperLayout/topBar/index.js +196 -0
- package/{dist/components → components}/wrapperLayout/topBar/menuIcon.js +4 -5
- package/components/wrapperLayout/topBar/style.js +74 -0
- package/http/index.js +133 -0
- package/{dist/index.js → index.js} +53 -55
- package/package.json +5 -3
- package/{dist/templates → templates}/listPage/index.js +36 -57
- package/{dist/themes → themes}/default.js +5 -7
- package/{dist/themes → themes}/defaultSmall.js +2 -3
- package/{dist/themes → themes}/responsiveTheme.js +6 -8
- package/.dockerignore +0 -6
- package/.storybook/main.js +0 -16
- package/.storybook/preview.js +0 -11
- package/Dockerfile +0 -17
- package/Jenkinsfile +0 -66
- package/build/asset-manifest.json +0 -16
- package/build/favicon.ico +0 -0
- package/build/index.html +0 -1
- package/build/logo192.png +0 -0
- package/build/logo512.png +0 -0
- package/build/manifest.json +0 -25
- package/build/robots.txt +0 -3
- package/build/static/css/main.522396f6.css +0 -2
- package/build/static/css/main.522396f6.css.map +0 -1
- package/build/static/js/787.18cf14d0.chunk.js +0 -2
- package/build/static/js/787.18cf14d0.chunk.js.map +0 -1
- package/build/static/js/main.d71fecac.js +0 -3
- package/build/static/js/main.d71fecac.js.LICENSE.txt +0 -50
- package/build/static/js/main.d71fecac.js.map +0 -1
- package/build/static/media/logo.6ce24c58023cc2f8fd88fe9d219db6c6.svg +0 -1
- package/build/tenjinLogo.png +0 -0
- package/dist/common/hooks/apiHooks.js +0 -223
- package/dist/common/hooks/newApiHook.js +0 -270
- package/dist/components/Canvas.js +0 -254
- package/dist/components/DragBox/index.js +0 -45
- package/dist/components/InputWithChip/index.js +0 -187
- package/dist/components/WorkFlow.js +0 -47
- package/dist/components/WorkFlowBuilder.js +0 -130
- package/dist/components/alert/Style.js +0 -23
- package/dist/components/alert/index.js +0 -69
- package/dist/components/authenticationProvider/index.js +0 -166
- package/dist/components/avatar/styles.js +0 -94
- package/dist/components/breadCrumbs/index.js +0 -180
- package/dist/components/browsingTestCaseLayout/TreeViewLayout/TreeViewHeader/style.js +0 -26
- package/dist/components/button/index.js +0 -140
- package/dist/components/checkBox/index.js +0 -30
- package/dist/components/divider/index.js +0 -41
- package/dist/components/errorBoundary/index.js +0 -160
- package/dist/components/fileUploader/index.js +0 -156
- package/dist/components/fileUploader/style.js +0 -60
- package/dist/components/filter/ValueSelector.js +0 -405
- package/dist/components/input/index.js +0 -174
- package/dist/components/layout/index.js +0 -98
- package/dist/components/layout/main/index.js +0 -27
- package/dist/components/layout/main/style.js +0 -22
- package/dist/components/layout/sidebar/FlatMenu.js +0 -64
- package/dist/components/layout/sidebar/GroupedIconMenu.js +0 -246
- package/dist/components/layout/sidebar/GroupedMenu.js +0 -67
- package/dist/components/layout/sidebar/ProjectMenu.js +0 -230
- package/dist/components/layout/sidebar/index.js +0 -91
- package/dist/components/layout/sidebar/style.js +0 -154
- package/dist/components/layout/topBar/ProjectTopbar.js +0 -338
- package/dist/components/layout/topBar/UserAvatar.js +0 -145
- package/dist/components/layout/topBar/index.js +0 -132
- package/dist/components/menu/index.js +0 -80
- package/dist/components/modal/index.js +0 -91
- package/dist/components/modal/style.js +0 -68
- package/dist/components/optionMenu/index.js +0 -112
- package/dist/components/pagination/index.js +0 -129
- package/dist/components/pagination/style.js +0 -36
- package/dist/components/paginationUpdated/index.js +0 -75
- package/dist/components/paper/index.js +0 -44
- package/dist/components/paper/style.js +0 -34
- package/dist/components/reactSelect/index.js +0 -212
- package/dist/components/reactSelect/style.js +0 -163
- package/dist/components/richTextEditor/index.js +0 -83
- package/dist/components/select/GroupedSelect.js +0 -183
- package/dist/components/select/SimpleSelect.js +0 -212
- package/dist/components/simpleSelect/index.js +0 -56
- package/dist/components/switch/style.js +0 -42
- package/dist/components/table/ReactTable.js +0 -118
- package/dist/components/table/SimpleTable.js +0 -136
- package/dist/components/table/index.js +0 -256
- package/dist/components/text/index.js +0 -67
- package/dist/components/timeStamp/style.js +0 -23
- package/dist/components/topBar/index.js +0 -176
- package/dist/components/tree/style.js +0 -32
- package/dist/components/valuePicker/ValueSelector.js +0 -273
- package/dist/components/wrapperLayout/main/sideBar/index.js +0 -262
- package/dist/components/wrapperLayout/main/sideBar/style.js +0 -196
- package/dist/components/wrapperLayout/topBar/avatar.js +0 -57
- package/dist/components/wrapperLayout/topBar/index.js +0 -182
- package/dist/components/wrapperLayout/topBar/style.js +0 -77
- package/dist/http/index.js +0 -226
- package/public/favicon.ico +0 -0
- package/public/index.html +0 -43
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/manifest.json +0 -25
- package/public/robots.txt +0 -3
- package/public/tenjinLogo.png +0 -0
- /package/{dist/assets → assets}/images/MicrosoftTeams-image (1).png +0 -0
- /package/{dist/assets → assets}/images/tenjin-4.0-logo.png +0 -0
- /package/{dist/components → components}/RightContext/index.css +0 -0
- /package/{dist/components → components}/browsingTestCaseLayout/style.css +0 -0
- /package/{dist/components → components}/errorBoundary/Error.jpg +0 -0
- /package/{dist/components → components}/iconButton/style.js +0 -0
- /package/{dist/components → components}/richTextEditor/style.js +0 -0
- /package/{dist/components → components}/wrapperLayout/layout/style.js +0 -0
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -16,35 +15,34 @@ var _bi = require("react-icons/bi");
|
|
|
16
15
|
var _text = _interopRequireDefault(require("../text"));
|
|
17
16
|
var _button = _interopRequireDefault(require("../button"));
|
|
18
17
|
var _divider = _interopRequireDefault(require("../divider"));
|
|
19
|
-
function _interopRequireDefault(
|
|
20
|
-
function
|
|
21
|
-
function
|
|
22
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
18
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
19
|
+
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); }
|
|
20
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
23
21
|
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
|
-
|
|
22
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
23
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
24
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
25
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } // import { Button, Divider, Text } from "tenjin-ui-kit";
|
|
26
|
+
const Sort = _ref => {
|
|
29
27
|
var _options$;
|
|
30
|
-
|
|
28
|
+
let onChange = _ref.onChange,
|
|
31
29
|
variant = _ref.variant,
|
|
32
30
|
columnName = _ref.columnName,
|
|
33
31
|
options = _ref.options,
|
|
34
32
|
defaultSelectedOptions = _ref.defaultSelectedOptions;
|
|
35
33
|
console.log({
|
|
36
|
-
defaultSelectedOptions
|
|
34
|
+
defaultSelectedOptions
|
|
37
35
|
});
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
const theme = (0, _material.useTheme)();
|
|
37
|
+
const _useState = (0, _react.useState)(null),
|
|
40
38
|
_useState2 = _slicedToArray(_useState, 2),
|
|
41
39
|
menuAnchor = _useState2[0],
|
|
42
40
|
setMenuAnchor = _useState2[1];
|
|
43
|
-
|
|
41
|
+
const _React$useState = _react.default.useState(defaultSelectedOptions ? defaultSelectedOptions : (_options$ = options[0]) === null || _options$ === void 0 ? void 0 : _options$.value),
|
|
44
42
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
45
43
|
value = _React$useState2[0],
|
|
46
44
|
setValue = _React$useState2[1];
|
|
47
|
-
(0, _react.useEffect)(
|
|
45
|
+
(0, _react.useEffect)(() => {
|
|
48
46
|
if (!defaultSelectedOptions) {
|
|
49
47
|
var _options$2;
|
|
50
48
|
setValue((_options$2 = options[0]) === null || _options$2 === void 0 ? void 0 : _options$2.value);
|
|
@@ -52,13 +50,13 @@ var Sort = function Sort(_ref) {
|
|
|
52
50
|
setValue(defaultSelectedOptions);
|
|
53
51
|
}
|
|
54
52
|
}, [defaultSelectedOptions]);
|
|
55
|
-
|
|
53
|
+
const handleMenuClose = () => {
|
|
56
54
|
setMenuAnchor(null);
|
|
57
55
|
};
|
|
58
|
-
|
|
56
|
+
const handleMenuOpen = e => {
|
|
59
57
|
setMenuAnchor(e.currentTarget);
|
|
60
58
|
};
|
|
61
|
-
|
|
59
|
+
const handleChange = event => {
|
|
62
60
|
setValue(event.target.value);
|
|
63
61
|
onChange(event.target.value);
|
|
64
62
|
};
|
|
@@ -129,7 +127,7 @@ var Sort = function Sort(_ref) {
|
|
|
129
127
|
name: "controlled-radio-buttons-group",
|
|
130
128
|
value: value,
|
|
131
129
|
onChange: handleChange
|
|
132
|
-
}, options === null || options === void 0 ? void 0 : options.map(
|
|
130
|
+
}, options === null || options === void 0 ? void 0 : options.map(a => {
|
|
133
131
|
return /*#__PURE__*/_react.default.createElement(_FormControlLabel.default, {
|
|
134
132
|
value: a.value,
|
|
135
133
|
control: /*#__PURE__*/_react.default.createElement(_Radio.default, null),
|
|
@@ -137,5 +135,4 @@ var Sort = function Sort(_ref) {
|
|
|
137
135
|
});
|
|
138
136
|
})))));
|
|
139
137
|
};
|
|
140
|
-
var _default = Sort;
|
|
141
|
-
exports.default = _default;
|
|
138
|
+
var _default = exports.default = Sort;
|
|
@@ -9,17 +9,17 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
var _default2 = _interopRequireDefault(require("../../themes/default"));
|
|
10
10
|
var _styles = require("@mui/material/styles");
|
|
11
11
|
var _text = _interopRequireDefault(require("../text"));
|
|
12
|
-
|
|
13
|
-
function _interopRequireDefault(
|
|
14
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
15
|
-
function _objectWithoutProperties(
|
|
16
|
-
function _objectWithoutPropertiesLoose(
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
const _excluded = ["label"];
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
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); }
|
|
15
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
16
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
17
|
+
const Switch = props => {
|
|
18
|
+
const label = props.label,
|
|
19
19
|
rest = _objectWithoutProperties(props, _excluded);
|
|
20
|
-
|
|
20
|
+
const MuiSwitchStyledComp = (0, _styles.styled)(_material.Switch)(_ref => {
|
|
21
21
|
var _theme$palette;
|
|
22
|
-
|
|
22
|
+
let MuiSwitch = _ref.MuiSwitch;
|
|
23
23
|
return {
|
|
24
24
|
padding: 10,
|
|
25
25
|
marginTop: "-6px",
|
|
@@ -68,5 +68,4 @@ Switch.defaultProps = {
|
|
|
68
68
|
defaultChecked: true,
|
|
69
69
|
labelPlacement: "right"
|
|
70
70
|
};
|
|
71
|
-
var _default = Switch;
|
|
72
|
-
exports.default = _default;
|
|
71
|
+
var _default = exports.default = Switch;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _styles = require("@mui/styles");
|
|
8
|
+
var _default2 = _interopRequireDefault(require("../../themes/default"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
var _default = exports.default = (0, _styles.makeStyles)(() => ({
|
|
11
|
+
labelLarge: {
|
|
12
|
+
"@media (min-width:1101px) and (max-width:1200px)": {
|
|
13
|
+
fontSize: "1.5rem !important",
|
|
14
|
+
fontWeight: "".concat(500, " !important")
|
|
15
|
+
},
|
|
16
|
+
"@media (min-width:769px) and (max-width:1100px)": {
|
|
17
|
+
fontSize: "1.3rem !important",
|
|
18
|
+
fontWeight: "".concat(500, " !important")
|
|
19
|
+
},
|
|
20
|
+
"@media (min-width:600px) and (max-width:768px)": {
|
|
21
|
+
fontSize: "1rem",
|
|
22
|
+
fontWeight: "".concat(500, " !important")
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
labelSmall: {
|
|
26
|
+
"@media (min-width:1101px) and (max-width:1200px)": {
|
|
27
|
+
fontSize: "0.85rem !important",
|
|
28
|
+
fontWeight: "".concat(500, " !important")
|
|
29
|
+
},
|
|
30
|
+
"@media (min-width:769px) and (max-width:1100px)": {
|
|
31
|
+
fontSize: "0.75rem !important",
|
|
32
|
+
fontWeight: "".concat(500, " !important")
|
|
33
|
+
},
|
|
34
|
+
"@media (min-width:600px) and (max-width:768px)": {
|
|
35
|
+
fontSize: "0.75rem",
|
|
36
|
+
fontWeight: "".concat(500, " !important")
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}));
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -13,17 +12,16 @@ var _material = require("@mui/material");
|
|
|
13
12
|
var _style = _interopRequireDefault(require("./style"));
|
|
14
13
|
var _default = _interopRequireDefault(require("../../themes/default"));
|
|
15
14
|
var _text = _interopRequireDefault(require("../text"));
|
|
16
|
-
function _interopRequireDefault(
|
|
17
|
-
function
|
|
18
|
-
function
|
|
19
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
15
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
+
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); }
|
|
17
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
20
18
|
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."); }
|
|
21
|
-
function _unsupportedIterableToArray(
|
|
22
|
-
function _arrayLikeToArray(
|
|
23
|
-
function _iterableToArrayLimit(
|
|
24
|
-
function _arrayWithHoles(
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
20
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
21
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
22
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
23
|
+
const MuiSwitchStyledComp = (0, _styles.styled)(_material.Switch)(_ref => {
|
|
24
|
+
let MuiSwitch = _ref.MuiSwitch;
|
|
27
25
|
return {
|
|
28
26
|
padding: 10,
|
|
29
27
|
marginTop: "-6px",
|
|
@@ -56,17 +54,17 @@ var MuiSwitchStyledComp = (0, _styles.styled)(_material.Switch)(function (_ref)
|
|
|
56
54
|
});
|
|
57
55
|
function Switch(props) {
|
|
58
56
|
var _props$objects, _props$objects2, _props$label;
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
const classes = (0, _style.default)();
|
|
58
|
+
const _React$useState = React.useState(props.checked),
|
|
61
59
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
62
60
|
switchChecked = _React$useState2[0],
|
|
63
61
|
setSwitchChecked = _React$useState2[1];
|
|
64
|
-
|
|
62
|
+
const onChangeEvent = () => {
|
|
65
63
|
setSwitchChecked(!switchChecked);
|
|
66
64
|
props.handleChange(!switchChecked);
|
|
67
65
|
};
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
const handleChange = keyId => {
|
|
67
|
+
const newData = props.objects.map(item => {
|
|
70
68
|
if (item.id === keyId) {
|
|
71
69
|
item.checked = item.checked === true ? false : true;
|
|
72
70
|
}
|
|
@@ -74,7 +72,7 @@ function Switch(props) {
|
|
|
74
72
|
});
|
|
75
73
|
props.setObjects(newData);
|
|
76
74
|
};
|
|
77
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, props.objects && ((_props$objects = props.objects) === null || _props$objects === void 0 ? void 0 : _props$objects.length) > 0 ? (_props$objects2 = props.objects) === null || _props$objects2 === void 0 ? void 0 : _props$objects2.map(
|
|
75
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, props.objects && ((_props$objects = props.objects) === null || _props$objects === void 0 ? void 0 : _props$objects.length) > 0 ? (_props$objects2 = props.objects) === null || _props$objects2 === void 0 ? void 0 : _props$objects2.map((object, index) => {
|
|
78
76
|
var _object$label;
|
|
79
77
|
return /*#__PURE__*/React.createElement("div", {
|
|
80
78
|
className: classes.root
|
|
@@ -82,9 +80,7 @@ function Switch(props) {
|
|
|
82
80
|
label: /*#__PURE__*/React.createElement(_text.default, null, object.label && ((_object$label = object.label) === null || _object$label === void 0 ? void 0 : _object$label.length) > 0 ? object.label : ""),
|
|
83
81
|
control: /*#__PURE__*/React.createElement(MuiSwitchStyledComp, {
|
|
84
82
|
checked: object.checked === true,
|
|
85
|
-
onChange:
|
|
86
|
-
return handleChange(object.id);
|
|
87
|
-
},
|
|
83
|
+
onChange: () => handleChange(object.id),
|
|
88
84
|
sx: {
|
|
89
85
|
"&:hover": {
|
|
90
86
|
backgroundColor: "transparent",
|
|
@@ -100,9 +96,7 @@ function Switch(props) {
|
|
|
100
96
|
}, /*#__PURE__*/React.createElement(_FormGroup.default, null, /*#__PURE__*/React.createElement(_FormControlLabel.default, {
|
|
101
97
|
control: /*#__PURE__*/React.createElement(MuiSwitchStyledComp, {
|
|
102
98
|
checked: switchChecked,
|
|
103
|
-
onChange:
|
|
104
|
-
return onChangeEvent();
|
|
105
|
-
}
|
|
99
|
+
onChange: () => onChangeEvent()
|
|
106
100
|
}),
|
|
107
101
|
label: /*#__PURE__*/React.createElement(_text.default, null, "`$", props.label && ((_props$label = props.label) === null || _props$label === void 0 ? void 0 : _props$label.length) > 0 ? props.label : "", "`"),
|
|
108
102
|
disabled: props.disabled && props.disabled
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
var _material = require("@mui/material");
|
|
10
|
+
var _text = _interopRequireDefault(require("../text"));
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
13
|
+
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."); }
|
|
14
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
15
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
16
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
17
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
18
|
+
const ReactTable = _ref => {
|
|
19
|
+
let columns = _ref.columns,
|
|
20
|
+
rows = _ref.rows,
|
|
21
|
+
sortable = _ref.sortable,
|
|
22
|
+
msg = _ref.msg;
|
|
23
|
+
const _React$useState = _react.default.useState({
|
|
24
|
+
column: null,
|
|
25
|
+
direction: "desc"
|
|
26
|
+
}),
|
|
27
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
28
|
+
sorting = _React$useState2[0],
|
|
29
|
+
setSorting = _React$useState2[1];
|
|
30
|
+
const handleSort = columnName => {
|
|
31
|
+
setSorting(prevSorting => ({
|
|
32
|
+
column: columnName,
|
|
33
|
+
direction: prevSorting.column === columnName && prevSorting.direction === "desc" ? "asc" : "desc"
|
|
34
|
+
}));
|
|
35
|
+
};
|
|
36
|
+
const sortedData = _react.default.useMemo(() => {
|
|
37
|
+
if (sorting !== null && sorting !== void 0 && sorting.column) {
|
|
38
|
+
const sortedArray = [...rows].sort((a, b) => {
|
|
39
|
+
const valueA = a[sorting.column];
|
|
40
|
+
const valueB = b[sorting.column];
|
|
41
|
+
if (typeof valueA === "string" && typeof valueB === "string") {
|
|
42
|
+
return sorting.direction === "asc" ? valueA.localeCompare(valueB) : valueB.localeCompare(valueA);
|
|
43
|
+
}
|
|
44
|
+
return sorting.direction === "asc" ? valueA - valueB : valueB - valueA;
|
|
45
|
+
});
|
|
46
|
+
return sortedArray;
|
|
47
|
+
}
|
|
48
|
+
return rows;
|
|
49
|
+
}, [rows, sorting]);
|
|
50
|
+
const theme = (0, _material.useTheme)();
|
|
51
|
+
return rows && (rows === null || rows === void 0 ? void 0 : rows.length) > 0 ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_material.TableContainer, null, /*#__PURE__*/_react.default.createElement(_material.Table, null, /*#__PURE__*/_react.default.createElement(_material.TableHead, null, /*#__PURE__*/_react.default.createElement(_material.TableRow, null, columns === null || columns === void 0 ? void 0 : columns.map(c => /*#__PURE__*/_react.default.createElement(_material.TableCell, {
|
|
52
|
+
key: c.name,
|
|
53
|
+
style: {
|
|
54
|
+
width: c.width
|
|
55
|
+
}
|
|
56
|
+
}, sortable ? /*#__PURE__*/_react.default.createElement(_material.TableSortLabel, {
|
|
57
|
+
active: sorting.column === c.name.toLowerCase(),
|
|
58
|
+
direction: sorting.column === c.name.toLowerCase() ? sorting.direction : "asc",
|
|
59
|
+
onClick: () => handleSort(c.name.toLowerCase())
|
|
60
|
+
}, /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
61
|
+
style: {
|
|
62
|
+
color: "#7D7D7D"
|
|
63
|
+
}
|
|
64
|
+
}, c.displayName)) : /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
65
|
+
style: {
|
|
66
|
+
color: "#7D7D7D"
|
|
67
|
+
}
|
|
68
|
+
}, c.displayName))))), /*#__PURE__*/_react.default.createElement(_material.TableBody, null, sortedData === null || sortedData === void 0 ? void 0 : sortedData.map(u => /*#__PURE__*/_react.default.createElement(_material.TableRow, {
|
|
69
|
+
key: u.id
|
|
70
|
+
}, columns === null || columns === void 0 ? void 0 : columns.map(c => /*#__PURE__*/_react.default.createElement(_material.TableCell, {
|
|
71
|
+
size: "small",
|
|
72
|
+
key: u[c.name],
|
|
73
|
+
style: {
|
|
74
|
+
width: c.width,
|
|
75
|
+
borderBottom: "none"
|
|
76
|
+
}
|
|
77
|
+
}, c.render ? c.render(u) : /*#__PURE__*/_react.default.createElement(_text.default, null, u[c.name]))))))))) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, " ", /*#__PURE__*/_react.default.createElement(_material.TableContainer, null, /*#__PURE__*/_react.default.createElement(_material.Table, null, /*#__PURE__*/_react.default.createElement(_material.TableHead, null, columns === null || columns === void 0 ? void 0 : columns.map(c => /*#__PURE__*/_react.default.createElement(_material.TableCell, {
|
|
78
|
+
key: c.name,
|
|
79
|
+
style: {
|
|
80
|
+
width: c.width,
|
|
81
|
+
color: "#7D7D7D",
|
|
82
|
+
borderBottom: "none"
|
|
83
|
+
}
|
|
84
|
+
}, /*#__PURE__*/_react.default.createElement(_text.default, null, c.displayName)))), " ")), /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
85
|
+
item: true,
|
|
86
|
+
xs: 11,
|
|
87
|
+
container: true,
|
|
88
|
+
justifyContent: "center"
|
|
89
|
+
}, /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
90
|
+
style: {
|
|
91
|
+
color: "grey",
|
|
92
|
+
marginTop: "calc(100vh - 750px)"
|
|
93
|
+
}
|
|
94
|
+
}, msg)));
|
|
95
|
+
};
|
|
96
|
+
ReactTable.propTypes = {
|
|
97
|
+
rows: _propTypes.default.array.isRequired,
|
|
98
|
+
columns: _propTypes.default.array.isRequired,
|
|
99
|
+
msg: _propTypes.default.string
|
|
100
|
+
};
|
|
101
|
+
var _default = exports.default = ReactTable;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _material = require("@mui/material");
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _text = _interopRequireDefault(require("../text"));
|
|
10
|
+
var _styles = require("@mui/styles");
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
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); }
|
|
13
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
14
|
+
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."); }
|
|
15
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
16
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
17
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
18
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
19
|
+
const useStyles = (0, _styles.makeStyles)(theme => ({
|
|
20
|
+
customCell: {
|
|
21
|
+
padding: "0px 1rem"
|
|
22
|
+
},
|
|
23
|
+
customTableContainer: {
|
|
24
|
+
overflowX: "initial"
|
|
25
|
+
}
|
|
26
|
+
}));
|
|
27
|
+
const SimpleTable = _ref => {
|
|
28
|
+
let rows = _ref.rows,
|
|
29
|
+
columns = _ref.columns,
|
|
30
|
+
size = _ref.size,
|
|
31
|
+
height = _ref.height,
|
|
32
|
+
isHeight = _ref.isHeight,
|
|
33
|
+
sx = _ref.sx;
|
|
34
|
+
const classes = useStyles();
|
|
35
|
+
const theme = (0, _material.useTheme)();
|
|
36
|
+
const _useState = (0, _react.useState)({
|
|
37
|
+
column: null,
|
|
38
|
+
direction: "desc"
|
|
39
|
+
}),
|
|
40
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
41
|
+
sorting = _useState2[0],
|
|
42
|
+
setSorting = _useState2[1];
|
|
43
|
+
const handleSort = columnName => {
|
|
44
|
+
setSorting(prevSorting => ({
|
|
45
|
+
column: columnName,
|
|
46
|
+
direction: prevSorting.column === columnName && prevSorting.direction === "desc" ? "asc" : "desc"
|
|
47
|
+
}));
|
|
48
|
+
};
|
|
49
|
+
const sortedData = _react.default.useMemo(() => {
|
|
50
|
+
if (sorting.column) {
|
|
51
|
+
const sortedArray = [...rows].sort((a, b) => {
|
|
52
|
+
const valueA = a[sorting.column];
|
|
53
|
+
const valueB = b[sorting.column];
|
|
54
|
+
if (typeof valueA === "string" && typeof valueB === "string") {
|
|
55
|
+
return sorting.direction === "asc" ? valueA.localeCompare(valueB) : valueB.localeCompare(valueA);
|
|
56
|
+
}
|
|
57
|
+
return sorting.direction === "asc" ? valueA - valueB : valueB - valueA;
|
|
58
|
+
});
|
|
59
|
+
return sortedArray;
|
|
60
|
+
}
|
|
61
|
+
return rows;
|
|
62
|
+
}, [rows, sorting]);
|
|
63
|
+
return rows && rows.length > 0 ? /*#__PURE__*/_react.default.createElement(_material.TableContainer, {
|
|
64
|
+
classes: {
|
|
65
|
+
root: classes.customTableContainer
|
|
66
|
+
}
|
|
67
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Table, {
|
|
68
|
+
size: size,
|
|
69
|
+
stickyHeader: true
|
|
70
|
+
}, /*#__PURE__*/_react.default.createElement(_material.TableHead, null, /*#__PURE__*/_react.default.createElement(_material.TableRow, null, columns && columns.map((c, index) => /*#__PURE__*/_react.default.createElement(_material.TableCell, {
|
|
71
|
+
key: index,
|
|
72
|
+
style: {
|
|
73
|
+
minWidth: c.minWidth || 80,
|
|
74
|
+
maxWidth: c.maxWidth || 240
|
|
75
|
+
}
|
|
76
|
+
}, /*#__PURE__*/_react.default.createElement(_material.TableSortLabel, {
|
|
77
|
+
active: sorting.column === c.name.toLowerCase(),
|
|
78
|
+
direction: sorting.column === c.name.toLowerCase() ? sorting.direction : "asc",
|
|
79
|
+
onClick: () => handleSort(c.name)
|
|
80
|
+
}, /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
81
|
+
semibold: true,
|
|
82
|
+
color: theme.palette.grey[500]
|
|
83
|
+
// textTransform="uppercase"
|
|
84
|
+
,
|
|
85
|
+
fontSize: theme.typography.fontSize - 1
|
|
86
|
+
}, c.displayName)))))), /*#__PURE__*/_react.default.createElement(_material.TableBody, null, sortedData.map((r, index) => /*#__PURE__*/_react.default.createElement(_material.TableRow, {
|
|
87
|
+
key: index,
|
|
88
|
+
hover: true
|
|
89
|
+
}, columns.map((c, index) => /*#__PURE__*/_react.default.createElement(_material.TableCell, {
|
|
90
|
+
className: isHeight && classes.customCell,
|
|
91
|
+
style: {
|
|
92
|
+
padding: "".concat(height || "0.5rem", " 1rem")
|
|
93
|
+
},
|
|
94
|
+
key: index
|
|
95
|
+
}, renderCellContent(r, c)))))))) : /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
96
|
+
height: "300px",
|
|
97
|
+
display: "flex",
|
|
98
|
+
alignItems: "center",
|
|
99
|
+
justifyContent: "center",
|
|
100
|
+
sx: sx
|
|
101
|
+
}, /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
102
|
+
color: theme.palette.grey[500],
|
|
103
|
+
semibold: true
|
|
104
|
+
}, "No records found"));
|
|
105
|
+
};
|
|
106
|
+
const renderCellContent = (row, column) => {
|
|
107
|
+
const name = column.name,
|
|
108
|
+
render = column.render;
|
|
109
|
+
let returnComponent;
|
|
110
|
+
if (render) {
|
|
111
|
+
returnComponent = render(row);
|
|
112
|
+
} else {
|
|
113
|
+
returnComponent = /*#__PURE__*/_react.default.createElement(_text.default, null, row[name]);
|
|
114
|
+
}
|
|
115
|
+
return returnComponent;
|
|
116
|
+
};
|
|
117
|
+
var _default = exports.default = SimpleTable;
|