@patternfly/react-core 4.235.6 → 4.235.7

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.
Files changed (67) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/esm/components/DualListSelector/DualListSelectorControl.d.ts.map +1 -1
  3. package/dist/esm/components/DualListSelector/DualListSelectorControl.js +2 -1
  4. package/dist/esm/components/DualListSelector/DualListSelectorControl.js.map +1 -1
  5. package/dist/esm/components/DualListSelector/DualListSelectorControlsWrapper.d.ts.map +1 -1
  6. package/dist/esm/components/DualListSelector/DualListSelectorControlsWrapper.js +2 -1
  7. package/dist/esm/components/DualListSelector/DualListSelectorControlsWrapper.js.map +1 -1
  8. package/dist/esm/components/DualListSelector/DualListSelectorListItem.d.ts.map +1 -1
  9. package/dist/esm/components/DualListSelector/DualListSelectorListItem.js +2 -1
  10. package/dist/esm/components/DualListSelector/DualListSelectorListItem.js.map +1 -1
  11. package/dist/esm/components/DualListSelector/DualListSelectorListWrapper.d.ts.map +1 -1
  12. package/dist/esm/components/DualListSelector/DualListSelectorListWrapper.js +2 -1
  13. package/dist/esm/components/DualListSelector/DualListSelectorListWrapper.js.map +1 -1
  14. package/dist/esm/components/InputGroup/InputGroup.d.ts.map +1 -1
  15. package/dist/esm/components/InputGroup/InputGroup.js +2 -1
  16. package/dist/esm/components/InputGroup/InputGroup.js.map +1 -1
  17. package/dist/esm/components/SearchInput/SearchInput.d.ts.map +1 -1
  18. package/dist/esm/components/SearchInput/SearchInput.js +2 -1
  19. package/dist/esm/components/SearchInput/SearchInput.js.map +1 -1
  20. package/dist/esm/components/TextInputGroup/TextInputGroup.d.ts.map +1 -1
  21. package/dist/esm/components/TextInputGroup/TextInputGroup.js +2 -1
  22. package/dist/esm/components/TextInputGroup/TextInputGroup.js.map +1 -1
  23. package/dist/esm/components/TextInputGroup/TextInputGroupMain.d.ts.map +1 -1
  24. package/dist/esm/components/TextInputGroup/TextInputGroupMain.js +2 -1
  25. package/dist/esm/components/TextInputGroup/TextInputGroupMain.js.map +1 -1
  26. package/dist/esm/next/components/Wizard/WizardToggle.d.ts.map +1 -1
  27. package/dist/esm/next/components/Wizard/WizardToggle.js +32 -31
  28. package/dist/esm/next/components/Wizard/WizardToggle.js.map +1 -1
  29. package/dist/js/components/DualListSelector/DualListSelectorControl.d.ts.map +1 -1
  30. package/dist/js/components/DualListSelector/DualListSelectorControl.js +2 -1
  31. package/dist/js/components/DualListSelector/DualListSelectorControl.js.map +1 -1
  32. package/dist/js/components/DualListSelector/DualListSelectorControlsWrapper.d.ts.map +1 -1
  33. package/dist/js/components/DualListSelector/DualListSelectorControlsWrapper.js +2 -1
  34. package/dist/js/components/DualListSelector/DualListSelectorControlsWrapper.js.map +1 -1
  35. package/dist/js/components/DualListSelector/DualListSelectorListItem.d.ts.map +1 -1
  36. package/dist/js/components/DualListSelector/DualListSelectorListItem.js +2 -1
  37. package/dist/js/components/DualListSelector/DualListSelectorListItem.js.map +1 -1
  38. package/dist/js/components/DualListSelector/DualListSelectorListWrapper.d.ts.map +1 -1
  39. package/dist/js/components/DualListSelector/DualListSelectorListWrapper.js +2 -1
  40. package/dist/js/components/DualListSelector/DualListSelectorListWrapper.js.map +1 -1
  41. package/dist/js/components/InputGroup/InputGroup.d.ts.map +1 -1
  42. package/dist/js/components/InputGroup/InputGroup.js +2 -1
  43. package/dist/js/components/InputGroup/InputGroup.js.map +1 -1
  44. package/dist/js/components/SearchInput/SearchInput.d.ts.map +1 -1
  45. package/dist/js/components/SearchInput/SearchInput.js +2 -1
  46. package/dist/js/components/SearchInput/SearchInput.js.map +1 -1
  47. package/dist/js/components/TextInputGroup/TextInputGroup.d.ts.map +1 -1
  48. package/dist/js/components/TextInputGroup/TextInputGroup.js +2 -1
  49. package/dist/js/components/TextInputGroup/TextInputGroup.js.map +1 -1
  50. package/dist/js/components/TextInputGroup/TextInputGroupMain.d.ts.map +1 -1
  51. package/dist/js/components/TextInputGroup/TextInputGroupMain.js +2 -1
  52. package/dist/js/components/TextInputGroup/TextInputGroupMain.js.map +1 -1
  53. package/dist/js/next/components/Wizard/WizardToggle.d.ts.map +1 -1
  54. package/dist/js/next/components/Wizard/WizardToggle.js +32 -31
  55. package/dist/js/next/components/Wizard/WizardToggle.js.map +1 -1
  56. package/dist/umd/react-core.min.css +534 -534
  57. package/dist/umd/react-core.min.js +2 -2
  58. package/package.json +5 -5
  59. package/src/components/DualListSelector/DualListSelectorControl.tsx +2 -1
  60. package/src/components/DualListSelector/DualListSelectorControlsWrapper.tsx +2 -1
  61. package/src/components/DualListSelector/DualListSelectorListItem.tsx +2 -1
  62. package/src/components/DualListSelector/DualListSelectorListWrapper.tsx +2 -1
  63. package/src/components/InputGroup/InputGroup.tsx +2 -1
  64. package/src/components/SearchInput/SearchInput.tsx +2 -1
  65. package/src/components/TextInputGroup/TextInputGroup.tsx +2 -1
  66. package/src/components/TextInputGroup/TextInputGroupMain.tsx +2 -1
  67. package/src/next/components/Wizard/WizardToggle.tsx +87 -85
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patternfly/react-core",
3
- "version": "4.235.6",
3
+ "version": "4.235.7",
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",
@@ -44,9 +44,9 @@
44
44
  "generate": "node scripts/copyStyles.js"
