oa-componentbook 1.0.1-stage.360 → 1.0.1-stage.361
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.
|
@@ -4,11 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
require("core-js/modules/es.object.assign.js");
|
|
7
8
|
var _react = _interopRequireDefault(require("react"));
|
|
8
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
10
|
var _Typography = _interopRequireDefault(require("../oa-component-typography/Typography"));
|
|
10
11
|
var _styles = require("./styles");
|
|
11
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
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); } /* eslint-disable */
|
|
12
14
|
/**
|
|
13
15
|
* A simple tag component that displays a label.
|
|
14
16
|
*
|
|
@@ -21,40 +23,44 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
21
23
|
*/
|
|
22
24
|
function CustomTag(_ref) {
|
|
23
25
|
let {
|
|
24
|
-
|
|
26
|
+
"data-test": dataTest,
|
|
25
27
|
label,
|
|
26
28
|
type,
|
|
27
29
|
visible,
|
|
28
30
|
bgColor,
|
|
29
31
|
borderColor,
|
|
30
|
-
textColor
|
|
32
|
+
textColor,
|
|
33
|
+
style
|
|
31
34
|
} = _ref;
|
|
32
|
-
return /*#__PURE__*/_react.default.createElement(_styles.StyledTag, {
|
|
35
|
+
return /*#__PURE__*/_react.default.createElement(_styles.StyledTag, _extends({
|
|
33
36
|
"data-test": dataTest,
|
|
34
37
|
type: type,
|
|
35
38
|
visible: visible,
|
|
36
39
|
bgColor: bgColor,
|
|
37
40
|
borderColor: borderColor,
|
|
38
41
|
textColor: textColor
|
|
39
|
-
},
|
|
42
|
+
}, style && {
|
|
43
|
+
style
|
|
44
|
+
}), /*#__PURE__*/_react.default.createElement(_styles.CenteredTextContainer, null, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
40
45
|
typography: "type-button-500"
|
|
41
46
|
}, label)));
|
|
42
47
|
}
|
|
43
48
|
CustomTag.propTypes = {
|
|
44
|
-
|
|
49
|
+
"data-test": _propTypes.default.string,
|
|
45
50
|
label: _propTypes.default.string.isRequired,
|
|
46
|
-
type: _propTypes.default.oneOf([
|
|
51
|
+
type: _propTypes.default.oneOf(["success", "pending", "failed", "recommended", "primary", "blue"]),
|
|
47
52
|
visible: _propTypes.default.bool,
|
|
48
53
|
bgColor: _propTypes.default.string,
|
|
49
54
|
borderColor: _propTypes.default.string,
|
|
50
|
-
textColor: _propTypes.default.string
|
|
55
|
+
textColor: _propTypes.default.string,
|
|
56
|
+
style: _propTypes.default.object
|
|
51
57
|
};
|
|
52
58
|
CustomTag.defaultProps = {
|
|
53
|
-
|
|
54
|
-
type:
|
|
59
|
+
"data-test": null,
|
|
60
|
+
type: "",
|
|
55
61
|
visible: true,
|
|
56
|
-
bgColor:
|
|
57
|
-
borderColor:
|
|
58
|
-
textColor:
|
|
62
|
+
bgColor: "",
|
|
63
|
+
borderColor: "",
|
|
64
|
+
textColor: ""
|
|
59
65
|
};
|
|
60
66
|
var _default = exports.default = CustomTag;
|
|
@@ -77,6 +77,9 @@ function KeyValueDataView(_ref) {
|
|
|
77
77
|
className: "type-b2-400",
|
|
78
78
|
title: value
|
|
79
79
|
}, value) || _react.default.isValidElement && /*#__PURE__*/_react.default.createElement("span", null, value), (tagStatus === null || tagStatus === void 0 ? void 0 : tagStatus.tagKey) === key && (tagStatus === null || tagStatus === void 0 ? void 0 : tagStatus.tagData) && /*#__PURE__*/_react.default.createElement(_CustomTag.default, {
|
|
80
|
+
style: {
|
|
81
|
+
width: "100px"
|
|
82
|
+
},
|
|
80
83
|
type: tagStatus.tagData.type || "success",
|
|
81
84
|
label: tagStatus.tagData.label,
|
|
82
85
|
size: tagStatus.tagData.size || "small"
|