@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/cjs/Sidebar.js
CHANGED
|
@@ -1100,7 +1100,7 @@ var Segment = function Segment(_ref) {
|
|
|
1100
1100
|
}));
|
|
1101
1101
|
};
|
|
1102
1102
|
|
|
1103
|
-
var _excluded$1 = ["data-cy", "to", "label", "type", "count", "columns", "filters", "id"];
|
|
1103
|
+
var _excluded$1 = ["data-cy", "to", "label", "type", "count", "columns", "filters", "id", "isCountsLoading"];
|
|
1104
1104
|
var SubLink = function SubLink(_ref) {
|
|
1105
1105
|
var dataCy = _ref["data-cy"],
|
|
1106
1106
|
to = _ref.to,
|
|
@@ -1111,6 +1111,7 @@ var SubLink = function SubLink(_ref) {
|
|
|
1111
1111
|
columns = _ref.columns,
|
|
1112
1112
|
filters = _ref.filters,
|
|
1113
1113
|
id = _ref.id,
|
|
1114
|
+
isCountsLoading = _ref.isCountsLoading,
|
|
1114
1115
|
otherProps = _objectWithoutProperties(_ref, _excluded$1);
|
|
1115
1116
|
var segment = {
|
|
1116
1117
|
id: id,
|
|
@@ -1126,6 +1127,9 @@ var SubLink = function SubLink(_ref) {
|
|
|
1126
1127
|
});
|
|
1127
1128
|
}
|
|
1128
1129
|
var dataCyPrefix = dataCy || neetoCist.hyphenate(label);
|
|
1130
|
+
var renderCount = function renderCount(count) {
|
|
1131
|
+
return count > 999 ? "999+" : count;
|
|
1132
|
+
};
|
|
1129
1133
|
return /*#__PURE__*/React__default["default"].createElement(CheckPointNavLinks, _extends({
|
|
1130
1134
|
to: to,
|
|
1131
1135
|
activeClassName: "active",
|
|
@@ -1144,15 +1148,17 @@ var SubLink = function SubLink(_ref) {
|
|
|
1144
1148
|
component: "span",
|
|
1145
1149
|
"data-cy": "".concat(dataCyPrefix, "-sub-link-count"),
|
|
1146
1150
|
style: "body2"
|
|
1147
|
-
},
|
|
1151
|
+
}, isCountsLoading ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1152
|
+
className: "neeto-ui-rounded neeto-ui-bg-gray-200 h-4 w-4 animate-pulse"
|
|
1153
|
+
}) : renderCount(count)));
|
|
1148
1154
|
};
|
|
1149
1155
|
|
|
1150
|
-
var _excluded = ["label", "to", "icon", "items"];
|
|
1156
|
+
var _excluded = ["label", "to", "icon", "items", "isCountsLoading"];
|
|
1151
1157
|
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; }
|
|
1152
1158
|
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; }
|
|
1153
1159
|
var Links = function Links(_ref) {
|
|
1154
1160
|
var navLinks = _ref.navLinks,
|
|
1155
|
-
|
|
1161
|
+
isCountsLoadingDeprecated = _ref.isCountsLoading;
|
|
1156
1162
|
var _useTranslation = reactI18next.useTranslation(),
|
|
1157
1163
|
t = _useTranslation.t;
|
|
1158
1164
|
var location = reactRouterDom.useLocation();
|
|
@@ -1183,13 +1189,15 @@ var Links = function Links(_ref) {
|
|
|
1183
1189
|
to = _ref3.to,
|
|
1184
1190
|
icon = _ref3.icon,
|
|
1185
1191
|
items = _ref3.items,
|
|
1192
|
+
_ref3$isCountsLoading = _ref3.isCountsLoading,
|
|
1193
|
+
isCountsLoading = _ref3$isCountsLoading === void 0 ? false : _ref3$isCountsLoading,
|
|
1186
1194
|
otherProps = _objectWithoutProperties(_ref3, _excluded);
|
|
1187
1195
|
var IconSVG = icon;
|
|
1188
1196
|
var url = new URL(to, window.location.href);
|
|
1189
1197
|
var isActive = function isActive() {
|
|
1190
1198
|
return ramda.is(Function, otherProps.isActive) ? otherProps.isActive() : location.pathname.startsWith(url.pathname);
|
|
1191
1199
|
};
|
|
1192
|
-
var isMenuExpanded = isActive() && isActiveLinkExpanded && !
|
|
1200
|
+
var isMenuExpanded = isActive() && isActiveLinkExpanded && !isCountsLoadingDeprecated;
|
|
1193
1201
|
var firstSegmentIndex = neetoCist._findIndexBy({
|
|
1194
1202
|
type: SUB_LINK_TYPES.SEGMENT
|
|
1195
1203
|
}, items);
|
|
@@ -1229,7 +1237,9 @@ var Links = function Links(_ref) {
|
|
|
1229
1237
|
className: "neeto-molecules-sidebar-segments-header neeto-ui-text-transform-capitalize neeto-ui-text-gray-600 py-2 uppercase",
|
|
1230
1238
|
style: "body3",
|
|
1231
1239
|
weight: "semibold"
|
|
1232
|
-
}, t("neetoMolecules.sidebar.segments.segment", constants.PLURAL)), /*#__PURE__*/React__default["default"].createElement(SubLink, _extends({}, subItem, {
|
|
1240
|
+
}, t("neetoMolecules.sidebar.segments.segment", constants.PLURAL)), /*#__PURE__*/React__default["default"].createElement(SubLink, _extends({}, _objectSpread(_objectSpread({}, subItem), {}, {
|
|
1241
|
+
isCountsLoading: isCountsLoading
|
|
1242
|
+
}), {
|
|
1233
1243
|
columns: otherProps.columns
|
|
1234
1244
|
})));
|
|
1235
1245
|
})));
|