intelicoreact 1.4.46 → 1.4.47

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.
@@ -44,7 +44,7 @@ const TagList = _ref => {
44
44
  const getStaticTagsCount = () => {
45
45
  var _window$getComputedSt;
46
46
  if (typeof shownItemsCount === "number") return shownItemsCount;
47
- const computedWidth = wrapperWidth || parseInt((_window$getComputedSt = window.getComputedStyle(wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current)) === null || _window$getComputedSt === void 0 ? void 0 : _window$getComputedSt.width);
47
+ const computedWidth = wrapperWidth || parseInt(wrapperRef !== null && wrapperRef !== void 0 && wrapperRef.current ? (_window$getComputedSt = window.getComputedStyle(wrapperRef.current)) === null || _window$getComputedSt === void 0 ? void 0 : _window$getComputedSt.width : 0);
48
48
  const delta = typeof onEditClick === "function" ? 60 : 32;
49
49
  if (isNaN(computedWidth)) return -1;
50
50
  const result = tagList.map(_ref2 => {
@@ -53,7 +53,7 @@ const TagList = _ref => {
53
53
  } = _ref2;
54
54
  return itemRef;
55
55
  }).reduce((result, itemRef) => {
56
- const itemStyle = window.getComputedStyle(itemRef === null || itemRef === void 0 ? void 0 : itemRef.current);
56
+ const itemStyle = (itemRef === null || itemRef === void 0 ? void 0 : itemRef.current) && window.getComputedStyle(itemRef.current);
57
57
  const itemWidth = [parseInt(itemStyle === null || itemStyle === void 0 ? void 0 : itemStyle.width, 10), parseInt(itemStyle === null || itemStyle === void 0 ? void 0 : itemStyle.marginLeft, 10), parseInt(itemStyle === null || itemStyle === void 0 ? void 0 : itemStyle.marginRight, 10)].reduce((result, item) => {
58
58
  if (!isNaN(item)) result += item;
59
59
  return result;
@@ -149,7 +149,7 @@ const TagList = _ref => {
149
149
  let computedWidth = wrapperWidth;
150
150
  if (computedWidth === 0) {
151
151
  var _window$getComputedSt2;
152
- computedWidth = parseInt((_window$getComputedSt2 = window.getComputedStyle(wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current)) === null || _window$getComputedSt2 === void 0 ? void 0 : _window$getComputedSt2.width);
152
+ computedWidth = parseInt(wrapperRef !== null && wrapperRef !== void 0 && wrapperRef.current ? (_window$getComputedSt2 = window.getComputedStyle(wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current)) === null || _window$getComputedSt2 === void 0 ? void 0 : _window$getComputedSt2.width : 0);
153
153
  }
154
154
  if (!isNaN(computedWidth)) {
155
155
  setStaticTagsCount(getStaticTagsCount());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intelicoreact",
3
- "version": "1.4.46",
3
+ "version": "1.4.47",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [