linear-react-components-ui 0.4.76-beta.0 → 0.4.76-beta.1

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.
package/.DS_Store ADDED
Binary file
package/README.md CHANGED
@@ -53,18 +53,8 @@ Caso queira gerar uma build com versão beta e fazer a publicação no npm rode
53
53
 
54
54
  `npm run publish:npm --tag beta`
55
55
 
56
- Caso queira gerar uma build com versão candidata e fazer a publicação no npm rode os comandos da seguinte forma:
57
-
58
- `npm version <versão>`
59
-
60
- `npm run publish:npm --tag rc`
61
-
62
- no local onde esta denominado o campo versão, você deverá colocar a nova versão do pacote, alguns exemplos para o campo versão:
63
- - release: 0.4.75
64
- - beta: 0.4.75-beta.0
65
- - candidata: 0.4.75-rc.0
66
-
67
- ficando da seguinte maneira:
56
+ no local onde esta denominado o campo versão, você deverá colocar a nova versão do pacote, um exemplo: 0.4.75 ou para o caso de uma
57
+ versão beta siga o seguinte exemplo: 0.4.75-beta.1, ficando da seguinte maneira:
68
58
 
69
59
  `npm version 0.4.75`
70
60
 
@@ -76,7 +76,7 @@ var withTooltip = function withTooltip(WrappedComponent) {
76
76
  var targetElement = (0, _react.useRef)();
77
77
 
78
78
  var onMouseOver = function onMouseOver(e) {
79
- if (targetElement && targetElement.current && targetElement.current.contains(e.target)) {
79
+ if (targetElement.current.contains(e.target)) {
80
80
  setShowTooltip(true);
81
81
  } else setShowTooltip(false);
82
82
  };
@@ -116,7 +116,6 @@ var withTooltip = function withTooltip(WrappedComponent) {
116
116
  height = tooltipDimensions.height;
117
117
  var targetDimensions = targetElement.current.getBoundingClientRect();
118
118
  var targetVerticalCenter = (targetDimensions.top + targetDimensions.bottom) / 2;
119
- var formattedWidth = typeof width === 'string' ? Number(width.slice(0, -2)) : width;
120
119
  var style = "width: ".concat(width, "px");
121
120
  var left = targetDimensions.left + targetDimensions.width / 2 - width / 2;
122
121
  left = Math.min(left, document.body.clientWidth - width - space);
@@ -142,17 +141,17 @@ var withTooltip = function withTooltip(WrappedComponent) {
142
141
  break;
143
142
 
144
143
  case 'left':
145
- if (targetDimensions.left < formattedWidth) {
144
+ if (targetDimensions.left < width) {
146
145
  setTooltipPosition('right');
147
146
  } else {
148
147
  style += "; top: ".concat(targetVerticalCenter + window.scrollY - height / 2, "px");
149
- style += "; left: ".concat(targetDimensions.left - formattedWidth - 6, "px");
148
+ style += "; left: ".concat(targetDimensions.left - width - 6, "px");
150
149
  }
151
150
 
152
151
  break;
153
152
 
154
153
  case 'right':
155
- if (window.innerWidth - targetDimensions.right < formattedWidth) {
154
+ if (window.innerWidth - targetDimensions.right < width) {
156
155
  setTooltipPosition('left');
157
156
  } else {
158
157
  style += "; top: ".concat(targetVerticalCenter + window.scrollY - height / 2, "px");
@@ -42,8 +42,8 @@ var Tooltip = function Tooltip(props) {
42
42
  var tooltipEl = document.querySelector("div#".concat(tooltipComponent.current.id));
43
43
  var width = tooltipEl.offsetWidth;
44
44
 
45
- if (tooltipDimensions.width && tooltipDimensions.width !== 'auto') {
46
- width = typeof tooltipDimensions.width === 'string' ? Number(tooltipDimensions.width.slice(0, -2)) : tooltipDimensions.width;
45
+ if (tooltipDimensions.width) {
46
+ width = tooltipDimensions.width;
47
47
  }
48
48
 
49
49
  var height = tooltipEl.offsetHeight;
@@ -78,6 +78,15 @@ var TreeView = /*#__PURE__*/function (_Component) {
78
78
 
79
79
  var _super = _createSuper(TreeView);
80
80
 
81
+ // static getDerivedStateFromProps(props, state) {
82
+ // const { data, selectedIds } = props;
83
+ // const { propSelectedIds } = state;
84
+ // const isSameSelectedIds = _.isEqual(propSelectedIds.sort(), selectedIds.sort());
85
+ // if (data !== state.data || !isSameSelectedIds) {
86
+ // return { data, selectedIds, propSelectedIds: selectedIds };
87
+ // }
88
+ // return null;
89
+ // }
81
90
  function TreeView(props) {
82
91
  var _this;
83
92
 
@@ -542,25 +551,6 @@ var TreeView = /*#__PURE__*/function (_Component) {
542
551
  className: "treeviewcontainer ".concat(bordered && '-bordered')
543
552
  }, this.buildTree(data))));
544
553
  }
545
- }], [{
546
- key: "getDerivedStateFromProps",
547
- value: function getDerivedStateFromProps(props, state) {
548
- var data = props.data,
549
- selectedIds = props.selectedIds;
550
- var propSelectedIds = state.propSelectedIds;
551
-
552
- var isSameSelectedIds = _lodash["default"].isEqual(propSelectedIds.sort(), selectedIds.sort());
553
-
554
- if (data !== state.data || !isSameSelectedIds) {
555
- return {
556
- data: data,
557
- selectedIds: selectedIds,
558
- propSelectedIds: selectedIds
559
- };
560
- }
561
-
562
- return null;
563
- }
564
554
  }]);
565
555
 
566
556
  return TreeView;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linear-react-components-ui",
3
- "version": "0.4.76-beta.0",
3
+ "version": "0.4.76-beta.1",
4
4
  "description": "Linear Sistemas ReactJs Components",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {