@bydata/react-supertabs 1.1.5 → 1.1.7

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/dist/SuperTabs.js CHANGED
@@ -17,9 +17,9 @@ var _eventEmitter = _interopRequireDefault(require("./eventEmitter"));
17
17
  var _Utils = require("./Utils");
18
18
  var _Constants = require("./Constants");
19
19
  require("./SuperTabs.scss");
20
- var _jsxRuntime = require("react/jsx-runtime");
21
20
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
22
21
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
22
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
23
23
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
24
24
  function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
25
25
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@@ -684,344 +684,323 @@ var SuperTabs = function SuperTabs(_ref) {
684
684
  // }
685
685
  // }, [activeTab, activeSubTab]);
686
686
 
687
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
687
+ return /*#__PURE__*/_react["default"].createElement("div", {
688
688
  className: "super-tabs-wrapper",
689
- ref: superTabsWrapperElemRef,
690
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactRouterDom.NavLink, {
691
- to: homeUrl,
692
- className: "home-tab"
693
- // activeClassName="active"
694
- // title="Home"
695
- ,
696
- onMouseEnter: handleBrandHoverEnter,
697
- onMouseLeave: handleBrandHoverLeave,
698
- onClick: function onClick(e) {
699
- if (preventHomeRedirect) {
700
- e.preventDefault();
701
- setShowMainMenu(true);
702
- return;
703
- }
704
- // if (expandedTabID || activeTab?.id) {
705
- if (expandedTabID) {
706
- // updateExpandedID(null);
707
- // closeSubTabStack(expandedTabID ?? activeTab.id);
708
- closeSubTabStack(expandedTabID);
709
- }
710
- updateActiveTab({});
711
- updateActiveSubTab({});
712
- updateCurrentTab({
713
- tab: (0, _Utils.getHomeTab)(homeUrl),
714
- isHomeTab: true
689
+ ref: superTabsWrapperElemRef
690
+ }, /*#__PURE__*/_react["default"].createElement(_reactRouterDom.NavLink, {
691
+ to: homeUrl,
692
+ className: "home-tab"
693
+ // activeClassName="active"
694
+ // title="Home"
695
+ ,
696
+ onMouseEnter: handleBrandHoverEnter,
697
+ onMouseLeave: handleBrandHoverLeave,
698
+ onClick: function onClick(e) {
699
+ if (preventHomeRedirect) {
700
+ e.preventDefault();
701
+ setShowMainMenu(true);
702
+ return;
703
+ }
704
+ // if (expandedTabID || activeTab?.id) {
705
+ if (expandedTabID) {
706
+ // updateExpandedID(null);
707
+ // closeSubTabStack(expandedTabID ?? activeTab.id);
708
+ closeSubTabStack(expandedTabID);
709
+ }
710
+ updateActiveTab({});
711
+ updateActiveSubTab({});
712
+ updateCurrentTab({
713
+ tab: (0, _Utils.getHomeTab)(homeUrl),
714
+ isHomeTab: true
715
+ });
716
+ },
717
+ exact: true
718
+ }, /*#__PURE__*/_react["default"].createElement("div", {
719
+ className: "brand-wrapper"
720
+ }, /*#__PURE__*/_react["default"].createElement("span", {
721
+ className: "brand-logo ".concat((0, _Utils.isDev)() ? 'dev' : '')
722
+ }))), showMainMenu && /*#__PURE__*/_react["default"].createElement(_ClickOutsideListener["default"], {
723
+ onOutsideClick: function onOutsideClick() {
724
+ // Only close via click outside if not triggered by hover
725
+ if (!isHoveringBrand) {
726
+ setShowMainMenu(false);
727
+ }
728
+ }
729
+ }, /*#__PURE__*/_react["default"].createElement("div", {
730
+ className: "app-pages-wrapper",
731
+ onMouseEnter: handleMenuHoverEnter,
732
+ onMouseLeave: handleMenuHoverLeave
733
+ }, SITE_PAGES.map(function (page, index) {
734
+ var _page$isExternal;
735
+ if (isMobile && !(page !== null && page !== void 0 && page.showInMobile) || !hasPrivilege(page.privilege)) {
736
+ return null;
737
+ }
738
+ return /*#__PURE__*/_react["default"].createElement("div", {
739
+ key: index,
740
+ className: "module",
741
+ onClick: function onClick() {
742
+ return setShowMainMenu(false);
743
+ }
744
+ }, /*#__PURE__*/_react["default"].createElement(_SuperLink["default"], {
745
+ tab: page,
746
+ isSubTab: false,
747
+ isExternal: (_page$isExternal = page.isExternal) !== null && _page$isExternal !== void 0 ? _page$isExternal : undefined
748
+ }, page.title));
749
+ }))), /*#__PURE__*/_react["default"].createElement(_superDnd.DragDropContext, {
750
+ onDragStart: handleDragStart,
751
+ onDragEnd: handleDragEnd
752
+ }, /*#__PURE__*/_react["default"].createElement(_superDnd.Droppable, {
753
+ droppableId: "HEADER_TABS",
754
+ direction: "horizontal"
755
+ }, function (provided) {
756
+ return /*#__PURE__*/_react["default"].createElement("div", _extends({
757
+ className: "main-tabs"
758
+ }, provided.droppableProps, {
759
+ ref: provided.innerRef
760
+ }), tabs.map(function (tab, index) {
761
+ var _tab$subTabs, _tab$subTabs2, _tab$subTabs3, _tab$subTabs4;
762
+ var url = tab.url;
763
+ var pathname = window.location.pathname;
764
+ var formattedPathname = getActiveParentTabName(pathname, homeUrl);
765
+ var tabUrl = getActiveParentTabName(tab.url, homeUrl);
766
+ if (tabUrl === formattedPathname) {
767
+ url = pathname;
768
+ }
769
+ var hasAccessToTab = hasPrivilege(tab.privilege);
770
+ var showNotificationDot = tab.showNotificationDot || false;
771
+ // const hasSubTabs = tab?.subTabs?.length > 0;
772
+ var containsSubTabs = tab === null || tab === void 0 ? void 0 : tab.containsSubTabs;
773
+ var showSubTabs = expandedTabID === tab.id;
774
+ var isTabClosing = closingTabID === tab.id;
775
+ var isActive = tabUrl === formattedPathname;
776
+
777
+ // const isActiveWithSubTabsExpanded = isActive && containsSubTabs && showSubTabs;
778
+ // const openedSubTab = lastOpenedSubTabs[tab.id];
779
+ // const isSubTabOpened = tab?.subTabs?.some(t => t.id === openedSubTab?.id)
780
+ // const subTabsLength = (isSubTabOpened ? tab?.subTabs?.length - 1 : tab?.subTabs?.length) || 0;
781
+ var hasAddBtnPrivilege = typeof tab.showAddButton === 'boolean' ? tab.showAddButton : _typeof(tab.showAddButton) === 'object' && Array.isArray(tab.showAddButton) ? hasPrivilege(tab.showAddButton) : false;
782
+ var showAddButton = hasAddBtnPrivilege && !isMobileView ? (tab === null || tab === void 0 || (_tab$subTabs = tab.subTabs) === null || _tab$subTabs === void 0 ? void 0 : _tab$subTabs.length) <= 1 : false;
783
+ var showChevron = (tab === null || tab === void 0 || (_tab$subTabs2 = tab.subTabs) === null || _tab$subTabs2 === void 0 ? void 0 : _tab$subTabs2.length) > 1;
784
+ var widthLessThan520 = window.innerWidth < 520;
785
+ var isMobileScreen = window.innerWidth < 640;
786
+ if (widthLessThan520 && !tab.lastOpened && !tab.isFixed) return null;
787
+ var shrinkedTab = tab.id === expandedTabID ? false : expandedTabID;
788
+ var additionalWidth = 0; // tab.url === pathname ? 24 : 0 + hiddenExternalToolbars[tab.id] ? 24 : 0;
789
+ var width = (0, _Utils.getTextWidth)(tab.title, _Constants.fontStyle) + 42 + additionalWidth;
790
+ var subTabWithOpenOrderOne = (tab === null || tab === void 0 || (_tab$subTabs3 = tab.subTabs) === null || _tab$subTabs3 === void 0 ? void 0 : _tab$subTabs3.length) >= 1 && tab.subTabs.find(function (t) {
791
+ return t.open_order === 1;
792
+ });
793
+ var isSubTabActive = tab.url !== pathname && isActive;
794
+ var hasCloseButton = false; // isSubTabActive; // TODO: This will be used in next release (pending for design update)
795
+ var hasToolbarButton = tab.url !== pathname && hiddenExternalToolbars[subTabWithOpenOrderOne === null || subTabWithOpenOrderOne === void 0 ? void 0 : subTabWithOpenOrderOne.id];
796
+ var subTabWithOpenOrderOneWidth = subTabWithOpenOrderOne && (0, _Utils.calculateWidth)({
797
+ text: (0, _Utils.getTitle)(subTabWithOpenOrderOne),
798
+ hasAvatar: subTabWithOpenOrderOne.showAvatar,
799
+ hasCloseButton: hasCloseButton,
800
+ hasToolbarButton: hasToolbarButton
801
+ });
802
+ var isExpandedTab = expandedTabID === tab.id;
803
+ var subTabsWidth = isDefaultExpanded && isExpandedTab ? tab === null || tab === void 0 || (_tab$subTabs4 = tab.subTabs) === null || _tab$subTabs4 === void 0 ? void 0 : _tab$subTabs4.map(function (subTab) {
804
+ var title = (0, _Utils.getTitle)(subTab);
805
+ return (0, _Utils.calculateWidth)({
806
+ text: title,
807
+ hasAvatar: subTab.showAvatar,
808
+ hasCloseButton: hasCloseButton,
809
+ hasToolbarButton: hasToolbarButton,
810
+ addMargin: true
715
811
  });
716
- },
717
- exact: true,
718
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
719
- className: "brand-wrapper",
720
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
721
- className: "brand-logo ".concat((0, _Utils.isDev)() ? 'dev' : '')
722
- })
723
- })
724
- }), showMainMenu && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ClickOutsideListener["default"], {
725
- onOutsideClick: function onOutsideClick() {
726
- // Only close via click outside if not triggered by hover
727
- if (!isHoveringBrand) {
728
- setShowMainMenu(false);
812
+ }).reduce(function (acc, width) {
813
+ return acc + width;
814
+ }, 0) : subTabWithOpenOrderOneWidth || 0;
815
+ var getItemStyle = function getItemStyle(draggableStyle) {
816
+ return _objectSpread({
817
+ maxWidth: expandedTabID ? "".concat(tab.width + additionalWidth || width, "px") : "".concat(width, "px")
818
+ }, draggableStyle);
819
+ };
820
+ var _filterSubTabs = filterSubTabs(tab.subTabs),
821
+ subTabsInNavbar = _filterSubTabs.subTabsInNavbar;
822
+ var getStylesForSubTabsWrapper = function getStylesForSubTabsWrapper(tab, isActive) {
823
+ if (isActive) {
824
+ if (showSubTabs || isSubTabCollapsing || !subTabsWidth) {
825
+ return {
826
+ width: '100%'
827
+ };
828
+ } else if (subTabWrapperWidth[currentEntityId + '_' + tab.id] && isSubTabActive) {
829
+ return {
830
+ width: subTabWrapperWidth[currentEntityId + '_' + tab.id] + (hasToolbarButton ? _Constants.ToolbarButtonWidth : 0)
831
+ };
832
+ } else {
833
+ return {
834
+ width: "".concat(subTabsWidth + (showChevron || showAddButton ? 42 : 5), "px")
835
+ };
836
+ }
729
837
  }
730
- },
731
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
732
- className: "app-pages-wrapper",
733
- onMouseEnter: handleMenuHoverEnter,
734
- onMouseLeave: handleMenuHoverLeave,
735
- children: SITE_PAGES.map(function (page, index) {
736
- var _page$isExternal;
737
- if (isMobile && !(page !== null && page !== void 0 && page.showInMobile) || !hasPrivilege(page.privilege)) {
738
- return null;
838
+ return {
839
+ width: '0px'
840
+ };
841
+ };
842
+ return containsSubTabs ? /*#__PURE__*/_react["default"].createElement(_superDnd.Draggable, {
843
+ draggableId: String(index),
844
+ index: index,
845
+ key: index,
846
+ isDragDisabled: isMobileScreen
847
+ }, function (provided, snapshot) {
848
+ return /*#__PURE__*/_react["default"].createElement("div", _extends({}, provided.draggableProps, provided.dragHandleProps, {
849
+ ref: provided.innerRef
850
+ // (snapshot.isDragging ? " dragging" : "") +
851
+ ,
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' : '')
853
+ }), /*#__PURE__*/_react["default"].createElement("div", {
854
+ className: 'child-tabs-wrapper tab-' + tab.id + (showSubTabs ? ' expanded' : '')
855
+ // (isActive ? ' active' : '')
856
+ }, /*#__PURE__*/_react["default"].createElement(_reactHoverText["default"], {
857
+ content: tab.title,
858
+ delay: 500,
859
+ followCursor: true,
860
+ placement: "bottom",
861
+ stylingOptions: tooltipStyles
862
+ }, /*#__PURE__*/_react["default"].createElement(_reactRouterDom.NavLink, {
863
+ to: tab.url,
864
+ className: "tab" + " tab-" + tab.id + ((expandedTabID ? tab.width : maxWidth) && (0, _Utils.compareDecimals)(expandedTabID ? tab.width || width : maxWidth, width) === -1 ? ' fade-at-end' : '') + (!hasAccessToTab ? ' disabled-tab' : '') + (containsSubTabs ? ' has-child' : '') + (shrinkedTab ? ' shrinked-tab' : '')
865
+ // (showSubTabs ? ' expanded' : '')
866
+ ,
867
+ style: {
868
+ maxWidth: expandedTabID ? "".concat((tab.width + additionalWidth || width) - 10, "px") : "".concat(width, "px")
739
869
  }
740
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
741
- className: "module",
742
- onClick: function onClick() {
743
- return setShowMainMenu(false);
744
- },
745
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SuperLink["default"], {
746
- tab: page,
747
- isSubTab: false,
748
- isExternal: (_page$isExternal = page.isExternal) !== null && _page$isExternal !== void 0 ? _page$isExternal : undefined,
749
- children: page.title
750
- })
751
- }, index);
752
- })
753
- })
754
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_superDnd.DragDropContext, {
755
- onDragStart: handleDragStart,
756
- onDragEnd: handleDragEnd,
757
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_superDnd.Droppable, {
758
- droppableId: "HEADER_TABS",
759
- direction: "horizontal",
760
- children: function children(provided) {
761
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", _objectSpread(_objectSpread({
762
- className: "main-tabs"
763
- }, provided.droppableProps), {}, {
764
- ref: provided.innerRef,
765
- children: [tabs.map(function (tab, index) {
766
- var _tab$subTabs, _tab$subTabs2, _tab$subTabs3, _tab$subTabs4;
767
- var url = tab.url;
768
- var pathname = window.location.pathname;
769
- var formattedPathname = getActiveParentTabName(pathname, homeUrl);
770
- var tabUrl = getActiveParentTabName(tab.url, homeUrl);
771
- if (tabUrl === formattedPathname) {
772
- url = pathname;
870
+ // title={tab.title}
871
+ ,
872
+ onClick: function onClick(e) {
873
+ var ignoreActiveTabUpdate = false;
874
+ if (containsSubTabs && !isActive) {
875
+ var _lastOpenedUrl$curren;
876
+ var lastOpenedTab = (_lastOpenedUrl$curren = lastOpenedUrl.current) === null || _lastOpenedUrl$curren === void 0 ? void 0 : _lastOpenedUrl$curren[currentEntityId + '_' + tab.id];
877
+ updateActiveTab(tab);
878
+ ignoreActiveTabUpdate = true;
879
+ var lastOpenedTabUrl = lastOpenedTab === null || lastOpenedTab === void 0 ? void 0 : lastOpenedTab.url;
880
+ if (lastOpenedTabUrl && tabModePreference.includes(lastOpenedTab === null || lastOpenedTab === void 0 ? void 0 : lastOpenedTab.tabId)) {
881
+ lastOpenedTabUrl += "?edit=true";
773
882
  }
774
- var hasAccessToTab = hasPrivilege(tab.privilege);
775
- var showNotificationDot = tab.showNotificationDot || false;
776
- // const hasSubTabs = tab?.subTabs?.length > 0;
777
- var containsSubTabs = tab === null || tab === void 0 ? void 0 : tab.containsSubTabs;
778
- var showSubTabs = expandedTabID === tab.id;
779
- var isTabClosing = closingTabID === tab.id;
780
- var isActive = tabUrl === formattedPathname;
781
-
782
- // const isActiveWithSubTabsExpanded = isActive && containsSubTabs && showSubTabs;
783
- // const openedSubTab = lastOpenedSubTabs[tab.id];
784
- // const isSubTabOpened = tab?.subTabs?.some(t => t.id === openedSubTab?.id)
785
- // const subTabsLength = (isSubTabOpened ? tab?.subTabs?.length - 1 : tab?.subTabs?.length) || 0;
786
- var hasAddBtnPrivilege = typeof tab.showAddButton === 'boolean' ? tab.showAddButton : _typeof(tab.showAddButton) === 'object' && Array.isArray(tab.showAddButton) ? hasPrivilege(tab.showAddButton) : false;
787
- var showAddButton = hasAddBtnPrivilege && !isMobileView ? (tab === null || tab === void 0 || (_tab$subTabs = tab.subTabs) === null || _tab$subTabs === void 0 ? void 0 : _tab$subTabs.length) <= 1 : false;
788
- var showChevron = (tab === null || tab === void 0 || (_tab$subTabs2 = tab.subTabs) === null || _tab$subTabs2 === void 0 ? void 0 : _tab$subTabs2.length) > 1;
789
- var widthLessThan520 = window.innerWidth < 520;
790
- var isMobileScreen = window.innerWidth < 640;
791
- if (widthLessThan520 && !tab.lastOpened && !tab.isFixed) return null;
792
- var shrinkedTab = tab.id === expandedTabID ? false : expandedTabID;
793
- var additionalWidth = 0; // tab.url === pathname ? 24 : 0 + hiddenExternalToolbars[tab.id] ? 24 : 0;
794
- var width = (0, _Utils.getTextWidth)(tab.title, _Constants.fontStyle) + 42 + additionalWidth;
795
- var subTabWithOpenOrderOne = (tab === null || tab === void 0 || (_tab$subTabs3 = tab.subTabs) === null || _tab$subTabs3 === void 0 ? void 0 : _tab$subTabs3.length) >= 1 && tab.subTabs.find(function (t) {
796
- return t.open_order === 1;
797
- });
798
- var isSubTabActive = tab.url !== pathname && isActive;
799
- var hasCloseButton = false; // isSubTabActive; // TODO: This will be used in next release (pending for design update)
800
- var hasToolbarButton = tab.url !== pathname && hiddenExternalToolbars[subTabWithOpenOrderOne === null || subTabWithOpenOrderOne === void 0 ? void 0 : subTabWithOpenOrderOne.id];
801
- var subTabWithOpenOrderOneWidth = subTabWithOpenOrderOne && (0, _Utils.calculateWidth)({
802
- text: (0, _Utils.getTitle)(subTabWithOpenOrderOne),
803
- hasAvatar: subTabWithOpenOrderOne.showAvatar,
804
- hasCloseButton: hasCloseButton,
805
- hasToolbarButton: hasToolbarButton
806
- });
807
- var isExpandedTab = expandedTabID === tab.id;
808
- var subTabsWidth = isDefaultExpanded && isExpandedTab ? tab === null || tab === void 0 || (_tab$subTabs4 = tab.subTabs) === null || _tab$subTabs4 === void 0 ? void 0 : _tab$subTabs4.map(function (subTab) {
809
- var title = (0, _Utils.getTitle)(subTab);
810
- return (0, _Utils.calculateWidth)({
811
- text: title,
812
- hasAvatar: subTab.showAvatar,
813
- hasCloseButton: hasCloseButton,
814
- hasToolbarButton: hasToolbarButton,
815
- addMargin: true
816
- });
817
- }).reduce(function (acc, width) {
818
- return acc + width;
819
- }, 0) : subTabWithOpenOrderOneWidth || 0;
820
- var getItemStyle = function getItemStyle(draggableStyle) {
821
- return _objectSpread({
822
- maxWidth: expandedTabID ? "".concat(tab.width + additionalWidth || width, "px") : "".concat(width, "px")
823
- }, draggableStyle);
824
- };
825
- var _filterSubTabs = filterSubTabs(tab.subTabs),
826
- subTabsInNavbar = _filterSubTabs.subTabsInNavbar;
827
- var getStylesForSubTabsWrapper = function getStylesForSubTabsWrapper(tab, isActive) {
828
- if (isActive) {
829
- if (showSubTabs || isSubTabCollapsing || !subTabsWidth) {
830
- return {
831
- width: '100%'
832
- };
833
- } else if (subTabWrapperWidth[currentEntityId + '_' + tab.id] && isSubTabActive) {
834
- return {
835
- width: subTabWrapperWidth[currentEntityId + '_' + tab.id] + (hasToolbarButton ? _Constants.ToolbarButtonWidth : 0)
836
- };
837
- } else {
838
- return {
839
- width: "".concat(subTabsWidth + (showChevron || showAddButton ? 42 : 5), "px")
840
- };
841
- }
883
+ if (lastOpenedTab !== null && lastOpenedTab !== void 0 && lastOpenedTab.url && (lastOpenedTab === null || lastOpenedTab === void 0 ? void 0 : lastOpenedTab.url) !== tab.url) {
884
+ e.preventDefault();
885
+ if ((lastOpenedTab === null || lastOpenedTab === void 0 ? void 0 : lastOpenedTab.url) !== tab.url) {
886
+ updateActiveSubTab(lastOpenedTab || {});
887
+ // setLastOpenedSubTabs((prev) => {
888
+ // const updated = { ...prev };
889
+ // updated[tab.id] = lastOpenedTab;
890
+ // return updated;
891
+ // });
842
892
  }
843
- return {
844
- width: '0px'
845
- };
846
- };
847
- return containsSubTabs ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_superDnd.Draggable, {
848
- draggableId: String(index),
849
- index: index,
850
- isDragDisabled: isMobileScreen,
851
- children: function children(provided, snapshot) {
852
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", _objectSpread(_objectSpread(_objectSpread({}, provided.draggableProps), provided.dragHandleProps), {}, {
853
- ref: provided.innerRef
854
- // (snapshot.isDragging ? " dragging" : "") +
855
- ,
856
- 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' : ''),
857
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
858
- className: 'child-tabs-wrapper tab-' + tab.id + (showSubTabs ? ' expanded' : '')
859
- // (isActive ? ' active' : '')
860
- ,
861
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactHoverText["default"], {
862
- content: tab.title,
863
- delay: 500,
864
- followCursor: true,
865
- placement: "bottom",
866
- stylingOptions: tooltipStyles,
867
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactRouterDom.NavLink, {
868
- to: tab.url,
869
- className: "tab" + " tab-" + tab.id + ((expandedTabID ? tab.width : maxWidth) && (0, _Utils.compareDecimals)(expandedTabID ? tab.width || width : maxWidth, width) === -1 ? ' fade-at-end' : '') + (!hasAccessToTab ? ' disabled-tab' : '') + (containsSubTabs ? ' has-child' : '') + (shrinkedTab ? ' shrinked-tab' : '')
870
- // (showSubTabs ? ' expanded' : '')
871
- ,
872
- style: {
873
- maxWidth: expandedTabID ? "".concat((tab.width + additionalWidth || width) - 10, "px") : "".concat(width, "px")
874
- }
875
- // title={tab.title}
876
- ,
877
- onClick: function onClick(e) {
878
- var ignoreActiveTabUpdate = false;
879
- if (containsSubTabs && !isActive) {
880
- var _lastOpenedUrl$curren;
881
- var lastOpenedTab = (_lastOpenedUrl$curren = lastOpenedUrl.current) === null || _lastOpenedUrl$curren === void 0 ? void 0 : _lastOpenedUrl$curren[currentEntityId + '_' + tab.id];
882
- updateActiveTab(tab);
883
- ignoreActiveTabUpdate = true;
884
- var lastOpenedTabUrl = lastOpenedTab === null || lastOpenedTab === void 0 ? void 0 : lastOpenedTab.url;
885
- if (lastOpenedTabUrl && tabModePreference.includes(lastOpenedTab === null || lastOpenedTab === void 0 ? void 0 : lastOpenedTab.tabId)) {
886
- lastOpenedTabUrl += "?edit=true";
887
- }
888
- if (lastOpenedTab !== null && lastOpenedTab !== void 0 && lastOpenedTab.url && (lastOpenedTab === null || lastOpenedTab === void 0 ? void 0 : lastOpenedTab.url) !== tab.url) {
889
- e.preventDefault();
890
- if ((lastOpenedTab === null || lastOpenedTab === void 0 ? void 0 : lastOpenedTab.url) !== tab.url) {
891
- updateActiveSubTab(lastOpenedTab || {});
892
- // setLastOpenedSubTabs((prev) => {
893
- // const updated = { ...prev };
894
- // updated[tab.id] = lastOpenedTab;
895
- // return updated;
896
- // });
897
- }
898
- history.push(lastOpenedTabUrl || tab.url);
899
- // } else {
900
- // setTimeout(() => {
901
- // toggleSubTabs(tab);
902
- // }, 0);
903
- }
904
- }
905
- handleTabClick({
906
- tab: tab,
907
- parentId: tab.id,
908
- ignoreActiveTabUpdate: ignoreActiveTabUpdate
909
- });
910
- },
911
- exact: tab.fixed,
912
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(TabContentWrapper, {
913
- tab: tab,
914
- index: index,
915
- isActive: tab.url === pathname,
916
- handleTabClose: handleTabClose,
917
- isSubTab: false,
918
- containsSubTabs: containsSubTabs,
919
- SITE_PREFIX: SITE_PREFIX,
920
- Suffix: (Suffix === null || Suffix === void 0 ? void 0 : Suffix[tab === null || tab === void 0 ? void 0 : tab.id]) || null
921
- })
922
- })
923
- })
924
- }), containsSubTabs && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
925
- className: "sub-tabs-wrapper tab-".concat(tab.id, " ").concat(showSubTabs ? 'expanded' : ''),
926
- style: getStylesForSubTabsWrapper(tab, isActive),
927
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_superDnd.DragDropContext, {
928
- onDragStart: handleSubTabDragStart,
929
- onDragEnd: function onDragEnd(res) {
930
- return handleSubTabDragEnd(res, tab.id);
931
- },
932
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_superDnd.Droppable, {
933
- droppableId: "HEADER_SUB_TABS_".concat(tab.id),
934
- direction: "horizontal",
935
- children: function children(subprovided) {
936
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", _objectSpread(_objectSpread({
937
- className: "sub-tab-group",
938
- ref: subprovided.innerRef
939
- }, subprovided.droppableProps), {}, {
940
- children: [subTabsInNavbar.map(function (subTab, subIndex) {
941
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(SubTab, {
942
- activeTab: activeTab,
943
- closingTabID: closingTabID,
944
- expandedTabID: expandedTabID,
945
- maxWidth: maxWidth,
946
- showSubTabs: showSubTabs,
947
- subIndex: subIndex,
948
- hasSingleSubTab: tab.subTabs.length === 1,
949
- subTab: subTab,
950
- tab: tab,
951
- tabUrl: tabUrl,
952
- handleTabClick: handleTabClick,
953
- handleTabClose: handleTabClose,
954
- SITE_PREFIX: SITE_PREFIX,
955
- index: index
956
- }, subTab.id);
957
- }), subprovided.placeholder]
958
- }));
959
- }
960
- })
961
- }), (showChevron || showAddButton) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_TabStack["default"], {
962
- handleTabClick: handleTabClick,
963
- handleTabClose: handleTabClose,
964
- index: index,
965
- isActive: isActive,
966
- isTabClosing: isTabClosing,
967
- showAddButton: showAddButton,
968
- showChevron: showChevron,
969
- showSubTabs: showSubTabs,
970
- subTabsInList: tab.subTabs,
971
- tab: tab,
972
- toggleSubTabs: toggleSubTabs,
973
- addButtonCallBackRefs: addButtonCallBackRefs,
974
- SITE_PREFIX: SITE_PREFIX,
975
- isMobileView: isMobileView
976
- })]
977
- })]
978
- }));
979
- }
980
- }, index) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_superDnd.Draggable, {
981
- draggableId: String(index),
982
- index: index,
983
- isDragDisabled: isMobileScreen,
984
- children: function children(provided, snapshot) {
985
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactHoverText["default"], {
986
- content: tab.title,
987
- delay: 500,
988
- followCursor: true,
989
- placement: "bottom",
990
- stylingOptions: tooltipStyles,
991
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactRouterDom.NavLink, _objectSpread(_objectSpread(_objectSpread({}, provided.draggableProps), provided.dragHandleProps), {}, {
992
- ref: provided.innerRef,
993
- to: url,
994
- onClick: function onClick() {
995
- handleTabClick({
996
- tab: tab
997
- });
998
- },
999
- className: "tab parent-super-tab" + (snapshot.isDragging ? " dragging" : "") + (maxWidth && (0, _Utils.compareDecimals)(maxWidth, width) === -1 ? ' fade-at-end' : '') + (expandedTabID ? ' shrinked-tab' : '') + (!hasAccessToTab ? " disabled-tab" : ""),
1000
- style: getItemStyle(provided.draggableProps.style),
1001
- exact: true
1002
- // exact={tab.exact}
1003
- // title={tab.title}
1004
- ,
1005
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(TabContentWrapper, {
1006
- tab: tab,
1007
- index: index,
1008
- isActive: tab.url === pathname,
1009
- showNotificationDot: showNotificationDot,
1010
- handleTabClose: handleTabClose,
1011
- isSubTab: false,
1012
- SITE_PREFIX: SITE_PREFIX,
1013
- Suffix: (Suffix === null || Suffix === void 0 ? void 0 : Suffix[tab === null || tab === void 0 ? void 0 : tab.id]) || null
1014
- })
1015
- }))
1016
- });
1017
- }
1018
- }, index);
1019
- }), provided.placeholder]
1020
- }));
1021
- }
1022
- })
1023
- })]
1024
- });
893
+ history.push(lastOpenedTabUrl || tab.url);
894
+ // } else {
895
+ // setTimeout(() => {
896
+ // toggleSubTabs(tab);
897
+ // }, 0);
898
+ }
899
+ }
900
+ handleTabClick({
901
+ tab: tab,
902
+ parentId: tab.id,
903
+ ignoreActiveTabUpdate: ignoreActiveTabUpdate
904
+ });
905
+ },
906
+ exact: tab.fixed
907
+ }, /*#__PURE__*/_react["default"].createElement(TabContentWrapper, {
908
+ tab: tab,
909
+ index: index,
910
+ isActive: tab.url === pathname,
911
+ handleTabClose: handleTabClose,
912
+ isSubTab: false,
913
+ containsSubTabs: containsSubTabs,
914
+ SITE_PREFIX: SITE_PREFIX,
915
+ Suffix: (Suffix === null || Suffix === void 0 ? void 0 : Suffix[tab === null || tab === void 0 ? void 0 : tab.id]) || null
916
+ })))), containsSubTabs && /*#__PURE__*/_react["default"].createElement("div", {
917
+ className: "sub-tabs-wrapper tab-".concat(tab.id, " ").concat(showSubTabs ? 'expanded' : ''),
918
+ style: getStylesForSubTabsWrapper(tab, isActive)
919
+ }, /*#__PURE__*/_react["default"].createElement(_superDnd.DragDropContext, {
920
+ onDragStart: handleSubTabDragStart,
921
+ onDragEnd: function onDragEnd(res) {
922
+ return handleSubTabDragEnd(res, tab.id);
923
+ }
924
+ }, /*#__PURE__*/_react["default"].createElement(_superDnd.Droppable, {
925
+ droppableId: "HEADER_SUB_TABS_".concat(tab.id),
926
+ direction: "horizontal"
927
+ }, function (subprovided) {
928
+ return /*#__PURE__*/_react["default"].createElement("div", _extends({
929
+ className: "sub-tab-group",
930
+ ref: subprovided.innerRef
931
+ }, subprovided.droppableProps), subTabsInNavbar.map(function (subTab, subIndex) {
932
+ return /*#__PURE__*/_react["default"].createElement(SubTab, {
933
+ activeTab: activeTab,
934
+ closingTabID: closingTabID,
935
+ expandedTabID: expandedTabID,
936
+ maxWidth: maxWidth,
937
+ showSubTabs: showSubTabs,
938
+ subIndex: subIndex,
939
+ hasSingleSubTab: tab.subTabs.length === 1,
940
+ subTab: subTab,
941
+ tab: tab,
942
+ tabUrl: tabUrl,
943
+ handleTabClick: handleTabClick,
944
+ handleTabClose: handleTabClose,
945
+ SITE_PREFIX: SITE_PREFIX,
946
+ index: index,
947
+ key: subTab.id
948
+ });
949
+ }), subprovided.placeholder);
950
+ })), (showChevron || showAddButton) && /*#__PURE__*/_react["default"].createElement(_TabStack["default"], {
951
+ handleTabClick: handleTabClick,
952
+ handleTabClose: handleTabClose,
953
+ index: index,
954
+ isActive: isActive,
955
+ isTabClosing: isTabClosing,
956
+ showAddButton: showAddButton,
957
+ showChevron: showChevron,
958
+ showSubTabs: showSubTabs,
959
+ subTabsInList: tab.subTabs,
960
+ tab: tab,
961
+ toggleSubTabs: toggleSubTabs,
962
+ addButtonCallBackRefs: addButtonCallBackRefs,
963
+ SITE_PREFIX: SITE_PREFIX,
964
+ isMobileView: isMobileView
965
+ })));
966
+ }) : /*#__PURE__*/_react["default"].createElement(_superDnd.Draggable, {
967
+ key: index,
968
+ draggableId: String(index),
969
+ index: index,
970
+ isDragDisabled: isMobileScreen
971
+ }, function (provided, snapshot) {
972
+ return /*#__PURE__*/_react["default"].createElement(_reactHoverText["default"], {
973
+ content: tab.title,
974
+ delay: 500,
975
+ followCursor: true,
976
+ placement: "bottom",
977
+ stylingOptions: tooltipStyles
978
+ }, /*#__PURE__*/_react["default"].createElement(_reactRouterDom.NavLink, _extends({}, provided.draggableProps, provided.dragHandleProps, {
979
+ ref: provided.innerRef,
980
+ to: url,
981
+ onClick: function onClick() {
982
+ handleTabClick({
983
+ tab: tab
984
+ });
985
+ },
986
+ className: "tab parent-super-tab" + (snapshot.isDragging ? " dragging" : "") + (maxWidth && (0, _Utils.compareDecimals)(maxWidth, width) === -1 ? ' fade-at-end' : '') + (expandedTabID ? ' shrinked-tab' : '') + (!hasAccessToTab ? " disabled-tab" : ""),
987
+ style: getItemStyle(provided.draggableProps.style),
988
+ exact: true
989
+ // exact={tab.exact}
990
+ // title={tab.title}
991
+ }), /*#__PURE__*/_react["default"].createElement(TabContentWrapper, {
992
+ tab: tab,
993
+ index: index,
994
+ isActive: tab.url === pathname,
995
+ showNotificationDot: showNotificationDot,
996
+ handleTabClose: handleTabClose,
997
+ isSubTab: false,
998
+ SITE_PREFIX: SITE_PREFIX,
999
+ Suffix: (Suffix === null || Suffix === void 0 ? void 0 : Suffix[tab === null || tab === void 0 ? void 0 : tab.id]) || null
1000
+ })));
1001
+ });
1002
+ }), provided.placeholder);
1003
+ })));
1025
1004
  };
1026
1005
  var TabContentWrapper = function TabContentWrapper(_ref9) {
1027
1006
  var tab = _ref9.tab,
@@ -1043,79 +1022,68 @@ var TabContentWrapper = function TabContentWrapper(_ref9) {
1043
1022
  var _useTabContext2 = (0, _TabContext.useTabContext)(),
1044
1023
  hiddenExternalToolbars = _useTabContext2.hiddenExternalToolbars,
1045
1024
  showExternalToolbar = _useTabContext2.showExternalToolbar;
1046
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
1047
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1048
- className: "tab-content-wrapper",
1049
- children: [!isSubTab && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
1050
- className: "single-tab ".concat(showNotificationDot ? 'show-notification-dot' : '')
1051
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1052
- className: "tab-title-wrapper",
1053
- children: [showAvatar && /*#__PURE__*/(0, _jsxRuntime.jsx)(_superAvatar["default"], {
1054
- firstName: tab.firstName,
1055
- lastName: tab.lastName,
1056
- imgSrc: tab.imgSrc || tab.img_url,
1057
- width: 20,
1058
- height: 20,
1059
- fontSize: 8,
1060
- borderRadius: 12
1061
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
1062
- className: "tab-title",
1063
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
1064
- children: title
1065
- })
1066
- })]
1067
- }), isActive && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
1068
- className: "tab-close-btn-wrapper",
1069
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
1070
- className: "tab-close-btn",
1071
- title: "Close tab",
1072
- onClick: function onClick(e) {
1073
- e.preventDefault();
1074
- e.stopPropagation();
1075
- handleTabClose({
1076
- tab: tab,
1077
- index: index,
1078
- isSubTab: isSubTab,
1079
- parentIndex: parentIndex
1080
- });
1081
- }
1082
- })
1083
- }), isActive && false && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
1084
- className: "active-sub-tab-btn-wrapper",
1085
- children: hiddenExternalToolbars[tab.id] && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
1086
- className: "tab-hide-toolbar-btn-wrapper",
1087
- onClick: function onClick(e) {
1088
- e.preventDefault();
1089
- showExternalToolbar(tab.id);
1090
- setShowTooltip(false);
1091
- setTimeout(function () {
1092
- setShowTooltip(true);
1093
- }, 100);
1094
- },
1095
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
1096
- className: "tab-hide-toolbar-btn",
1097
- title: "Show Toolbar"
1098
- })
1099
- })
1100
- })]
1101
- }), Suffix && isActive && window.innerWidth < 640 && /*#__PURE__*/(0, _jsxRuntime.jsx)(Suffix, {}), !isActive && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
1102
- className: "tab-close-btn-wrapper",
1103
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
1104
- className: "tab-close-btn",
1105
- title: "Close tab",
1106
- onClick: function onClick(e) {
1107
- e.preventDefault();
1108
- e.stopPropagation();
1109
- handleTabClose({
1110
- tab: tab,
1111
- index: index,
1112
- isSubTab: isSubTab,
1113
- parentIndex: parentIndex
1114
- });
1115
- }
1116
- })
1117
- })]
1118
- });
1025
+ return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("div", {
1026
+ className: "tab-content-wrapper"
1027
+ }, !isSubTab && /*#__PURE__*/_react["default"].createElement("div", {
1028
+ className: "single-tab ".concat(showNotificationDot ? 'show-notification-dot' : '')
1029
+ }), /*#__PURE__*/_react["default"].createElement("div", {
1030
+ className: "tab-title-wrapper"
1031
+ }, showAvatar && /*#__PURE__*/_react["default"].createElement(_superAvatar["default"], {
1032
+ firstName: tab.firstName,
1033
+ lastName: tab.lastName,
1034
+ imgSrc: tab.imgSrc || tab.img_url,
1035
+ width: 20,
1036
+ height: 20,
1037
+ fontSize: 8,
1038
+ borderRadius: 12
1039
+ }), /*#__PURE__*/_react["default"].createElement("div", {
1040
+ className: "tab-title"
1041
+ }, /*#__PURE__*/_react["default"].createElement("div", null, title))), isActive && /*#__PURE__*/_react["default"].createElement("div", {
1042
+ className: "tab-close-btn-wrapper"
1043
+ }, /*#__PURE__*/_react["default"].createElement("button", {
1044
+ className: "tab-close-btn",
1045
+ title: "Close tab",
1046
+ onClick: function onClick(e) {
1047
+ e.preventDefault();
1048
+ e.stopPropagation();
1049
+ handleTabClose({
1050
+ tab: tab,
1051
+ index: index,
1052
+ isSubTab: isSubTab,
1053
+ parentIndex: parentIndex
1054
+ });
1055
+ }
1056
+ })), isActive && false && /*#__PURE__*/_react["default"].createElement("div", {
1057
+ className: "active-sub-tab-btn-wrapper"
1058
+ }, hiddenExternalToolbars[tab.id] && /*#__PURE__*/_react["default"].createElement("div", {
1059
+ className: "tab-hide-toolbar-btn-wrapper",
1060
+ onClick: function onClick(e) {
1061
+ e.preventDefault();
1062
+ showExternalToolbar(tab.id);
1063
+ setShowTooltip(false);
1064
+ setTimeout(function () {
1065
+ setShowTooltip(true);
1066
+ }, 100);
1067
+ }
1068
+ }, /*#__PURE__*/_react["default"].createElement("button", {
1069
+ className: "tab-hide-toolbar-btn",
1070
+ title: "Show Toolbar"
1071
+ })))), Suffix && isActive && window.innerWidth < 640 && /*#__PURE__*/_react["default"].createElement(Suffix, null), !isActive && /*#__PURE__*/_react["default"].createElement("div", {
1072
+ className: "tab-close-btn-wrapper"
1073
+ }, /*#__PURE__*/_react["default"].createElement("button", {
1074
+ className: "tab-close-btn",
1075
+ title: "Close tab",
1076
+ onClick: function onClick(e) {
1077
+ e.preventDefault();
1078
+ e.stopPropagation();
1079
+ handleTabClose({
1080
+ tab: tab,
1081
+ index: index,
1082
+ isSubTab: isSubTab,
1083
+ parentIndex: parentIndex
1084
+ });
1085
+ }
1086
+ })));
1119
1087
  };
1120
1088
  var SubTab = exports.SubTab = function SubTab(_ref0) {
1121
1089
  var _subTab$url;
@@ -1177,55 +1145,52 @@ var SubTab = exports.SubTab = function SubTab(_ref0) {
1177
1145
  opacity: isVisible ? 1 : 0
1178
1146
  }, draggableStyle);
1179
1147
  };
1180
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_superDnd.Draggable, {
1148
+ return /*#__PURE__*/_react["default"].createElement(_superDnd.Draggable, {
1149
+ key: subIndex,
1181
1150
  draggableId: String(subIndex),
1182
1151
  isDragDisabled: !showSubTabs,
1183
- index: subIndex,
1184
- children: function children(subprovided, snapshot) {
1185
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactHoverText["default"], {
1186
- content: title,
1187
- delay: 500,
1188
- followCursor: true,
1189
- show: showTooltip,
1190
- placement: "bottom",
1191
- stylingOptions: tooltipStyles,
1192
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactRouterDom.NavLink, _objectSpread(_objectSpread(_objectSpread({}, subprovided.draggableProps), subprovided.dragHandleProps), {}, {
1193
- ref: subprovided.innerRef,
1194
- to: subTabUrl,
1195
- id: "tab-".concat(tab.id, "-") + subTab.id.toString().replace('/', '-'),
1196
- className: "tab sub-tab" + (show ? ' show' : '') + (
1197
- // (isTabClosing ? ' slide-out' : '') +
1198
- // (isTabOpening ? ' fade-in' : '') +
1199
- expandedTabID && subTab.width && (0, _Utils.compareDecimals)(subTab.width, width) === -1 ? ' fade-at-end' : '') + (
1200
- // (closingUnexpandedSubTab || openingUnexpandedSubTab ? ' no-transition' : '') +
1201
- snapshot.isDragging ? ' dragging' : '') + (subTab.isFixed ? ' fixed' : ''),
1202
- style: getItemStyle(showSubTabs || show, subprovided.draggableProps.style, width)
1203
- // title={subTab.name}
1204
- ,
1205
- exact: false,
1206
- onClick: function onClick() {
1207
- return handleTabClick({
1208
- tab: subTab,
1209
- parentId: tab.id,
1210
- isSubTab: true
1211
- });
1212
- }
1213
- // key={subIndex}
1214
- ,
1215
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(TabContentWrapper, {
1216
- tab: subTab,
1217
- tabTitle: title,
1218
- isActive: isSubTabActive,
1219
- index: subIndex,
1220
- handleTabClose: handleTabClose,
1221
- isSubTab: true,
1222
- SITE_PREFIX: SITE_PREFIX,
1223
- parentIndex: index,
1224
- setShowTooltip: setShowTooltip
1225
- })
1226
- }))
1227
- });
1228
- }
1229
- }, subIndex);
1152
+ index: subIndex
1153
+ }, function (subprovided, snapshot) {
1154
+ return /*#__PURE__*/_react["default"].createElement(_reactHoverText["default"], {
1155
+ content: title,
1156
+ delay: 500,
1157
+ followCursor: true,
1158
+ show: showTooltip,
1159
+ placement: "bottom",
1160
+ stylingOptions: tooltipStyles
1161
+ }, /*#__PURE__*/_react["default"].createElement(_reactRouterDom.NavLink, _extends({}, subprovided.draggableProps, subprovided.dragHandleProps, {
1162
+ ref: subprovided.innerRef,
1163
+ to: subTabUrl,
1164
+ id: "tab-".concat(tab.id, "-") + subTab.id.toString().replace('/', '-'),
1165
+ className: "tab sub-tab" + (show ? ' show' : '') + (
1166
+ // (isTabClosing ? ' slide-out' : '') +
1167
+ // (isTabOpening ? ' fade-in' : '') +
1168
+ expandedTabID && subTab.width && (0, _Utils.compareDecimals)(subTab.width, width) === -1 ? ' fade-at-end' : '') + (
1169
+ // (closingUnexpandedSubTab || openingUnexpandedSubTab ? ' no-transition' : '') +
1170
+ snapshot.isDragging ? ' dragging' : '') + (subTab.isFixed ? ' fixed' : ''),
1171
+ style: getItemStyle(showSubTabs || show, subprovided.draggableProps.style, width)
1172
+ // title={subTab.name}
1173
+ ,
1174
+ exact: false,
1175
+ onClick: function onClick() {
1176
+ return handleTabClick({
1177
+ tab: subTab,
1178
+ parentId: tab.id,
1179
+ isSubTab: true
1180
+ });
1181
+ }
1182
+ // key={subIndex}
1183
+ }), /*#__PURE__*/_react["default"].createElement(TabContentWrapper, {
1184
+ tab: subTab,
1185
+ tabTitle: title,
1186
+ isActive: isSubTabActive,
1187
+ index: subIndex,
1188
+ handleTabClose: handleTabClose,
1189
+ isSubTab: true,
1190
+ SITE_PREFIX: SITE_PREFIX,
1191
+ parentIndex: index,
1192
+ setShowTooltip: setShowTooltip
1193
+ })));
1194
+ });
1230
1195
  };
1231
1196
  var _default = exports["default"] = SuperTabs;