@patternfly/react-core 4.255.0 → 4.255.2
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 +19 -0
- package/dist/esm/components/Alert/AlertIcon.js +1 -1
- package/dist/esm/components/Alert/AlertIcon.js.map +1 -1
- package/dist/esm/next/components/Wizard/Wizard.d.ts +1 -3
- package/dist/esm/next/components/Wizard/Wizard.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/Wizard.js +36 -45
- package/dist/esm/next/components/Wizard/Wizard.js.map +1 -1
- package/dist/esm/next/components/Wizard/WizardBody.d.ts +2 -2
- package/dist/esm/next/components/Wizard/WizardBody.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/WizardBody.js +2 -2
- package/dist/esm/next/components/Wizard/WizardBody.js.map +1 -1
- package/dist/esm/next/components/Wizard/WizardContext.d.ts +2 -7
- package/dist/esm/next/components/Wizard/WizardContext.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/WizardContext.js +18 -39
- package/dist/esm/next/components/Wizard/WizardContext.js.map +1 -1
- package/dist/esm/next/components/Wizard/WizardFooter.d.ts +3 -3
- package/dist/esm/next/components/Wizard/WizardFooter.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/WizardFooter.js +3 -3
- package/dist/esm/next/components/Wizard/WizardFooter.js.map +1 -1
- package/dist/esm/next/components/Wizard/WizardNavInternal.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/WizardNavInternal.js +12 -12
- package/dist/esm/next/components/Wizard/WizardNavInternal.js.map +1 -1
- package/dist/esm/next/components/Wizard/WizardStep.d.ts +1 -3
- package/dist/esm/next/components/Wizard/WizardStep.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/WizardStep.js +10 -18
- package/dist/esm/next/components/Wizard/WizardStep.js.map +1 -1
- package/dist/esm/next/components/Wizard/WizardToggle.d.ts +2 -4
- package/dist/esm/next/components/Wizard/WizardToggle.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/WizardToggle.js +19 -16
- package/dist/esm/next/components/Wizard/WizardToggle.js.map +1 -1
- package/dist/esm/next/components/Wizard/hooks/useWizardFooter.js +3 -3
- package/dist/esm/next/components/Wizard/hooks/useWizardFooter.js.map +1 -1
- package/dist/esm/next/components/Wizard/types.d.ts +5 -3
- package/dist/esm/next/components/Wizard/types.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/types.js.map +1 -1
- package/dist/esm/next/components/Wizard/utils.d.ts +3 -3
- package/dist/esm/next/components/Wizard/utils.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/utils.js +14 -11
- package/dist/esm/next/components/Wizard/utils.js.map +1 -1
- package/dist/js/components/Alert/AlertIcon.js +1 -1
- package/dist/js/components/Alert/AlertIcon.js.map +1 -1
- package/dist/js/next/components/Wizard/Wizard.d.ts +1 -3
- package/dist/js/next/components/Wizard/Wizard.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/Wizard.js +36 -45
- package/dist/js/next/components/Wizard/Wizard.js.map +1 -1
- package/dist/js/next/components/Wizard/WizardBody.d.ts +2 -2
- package/dist/js/next/components/Wizard/WizardBody.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/WizardBody.js +2 -2
- package/dist/js/next/components/Wizard/WizardBody.js.map +1 -1
- package/dist/js/next/components/Wizard/WizardContext.d.ts +2 -7
- package/dist/js/next/components/Wizard/WizardContext.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/WizardContext.js +15 -37
- package/dist/js/next/components/Wizard/WizardContext.js.map +1 -1
- package/dist/js/next/components/Wizard/WizardFooter.d.ts +3 -3
- package/dist/js/next/components/Wizard/WizardFooter.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/WizardFooter.js +3 -3
- package/dist/js/next/components/Wizard/WizardFooter.js.map +1 -1
- package/dist/js/next/components/Wizard/WizardNavInternal.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/WizardNavInternal.js +12 -12
- package/dist/js/next/components/Wizard/WizardNavInternal.js.map +1 -1
- package/dist/js/next/components/Wizard/WizardStep.d.ts +1 -3
- package/dist/js/next/components/Wizard/WizardStep.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/WizardStep.js +9 -18
- package/dist/js/next/components/Wizard/WizardStep.js.map +1 -1
- package/dist/js/next/components/Wizard/WizardToggle.d.ts +2 -4
- package/dist/js/next/components/Wizard/WizardToggle.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/WizardToggle.js +18 -16
- package/dist/js/next/components/Wizard/WizardToggle.js.map +1 -1
- package/dist/js/next/components/Wizard/hooks/useWizardFooter.js +3 -3
- package/dist/js/next/components/Wizard/hooks/useWizardFooter.js.map +1 -1
- package/dist/js/next/components/Wizard/types.d.ts +5 -3
- package/dist/js/next/components/Wizard/types.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/types.js.map +1 -1
- package/dist/js/next/components/Wizard/utils.d.ts +3 -3
- package/dist/js/next/components/Wizard/utils.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/utils.js +16 -13
- package/dist/js/next/components/Wizard/utils.js.map +1 -1
- package/dist/umd/react-core.min.css +812 -812
- package/dist/umd/react-core.min.js +1 -1
- package/package.json +2 -2
- package/src/components/Alert/AlertIcon.tsx +2 -2
- package/src/components/Button/__tests__/Button.test.tsx +16 -7
- package/src/components/Button/__tests__/__snapshots__/Button.test.tsx.snap +36 -0
- package/src/components/Button/examples/ButtonProgress.tsx +15 -2
- package/src/components/Wizard/examples/Wizard.md +11 -7
- package/src/next/components/Wizard/Wizard.tsx +35 -54
- package/src/next/components/Wizard/WizardBody.tsx +3 -3
- package/src/next/components/Wizard/WizardContext.tsx +29 -61
- package/src/next/components/Wizard/WizardFooter.tsx +6 -6
- package/src/next/components/Wizard/WizardNavInternal.tsx +18 -17
- package/src/next/components/Wizard/WizardStep.tsx +19 -30
- package/src/next/components/Wizard/WizardToggle.tsx +22 -24
- package/src/next/components/Wizard/__tests__/Wizard.test.tsx +1 -21
- package/src/next/components/Wizard/__tests__/WizardBody.test.tsx +2 -2
- package/src/next/components/Wizard/__tests__/WizardFooter.test.tsx +5 -5
- package/src/next/components/Wizard/__tests__/WizardStep.test.tsx +22 -76
- package/src/next/components/Wizard/__tests__/WizardToggle.test.tsx +7 -11
- package/src/next/components/Wizard/__tests__/utils.test.tsx +3 -3
- package/src/next/components/Wizard/examples/Wizard.md +4 -4
- package/src/next/components/Wizard/examples/WizardCustomNav.tsx +4 -4
- package/src/next/components/Wizard/examples/WizardKitchenSink.tsx +74 -85
- package/src/next/components/Wizard/hooks/__tests__/useWizardFooter.test.tsx +4 -4
- package/src/next/components/Wizard/hooks/useWizardFooter.tsx +3 -3
- package/src/next/components/Wizard/types.tsx +5 -3
- package/src/next/components/Wizard/utils.ts +35 -25
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getActiveStep = exports.normalizeNavStep = exports.normalizeStep = exports.isWizardStep = exports.buildSteps = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
6
|
const WizardStep_1 = require("./WizardStep");
|
|
@@ -11,16 +11,19 @@ const WizardStep_1 = require("./WizardStep");
|
|
|
11
11
|
*/
|
|
12
12
|
const buildSteps = (children) => react_1.default.Children.toArray(children).reduce((acc, child) => {
|
|
13
13
|
if (isWizardStep(child)) {
|
|
14
|
-
const { steps: subSteps, id } = child.props;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
const { steps: subSteps, id, isHidden, isDisabled } = child.props;
|
|
15
|
+
const subControlledSteps = [];
|
|
16
|
+
const stepIndex = acc.length + 1;
|
|
17
|
+
acc.push(Object.assign(Object.assign(Object.assign({ index: stepIndex, component: child }, (stepIndex === 1 && { isVisited: true })), (subSteps && {
|
|
18
|
+
subStepIds: subSteps === null || subSteps === void 0 ? void 0 : subSteps.map((subStep, subStepIndex) => {
|
|
19
|
+
subControlledSteps.push(Object.assign({ isHidden,
|
|
20
|
+
isDisabled, component: subStep, parentId: id, index: stepIndex + subStepIndex + 1 }, exports.normalizeStep(subStep.props)));
|
|
18
21
|
return subStep.props.id;
|
|
19
22
|
})
|
|
20
|
-
})));
|
|
23
|
+
})), exports.normalizeStep(child.props)), ...subControlledSteps);
|
|
21
24
|
}
|
|
22
25
|
else {
|
|
23
|
-
throw new Error('Wizard only accepts children
|
|
26
|
+
throw new Error('Wizard only accepts children with required WizardStepProps.');
|
|
24
27
|
}
|
|
25
28
|
return acc;
|
|
26
29
|
}, []);
|
|
@@ -33,16 +36,16 @@ function isWizardStep(child) {
|
|
|
33
36
|
exports.isWizardStep = isWizardStep;
|
|
34
37
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
35
38
|
const normalizeStep = (_a) => {
|
|
36
|
-
var { children, steps
|
|
39
|
+
var { children, steps } = _a, controlStep = tslib_1.__rest(_a, ["children", "steps"]);
|
|
37
40
|
return controlStep;
|
|
38
41
|
};
|
|
39
42
|
exports.normalizeStep = normalizeStep;
|
|
40
|
-
const normalizeNavStep = (navStep
|
|
43
|
+
const normalizeNavStep = (navStep) => ({
|
|
41
44
|
id: navStep.id,
|
|
42
|
-
|
|
43
|
-
|
|
45
|
+
index: navStep.index,
|
|
46
|
+
name: navStep.name.toString()
|
|
44
47
|
});
|
|
45
48
|
exports.normalizeNavStep = normalizeNavStep;
|
|
46
|
-
const
|
|
47
|
-
exports.
|
|
49
|
+
const getActiveStep = (steps, activeStepIndex) => steps.find(step => step.index === activeStepIndex);
|
|
50
|
+
exports.getActiveStep = getActiveStep;
|
|
48
51
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/utils.ts"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAG1B,6CAA2D;AAE3D;;;;GAIG;AACI,MAAM,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