linear-react-components-ui 0.4.76-beta.34 → 0.4.76-beta.35

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.
@@ -331,8 +331,10 @@ $shadow-button-inset-default: inset 0 0 0 1px $default-border-color, $shadow-but
331
331
  text-shadow: none;
332
332
  box-shadow: none;
333
333
  border-color: transparent !important;
334
+ transition: none;
334
335
 
335
336
  > svg {
336
- display: none;
337
+ opacity: 0;
338
+ visibility: hidden;
337
339
  }
338
340
  }
@@ -15,6 +15,11 @@
15
15
  margin-left: -20px;
16
16
  cursor: pointer;
17
17
  }
18
+ .loading {
19
+ margin-left: -30px;
20
+ position: absolute;
21
+ margin-top: -5px;
22
+ }
18
23
  }
19
24
  }
20
25
 
package/lib/list/index.js CHANGED
@@ -129,6 +129,37 @@ var List = function List(props) {
129
129
  return null;
130
130
  };
131
131
 
132
+ var getSkeleton = function getSkeleton() {
133
+ var length = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
134
+ var maxSkeletonsItensExceeded = 2;
135
+ var skeletonItensCount = length > skeletonItens ? maxSkeletonsItensExceeded : Math.floor(skeletonItens / length);
136
+ var skeletonItensList = Array.from(Array(skeletonItensCount).keys());
137
+ return /*#__PURE__*/_react["default"].createElement("div", {
138
+ className: "skeleton-transparency"
139
+ }, skeletonItensList.map(function (id) {
140
+ return /*#__PURE__*/_react["default"].createElement(_Item["default"], {
141
+ key: id,
142
+ hovered: false,
143
+ style: {
144
+ pointerEvents: 'none'
145
+ }
146
+ }, /*#__PURE__*/_react["default"].createElement(_skeleton["default"], {
147
+ height: skeletonHeight,
148
+ style: {
149
+ margin: '6px 0'
150
+ }
151
+ }));
152
+ }));
153
+ };
154
+
155
+ var getNewChildren = function getNewChildren(headersChildren) {
156
+ return headersChildren.length > 0 ? headersChildren.map(function (item) {
157
+ return /*#__PURE__*/_react["default"].createElement(_react.Fragment, {
158
+ key: item.props.title
159
+ }, item, getSkeleton(headersChildren.length));
160
+ }) : /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, headersChildren, getSkeleton());
161
+ };
162
+
132
163
  (0, _react.useEffect)(function () {
133
164
  if (selectedItemRef.current && listRef.current && listRef.current.scroll) {
134
165
  var selectedItemRect = selectedItemRef.current.getBoundingClientRect();
@@ -156,7 +187,7 @@ var List = function List(props) {
156
187
  }
157
188
  }, [selectedItemRef.current]);
158
189
  (0, _react.useEffect)(function () {
159
- document.addEventListener('keydown', onKeyDown);
190
+ if (!skeletonize) document.addEventListener('keydown', onKeyDown);
160
191
  return function () {
161
192
  document.removeEventListener('keydown', onKeyDown);
162
193
  };
@@ -169,39 +200,7 @@ var List = function List(props) {
169
200
  return item.props && item.props.itemId;
170
201
  }).filter(Boolean) : [children.props.itemId];
171
202
  setItensId(newItensIds);
172
- }, [children.length]);
173
-
174
- var getSkeleton = function getSkeleton() {
175
- var length = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
176
- var maxSkeletonsItensExceeded = 2;
177
- var skeletonItensCount = length > skeletonItens ? maxSkeletonsItensExceeded : Math.floor(skeletonItens / length);
178
- var skeletonItensList = Array.from(Array(skeletonItensCount).keys());
179
- return /*#__PURE__*/_react["default"].createElement("div", {
180
- className: "skeleton-transparency"
181
- }, skeletonItensList.map(function (id) {
182
- return /*#__PURE__*/_react["default"].createElement(_Item["default"], {
183
- key: id,
184
- hovered: false,
185
- style: {
186
- pointerEvents: 'none'
187
- }
188
- }, /*#__PURE__*/_react["default"].createElement(_skeleton["default"], {
189
- height: skeletonHeight,
190
- style: {
191
- margin: '6px 0'
192
- }
193
- }));
194
- }));
195
- };
196
-
197
- var getNewChildren = function getNewChildren(headersChildren) {
198
- return headersChildren.length > 0 ? headersChildren.map(function (item) {
199
- return /*#__PURE__*/_react["default"].createElement(_react.Fragment, {
200
- key: item.props.title
201
- }, item, getSkeleton(headersChildren.length));
202
- }) : /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, headersChildren, getSkeleton());
203
- };
204
-
203
+ }, [children]);
205
204
  (0, _react.useEffect)(function () {
206
205
  if (skeletonize) {
207
206
  var headersChildren = children.type && children.type === _helpers.LIST_ITEMS_TYPES.listHeader && children;
@@ -216,7 +215,7 @@ var List = function List(props) {
216
215
  } else {
217
216
  setNewChildren(children);
218
217
  }
219
- }, [skeletonize, children.length]);
218
+ }, [skeletonize, children]);
220
219
  return /*#__PURE__*/_react["default"].createElement(_helpers.ListContext.Provider, {
221
220
  value: contextValues
222
221
  }, /*#__PURE__*/_react["default"].createElement("ul", {
package/lib/table/Body.js CHANGED
@@ -63,7 +63,9 @@ var TableBody = function TableBody(_ref2) {
63
63
  skeletonize = context.skeletonize,
64
64
  skeletonInRows = context.skeletonInRows,
65
65
  strict = context.strict,
66
- vertical = context.vertical;
66
+ vertical = context.vertical,
67
+ columnsCount = context.columnsCount;
68
+ var isSkeletonized = skeletonize && !vertical && skeletonInRows && columnsCount;
67
69
  return bodyScrollable ? /*#__PURE__*/_react["default"].createElement("div", {
68
70
  className: "bodycontainer",
69
71
  ref: bodyContainerRef
@@ -74,11 +76,11 @@ var TableBody = function TableBody(_ref2) {
74
76
  contain: strict ? 'strict' : 'size layout style'
75
77
  }
76
78
  }, /*#__PURE__*/_react["default"].createElement("tbody", {
77
- className: "tbody ".concat(skeletonize && !vertical && skeletonInRows ? 'skeleton-transparency' : '', " ").concat(customClass)
79
+ className: "tbody ".concat(isSkeletonized ? 'skeleton-transparency' : '', " ").concat(customClass)
78
80
  }, renderChildren(_extends({}, context, {
79
81
  children: children
80
82
  }))))) : /*#__PURE__*/_react["default"].createElement("tbody", {
81
- className: "tbody ".concat(skeletonize && !vertical && skeletonInRows ? 'skeleton-transparency' : '', " ").concat(customClass)
83
+ className: "tbody ".concat(isSkeletonized ? 'skeleton-transparency' : '', " ").concat(customClass)
82
84
  }, renderChildren(_extends({}, context, {
83
85
  children: children
84
86
  })));
@@ -42,12 +42,14 @@ var getColumnsWidth = function getColumnsWidth(children) {
42
42
  };
43
43
 
44
44
  var getColumnsCount = function getColumnsCount(children) {
45
- if (children && children.props) {
46
- var columnsChildren = children.props.children;
47
- return columnsChildren.length;
45
+ var columnsCount = 0;
46
+
47
+ if (_lodash["default"].isArray(children) && children.length > 0 && children[0].props) {
48
+ columnsCount = children[0].props.children.length;
48
49
  }
49
50
 
50
- return undefined;
51
+ if (children && children.props) columnsCount = children.props.children.length;
52
+ return columnsCount;
51
53
  };
52
54
 
53
55
  var Header = function Header(_ref) {
@@ -260,11 +260,7 @@ var _initialiseProps = function _initialiseProps() {
260
260
  onKeyPress: null,
261
261
  tabIndex: 0,
262
262
  role: "button",
263
- style: isLoading ? {
264
- marginLeft: '-30px',
265
- marginTop: '-5px'
266
- } : null,
267
- className: "opencloseicon",
263
+ className: isLoading ? 'loading' : 'opencloseicon',
268
264
  onClick: function onClick() {
269
265
  return _this3.openCloseTree(node);
270
266
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linear-react-components-ui",
3
- "version": "0.4.76-beta.34",
3
+ "version": "0.4.76-beta.35",
4
4
  "description": "Linear Sistemas ReactJs Components",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {