@bydata/react-supertabs 1.1.8 → 1.1.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.
@@ -13,7 +13,7 @@ var NotAvailable = function NotAvailable(_ref) {
13
13
  var title = _ref.title,
14
14
  description = _ref.description,
15
15
  _ref$subTabName = _ref.subTabName,
16
- subTabName = _ref$subTabName === void 0 ? 'Page' : _ref$subTabName;
16
+ subTabName = _ref$subTabName === void 0 ? "Page" : _ref$subTabName;
17
17
  var _useTabContext = (0, _TabContext.useTabContext)(),
18
18
  activeSubTab = _useTabContext.activeSubTab;
19
19
  var heading = title !== null && title !== void 0 ? title : (0, _Utils.getTitle)(activeSubTab);
@@ -24,7 +24,7 @@ var NotAvailable = function NotAvailable(_ref) {
24
24
  className: "not-available-content"
25
25
  }, /*#__PURE__*/_react["default"].createElement("h3", {
26
26
  className: "title"
27
- }, heading.replace('Loading...', 'Untitled')), /*#__PURE__*/_react["default"].createElement("p", {
27
+ }, heading.replace("Loading...", "Untitled")), /*#__PURE__*/_react["default"].createElement("p", {
28
28
  className: "description"
29
29
  }, subHeading)));
30
30
  };
package/dist/SuperTabs.js CHANGED
@@ -50,7 +50,11 @@ var tooltipStyles = {
50
50
  zIndex: 100000,
51
51
  boxShadow: "0px 1px 10px 0px rgba(0, 0, 0, 0.10)",
52
52
  marginBottom: "5px",
53
- minWidth: "fit-content"
53
+ minWidth: "fit-content",
54
+ marginTop: "2px",
55
+ borderRadius: "2px",
56
+ backgroundColor: 'var(--tab-background-overlay, #272B32)',
57
+ color: 'var(--tab-text-normal, #BDC3CC)'
54
58
  };
