@dreamcommerce/aurora 2.1.33-3 → 2.1.33-5
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.
|
@@ -14,14 +14,14 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
14
14
|
const TabsPanelList = ({ children }) => {
|
|
15
15
|
const { activeId } = React.useContext(context.TabsContext);
|
|
16
16
|
const arrayOfChildren = React.Children.toArray(children);
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
if (!arrayOfChildren.length)
|
|
18
|
+
return null;
|
|
19
|
+
return (React__default['default'].createElement("div", { className: main_module['default'][css_classes['default'].tabsPanelList] }, React__default['default'].Children.map(arrayOfChildren, (child) => {
|
|
20
|
+
if (child.type.name !== 'TabsPanel') {
|
|
21
|
+
throw new Error('The child components should be of type TabsPanel');
|
|
22
|
+
}
|
|
23
|
+
return child.props.id === activeId ? React__default['default'].createElement(React__default['default'].Fragment, null, child) : null;
|
|
24
|
+
})));
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
exports.TabsPanelList = TabsPanelList;
|
|
@@ -6,14 +6,14 @@ import cssClasses from '../../../css/tabs/main.module.less.js';
|
|
|
6
6
|
const TabsPanelList = ({ children }) => {
|
|
7
7
|
const { activeId } = useContext(TabsContext);
|
|
8
8
|
const arrayOfChildren = Children.toArray(children);
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
if (!arrayOfChildren.length)
|
|
10
|
+
return null;
|
|
11
|
+
return (React.createElement("div", { className: cssClasses[CSS_CLASSES.tabsPanelList] }, React.Children.map(arrayOfChildren, (child) => {
|
|
12
|
+
if (child.type.name !== 'TabsPanel') {
|
|
13
|
+
throw new Error('The child components should be of type TabsPanel');
|
|
14
|
+
}
|
|
15
|
+
return child.props.id === activeId ? React.createElement(React.Fragment, null, child) : null;
|
|
16
|
+
})));
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
export default TabsPanelList;
|