orc-shared 5.10.1-dev.5 → 5.10.1-dev.7
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/dist/components/AppFrame/MenuItem.js +3 -12
- package/dist/components/MaterialUI/DataDisplay/Table.js +2 -1
- package/dist/components/MaterialUI/DataDisplay/TableProps.js +3 -1
- package/dist/components/MaterialUI/Surfaces/SectionExpansionPanel.js +3 -2
- package/dist/components/ToastList.js +95 -64
- package/dist/getTheme.js +0 -5
- package/dist/utils/toastHelper.js +52 -0
- package/package.json +1 -1
- package/src/components/AppFrame/MenuItem.js +1 -9
- package/src/components/MaterialUI/DataDisplay/Table.js +6 -1
- package/src/components/MaterialUI/DataDisplay/Table.test.js +20 -0
- package/src/components/MaterialUI/DataDisplay/TableProps.js +2 -0
- package/src/components/MaterialUI/DataDisplay/TableProps.test.js +20 -2
- package/src/components/MaterialUI/Surfaces/SectionExpansionPanel.js +2 -1
- package/src/components/ToastList.js +79 -90
- package/src/components/ToastList.test.js +29 -103
- package/src/getTheme.js +0 -5
- package/src/utils/toastHelper.js +8 -0
- package/src/utils/toastHelper.test.js +41 -0
- package/dist/components/CategoryList.js +0 -197
- package/dist/components/List/DataCell.js +0 -129
- package/dist/components/List/HeadCell.js +0 -125
- package/dist/components/List/HeadRow.js +0 -73
- package/dist/components/List/List.js +0 -274
- package/dist/components/List/Row.js +0 -109
- package/dist/components/List/enhanceColumnDefs.js +0 -111
- package/dist/components/List/index.js +0 -59
- package/src/components/CategoryList.js +0 -140
- package/src/components/CategoryList.test.js +0 -667
- package/src/components/List/DataCell.js +0 -77
- package/src/components/List/DataCell.test.js +0 -357
- package/src/components/List/HeadCell.js +0 -105
- package/src/components/List/HeadCell.test.js +0 -331
- package/src/components/List/HeadRow.js +0 -21
- package/src/components/List/HeadRow.test.js +0 -27
- package/src/components/List/List.js +0 -162
- package/src/components/List/List.test.js +0 -705
- package/src/components/List/Row.js +0 -72
- package/src/components/List/Row.test.js +0 -194
- package/src/components/List/enhanceColumnDefs.js +0 -54
- package/src/components/List/enhanceColumnDefs.test.js +0 -179
- package/src/components/List/index.js +0 -6
|
@@ -7,6 +7,7 @@ var _styles = require("@material-ui/core/styles");
|
|
|
7
7
|
var _reactRouterDom = require("react-router-dom");
|
|
8
8
|
var _reactIntl = require("react-intl");
|
|
9
9
|
var _Icon = _interopRequireDefault(require("../MaterialUI/DataDisplay/Icon"));
|
|
10
|
+
var _toastHelper = require("../../utils/toastHelper");
|
|
10
11
|
var _excluded = ["staticContext", "dispatch", "component"],
|
|
11
12
|
_excluded2 = ["open", "label", "icon", "alert", "isHidden", "href", "menuToggle", "active"];
|
|
12
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -29,14 +30,6 @@ var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoader
|
|
|
29
30
|
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
30
31
|
return a;
|
|
31
32
|
};
|
|
32
|
-
var getToastColor = function getToastColor(theme, alertType) {
|
|
33
|
-
var toastBorderColors = {
|
|
34
|
-
error: theme.palette.error.main,
|
|
35
|
-
warn: theme.palette.warning.main,
|
|
36
|
-
confirm: theme.palette.success.main
|
|
37
|
-
};
|
|
38
|
-
return toastBorderColors[alertType] || "red";
|
|
39
|
-
};
|
|
40
33
|
var useStyles = (0, _styles.makeStyles)(function (theme) {
|
|
41
34
|
return {
|
|
42
35
|
block: function block(props) {
|
|
@@ -54,7 +47,7 @@ var useStyles = (0, _styles.makeStyles)(function (theme) {
|
|
|
54
47
|
};
|
|
55
48
|
},
|
|
56
49
|
alert: function alert(props) {
|
|
57
|
-
var toastColor = getToastColor(theme, props.alertType);
|
|
50
|
+
var toastColor = (0, _toastHelper.getToastColor)(theme, props.alertType);
|
|
58
51
|
return {
|
|
59
52
|
borderRadius: "50%",
|
|
60
53
|
border: "4px solid ".concat(toastColor),
|
|
@@ -68,7 +61,7 @@ var useStyles = (0, _styles.makeStyles)(function (theme) {
|
|
|
68
61
|
};
|
|
69
62
|
},
|
|
70
63
|
alertMessage: function alertMessage(props) {
|
|
71
|
-
var toastColor = getToastColor(theme, props.alertType);
|
|
64
|
+
var toastColor = (0, _toastHelper.getToastColor)(theme, props.alertType);
|
|
72
65
|
return {
|
|
73
66
|
position: "absolute",
|
|
74
67
|
zIndex: 10000,
|
|
@@ -186,7 +179,6 @@ var _default3 = exports.default = _default2;
|
|
|
186
179
|
if (!reactHotLoader) {
|
|
187
180
|
return;
|
|
188
181
|
}
|
|
189
|
-
reactHotLoader.register(getToastColor, "getToastColor", "/home/vsts/work/1/s/src/components/AppFrame/MenuItem.js");
|
|
190
182
|
reactHotLoader.register(useStyles, "useStyles", "/home/vsts/work/1/s/src/components/AppFrame/MenuItem.js");
|
|
191
183
|
reactHotLoader.register(FilteredLink, "FilteredLink", "/home/vsts/work/1/s/src/components/AppFrame/MenuItem.js");
|
|
192
184
|
reactHotLoader.register(MenuItem, "MenuItem", "/home/vsts/work/1/s/src/components/AppFrame/MenuItem.js");
|
|
@@ -203,7 +195,6 @@ var _default3 = exports.default = _default2;
|
|
|
203
195
|
if (!reactHotLoader) {
|
|
204
196
|
return;
|
|
205
197
|
}
|
|
206
|
-
reactHotLoader.register(getToastColor, "getToastColor", "/home/vsts/work/1/s/src/components/AppFrame/MenuItem.js");
|
|
207
198
|
reactHotLoader.register(useStyles, "useStyles", "/home/vsts/work/1/s/src/components/AppFrame/MenuItem.js");
|
|
208
199
|
reactHotLoader.register(FilteredLink, "FilteredLink", "/home/vsts/work/1/s/src/components/AppFrame/MenuItem.js");
|
|
209
200
|
reactHotLoader.register(MenuItem, "MenuItem", "/home/vsts/work/1/s/src/components/AppFrame/MenuItem.js");
|
|
@@ -353,7 +353,7 @@ var DefaultFullTable = _react.default.forwardRef(function (props, ref) {
|
|
|
353
353
|
isEditingMode: props.isEditingMode,
|
|
354
354
|
context: props.context
|
|
355
355
|
})), props.tableRows.length > 0 ? null : /*#__PURE__*/_react.default.createElement("div", {
|
|
356
|
-
className: props.classes.placeholder
|
|
356
|
+
className: (0, _classnames.default)(props.classes.placeholder, props.customClasses.placeholderContainer)
|
|
357
357
|
}, props.placeholder));
|
|
358
358
|
});
|
|
359
359
|
var FullTableWithSavedScrollbar = _react.default.forwardRef(__signature__(__signature__(function (props, ref) {
|
|
@@ -452,6 +452,7 @@ var Table = _react.default.forwardRef(__signature__(__signature__(function (_ref
|
|
|
452
452
|
customClasses["tableCell"] = (tableProps == null ? void 0 : tableProps.getStyle(_TableProps.default.ruleNames.tableCell)) || null;
|
|
453
453
|
customClasses["headerCell"] = (tableProps == null ? void 0 : tableProps.getStyle(_TableProps.default.ruleNames.headerCell)) || null;
|
|
454
454
|
customClasses["tableContainer"] = (tableProps == null ? void 0 : tableProps.getStyle(_TableProps.default.ruleNames.tableContainer)) || null;
|
|
455
|
+
customClasses["placeholderContainer"] = (tableProps == null ? void 0 : tableProps.getStyle(_TableProps.default.ruleNames.placeholderContainer)) || null;
|
|
455
456
|
customClasses["container"] = (tableProps == null ? void 0 : tableProps.getStyle(_TableProps.default.ruleNames.container)) || null;
|
|
456
457
|
customClasses["table"] = (tableProps == null ? void 0 : tableProps.getStyle(_TableProps.default.ruleNames.table)) || null;
|
|
457
458
|
if (selectedRows && !selectedRowsChanged || !selectedRows && selectedRowsChanged) throw new Error("Both 'selectedRows' and 'selectedRowsChanged' need to be defined if one of them is.");
|
|
@@ -44,6 +44,7 @@ var TableProps = /*#__PURE__*/function (_ComponentProps) {
|
|
|
44
44
|
_this.componentClasses.set(_this.constructor.ruleNames.tableCell, null);
|
|
45
45
|
_this.componentClasses.set(_this.constructor.ruleNames.headerCell, null);
|
|
46
46
|
_this.componentClasses.set(_this.constructor.ruleNames.tableContainer, null);
|
|
47
|
+
_this.componentClasses.set(_this.constructor.ruleNames.placeholderContainer, null);
|
|
47
48
|
_this.componentClasses.set(_this.constructor.ruleNames.container, null);
|
|
48
49
|
_this.componentClasses.set(_this.constructor.ruleNames.table, null);
|
|
49
50
|
_this._isTableProps = true;
|
|
@@ -79,7 +80,8 @@ _defineProperty(TableProps, "ruleNames", {
|
|
|
79
80
|
headerCell: "headerCell",
|
|
80
81
|
tableContainer: "tableContainer",
|
|
81
82
|
container: "container",
|
|
82
|
-
table: "table"
|
|
83
|
+
table: "table",
|
|
84
|
+
placeholderContainer: "placeholderContainer"
|
|
83
85
|
});
|
|
84
86
|
var isTableProps = exports.isTableProps = function isTableProps(value) {
|
|
85
87
|
if (value == null) return true;
|
|
@@ -89,7 +89,8 @@ var SectionExpansionPanel = function SectionExpansionPanel(_ref) {
|
|
|
89
89
|
actions = _ref.actions,
|
|
90
90
|
expansionPanelId = _ref.expansionPanelId,
|
|
91
91
|
expansionPanelProps = _ref.expansionPanelProps,
|
|
92
|
-
expansionPanelActionsProps = _ref.expansionPanelActionsProps
|
|
92
|
+
expansionPanelActionsProps = _ref.expansionPanelActionsProps,
|
|
93
|
+
headerClassName = _ref.headerClassName;
|
|
93
94
|
if ((0, _expansionPanelProps.isExpansionPanelProps)(expansionPanelProps) === false) {
|
|
94
95
|
throw new TypeError("expansionPanelProps property is not of type ExpansionPanelProps");
|
|
95
96
|
}
|
|
@@ -142,7 +143,7 @@ var SectionExpansionPanel = function SectionExpansionPanel(_ref) {
|
|
|
142
143
|
}),
|
|
143
144
|
IconButtonProps: defaultSummaryStyles,
|
|
144
145
|
classes: {
|
|
145
|
-
root: (0, _classnames.default)(classes.summaryRoot, constrained ? classes.constrainedSummaryRoot : ""),
|
|
146
|
+
root: (0, _classnames.default)(classes.summaryRoot, headerClassName, constrained ? classes.constrainedSummaryRoot : ""),
|
|
146
147
|
expanded: (0, _classnames.default)(classes.panelExpanded),
|
|
147
148
|
content: (0, _classnames.default)(classes.summaryContent, constrained ? classes.constrainedSummaryContent : ""),
|
|
148
149
|
expandIcon: (0, _classnames.default)(classes.summaryExpandIconRoot)
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.default = exports.ToastList = exports.
|
|
4
|
+
exports.default = exports.ToastList = exports.Toast = void 0;
|
|
5
5
|
var _react = _interopRequireDefault(require("react"));
|
|
6
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
7
|
-
var _styledTransitionGroup = _interopRequireDefault(require("styled-transition-group"));
|
|
8
|
-
var _reactTransitionGroup = require("react-transition-group");
|
|
9
6
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
7
|
+
var _reactIntl = require("react-intl");
|
|
8
|
+
var _styles = require("@material-ui/core/styles");
|
|
9
|
+
var _Icon = _interopRequireDefault(require("./MaterialUI/DataDisplay/Icon"));
|
|
10
|
+
var _toastHelper = require("../utils/toastHelper");
|
|
11
|
+
var _reactTransitionGroup = require("react-transition-group");
|
|
14
12
|
var _excluded = ["message", "type", "closeFunc"];
|
|
15
|
-
var _templateObject;
|
|
16
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
14
|
(function () {
|
|
18
15
|
var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
|
|
@@ -25,7 +22,6 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
25
22
|
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); }
|
|
26
23
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
27
24
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
|
|
28
|
-
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
29
25
|
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
30
26
|
return a;
|
|
31
27
|
};
|
|
@@ -38,36 +34,65 @@ if (!portal.parent) {
|
|
|
38
34
|
portal.id = "toast";
|
|
39
35
|
document.body.appendChild(portal);
|
|
40
36
|
}
|
|
41
|
-
var
|
|
42
|
-
var ToastBox = exports.ToastBox = _styledTransitionGroup.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\tdisplay: flex;\n\twidth: 390px;\n\tmargin-top: 10px;\n\tpadding: 17px;\n\tborder-radius: 5px;\n\tfont-size: 14px;\n\tcolor: white;\n\tbackground-color: ", ";\n\tz-index: 10000;\n\n\t& > * {\n\t\tmargin-top: auto;\n\t\tmargin-bottom: auto;\n\t}\n\t\n\t&:enter {\n\t\ttransform: translateX(200%);\n\t}\n\t&:enter-active {\n\t\ttransform: translateX(0);\n\t\ttransition: transform ", "ms ease-out;\n\t}\n\t&:exit {\n\t\ttransform-origin: top;\n\t\ttransform: scale(1,1);\n\t}\n\t&:exit ~ & {\n\t\ttransform: translateY(0);\n\t}\n\t&:exit-active {\n\t\ttransform: scale(1, 0.001);\n\t\ttransition: transform ", "ms ease-out;\n\t}\n\t&:exit-active ~ & {\n\t\ttransition: transform ", "ms ease-out;\n\t\ttransform: translateY(-100%);\n\t}\n"])), (0, _utils.getThemeProp)(["colors", "toasts", function (props) {
|
|
43
|
-
return props.type;
|
|
44
|
-
}], "#999"), toastTransitionTime, toastTransitionTime, toastTransitionTime);
|
|
45
|
-
ToastBox.defaultProps = {
|
|
46
|
-
timeout: toastTransitionTime,
|
|
47
|
-
unmountOnExit: true
|
|
48
|
-
};
|
|
49
|
-
var ToastIcon = exports.ToastIcon = (0, _styledComponents.default)(_Icon.default).attrs(function (props) {
|
|
50
|
-
return {
|
|
51
|
-
id: (0, _utils.getThemeProp)(["icons", "toast", function (props) {
|
|
52
|
-
return props.type;
|
|
53
|
-
}], "bubble-chat-2")(props)
|
|
54
|
-
};
|
|
55
|
-
}).withConfig({
|
|
56
|
-
displayName: "ToastList__ToastIcon",
|
|
57
|
-
componentId: "sc-ux3rdy-0"
|
|
58
|
-
})(["font-size:20px;margin-right:16px;stroke-width:2px;"]);
|
|
59
|
-
var CloseIcon = exports.CloseIcon = (0, _styledComponents.default)(_Icon.default).attrs(function (props) {
|
|
37
|
+
var useStyles = (0, _styles.makeStyles)(function (theme) {
|
|
60
38
|
return {
|
|
61
|
-
|
|
39
|
+
toastBox: function toastBox(props) {
|
|
40
|
+
var toastColor = (0, _toastHelper.getToastColor)(theme, props.toastType);
|
|
41
|
+
return {
|
|
42
|
+
display: "flex",
|
|
43
|
+
width: "390px",
|
|
44
|
+
marginTop: "10px",
|
|
45
|
+
padding: "17px",
|
|
46
|
+
borderRadius: "5px",
|
|
47
|
+
fontSize: "14px",
|
|
48
|
+
color: "white",
|
|
49
|
+
backgroundColor: toastColor,
|
|
50
|
+
zIndex: 10000,
|
|
51
|
+
"& > *": {
|
|
52
|
+
marginTop: "auto",
|
|
53
|
+
marginBottom: "auto"
|
|
54
|
+
},
|
|
55
|
+
"&.enter": {
|
|
56
|
+
transform: "translateX(200%)"
|
|
57
|
+
},
|
|
58
|
+
"&.enter-active": {
|
|
59
|
+
transform: "translateX(0)",
|
|
60
|
+
transition: "transform 300ms ease-out"
|
|
61
|
+
},
|
|
62
|
+
"&.exit": {
|
|
63
|
+
transformOrigin: "top",
|
|
64
|
+
transform: "scale(1,1)"
|
|
65
|
+
},
|
|
66
|
+
"&.exit ~ &": {
|
|
67
|
+
transform: "translateY(0)"
|
|
68
|
+
},
|
|
69
|
+
"&.exit-active": {
|
|
70
|
+
transform: "scale(1, 0.001)",
|
|
71
|
+
transition: "transform 300ms ease-out"
|
|
72
|
+
},
|
|
73
|
+
"&.exit-active ~ &": {
|
|
74
|
+
transition: "transform 300ms ease-out",
|
|
75
|
+
transform: "translateY(-100%)"
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
},
|
|
79
|
+
listWrapper: {
|
|
80
|
+
position: "absolute",
|
|
81
|
+
top: "40px",
|
|
82
|
+
right: "16px",
|
|
83
|
+
display: "flex",
|
|
84
|
+
flexDirection: "column"
|
|
85
|
+
},
|
|
86
|
+
closeIcon: {
|
|
87
|
+
padding: "2px",
|
|
88
|
+
borderRadius: "2px",
|
|
89
|
+
strokeWidth: "2px",
|
|
90
|
+
cursor: "pointer",
|
|
91
|
+
marginLeft: "auto",
|
|
92
|
+
fontSize: "20px"
|
|
93
|
+
}
|
|
62
94
|
};
|
|
63
|
-
})
|
|
64
|
-
displayName: "ToastList__CloseIcon",
|
|
65
|
-
componentId: "sc-ux3rdy-1"
|
|
66
|
-
})(["position:absolute;top:8px;right:8px;font-size:10px;padding:2px;border-radius:2px;stroke-width:2px;&:hover{background-color:", ";}"], (0, _utils.getThemeProp)(["colors", "toasts", function (props) {
|
|
67
|
-
return props.type;
|
|
68
|
-
}], "#999999", function (color) {
|
|
69
|
-
return (0, _polished.shade)(0.3, color);
|
|
70
|
-
}));
|
|
95
|
+
});
|
|
71
96
|
var Toast = exports.Toast = function Toast(_ref) {
|
|
72
97
|
var _ref$message = _ref.message,
|
|
73
98
|
message = _ref$message === void 0 ? "[No message]" : _ref$message,
|
|
@@ -75,30 +100,44 @@ var Toast = exports.Toast = function Toast(_ref) {
|
|
|
75
100
|
type = _ref$type === void 0 ? "" : _ref$type,
|
|
76
101
|
closeFunc = _ref.closeFunc,
|
|
77
102
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
103
|
+
var classes = useStyles({
|
|
104
|
+
toastType: type
|
|
105
|
+
});
|
|
106
|
+
return /*#__PURE__*/_react.default.createElement(_reactTransitionGroup.CSSTransition, {
|
|
107
|
+
in: props.in,
|
|
108
|
+
timeout: 300,
|
|
109
|
+
unmountOnExit: true
|
|
110
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
111
|
+
className: classes.toastBox
|
|
112
|
+
}, /*#__PURE__*/_react.default.createElement("span", null, typeof message === "string" ? message : /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, message)), closeFunc ? /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
113
|
+
id: "close",
|
|
114
|
+
className: classes.closeIcon,
|
|
115
|
+
onClick: closeFunc
|
|
116
|
+
}) : null));
|
|
89
117
|
};
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
118
|
+
__signature__(Toast, "useStyles{classes}", function () {
|
|
119
|
+
return [useStyles];
|
|
120
|
+
});
|
|
121
|
+
__signature__(Toast, "useStyles{classes}", function () {
|
|
122
|
+
return [useStyles];
|
|
123
|
+
});
|
|
94
124
|
var ToastList = exports.ToastList = function ToastList(_ref2) {
|
|
95
125
|
var toasts = _ref2.toasts;
|
|
96
|
-
|
|
126
|
+
var classes = useStyles();
|
|
127
|
+
return _reactDom.default.createPortal(/*#__PURE__*/_react.default.createElement(_reactTransitionGroup.TransitionGroup, {
|
|
128
|
+
className: classes.listWrapper
|
|
129
|
+
}, toasts.map(function (props, idx) {
|
|
97
130
|
return /*#__PURE__*/_react.default.createElement(Toast, _extends({
|
|
98
131
|
key: "toast" + idx
|
|
99
132
|
}, props));
|
|
100
133
|
})), portal);
|
|
101
134
|
};
|
|
135
|
+
__signature__(ToastList, "useStyles{classes}", function () {
|
|
136
|
+
return [useStyles];
|
|
137
|
+
});
|
|
138
|
+
__signature__(ToastList, "useStyles{classes}", function () {
|
|
139
|
+
return [useStyles];
|
|
140
|
+
});
|
|
102
141
|
var _default = ToastList;
|
|
103
142
|
var _default2 = _default;
|
|
104
143
|
var _default3 = exports.default = _default2;
|
|
@@ -109,12 +148,8 @@ var _default3 = exports.default = _default2;
|
|
|
109
148
|
return;
|
|
110
149
|
}
|
|
111
150
|
reactHotLoader.register(portal, "portal", "/home/vsts/work/1/s/src/components/ToastList.js");
|
|
112
|
-
reactHotLoader.register(
|
|
113
|
-
reactHotLoader.register(ToastBox, "ToastBox", "/home/vsts/work/1/s/src/components/ToastList.js");
|
|
114
|
-
reactHotLoader.register(ToastIcon, "ToastIcon", "/home/vsts/work/1/s/src/components/ToastList.js");
|
|
115
|
-
reactHotLoader.register(CloseIcon, "CloseIcon", "/home/vsts/work/1/s/src/components/ToastList.js");
|
|
151
|
+
reactHotLoader.register(useStyles, "useStyles", "/home/vsts/work/1/s/src/components/ToastList.js");
|
|
116
152
|
reactHotLoader.register(Toast, "Toast", "/home/vsts/work/1/s/src/components/ToastList.js");
|
|
117
|
-
reactHotLoader.register(ListWrapper, "ListWrapper", "/home/vsts/work/1/s/src/components/ToastList.js");
|
|
118
153
|
reactHotLoader.register(ToastList, "ToastList", "/home/vsts/work/1/s/src/components/ToastList.js");
|
|
119
154
|
reactHotLoader.register(_default, "default", "/home/vsts/work/1/s/src/components/ToastList.js");
|
|
120
155
|
})();
|
|
@@ -130,12 +165,8 @@ var _default3 = exports.default = _default2;
|
|
|
130
165
|
return;
|
|
131
166
|
}
|
|
132
167
|
reactHotLoader.register(portal, "portal", "/home/vsts/work/1/s/src/components/ToastList.js");
|
|
133
|
-
reactHotLoader.register(
|
|
134
|
-
reactHotLoader.register(ToastBox, "ToastBox", "/home/vsts/work/1/s/src/components/ToastList.js");
|
|
135
|
-
reactHotLoader.register(ToastIcon, "ToastIcon", "/home/vsts/work/1/s/src/components/ToastList.js");
|
|
136
|
-
reactHotLoader.register(CloseIcon, "CloseIcon", "/home/vsts/work/1/s/src/components/ToastList.js");
|
|
168
|
+
reactHotLoader.register(useStyles, "useStyles", "/home/vsts/work/1/s/src/components/ToastList.js");
|
|
137
169
|
reactHotLoader.register(Toast, "Toast", "/home/vsts/work/1/s/src/components/ToastList.js");
|
|
138
|
-
reactHotLoader.register(ListWrapper, "ListWrapper", "/home/vsts/work/1/s/src/components/ToastList.js");
|
|
139
170
|
reactHotLoader.register(ToastList, "ToastList", "/home/vsts/work/1/s/src/components/ToastList.js");
|
|
140
171
|
reactHotLoader.register(_default2, "default", "/home/vsts/work/1/s/src/components/ToastList.js");
|
|
141
172
|
})();
|
package/dist/getTheme.js
CHANGED
|
@@ -72,11 +72,6 @@ var baseTheme = {
|
|
|
72
72
|
Sale: "sales-scope",
|
|
73
73
|
Dependant: "dependent-scope"
|
|
74
74
|
},
|
|
75
|
-
// toast: {
|
|
76
|
-
// confirm: "checkmark-circle",
|
|
77
|
-
// warn: "warning",
|
|
78
|
-
// error: "cross-circle",
|
|
79
|
-
// },
|
|
80
75
|
prev: "arrow-small-left",
|
|
81
76
|
next: "arrow-small-right",
|
|
82
77
|
menu: "app-list",
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.getToastColor = void 0;
|
|
5
|
+
(function () {
|
|
6
|
+
var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
|
|
7
|
+
enterModule && enterModule(module);
|
|
8
|
+
})();
|
|
9
|
+
(function () {
|
|
10
|
+
var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
|
|
11
|
+
enterModule && enterModule(module);
|
|
12
|
+
})();
|
|
13
|
+
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
14
|
+
return a;
|
|
15
|
+
};
|
|
16
|
+
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var getToastColor = exports.getToastColor = function getToastColor(theme, alertType) {
|
|
20
|
+
var toastBorderColors = {
|
|
21
|
+
error: theme.palette.error.main,
|
|
22
|
+
warn: theme.palette.warning.main,
|
|
23
|
+
confirm: theme.palette.success.main
|
|
24
|
+
};
|
|
25
|
+
return toastBorderColors[alertType] || "red";
|
|
26
|
+
};
|
|
27
|
+
;
|
|
28
|
+
(function () {
|
|
29
|
+
var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
|
|
30
|
+
if (!reactHotLoader) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
reactHotLoader.register(getToastColor, "getToastColor", "/home/vsts/work/1/s/src/utils/toastHelper.js");
|
|
34
|
+
})();
|
|
35
|
+
;
|
|
36
|
+
(function () {
|
|
37
|
+
var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
|
|
38
|
+
leaveModule && leaveModule(module);
|
|
39
|
+
})();
|
|
40
|
+
;
|
|
41
|
+
(function () {
|
|
42
|
+
var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
|
|
43
|
+
if (!reactHotLoader) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
reactHotLoader.register(getToastColor, "getToastColor", "/home/vsts/work/1/s/src/utils/toastHelper.js");
|
|
47
|
+
})();
|
|
48
|
+
;
|
|
49
|
+
(function () {
|
|
50
|
+
var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
|
|
51
|
+
leaveModule && leaveModule(module);
|
|
52
|
+
})();
|
package/package.json
CHANGED
|
@@ -3,15 +3,7 @@ import { makeStyles } from "@material-ui/core/styles";
|
|
|
3
3
|
import { Link } from "react-router-dom";
|
|
4
4
|
import { FormattedMessage } from "react-intl";
|
|
5
5
|
import Icon from "../MaterialUI/DataDisplay/Icon";
|
|
6
|
-
|
|
7
|
-
const getToastColor = (theme, alertType) => {
|
|
8
|
-
const toastBorderColors = {
|
|
9
|
-
error: theme.palette.error.main,
|
|
10
|
-
warn: theme.palette.warning.main,
|
|
11
|
-
confirm: theme.palette.success.main,
|
|
12
|
-
};
|
|
13
|
-
return toastBorderColors[alertType] || "red";
|
|
14
|
-
};
|
|
6
|
+
import { getToastColor } from "../../utils/toastHelper";
|
|
15
7
|
|
|
16
8
|
const useStyles = makeStyles(theme => ({
|
|
17
9
|
block: props => ({
|
|
@@ -352,7 +352,11 @@ const DefaultFullTable = React.forwardRef((props, ref) => {
|
|
|
352
352
|
context={props.context}
|
|
353
353
|
/>
|
|
354
354
|
</TableMui>
|
|
355
|
-
{props.tableRows.length > 0 ? null :
|
|
355
|
+
{props.tableRows.length > 0 ? null : (
|
|
356
|
+
<div className={classNames(props.classes.placeholder, props.customClasses.placeholderContainer)}>
|
|
357
|
+
{props.placeholder}
|
|
358
|
+
</div>
|
|
359
|
+
)}
|
|
356
360
|
</div>
|
|
357
361
|
);
|
|
358
362
|
});
|
|
@@ -441,6 +445,7 @@ const Table = React.forwardRef(
|
|
|
441
445
|
customClasses["tableCell"] = tableProps?.getStyle(TableProps.ruleNames.tableCell) || null;
|
|
442
446
|
customClasses["headerCell"] = tableProps?.getStyle(TableProps.ruleNames.headerCell) || null;
|
|
443
447
|
customClasses["tableContainer"] = tableProps?.getStyle(TableProps.ruleNames.tableContainer) || null;
|
|
448
|
+
customClasses["placeholderContainer"] = tableProps?.getStyle(TableProps.ruleNames.placeholderContainer) || null;
|
|
444
449
|
customClasses["container"] = tableProps?.getStyle(TableProps.ruleNames.container) || null;
|
|
445
450
|
customClasses["table"] = tableProps?.getStyle(TableProps.ruleNames.table) || null;
|
|
446
451
|
|
|
@@ -1102,6 +1102,26 @@ describe("Table", () => {
|
|
|
1102
1102
|
expect(placeHolder.length, "to equal", 1);
|
|
1103
1103
|
});
|
|
1104
1104
|
|
|
1105
|
+
it("Renders Table with placeholder and custom class if rows are empty", () => {
|
|
1106
|
+
const { headers, rows } = buildHeaderAndRowFromConfig(config, []);
|
|
1107
|
+
|
|
1108
|
+
const placeholder = <Placeholder />;
|
|
1109
|
+
|
|
1110
|
+
const tableProps = new TableProps();
|
|
1111
|
+
tableProps.setStyle(TableProps.ruleNames.placeholderContainer, "placeholder-container-custom-class");
|
|
1112
|
+
|
|
1113
|
+
const component = <Table rows={rows} headers={headers} placeholder={placeholder} tableProps={tableProps} />;
|
|
1114
|
+
|
|
1115
|
+
const mountedComponent = mount(component);
|
|
1116
|
+
|
|
1117
|
+
const placeHolder = mountedComponent.find(Placeholder);
|
|
1118
|
+
expect(placeHolder.exists(), "to be true");
|
|
1119
|
+
|
|
1120
|
+
const placeholderContainer = placeHolder.parent();
|
|
1121
|
+
expect(placeholderContainer.exists(), "to be true");
|
|
1122
|
+
expect(placeholderContainer.hasClass("placeholder-container-custom-class"), "to be true");
|
|
1123
|
+
});
|
|
1124
|
+
|
|
1105
1125
|
it("Renders Table with tableInfo if provided", () => {
|
|
1106
1126
|
const { headers, rows } = buildHeaderAndRowFromConfig(config, []);
|
|
1107
1127
|
|
|
@@ -24,6 +24,7 @@ class TableProps extends ComponentProps {
|
|
|
24
24
|
tableContainer: "tableContainer",
|
|
25
25
|
container: "container",
|
|
26
26
|
table: "table",
|
|
27
|
+
placeholderContainer: "placeholderContainer",
|
|
27
28
|
};
|
|
28
29
|
|
|
29
30
|
constructor() {
|
|
@@ -47,6 +48,7 @@ class TableProps extends ComponentProps {
|
|
|
47
48
|
this.componentClasses.set(this.constructor.ruleNames.tableCell, null);
|
|
48
49
|
this.componentClasses.set(this.constructor.ruleNames.headerCell, null);
|
|
49
50
|
this.componentClasses.set(this.constructor.ruleNames.tableContainer, null);
|
|
51
|
+
this.componentClasses.set(this.constructor.ruleNames.placeholderContainer, null);
|
|
50
52
|
this.componentClasses.set(this.constructor.ruleNames.container, null);
|
|
51
53
|
this.componentClasses.set(this.constructor.ruleNames.table, null);
|
|
52
54
|
|
|
@@ -12,7 +12,16 @@ describe("TableProps Props", () => {
|
|
|
12
12
|
"constrained",
|
|
13
13
|
];
|
|
14
14
|
|
|
15
|
-
const ruleNames = [
|
|
15
|
+
const ruleNames = [
|
|
16
|
+
"tableHeader",
|
|
17
|
+
"tableRow",
|
|
18
|
+
"tableCell",
|
|
19
|
+
"headerCell",
|
|
20
|
+
"tableContainer",
|
|
21
|
+
"placeholderContainer",
|
|
22
|
+
"container",
|
|
23
|
+
"table",
|
|
24
|
+
];
|
|
16
25
|
|
|
17
26
|
expect(TableProps.propNames, "to have keys", propNames);
|
|
18
27
|
expect(TableProps.ruleNames, "to have keys", ruleNames);
|
|
@@ -34,7 +43,16 @@ describe("TableProps Props", () => {
|
|
|
34
43
|
"saveScrollbarPosition",
|
|
35
44
|
];
|
|
36
45
|
|
|
37
|
-
const ruleNames = [
|
|
46
|
+
const ruleNames = [
|
|
47
|
+
"tableHeader",
|
|
48
|
+
"tableRow",
|
|
49
|
+
"tableCell",
|
|
50
|
+
"headerCell",
|
|
51
|
+
"tableContainer",
|
|
52
|
+
"placeholderContainer",
|
|
53
|
+
"container",
|
|
54
|
+
"table",
|
|
55
|
+
];
|
|
38
56
|
|
|
39
57
|
const tableProps = new TableProps();
|
|
40
58
|
|
|
@@ -69,6 +69,7 @@ const SectionExpansionPanel = ({
|
|
|
69
69
|
expansionPanelId,
|
|
70
70
|
expansionPanelProps,
|
|
71
71
|
expansionPanelActionsProps,
|
|
72
|
+
headerClassName,
|
|
72
73
|
}) => {
|
|
73
74
|
if (isExpansionPanelProps(expansionPanelProps) === false) {
|
|
74
75
|
throw new TypeError("expansionPanelProps property is not of type ExpansionPanelProps");
|
|
@@ -122,7 +123,7 @@ const SectionExpansionPanel = ({
|
|
|
122
123
|
expandIcon={<Icon id="dropdown-chevron-down" />}
|
|
123
124
|
IconButtonProps={defaultSummaryStyles}
|
|
124
125
|
classes={{
|
|
125
|
-
root: classNames(classes.summaryRoot, constrained ? classes.constrainedSummaryRoot : ""),
|
|
126
|
+
root: classNames(classes.summaryRoot, headerClassName, constrained ? classes.constrainedSummaryRoot : ""),
|
|
126
127
|
expanded: classNames(classes.panelExpanded),
|
|
127
128
|
content: classNames(classes.summaryContent, constrained ? classes.constrainedSummaryContent : ""),
|
|
128
129
|
expandIcon: classNames(classes.summaryExpandIconRoot),
|