55
59
  var filterSubTabs = function filterSubTabs(subTabs) {
56
60
  // const subTabsInList = [];
@@ -106,6 +110,7 @@ var SuperTabs = function SuperTabs(_ref) {
106
110
  updateExpandedID = _useTabContext.updateExpandedID,
107
111
  expandedTabIDRef = _useTabContext.expandedTabIDRef,
108
112
  updateCurrentTab = _useTabContext.updateCurrentTab,
113
+ openSuperTabOnRowClick = _useTabContext.openSuperTabOnRowClick,
109
114
  hasPrivilege = _useTabContext.hasPrivilege,
110
115
  subTabChange = _useTabContext.subTabChange,
111
116
  updateSubTabChange = _useTabContext.updateSubTabChange,
@@ -324,8 +329,6 @@ var SuperTabs = function SuperTabs(_ref) {
324
329
 
325
330
  // Hover handlers for brand wrapper
326
331
  var handleBrandHoverEnter = function handleBrandHoverEnter() {
327
- console.log('handleBrandHoverEnter', isMobile, preventHomeRedirect);
328
-
329
332
  // Skip hover functionality on mobile devices to avoid conflicts
330
333
  if (isMobile) return;
331
334
 
@@ -849,7 +852,14 @@ var SuperTabs = function SuperTabs(_ref) {
849
852
  ref: provided.innerRef
850
853
  // (snapshot.isDragging ? " dragging" : "") +
851
854
  ,
852
- className: 'tab-with-child-wrapper parent-super-tab' + " tab-".concat(tab.id) + (isActive ? ' active' : '') + (closingTabID === tab.id ? ' stack-closing' : '') + (shrinkedTab ? ' shrinked-parent-tab' : '') + (snapshot.isDragging ? ' dragging' : '')
855
+ className: 'tab-with-child-wrapper parent-super-tab' + " tab-".concat(tab.id) + (isActive ? ' active' : '') + (closingTabID === tab.id ? ' stack-closing' : '') + (shrinkedTab ? ' shrinked-parent-tab' : '') + (snapshot.isDragging ? ' dragging' : ''),
856
+ onClick: function onClick() {
857
+ if (isActive) return;
858
+ openSuperTabOnRowClick({
859
+ tab: tab,
860
+ isSubTab: false
861
+ });
862
+ }
853
863
  }), /*#__PURE__*/_react["default"].createElement("div", {
854
864
  className: 'child-tabs-wrapper tab-' + tab.id + (showSubTabs ? ' expanded' : '')
855
865
  // (isActive ? ' active' : '')
@@ -870,6 +880,7 @@ var SuperTabs = function SuperTabs(_ref) {
870
880
  // title={tab.title}
871
881
  ,
872
882
  onClick: function onClick(e) {
883
+ e.stopPropagation();
873
884
  var ignoreActiveTabUpdate = false;
874
885
  if (containsSubTabs && !isActive) {
875
886
  var _lastOpenedUrl$curren;
@@ -197,6 +197,7 @@ body[data-theme="light"] {
197
197
 
198
198
  display: flex;
199
199
  align-items: center;
200
+ cursor: pointer !important;
200
201
  transition-duration: var(--transition-duration-extended);
201
202
  transition-property: padding, opacity, border-color, max-width;
202
203
 
@@ -536,6 +537,7 @@ body[data-theme="light"] {
536
537
  align-items: center;
537
538
  position: relative;
538
539
  z-index: 10;
540
+ cursor: pointer !important;
539
541
 
540
542
  &:not(.active) {
541
543
  position: relative;
@@ -1496,7 +1496,7 @@ function TabProvider(_ref9) {
1496
1496
  break;
1497
1497
  }
1498
1498
  pathName = window.location.pathname;
1499
- isHomeTab = pathName === homeUrl;
1499
+ isHomeTab = pathName === homeUrl || pathName === '/';
1500
1500
  _context10.n = 3;
1501
1501
  return findDuplicateEntriesAndCloseTab(response.tabs);
1502
1502
  case 3:
package/dist/TabList.js CHANGED
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports["default"] = void 0;
8
8
  var _react = _interopRequireWildcard(require("react"));
9
+ var _reactDom = require("react-dom");
9
10
  var _TabContext = require("./TabContext");
10
11
  var _reactRouterDom = require("react-router-dom");
11
12
  var _ClickOutsideListener = _interopRequireDefault(require("./ClickOutsideListener"));
@@ -74,13 +75,16 @@ var TabList = function TabList(_ref) {
74
75
  if (popupElem) {
75
76
  var popupRect = popupElem.getBoundingClientRect();
76
77
  var windowWidth = window.innerWidth;
78
+ var top = "".concat(popupRect.bottom - 2, "px");
77
79
  if (popupRect.right + 300 > windowWidth) {
78
80
  position = {
79
- right: "".concat(window.innerWidth - (popupRect === null || popupRect === void 0 ? void 0 : popupRect.right), "px")
81
+ right: "".concat(window.innerWidth - (popupRect === null || popupRect === void 0 ? void 0 : popupRect.right), "px"),
82
+ top: top
80
83
  };
81
84
  } else {
82
85
  position = {
83
- left: "".concat((popupRect === null || popupRect === void 0 ? void 0 : popupRect.left) + 5, "px")
86
+ left: "".concat((popupRect === null || popupRect === void 0 ? void 0 : popupRect.left) + 5, "px"),
87
+ top: top
84
88
  };
85
89
  }
86
90
  }
@@ -134,7 +138,7 @@ var TabList = function TabList(_ref) {
134
138
  return exactMatches.flat().concat(otherMatches);
135
139
  };
136
140
  var filteredTabs = filterTabs(tabs);
137
- return /*#__PURE__*/_react["default"].createElement(_ClickOutsideListener["default"], {
141
+ var tabListContent = /*#__PURE__*/_react["default"].createElement(_ClickOutsideListener["default"], {
138
142
  onOutsideClick: handleOutsideClick
139
143
  }, /*#__PURE__*/_react["default"].createElement("div", {
140
144
  className: "tab-list-wrapper ".concat(showList ? 'show' : ''),
@@ -154,7 +158,7 @@ var TabList = function TabList(_ref) {
154
158
  closeList();
155
159
  setShowList(false);
156
160
  }
157
- }, title), !(index == customAddButtons.length - 1) && /*#__PURE__*/_react["default"].createElement("span", {
161
+ }, title), !(index === customAddButtons.length - 1) && /*#__PURE__*/_react["default"].createElement("span", {
158
162
  className: "pipe"
159
163
  }));
160
164
  }) : showAddButton && !hasCustomAddButtons && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("button", {
@@ -232,5 +236,9 @@ var TabList = function TabList(_ref) {
232
236
  }) : /*#__PURE__*/_react["default"].createElement("div", {
233
237
  className: "tab-list-no-data"
234
238
  }, "No data found"))))));
239
+ if (!showList) {
240
+ return null;
241
+ }
242
+ return /*#__PURE__*/(0, _reactDom.createPortal)(tabListContent, document.body);
235
243
  };
236
244
  var _default = exports["default"] = TabList;
package/dist/TabList.scss CHANGED
@@ -1,11 +1,11 @@
1
1
  .tab-list-wrapper {
2
2
  padding-top: 12px;
3
3
  position: fixed;
4
- top: calc(var(--header-height-other-tab) - 8px);
5
4
  opacity: 0;
6
5
  visibility: hidden;
7
6
  transition: opacity 0.3s;
8
7
  pointer-events: none;
8
+ z-index: 10000;
9
9
 
10
10
  &.show {
11
11
  opacity: 1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bydata/react-supertabs",
3
- "version": "1.1.8",
3
+ "version": "1.1.9",
4
4
  "description": "A customizable React super tabs component.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",