@patternfly/react-core 4.224.11 → 4.224.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 +24 -0
- package/dist/esm/components/DragDrop/DragDrop.d.ts +1 -1
- package/dist/esm/components/DragDrop/DragDrop.d.ts.map +1 -1
- package/dist/esm/components/Wizard/Wizard.d.ts +2 -0
- package/dist/esm/components/Wizard/Wizard.d.ts.map +1 -1
- package/dist/esm/components/Wizard/Wizard.js +26 -5
- package/dist/esm/components/Wizard/Wizard.js.map +1 -1
- package/dist/esm/helpers/OUIA/ouia.d.ts.map +1 -1
- package/dist/esm/helpers/OUIA/ouia.js +2 -4
- package/dist/esm/helpers/OUIA/ouia.js.map +1 -1
- package/dist/js/components/DragDrop/DragDrop.d.ts +1 -1
- package/dist/js/components/DragDrop/DragDrop.d.ts.map +1 -1
- package/dist/js/components/Wizard/Wizard.d.ts +2 -0
- package/dist/js/components/Wizard/Wizard.d.ts.map +1 -1
- package/dist/js/components/Wizard/Wizard.js +26 -5
- package/dist/js/components/Wizard/Wizard.js.map +1 -1
- package/dist/js/helpers/OUIA/ouia.d.ts.map +1 -1
- package/dist/js/helpers/OUIA/ouia.js +2 -4
- package/dist/js/helpers/OUIA/ouia.js.map +1 -1
- package/dist/umd/react-core.css +759 -759
- package/dist/umd/react-core.js +28 -9
- package/dist/umd/react-core.min.js +2 -2
- package/package.json +6 -6
- package/src/components/Accordion/__tests__/Accordion.test.tsx +134 -104
- package/src/components/Accordion/__tests__/AccordionContent.test.tsx +180 -0
- package/src/components/Accordion/__tests__/AccordionExpandedContentBody.test.tsx +33 -0
- package/src/components/Accordion/__tests__/AccordionItem.test.tsx +18 -0
- package/src/components/Accordion/__tests__/AccordionToggle.test.tsx +164 -0
- package/src/components/Accordion/__tests__/__snapshots__/Accordion.test.tsx.snap +1 -214
- package/src/components/Accordion/__tests__/__snapshots__/AccordionContent.test.tsx.snap +17 -0
- package/src/components/Accordion/__tests__/__snapshots__/AccordionExpandedContentBody.test.tsx.snap +19 -0
- package/src/components/Accordion/__tests__/__snapshots__/AccordionItem.test.tsx.snap +7 -0
- package/src/components/Accordion/__tests__/__snapshots__/AccordionToggle.test.tsx.snap +25 -0
- package/src/components/DragDrop/DragDrop.tsx +1 -1
- package/src/components/Hint/__tests__/Hint.test.tsx +63 -10
- package/src/components/Hint/__tests__/HintBody.test.tsx +47 -0
- package/src/components/Hint/__tests__/HintFooter.test.tsx +47 -0
- package/src/components/Hint/__tests__/HintTitle.test.tsx +47 -0
- package/src/components/Hint/__tests__/__snapshots__/Hint.test.tsx.snap +1 -16
- package/src/components/Hint/__tests__/__snapshots__/HintBody.test.tsx.snap +13 -0
- package/src/components/Hint/__tests__/__snapshots__/HintFooter.test.tsx.snap +13 -0
- package/src/components/Hint/__tests__/__snapshots__/HintTitle.test.tsx.snap +13 -0
- package/src/components/Wizard/Wizard.tsx +37 -5
- package/src/components/Wizard/__tests__/Wizard.test.tsx +92 -0
- package/src/components/Wizard/examples/Wizard.md +25 -0
- package/src/helpers/OUIA/ouia.ts +2 -4
package/dist/umd/react-core.js
CHANGED
|
@@ -1507,10 +1507,8 @@
|
|
|
1507
1507
|
* @param {string} variant Optional variant to add to the generated ID
|
|
1508
1508
|
*/
|
|
1509
1509
|
const useOUIAId = (componentType, id, variant) => {
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
}
|
|
1513
|
-
return React.useMemo(() => getDefaultOUIAId(componentType, variant), [componentType, variant]);
|
|
1510
|
+
const defaultOUIAId = React.useMemo(() => getDefaultOUIAId(componentType, variant), [componentType, variant]);
|
|
1511
|
+
return id !== null && id !== void 0 ? id : defaultOUIAId;
|
|
1514
1512
|
};
|
|
1515
1513
|
/**
|
|
1516
1514
|
* Returns a generated id based on the URL location
|
|
@@ -21017,7 +21015,16 @@
|
|
|
21017
21015
|
return onClose();
|
|
21018
21016
|
}
|
|
21019
21017
|
else {
|
|
21020
|
-
|
|
21018
|
+
let newStep = currentStep;
|
|
21019
|
+
for (let nextStep = currentStep; nextStep <= maxSteps; nextStep++) {
|
|
21020
|
+
if (!flattenedSteps[nextStep]) {
|
|
21021
|
+
return;
|
|
21022
|
+
}
|
|
21023
|
+
if (!flattenedSteps[nextStep].isDisabled) {
|
|
21024
|
+
newStep = nextStep + 1;
|
|
21025
|
+
break;
|
|
21026
|
+
}
|
|
21027
|
+
}
|
|
21021
21028
|
this.setState({
|
|
21022
21029
|
currentStep: newStep
|
|
21023
21030
|
});
|
|
@@ -21038,7 +21045,16 @@
|
|
|
21038
21045
|
});
|
|
21039
21046
|
}
|
|
21040
21047
|
else {
|
|
21041
|
-
|
|
21048
|
+
let newStep = currentStep;
|
|
21049
|
+
for (let prevStep = currentStep; prevStep >= 0; prevStep--) {
|
|
21050
|
+
if (!flattenedSteps[prevStep - 2]) {
|
|
21051
|
+
return;
|
|
21052
|
+
}
|
|
21053
|
+
if (!flattenedSteps[prevStep - 2].isDisabled) {
|
|
21054
|
+
newStep = prevStep - 1 <= 1 ? 1 : prevStep - 1;
|
|
21055
|
+
break;
|
|
21056
|
+
}
|
|
21057
|
+
}
|
|
21042
21058
|
this.setState({
|
|
21043
21059
|
currentStep: newStep
|
|
21044
21060
|
});
|
|
@@ -21048,9 +21064,12 @@
|
|
|
21048
21064
|
}
|
|
21049
21065
|
};
|
|
21050
21066
|
this.goToStep = (step) => {
|
|
21067
|
+
const flattenedSteps = this.getFlattenedSteps();
|
|
21068
|
+
if (flattenedSteps[step - 1].isDisabled) {
|
|
21069
|
+
return;
|
|
21070
|
+
}
|
|
21051
21071
|
const { onGoToStep } = this.props;
|
|
21052
21072
|
const { currentStep } = this.state;
|
|
21053
|
-
const flattenedSteps = this.getFlattenedSteps();
|
|
21054
21073
|
const maxSteps = flattenedSteps.length;
|
|
21055
21074
|
if (step < 1) {
|
|
21056
21075
|
step = 1;
|
|
@@ -21197,12 +21216,12 @@
|
|
|
21197
21216
|
return;
|
|
21198
21217
|
}
|
|
21199
21218
|
navItemStep = this.getFlattenedStepsIndex(flattenedSteps, childStep.name);
|
|
21200
|
-
enabled = childStep.canJumpTo;
|
|
21219
|
+
enabled = childStep.canJumpTo && !childStep.isDisabled;
|
|
21201
21220
|
return (React__namespace.createElement(WizardNavItem, { key: `child_${indexChild}`, id: childStep.id, content: childStep.name, isCurrent: activeStep.name === childStep.name, isDisabled: !enabled, step: navItemStep, onNavItemClick: this.goToStep }));
|
|
21202
21221
|
}))));
|
|
21203
21222
|
}
|
|
21204
21223
|
navItemStep = this.getFlattenedStepsIndex(flattenedSteps, step.name);
|
|
21205
|
-
enabled = step.canJumpTo;
|
|
21224
|
+
enabled = step.canJumpTo && !step.isDisabled;
|
|
21206
21225
|
return (React__namespace.createElement(WizardNavItem, Object.assign({}, step.stepNavItemProps, { key: index, id: step.id, content: step.name, isCurrent: activeStep.name === step.name, isDisabled: !enabled, step: navItemStep, onNavItemClick: this.goToStep })));
|
|
21207
21226
|
})));
|
|
21208
21227
|
};
|