@banyan_cloud/roots 1.0.154 → 1.0.156
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/cjs/index.js +8 -6
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +8 -6
- package/dist/esm/index.js.map +1 -1
- package/dist/index.js +8 -6
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -10612,6 +10612,7 @@ Link.defaultProps = _objectSpread2(_objectSpread2({}, Text.defaultProps), {}, {
|
|
|
10612
10612
|
});
|
|
10613
10613
|
|
|
10614
10614
|
var BreadCrumbs = function BreadCrumbs(props) {
|
|
10615
|
+
var _crumbs$;
|
|
10615
10616
|
var crumbs = props.crumbs,
|
|
10616
10617
|
maxItems = props.maxItems,
|
|
10617
10618
|
itemsBeforeCollapse = props.itemsBeforeCollapse,
|
|
@@ -10624,15 +10625,16 @@ var BreadCrumbs = function BreadCrumbs(props) {
|
|
|
10624
10625
|
_useState2 = _slicedToArray(_useState, 2),
|
|
10625
10626
|
expand = _useState2[0],
|
|
10626
10627
|
setExpand = _useState2[1];
|
|
10627
|
-
var href =
|
|
10628
|
-
var
|
|
10628
|
+
var href = "/".concat(crumbs === null || crumbs === void 0 || (_crumbs$ = crumbs[0]) === null || _crumbs$ === void 0 ? void 0 : _crumbs$.path);
|
|
10629
|
+
var crumbsList = crumbs === null || crumbs === void 0 ? void 0 : crumbs.slice(1);
|
|
10630
|
+
var CrumbsDOM = crumbsList !== null && crumbsList.map(function (crumb, index) {
|
|
10629
10631
|
var title = crumb.title,
|
|
10630
10632
|
value = crumb.value,
|
|
10631
10633
|
path = crumb.path,
|
|
10632
10634
|
search = crumb.search,
|
|
10633
10635
|
icon = crumb.icon;
|
|
10634
|
-
var active = index ===
|
|
10635
|
-
var showSeperator = index <
|
|
10636
|
+
var active = index === crumbsList.length - 1;
|
|
10637
|
+
var showSeperator = index < crumbsList.length - 1;
|
|
10636
10638
|
href += "/".concat(path);
|
|
10637
10639
|
return /*#__PURE__*/jsxRuntime.jsxs(React.Fragment, {
|
|
10638
10640
|
children: [/*#__PURE__*/jsxRuntime.jsxs(Link, {
|
|
@@ -10659,7 +10661,7 @@ var BreadCrumbs = function BreadCrumbs(props) {
|
|
|
10659
10661
|
})]
|
|
10660
10662
|
}, path);
|
|
10661
10663
|
});
|
|
10662
|
-
if (
|
|
10664
|
+
if (crumbsList !== null && CrumbsDOM.length > maxItems && !expand) {
|
|
10663
10665
|
CrumbsDOM.splice(itemsBeforeCollapse, CrumbsDOM.length - (itemsAfterCollapse + itemsBeforeCollapse), /*#__PURE__*/jsxRuntime.jsxs(React.Fragment, {
|
|
10664
10666
|
children: [/*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
10665
10667
|
className: modules_651f50a9.expand,
|
|
@@ -10674,7 +10676,7 @@ var BreadCrumbs = function BreadCrumbs(props) {
|
|
|
10674
10676
|
})]
|
|
10675
10677
|
}, 'expand'));
|
|
10676
10678
|
}
|
|
10677
|
-
return (
|
|
10679
|
+
return (crumbsList === null || crumbsList === void 0 ? void 0 : crumbsList.length) > 1 && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
10678
10680
|
className: classes(modules_651f50a9.root, modules_651f50a9["theme-".concat(theme)]),
|
|
10679
10681
|
children: [/*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
10680
10682
|
size: "auto",
|