@patternfly/react-core 4.273.3 → 4.274.1
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 +24 -0
- package/components/Chip/Chip.d.ts.map +1 -1
- package/components/Chip/Chip.js +5 -4
- package/components/Chip/Chip.js.map +1 -1
- package/components/Menu/MenuGroup.d.ts +1 -1
- package/components/Menu/MenuGroup.d.ts.map +1 -1
- package/components/Menu/MenuGroup.js.map +1 -1
- package/components/Text/TextList.d.ts +2 -0
- package/components/Text/TextList.d.ts.map +1 -1
- package/components/Text/TextList.js +3 -2
- package/components/Text/TextList.js.map +1 -1
- package/dist/esm/components/Chip/Chip.d.ts.map +1 -1
- package/dist/esm/components/Chip/Chip.js +5 -4
- package/dist/esm/components/Chip/Chip.js.map +1 -1
- package/dist/esm/components/Menu/MenuGroup.d.ts +1 -1
- package/dist/esm/components/Menu/MenuGroup.d.ts.map +1 -1
- package/dist/esm/components/Menu/MenuGroup.js.map +1 -1
- package/dist/esm/components/Text/TextList.d.ts +2 -0
- package/dist/esm/components/Text/TextList.d.ts.map +1 -1
- package/dist/esm/components/Text/TextList.js +3 -2
- package/dist/esm/components/Text/TextList.js.map +1 -1
- package/dist/esm/next/components/Wizard/Wizard.d.ts +11 -14
- package/dist/esm/next/components/Wizard/Wizard.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/Wizard.js +30 -23
- package/dist/esm/next/components/Wizard/Wizard.js.map +1 -1
- package/dist/esm/next/components/Wizard/WizardContext.d.ts +16 -16
- package/dist/esm/next/components/Wizard/WizardContext.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/WizardContext.js +17 -19
- package/dist/esm/next/components/Wizard/WizardContext.js.map +1 -1
- package/dist/esm/next/components/Wizard/WizardFooter.d.ts +8 -5
- package/dist/esm/next/components/Wizard/WizardFooter.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/WizardFooter.js +1 -1
- package/dist/esm/next/components/Wizard/WizardFooter.js.map +1 -1
- package/dist/esm/next/components/Wizard/WizardHeader.d.ts +1 -1
- package/dist/esm/next/components/Wizard/WizardHeader.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/WizardNavInternal.d.ts +2 -2
- package/dist/esm/next/components/Wizard/WizardNavInternal.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/WizardNavInternal.js +15 -9
- package/dist/esm/next/components/Wizard/WizardNavInternal.js.map +1 -1
- package/dist/esm/next/components/Wizard/WizardNavItem.d.ts +10 -4
- package/dist/esm/next/components/Wizard/WizardNavItem.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/WizardNavItem.js +10 -9
- package/dist/esm/next/components/Wizard/WizardNavItem.js.map +1 -1
- package/dist/esm/next/components/Wizard/WizardStep.d.ts +3 -3
- package/dist/esm/next/components/Wizard/WizardStep.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/WizardStep.js +4 -2
- package/dist/esm/next/components/Wizard/WizardStep.js.map +1 -1
- package/dist/esm/next/components/Wizard/WizardToggle.d.ts +4 -4
- package/dist/esm/next/components/Wizard/WizardToggle.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/WizardToggle.js +1 -1
- package/dist/esm/next/components/Wizard/WizardToggle.js.map +1 -1
- package/dist/esm/next/components/Wizard/hooks/index.d.ts +1 -0
- package/dist/esm/next/components/Wizard/hooks/index.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/hooks/index.js +1 -0
- package/dist/esm/next/components/Wizard/hooks/index.js.map +1 -1
- package/dist/esm/next/components/Wizard/hooks/useGetMergedSteps.d.ts +9 -0
- package/dist/esm/next/components/Wizard/hooks/useGetMergedSteps.d.ts.map +1 -0
- package/dist/esm/next/components/Wizard/hooks/useGetMergedSteps.js +33 -0
- package/dist/esm/next/components/Wizard/hooks/useGetMergedSteps.js.map +1 -0
- package/dist/esm/next/components/Wizard/index.d.ts +2 -2
- package/dist/esm/next/components/Wizard/index.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/index.js +2 -2
- package/dist/esm/next/components/Wizard/index.js.map +1 -1
- package/dist/esm/next/components/Wizard/types.d.ts +13 -19
- package/dist/esm/next/components/Wizard/types.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/types.js +6 -0
- package/dist/esm/next/components/Wizard/types.js.map +1 -1
- package/dist/esm/next/components/Wizard/utils.d.ts +5 -6
- package/dist/esm/next/components/Wizard/utils.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/utils.js +15 -22
- package/dist/esm/next/components/Wizard/utils.js.map +1 -1
- package/dist/js/components/Chip/Chip.d.ts.map +1 -1
- package/dist/js/components/Chip/Chip.js +4 -4
- package/dist/js/components/Chip/Chip.js.map +1 -1
- package/dist/js/components/Menu/MenuGroup.d.ts +1 -1
- package/dist/js/components/Menu/MenuGroup.d.ts.map +1 -1
- package/dist/js/components/Menu/MenuGroup.js.map +1 -1
- package/dist/js/components/Text/TextList.d.ts +2 -0
- package/dist/js/components/Text/TextList.d.ts.map +1 -1
- package/dist/js/components/Text/TextList.js +3 -2
- package/dist/js/components/Text/TextList.js.map +1 -1
- package/dist/js/next/components/Wizard/Wizard.d.ts +11 -14
- package/dist/js/next/components/Wizard/Wizard.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/Wizard.js +28 -21
- package/dist/js/next/components/Wizard/Wizard.js.map +1 -1
- package/dist/js/next/components/Wizard/WizardContext.d.ts +16 -16
- package/dist/js/next/components/Wizard/WizardContext.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/WizardContext.js +16 -17
- package/dist/js/next/components/Wizard/WizardContext.js.map +1 -1
- package/dist/js/next/components/Wizard/WizardFooter.d.ts +8 -5
- package/dist/js/next/components/Wizard/WizardFooter.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/WizardFooter.js +1 -1
- package/dist/js/next/components/Wizard/WizardFooter.js.map +1 -1
- package/dist/js/next/components/Wizard/WizardHeader.d.ts +1 -1
- package/dist/js/next/components/Wizard/WizardHeader.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/WizardNavInternal.d.ts +2 -2
- package/dist/js/next/components/Wizard/WizardNavInternal.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/WizardNavInternal.js +15 -9
- package/dist/js/next/components/Wizard/WizardNavInternal.js.map +1 -1
- package/dist/js/next/components/Wizard/WizardNavItem.d.ts +10 -4
- package/dist/js/next/components/Wizard/WizardNavItem.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/WizardNavItem.js +10 -8
- package/dist/js/next/components/Wizard/WizardNavItem.js.map +1 -1
- package/dist/js/next/components/Wizard/WizardStep.d.ts +3 -3
- package/dist/js/next/components/Wizard/WizardStep.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/WizardStep.js +4 -2
- package/dist/js/next/components/Wizard/WizardStep.js.map +1 -1
- package/dist/js/next/components/Wizard/WizardToggle.d.ts +4 -4
- package/dist/js/next/components/Wizard/WizardToggle.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/WizardToggle.js +1 -1
- package/dist/js/next/components/Wizard/WizardToggle.js.map +1 -1
- package/dist/js/next/components/Wizard/hooks/index.d.ts +1 -0
- package/dist/js/next/components/Wizard/hooks/index.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/hooks/index.js +3 -1
- package/dist/js/next/components/Wizard/hooks/index.js.map +1 -1
- package/dist/js/next/components/Wizard/hooks/useGetMergedSteps.d.ts +9 -0
- package/dist/js/next/components/Wizard/hooks/useGetMergedSteps.d.ts.map +1 -0
- package/dist/js/next/components/Wizard/hooks/useGetMergedSteps.js +38 -0
- package/dist/js/next/components/Wizard/hooks/useGetMergedSteps.js.map +1 -0
- package/dist/js/next/components/Wizard/index.d.ts +2 -2
- package/dist/js/next/components/Wizard/index.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/index.js +4 -2
- package/dist/js/next/components/Wizard/index.js.map +1 -1
- package/dist/js/next/components/Wizard/types.d.ts +13 -19
- package/dist/js/next/components/Wizard/types.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/types.js +7 -1
- package/dist/js/next/components/Wizard/types.js.map +1 -1
- package/dist/js/next/components/Wizard/utils.d.ts +5 -6
- package/dist/js/next/components/Wizard/utils.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/utils.js +17 -25
- package/dist/js/next/components/Wizard/utils.js.map +1 -1
- package/dist/umd/react-core.min.js +2 -2
- package/next/components/Wizard/Wizard.d.ts +11 -14
- package/next/components/Wizard/Wizard.d.ts.map +1 -1
- package/next/components/Wizard/Wizard.js +30 -23
- package/next/components/Wizard/Wizard.js.map +1 -1
- package/next/components/Wizard/WizardContext.d.ts +16 -16
- package/next/components/Wizard/WizardContext.d.ts.map +1 -1
- package/next/components/Wizard/WizardContext.js +17 -19
- package/next/components/Wizard/WizardContext.js.map +1 -1
- package/next/components/Wizard/WizardFooter.d.ts +8 -5
- package/next/components/Wizard/WizardFooter.d.ts.map +1 -1
- package/next/components/Wizard/WizardFooter.js +1 -1
- package/next/components/Wizard/WizardFooter.js.map +1 -1
- package/next/components/Wizard/WizardHeader.d.ts +1 -1
- package/next/components/Wizard/WizardHeader.d.ts.map +1 -1
- package/next/components/Wizard/WizardNavInternal.d.ts +2 -2
- package/next/components/Wizard/WizardNavInternal.d.ts.map +1 -1
- package/next/components/Wizard/WizardNavInternal.js +15 -9
- package/next/components/Wizard/WizardNavInternal.js.map +1 -1
- package/next/components/Wizard/WizardNavItem.d.ts +10 -4
- package/next/components/Wizard/WizardNavItem.d.ts.map +1 -1
- package/next/components/Wizard/WizardNavItem.js +10 -9
- package/next/components/Wizard/WizardNavItem.js.map +1 -1
- package/next/components/Wizard/WizardStep.d.ts +3 -3
- package/next/components/Wizard/WizardStep.d.ts.map +1 -1
- package/next/components/Wizard/WizardStep.js +4 -2
- package/next/components/Wizard/WizardStep.js.map +1 -1
- package/next/components/Wizard/WizardToggle.d.ts +4 -4
- package/next/components/Wizard/WizardToggle.d.ts.map +1 -1
- package/next/components/Wizard/WizardToggle.js +1 -1
- package/next/components/Wizard/WizardToggle.js.map +1 -1
- package/next/components/Wizard/hooks/index.d.ts +1 -0
- package/next/components/Wizard/hooks/index.d.ts.map +1 -1
- package/next/components/Wizard/hooks/index.js +1 -0
- package/next/components/Wizard/hooks/index.js.map +1 -1
- package/next/components/Wizard/hooks/useGetMergedSteps.d.ts +9 -0
- package/next/components/Wizard/hooks/useGetMergedSteps.d.ts.map +1 -0
- package/next/components/Wizard/hooks/useGetMergedSteps.js +33 -0
- package/next/components/Wizard/hooks/useGetMergedSteps.js.map +1 -0
- package/next/components/Wizard/index.d.ts +2 -2
- package/next/components/Wizard/index.d.ts.map +1 -1
- package/next/components/Wizard/index.js +2 -2
- package/next/components/Wizard/index.js.map +1 -1
- package/next/components/Wizard/types.d.ts +13 -19
- package/next/components/Wizard/types.d.ts.map +1 -1
- package/next/components/Wizard/types.js +6 -0
- package/next/components/Wizard/types.js.map +1 -1
- package/next/components/Wizard/utils.d.ts +5 -6
- package/next/components/Wizard/utils.d.ts.map +1 -1
- package/next/components/Wizard/utils.js +15 -22
- package/next/components/Wizard/utils.js.map +1 -1
- package/package.json +2 -2
- package/src/components/Chip/Chip.tsx +4 -2
- package/src/components/Chip/__tests__/Chip.test.tsx +9 -0
- package/src/components/Chip/__tests__/__snapshots__/Chip.test.tsx.snap +55 -0
- package/src/components/ChipGroup/__tests__/__snapshots__/ChipGroup.test.tsx.snap +4 -0
- package/src/components/Menu/MenuGroup.tsx +2 -2
- package/src/components/Modal/examples/Modal.md +46 -11
- package/src/components/Select/__tests__/__snapshots__/Select.test.tsx.snap +2 -0
- package/src/components/Text/TextList.tsx +5 -1
- package/src/components/Text/__tests__/TextList.test.tsx +5 -0
- package/src/components/Text/examples/Text.md +5 -0
- package/src/components/Text/examples/TextPlainList.tsx +24 -0
- package/src/components/Toolbar/__tests__/__snapshots__/Toolbar.test.tsx.snap +2 -0
- package/src/next/components/Wizard/Wizard.tsx +71 -46
- package/src/next/components/Wizard/WizardContext.tsx +38 -43
- package/src/next/components/Wizard/WizardFooter.tsx +10 -6
- package/src/next/components/Wizard/WizardHeader.tsx +1 -1
- package/src/next/components/Wizard/WizardNavInternal.tsx +51 -43
- package/src/next/components/Wizard/WizardNavItem.tsx +21 -14
- package/src/next/components/Wizard/WizardStep.tsx +8 -6
- package/src/next/components/Wizard/WizardToggle.tsx +5 -5
- package/src/next/components/Wizard/__tests__/Wizard.test.tsx +129 -26
- package/src/next/components/Wizard/__tests__/WizardStep.test.tsx +5 -5
- package/src/next/components/Wizard/__tests__/WizardToggle.test.tsx +2 -2
- package/src/next/components/Wizard/__tests__/utils.test.tsx +3 -17
- package/src/next/components/Wizard/examples/Wizard.md +69 -41
- package/src/next/components/Wizard/examples/WizardBasic.tsx +6 -12
- package/src/next/components/Wizard/examples/WizardBasicDisabledSteps.tsx +22 -0
- package/src/next/components/Wizard/examples/WizardEnabledOnFormValidation.tsx +84 -0
- package/src/next/components/Wizard/examples/WizardExpandableSteps.tsx +42 -0
- package/src/next/components/Wizard/examples/WizardGetCurrentStep.tsx +53 -0
- package/src/next/components/Wizard/examples/WizardProgressiveSteps.tsx +31 -0
- package/src/next/components/Wizard/examples/WizardStepDrawerContent.tsx +80 -0
- package/src/next/components/Wizard/examples/WizardStepErrorStatus.tsx +55 -0
- package/src/next/components/Wizard/examples/WizardStepVisitRequired.tsx +22 -0
- package/src/next/components/Wizard/examples/WizardToggleStepVisibility.tsx +57 -0
- package/src/next/components/Wizard/examples/WizardValidateOnButtonPress.tsx +183 -0
- package/src/next/components/Wizard/examples/WizardWithCustomFooter.tsx +107 -0
- package/src/next/components/Wizard/examples/{WizardCustomNav.tsx → WizardWithCustomNav.tsx} +11 -11
- package/src/next/components/Wizard/examples/WizardWithCustomNavItem.tsx +22 -0
- package/src/next/components/Wizard/examples/WizardWithHeader.tsx +26 -0
- package/src/next/components/Wizard/examples/WizardWithNavAnchors.tsx +46 -0
- package/src/next/components/Wizard/examples/WizardWithSubmitProgress.tsx +86 -0
- package/src/next/components/Wizard/examples/WizardWithinModal.tsx +41 -0
- package/src/next/components/Wizard/hooks/index.ts +1 -0
- package/src/next/components/Wizard/hooks/useGetMergedSteps.tsx +45 -0
- package/src/next/components/Wizard/index.ts +2 -2
- package/src/next/components/Wizard/types.tsx +19 -29
- package/src/next/components/Wizard/utils.ts +27 -33
- package/src/next/components/Wizard/examples/WizardKitchenSink.tsx +0 -243
|
@@ -7,6 +7,8 @@ exports[`Chip closable 1`] = `
|
|
|
7
7
|
data-ouia-component-id="OUIA-Generated-Chip-2"
|
|
8
8
|
data-ouia-component-type="PF4/Chip"
|
|
9
9
|
data-ouia-safe="true"
|
|
10
|
+
id="chip_one"
|
|
11
|
+
tooltipposition="top"
|
|
10
12
|
>
|
|
11
13
|
<span
|
|
12
14
|
class="pf-c-chip__text"
|
|
@@ -50,6 +52,8 @@ exports[`Chip closable with tooltip 1`] = `
|
|
|
50
52
|
data-ouia-component-id="OUIA-Generated-Chip-3"
|
|
51
53
|
data-ouia-component-type="PF4/Chip"
|
|
52
54
|
data-ouia-safe="true"
|
|
55
|
+
id="chip_one"
|
|
56
|
+
tooltipposition="top"
|
|
53
57
|
>
|
|
54
58
|
<span
|
|
55
59
|
class="pf-c-chip__text"
|
|
@@ -94,6 +98,8 @@ exports[`Chip custom max-width text 1`] = `
|
|
|
94
98
|
data-ouia-component-type="PF4/Chip"
|
|
95
99
|
data-ouia-safe="true"
|
|
96
100
|
style="--pf-c-chip__text--MaxWidth: 100px;"
|
|
101
|
+
textmaxwidth="100px"
|
|
102
|
+
tooltipposition="top"
|
|
97
103
|
>
|
|
98
104
|
<span
|
|
99
105
|
class="pf-c-chip__text"
|
|
@@ -134,9 +140,12 @@ exports[`Chip overflow 1`] = `
|
|
|
134
140
|
<DocumentFragment>
|
|
135
141
|
<div
|
|
136
142
|
class="pf-c-chip pf-m-overflow my-chp-cls"
|
|
143
|
+
closebtnarialabel="close"
|
|
144
|
+
component="div"
|
|
137
145
|
data-ouia-component-id="OUIA-Generated-Chip-1"
|
|
138
146
|
data-ouia-component-type="PF4/OverflowChip"
|
|
139
147
|
data-ouia-safe="true"
|
|
148
|
+
tooltipposition="top"
|
|
140
149
|
>
|
|
141
150
|
<span
|
|
142
151
|
class="pf-c-chip__text"
|
|
@@ -154,6 +163,7 @@ exports[`Chip readonly 1`] = `
|
|
|
154
163
|
data-ouia-component-id="OUIA-Generated-Chip-4"
|
|
155
164
|
data-ouia-component-type="PF4/Chip"
|
|
156
165
|
data-ouia-safe="true"
|
|
166
|
+
tooltipposition="top"
|
|
157
167
|
>
|
|
158
168
|
<span
|
|
159
169
|
class="pf-c-chip__text"
|
|
@@ -164,3 +174,48 @@ exports[`Chip readonly 1`] = `
|
|
|
164
174
|
</div>
|
|
165
175
|
</DocumentFragment>
|
|
166
176
|
`;
|
|
177
|
+
|
|
178
|
+
exports[`Chip with role='gridcell' 1`] = `
|
|
179
|
+
<DocumentFragment>
|
|
180
|
+
<div
|
|
181
|
+
class="pf-c-chip my-chp-cls"
|
|
182
|
+
data-ouia-component-id="OUIA-Generated-Chip-6"
|
|
183
|
+
data-ouia-component-type="PF4/Chip"
|
|
184
|
+
data-ouia-safe="true"
|
|
185
|
+
role="gridcell"
|
|
186
|
+
tooltipposition="top"
|
|
187
|
+
>
|
|
188
|
+
<span
|
|
189
|
+
class="pf-c-chip__text"
|
|
190
|
+
id="pf-random-id-5"
|
|
191
|
+
>
|
|
192
|
+
I'm a roled chip
|
|
193
|
+
</span>
|
|
194
|
+
<button
|
|
195
|
+
aria-disabled="false"
|
|
196
|
+
aria-label="close"
|
|
197
|
+
aria-labelledby="remove_pf-random-id-5 pf-random-id-5"
|
|
198
|
+
class="pf-c-button pf-m-plain"
|
|
199
|
+
data-ouia-component-id="close"
|
|
200
|
+
data-ouia-component-type="PF4/Button"
|
|
201
|
+
data-ouia-safe="true"
|
|
202
|
+
id="remove_pf-random-id-5"
|
|
203
|
+
type="button"
|
|
204
|
+
>
|
|
205
|
+
<svg
|
|
206
|
+
aria-hidden="true"
|
|
207
|
+
fill="currentColor"
|
|
208
|
+
height="1em"
|
|
209
|
+
role="img"
|
|
210
|
+
style="vertical-align: -0.125em;"
|
|
211
|
+
viewBox="0 0 352 512"
|
|
212
|
+
width="1em"
|
|
213
|
+
>
|
|
214
|
+
<path
|
|
215
|
+
d="M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"
|
|
216
|
+
/>
|
|
217
|
+
</svg>
|
|
218
|
+
</button>
|
|
219
|
+
</div>
|
|
220
|
+
</DocumentFragment>
|
|
221
|
+
`;
|
|
@@ -25,6 +25,7 @@ exports[`ChipGroup chip group default 1`] = `
|
|
|
25
25
|
data-ouia-component-id="OUIA-Generated-Chip-1"
|
|
26
26
|
data-ouia-component-type="PF4/Chip"
|
|
27
27
|
data-ouia-safe="true"
|
|
28
|
+
tooltipposition="top"
|
|
28
29
|
>
|
|
29
30
|
<span
|
|
30
31
|
class="pf-c-chip__text"
|
|
@@ -96,6 +97,7 @@ exports[`ChipGroup chip group with category 1`] = `
|
|
|
96
97
|
data-ouia-component-id="OUIA-Generated-Chip-2"
|
|
97
98
|
data-ouia-component-type="PF4/Chip"
|
|
98
99
|
data-ouia-safe="true"
|
|
100
|
+
tooltipposition="top"
|
|
99
101
|
>
|
|
100
102
|
<span
|
|
101
103
|
class="pf-c-chip__text"
|
|
@@ -167,6 +169,7 @@ exports[`ChipGroup chip group with category and tooltip 1`] = `
|
|
|
167
169
|
data-ouia-component-id="OUIA-Generated-Chip-9"
|
|
168
170
|
data-ouia-component-type="PF4/Chip"
|
|
169
171
|
data-ouia-safe="true"
|
|
172
|
+
tooltipposition="top"
|
|
170
173
|
>
|
|
171
174
|
<span
|
|
172
175
|
class="pf-c-chip__text"
|
|
@@ -238,6 +241,7 @@ exports[`ChipGroup chip group with closable category 1`] = `
|
|
|
238
241
|
data-ouia-component-id="OUIA-Generated-Chip-3"
|
|
239
242
|
data-ouia-component-type="PF4/Chip"
|
|
240
243
|
data-ouia-safe="true"
|
|
244
|
+
tooltipposition="top"
|
|
241
245
|
>
|
|
242
246
|
<span
|
|
243
247
|
class="pf-c-chip__text"
|
|
@@ -8,7 +8,7 @@ export interface MenuGroupProps extends Omit<React.HTMLProps<HTMLElement>, 'labe
|
|
|
8
8
|
/** Additional classes added to the MenuGroup */
|
|
9
9
|
className?: string;
|
|
10
10
|
/** Group label */
|
|
11
|
-
label?: React.ReactNode
|
|
11
|
+
label?: React.ReactNode;
|
|
12
12
|
/** ID for title label */
|
|
13
13
|
titleId?: string;
|
|
14
14
|
/** Forwarded ref */
|
|
@@ -32,7 +32,7 @@ const MenuGroupBase: React.FunctionComponent<MenuGroupProps> = ({
|
|
|
32
32
|
<>
|
|
33
33
|
{['function', 'string'].includes(typeof label) ? (
|
|
34
34
|
<Wrapper className={css(styles.menuGroupTitle)} id={titleId}>
|
|
35
|
-
{label
|
|
35
|
+
{label}
|
|
36
36
|
</Wrapper>
|
|
37
37
|
) : (
|
|
38
38
|
label
|
|
@@ -13,84 +13,119 @@ import HelpIcon from '@patternfly/react-icons/dist/esm/icons/help-icon';
|
|
|
13
13
|
|
|
14
14
|
## Examples
|
|
15
15
|
|
|
16
|
-
### Basic
|
|
16
|
+
### Basic modals
|
|
17
|
+
|
|
18
|
+
Basic modals give users the option to either confirm or cancel an action. To flag an open modal, use the `isOpen` property. To execute a callback when a modal is closed, use the `onClose` property.
|
|
17
19
|
|
|
18
20
|
```ts file="./ModalBasic.tsx"
|
|
19
21
|
```
|
|
20
22
|
|
|
21
|
-
###
|
|
23
|
+
### Scrollable modals
|
|
24
|
+
|
|
25
|
+
To enable keyboard-accessible scrolling of a modal’s content, pass `tabIndex={0}` to the `<Modal>`.
|
|
26
|
+
|
|
27
|
+
```ts file="ModalWithOverflowingContent.tsx"
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### With a static description
|
|
31
|
+
|
|
32
|
+
To provide additional information about a modal, use the `description` property. Descriptions are static and do not scroll with other modal content.
|
|
22
33
|
|
|
23
34
|
```ts file="./ModalWithDescription.tsx"
|
|
24
35
|
```
|
|
25
36
|
|
|
26
37
|
### Top aligned
|
|
27
38
|
|
|
39
|
+
To override a modal's default center alignment, use the `position` property. In this example, `position` is set to "top", which moves the modal to the top of the screen.
|
|
40
|
+
|
|
28
41
|
```ts file="./ModalTopAligned.tsx"
|
|
29
42
|
```
|
|
30
43
|
|
|
31
|
-
### Small
|
|
44
|
+
### Small modal
|
|
45
|
+
|
|
46
|
+
To adjust the size of a modal, use the `variant` property. Modal variants include "small", "medium", "large", and "default".
|
|
47
|
+
|
|
48
|
+
The following example displays a "small" modal by passing in `variant={ModalVariant.small}`.
|
|
32
49
|
|
|
33
50
|
```ts file="./ModalSmall.tsx"
|
|
34
51
|
```
|
|
35
52
|
|
|
36
|
-
### Medium
|
|
53
|
+
### Medium modal
|
|
54
|
+
|
|
55
|
+
The following example displays a "medium" modal by passing in `variant={ModalVariant.medium}`.
|
|
37
56
|
|
|
38
57
|
```ts file="./ModalMedium.tsx"
|
|
39
58
|
```
|
|
40
59
|
|
|
41
|
-
### Large
|
|
60
|
+
### Large modal
|
|
61
|
+
|
|
62
|
+
The following example displays a "large" modal by passing in `variant={ModalVariant.large}`.
|
|
42
63
|
|
|
43
64
|
```ts file="./ModalLarge.tsx"
|
|
44
65
|
```
|
|
45
66
|
|
|
46
67
|
### Custom width
|
|
47
68
|
|
|
69
|
+
To choose a specific width for a modal, use the `width` property. The following example has a `width` of "50%".
|
|
70
|
+
|
|
48
71
|
```ts file="./ModalCustomWidth.tsx"
|
|
49
72
|
```
|
|
50
73
|
|
|
51
74
|
### Custom header and footer
|
|
52
75
|
|
|
76
|
+
To add a custom header and footer to a modal, set the `header` and `footer` properties to a custom implementation. The following example passes title components into both the header and the footer and also passes an icon to the footer.
|
|
77
|
+
|
|
53
78
|
```ts file="./ModalCustomHeaderFooter.tsx"
|
|
54
79
|
```
|
|
55
80
|
|
|
56
81
|
### No header or footer
|
|
57
82
|
|
|
83
|
+
To exclusively present information in a modal, remove the `header` and/or `footer`.
|
|
84
|
+
|
|
58
85
|
```ts file="./ModalNoHeaderFooter.tsx"
|
|
59
86
|
```
|
|
60
87
|
|
|
61
88
|
### Title icon
|
|
62
89
|
|
|
90
|
+
To add an icon before a modal’s title, use the `titleIconVariant`, which can be set to one of the predefined variants -- "success", "danger", "warning", "info", and "default" -- or to an imported custom icon. The following example uses a "warning" variant.
|
|
91
|
+
|
|
63
92
|
```ts file="./ModalTitleIcon.tsx"
|
|
64
93
|
```
|
|
65
94
|
|
|
66
95
|
### Custom title icon
|
|
67
96
|
|
|
97
|
+
To add a custom icon before a modal’s title, set `titleIconVariant` to an imported custom icon. The following example imports and uses a bullhorn icon.
|
|
98
|
+
|
|
68
99
|
```ts file="./ModalCustomTitleIcon.tsx"
|
|
69
100
|
```
|
|
70
101
|
|
|
71
102
|
### With wizard
|
|
72
103
|
|
|
104
|
+
To guide users through a series of steps in a modal, you can add a [wizard](/components/wizard) to a modal. To configure the `<Wizard>`, pass an array that contains a “name” and “component” value for each step into the `steps` property.
|
|
105
|
+
|
|
73
106
|
```ts file="./ModalWithWizard.tsx"
|
|
74
107
|
```
|
|
75
108
|
|
|
76
109
|
### With dropdown
|
|
77
110
|
|
|
111
|
+
To present a menu of actions or links to a user, you can add a [dropdown](/components/dropdown) to a modal. To allow the dropdown to visually break out of the modal container, set the `menuAppendTo` property to “parent”. Handle the modal’s closing behavior by listening to the `onEscapePress` callback on the `<Modal>` component. This allows the "escape" key to collapse the dropdown without closing the entire modal.
|
|
112
|
+
|
|
78
113
|
```ts file="./ModalWithDropdown.tsx"
|
|
79
114
|
```
|
|
80
115
|
|
|
81
116
|
### With help
|
|
82
117
|
|
|
118
|
+
To help simplify and explain complex models, add a help [popover](/components/popover). Only place a help icon at the modal level if its information applies to all content in the modal. If the help popover is specific to a particular modal section, place the help icon beside that section instead.
|
|
119
|
+
|
|
83
120
|
```ts file="./ModalWithHelp.tsx"
|
|
84
121
|
```
|
|
85
122
|
|
|
86
123
|
### With form
|
|
87
124
|
|
|
88
|
-
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
### With overflowing content
|
|
125
|
+
To collect user input within a modal, you can add a [form](/components/form).
|
|
92
126
|
|
|
93
|
-
|
|
127
|
+
To submit the form from a button in the modal's footer (outside of the `<Form>`), set the button's `form` property equal to the form's id.
|
|
94
128
|
|
|
95
|
-
```ts file="
|
|
129
|
+
```ts file="ModalWithForm.tsx"
|
|
96
130
|
```
|
|
131
|
+
|
|
@@ -1859,6 +1859,7 @@ exports[`typeahead multi select renders selected successfully 1`] = `
|
|
|
1859
1859
|
data-ouia-component-id="OUIA-Generated-Chip-1"
|
|
1860
1860
|
data-ouia-component-type="PF4/Chip"
|
|
1861
1861
|
data-ouia-safe="true"
|
|
1862
|
+
tooltipposition="top"
|
|
1862
1863
|
>
|
|
1863
1864
|
<span
|
|
1864
1865
|
class="pf-c-chip__text"
|
|
@@ -1901,6 +1902,7 @@ exports[`typeahead multi select renders selected successfully 1`] = `
|
|
|
1901
1902
|
data-ouia-component-id="OUIA-Generated-Chip-2"
|
|
1902
1903
|
data-ouia-component-type="PF4/Chip"
|
|
1903
1904
|
data-ouia-safe="true"
|
|
1905
|
+
tooltipposition="top"
|
|
1904
1906
|
>
|
|
1905
1907
|
<span
|
|
1906
1908
|
class="pf-c-chip__text"
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import styles from '@patternfly/react-styles/css/components/Content/content';
|
|
2
3
|
import { css } from '@patternfly/react-styles';
|
|
3
4
|
|
|
4
5
|
export enum TextListVariants {
|
|
@@ -14,18 +15,21 @@ export interface TextListProps extends React.HTMLProps<HTMLElement> {
|
|
|
14
15
|
className?: string;
|
|
15
16
|
/** The text list component */
|
|
16
17
|
component?: 'ul' | 'ol' | 'dl';
|
|
18
|
+
/** Modifies the list to include plain styling */
|
|
19
|
+
isPlain?: boolean;
|
|
17
20
|
}
|
|
18
21
|
|
|
19
22
|
export const TextList: React.FunctionComponent<TextListProps> = ({
|
|
20
23
|
children = null,
|
|
21
24
|
className = '',
|
|
22
25
|
component = TextListVariants.ul,
|
|
26
|
+
isPlain = false,
|
|
23
27
|
...props
|
|
24
28
|
}: TextListProps) => {
|
|
25
29
|
const Component: any = component;
|
|
26
30
|
|
|
27
31
|
return (
|
|
28
|
-
<Component {...props} className={css(className)}>
|
|
32
|
+
<Component {...props} className={css(isPlain && styles.modifiers.plain, className)}>
|
|
29
33
|
{children}
|
|
30
34
|
</Component>
|
|
31
35
|
);
|
|
@@ -41,6 +41,11 @@ test('Renders as "dl" element when component="dl"', () => {
|
|
|
41
41
|
expect(screen.getByText('Test')).toHaveProperty('nodeName', 'DL');
|
|
42
42
|
});
|
|
43
43
|
|
|
44
|
+
test('Renders with plain modifier class when isPlain is set to true', () => {
|
|
45
|
+
render(<TextList isPlain>Test</TextList>);
|
|
46
|
+
expect(screen.getByRole('list')).toHaveClass('pf-m-plain');
|
|
47
|
+
});
|
|
48
|
+
|
|
44
49
|
test('Renders with inherited element props spread to the component', () => {
|
|
45
50
|
render(<TextList aria-label="Test label">Test</TextList>);
|
|
46
51
|
expect(screen.getByText('Test')).toHaveAccessibleName('Test label');
|
|
@@ -29,6 +29,11 @@ Text components such as Text, TextList, TextListItem need to be placed within a
|
|
|
29
29
|
```ts file="./TextOrderedList.tsx"
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
+
### Plain list
|
|
33
|
+
|
|
34
|
+
```ts file="./TextPlainList.tsx"
|
|
35
|
+
```
|
|
36
|
+
|
|
32
37
|
### Description list
|
|
33
38
|
|
|
34
39
|
```ts file="./TextDescriptionList.tsx"
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Text, TextVariants, TextContent, TextList, TextListVariants, TextListItem } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const TextPlainList: React.FunctionComponent = () => (
|
|
5
|
+
<TextContent>
|
|
6
|
+
<Text component={TextVariants.h3}>Plain unordered list</Text>
|
|
7
|
+
<TextList isPlain>
|
|
8
|
+
<TextListItem>In fermentum leo eu lectus mollis, quis dictum mi aliquet.</TextListItem>
|
|
9
|
+
<TextListItem>Morbi eu nulla lobortis, lobortis est in, fringilla felis.</TextListItem>
|
|
10
|
+
<TextListItem>Aliquam nec felis in sapien venenatis viverra fermentum nec lectus.</TextListItem>
|
|
11
|
+
<TextListItem>Ut non enim metus.</TextListItem>
|
|
12
|
+
</TextList>
|
|
13
|
+
<Text component={TextVariants.h3}>Plain ordered list</Text>
|
|
14
|
+
<TextList component={TextListVariants.ol} isPlain>
|
|
15
|
+
<TextListItem>Donec blandit a lorem id convallis.</TextListItem>
|
|
16
|
+
<TextListItem>Cras gravida arcu at diam gravida gravida.</TextListItem>
|
|
17
|
+
<TextListItem>Integer in volutpat libero.</TextListItem>
|
|
18
|
+
<TextListItem>Donec a diam tellus.</TextListItem>
|
|
19
|
+
<TextListItem>Aenean nec tortor orci.</TextListItem>
|
|
20
|
+
<TextListItem>Quisque aliquam cursus urna, non bibendum massa viverra eget.</TextListItem>
|
|
21
|
+
<TextListItem>Vivamus maximus ultricies pulvinar.</TextListItem>
|
|
22
|
+
</TextList>
|
|
23
|
+
</TextContent>
|
|
24
|
+
);
|
|
@@ -297,6 +297,7 @@ exports[`Toolbar should render with custom chip content 1`] = `
|
|
|
297
297
|
data-ouia-component-id="OUIA-Generated-Chip-1"
|
|
298
298
|
data-ouia-component-type="PF4/Chip"
|
|
299
299
|
data-ouia-safe="true"
|
|
300
|
+
tooltipposition="top"
|
|
300
301
|
>
|
|
301
302
|
<span
|
|
302
303
|
class="pf-c-chip__text"
|
|
@@ -339,6 +340,7 @@ exports[`Toolbar should render with custom chip content 1`] = `
|
|
|
339
340
|
data-ouia-component-id="OUIA-Generated-Chip-2"
|
|
340
341
|
data-ouia-component-type="PF4/Chip"
|
|
341
342
|
data-ouia-safe="true"
|
|
343
|
+
tooltipposition="top"
|
|
342
344
|
>
|
|
343
345
|
<span
|
|
344
346
|
class="pf-c-chip__text"
|
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import findLastIndex from 'lodash/findLastIndex';
|
|
3
2
|
|
|
4
3
|
import { css } from '@patternfly/react-styles';
|
|
5
4
|
import styles from '@patternfly/react-styles/css/components/Wizard/wizard';
|
|
6
5
|
|
|
7
6
|
import {
|
|
8
7
|
isWizardParentStep,
|
|
9
|
-
|
|
10
|
-
WizardControlStep,
|
|
8
|
+
WizardStepType,
|
|
11
9
|
isCustomWizardNav,
|
|
12
10
|
WizardFooterType,
|
|
13
|
-
WizardNavType
|
|
11
|
+
WizardNavType,
|
|
12
|
+
WizardStepChangeScope
|
|
14
13
|
} from './types';
|
|
15
|
-
import { buildSteps
|
|
14
|
+
import { buildSteps } from './utils';
|
|
16
15
|
import { useWizardContext, WizardContextProvider } from './WizardContext';
|
|
17
|
-
import { WizardStepProps } from './WizardStep';
|
|
18
16
|
import { WizardToggle } from './WizardToggle';
|
|
19
17
|
import { WizardNavInternal } from './WizardNavInternal';
|
|
20
18
|
|
|
@@ -25,7 +23,7 @@ import { WizardNavInternal } from './WizardNavInternal';
|
|
|
25
23
|
|
|
26
24
|
export interface WizardProps extends React.HTMLProps<HTMLDivElement> {
|
|
27
25
|
/** Step components */
|
|
28
|
-
children: React.
|
|
26
|
+
children: React.ReactNode | React.ReactNode[];
|
|
29
27
|
/** Wizard header */
|
|
30
28
|
header?: React.ReactNode;
|
|
31
29
|
/** Wizard footer */
|
|
@@ -40,18 +38,21 @@ export interface WizardProps extends React.HTMLProps<HTMLDivElement> {
|
|
|
40
38
|
width?: number | string;
|
|
41
39
|
/** Custom height of the wizard */
|
|
42
40
|
height?: number | string;
|
|
43
|
-
/** Disables
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
|
|
47
|
-
/** Callback function
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
41
|
+
/** Disables steps that haven't been visited. Defaults to false. */
|
|
42
|
+
isVisitRequired?: boolean;
|
|
43
|
+
/** Progressively shows steps, where all steps following the active step are hidden. Defaults to false. */
|
|
44
|
+
isProgressive?: boolean;
|
|
45
|
+
/** Callback function when navigating between steps */
|
|
46
|
+
onStepChange?: (
|
|
47
|
+
event: React.MouseEvent<HTMLButtonElement>,
|
|
48
|
+
currentStep: WizardStepType,
|
|
49
|
+
prevStep: WizardStepType,
|
|
50
|
+
scope: WizardStepChangeScope
|
|
51
|
+
) => void | Promise<void>;
|
|
51
52
|
/** Callback function to save at the end of the wizard, if not specified uses onClose */
|
|
52
|
-
onSave?: () => void | Promise<void>;
|
|
53
|
+
onSave?: (event: React.MouseEvent<HTMLButtonElement>) => void | Promise<void>;
|
|
53
54
|
/** Callback function to close the wizard */
|
|
54
|
-
onClose?: () => void;
|
|
55
|
+
onClose?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
export const Wizard = ({
|
|
@@ -63,48 +64,61 @@ export const Wizard = ({
|
|
|
63
64
|
header,
|
|
64
65
|
nav,
|
|
65
66
|
startIndex = 1,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
onBack,
|
|
67
|
+
isVisitRequired = false,
|
|
68
|
+
isProgressive = false,
|
|
69
|
+
onStepChange,
|
|
70
70
|
onSave,
|
|
71
71
|
onClose,
|
|
72
72
|
...wrapperProps
|
|
73
73
|
}: WizardProps) => {
|
|
74
74
|
const [activeStepIndex, setActiveStepIndex] = React.useState(startIndex);
|
|
75
75
|
const initialSteps = buildSteps(children);
|
|
76
|
+
const firstStepRef = React.useRef(initialSteps[startIndex - 1]);
|
|
76
77
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
// When the startIndex maps to a parent step, focus on the first sub-step
|
|
79
|
+
React.useEffect(() => {
|
|
80
|
+
if (isWizardParentStep(firstStepRef.current)) {
|
|
81
|
+
setActiveStepIndex(startIndex + 1);
|
|
82
|
+
}
|
|
83
|
+
}, [startIndex]);
|
|
84
|
+
|
|
85
|
+
const goToNextStep = (event: React.MouseEvent<HTMLButtonElement>, steps: WizardStepType[] = initialSteps) => {
|
|
86
|
+
const newStep = steps.find(
|
|
87
|
+
step => step.index > activeStepIndex && !step.isHidden && !step.isDisabled && !isWizardParentStep(step)
|
|
88
|
+
);
|
|
80
89
|
|
|
81
|
-
if (activeStepIndex >= steps.length || !
|
|
82
|
-
return onSave ? onSave() : onClose?.();
|
|
90
|
+
if (activeStepIndex >= steps.length || !newStep?.index) {
|
|
91
|
+
return onSave ? onSave(event) : onClose?.(event);
|
|
83
92
|
}
|
|
84
93
|
|
|
85
94
|
const currStep = isWizardParentStep(steps[activeStepIndex]) ? steps[activeStepIndex + 1] : steps[activeStepIndex];
|
|
86
95
|
const prevStep = steps[activeStepIndex - 1];
|
|
87
96
|
|
|
88
|
-
setActiveStepIndex(
|
|
89
|
-
|
|
97
|
+
setActiveStepIndex(newStep?.index);
|
|
98
|
+
onStepChange?.(event, currStep, prevStep, WizardStepChangeScope.Next);
|
|
90
99
|
};
|
|
91
100
|
|
|
92
|
-
const goToPrevStep = (steps:
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
(step:
|
|
97
|
-
|
|
101
|
+
const goToPrevStep = (event: React.MouseEvent<HTMLButtonElement>, steps: WizardStepType[] = initialSteps) => {
|
|
102
|
+
const newStep = [...steps]
|
|
103
|
+
.reverse()
|
|
104
|
+
.find(
|
|
105
|
+
(step: WizardStepType) =>
|
|
106
|
+
step.index < activeStepIndex && !step.isHidden && !step.isDisabled && !isWizardParentStep(step)
|
|
107
|
+
);
|
|
98
108
|
const currStep = isWizardParentStep(steps[activeStepIndex - 2])
|
|
99
109
|
? steps[activeStepIndex - 3]
|
|
100
110
|
: steps[activeStepIndex - 2];
|
|
101
111
|
const prevStep = steps[activeStepIndex - 1];
|
|
102
112
|
|
|
103
|
-
setActiveStepIndex(
|
|
104
|
-
|
|
113
|
+
setActiveStepIndex(newStep?.index);
|
|
114
|
+
onStepChange?.(event, currStep, prevStep, WizardStepChangeScope.Back);
|
|
105
115
|
};
|
|
106
116
|
|
|
107
|
-
const goToStepByIndex = (
|
|
117
|
+
const goToStepByIndex = (
|
|
118
|
+
event: React.MouseEvent<HTMLButtonElement>,
|
|
119
|
+
steps: WizardStepType[] = initialSteps,
|
|
120
|
+
index: number
|
|
121
|
+
) => {
|
|
108
122
|
const lastStepIndex = steps.length + 1;
|
|
109
123
|
|
|
110
124
|
// Handle index when out of bounds or hidden
|
|
@@ -118,25 +132,25 @@ export const Wizard = ({
|
|
|
118
132
|
const prevStep = steps[activeStepIndex - 1];
|
|
119
133
|
|
|
120
134
|
setActiveStepIndex(index);
|
|
121
|
-
|
|
135
|
+
onStepChange?.(event, currStep, prevStep, WizardStepChangeScope.Nav);
|
|
122
136
|
};
|
|
123
137
|
|
|
124
|
-
const goToStepById = (steps:
|
|
138
|
+
const goToStepById = (steps: WizardStepType[] = initialSteps, id: number | string) => {
|
|
125
139
|
const step = steps.find(step => step.id === id);
|
|
126
140
|
const stepIndex = step?.index;
|
|
127
141
|
const lastStepIndex = steps.length + 1;
|
|
128
142
|
|
|
129
|
-
if (stepIndex > 0 && stepIndex < lastStepIndex && !step.isHidden) {
|
|
143
|
+
if (stepIndex > 0 && stepIndex < lastStepIndex && !step.isDisabled && !step.isHidden) {
|
|
130
144
|
setActiveStepIndex(stepIndex);
|
|
131
145
|
}
|
|
132
146
|
};
|
|
133
147
|
|
|
134
|
-
const goToStepByName = (steps:
|
|
148
|
+
const goToStepByName = (steps: WizardStepType[] = initialSteps, name: string) => {
|
|
135
149
|
const step = steps.find(step => step.name === name);
|
|
136
150
|
const stepIndex = step?.index;
|
|
137
151
|
const lastStepIndex = steps.length + 1;
|
|
138
152
|
|
|
139
|
-
if (stepIndex > 0 && stepIndex < lastStepIndex && !step.isHidden) {
|
|
153
|
+
if (stepIndex > 0 && stepIndex < lastStepIndex && !step.isDisabled && !step.isHidden) {
|
|
140
154
|
setActiveStepIndex(stepIndex);
|
|
141
155
|
}
|
|
142
156
|
};
|
|
@@ -162,13 +176,17 @@ export const Wizard = ({
|
|
|
162
176
|
{...wrapperProps}
|
|
163
177
|
>
|
|
164
178
|
{header}
|
|
165
|
-
<WizardInternal nav={nav}
|
|
179
|
+
<WizardInternal nav={nav} isVisitRequired={isVisitRequired} isProgressive={isProgressive} />
|
|
166
180
|
</div>
|
|
167
181
|
</WizardContextProvider>
|
|
168
182
|
);
|
|
169
183
|
};
|
|
170
184
|
|
|
171
|
-
const WizardInternal = ({
|
|
185
|
+
const WizardInternal = ({
|
|
186
|
+
nav,
|
|
187
|
+
isVisitRequired,
|
|
188
|
+
isProgressive
|
|
189
|
+
}: Pick<WizardProps, 'nav' | 'isVisitRequired' | 'isProgressive'>) => {
|
|
172
190
|
const { activeStep, steps, footer, goToStepByIndex } = useWizardContext();
|
|
173
191
|
const [isNavExpanded, setIsNavExpanded] = React.useState(false);
|
|
174
192
|
|
|
@@ -177,8 +195,15 @@ const WizardInternal = ({ nav, isStepVisitRequired }: Pick<WizardProps, 'nav' |
|
|
|
177
195
|
return typeof nav === 'function' ? nav(isNavExpanded, steps, activeStep, goToStepByIndex) : nav;
|
|
178
196
|
}
|
|
179
197
|
|
|
180
|
-
return
|
|
181
|
-
|
|
198
|
+
return (
|
|
199
|
+
<WizardNavInternal
|
|
200
|
+
nav={nav}
|
|
201
|
+
isNavExpanded={isNavExpanded}
|
|
202
|
+
isVisitRequired={isVisitRequired}
|
|
203
|
+
isProgressive={isProgressive}
|
|
204
|
+
/>
|
|
205
|
+
);
|
|
206
|
+
}, [activeStep, isVisitRequired, isProgressive, goToStepByIndex, isNavExpanded, nav, steps]);
|
|
182
207
|
|
|
183
208
|
return (
|
|
184
209
|
<WizardToggle
|