@patternfly/react-core 4.188.1 → 4.189.0
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/CHANGELOG.md +11 -0
- package/dist/esm/components/Tabs/Tabs.d.ts +5 -2
- package/dist/esm/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/esm/components/Tabs/Tabs.js +3 -3
- package/dist/esm/components/Tabs/Tabs.js.map +1 -1
- package/dist/js/components/Tabs/Tabs.d.ts +5 -2
- package/dist/js/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/js/components/Tabs/Tabs.js +3 -3
- package/dist/js/components/Tabs/Tabs.js.map +1 -1
- package/dist/umd/react-core.js +3 -3
- package/dist/umd/react-core.min.css +404 -404
- package/dist/umd/react-core.min.js +1 -1
- package/package.json +5 -5
- package/src/components/Tabs/Tabs.tsx +9 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.189.0",
|
|
4
4
|
"description": "This library provides a set of common React components for use with the PatternFly reference implementation.",
|
|
5
5
|
"main": "dist/js/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
"generate": "node scripts/copyStyles.js"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@patternfly/react-icons": "^4.
|
|
38
|
-
"@patternfly/react-styles": "^4.
|
|
39
|
-
"@patternfly/react-tokens": "^4.
|
|
37
|
+
"@patternfly/react-icons": "^4.40.0",
|
|
38
|
+
"@patternfly/react-styles": "^4.39.0",
|
|
39
|
+
"@patternfly/react-tokens": "^4.41.0",
|
|
40
40
|
"focus-trap": "6.2.2",
|
|
41
41
|
"react-dropzone": "9.0.0",
|
|
42
42
|
"tippy.js": "5.1.2",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"react": "^16.8.0 || ^17.0.0",
|
|
61
61
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "232be76ce3bb9ee8af7b86f3b0ae3629eb65a761"
|
|
64
64
|
}
|
|
@@ -18,9 +18,12 @@ export enum TabsComponent {
|
|
|
18
18
|
nav = 'nav'
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
type TabElement = React.ReactElement<TabProps, React.JSXElementConstructor<TabProps>>;
|
|
22
|
+
type TabsChild = TabElement | boolean | null | undefined;
|
|
23
|
+
|
|
21
24
|
export interface TabsProps extends Omit<React.HTMLProps<HTMLElement | HTMLDivElement>, 'onSelect'>, OUIAProps {
|
|
22
|
-
/** Content rendered inside the tabs component.
|
|
23
|
-
children:
|
|
25
|
+
/** Content rendered inside the tabs component. Only `Tab` components or expressions resulting in a falsy value are allowed here. */
|
|
26
|
+
children: TabsChild | TabsChild[];
|
|
24
27
|
/** Additional classes added to the tabs */
|
|
25
28
|
className?: string;
|
|
26
29
|
/** Tabs background color variant */
|
|
@@ -163,8 +166,8 @@ export class Tabs extends React.Component<TabsProps, TabsState> {
|
|
|
163
166
|
// process any tab content sections outside of the component
|
|
164
167
|
if (tabContentRef) {
|
|
165
168
|
React.Children.toArray(this.props.children)
|
|
166
|
-
.
|
|
167
|
-
.filter(
|
|
169
|
+
.filter((child): child is TabElement => React.isValidElement(child))
|
|
170
|
+
.filter(({ props }) => props.tabContentRef && props.tabContentRef.current)
|
|
168
171
|
.forEach(child => (child.props.tabContentRef.current.hidden = true));
|
|
169
172
|
// most recently selected tabContent
|
|
170
173
|
if (tabContentRef.current) {
|
|
@@ -308,8 +311,8 @@ export class Tabs extends React.Component<TabsProps, TabsState> {
|
|
|
308
311
|
uncontrolledActiveKey,
|
|
309
312
|
uncontrolledIsExpandedLocal
|
|
310
313
|
} = this.state;
|
|
311
|
-
const filteredChildren =
|
|
312
|
-
.filter(
|
|
314
|
+
const filteredChildren = React.Children.toArray(children)
|
|
315
|
+
.filter((child): child is TabElement => React.isValidElement(child))
|
|
313
316
|
.filter(child => !child.props.isHidden);
|
|
314
317
|
|
|
315
318
|
const uniqueId = id || getUniqueId();
|