@bydata/react-supertabs 1.1.0
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/README.md +257 -0
- package/dist/ClickOutsideListener.js +72 -0
- package/dist/Constants.js +20 -0
- package/dist/NotAvailable.js +29 -0
- package/dist/NotAvailable.scss +30 -0
- package/dist/Readme.md +258 -0
- package/dist/SuperLink.js +36 -0
- package/dist/SuperTabs.js +1196 -0
- package/dist/SuperTabs.scss +892 -0
- package/dist/TabContext.js +1895 -0
- package/dist/TabList.js +234 -0
- package/dist/TabList.scss +274 -0
- package/dist/TabStack.js +98 -0
- package/dist/Utils.js +336 -0
- package/dist/eventEmitter.js +116 -0
- package/dist/images/Icon-open-arrow-top.svg +3 -0
- package/dist/images/icon-chevron-right.svg +1 -0
- package/dist/images/icon-close-lite.svg +3 -0
- package/dist/images/icon-search.svg +10 -0
- package/dist/images/icon-stack.svg +6 -0
- package/dist/index.js +20 -0
- package/dist/usePrevious.js +37 -0
- package/package.json +33 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _reactRouterDom = require("react-router-dom");
|
|
8
|
+
var _TabContext = require("./TabContext");
|
|
9
|
+
var SuperLink = function SuperLink(_ref) {
|
|
10
|
+
var children = _ref.children,
|
|
11
|
+
tab = _ref.tab,
|
|
12
|
+
_ref$isSubTab = _ref.isSubTab,
|
|
13
|
+
isSubTab = _ref$isSubTab === void 0 ? true : _ref$isSubTab,
|
|
14
|
+
_ref$isExternal = _ref.isExternal,
|
|
15
|
+
isExternal = _ref$isExternal === void 0 ? false : _ref$isExternal;
|
|
16
|
+
var _useTabContext = (0, _TabContext.useTabContext)(),
|
|
17
|
+
openSuperTabOnRowClick = _useTabContext.openSuperTabOnRowClick;
|
|
18
|
+
var handleSuperLinkClick = function handleSuperLinkClick(e) {
|
|
19
|
+
if (isExternal) {
|
|
20
|
+
e.preventDefault();
|
|
21
|
+
window.open(tab.url, '_blank'); // open link in new tab if it is external
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
openSuperTabOnRowClick({
|
|
25
|
+
tab: tab,
|
|
26
|
+
isSubTab: isSubTab
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
return /*#__PURE__*/React.createElement(_reactRouterDom.NavLink, {
|
|
30
|
+
to: tab.url,
|
|
31
|
+
title: tab.title || '',
|
|
32
|
+
onClick: handleSuperLinkClick
|
|
33
|
+
// exact
|
|
34
|
+
}, children);
|
|
35
|
+
};
|
|
36
|
+
var _default = exports["default"] = SuperLink;
|