orc-shared 5.8.0-dev.6 → 5.8.0-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.
|
@@ -20,6 +20,9 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
20
20
|
var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
|
|
21
21
|
enterModule && enterModule(module);
|
|
22
22
|
})();
|
|
23
|
+
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; }
|
|
24
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
25
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
23
26
|
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
24
27
|
return a;
|
|
25
28
|
};
|
|
@@ -30,12 +33,13 @@ var useStyles = (0, _styles.makeStyles)(function (theme) {
|
|
|
30
33
|
return {
|
|
31
34
|
title: {
|
|
32
35
|
fontSize: theme.typography.fieldLabelSize,
|
|
33
|
-
color:
|
|
34
|
-
return !props.error ? theme.palette.text.hint : theme.palette.error.main;
|
|
35
|
-
},
|
|
36
|
+
color: theme.palette.text.hint,
|
|
36
37
|
fontFamily: theme.typography.fontFamily,
|
|
37
38
|
marginBottom: theme.spacing(1)
|
|
38
39
|
},
|
|
40
|
+
titleError: {
|
|
41
|
+
color: theme.palette.error.main
|
|
42
|
+
},
|
|
39
43
|
titleRequired: {
|
|
40
44
|
paddingLeft: theme.spacing(0.5),
|
|
41
45
|
color: theme.palette.error.main
|
|
@@ -110,10 +114,12 @@ var InformationItemHeader = function InformationItemHeader(_ref2) {
|
|
|
110
114
|
label = _ref2.label,
|
|
111
115
|
headerIcon = _ref2.headerIcon,
|
|
112
116
|
headerIconClassName = _ref2.headerIconClassName,
|
|
113
|
-
required = _ref2.required
|
|
117
|
+
required = _ref2.required,
|
|
118
|
+
error = _ref2.error;
|
|
114
119
|
var formattedLabel = typeof label === "object" ? /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, label) : label;
|
|
120
|
+
var titleClasses = (0, _classnames.default)(classes.title, _defineProperty({}, classes.titleError, error));
|
|
115
121
|
var headerText = (_ref3 = formattedLabel && /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
116
|
-
className:
|
|
122
|
+
className: titleClasses,
|
|
117
123
|
children: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, formattedLabel, required && /*#__PURE__*/_react.default.createElement("span", {
|
|
118
124
|
"data-qa": "required",
|
|
119
125
|
className: classes.titleRequired
|
|
@@ -157,6 +163,7 @@ var InformationItem = function InformationItem(_ref4) {
|
|
|
157
163
|
classes: classes,
|
|
158
164
|
label: label,
|
|
159
165
|
required: required,
|
|
166
|
+
error: error,
|
|
160
167
|
headerIcon: headerIcon,
|
|
161
168
|
headerIconClassName: headerIconClassName
|
|
162
169
|
}), /*#__PURE__*/_react.default.createElement(InformationItemChildren, {
|
package/package.json
CHANGED
|
@@ -12,10 +12,13 @@ import classNames from "classnames";
|
|
|
12
12
|
const useStyles = makeStyles(theme => ({
|
|
13
13
|
title: {
|
|
14
14
|
fontSize: theme.typography.fieldLabelSize,
|
|
15
|
-
color:
|
|
15
|
+
color: theme.palette.text.hint,
|
|
16
16
|
fontFamily: theme.typography.fontFamily,
|
|
17
17
|
marginBottom: theme.spacing(1),
|
|
18
18
|
},
|
|
19
|
+
titleError: {
|
|
20
|
+
color: theme.palette.error.main,
|
|
21
|
+
},
|
|
19
22
|
titleRequired: {
|
|
20
23
|
paddingLeft: theme.spacing(0.5),
|
|
21
24
|
color: theme.palette.error.main,
|
|
@@ -76,12 +79,13 @@ const InformationItemChildren = ({
|
|
|
76
79
|
return <MultipleLinesText textProps={multipleLinesTextProps} children={value} tooltipClasses={tooltipClasses} />;
|
|
77
80
|
};
|
|
78
81
|
|
|
79
|
-
const InformationItemHeader = ({ classes, label, headerIcon, headerIconClassName, required }) => {
|
|
82
|
+
const InformationItemHeader = ({ classes, label, headerIcon, headerIconClassName, required, error }) => {
|
|
80
83
|
const formattedLabel = typeof label === "object" ? <FormattedMessage {...label} /> : label;
|
|
84
|
+
const titleClasses = classNames(classes.title, { [classes.titleError]: error });
|
|
81
85
|
const headerText =
|
|
82
86
|
(formattedLabel && (
|
|
83
87
|
<Typography
|
|
84
|
-
className={
|
|
88
|
+
className={titleClasses}
|
|
85
89
|
children={
|
|
86
90
|
<>
|
|
87
91
|
{formattedLabel}
|
|
@@ -129,6 +133,7 @@ const InformationItem = ({
|
|
|
129
133
|
classes={classes}
|
|
130
134
|
label={label}
|
|
131
135
|
required={required}
|
|
136
|
+
error={error}
|
|
132
137
|
headerIcon={headerIcon}
|
|
133
138
|
headerIconClassName={headerIconClassName}
|
|
134
139
|
/>
|