45
45
  },
46
46
  "dependencies": {
47
- "@patternfly/react-icons": "^4.86.6",
48
- "@patternfly/react-styles": "^4.85.6",
49
- "@patternfly/react-tokens": "^4.87.6",
47
+ "@patternfly/react-icons": "^4.86.7",
48
+ "@patternfly/react-styles": "^4.85.7",
49
+ "@patternfly/react-tokens": "^4.87.7",
50
50
  "focus-trap": "6.9.2",
51
51
  "react-dropzone": "9.0.0",
52
52
  "tippy.js": "5.1.2",
@@ -70,5 +70,5 @@
70
70
  "react": "^16.8.0 || ^17.0.0",
71
71
  "react-dom": "^16.8.0 || ^17.0.0"
72
72
  },
73
- "gitHead": "e688e3b26385dc09280dca250d72a733ce18b52a"
73
+ "gitHead": "87397c498b2fb5bf5425336fd14da3864dd9334d"
74
74
  }
@@ -37,7 +37,8 @@ export const DualListSelectorControlBase: React.FunctionComponent<DualListSelect
37
37
  tooltipProps = {} as any,
38
38
  ...props
39
39
  }: DualListSelectorControlProps) => {
40
- const ref = innerRef || React.useRef(null);
40
+ const privateRef = React.useRef(null);
41
+ const ref = innerRef || privateRef;
41
42
  return (
42
43
  <div className={css('pf-c-dual-list-selector__controls-item', className)} {...props}>
43
44
  <Button
@@ -23,7 +23,8 @@ export const DualListSelectorControlsWrapperBase: React.FunctionComponent<DualLi
23
23
  'aria-label': ariaLabel = 'Controls for moving options between lists',
24
24
  ...props
25
25
  }: DualListSelectorControlsWrapperProps) => {
26
- const wrapperRef = innerRef || React.useRef(null);
26
+ const ref = React.useRef(null);
27
+ const wrapperRef = innerRef || ref;
27
28
  // Adds keyboard navigation to the dynamically built dual list selector controls. Works when controls are dynamically built
28
29
  // as well as when they are passed in via children.
29
30
  const handleKeys = (event: KeyboardEvent) => {
@@ -47,7 +47,8 @@ export const DualListSelectorListItemBase: React.FunctionComponent<DualListSelec
47
47
  draggableButtonAriaLabel = 'Reorder option',
48
48
  ...props
49
49
  }: DualListSelectorListItemProps) => {
50
- const ref = innerRef || React.useRef<HTMLLIElement>(null);
50
+ const privateRef = React.useRef<HTMLLIElement>(null);
51
+ const ref = innerRef || privateRef;
51
52
  const { setFocusedOption } = React.useContext(DualListSelectorListContext);
52
53
 
53
54
  return (
@@ -42,7 +42,8 @@ export const DualListSelectorListWrapperBase: React.FunctionComponent<DualListSe
42
42
  ...props
43
43
  }: DualListSelectorListWrapperProps) => {
44
44
  const [focusedOption, setFocusedOption] = React.useState('');
45
- const menuRef = innerRef || React.useRef(null);
45
+ const ref = React.useRef(null);
46
+ const menuRef = innerRef || ref;
46
47
  const { isTree } = React.useContext(DualListSelectorContext);
47
48
 
48
49
  // sets up keyboard focus handling for the dual list selector menu child of the pane. This keyboard
@@ -25,7 +25,8 @@ export const InputGroup: React.FunctionComponent<InputGroupProps> = ({
25
25
  (child: any) => !formCtrls.includes(child.type.displayName) && child.props.id
26
26
  ) as React.ReactElement<{ id: string }>;
27
27
 
28
- const inputGroupRef = innerRef || React.useRef(null);
28
+ const ref = React.useRef(null);
29
+ const inputGroupRef = innerRef || ref;
29
30
 
30
31
  return (
31
32
  <div ref={inputGroupRef} className={css(styles.inputGroup, className)} {...props}>
@@ -125,7 +125,8 @@ const SearchInputBase: React.FunctionComponent<SearchInputProps> = ({
125
125
  const [isSearchMenuOpen, setIsSearchMenuOpen] = React.useState(false);
126
126
  const [searchValue, setSearchValue] = React.useState(value);
127
127
  const searchInputRef = React.useRef(null);
128
- const searchInputInputRef = innerRef || React.useRef(null);
128
+ const ref = React.useRef(null);
129
+ const searchInputInputRef = innerRef || ref;
129
130
 
130
131
  React.useEffect(() => {
131
132
  setSearchValue(value);
@@ -27,7 +27,8 @@ export const TextInputGroup: React.FunctionComponent<TextInputGroupProps> = ({
27
27
  innerRef,
28
28
  ...props
29
29
  }: TextInputGroupProps) => {
30
- const textInputGroupRef = innerRef || React.useRef(null);
30
+ const ref = React.useRef(null);
31
+ const textInputGroupRef = innerRef || ref;
31
32
 
32
33
  return (
33
34
  <TextInputGroupContext.Provider value={{ isDisabled }}>
@@ -57,7 +57,8 @@ export const TextInputGroupMain: React.FunctionComponent<TextInputGroupMainProps
57
57
  ...props
58
58
  }: TextInputGroupMainProps) => {
59
59
  const { isDisabled } = React.useContext(TextInputGroupContext);
60
- const textInputGroupInputInputRef = innerRef || React.useRef(null);
60
+ const ref = React.useRef(null);
61
+ const textInputGroupInputInputRef = innerRef || ref;
61
62
 
62
63
  const handleChange = (event: React.FormEvent<HTMLInputElement>) => {
63
64
  onChange(event.currentTarget.value, event);
@@ -84,95 +84,97 @@ export const WizardToggle = ({
84
84
  );
85
85
  });
86
86
 
87
- const wizardNav = isCustomWizardNav(nav)
88
- ? nav(isNavOpen, steps, activeStep, goToStepByIndex)
89
- : React.useMemo(() => {
90
- const props = {
91
- isOpen: isNavOpen,
92
- 'aria-label': nav?.ariaLabel || 'Wizard nav',
93
- ...(nav?.ariaLabelledBy && { 'aria-labelledby': nav?.ariaLabelledBy })
94
- };
87
+ const wizardNav = React.useMemo(() => {
88
+ if (isCustomWizardNav(nav)) {
89
+ return nav(isNavOpen, steps, activeStep, goToStepByIndex);
90
+ }
91
+
92
+ const props = {
93
+ isOpen: isNavOpen,
94
+ 'aria-label': nav?.ariaLabel || 'Wizard nav',
95
+ ...(nav?.ariaLabelledBy && { 'aria-labelledby': nav?.ariaLabelledBy })
96
+ };
95
97
 
96
- return (
97
- <WizardNav {...props}>
98
- {steps.map((step, index) => {
99
- const stepIndex = index + 1;
100
- const stepNavItem = step.navItem && <React.Fragment key={step.id}>{step.navItem}</React.Fragment>;
101
-
102
- if (isWizardParentStep(step)) {
103
- let firstSubStepIndex;
104
- let hasActiveChild = false;
105
-
106
- const subNavItems = step.subStepIds?.map((subStepId, index) => {
107
- const subStep = steps.find(step => step.id === subStepId);
108
- const subStepIndex = steps.indexOf(subStep) + 1;
109
-
110
- if (index === 0) {
111
- firstSubStepIndex = subStepIndex;
112
- }
113
-
114
- if (activeStep?.id === subStep.id) {
115
- hasActiveChild = true;
116
- }
117
-
118
- return subStep.navItem ? (
119
- <React.Fragment key={subStep.id}>{subStep.navItem}</React.Fragment>
120
- ) : (
121
- <WizardNavItem
122
- key={subStep.id}
123
- id={subStep.id}
124
- content={subStep.name}
125
- isCurrent={activeStep?.id === subStep.id}
126
- isDisabled={subStep.isDisabled || (nav?.forceStepVisit && !subStep.visited)}
127
- step={subStepIndex}
128
- onNavItemClick={goToStepByIndex}
129
- />
130
- );
131
- });
132
-
133
- const hasEnabledChildren = React.Children.toArray(subNavItems).some(
134
- child => React.isValidElement(child) && !child.props.isDisabled
135
- );
136
-
137
- return (
138
- stepNavItem || (
139
- <WizardNavItem
140
- key={step.id}
141
- id={step.id}
142
- content={step.name}
143
- isExpandable={nav?.isExpandable}
144
- isCurrent={hasActiveChild}
145
- isDisabled={!hasEnabledChildren}
146
- step={firstSubStepIndex}
147
- onNavItemClick={goToStepByIndex}
148
- >
149
- <WizardNav {...props} returnList>
150
- {subNavItems}
151
- </WizardNav>
152
- </WizardNavItem>
153
- )
154
- );
98
+ return (
99
+ <WizardNav {...props}>
100
+ {steps.map((step, index) => {
101
+ const stepIndex = index + 1;
102
+ const stepNavItem = step.navItem && <React.Fragment key={step.id}>{step.navItem}</React.Fragment>;
103
+
104
+ if (isWizardParentStep(step)) {
105
+ let firstSubStepIndex;
106
+ let hasActiveChild = false;
107
+
108
+ const subNavItems = step.subStepIds?.map((subStepId, index) => {
109
+ const subStep = steps.find(step => step.id === subStepId);
110
+ const subStepIndex = steps.indexOf(subStep) + 1;
111
+
112
+ if (index === 0) {
113
+ firstSubStepIndex = subStepIndex;
155
114
  }
156
115
 
157
- if (isWizardBasicStep(step)) {
158
- return (
159
- stepNavItem || (
160
- <WizardNavItem
161
- key={step.id}
162
- id={step.id}
163
- content={step.name}
164
- isCurrent={activeStep?.id === step.id}
165
- isDisabled={step.isDisabled || (nav?.forceStepVisit && !step.visited)}
166
- step={stepIndex}
167
- onNavItemClick={goToStepByIndex}
168
- />
169
- )
170
- );
116
+ if (activeStep?.id === subStep.id) {
117
+ hasActiveChild = true;
171
118
  }
172
- })}
173
- </WizardNav>
174
- );
175
- }, [activeStep?.id, goToStepByIndex, isNavOpen, nav, steps]);
119
+
120
+ return subStep.navItem ? (
121
+ <React.Fragment key={subStep.id}>{subStep.navItem}</React.Fragment>
122
+ ) : (
123
+ <WizardNavItem
124
+ key={subStep.id}
125
+ id={subStep.id}
126
+ content={subStep.name}
127
+ isCurrent={activeStep?.id === subStep.id}
128
+ isDisabled={subStep.isDisabled || (nav?.forceStepVisit && !subStep.visited)}
129
+ step={subStepIndex}
130
+ onNavItemClick={goToStepByIndex}
131
+ />
132
+ );
133
+ });
134
+
135
+ const hasEnabledChildren = React.Children.toArray(subNavItems).some(
136
+ child => React.isValidElement(child) && !child.props.isDisabled
137
+ );
138
+
139
+ return (
140
+ stepNavItem || (
141
+ <WizardNavItem
142
+ key={step.id}
143
+ id={step.id}
144
+ content={step.name}
145
+ isExpandable={nav?.isExpandable}
146
+ isCurrent={hasActiveChild}
147
+ isDisabled={!hasEnabledChildren}
148
+ step={firstSubStepIndex}
149
+ onNavItemClick={goToStepByIndex}
150
+ >
151
+ <WizardNav {...props} returnList>
152
+ {subNavItems}
153
+ </WizardNav>
154
+ </WizardNavItem>
155
+ )
156
+ );
157
+ }
158
+
159
+ if (isWizardBasicStep(step)) {
160
+ return (
161
+ stepNavItem || (
162
+ <WizardNavItem
163
+ key={step.id}
164
+ id={step.id}
165
+ content={step.name}
166
+ isCurrent={activeStep?.id === step.id}
167
+ isDisabled={step.isDisabled || (nav?.forceStepVisit && !step.visited)}
168
+ step={stepIndex}
169
+ onNavItemClick={goToStepByIndex}
170
+ />
171
+ )
172
+ );
173
+ }
174
+ })}
175
+ </WizardNav>
176
+ );
177
+ }, [activeStep?.id, goToStepByIndex, isNavOpen, nav, steps]);
176
178
 
177
179
  return (
178
180
  <>