tenjin-ui-kit 0.2.51 → 0.2.53
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/components/breadCrumbs/index.js +2 -2
- package/components/button/index.js +9 -4
- package/components/input/index.js +11 -3
- package/components/layout/sidebar/GroupedMenu.js +13 -4
- package/components/layout/sidebar/index.js +9 -9
- package/components/layout/sidebar/style.js +24 -19
- package/package.json +1 -1
|
@@ -66,7 +66,7 @@ function BreadCrumbs(props) {
|
|
|
66
66
|
fontSize: "small"
|
|
67
67
|
}),
|
|
68
68
|
"aria-label": "breadcrumb"
|
|
69
|
-
}, /*#__PURE__*/React.createElement(
|
|
69
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
70
70
|
// to={props.crumbInfo[0]?.link}
|
|
71
71
|
onClick: function onClick(e) {
|
|
72
72
|
var _props$crumbInfo$;
|
|
@@ -82,5 +82,5 @@ function BreadCrumbs(props) {
|
|
|
82
82
|
style: {
|
|
83
83
|
margin: '0.5rem 0.4rem 0rem 0rem'
|
|
84
84
|
}
|
|
85
|
-
}, (_props$crumbInfo$4 = props.crumbInfo[0]) === null || _props$crumbInfo$4 === void 0 ? void 0 : _props$crumbInfo$4.icon), (_props$crumbInfo$5 = props.crumbInfo[0]) === null || _props$crumbInfo$5 === void 0 ? void 0 : _props$crumbInfo$5.title))))
|
|
85
|
+
}, (_props$crumbInfo$4 = props.crumbInfo[0]) === null || _props$crumbInfo$4 === void 0 ? void 0 : _props$crumbInfo$4.icon), (_props$crumbInfo$5 = props.crumbInfo[0]) === null || _props$crumbInfo$5 === void 0 ? void 0 : _props$crumbInfo$5.title))));
|
|
86
86
|
}
|
|
@@ -26,7 +26,12 @@ var Button = function Button(props) {
|
|
|
26
26
|
};
|
|
27
27
|
return /*#__PURE__*/_react.default.createElement(_material.Button, _extends({
|
|
28
28
|
onClick: handleClick
|
|
29
|
-
}, props
|
|
29
|
+
}, props, {
|
|
30
|
+
size: "small",
|
|
31
|
+
sx: {
|
|
32
|
+
minWidth: 148
|
|
33
|
+
}
|
|
34
|
+
}), loading ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(ButtonLoader, {
|
|
30
35
|
buttonColor: color,
|
|
31
36
|
size: size,
|
|
32
37
|
loadingText: loadingText
|
|
@@ -40,16 +45,16 @@ var ButtonLoader = function ButtonLoader(_ref) {
|
|
|
40
45
|
var resolvedButtonColor = theme.palette[buttonColor] ? theme.palette[buttonColor].main : theme.palette.primary.main;
|
|
41
46
|
var textColor = theme.palette.getContrastText(resolvedButtonColor);
|
|
42
47
|
return /*#__PURE__*/_react.default.createElement(_material.CircularProgress, {
|
|
43
|
-
size: size ===
|
|
48
|
+
size: size === 'small' ? 20 : size === 'large' ? 24 : 22,
|
|
44
49
|
sx: {
|
|
45
|
-
marginRight: loadingText ?
|
|
50
|
+
marginRight: loadingText ? '0.5rem' : 'initial',
|
|
46
51
|
color: textColor
|
|
47
52
|
}
|
|
48
53
|
});
|
|
49
54
|
};
|
|
50
55
|
exports.ButtonLoader = ButtonLoader;
|
|
51
56
|
Button.defaultProps = {
|
|
52
|
-
color:
|
|
57
|
+
color: 'primary'
|
|
53
58
|
};
|
|
54
59
|
Button.propTypes = {
|
|
55
60
|
loading: _propTypes.default.bool,
|
|
@@ -10,7 +10,7 @@ var _InputLabel = _interopRequireDefault(require("@mui/material/InputLabel"));
|
|
|
10
10
|
var _styles = require("@mui/material/styles");
|
|
11
11
|
var _react = _interopRequireDefault(require("react"));
|
|
12
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
var _excluded = ["label", "id", "fullWidth", "disableAutocomplete", "startIcon", "endIcon", "size", "error", "errorMessage", "isRequired", "isDisabled"];
|
|
13
|
+
var _excluded = ["label", "id", "fullWidth", "disableAutocomplete", "startIcon", "endIcon", "size", "error", "errorMessage", "isRequired", "isDisabled", "isPastDateDisabled"];
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
16
16
|
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; }
|
|
@@ -27,8 +27,10 @@ var Input = function Input(_ref) {
|
|
|
27
27
|
errorMessage = _ref.errorMessage,
|
|
28
28
|
isRequired = _ref.isRequired,
|
|
29
29
|
isDisabled = _ref.isDisabled,
|
|
30
|
+
isPastDateDisabled = _ref.isPastDateDisabled,
|
|
30
31
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
31
32
|
var theme = (0, _styles.useTheme)();
|
|
33
|
+
var minDate = new Date().toISOString().split('T')[0];
|
|
32
34
|
return /*#__PURE__*/_react.default.createElement(_FormControl.default, {
|
|
33
35
|
variant: "standard",
|
|
34
36
|
fullWidth: fullWidth
|
|
@@ -60,7 +62,10 @@ var Input = function Input(_ref) {
|
|
|
60
62
|
startAdornment: startIcon,
|
|
61
63
|
endAdornment: endIcon,
|
|
62
64
|
helperText: errorMessage,
|
|
63
|
-
disabled: isDisabled
|
|
65
|
+
disabled: isDisabled,
|
|
66
|
+
inputProps: isPastDateDisabled && {
|
|
67
|
+
min: minDate
|
|
68
|
+
}
|
|
64
69
|
})), error && /*#__PURE__*/_react.default.createElement(_material.TextField, _extends({
|
|
65
70
|
required: isRequired,
|
|
66
71
|
id: id,
|
|
@@ -78,7 +83,10 @@ var Input = function Input(_ref) {
|
|
|
78
83
|
startAdornment: startIcon,
|
|
79
84
|
endAdornment: endIcon,
|
|
80
85
|
helperText: errorMessage,
|
|
81
|
-
error: true
|
|
86
|
+
error: true,
|
|
87
|
+
inputProps: isPastDateDisabled && {
|
|
88
|
+
min: minDate
|
|
89
|
+
}
|
|
82
90
|
}, rest)));
|
|
83
91
|
};
|
|
84
92
|
Input.propTypes = {
|
|
@@ -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,15 +10,21 @@ var _material = require("@mui/material");
|
|
|
11
10
|
var _reactRouterDom = require("react-router-dom");
|
|
12
11
|
var _style = _interopRequireDefault(require("./style"));
|
|
13
12
|
var _ = require("..");
|
|
13
|
+
var _clsx2 = _interopRequireDefault(require("clsx"));
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
16
16
|
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; }
|
|
17
|
+
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); }
|
|
18
|
+
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; }
|
|
19
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
20
|
+
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); }
|
|
17
21
|
var GroupedMenu = function GroupedMenu(_ref) {
|
|
18
22
|
var groups = _ref.groups;
|
|
19
23
|
var classes = (0, _style.default)();
|
|
20
24
|
var _useContext = (0, _react.useContext)(_.LayoutContext),
|
|
21
25
|
selectedSidebarKey = _useContext.layoutState.selectedSidebarKey,
|
|
22
26
|
setSelectedSidebarKey = _useContext.setSelectedSidebarKey;
|
|
27
|
+
console.log(selectedSidebarKey, '0-00000000000000000');
|
|
23
28
|
return groups ? groups.map(function (group, index) {
|
|
24
29
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
25
30
|
key: group.groupName
|
|
@@ -28,10 +33,11 @@ var GroupedMenu = function GroupedMenu(_ref) {
|
|
|
28
33
|
className: classes.subHeader
|
|
29
34
|
}, group.groupName)
|
|
30
35
|
}, group.items.map(function (i) {
|
|
36
|
+
var _clsx;
|
|
31
37
|
return /*#__PURE__*/_react.default.createElement(_material.ListItemButton, {
|
|
32
38
|
disableRipple: true,
|
|
33
39
|
disableTouchRipple: true,
|
|
34
|
-
component: i.serverSide ?
|
|
40
|
+
component: i.serverSide ? 'a' : _reactRouterDom.Link,
|
|
35
41
|
href: i.href,
|
|
36
42
|
to: i.href,
|
|
37
43
|
selected: i.key === selectedSidebarKey,
|
|
@@ -39,14 +45,17 @@ var GroupedMenu = function GroupedMenu(_ref) {
|
|
|
39
45
|
key: i.key,
|
|
40
46
|
onClick: function onClick() {
|
|
41
47
|
return setSelectedSidebarKey(i.key);
|
|
48
|
+
},
|
|
49
|
+
classes: {
|
|
50
|
+
selected: classes.selectedGroupMenuItem
|
|
42
51
|
}
|
|
43
52
|
}, /*#__PURE__*/_react.default.createElement(_material.ListItemText, {
|
|
44
53
|
disableTypography: true,
|
|
45
|
-
className: classes.listItemText
|
|
54
|
+
className: (0, _clsx2.default)((_clsx = {}, _defineProperty(_clsx, classes.listItemText, true), _defineProperty(_clsx, classes.selectedFlatMenuItemText, selectedSidebarKey === i.key), _clsx))
|
|
46
55
|
}, i.display));
|
|
47
56
|
})), index < groups.length - 1 && /*#__PURE__*/_react.default.createElement(_material.Divider, {
|
|
48
57
|
sx: {
|
|
49
|
-
height:
|
|
58
|
+
height: 'initial !important'
|
|
50
59
|
}
|
|
51
60
|
}));
|
|
52
61
|
}) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null);
|
|
@@ -34,14 +34,14 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
34
34
|
toggleSidebar = _useContext.toggleSidebar,
|
|
35
35
|
setSelectedSidebarKey = _useContext.setSelectedSidebarKey;
|
|
36
36
|
return /*#__PURE__*/_react.default.createElement(_paper.default, {
|
|
37
|
-
className: (0, _clsx2.default)((_clsx = {}, _defineProperty(_clsx, classes.expanded, !collapsed), _defineProperty(_clsx, classes.collapsed, collapsed && allowCollapse), _defineProperty(_clsx,
|
|
37
|
+
className: (0, _clsx2.default)((_clsx = {}, _defineProperty(_clsx, classes.expanded, !collapsed), _defineProperty(_clsx, classes.collapsed, collapsed && allowCollapse), _defineProperty(_clsx, 'tenjin-sidebar', true), _clsx)),
|
|
38
38
|
fullHeight: true
|
|
39
39
|
}, /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
40
40
|
sx: {
|
|
41
41
|
padding: theme.spacing(1),
|
|
42
|
-
maxHeight: allowCollapse ?
|
|
43
|
-
height: allowCollapse ?
|
|
44
|
-
overflowY:
|
|
42
|
+
maxHeight: allowCollapse ? 'calc(100% - 48px)' : '100%',
|
|
43
|
+
height: allowCollapse ? 'calc(100% - 48px)' : '100%',
|
|
44
|
+
overflowY: 'auto'
|
|
45
45
|
}
|
|
46
46
|
}, children), allowCollapse && /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
47
47
|
display: "flex",
|
|
@@ -49,22 +49,22 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
49
49
|
justifyContent: "center",
|
|
50
50
|
alignContent: "center",
|
|
51
51
|
sx: {
|
|
52
|
-
height:
|
|
52
|
+
height: '48px'
|
|
53
53
|
}
|
|
54
54
|
}, /*#__PURE__*/_react.default.createElement(_material.Tooltip, {
|
|
55
|
-
title: collapsed ?
|
|
55
|
+
title: collapsed ? 'Expand' : 'Collapse',
|
|
56
56
|
placement: "top"
|
|
57
57
|
}, /*#__PURE__*/_react.default.createElement(_material.IconButton, {
|
|
58
58
|
size: "large",
|
|
59
59
|
disableRipple: true,
|
|
60
60
|
sx: {
|
|
61
|
-
height:
|
|
62
|
-
width:
|
|
61
|
+
height: '100%',
|
|
62
|
+
width: '100%'
|
|
63
63
|
},
|
|
64
64
|
variant: "text",
|
|
65
65
|
fullWidth: true,
|
|
66
66
|
onClick: toggleSidebar,
|
|
67
|
-
"aria-label": collapsed ?
|
|
67
|
+
"aria-label": collapsed ? 'Expand Menu' : 'Collapse Menu'
|
|
68
68
|
}, collapsed ? /*#__PURE__*/_react.default.createElement(_fi.FiChevronRight, null) : /*#__PURE__*/_react.default.createElement(_fi.FiChevronLeft, null)))));
|
|
69
69
|
};
|
|
70
70
|
Sidebar.propTypes = {
|
|
@@ -8,50 +8,55 @@ var _styles = require("@mui/styles");
|
|
|
8
8
|
var _default = (0, _styles.makeStyles)(function (theme) {
|
|
9
9
|
return {
|
|
10
10
|
subHeader: {
|
|
11
|
-
textTransform:
|
|
11
|
+
textTransform: 'uppercase',
|
|
12
12
|
fontSize: theme.typography.fontSize - 2,
|
|
13
|
-
color:
|
|
13
|
+
color: 'rgba(0,0,0,0.5)',
|
|
14
14
|
fontWeight: 500
|
|
15
15
|
},
|
|
16
16
|
link: {
|
|
17
|
-
textDecoration:
|
|
17
|
+
textDecoration: 'none'
|
|
18
18
|
},
|
|
19
19
|
listItemText: {
|
|
20
20
|
color: "".concat(theme.palette.primary.main, " !important"),
|
|
21
|
-
fontWeight:
|
|
21
|
+
fontWeight: '500 !important'
|
|
22
22
|
},
|
|
23
23
|
expanded: {
|
|
24
|
-
width:
|
|
24
|
+
width: '240px'
|
|
25
25
|
},
|
|
26
26
|
collapsed: {
|
|
27
|
-
width:
|
|
27
|
+
width: '72px'
|
|
28
28
|
},
|
|
29
29
|
collapsedFlatMenuItem: {
|
|
30
|
-
paddingLeft:
|
|
31
|
-
paddingRight:
|
|
32
|
-
display:
|
|
33
|
-
alignItems:
|
|
34
|
-
justifyContent:
|
|
35
|
-
|
|
36
|
-
minWidth:
|
|
30
|
+
paddingLeft: '0',
|
|
31
|
+
paddingRight: '0',
|
|
32
|
+
display: 'flex !important',
|
|
33
|
+
alignItems: 'center !important',
|
|
34
|
+
justifyContent: 'center !important',
|
|
35
|
+
'& .MuiListItemIcon-root': {
|
|
36
|
+
minWidth: '10px'
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
39
|
collapsedFlatMenuItemText: {
|
|
40
|
-
display:
|
|
40
|
+
display: 'none !important'
|
|
41
41
|
},
|
|
42
42
|
flatMenuItem: {
|
|
43
|
-
height:
|
|
44
|
-
borderRadius:
|
|
43
|
+
height: '48px',
|
|
44
|
+
borderRadius: '7px !important'
|
|
45
45
|
},
|
|
46
46
|
selectedFlatMenuItem: {
|
|
47
47
|
backgroundColor: "".concat(theme.palette.primary.main, " !important"),
|
|
48
|
-
color:
|
|
48
|
+
color: '#fff !important'
|
|
49
|
+
},
|
|
50
|
+
selectedGroupMenuItem: {
|
|
51
|
+
backgroundColor: "".concat(theme.palette.primary.main, " !important"),
|
|
52
|
+
color: '#fff !important',
|
|
53
|
+
borderRadius: '5px !important'
|
|
49
54
|
},
|
|
50
55
|
selectedFlatMenuIcon: {
|
|
51
|
-
color:
|
|
56
|
+
color: '#fff !important'
|
|
52
57
|
},
|
|
53
58
|
selectedFlatMenuItemText: {
|
|
54
|
-
color:
|
|
59
|
+
color: '#fff !important'
|
|
55
60
|
}
|
|
56
61
|
};
|
|
57
62
|
});
|