linear-react-components-ui 0.4.76-beta.30 → 0.4.76-beta.31

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.
@@ -46,6 +46,9 @@
46
46
  vertical-align: middle;
47
47
  border-bottom: 1px solid $component-border-color-soft;
48
48
  line-height: 18px;
49
+ > .rowskeleton {
50
+ margin: 10px 0;
51
+ }
49
52
  > .hidden,
50
53
  > .rowhover {
51
54
  display: none;
package/lib/table/Body.js CHANGED
@@ -23,8 +23,17 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
23
23
 
24
24
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
25
25
 
26
- var renderChildren = function renderChildren(children, columnsCount, skeletonize, skeletonInRows) {
27
- if (skeletonize && columnsCount) {
26
+ function _extends() { _extends = Object.assign || 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); }
27
+
28
+ var renderChildren = function renderChildren(_ref) {
29
+ var children = _ref.children,
30
+ columnsCount = _ref.columnsCount,
31
+ vertical = _ref.vertical,
32
+ skeletonize = _ref.skeletonize,
33
+ skeletonInRows = _ref.skeletonInRows,
34
+ skeletonHeight = _ref.skeletonHeight;
35
+
36
+ if (skeletonize && !vertical && columnsCount) {
28
37
  var rows = (0, _helpers.getArrayFromNumber)(skeletonInRows);
29
38
  var columns = (0, _helpers.getArrayFromNumber)(columnsCount);
30
39
  var skeletonChildrens = rows.map(function (index) {
@@ -34,11 +43,8 @@ var renderChildren = function renderChildren(children, columnsCount, skeletonize
34
43
  return /*#__PURE__*/_react["default"].createElement(_index.Td, {
35
44
  key: id
36
45
  }, /*#__PURE__*/_react["default"].createElement(_skeleton["default"], {
37
- height: 16,
38
- style: {
39
- marginBottom: 0,
40
- opacity: 1
41
- }
46
+ height: skeletonHeight,
47
+ customClass: "rowskeleton"
42
48
  }));
43
49
  }));
44
50
  });
@@ -48,18 +54,16 @@ var renderChildren = function renderChildren(children, columnsCount, skeletonize
48
54
  return children;
49
55
  };
50
56
 
51
- var TableBody = function TableBody(_ref) {
52
- var children = _ref.children,
53
- customClass = _ref.customClass;
54
-
55
- var _useContext = (0, _react.useContext)(_helpers["default"]),
56
- bodyScrollable = _useContext.bodyScrollable,
57
- bodyContainerRef = _useContext.bodyContainerRef,
58
- columnsCount = _useContext.columnsCount,
59
- skeletonize = _useContext.skeletonize,
60
- skeletonInRows = _useContext.skeletonInRows,
61
- strict = _useContext.strict;
62
-
57
+ var TableBody = function TableBody(_ref2) {
58
+ var children = _ref2.children,
59
+ customClass = _ref2.customClass;
60
+ var context = (0, _react.useContext)(_helpers["default"]);
61
+ var bodyScrollable = context.bodyScrollable,
62
+ bodyContainerRef = context.bodyContainerRef,
63
+ skeletonize = context.skeletonize,
64
+ skeletonInRows = context.skeletonInRows,
65
+ strict = context.strict,
66
+ vertical = context.vertical;
63
67
  return bodyScrollable ? /*#__PURE__*/_react["default"].createElement("div", {
64
68
  className: "bodycontainer",
65
69
  ref: bodyContainerRef
@@ -70,10 +74,14 @@ var TableBody = function TableBody(_ref) {
70
74
  contain: strict ? 'strict' : 'size layout style'
71
75
  }
72
76
  }, /*#__PURE__*/_react["default"].createElement("tbody", {
73
- className: "tbody ".concat(skeletonize && skeletonInRows ? 'skeleton-transparency' : '', " ").concat(customClass)
74
- }, renderChildren(children, columnsCount, skeletonize, skeletonInRows)))) : /*#__PURE__*/_react["default"].createElement("tbody", {
75
- className: "tbody ".concat(skeletonize && skeletonInRows ? 'skeleton-transparency' : '', " ").concat(customClass)
76
- }, renderChildren(children, columnsCount, skeletonize, skeletonInRows));
77
+ className: "tbody ".concat(skeletonize && !vertical && skeletonInRows ? 'skeleton-transparency' : '', " ").concat(customClass)
78
+ }, renderChildren(_extends({}, context, {
79
+ children: children
80
+ }))))) : /*#__PURE__*/_react["default"].createElement("tbody", {
81
+ className: "tbody ".concat(skeletonize && !vertical && skeletonInRows ? 'skeleton-transparency' : '', " ").concat(customClass)
82
+ }, renderChildren(_extends({}, context, {
83
+ children: children
84
+ })));
77
85
  };
78
86
 
79
87
  TableBody.propTypes = {
@@ -184,7 +184,8 @@ Table.propTypes = {
184
184
  skeletonize: _propTypes["default"].bool,
185
185
  strict: _propTypes["default"].bool,
186
186
  skeletonInRows: _propTypes["default"].number,
187
- skeletonInHeader: _propTypes["default"].bool
187
+ skeletonInHeader: _propTypes["default"].bool,
188
+ skeletonHeight: _propTypes["default"].number
188
189
  };
189
190
  Table.defaultProps = {
190
191
  striped: false,
@@ -200,8 +201,9 @@ Table.defaultProps = {
200
201
  bodyScrollable: false,
201
202
  skeletonize: false,
202
203
  strict: false,
203
- skeletonInRows: undefined,
204
- skeletonInHeader: true
204
+ skeletonInRows: 10,
205
+ skeletonInHeader: false,
206
+ skeletonHeight: 16
205
207
  };
206
208
  var _default = Table;
207
209
  exports["default"] = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linear-react-components-ui",
3
- "version": "0.4.76-beta.30",
3
+ "version": "0.4.76-beta.31",
4
4
  "description": "Linear Sistemas ReactJs Components",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {