tenjin-ui-kit 0.2.138 → 0.2.140
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.
|
@@ -30,7 +30,8 @@ function BreadCrumbs(props) {
|
|
|
30
30
|
// const windowSm = useMediaQuery("(max-width:960px)");
|
|
31
31
|
|
|
32
32
|
var crumbInfo = props.crumbInfo,
|
|
33
|
-
maxItems = props.maxItems
|
|
33
|
+
maxItems = props.maxItems,
|
|
34
|
+
serverSide = props.serverSide;
|
|
34
35
|
var displayCrumbs = maxItems ? crumbInfo.slice(-maxItems) : crumbInfo;
|
|
35
36
|
var _useState = (0, React.useState)(false),
|
|
36
37
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -49,14 +50,22 @@ function BreadCrumbs(props) {
|
|
|
49
50
|
if (item.onClick) {
|
|
50
51
|
item.onClick(item.data);
|
|
51
52
|
} else if (item.link !== undefined) {
|
|
52
|
-
|
|
53
|
+
if (item.serverSide) {
|
|
54
|
+
window.location = item.link;
|
|
55
|
+
} else {
|
|
56
|
+
navigate(item.link);
|
|
57
|
+
}
|
|
53
58
|
}
|
|
54
59
|
}
|
|
55
60
|
var handleMenuClose = function handleMenuClose(event, item) {
|
|
56
61
|
if (item && item.onClick) {
|
|
57
62
|
item.onClick(item.data);
|
|
58
63
|
} else if (item && item.link !== undefined) {
|
|
59
|
-
|
|
64
|
+
if (item.serverSide) {
|
|
65
|
+
window.location = item.link;
|
|
66
|
+
} else {
|
|
67
|
+
navigate(item.link);
|
|
68
|
+
}
|
|
60
69
|
}
|
|
61
70
|
setMenuOpen(false);
|
|
62
71
|
};
|