@patternfly/react-core 4.192.10 → 4.192.14
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 +41 -0
- package/dist/esm/components/Tabs/Tabs.d.ts +2 -5
- 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 +2 -5
- 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.css +115 -115
- package/dist/umd/react-core.js +3 -3
- package/dist/umd/react-core.min.js +1 -1
- package/package.json +5 -5
- package/src/components/Tabs/Tabs.tsx +6 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "4.192.
|
|
3
|
+
"version": "4.192.14",
|
|
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.43.
|
|
38
|
-
"@patternfly/react-styles": "^4.42.
|
|
39
|
-
"@patternfly/react-tokens": "^4.44.
|
|
37
|
+
"@patternfly/react-icons": "^4.43.14",
|
|
38
|
+
"@patternfly/react-styles": "^4.42.14",
|
|
39
|
+
"@patternfly/react-tokens": "^4.44.14",
|
|
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": "0709d0fe96e6823efb78defc830f734c586b8eeb"
|
|
64
64
|
}
|
|
@@ -18,12 +18,9 @@ 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
|
-
|
|
24
21
|
export interface TabsProps extends Omit<React.HTMLProps<HTMLElement | HTMLDivElement>, 'onSelect'>, OUIAProps {
|
|
25
|
-
/** Content rendered inside the tabs component.
|
|
26
|
-
children:
|
|
22
|
+
/** Content rendered inside the tabs component. Must be React.ReactElement<TabProps>[] */
|
|
23
|
+
children: React.ReactNode;
|
|
27
24
|
/** Additional classes added to the tabs */
|
|
28
25
|
className?: string;
|
|
29
26
|
/** Tabs background color variant */
|
|
@@ -168,8 +165,8 @@ export class Tabs extends React.Component<TabsProps, TabsState> {
|
|
|
168
165
|
// process any tab content sections outside of the component
|
|
169
166
|
if (tabContentRef) {
|
|
170
167
|
React.Children.toArray(this.props.children)
|
|
171
|
-
.
|
|
172
|
-
.filter(
|
|
168
|
+
.map(child => child as React.ReactElement<TabProps>)
|
|
169
|
+
.filter(child => child.props && child.props.tabContentRef && child.props.tabContentRef.current)
|
|
173
170
|
.forEach(child => (child.props.tabContentRef.current.hidden = true));
|
|
174
171
|
// most recently selected tabContent
|
|
175
172
|
if (tabContentRef.current) {
|
|
@@ -318,8 +315,8 @@ export class Tabs extends React.Component<TabsProps, TabsState> {
|
|
|
318
315
|
uncontrolledActiveKey,
|
|
319
316
|
uncontrolledIsExpandedLocal
|
|
320
317
|
} = this.state;
|
|
321
|
-
const filteredChildren = React.Children.toArray(children)
|
|
322
|
-
.filter(
|
|
318
|
+
const filteredChildren = (React.Children.toArray(children) as React.ReactElement<TabProps>[])
|
|
319
|
+
.filter(Boolean)
|
|
323
320
|
.filter(child => !child.props.isHidden);
|
|
324
321
|
|
|
325
322
|
const uniqueId = id || getUniqueId();
|