tenjin-ui-kit 0.2.125 → 0.2.126
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.
|
@@ -29,8 +29,9 @@ function BreadCrumbs(props) {
|
|
|
29
29
|
var navigate = (0, _reactRouterDom.useNavigate)();
|
|
30
30
|
// const windowSm = useMediaQuery("(max-width:960px)");
|
|
31
31
|
|
|
32
|
-
var crumbInfo = props.crumbInfo
|
|
33
|
-
|
|
32
|
+
var crumbInfo = props.crumbInfo,
|
|
33
|
+
maxItems = props.maxItems;
|
|
34
|
+
var displayCrumbs = maxItems ? crumbInfo.slice(-maxItems) : crumbInfo;
|
|
34
35
|
var _useState = (0, React.useState)(false),
|
|
35
36
|
_useState2 = _slicedToArray(_useState, 2),
|
|
36
37
|
menuOpen = _useState2[0],
|
|
@@ -70,7 +71,7 @@ function BreadCrumbs(props) {
|
|
|
70
71
|
fontSize: "small"
|
|
71
72
|
}),
|
|
72
73
|
"aria-label": "breadcrumb"
|
|
73
|
-
}, crumbInfo.length >
|
|
74
|
+
}, crumbInfo.length > maxItems && /*#__PURE__*/React.createElement("div", {
|
|
74
75
|
onClick: function onClick(e) {
|
|
75
76
|
return handleClick(e, crumbInfo[0]);
|
|
76
77
|
},
|
|
@@ -92,7 +93,7 @@ function BreadCrumbs(props) {
|
|
|
92
93
|
title: (_crumbInfo$3 = crumbInfo[0]) === null || _crumbInfo$3 === void 0 ? void 0 : _crumbInfo$3.title,
|
|
93
94
|
arrow: true,
|
|
94
95
|
placement: "top"
|
|
95
|
-
}, /*#__PURE__*/React.createElement("span", null, ((_crumbInfo$4 = crumbInfo[0]) === null || _crumbInfo$4 === void 0 ? void 0 : (_crumbInfo$4$title = _crumbInfo$4.title) === null || _crumbInfo$4$title === void 0 ? void 0 : _crumbInfo$4$title.slice(0, 20)) + "...")) : /*#__PURE__*/React.createElement(_text.default, null, (_crumbInfo$5 = crumbInfo[0]) === null || _crumbInfo$5 === void 0 ? void 0 : _crumbInfo$5.title)), crumbInfo.length >
|
|
96
|
+
}, /*#__PURE__*/React.createElement("span", null, ((_crumbInfo$4 = crumbInfo[0]) === null || _crumbInfo$4 === void 0 ? void 0 : (_crumbInfo$4$title = _crumbInfo$4.title) === null || _crumbInfo$4$title === void 0 ? void 0 : _crumbInfo$4$title.slice(0, 20)) + "...")) : /*#__PURE__*/React.createElement(_text.default, null, (_crumbInfo$5 = crumbInfo[0]) === null || _crumbInfo$5 === void 0 ? void 0 : _crumbInfo$5.title)), crumbInfo.length > maxItems && crumbInfo.length - 1 !== maxItems && /*#__PURE__*/React.createElement(_button.default, {
|
|
96
97
|
color: "inherit",
|
|
97
98
|
variant: "text",
|
|
98
99
|
onClick: handleMenuClick,
|
|
@@ -137,7 +138,7 @@ function BreadCrumbs(props) {
|
|
|
137
138
|
minWidth: "200px",
|
|
138
139
|
maxHeight: "220px"
|
|
139
140
|
}
|
|
140
|
-
}, crumbInfo.slice(1, crumbInfo.length -
|
|
141
|
+
}, crumbInfo.slice(1, crumbInfo.length - maxItems).map(function (breadcrumb, index) {
|
|
141
142
|
var _ref;
|
|
142
143
|
return /*#__PURE__*/React.createElement(_material.MenuItem, {
|
|
143
144
|
key: index,
|
package/dist/package.json
CHANGED