tenjin-ui-kit 0.3.74 → 0.3.76
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 +91 -199
- package/common/hooks/newApiHook.js +127 -258
- package/common/utils/security/index.js +2 -2
- package/common/utils/security/securityConfig.js +1 -2
- package/components/Canvas.js +172 -101
- package/components/DragBox/index.js +21 -31
- package/components/InputWithChip/index.js +178 -83
- package/components/RightContext/index.js +17 -41
- package/components/WorkFlow.js +19 -29
- package/components/WorkFlowBuilder.js +32 -56
- package/components/alert/Style.js +11 -14
- package/components/alert/index.js +8 -14
- package/components/attachment/index.js +26 -31
- package/components/authenticationProvider/AuthError.js +3 -4
- package/components/authenticationProvider/AuthLoader.js +3 -4
- package/components/authenticationProvider/index.js +58 -130
- package/components/avatar/index.js +24 -23
- package/components/avatar/styles.js +76 -77
- package/components/breadCrumbs/index.js +64 -89
- package/components/breadCrumbs/style.js +1 -4
- package/components/browsingTestCaseLayout/DetailsViewLayout/DetailsViewContent/index.js +7 -6
- package/components/browsingTestCaseLayout/DetailsViewLayout/DetailsViewContent/style.js +5 -8
- package/components/browsingTestCaseLayout/DetailsViewLayout/DetailsViewHeader/index.js +7 -6
- package/components/browsingTestCaseLayout/TreeViewLayout/TreeViewContent/Index.js +8 -7
- package/components/browsingTestCaseLayout/TreeViewLayout/TreeViewHeader/Index.js +8 -7
- package/components/browsingTestCaseLayout/TreeViewLayout/TreeViewHeader/style.js +16 -19
- package/components/browsingTestCaseLayout/index.js +30 -46
- package/components/button/index.js +47 -58
- package/components/chatBotModal/index.js +40 -61
- package/components/checkBox/index.js +8 -10
- package/components/combobox/index.js +66 -100
- package/components/divider/index.js +9 -18
- package/components/editableField/index.js +19 -46
- package/components/error/index.js +6 -12
- package/components/errorBoundary/index.js +74 -98
- package/components/fileUploader/index.js +46 -58
- package/components/fileUploader/style.js +46 -49
- package/components/filter/ValueSelector.js +148 -243
- package/components/filter/index.js +43 -66
- package/components/iconButton/index.js +3 -4
- package/components/input/index.js +70 -90
- package/components/layout/index.js +36 -49
- package/components/layout/main/index.js +13 -14
- package/components/layout/main/style.js +11 -14
- package/components/layout/pageContent/index.js +8 -7
- package/components/layout/sidebar/FlatMenu.js +51 -47
- package/components/layout/sidebar/GroupedIconMenu.js +169 -194
- package/components/layout/sidebar/GroupedMenu.js +45 -50
- package/components/layout/sidebar/ProjectMenu.js +165 -185
- package/components/layout/sidebar/index.js +27 -26
- package/components/layout/sidebar/style.js +138 -143
- package/components/layout/topBar/ProjectTopbar.js +86 -119
- package/components/layout/topBar/UserAvatar.js +51 -65
- package/components/layout/topBar/index.js +23 -41
- package/components/loader/index.js +9 -12
- package/components/menu/index.js +23 -42
- package/components/modal/Modal.js +5 -6
- package/components/modal/index.js +16 -20
- package/components/modal/style.js +53 -56
- package/components/optionMenu/index.js +32 -47
- package/components/pagination/index.js +23 -43
- package/components/pagination/style.js +25 -28
- package/components/paginationUpdated/index.js +19 -26
- package/components/paper/index.js +20 -22
- package/components/paper/style.js +24 -27
- package/components/reactSelect/index.js +64 -97
- package/components/reactSelect/style.js +131 -151
- package/components/richTextEditor/index.js +24 -48
- package/components/select/GroupedSelect.js +56 -100
- package/components/select/SimpleSelect.js +59 -99
- package/components/select/index.js +56 -69
- package/components/simpleSelect/index.js +18 -22
- package/components/sort/index.js +23 -36
- package/components/switch/index.js +14 -15
- package/components/switch/style.js +29 -32
- package/components/switch/switch.js +30 -47
- package/components/table/ReactTable.js +59 -83
- package/components/table/SimpleTable.js +67 -91
- package/components/table/index.js +300 -206
- package/components/text/index.js +22 -30
- package/components/timeStamp/index.js +4 -6
- package/components/timeStamp/style.js +12 -15
- package/components/topBar/index.js +86 -102
- package/components/tree/index.js +30 -58
- package/components/tree/style.js +20 -23
- package/components/valuePicker/ValueSelector.js +78 -160
- package/components/valuePicker/index.js +30 -50
- package/components/wrapperLayout/layout/index.js +8 -7
- package/components/wrapperLayout/main/index.js +8 -7
- package/components/wrapperLayout/main/pageContainer/index.js +6 -5
- package/components/wrapperLayout/main/sideBar/index.js +171 -175
- package/components/wrapperLayout/main/sideBar/style.js +177 -183
- package/components/wrapperLayout/topBar/UserAvatar.js +6 -5
- package/components/wrapperLayout/topBar/avatar.js +15 -18
- package/components/wrapperLayout/topBar/index.js +115 -107
- package/components/wrapperLayout/topBar/menuIcon.js +6 -5
- package/components/wrapperLayout/topBar/style.js +63 -64
- package/http/index.js +92 -188
- package/index.js +53 -55
- package/package.json +6 -3
- package/templates/listPage/index.js +168 -196
- package/themes/default.js +5 -7
- package/themes/defaultSmall.js +2 -3
- package/themes/responsiveTheme.js +6 -8
|
@@ -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
|
});
|
|
@@ -9,16 +8,9 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
8
|
var _material = require("@mui/material");
|
|
10
9
|
var _fi = require("react-icons/fi");
|
|
11
10
|
var _text = _interopRequireDefault(require("../text"));
|
|
12
|
-
function _interopRequireDefault(
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
16
|
-
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."); }
|
|
17
|
-
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); }
|
|
18
|
-
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; }
|
|
19
|
-
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; } }
|
|
20
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
21
|
-
var ITEM_HEIGHT = 500;
|
|
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
|
+
const ITEM_HEIGHT = 500;
|
|
22
14
|
|
|
23
15
|
/**
|
|
24
16
|
*
|
|
@@ -47,22 +39,20 @@ var ITEM_HEIGHT = 500;
|
|
|
47
39
|
* @returns An option component
|
|
48
40
|
*/
|
|
49
41
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
optionId =
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
var open = Boolean(anchorEl);
|
|
59
|
-
var handleClick = function handleClick(event) {
|
|
42
|
+
const OptionMenu = _ref => {
|
|
43
|
+
let {
|
|
44
|
+
options,
|
|
45
|
+
optionId = null
|
|
46
|
+
} = _ref;
|
|
47
|
+
const [anchorEl, setAnchorEl] = _react.default.useState(null);
|
|
48
|
+
const open = Boolean(anchorEl);
|
|
49
|
+
const handleClick = event => {
|
|
60
50
|
setAnchorEl(event.currentTarget);
|
|
61
51
|
};
|
|
62
|
-
|
|
52
|
+
const handleClose = () => {
|
|
63
53
|
setAnchorEl(null);
|
|
64
54
|
};
|
|
65
|
-
|
|
55
|
+
const handleMenuItemClick = callback => {
|
|
66
56
|
handleClose();
|
|
67
57
|
callback();
|
|
68
58
|
};
|
|
@@ -85,28 +75,23 @@ var OptionMenu = function OptionMenu(_ref) {
|
|
|
85
75
|
width: "27ch"
|
|
86
76
|
}
|
|
87
77
|
}
|
|
88
|
-
}, options
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
flexWrap: "wrap"
|
|
107
|
-
}
|
|
108
|
-
}, option === null || option === void 0 ? void 0 : option.displayName))), option.divider && index < options.length - 1 && /*#__PURE__*/_react.default.createElement(_material.Divider, null));
|
|
109
|
-
}))));
|
|
78
|
+
}, options?.map((option, index) => /*#__PURE__*/_react.default.createElement("div", {
|
|
79
|
+
key: option.name
|
|
80
|
+
}, /*#__PURE__*/_react.default.createElement(_material.MenuItem, {
|
|
81
|
+
disabled: option.visibility === false,
|
|
82
|
+
onClick: () => {
|
|
83
|
+
handleMenuItemClick(() => option?.onClick(option.name, optionId));
|
|
84
|
+
}
|
|
85
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
86
|
+
container: true,
|
|
87
|
+
alignItems: "center"
|
|
88
|
+
}, /*#__PURE__*/_react.default.createElement("div", null, option.icon && /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
89
|
+
mr: 1
|
|
90
|
+
}, option.icon)), /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
91
|
+
style: {
|
|
92
|
+
display: "flex",
|
|
93
|
+
flexWrap: "wrap"
|
|
94
|
+
}
|
|
95
|
+
}, option?.displayName))), option.divider && index < options.length - 1 && /*#__PURE__*/_react.default.createElement(_material.Divider, null))))));
|
|
110
96
|
};
|
|
111
|
-
var _default = OptionMenu;
|
|
112
|
-
exports.default = _default;
|
|
97
|
+
var _default = exports.default = OptionMenu;
|
|
@@ -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,54 +12,40 @@ var _material = require("@mui/material");
|
|
|
13
12
|
var _style = _interopRequireDefault(require("./style"));
|
|
14
13
|
var _default2 = _interopRequireDefault(require("../../themes/default"));
|
|
15
14
|
var _text = _interopRequireDefault(require("../text"));
|
|
16
|
-
function _interopRequireDefault(
|
|
17
|
-
function
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
var _useState = (0, _react.useState)(props.initialPage),
|
|
28
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
29
|
-
page = _useState2[0],
|
|
30
|
-
setPage = _useState2[1];
|
|
31
|
-
var handlePaginationInputKeyDown = function handlePaginationInputKeyDown(e) {
|
|
32
|
-
var key = e.key;
|
|
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
|
+
/* eslint-disable use-isnan */
|
|
18
|
+
|
|
19
|
+
const Pagination = props => {
|
|
20
|
+
const classes = (0, _style.default)();
|
|
21
|
+
const [page, setPage] = (0, _react.useState)(props.initialPage);
|
|
22
|
+
const handlePaginationInputKeyDown = e => {
|
|
23
|
+
const {
|
|
24
|
+
key
|
|
25
|
+
} = e;
|
|
33
26
|
if (key === "Enter") {
|
|
34
27
|
if (Number(page) > Number(props.totalPage) || Number(page) < Number(props.initialPage) || !Number(page)) {
|
|
35
28
|
window.alert("Invalid Page Number");
|
|
36
29
|
setPage(props.initialPage);
|
|
37
30
|
} else {
|
|
38
31
|
setPage(page);
|
|
39
|
-
props
|
|
32
|
+
props?.setInputPage(page);
|
|
40
33
|
}
|
|
41
34
|
}
|
|
42
35
|
};
|
|
43
|
-
|
|
36
|
+
const onPrevClick = () => {
|
|
44
37
|
if (props.inputPage === null) {
|
|
45
|
-
setPage(
|
|
46
|
-
return prev - 1;
|
|
47
|
-
});
|
|
38
|
+
setPage(prev => prev - 1);
|
|
48
39
|
} else {
|
|
49
|
-
setPage(
|
|
50
|
-
return Number(props.inputPage) - 1;
|
|
51
|
-
});
|
|
40
|
+
setPage(prev => Number(props.inputPage) - 1);
|
|
52
41
|
props.setInputPage(null);
|
|
53
42
|
}
|
|
54
43
|
};
|
|
55
|
-
|
|
44
|
+
const onNextClick = () => {
|
|
56
45
|
if (props.inputPage === null) {
|
|
57
|
-
setPage(
|
|
58
|
-
return prev + 1;
|
|
59
|
-
});
|
|
46
|
+
setPage(prev => prev + 1);
|
|
60
47
|
} else {
|
|
61
|
-
setPage(
|
|
62
|
-
return Number(props.inputPage) + 1;
|
|
63
|
-
});
|
|
48
|
+
setPage(prev => Number(props.inputPage) + 1);
|
|
64
49
|
props.setInputPage(null);
|
|
65
50
|
}
|
|
66
51
|
};
|
|
@@ -77,9 +62,7 @@ var Pagination = function Pagination(props) {
|
|
|
77
62
|
display: "flex",
|
|
78
63
|
alignItems: "center"
|
|
79
64
|
},
|
|
80
|
-
onClick:
|
|
81
|
-
return page > props.initialPage ? onPrevClick() : "";
|
|
82
|
-
},
|
|
65
|
+
onClick: () => page > props.initialPage ? onPrevClick() : "",
|
|
83
66
|
disabled: page === props.initialPage ? true : false,
|
|
84
67
|
title: "Previous"
|
|
85
68
|
})
|
|
@@ -94,7 +77,7 @@ var Pagination = function Pagination(props) {
|
|
|
94
77
|
type: "text",
|
|
95
78
|
value: page,
|
|
96
79
|
className: classes.pageNumberInput,
|
|
97
|
-
onChange:
|
|
80
|
+
onChange: e => {
|
|
98
81
|
setPage(e.target.value);
|
|
99
82
|
},
|
|
100
83
|
onKeyDown: handlePaginationInputKeyDown
|
|
@@ -109,15 +92,13 @@ var Pagination = function Pagination(props) {
|
|
|
109
92
|
display: "flex",
|
|
110
93
|
alignItems: "center"
|
|
111
94
|
},
|
|
112
|
-
onClick:
|
|
113
|
-
return page < props.totalPage && onNextClick();
|
|
114
|
-
},
|
|
95
|
+
onClick: () => page < props.totalPage && onNextClick(),
|
|
115
96
|
disabled: page === props.totalPage ? true : false,
|
|
116
97
|
title: "Next"
|
|
117
98
|
})
|
|
118
99
|
}))));
|
|
119
100
|
};
|
|
120
|
-
|
|
101
|
+
const PaginationButton = icon => {
|
|
121
102
|
return /*#__PURE__*/_react.default.createElement(_iconButton.default, {
|
|
122
103
|
disabled: icon.icon.props.disabled,
|
|
123
104
|
onClick: icon.onClick,
|
|
@@ -125,5 +106,4 @@ var PaginationButton = function PaginationButton(icon) {
|
|
|
125
106
|
title: icon.icon.props.title
|
|
126
107
|
});
|
|
127
108
|
};
|
|
128
|
-
var _default = Pagination;
|
|
129
|
-
exports.default = _default;
|
|
109
|
+
var _default = exports.default = Pagination;
|
|
@@ -6,31 +6,28 @@ 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 = (0, _styles.makeStyles)(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
};
|
|
35
|
-
});
|
|
36
|
-
exports.default = _default;
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
var _default = exports.default = (0, _styles.makeStyles)(() => ({
|
|
11
|
+
paginationText: {
|
|
12
|
+
fontWeight: 500,
|
|
13
|
+
fontSize: _default2.default.typography.fontSize - 2
|
|
14
|
+
},
|
|
15
|
+
paginationContent: {
|
|
16
|
+
display: "flex",
|
|
17
|
+
margin: "0px 1rem",
|
|
18
|
+
alignItems: "center",
|
|
19
|
+
justifyContent: "space-evenly"
|
|
20
|
+
},
|
|
21
|
+
pageNumberInput: {
|
|
22
|
+
width: "40px",
|
|
23
|
+
border: "1px solid #ccc",
|
|
24
|
+
borderRadius: "3px",
|
|
25
|
+
margin: "2px 0.5rem 2px 0.5rem",
|
|
26
|
+
// top: "1px",
|
|
27
|
+
position: "relative",
|
|
28
|
+
fontFamily: _default2.default.typography.fontFamily,
|
|
29
|
+
textAlign: "center",
|
|
30
|
+
fontSize: _default2.default.typography.fontSize - 2,
|
|
31
|
+
fontWeight: 500
|
|
32
|
+
}
|
|
33
|
+
}));
|
|
@@ -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
|
});
|
|
@@ -8,30 +7,22 @@ exports.default = Pagination;
|
|
|
8
7
|
var React = _interopRequireWildcard(require("react"));
|
|
9
8
|
var _TablePagination = _interopRequireDefault(require("@mui/material/TablePagination"));
|
|
10
9
|
var _material = require("@mui/material");
|
|
11
|
-
function _interopRequireDefault(
|
|
12
|
-
function
|
|
13
|
-
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; }
|
|
14
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
15
|
-
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."); }
|
|
16
|
-
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); }
|
|
17
|
-
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; }
|
|
18
|
-
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; } }
|
|
19
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
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
12
|
function Pagination(_ref) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
var handleChangePage = function handleChangePage(event, newPage) {
|
|
13
|
+
let {
|
|
14
|
+
page,
|
|
15
|
+
setPage,
|
|
16
|
+
rowsPerPage,
|
|
17
|
+
setRowsPerPage,
|
|
18
|
+
totalPage
|
|
19
|
+
} = _ref;
|
|
20
|
+
const [negativeState, setNegativeState] = React.useState(false);
|
|
21
|
+
const handleChangePage = (event, newPage) => {
|
|
31
22
|
setPage(newPage);
|
|
32
23
|
setNegativeState(false);
|
|
33
24
|
};
|
|
34
|
-
|
|
25
|
+
const handleChangeRowsPerPage = event => {
|
|
35
26
|
setRowsPerPage(parseInt(event.target.value, 10));
|
|
36
27
|
setPage(0);
|
|
37
28
|
};
|
|
@@ -46,13 +37,15 @@ function Pagination(_ref) {
|
|
|
46
37
|
onPageChange: handleChangePage,
|
|
47
38
|
rowsPerPage: rowsPerPage,
|
|
48
39
|
onRowsPerPageChange: handleChangeRowsPerPage,
|
|
49
|
-
labelDisplayedRows:
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
40
|
+
labelDisplayedRows: _ref2 => {
|
|
41
|
+
let {
|
|
42
|
+
from,
|
|
43
|
+
to,
|
|
44
|
+
count
|
|
45
|
+
} = _ref2;
|
|
53
46
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("input", {
|
|
54
47
|
value: negativeState ? "" : page + 1,
|
|
55
|
-
onChange:
|
|
48
|
+
onChange: e => {
|
|
56
49
|
if (/^\d*$/.test(e.target.value) && !(Number(e.target.value) > Math.ceil(totalPage / rowsPerPage))) {
|
|
57
50
|
if (Number(e.target.value) == 0) {
|
|
58
51
|
setNegativeState(true);
|
|
@@ -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
|
});
|
|
@@ -8,28 +7,28 @@ exports.default = void 0;
|
|
|
8
7
|
var _material = require("@mui/material");
|
|
9
8
|
var _loader = _interopRequireDefault(require("../loader"));
|
|
10
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
var
|
|
10
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
12
11
|
var _react = _interopRequireDefault(require("react"));
|
|
13
12
|
var _style = _interopRequireDefault(require("./style"));
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
loading = _ref.loading,
|
|
27
|
-
fullHeight = _ref.fullHeight,
|
|
28
|
-
position = _ref.position,
|
|
29
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
30
|
-
var classes = (0, _style.default)();
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
const Paper = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
className,
|
|
17
|
+
sx,
|
|
18
|
+
children,
|
|
19
|
+
loading,
|
|
20
|
+
fullHeight,
|
|
21
|
+
position,
|
|
22
|
+
...rest
|
|
23
|
+
} = _ref;
|
|
24
|
+
const classes = (0, _style.default)();
|
|
31
25
|
return /*#__PURE__*/_react.default.createElement(_material.Paper, {
|
|
32
|
-
className: (0,
|
|
26
|
+
className: (0, _clsx.default)({
|
|
27
|
+
[classes.paper]: true,
|
|
28
|
+
[classes.fullHeight]: fullHeight,
|
|
29
|
+
[className]: true,
|
|
30
|
+
[classes[position]]: true
|
|
31
|
+
}),
|
|
33
32
|
sx: sx
|
|
34
33
|
}, loading ? /*#__PURE__*/_react.default.createElement(_loader.default, null) : children);
|
|
35
34
|
};
|
|
@@ -40,5 +39,4 @@ Paper.propTypes = {
|
|
|
40
39
|
Paper.defaultProps = {
|
|
41
40
|
position: "static"
|
|
42
41
|
};
|
|
43
|
-
var _default = Paper;
|
|
44
|
-
exports.default = _default;
|
|
42
|
+
var _default = exports.default = Paper;
|
|
@@ -5,30 +5,27 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _styles = require("@mui/styles");
|
|
8
|
-
var _default = (0, _styles.makeStyles)(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
};
|
|
33
|
-
});
|
|
34
|
-
exports.default = _default;
|
|
8
|
+
var _default = exports.default = (0, _styles.makeStyles)(theme => ({
|
|
9
|
+
paper: {
|
|
10
|
+
border: `1px solid #D6D9E0`,
|
|
11
|
+
boxShadow: `0px 3px 10px #667CBC1A`
|
|
12
|
+
},
|
|
13
|
+
fullHeight: {
|
|
14
|
+
height: "100%"
|
|
15
|
+
},
|
|
16
|
+
relative: {
|
|
17
|
+
position: "relative"
|
|
18
|
+
},
|
|
19
|
+
fixed: {
|
|
20
|
+
position: "fixed"
|
|
21
|
+
},
|
|
22
|
+
static: {
|
|
23
|
+
position: "static"
|
|
24
|
+
},
|
|
25
|
+
sticky: {
|
|
26
|
+
position: "sticky"
|
|
27
|
+
},
|
|
28
|
+
absolute: {
|
|
29
|
+
position: "absolute"
|
|
30
|
+
}
|
|
31
|
+
}));
|