@ballistix.digital/react-components 0.4.44 → 0.4.45
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/index.esm.js +10 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +10 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -17452,7 +17452,16 @@ var List$1 = function (props) {
|
|
|
17452
17452
|
setActive && setActive(tab === null || tab === void 0 ? void 0 : tab.props.accessor);
|
|
17453
17453
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
17454
17454
|
}, []);
|
|
17455
|
-
|
|
17455
|
+
var handleCalculateActiveAccessor = function (items) {
|
|
17456
|
+
var _a;
|
|
17457
|
+
var result = active;
|
|
17458
|
+
var currentItem = (_a = Children.map(children, function (child) { return (__assign({}, child.props)); })) === null || _a === void 0 ? void 0 : _a.find(function (tab) { return tab === null || tab === void 0 ? void 0 : tab.isCurrent; });
|
|
17459
|
+
if (currentItem === null || currentItem === void 0 ? void 0 : currentItem.href) {
|
|
17460
|
+
result = currentItem === null || currentItem === void 0 ? void 0 : currentItem.accessor;
|
|
17461
|
+
}
|
|
17462
|
+
return result;
|
|
17463
|
+
};
|
|
17464
|
+
return (jsxs("div", __assign({ className: styles.list.container }, { children: [jsxs("div", __assign({ className: styles.list.head }, { children: [jsx("label", __assign({ htmlFor: name, className: styles.list.label }, { children: "Select a tab" })), jsx("select", __assign({ id: name, name: name, value: handleCalculateActiveAccessor(), className: styles.list.select, onChange: handleChangeSelect }, { children: Children.map(children, function (child) {
|
|
17456
17465
|
var _a;
|
|
17457
17466
|
return (jsx("option", __assign({ value: child.props.accessor }, { children: child.props.children }), (_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.accessor));
|
|
17458
17467
|
}) }))] })), jsx("div", __assign({ className: styles.list.body }, { children: jsx("nav", __assign({ className: styles.list.navigation }, { children: children })) }))] })));
|