@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.js
CHANGED
|
@@ -17462,7 +17462,16 @@ var List$1 = function (props) {
|
|
|
17462
17462
|
setActive && setActive(tab === null || tab === void 0 ? void 0 : tab.props.accessor);
|
|
17463
17463
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
17464
17464
|
}, []);
|
|
17465
|
-
|
|
17465
|
+
var handleCalculateActiveAccessor = function (items) {
|
|
17466
|
+
var _a;
|
|
17467
|
+
var result = active;
|
|
17468
|
+
var currentItem = (_a = n.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; });
|
|
17469
|
+
if (currentItem === null || currentItem === void 0 ? void 0 : currentItem.href) {
|
|
17470
|
+
result = currentItem === null || currentItem === void 0 ? void 0 : currentItem.accessor;
|
|
17471
|
+
}
|
|
17472
|
+
return result;
|
|
17473
|
+
};
|
|
17474
|
+
return (jsxRuntime.jsxs("div", __assign({ className: styles.list.container }, { children: [jsxRuntime.jsxs("div", __assign({ className: styles.list.head }, { children: [jsxRuntime.jsx("label", __assign({ htmlFor: name, className: styles.list.label }, { children: "Select a tab" })), jsxRuntime.jsx("select", __assign({ id: name, name: name, value: handleCalculateActiveAccessor(), className: styles.list.select, onChange: handleChangeSelect }, { children: n.Children.map(children, function (child) {
|
|
17466
17475
|
var _a;
|
|
17467
17476
|
return (jsxRuntime.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));
|
|
17468
17477
|
}) }))] })), jsxRuntime.jsx("div", __assign({ className: styles.list.body }, { children: jsxRuntime.jsx("nav", __assign({ className: styles.list.navigation }, { children: children })) }))] })));
|