@bigbinary/neeto-molecules 1.11.0 → 1.11.1
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/Sidebar.js +16 -6
- package/dist/Sidebar.js.map +1 -1
- package/dist/cjs/Sidebar.js +16 -6
- package/dist/cjs/Sidebar.js.map +1 -1
- package/package.json +1 -1
- package/types/Sidebar.d.ts +1 -0
package/dist/Sidebar.js
CHANGED
|
@@ -1070,7 +1070,7 @@ var Segment = function Segment(_ref) {
|
|
|
1070
1070
|
}));
|
|
1071
1071
|
};
|
|
1072
1072
|
|
|
1073
|
-
var _excluded$1 = ["data-cy", "to", "label", "type", "count", "columns", "filters", "id"];
|
|
1073
|
+
var _excluded$1 = ["data-cy", "to", "label", "type", "count", "columns", "filters", "id", "isCountsLoading"];
|
|
1074
1074
|
var SubLink = function SubLink(_ref) {
|
|
1075
1075
|
var dataCy = _ref["data-cy"],
|
|
1076
1076
|
to = _ref.to,
|
|
@@ -1081,6 +1081,7 @@ var SubLink = function SubLink(_ref) {
|
|
|
1081
1081
|
columns = _ref.columns,
|
|
1082
1082
|
filters = _ref.filters,
|
|
1083
1083
|
id = _ref.id,
|
|
1084
|
+
isCountsLoading = _ref.isCountsLoading,
|
|
1084
1085
|
otherProps = _objectWithoutProperties(_ref, _excluded$1);
|
|
1085
1086
|
var segment = {
|
|
1086
1087
|
id: id,
|
|
@@ -1096,6 +1097,9 @@ var SubLink = function SubLink(_ref) {
|
|
|
1096
1097
|
});
|
|
1097
1098
|
}
|
|
1098
1099
|
var dataCyPrefix = dataCy || hyphenate(label);
|
|
1100
|
+
var renderCount = function renderCount(count) {
|
|
1101
|
+
return count > 999 ? "999+" : count;
|
|
1102
|
+
};
|
|
1099
1103
|
return /*#__PURE__*/React.createElement(CheckPointNavLinks, _extends({
|
|
1100
1104
|
to: to,
|
|
1101
1105
|
activeClassName: "active",
|
|
@@ -1114,15 +1118,17 @@ var SubLink = function SubLink(_ref) {
|
|
|
1114
1118
|
component: "span",
|
|
1115
1119
|
"data-cy": "".concat(dataCyPrefix, "-sub-link-count"),
|
|
1116
1120
|
style: "body2"
|
|
1117
|
-
},
|
|
1121
|
+
}, isCountsLoading ? /*#__PURE__*/React.createElement("div", {
|
|
1122
|
+
className: "neeto-ui-rounded neeto-ui-bg-gray-200 h-4 w-4 animate-pulse"
|
|
1123
|
+
}) : renderCount(count)));
|
|
1118
1124
|
};
|
|
1119
1125
|
|
|
1120
|
-
var _excluded = ["label", "to", "icon", "items"];
|
|
1126
|
+
var _excluded = ["label", "to", "icon", "items", "isCountsLoading"];
|
|
1121
1127
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1122
1128
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1123
1129
|
var Links = function Links(_ref) {
|
|
1124
1130
|
var navLinks = _ref.navLinks,
|
|
1125
|
-
|
|
1131
|
+
isCountsLoadingDeprecated = _ref.isCountsLoading;
|
|
1126
1132
|
var _useTranslation = useTranslation(),
|
|
1127
1133
|
t = _useTranslation.t;
|
|
1128
1134
|
var location = useLocation();
|
|
@@ -1153,13 +1159,15 @@ var Links = function Links(_ref) {
|
|
|
1153
1159
|
to = _ref3.to,
|
|
1154
1160
|
icon = _ref3.icon,
|
|
1155
1161
|
items = _ref3.items,
|
|
1162
|
+
_ref3$isCountsLoading = _ref3.isCountsLoading,
|
|
1163
|
+
isCountsLoading = _ref3$isCountsLoading === void 0 ? false : _ref3$isCountsLoading,
|
|
1156
1164
|
otherProps = _objectWithoutProperties(_ref3, _excluded);
|
|
1157
1165
|
var IconSVG = icon;
|
|
1158
1166
|
var url = new URL(to, window.location.href);
|
|
1159
1167
|
var isActive = function isActive() {
|
|
1160
1168
|
return is(Function, otherProps.isActive) ? otherProps.isActive() : location.pathname.startsWith(url.pathname);
|
|
1161
1169
|
};
|
|
1162
|
-
var isMenuExpanded = isActive() && isActiveLinkExpanded && !
|
|
1170
|
+
var isMenuExpanded = isActive() && isActiveLinkExpanded && !isCountsLoadingDeprecated;
|
|
1163
1171
|
var firstSegmentIndex = _findIndexBy({
|
|
1164
1172
|
type: SUB_LINK_TYPES.SEGMENT
|
|
1165
1173
|
}, items);
|
|
@@ -1199,7 +1207,9 @@ var Links = function Links(_ref) {
|
|
|
1199
1207
|
className: "neeto-molecules-sidebar-segments-header neeto-ui-text-transform-capitalize neeto-ui-text-gray-600 py-2 uppercase",
|
|
1200
1208
|
style: "body3",
|
|
1201
1209
|
weight: "semibold"
|
|
1202
|
-
}, t("neetoMolecules.sidebar.segments.segment", PLURAL)), /*#__PURE__*/React.createElement(SubLink, _extends({}, subItem, {
|
|
1210
|
+
}, t("neetoMolecules.sidebar.segments.segment", PLURAL)), /*#__PURE__*/React.createElement(SubLink, _extends({}, _objectSpread(_objectSpread({}, subItem), {}, {
|
|
1211
|
+
isCountsLoading: isCountsLoading
|
|
1212
|
+
}), {
|
|
1203
1213
|
columns: otherProps.columns
|
|
1204
1214
|
})));
|
|
1205
1215
|
})));
|