@patternfly/react-core 4.192.9 → 4.192.13

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patternfly/react-core",
3
- "version": "4.192.9",
3
+ "version": "4.192.13",
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,16 +34,16 @@
34
34
  "generate": "node scripts/copyStyles.js"
35
35
  },
36
36
  "dependencies": {
37
- "@patternfly/react-icons": "^4.43.9",
38
- "@patternfly/react-styles": "^4.42.9",
39
- "@patternfly/react-tokens": "^4.44.9",
37
+ "@patternfly/react-icons": "^4.43.13",
38
+ "@patternfly/react-styles": "^4.42.13",
39
+ "@patternfly/react-tokens": "^4.44.13",
40
40
  "focus-trap": "6.2.2",
41
41
  "react-dropzone": "9.0.0",
42
42
  "tippy.js": "5.1.2",
43
43
  "tslib": "^2.0.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@patternfly/patternfly": "4.171.0",
46
+ "@patternfly/patternfly": "4.171.1",
47
47
  "@rollup/plugin-commonjs": "^21.0.0",
48
48
  "@rollup/plugin-node-resolve": "^13.0.0",
49
49
  "@rollup/plugin-replace": "^3.0.0",
@@ -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": "ef03957eef7673a3fbecd704a5a0c88040bd5313"
63
+ "gitHead": "1c02d77a07a642f8ef67eaf94ba3330fa8015a63"
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. Only `Tab` components or expressions resulting in a falsy value are allowed here. */
26
- children: TabsChild | TabsChild[];
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
- .filter((child): child is TabElement => React.isValidElement(child))
172
- .filter(({ props }) => props.tabContentRef && props.tabContentRef.current)
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((child): child is TabElement => React.isValidElement(child))
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();