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.
- 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 +149 -245
- package/components/filter/index.js +45 -71
- package/components/iconButton/index.js +3 -4
- package/components/input/index.js +60 -74
- 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 +91 -208
- package/components/layout/topBar/UserAvatar.js +53 -69
- 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 +22 -29
- 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 +96 -99
- package/components/select/SimpleSelect.js +61 -103
- 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 -9
- 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 +3 -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
|
});
|
|
@@ -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,31 +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
|
-
setNegativeState = _React$useState2[1];
|
|
31
|
-
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) => {
|
|
32
22
|
setPage(newPage);
|
|
33
23
|
setNegativeState(false);
|
|
34
24
|
};
|
|
35
|
-
|
|
25
|
+
const handleChangeRowsPerPage = event => {
|
|
36
26
|
setRowsPerPage(parseInt(event.target.value, 10));
|
|
37
27
|
setPage(0);
|
|
38
28
|
};
|
|
@@ -47,13 +37,15 @@ function Pagination(_ref) {
|
|
|
47
37
|
onPageChange: handleChangePage,
|
|
48
38
|
rowsPerPage: rowsPerPage,
|
|
49
39
|
onRowsPerPageChange: handleChangeRowsPerPage,
|
|
50
|
-
labelDisplayedRows:
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
40
|
+
labelDisplayedRows: _ref2 => {
|
|
41
|
+
let {
|
|
42
|
+
from,
|
|
43
|
+
to,
|
|
44
|
+
count
|
|
45
|
+
} = _ref2;
|
|
54
46
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("input", {
|
|
55
47
|
value: negativeState ? "" : page + 1,
|
|
56
|
-
onChange:
|
|
48
|
+
onChange: e => {
|
|
57
49
|
if (/^\d*$/.test(e.target.value) && !(Number(e.target.value) > Math.ceil(totalPage / rowsPerPage))) {
|
|
58
50
|
if (Number(e.target.value) == 0) {
|
|
59
51
|
setNegativeState(true);
|
|
@@ -68,9 +60,10 @@ function Pagination(_ref) {
|
|
|
68
60
|
textAlign: "center",
|
|
69
61
|
borderRadius: "6px",
|
|
70
62
|
backgroundColor: "transparent",
|
|
71
|
-
margin: "0 8px"
|
|
63
|
+
margin: "0 8px",
|
|
64
|
+
border: "1px solid grey"
|
|
72
65
|
}
|
|
73
|
-
}), " ",
|
|
66
|
+
}), " ", "of ", Math.ceil(totalPage / rowsPerPage));
|
|
74
67
|
}
|
|
75
68
|
}));
|
|
76
69
|
}
|
|
@@ -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
|
+
}));
|
|
@@ -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
|
});
|
|
@@ -11,57 +10,34 @@ var _reactSelect = _interopRequireWildcard(require("react-select"));
|
|
|
11
10
|
var _material = require("@mui/material");
|
|
12
11
|
var _KeyboardArrowDown = _interopRequireDefault(require("@mui/icons-material/KeyboardArrowDown"));
|
|
13
12
|
var _style = require("./style");
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
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); }
|
|
20
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
21
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
22
|
-
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; }
|
|
23
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
24
|
-
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); }
|
|
25
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
26
|
-
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."); }
|
|
27
|
-
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); }
|
|
28
|
-
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; }
|
|
29
|
-
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; } }
|
|
30
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
31
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
32
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
33
|
-
var DropdownIndicator = function DropdownIndicator(props) {
|
|
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 _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
+
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); }
|
|
16
|
+
const DropdownIndicator = props => {
|
|
34
17
|
return /*#__PURE__*/_react.default.createElement(_reactSelect.components.DropdownIndicator, props, /*#__PURE__*/_react.default.createElement(_KeyboardArrowDown.default, null));
|
|
35
18
|
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
};
|
|
53
|
-
var onMouseUp = function onMouseUp() {
|
|
54
|
-
return setIsActive(false);
|
|
55
|
-
};
|
|
56
|
-
var onMouseLeave = function onMouseLeave() {
|
|
57
|
-
return setIsActive(false);
|
|
58
|
-
};
|
|
19
|
+
const InputOption = _ref => {
|
|
20
|
+
let {
|
|
21
|
+
getStyles,
|
|
22
|
+
Icon,
|
|
23
|
+
isDisabled,
|
|
24
|
+
isFocused,
|
|
25
|
+
isSelected,
|
|
26
|
+
children,
|
|
27
|
+
innerProps,
|
|
28
|
+
isCheckBox,
|
|
29
|
+
...rest
|
|
30
|
+
} = _ref;
|
|
31
|
+
const [isActive, setIsActive] = _react.default.useState(false);
|
|
32
|
+
const onMouseDown = () => setIsActive(true);
|
|
33
|
+
const onMouseUp = () => setIsActive(false);
|
|
34
|
+
const onMouseLeave = () => setIsActive(false);
|
|
59
35
|
|
|
60
36
|
// styles
|
|
61
|
-
|
|
37
|
+
let bg = "transparent";
|
|
62
38
|
if (isFocused) bg = "#eee";
|
|
63
39
|
if (isActive) bg = "#B2D4FF";
|
|
64
|
-
|
|
40
|
+
const style = {
|
|
65
41
|
alignItems: "center",
|
|
66
42
|
backgroundColor: bg,
|
|
67
43
|
color: "inherit",
|
|
@@ -69,12 +45,13 @@ var InputOption = function InputOption(_ref) {
|
|
|
69
45
|
};
|
|
70
46
|
|
|
71
47
|
// prop assignment
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
48
|
+
const props = {
|
|
49
|
+
...innerProps,
|
|
50
|
+
onMouseDown,
|
|
51
|
+
onMouseUp,
|
|
52
|
+
onMouseLeave,
|
|
53
|
+
style
|
|
54
|
+
};
|
|
78
55
|
return /*#__PURE__*/_react.default.createElement(_reactSelect.components.Option, _extends({}, rest, {
|
|
79
56
|
isDisabled: isDisabled,
|
|
80
57
|
isFocused: isFocused,
|
|
@@ -86,46 +63,43 @@ var InputOption = function InputOption(_ref) {
|
|
|
86
63
|
checked: isSelected
|
|
87
64
|
}), children);
|
|
88
65
|
};
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
66
|
+
const ReactSelect = _ref2 => {
|
|
67
|
+
let {
|
|
68
|
+
options,
|
|
69
|
+
value,
|
|
70
|
+
label,
|
|
71
|
+
defaultValue,
|
|
72
|
+
isMulti,
|
|
73
|
+
isDisabled,
|
|
74
|
+
placeholder,
|
|
75
|
+
className,
|
|
76
|
+
isRequired,
|
|
77
|
+
simulateNativeSelect,
|
|
78
|
+
onChange,
|
|
79
|
+
theme,
|
|
80
|
+
error,
|
|
81
|
+
helperText,
|
|
82
|
+
isBlueTheme,
|
|
83
|
+
isLoading,
|
|
84
|
+
isCheckBox,
|
|
85
|
+
...rest
|
|
86
|
+
} = _ref2;
|
|
87
|
+
const classes = (0, _style.useStyles)({
|
|
109
88
|
colorTheme: isBlueTheme
|
|
110
89
|
});
|
|
111
|
-
|
|
90
|
+
const handleSelectChange = value => {
|
|
112
91
|
if (simulateNativeSelect) {
|
|
113
92
|
onChange(value.value);
|
|
114
93
|
} else {
|
|
115
94
|
onChange(value);
|
|
116
95
|
}
|
|
117
96
|
};
|
|
118
|
-
|
|
97
|
+
const handleChange = options => {
|
|
119
98
|
if (Array.isArray(options)) {
|
|
120
|
-
setSelectedOptions(options.map(
|
|
121
|
-
return opt.value;
|
|
122
|
-
}));
|
|
99
|
+
setSelectedOptions(options.map(opt => opt.value));
|
|
123
100
|
}
|
|
124
101
|
};
|
|
125
|
-
|
|
126
|
-
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
127
|
-
selectedOptions = _React$useState4[0],
|
|
128
|
-
setSelectedOptions = _React$useState4[1];
|
|
102
|
+
const [selectedOptions, setSelectedOptions] = _react.default.useState([]);
|
|
129
103
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
130
104
|
style: {
|
|
131
105
|
width: "100%"
|
|
@@ -139,42 +113,36 @@ var ReactSelect = function ReactSelect(_ref2) {
|
|
|
139
113
|
defaultValue: defaultValue && defaultValue.length > 0 ? defaultValue : "",
|
|
140
114
|
styles: (0, _style.getCustomStyles)({
|
|
141
115
|
colorTheme: isBlueTheme,
|
|
142
|
-
error
|
|
116
|
+
error
|
|
143
117
|
}),
|
|
144
118
|
isDisabled: isDisabled,
|
|
145
119
|
placeholder: placeholder,
|
|
146
120
|
components: isCheckBox ? {
|
|
147
|
-
DropdownIndicator
|
|
121
|
+
DropdownIndicator,
|
|
148
122
|
Option: InputOption
|
|
149
123
|
} : {
|
|
150
|
-
DropdownIndicator
|
|
124
|
+
DropdownIndicator
|
|
151
125
|
},
|
|
152
126
|
isLoading: isLoading
|
|
153
127
|
/////isCheckBox
|
|
154
128
|
,
|
|
155
129
|
closeMenuOnSelect: !isCheckBox ? true : false,
|
|
156
130
|
hideSelectedOptions: !isCheckBox ? true : false,
|
|
157
|
-
onChange:
|
|
158
|
-
return isCheckBox && handleChange(options);
|
|
159
|
-
}
|
|
131
|
+
onChange: options => isCheckBox && handleChange(options)
|
|
160
132
|
}, rest))) : /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_reactSelect.default, _extends({
|
|
161
133
|
options: options,
|
|
162
134
|
styles: (0, _style.getCustomStyles)({
|
|
163
135
|
colorTheme: isBlueTheme,
|
|
164
|
-
error
|
|
136
|
+
error
|
|
165
137
|
}),
|
|
166
138
|
onChange: handleSelectChange,
|
|
167
|
-
defaultValue: options.filter(
|
|
168
|
-
|
|
169
|
-
}),
|
|
170
|
-
value: options.filter(function (option) {
|
|
171
|
-
return option.value === value;
|
|
172
|
-
}),
|
|
139
|
+
defaultValue: options.filter(option => option.value === defaultValue),
|
|
140
|
+
value: options.filter(option => option.value === value),
|
|
173
141
|
isMulti: isMulti,
|
|
174
142
|
isDisabled: isDisabled,
|
|
175
143
|
placeholder: placeholder,
|
|
176
144
|
components: {
|
|
177
|
-
DropdownIndicator
|
|
145
|
+
DropdownIndicator
|
|
178
146
|
},
|
|
179
147
|
isLoading: isLoading
|
|
180
148
|
}, rest))), helperText && /*#__PURE__*/_react.default.createElement(_material.Typography, {
|
|
@@ -208,5 +176,4 @@ ReactSelect.defaultProps = {
|
|
|
208
176
|
isRequired: false,
|
|
209
177
|
simulateNativeSelect: true
|
|
210
178
|
};
|
|
211
|
-
var _default = ReactSelect;
|
|
212
|
-
exports.default = _default;
|
|
179
|
+
var _default = exports.default = ReactSelect;
|