@nulogy/components 8.1.1 → 8.1.2

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/main.js CHANGED
@@ -26090,38 +26090,39 @@
26090
26090
  children = _this$props.children,
26091
26091
  onTabClick = _this$props.onTabClick;
26092
26092
  var selectedIndex = this.getSelectedIndex();
26093
- return React__default['default'].Children.map(children, function (tab, index) {
26094
- if (tab) {
26095
- return /*#__PURE__*/React__default['default'].cloneElement(tab, {
26096
- onClick: function onClick(e) {
26097
- var _a, _b;
26098
-
26099
- setFocusToTab(index);
26100
-
26101
- if ((_a = tab === null || tab === void 0 ? void 0 : tab.props) === null || _a === void 0 ? void 0 : _a.onClick) {
26102
- (_b = tab === null || tab === void 0 ? void 0 : tab.props) === null || _b === void 0 ? void 0 : _b.onClick(e);
26103
- }
26093
+ var tabs = React__default['default'].Children.toArray(children);
26094
+ return tabs.filter(function (tab) {
26095
+ return Boolean(tab);
26096
+ }).map(function (tab, index) {
26097
+ return /*#__PURE__*/React__default['default'].cloneElement(tab, {
26098
+ onClick: function onClick(e) {
26099
+ var _a, _b;
26100
+
26101
+ setFocusToTab(index);
26102
+
26103
+ if ((_a = tab === null || tab === void 0 ? void 0 : tab.props) === null || _a === void 0 ? void 0 : _a.onClick) {
26104
+ (_b = tab === null || tab === void 0 ? void 0 : tab.props) === null || _b === void 0 ? void 0 : _b.onClick(e);
26105
+ }
26104
26106
 
26105
- if (onTabClick) {
26106
- onTabClick(e, index);
26107
- } else {
26108
- _this2.handleTabClick(index);
26109
- }
26110
- },
26111
- onFocus: function onFocus(e) {
26112
- e.stopPropagation();
26113
- },
26114
- onKeyDown: handleArrowNavigation,
26115
- index: index,
26116
- tabIndex: index === focusedIndex ? 0 : -1,
26117
- selected: index === selectedIndex,
26118
- "aria-selected": index === selectedIndex,
26119
- fullWidth: fitted,
26120
- ref: function ref(_ref) {
26121
- _this2.tabRefs[index] = _ref;
26107
+ if (onTabClick) {
26108
+ onTabClick(e, index);
26109
+ } else {
26110
+ _this2.handleTabClick(index);
26122
26111
  }
26123
- });
26124
- }
26112
+ },
26113
+ onFocus: function onFocus(e) {
26114
+ e.stopPropagation();
26115
+ },
26116
+ onKeyDown: handleArrowNavigation,
26117
+ index: index,
26118
+ tabIndex: index === focusedIndex ? 0 : -1,
26119
+ selected: index === selectedIndex,
26120
+ "aria-selected": index === selectedIndex,
26121
+ fullWidth: fitted,
26122
+ ref: function ref(_ref) {
26123
+ _this2.tabRefs[index] = _ref;
26124
+ }
26125
+ });
26125
26126
  });
26126
26127
  };
26127
26128
 
@@ -26130,7 +26131,10 @@
26130
26131
  children = _this$props2.children,
26131
26132
  renderTabContentOnlyWhenSelected = _this$props2.renderTabContentOnlyWhenSelected;
26132
26133
  var selectedIndex = this.getSelectedIndex();
26133
- var tabContent = React__default['default'].Children.map(children, function (tab, index) {
26134
+ var tabs = React__default['default'].Children.toArray(children);
26135
+ var tabContent = tabs.filter(function (tab) {
26136
+ return Boolean(tab);
26137
+ }).map(function (tab, index) {
26134
26138
  var _a;
26135
26139
 
26136
26140
  var selected = index === selectedIndex;
@@ -26064,38 +26064,39 @@ var Tabs = /*#__PURE__*/function (_React$Component) {
26064
26064
  children = _this$props.children,
26065
26065
  onTabClick = _this$props.onTabClick;
26066
26066
  var selectedIndex = this.getSelectedIndex();
26067
- return React__default.Children.map(children, function (tab, index) {
26068
- if (tab) {
26069
- return /*#__PURE__*/React__default.cloneElement(tab, {
26070
- onClick: function onClick(e) {
26071
- var _a, _b;
26072
-
26073
- setFocusToTab(index);
26074
-
26075
- if ((_a = tab === null || tab === void 0 ? void 0 : tab.props) === null || _a === void 0 ? void 0 : _a.onClick) {
26076
- (_b = tab === null || tab === void 0 ? void 0 : tab.props) === null || _b === void 0 ? void 0 : _b.onClick(e);
26077
- }
26067
+ var tabs = React__default.Children.toArray(children);
26068
+ return tabs.filter(function (tab) {
26069
+ return Boolean(tab);
26070
+ }).map(function (tab, index) {
26071
+ return /*#__PURE__*/React__default.cloneElement(tab, {
26072
+ onClick: function onClick(e) {
26073
+ var _a, _b;
26074
+
26075
+ setFocusToTab(index);
26076
+
26077
+ if ((_a = tab === null || tab === void 0 ? void 0 : tab.props) === null || _a === void 0 ? void 0 : _a.onClick) {
26078
+ (_b = tab === null || tab === void 0 ? void 0 : tab.props) === null || _b === void 0 ? void 0 : _b.onClick(e);
26079
+ }
26078
26080
 
26079
- if (onTabClick) {
26080
- onTabClick(e, index);
26081
- } else {
26082
- _this2.handleTabClick(index);
26083
- }
26084
- },
26085
- onFocus: function onFocus(e) {
26086
- e.stopPropagation();
26087
- },
26088
- onKeyDown: handleArrowNavigation,
26089
- index: index,
26090
- tabIndex: index === focusedIndex ? 0 : -1,
26091
- selected: index === selectedIndex,
26092
- "aria-selected": index === selectedIndex,
26093
- fullWidth: fitted,
26094
- ref: function ref(_ref) {
26095
- _this2.tabRefs[index] = _ref;
26081
+ if (onTabClick) {
26082
+ onTabClick(e, index);
26083
+ } else {
26084
+ _this2.handleTabClick(index);
26096
26085
  }
26097
- });
26098
- }
26086
+ },
26087
+ onFocus: function onFocus(e) {
26088
+ e.stopPropagation();
26089
+ },
26090
+ onKeyDown: handleArrowNavigation,
26091
+ index: index,
26092
+ tabIndex: index === focusedIndex ? 0 : -1,
26093
+ selected: index === selectedIndex,
26094
+ "aria-selected": index === selectedIndex,
26095
+ fullWidth: fitted,
26096
+ ref: function ref(_ref) {
26097
+ _this2.tabRefs[index] = _ref;
26098
+ }
26099
+ });
26099
26100
  });
26100
26101
  };
26101
26102
 
@@ -26104,7 +26105,10 @@ var Tabs = /*#__PURE__*/function (_React$Component) {
26104
26105
  children = _this$props2.children,
26105
26106
  renderTabContentOnlyWhenSelected = _this$props2.renderTabContentOnlyWhenSelected;
26106
26107
  var selectedIndex = this.getSelectedIndex();
26107
- var tabContent = React__default.Children.map(children, function (tab, index) {
26108
+ var tabs = React__default.Children.toArray(children);
26109
+ var tabContent = tabs.filter(function (tab) {
26110
+ return Boolean(tab);
26111
+ }).map(function (tab, index) {
26108
26112
  var _a;
26109
26113
 
26110
26114
  var selected = index === selectedIndex;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nulogy/components",
3
- "version": "8.1.1",
3
+ "version": "8.1.2",
4
4
  "description": "Component library for the Nulogy Design System - http://nulogy.design",
5
5
  "private": false,
6
6
  "publishConfig": {