intelicoreact 0.3.8 → 0.3.9

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.
@@ -207,7 +207,7 @@ var Input = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
207
207
  var uniProps = _objectSpread(_objectSpread({
208
208
  className: "input ".concat(className),
209
209
  placeholder: placeholder,
210
- value: value || '',
210
+ value: value === undefined || value === null ? '' : value,
211
211
  inputMode: isNumericMobileKeyboard ? 'numeric' : 'text',
212
212
  disabled: disabled,
213
213
  onChange: handle.change,
@@ -28,7 +28,8 @@ var WidgetWithSwitchableRows = function WidgetWithSwitchableRows(props) {
28
28
  className = _ref.className,
29
29
  title = _ref.title,
30
30
  rightHeaderContent = _ref.rightHeaderContent,
31
- columns = _ref.columns,
31
+ _ref$columns = _ref.columns,
32
+ columns = _ref$columns === void 0 ? [] : _ref$columns,
32
33
  rows = _ref.rows,
33
34
  CellComponent = _ref.CellComponent,
34
35
  _onChange = _ref.onChange;
@@ -46,8 +47,8 @@ var WidgetWithSwitchableRows = function WidgetWithSwitchableRows(props) {
46
47
  }, title), /*#__PURE__*/_react.default.createElement("div", {
47
48
  className: (0, _classnames.default)("".concat(RC, "__right-header-content-block"))
48
49
  }, rightHeaderContent)), /*#__PURE__*/_react.default.createElement("div", {
49
- className: (0, _classnames.default)("".concat(RC, "__body"))
50
- }, /*#__PURE__*/_react.default.createElement("div", {
50
+ className: (0, _classnames.default)("".concat(RC, "__body"), (0, _defineProperty2.default)({}, "".concat(RC, "__body_no-content"), !(rows !== null && rows !== void 0 && rows.length)))
51
+ }, !!(rows !== null && rows !== void 0 && rows.length) && /*#__PURE__*/_react.default.createElement("div", {
51
52
  className: (0, _classnames.default)("".concat(RC, "__thead"))
52
53
  }, preperedColumns.map(function (field) {
53
54
  return /*#__PURE__*/_react.default.createElement("div", {
@@ -57,14 +58,12 @@ var WidgetWithSwitchableRows = function WidgetWithSwitchableRows(props) {
57
58
  }, field.label);
58
59
  })), /*#__PURE__*/_react.default.createElement("div", {
59
60
  className: (0, _classnames.default)("".concat(RC, "__table"))
60
- }, rows.map(function (row) {
61
+ }, rows !== null && rows !== void 0 && rows.length ? rows.map(function (row) {
61
62
  return /*#__PURE__*/_react.default.createElement("div", {
62
- key: row.id,
63
63
  className: (0, _classnames.default)("".concat(RC, "__row")),
64
64
  "data-id": row.id
65
65
  }, preperedColumns.map(function (cell) {
66
66
  return /*#__PURE__*/_react.default.createElement("div", {
67
- key: "".concat(row.id, "-").concat(cell.key),
68
67
  className: (0, _classnames.default)("".concat(RC, "__cell"), cell.cellClassName, cell.columnClassName)
69
68
  }, /*#__PURE__*/_react.default.createElement(CellComponent, {
70
69
  field: _objectSpread(_objectSpread({}, cell), {}, {
@@ -72,17 +71,23 @@ var WidgetWithSwitchableRows = function WidgetWithSwitchableRows(props) {
72
71
  rowData: row
73
72
  }, cell.key === 'isActive' ? {
74
73
  disabled: cell.disabled,
75
- label: row.label
74
+ label: row.label,
75
+ isActive: row.isActive
76
76
  } : {
77
77
  disabled: !row.isActive,
78
78
  label: cell.label
79
79
  }),
80
- onChange: function onChange(val) {
80
+ onChange: function onChange(key, val) {
81
81
  return _onChange(val, cell.key, row.id);
82
82
  }
83
83
  }));
84
84
  }));
85
- }))));
85
+ }) : /*#__PURE__*/_react.default.createElement("div", {
86
+ className: (0, _classnames.default)("".concat(RC, "__row")),
87
+ "data-id": "empty-row"
88
+ }, /*#__PURE__*/_react.default.createElement("span", {
89
+ className: (0, _classnames.default)("".concat(RC, "__no-data-content"))
90
+ }, Lng('No lenders'))))));
86
91
  };
87
92
 
88
93
  var _default = WidgetWithSwitchableRows;
@@ -33,6 +33,10 @@
33
33
 
34
34
  &__body {
35
35
  padding: 8px 16px;
36
+
37
+ &_no-content {
38
+ padding: 0 16px;
39
+ }
36
40
  }
37
41
 
38
42
  &__thead {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intelicoreact",
3
- "version": "0.3.8",
3
+ "version": "0.3.9",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [