@bydata/react-supertabs 1.1.5 → 1.1.6
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/ClickOutsideListener.js +3 -5
- package/dist/NotAvailable.js +11 -14
- package/dist/SuperLink.js +4 -5
- package/dist/SuperTabs.js +419 -454
- package/dist/TabContext.js +5 -6
- package/dist/TabList.js +100 -113
- package/dist/TabStack.js +41 -43
- package/package.json +6 -1
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__*/
|
|
687
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
688
688
|
className: "super-tabs-wrapper",
|
|
689
|
-
ref: superTabsWrapperElemRef
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
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
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
})
|
|
723
|
-
}
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
if (
|
|
728
|
-
|
|
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
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
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
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
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
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
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
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
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__*/(
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
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__*/
|
|
1148
|
+
return /*#__PURE__*/_react["default"].createElement(_superDnd.Draggable, {
|
|
1149
|
+
key: subIndex,
|
|
1181
1150
|
draggableId: String(subIndex),
|
|
1182
1151
|
isDragDisabled: !showSubTabs,
|
|
1183
|
-
index: subIndex
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
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;
|