oa-componentbook 0.18.15 → 0.18.16

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.
@@ -13,7 +13,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
13
13
  function KeyValueDataView(_ref) {
14
14
  let {
15
15
  data,
16
- columnLayout
16
+ columnLayout,
17
+ info
17
18
  } = _ref;
18
19
  let actualColumnLayout = [];
19
20
  if (columnLayout.length === 0) {
@@ -31,17 +32,22 @@ function KeyValueDataView(_ref) {
31
32
  return /*#__PURE__*/_react.default.createElement("div", {
32
33
  className: className,
33
34
  key: (0, _utils.getUUID)()
34
- }, Object.entries(data)
35
-
36
- /*
37
- When no more elements are left, entryIdx is more than last index of `data`,
38
- resulting in no elements selected.
39
- */.splice(entryIdx, element).map(_ref2 => {
35
+ }, Object.entries(data).splice(entryIdx, element).map(_ref2 => {
40
36
  let [key, value] = _ref2;
41
37
  return /*#__PURE__*/_react.default.createElement("div", {
42
38
  className: "valuestyle",
43
39
  key: (0, _utils.getUUID)()
44
- }, /*#__PURE__*/_react.default.createElement("b", {
40
+ }, (info === null || info === void 0 ? void 0 : info.infoKey) === key && /*#__PURE__*/_react.default.createElement("b", {
41
+ className: "type-b2-400",
42
+ style: {
43
+ display: 'flex',
44
+ alignItems: 'center'
45
+ }
46
+ }, /*#__PURE__*/_react.default.createElement("span", null, key), /*#__PURE__*/_react.default.createElement("span", {
47
+ style: {
48
+ marginLeft: '4px'
49
+ }
50
+ }, info === null || info === void 0 ? void 0 : info.infoData), ":"), " ", !(info !== null && info !== void 0 && info.infoKey) === key && /*#__PURE__*/_react.default.createElement("b", {
45
51
  className: "type-b2-400"
46
52
  }, key, ":"), ((0, _utils.isString)(value) || (0, _utils.isNumber)(value)) && /*#__PURE__*/_react.default.createElement("span", {
47
53
  className: "type-b2-400",
@@ -52,9 +58,17 @@ function KeyValueDataView(_ref) {
52
58
  }
53
59
  KeyValueDataView.propTypes = {
54
60
  columnLayout: _propTypes.default.arrayOf(_propTypes.default.number),
55
- data: _propTypes.default.objectOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number, _propTypes.default.node])).isRequired
61
+ data: _propTypes.default.objectOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number, _propTypes.default.node])).isRequired,
62
+ info: _propTypes.default.shape({
63
+ infoData: _propTypes.default.node,
64
+ infoKey: _propTypes.default.string
65
+ })
56
66
  };
57
67
  KeyValueDataView.defaultProps = {
58
- columnLayout: []
68
+ columnLayout: [],
69
+ info: {
70
+ infoData: null,
71
+ infoKey: ''
72
+ }
59
73
  };
60
74
  var _default = exports.default = KeyValueDataView;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oa-componentbook",
3
- "version": "0.18.15",
3
+ "version": "0.18.16",
4
4
  "private": false,
5
5
  "description": "Reusable components",
6
6
  "main": "build/index.js",