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
|
@@ -0,0 +1,121 @@
|
|
|
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 _breadCrumbs = _interopRequireDefault(require("../../breadCrumbs"));
|
|
10
|
+
var _button = _interopRequireDefault(require("../../button"));
|
|
11
|
+
var _UserAvatar = _interopRequireDefault(require("./UserAvatar"));
|
|
12
|
+
var _modal = _interopRequireDefault(require("../../modal"));
|
|
13
|
+
var _reactRouter = require("react-router");
|
|
14
|
+
var _text = _interopRequireDefault(require("../../text"));
|
|
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(); }
|
|
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."); }
|
|
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 TopBar = _ref => {
|
|
24
|
+
let breadcrumbs = _ref.breadcrumbs,
|
|
25
|
+
loggedInUser = _ref.loggedInUser,
|
|
26
|
+
showAdmin = _ref.showAdmin,
|
|
27
|
+
actions = _ref.actions,
|
|
28
|
+
onLogout = _ref.onLogout;
|
|
29
|
+
const _useState = (0, _react.useState)(false),
|
|
30
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
31
|
+
open = _useState2[0],
|
|
32
|
+
setOpen = _useState2[1];
|
|
33
|
+
const handleOpen = () => setOpen(true);
|
|
34
|
+
const handleClose = () => setOpen(false);
|
|
35
|
+
const navigate = (0, _reactRouter.useNavigate)();
|
|
36
|
+
const theme = (0, _material.useTheme)();
|
|
37
|
+
const logout = () => {
|
|
38
|
+
onLogout();
|
|
39
|
+
// localStorage.removeItem('t-at');
|
|
40
|
+
setOpen(false);
|
|
41
|
+
};
|
|
42
|
+
return /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
43
|
+
className: "tenjin-header"
|
|
44
|
+
}, /*#__PURE__*/_react.default.createElement(_material.AppBar, {
|
|
45
|
+
position: "static",
|
|
46
|
+
sx: {
|
|
47
|
+
boxShadow: "-1px 1px 7px 0px rgba(0, 0, 0, 0.2) !important",
|
|
48
|
+
backgroundColor: "#fff",
|
|
49
|
+
margin: "0rem !important",
|
|
50
|
+
padding: " 0rem !important",
|
|
51
|
+
height: "48px !important",
|
|
52
|
+
maxHeight: "48px !important",
|
|
53
|
+
borderBottom: "1px solid #D6D9E0"
|
|
54
|
+
}
|
|
55
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Toolbar, {
|
|
56
|
+
variant: "dense"
|
|
57
|
+
}, /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
58
|
+
variant: "title",
|
|
59
|
+
component: "a",
|
|
60
|
+
href: "/",
|
|
61
|
+
sx: {
|
|
62
|
+
mr: 2,
|
|
63
|
+
textDecoration: "none"
|
|
64
|
+
}
|
|
65
|
+
}, "Tenjin Enterprise"), /*#__PURE__*/_react.default.createElement(_material.Divider, {
|
|
66
|
+
sx: {
|
|
67
|
+
height: "100% !important"
|
|
68
|
+
},
|
|
69
|
+
orientation: "vertical",
|
|
70
|
+
flexItem: true
|
|
71
|
+
}), /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
72
|
+
sx: {
|
|
73
|
+
flexGrow: 1
|
|
74
|
+
}
|
|
75
|
+
}, /*#__PURE__*/_react.default.createElement(_breadCrumbs.default, {
|
|
76
|
+
crumbInfo: breadcrumbs
|
|
77
|
+
})), actions ? /*#__PURE__*/_react.default.createElement(_material.Box, null, /*#__PURE__*/_react.default.createElement(_material.Stack, {
|
|
78
|
+
direction: "row",
|
|
79
|
+
spacing: 1
|
|
80
|
+
}, actions.map(a => /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
81
|
+
key: a.title,
|
|
82
|
+
variant: "text",
|
|
83
|
+
startIcon: a.icon,
|
|
84
|
+
onClick: () => navigate(a.href)
|
|
85
|
+
}, /*#__PURE__*/_react.default.createElement(_text.default, null, a.title))))) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null), /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
86
|
+
sx: {
|
|
87
|
+
marginLeft: theme.spacing(1)
|
|
88
|
+
}
|
|
89
|
+
}, /*#__PURE__*/_react.default.createElement(_UserAvatar.default, {
|
|
90
|
+
loggedInUser: loggedInUser,
|
|
91
|
+
onLogout: handleOpen
|
|
92
|
+
})))), /*#__PURE__*/_react.default.createElement(_modal.default, {
|
|
93
|
+
title: "Log out",
|
|
94
|
+
open: open,
|
|
95
|
+
handleClose: handleClose,
|
|
96
|
+
onClose: handleClose,
|
|
97
|
+
width: "sm"
|
|
98
|
+
}, /*#__PURE__*/_react.default.createElement(_text.default, null, "Are you sure you want to log out?"), /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
99
|
+
container: true,
|
|
100
|
+
direction: "row",
|
|
101
|
+
justifyContent: "flex-end",
|
|
102
|
+
alignItems: "flex-end",
|
|
103
|
+
style: {
|
|
104
|
+
padding: "3rem 0rem 0rem 4rem"
|
|
105
|
+
}
|
|
106
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
107
|
+
item: true,
|
|
108
|
+
xs: 6
|
|
109
|
+
}, /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
110
|
+
variant: "outlined",
|
|
111
|
+
onClick: handleClose
|
|
112
|
+
}, /*#__PURE__*/_react.default.createElement(_text.default, null, "Cancel"))), /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
113
|
+
item: true,
|
|
114
|
+
xs: 6
|
|
115
|
+
}, /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
116
|
+
color: "error",
|
|
117
|
+
onClick: logout
|
|
118
|
+
}, /*#__PURE__*/_react.default.createElement(_text.default, null, "Log out"))))));
|
|
119
|
+
};
|
|
120
|
+
TopBar.propTypes = {};
|
|
121
|
+
var _default = exports.default = TopBar;
|
|
@@ -7,16 +7,14 @@ exports.default = void 0;
|
|
|
7
7
|
var _material = require("@mui/material");
|
|
8
8
|
var _styles = require("@mui/styles");
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
|
10
|
-
function _interopRequireDefault(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var UIBlockLoader = function UIBlockLoader() {
|
|
19
|
-
var classes = useStyle();
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
const useStyle = (0, _styles.makeStyles)(theme => ({
|
|
12
|
+
loaderWrapper: {
|
|
13
|
+
height: "100%"
|
|
14
|
+
}
|
|
15
|
+
}));
|
|
16
|
+
const UIBlockLoader = () => {
|
|
17
|
+
const classes = useStyle();
|
|
20
18
|
return /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
21
19
|
container: true,
|
|
22
20
|
alignItems: "center",
|
|
@@ -24,5 +22,4 @@ var UIBlockLoader = function UIBlockLoader() {
|
|
|
24
22
|
className: classes.loaderWrapper
|
|
25
23
|
}, /*#__PURE__*/_react.default.createElement(_material.CircularProgress, null));
|
|
26
24
|
};
|
|
27
|
-
var _default = UIBlockLoader;
|
|
28
|
-
exports.default = _default;
|
|
25
|
+
var _default = exports.default = UIBlockLoader;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _material = require("@mui/material");
|
|
9
|
+
var _text = _interopRequireDefault(require("../text"));
|
|
10
|
+
var _reactRouterDom = require("react-router-dom");
|
|
11
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
|
+
var _button = _interopRequireDefault(require("../button"));
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
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); }
|
|
15
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _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(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; } }
|
|
18
|
+
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; }
|
|
19
|
+
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; } }
|
|
20
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
21
|
+
const Menu = props => {
|
|
22
|
+
const navigate = (0, _reactRouterDom.useNavigate)();
|
|
23
|
+
const _useState = (0, _react.useState)(null),
|
|
24
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
25
|
+
anchorEl = _useState2[0],
|
|
26
|
+
setAnchorEl = _useState2[1];
|
|
27
|
+
const _useState3 = (0, _react.useState)(false),
|
|
28
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
29
|
+
menuOpen = _useState4[0],
|
|
30
|
+
setMenuOpen = _useState4[1];
|
|
31
|
+
const items = props.items;
|
|
32
|
+
const handleClick = event => {
|
|
33
|
+
setMenuOpen(true);
|
|
34
|
+
setAnchorEl(event.currentTarget);
|
|
35
|
+
};
|
|
36
|
+
const handleMenuItemClick = (event, data) => {
|
|
37
|
+
event.preventDefault();
|
|
38
|
+
if (data !== undefined) {
|
|
39
|
+
navigate(data);
|
|
40
|
+
}
|
|
41
|
+
setMenuOpen(false);
|
|
42
|
+
setAnchorEl(null);
|
|
43
|
+
};
|
|
44
|
+
const handleClose = (event, data) => {
|
|
45
|
+
setMenuOpen(false);
|
|
46
|
+
};
|
|
47
|
+
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
48
|
+
onClick: handleClick
|
|
49
|
+
}, "Open Menu"), /*#__PURE__*/_react.default.createElement(_material.Menu, {
|
|
50
|
+
anchorEl: anchorEl,
|
|
51
|
+
open: menuOpen,
|
|
52
|
+
onClose: handleClose,
|
|
53
|
+
sx: {
|
|
54
|
+
minWidth: "200px",
|
|
55
|
+
maxHeight: "220px"
|
|
56
|
+
}
|
|
57
|
+
}, items.map((item, index) => /*#__PURE__*/_react.default.createElement(_material.MenuItem, {
|
|
58
|
+
key: index,
|
|
59
|
+
onClick: e => handleMenuItemClick(e, item === null || item === void 0 ? void 0 : item.link),
|
|
60
|
+
sx: {
|
|
61
|
+
textDecoration: "none",
|
|
62
|
+
fontWeight: "bold",
|
|
63
|
+
fontWeight: 500,
|
|
64
|
+
cursor: "pointer"
|
|
65
|
+
}
|
|
66
|
+
}, /*#__PURE__*/_react.default.createElement(_text.default, null, item === null || item === void 0 ? void 0 : item.name)))));
|
|
67
|
+
};
|
|
68
|
+
Menu.propTypes = {
|
|
69
|
+
items: _propTypes.default.array.isRequired
|
|
70
|
+
};
|
|
71
|
+
var _default = exports.default = Menu;
|
|
@@ -11,10 +11,10 @@ var _clsx = _interopRequireDefault(require("clsx"));
|
|
|
11
11
|
var _style = _interopRequireDefault(require("./style"));
|
|
12
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
13
|
var _Close = _interopRequireDefault(require("@mui/icons-material/Close"));
|
|
14
|
-
function _interopRequireDefault(
|
|
15
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
16
|
-
|
|
17
|
-
|
|
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 Modal = props => {
|
|
17
|
+
const classes = (0, _style.default)();
|
|
18
18
|
return /*#__PURE__*/_react.default.createElement(_material.Modal, _extends({
|
|
19
19
|
open: props.open,
|
|
20
20
|
onClose: props.handleClose
|
|
@@ -52,5 +52,4 @@ Modal.defaultProps = {
|
|
|
52
52
|
title: "Modal Dialog",
|
|
53
53
|
blur: "false"
|
|
54
54
|
};
|
|
55
|
-
var _default = Modal;
|
|
56
|
-
exports.default = _default;
|
|
55
|
+
var _default = exports.default = Modal;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var React = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _Dialog = _interopRequireDefault(require("@mui/material/Dialog"));
|
|
9
|
+
var _DialogContent = _interopRequireDefault(require("@mui/material/DialogContent"));
|
|
10
|
+
var _DialogTitle = _interopRequireDefault(require("@mui/material/DialogTitle"));
|
|
11
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
|
+
var _material = require("@mui/material");
|
|
13
|
+
var _Close = _interopRequireDefault(require("@mui/icons-material/Close"));
|
|
14
|
+
var _text = _interopRequireDefault(require("../text"));
|
|
15
|
+
var _style = _interopRequireDefault(require("./style"));
|
|
16
|
+
const _excluded = ["fullWidth", "width", "open", "handleClose", "title", "children", "onClose"];
|
|
17
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
18
|
+
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); }
|
|
19
|
+
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); }
|
|
20
|
+
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; }
|
|
21
|
+
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; }
|
|
22
|
+
const Modal = props => {
|
|
23
|
+
const fullWidth = props.fullWidth,
|
|
24
|
+
width = props.width,
|
|
25
|
+
open = props.open,
|
|
26
|
+
handleClose = props.handleClose,
|
|
27
|
+
title = props.title,
|
|
28
|
+
children = props.children,
|
|
29
|
+
onClose = props.onClose,
|
|
30
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
31
|
+
const classes = (0, _style.default)();
|
|
32
|
+
return /*#__PURE__*/React.createElement(_Dialog.default, _extends({
|
|
33
|
+
sx: {
|
|
34
|
+
"& .MuiDialogTitle-root": {
|
|
35
|
+
padding: "3px !important"
|
|
36
|
+
},
|
|
37
|
+
"& .MuiDialog-paper": {
|
|
38
|
+
maxWidth: width === "xs" ? "20%" : width === "sm" ? "30%" : width === "md" ? "50%" : width === "lg" ? "70%" : width === "xl" ? "95%" : width,
|
|
39
|
+
width: width === "xs" ? "20%" : width === "sm" ? "30%" : width === "md" ? "50%" : width === "lg" ? "70%" : width === "xl" ? "95%" : width,
|
|
40
|
+
margin: "auto auto",
|
|
41
|
+
maxHeight: "null !important"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
open: open,
|
|
45
|
+
onClose: onClose,
|
|
46
|
+
className: classes.modalHeader
|
|
47
|
+
}, rest), /*#__PURE__*/React.createElement(_DialogTitle.default, null, /*#__PURE__*/React.createElement(_material.Grid, {
|
|
48
|
+
container: true,
|
|
49
|
+
alignContent: "center"
|
|
50
|
+
}, /*#__PURE__*/React.createElement(_material.Grid, {
|
|
51
|
+
item: true,
|
|
52
|
+
xs: 8
|
|
53
|
+
}, /*#__PURE__*/React.createElement(_text.default, {
|
|
54
|
+
sx: {
|
|
55
|
+
fontSize: "17px",
|
|
56
|
+
paddingLeft: "1.2rem",
|
|
57
|
+
fontWeight: 500
|
|
58
|
+
}
|
|
59
|
+
}, title)), /*#__PURE__*/React.createElement(_material.Grid, {
|
|
60
|
+
item: true,
|
|
61
|
+
xs: 4,
|
|
62
|
+
container: true,
|
|
63
|
+
justifyContent: "flex-end",
|
|
64
|
+
alignSelf: "center"
|
|
65
|
+
}, /*#__PURE__*/React.createElement(_Close.default, {
|
|
66
|
+
sx: {
|
|
67
|
+
cursor: "pointer",
|
|
68
|
+
fontSize: 15,
|
|
69
|
+
marginRight: "0.5rem"
|
|
70
|
+
},
|
|
71
|
+
onClick: handleClose
|
|
72
|
+
})))), /*#__PURE__*/React.createElement(_DialogContent.default, {
|
|
73
|
+
dividers: true
|
|
74
|
+
}, children));
|
|
75
|
+
};
|
|
76
|
+
Modal.propTypes = {
|
|
77
|
+
open: _propTypes.default.bool,
|
|
78
|
+
title: _propTypes.default.string,
|
|
79
|
+
onClose: _propTypes.default.func,
|
|
80
|
+
handleClose: _propTypes.default.func,
|
|
81
|
+
width: _propTypes.default.oneOf(["xs", "sm", "md", "lg", "xl"])
|
|
82
|
+
};
|
|
83
|
+
Modal.defaultProps = {
|
|
84
|
+
width: "md",
|
|
85
|
+
title: "Modal Title",
|
|
86
|
+
fullWidth: false
|
|
87
|
+
};
|
|
88
|
+
var _default = exports.default = Modal;
|
|
@@ -0,0 +1,65 @@
|
|
|
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
|
+
modalContentWrapper: {
|
|
12
|
+
position: "absolute",
|
|
13
|
+
backgroundColor: _default2.default.palette.background.paper,
|
|
14
|
+
borderRadius: "3px",
|
|
15
|
+
boxShadow: _default2.default.shadows[5],
|
|
16
|
+
top: "10%",
|
|
17
|
+
"&:focus": {
|
|
18
|
+
outline: "none"
|
|
19
|
+
},
|
|
20
|
+
margin: "auto"
|
|
21
|
+
},
|
|
22
|
+
default: {
|
|
23
|
+
width: "400px",
|
|
24
|
+
left: "calc(50% - 400px / 2)"
|
|
25
|
+
},
|
|
26
|
+
large: {
|
|
27
|
+
width: "600px",
|
|
28
|
+
left: "calc(50% - 600px / 2)"
|
|
29
|
+
},
|
|
30
|
+
xlarge: {
|
|
31
|
+
width: "800px",
|
|
32
|
+
left: "calc(50% - 800px / 2)"
|
|
33
|
+
},
|
|
34
|
+
fullscreen: {
|
|
35
|
+
width: "98%",
|
|
36
|
+
left: "1%",
|
|
37
|
+
top: "10px"
|
|
38
|
+
},
|
|
39
|
+
header: {
|
|
40
|
+
display: "flex",
|
|
41
|
+
alignItems: "center",
|
|
42
|
+
padding: "0.4rem 1rem",
|
|
43
|
+
borderBottom: "1px solid #ccc",
|
|
44
|
+
"& .MuiDialogTitle-root": {
|
|
45
|
+
backgroundColor: "#e7e7e7"
|
|
46
|
+
},
|
|
47
|
+
"& .title": {
|
|
48
|
+
flexGrow: 1,
|
|
49
|
+
fontWeight: 500
|
|
50
|
+
},
|
|
51
|
+
"& .modalCloseTrigger": {
|
|
52
|
+
cursor: "pointer"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
content: {
|
|
56
|
+
padding: "0.4rem 1rem",
|
|
57
|
+
maxHeight: "calc(100vh - 170px)",
|
|
58
|
+
overflowY: "auto"
|
|
59
|
+
},
|
|
60
|
+
modalHeader: {
|
|
61
|
+
"& .MuiDialogTitle-root": {
|
|
62
|
+
backgroundColor: "#e7e7e7"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}));
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _material = require("@mui/material");
|
|
9
|
+
var _fi = require("react-icons/fi");
|
|
10
|
+
var _text = _interopRequireDefault(require("../text"));
|
|
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 ITEM_HEIGHT = 500;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
*
|
|
23
|
+
* @param {{
|
|
24
|
+
* options: Array<{
|
|
25
|
+
* name: String | Number,
|
|
26
|
+
* displayName: String,
|
|
27
|
+
* onClick: (name: String | Number, optionId: String | Number) => void,
|
|
28
|
+
* visibility?: boolean,
|
|
29
|
+
* divider?: boolean
|
|
30
|
+
* }>,
|
|
31
|
+
* optionId?: String | Number,
|
|
32
|
+
* }} props
|
|
33
|
+
* @description
|
|
34
|
+
* options: provide this object in an array for options
|
|
35
|
+
* {
|
|
36
|
+
* name, displayName , onClick, visibility, divider
|
|
37
|
+
* }
|
|
38
|
+
* name: name for Menuoption it will act like ID
|
|
39
|
+
* displayname: To display name
|
|
40
|
+
* onClick: Accepts a callbac function, this function will provide name in parameter
|
|
41
|
+
* visibility: (optional) if set to false, the option will be disabled
|
|
42
|
+
* divider: (optional) if set to true, a divider line will be displayed after the MenuItem
|
|
43
|
+
*
|
|
44
|
+
* optionId: Provide an option ID to get it as 2nd parameter of callback function
|
|
45
|
+
* @returns An option component
|
|
46
|
+
*/
|
|
47
|
+
|
|
48
|
+
const OptionMenu = _ref => {
|
|
49
|
+
let options = _ref.options,
|
|
50
|
+
_ref$optionId = _ref.optionId,
|
|
51
|
+
optionId = _ref$optionId === void 0 ? null : _ref$optionId;
|
|
52
|
+
const _React$useState = _react.default.useState(null),
|
|
53
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
54
|
+
anchorEl = _React$useState2[0],
|
|
55
|
+
setAnchorEl = _React$useState2[1];
|
|
56
|
+
const open = Boolean(anchorEl);
|
|
57
|
+
const handleClick = event => {
|
|
58
|
+
setAnchorEl(event.currentTarget);
|
|
59
|
+
};
|
|
60
|
+
const handleClose = () => {
|
|
61
|
+
setAnchorEl(null);
|
|
62
|
+
};
|
|
63
|
+
const handleMenuItemClick = callback => {
|
|
64
|
+
handleClose();
|
|
65
|
+
callback();
|
|
66
|
+
};
|
|
67
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_material.Box, null, /*#__PURE__*/_react.default.createElement(_material.IconButton, {
|
|
68
|
+
"aria-label": "more",
|
|
69
|
+
"aria-controls": "long-menu",
|
|
70
|
+
"aria-haspopup": "true",
|
|
71
|
+
onClick: handleClick
|
|
72
|
+
}, /*#__PURE__*/_react.default.createElement(_fi.FiMoreHorizontal, {
|
|
73
|
+
color: "#44409A"
|
|
74
|
+
})), /*#__PURE__*/_react.default.createElement(_material.Menu, {
|
|
75
|
+
id: "long-menu",
|
|
76
|
+
anchorEl: anchorEl,
|
|
77
|
+
keepMounted: true,
|
|
78
|
+
open: open,
|
|
79
|
+
onClose: handleClose,
|
|
80
|
+
PaperProps: {
|
|
81
|
+
style: {
|
|
82
|
+
maxHeight: ITEM_HEIGHT * 4.5,
|
|
83
|
+
width: "27ch"
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}, options === null || options === void 0 ? void 0 : options.map((option, index) => /*#__PURE__*/_react.default.createElement("div", {
|
|
87
|
+
key: option.name
|
|
88
|
+
}, /*#__PURE__*/_react.default.createElement(_material.MenuItem, {
|
|
89
|
+
disabled: option.visibility === false,
|
|
90
|
+
onClick: () => {
|
|
91
|
+
handleMenuItemClick(() => option === null || option === void 0 ? void 0 : option.onClick(option.name, optionId));
|
|
92
|
+
}
|
|
93
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
94
|
+
container: true,
|
|
95
|
+
alignItems: "center"
|
|
96
|
+
}, /*#__PURE__*/_react.default.createElement("div", null, option.icon && /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
97
|
+
mr: 1
|
|
98
|
+
}, option.icon)), /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
99
|
+
style: {
|
|
100
|
+
display: "flex",
|
|
101
|
+
flexWrap: "wrap"
|
|
102
|
+
}
|
|
103
|
+
}, option === null || option === void 0 ? void 0 : option.displayName))), option.divider && index < options.length - 1 && /*#__PURE__*/_react.default.createElement(_material.Divider, null))))));
|
|
104
|
+
};
|
|
105
|
+
var _default = exports.default = OptionMenu;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _iconButton = _interopRequireDefault(require("../iconButton"));
|
|
9
|
+
var _ArrowLeft = _interopRequireDefault(require("@mui/icons-material/ArrowLeft"));
|
|
10
|
+
var _ArrowRight = _interopRequireDefault(require("@mui/icons-material/ArrowRight"));
|
|
11
|
+
var _material = require("@mui/material");
|
|
12
|
+
var _style = _interopRequireDefault(require("./style"));
|
|
13
|
+
var _default2 = _interopRequireDefault(require("../../themes/default"));
|
|
14
|
+
var _text = _interopRequireDefault(require("../text"));
|
|
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(); }
|
|
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."); }
|
|
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; } /* eslint-disable use-isnan */
|
|
23
|
+
const Pagination = props => {
|
|
24
|
+
const classes = (0, _style.default)();
|
|
25
|
+
const _useState = (0, _react.useState)(props.initialPage),
|
|
26
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
27
|
+
page = _useState2[0],
|
|
28
|
+
setPage = _useState2[1];
|
|
29
|
+
const handlePaginationInputKeyDown = e => {
|
|
30
|
+
const key = e.key;
|
|
31
|
+
if (key === "Enter") {
|
|
32
|
+
if (Number(page) > Number(props.totalPage) || Number(page) < Number(props.initialPage) || !Number(page)) {
|
|
33
|
+
window.alert("Invalid Page Number");
|
|
34
|
+
setPage(props.initialPage);
|
|
35
|
+
} else {
|
|
36
|
+
setPage(page);
|
|
37
|
+
props === null || props === void 0 || props.setInputPage(page);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
const onPrevClick = () => {
|
|
42
|
+
if (props.inputPage === null) {
|
|
43
|
+
setPage(prev => prev - 1);
|
|
44
|
+
} else {
|
|
45
|
+
setPage(prev => Number(props.inputPage) - 1);
|
|
46
|
+
props.setInputPage(null);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
const onNextClick = () => {
|
|
50
|
+
if (props.inputPage === null) {
|
|
51
|
+
setPage(prev => prev + 1);
|
|
52
|
+
} else {
|
|
53
|
+
setPage(prev => Number(props.inputPage) + 1);
|
|
54
|
+
props.setInputPage(null);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
58
|
+
style: {
|
|
59
|
+
display: "flex",
|
|
60
|
+
flexDirection: "row",
|
|
61
|
+
justifyContent: "space-evenly",
|
|
62
|
+
width: "30%"
|
|
63
|
+
}
|
|
64
|
+
}, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(PaginationButton, {
|
|
65
|
+
icon: /*#__PURE__*/_react.default.createElement(_ArrowLeft.default, {
|
|
66
|
+
style: {
|
|
67
|
+
display: "flex",
|
|
68
|
+
alignItems: "center"
|
|
69
|
+
},
|
|
70
|
+
onClick: () => page > props.initialPage ? onPrevClick() : "",
|
|
71
|
+
disabled: page === props.initialPage ? true : false,
|
|
72
|
+
title: "Previous"
|
|
73
|
+
})
|
|
74
|
+
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
75
|
+
className: classes.paginationContent
|
|
76
|
+
}, /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
77
|
+
component: "span",
|
|
78
|
+
variant: "body2"
|
|
79
|
+
// className={classes.paginationText}
|
|
80
|
+
// style={{ fontSize: theme.typography.fontSize - 1, fontWeight: 500 }}
|
|
81
|
+
}, "Page"), /*#__PURE__*/_react.default.createElement("input", {
|
|
82
|
+
type: "text",
|
|
83
|
+
value: page,
|
|
84
|
+
className: classes.pageNumberInput,
|
|
85
|
+
onChange: e => {
|
|
86
|
+
setPage(e.target.value);
|
|
87
|
+
},
|
|
88
|
+
onKeyDown: handlePaginationInputKeyDown
|
|
89
|
+
}), /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
90
|
+
component: "span",
|
|
91
|
+
variant: "body2"
|
|
92
|
+
// className={classes.paginationText}
|
|
93
|
+
// style={{ fontSize: theme.typography.fontSize - 1, fontWeight: 500 }}
|
|
94
|
+
}, "of ", props.totalPage)), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(PaginationButton, {
|
|
95
|
+
icon: /*#__PURE__*/_react.default.createElement(_ArrowRight.default, {
|
|
96
|
+
style: {
|
|
97
|
+
display: "flex",
|
|
98
|
+
alignItems: "center"
|
|
99
|
+
},
|
|
100
|
+
onClick: () => page < props.totalPage && onNextClick(),
|
|
101
|
+
disabled: page === props.totalPage ? true : false,
|
|
102
|
+
title: "Next"
|
|
103
|
+
})
|
|
104
|
+
}))));
|
|
105
|
+
};
|
|
106
|
+
const PaginationButton = icon => {
|
|
107
|
+
return /*#__PURE__*/_react.default.createElement(_iconButton.default, {
|
|
108
|
+
disabled: icon.icon.props.disabled,
|
|
109
|
+
onClick: icon.onClick,
|
|
110
|
+
icon: icon.icon,
|
|
111
|
+
title: icon.icon.props.title
|
|
112
|
+
});
|
|
113
|
+
};
|
|
114
|
+
var _default = exports.default = Pagination;
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
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
|
+
}));
|