@patternfly/react-core 4.235.6 → 4.236.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 +27 -0
- package/dist/esm/components/DualListSelector/DualListSelectorControl.d.ts.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelectorControl.js +2 -1
- package/dist/esm/components/DualListSelector/DualListSelectorControl.js.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelectorControlsWrapper.d.ts.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelectorControlsWrapper.js +2 -1
- package/dist/esm/components/DualListSelector/DualListSelectorControlsWrapper.js.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelectorListItem.d.ts.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelectorListItem.js +2 -1
- package/dist/esm/components/DualListSelector/DualListSelectorListItem.js.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelectorListWrapper.d.ts.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelectorListWrapper.js +2 -1
- package/dist/esm/components/DualListSelector/DualListSelectorListWrapper.js.map +1 -1
- package/dist/esm/components/InputGroup/InputGroup.d.ts.map +1 -1
- package/dist/esm/components/InputGroup/InputGroup.js +2 -1
- package/dist/esm/components/InputGroup/InputGroup.js.map +1 -1
- package/dist/esm/components/MenuToggle/MenuToggle.d.ts.map +1 -1
- package/dist/esm/components/MenuToggle/MenuToggle.js +1 -1
- package/dist/esm/components/MenuToggle/MenuToggle.js.map +1 -1
- package/dist/esm/components/Page/PageSection.d.ts +2 -0
- package/dist/esm/components/Page/PageSection.d.ts.map +1 -1
- package/dist/esm/components/Page/PageSection.js +3 -2
- package/dist/esm/components/Page/PageSection.js.map +1 -1
- package/dist/esm/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/dist/esm/components/SearchInput/SearchInput.js +2 -1
- package/dist/esm/components/SearchInput/SearchInput.js.map +1 -1
- package/dist/esm/components/TextInputGroup/TextInputGroup.d.ts.map +1 -1
- package/dist/esm/components/TextInputGroup/TextInputGroup.js +2 -1
- package/dist/esm/components/TextInputGroup/TextInputGroup.js.map +1 -1
- package/dist/esm/components/TextInputGroup/TextInputGroupMain.d.ts.map +1 -1
- package/dist/esm/components/TextInputGroup/TextInputGroupMain.js +2 -1
- package/dist/esm/components/TextInputGroup/TextInputGroupMain.js.map +1 -1
- package/dist/esm/next/components/Wizard/WizardToggle.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/WizardToggle.js +32 -31
- package/dist/esm/next/components/Wizard/WizardToggle.js.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelectorControl.d.ts.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelectorControl.js +2 -1
- package/dist/js/components/DualListSelector/DualListSelectorControl.js.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelectorControlsWrapper.d.ts.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelectorControlsWrapper.js +2 -1
- package/dist/js/components/DualListSelector/DualListSelectorControlsWrapper.js.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelectorListItem.d.ts.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelectorListItem.js +2 -1
- package/dist/js/components/DualListSelector/DualListSelectorListItem.js.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelectorListWrapper.d.ts.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelectorListWrapper.js +2 -1
- package/dist/js/components/DualListSelector/DualListSelectorListWrapper.js.map +1 -1
- package/dist/js/components/InputGroup/InputGroup.d.ts.map +1 -1
- package/dist/js/components/InputGroup/InputGroup.js +2 -1
- package/dist/js/components/InputGroup/InputGroup.js.map +1 -1
- package/dist/js/components/MenuToggle/MenuToggle.d.ts.map +1 -1
- package/dist/js/components/MenuToggle/MenuToggle.js +1 -1
- package/dist/js/components/MenuToggle/MenuToggle.js.map +1 -1
- package/dist/js/components/Page/PageSection.d.ts +2 -0
- package/dist/js/components/Page/PageSection.d.ts.map +1 -1
- package/dist/js/components/Page/PageSection.js +3 -2
- package/dist/js/components/Page/PageSection.js.map +1 -1
- package/dist/js/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/dist/js/components/SearchInput/SearchInput.js +2 -1
- package/dist/js/components/SearchInput/SearchInput.js.map +1 -1
- package/dist/js/components/TextInputGroup/TextInputGroup.d.ts.map +1 -1
- package/dist/js/components/TextInputGroup/TextInputGroup.js +2 -1
- package/dist/js/components/TextInputGroup/TextInputGroup.js.map +1 -1
- package/dist/js/components/TextInputGroup/TextInputGroupMain.d.ts.map +1 -1
- package/dist/js/components/TextInputGroup/TextInputGroupMain.js +2 -1
- package/dist/js/components/TextInputGroup/TextInputGroupMain.js.map +1 -1
- package/dist/js/next/components/Wizard/WizardToggle.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/WizardToggle.js +32 -31
- package/dist/js/next/components/Wizard/WizardToggle.js.map +1 -1
- package/dist/umd/react-core.min.css +1337 -1337
- package/dist/umd/react-core.min.js +2 -2
- package/package.json +5 -5
- package/src/components/Dropdown/__tests__/Dropdown.test.tsx +1 -1
- package/src/components/Dropdown/examples/DropdownPrimaryToggle.tsx +1 -1
- package/src/components/DualListSelector/DualListSelectorControl.tsx +2 -1
- package/src/components/DualListSelector/DualListSelectorControlsWrapper.tsx +2 -1
- package/src/components/DualListSelector/DualListSelectorListItem.tsx +2 -1
- package/src/components/DualListSelector/DualListSelectorListWrapper.tsx +2 -1
- package/src/components/InputGroup/InputGroup.tsx +2 -1
- package/src/components/MenuToggle/MenuToggle.tsx +7 -1
- package/src/components/Page/PageSection.tsx +7 -2
- package/src/components/Page/__tests__/PageSection.test.tsx +12 -0
- package/src/components/SearchInput/SearchInput.tsx +2 -1
- package/src/components/TextInputGroup/TextInputGroup.tsx +2 -1
- package/src/components/TextInputGroup/TextInputGroupMain.tsx +2 -1
- 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.
|
|
3
|
+
"version": "4.236.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",
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
"generate": "node scripts/copyStyles.js"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@patternfly/react-icons": "^4.
|
|
48
|
-
"@patternfly/react-styles": "^4.
|
|
49
|
-
"@patternfly/react-tokens": "^4.
|
|
47
|
+
"@patternfly/react-icons": "^4.87.0",
|
|
48
|
+
"@patternfly/react-styles": "^4.86.0",
|
|
49
|
+
"@patternfly/react-tokens": "^4.88.0",
|
|
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": "
|
|
73
|
+
"gitHead": "a4b7c93b2fad078f13a177a886317bbb054f4922"
|
|
74
74
|
}
|
|
@@ -46,7 +46,7 @@ export const DropdownPrimaryToggle: React.FunctionComponent = () => {
|
|
|
46
46
|
<Dropdown
|
|
47
47
|
onSelect={onSelect}
|
|
48
48
|
toggle={
|
|
49
|
-
<DropdownToggle id="toggle-primary"
|
|
49
|
+
<DropdownToggle id="toggle-primary" toggleVariant="primary" onToggle={onToggle}>
|
|
50
50
|
Dropdown
|
|
51
51
|
</DropdownToggle>
|
|
52
52
|
}
|
|
@@ -37,7 +37,8 @@ export const DualListSelectorControlBase: React.FunctionComponent<DualListSelect
|
|
|
37
37
|
tooltipProps = {} as any,
|
|
38
38
|
...props
|
|
39
39
|
}: DualListSelectorControlProps) => {
|
|
40
|
-
const
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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}>
|
|
@@ -124,7 +124,13 @@ export class MenuToggleBase extends React.Component<MenuToggleProps> {
|
|
|
124
124
|
};
|
|
125
125
|
|
|
126
126
|
if (isTypeahead) {
|
|
127
|
-
return
|
|
127
|
+
return (
|
|
128
|
+
<div
|
|
129
|
+
ref={innerRef as React.Ref<HTMLDivElement>}
|
|
130
|
+
className={css(commonStyles, styles.modifiers.typeahead)}
|
|
131
|
+
{...componentProps}
|
|
132
|
+
/>
|
|
133
|
+
);
|
|
128
134
|
}
|
|
129
135
|
|
|
130
136
|
if (splitButtonOptions) {
|
|
@@ -65,6 +65,8 @@ export interface PageSectionProps extends React.HTMLProps<HTMLDivElement> {
|
|
|
65
65
|
* This prop should also be passed in if a heading is not being used to describe the content of the page section.
|
|
66
66
|
*/
|
|
67
67
|
'aria-label'?: string;
|
|
68
|
+
/** Sets the base component to render. Defaults to section */
|
|
69
|
+
component?: keyof JSX.IntrinsicElements;
|
|
68
70
|
}
|
|
69
71
|
|
|
70
72
|
const variantType = {
|
|
@@ -98,6 +100,7 @@ export const PageSection: React.FunctionComponent<PageSectionProps> = ({
|
|
|
98
100
|
hasShadowBottom = false,
|
|
99
101
|
hasOverflowScroll = false,
|
|
100
102
|
'aria-label': ariaLabel,
|
|
103
|
+
component = 'section',
|
|
101
104
|
...props
|
|
102
105
|
}: PageSectionProps) => {
|
|
103
106
|
const { height, getVerticalBreakpoint } = React.useContext(PageContext);
|
|
@@ -109,8 +112,10 @@ export const PageSection: React.FunctionComponent<PageSectionProps> = ({
|
|
|
109
112
|
}
|
|
110
113
|
}, [hasOverflowScroll, ariaLabel]);
|
|
111
114
|
|
|
115
|
+
const Component = component as any;
|
|
116
|
+
|
|
112
117
|
return (
|
|
113
|
-
<
|
|
118
|
+
<Component
|
|
114
119
|
{...props}
|
|
115
120
|
className={css(
|
|
116
121
|
variantType[type],
|
|
@@ -133,7 +138,7 @@ export const PageSection: React.FunctionComponent<PageSectionProps> = ({
|
|
|
133
138
|
>
|
|
134
139
|
{isWidthLimited && <div className={css(styles.pageMainBody)}>{children}</div>}
|
|
135
140
|
{!isWidthLimited && children}
|
|
136
|
-
</
|
|
141
|
+
</Component>
|
|
137
142
|
);
|
|
138
143
|
};
|
|
139
144
|
PageSection.displayName = 'PageSection';
|
|
@@ -128,3 +128,15 @@ test('Logs a warning in the console when an aria-label is not included with hasO
|
|
|
128
128
|
|
|
129
129
|
expect(consoleWarning).toHaveBeenCalled();
|
|
130
130
|
});
|
|
131
|
+
|
|
132
|
+
test('Renders as a section by default', () => {
|
|
133
|
+
render(<PageSection>test</PageSection>);
|
|
134
|
+
|
|
135
|
+
expect(screen.getByText('test')).toHaveProperty('nodeName', 'SECTION');
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
test('Renders as other elements when a different element type is passed using the component prop', () => {
|
|
139
|
+
render(<PageSection component="main">test</PageSection>);
|
|
140
|
+
|
|
141
|
+
expect(screen.getByRole('main')).toHaveTextContent('test');
|
|
142
|
+
});
|
|
@@ -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
|
|
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
|
|
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
|
|
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 =
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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 (
|
|
158
|
-
|
|
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
|
-
|
|
174
|
-
|
|
175
|
-
|
|
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
|
<>
|