@patternfly/react-core 4.234.3 → 4.235.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 +27 -0
- package/dist/esm/next/components/Wizard/Wizard.d.ts +40 -0
- package/dist/esm/next/components/Wizard/Wizard.d.ts.map +1 -0
- package/dist/esm/next/components/Wizard/Wizard.js +86 -0
- package/dist/esm/next/components/Wizard/Wizard.js.map +1 -0
- package/dist/esm/next/components/Wizard/WizardBody.d.ts +20 -0
- package/dist/esm/next/components/Wizard/WizardBody.d.ts.map +1 -0
- package/dist/esm/next/components/Wizard/WizardBody.js +7 -0
- package/dist/esm/next/components/Wizard/WizardBody.js.map +1 -0
- package/dist/esm/next/components/Wizard/WizardContext.d.ts +49 -0
- package/dist/esm/next/components/Wizard/WizardContext.d.ts.map +1 -0
- package/dist/esm/next/components/Wizard/WizardContext.js +34 -0
- package/dist/esm/next/components/Wizard/WizardContext.js.map +1 -0
- package/dist/esm/next/components/Wizard/WizardFooter.d.ts +28 -0
- package/dist/esm/next/components/Wizard/WizardFooter.d.ts.map +1 -0
- package/dist/esm/next/components/Wizard/WizardFooter.js +11 -0
- package/dist/esm/next/components/Wizard/WizardFooter.js.map +1 -0
- package/dist/esm/next/components/Wizard/WizardHeader.d.ts +21 -0
- package/dist/esm/next/components/Wizard/WizardHeader.d.ts.map +1 -0
- package/dist/esm/next/components/Wizard/WizardHeader.js +13 -0
- package/dist/esm/next/components/Wizard/WizardHeader.js.map +1 -0
- package/dist/esm/next/components/Wizard/WizardNav.d.ts +15 -0
- package/dist/esm/next/components/Wizard/WizardNav.d.ts.map +1 -0
- package/dist/esm/next/components/Wizard/WizardNav.js +13 -0
- package/dist/esm/next/components/Wizard/WizardNav.js.map +1 -0
- package/dist/esm/next/components/Wizard/WizardNavItem.d.ts +25 -0
- package/dist/esm/next/components/Wizard/WizardNavItem.d.ts.map +1 -0
- package/dist/esm/next/components/Wizard/WizardNavItem.js +33 -0
- package/dist/esm/next/components/Wizard/WizardNavItem.js.map +1 -0
- package/dist/esm/next/components/Wizard/WizardStep.d.ts +20 -0
- package/dist/esm/next/components/Wizard/WizardStep.d.ts.map +1 -0
- package/dist/esm/next/components/Wizard/WizardStep.js +5 -0
- package/dist/esm/next/components/Wizard/WizardStep.js.map +1 -0
- package/dist/esm/next/components/Wizard/WizardToggle.d.ts +26 -0
- package/dist/esm/next/components/Wizard/WizardToggle.d.ts.map +1 -0
- package/dist/esm/next/components/Wizard/WizardToggle.js +81 -0
- package/dist/esm/next/components/Wizard/WizardToggle.js.map +1 -0
- package/dist/esm/next/components/Wizard/hooks/index.d.ts +2 -0
- package/dist/esm/next/components/Wizard/hooks/index.d.ts.map +1 -0
- package/dist/esm/next/components/Wizard/hooks/index.js +2 -0
- package/dist/esm/next/components/Wizard/hooks/index.js.map +1 -0
- package/dist/esm/next/components/Wizard/hooks/useWizardFooter.d.ts +8 -0
- package/dist/esm/next/components/Wizard/hooks/useWizardFooter.d.ts.map +1 -0
- package/dist/esm/next/components/Wizard/hooks/useWizardFooter.js +20 -0
- package/dist/esm/next/components/Wizard/hooks/useWizardFooter.js.map +1 -0
- package/dist/esm/next/components/Wizard/index.d.ts +12 -0
- package/dist/esm/next/components/Wizard/index.d.ts.map +1 -0
- package/dist/esm/next/components/Wizard/index.js +12 -0
- package/dist/esm/next/components/Wizard/index.js.map +1 -0
- package/dist/esm/next/components/Wizard/types.d.ts +69 -0
- package/dist/esm/next/components/Wizard/types.d.ts.map +1 -0
- package/dist/esm/next/components/Wizard/types.js +20 -0
- package/dist/esm/next/components/Wizard/types.js.map +1 -0
- package/dist/esm/next/components/Wizard/utils.d.ts +15 -0
- package/dist/esm/next/components/Wizard/utils.d.ts.map +1 -0
- package/dist/esm/next/components/Wizard/utils.js +35 -0
- package/dist/esm/next/components/Wizard/utils.js.map +1 -0
- package/dist/esm/next/components/index.d.ts +1 -1
- package/dist/esm/next/components/index.d.ts.map +1 -1
- package/dist/esm/next/components/index.js +1 -1
- package/dist/esm/next/components/index.js.map +1 -1
- package/dist/js/next/components/Wizard/Wizard.d.ts +40 -0
- package/dist/js/next/components/Wizard/Wizard.d.ts.map +1 -0
- package/dist/js/next/components/Wizard/Wizard.js +90 -0
- package/dist/js/next/components/Wizard/Wizard.js.map +1 -0
- package/dist/js/next/components/Wizard/WizardBody.d.ts +20 -0
- package/dist/js/next/components/Wizard/WizardBody.d.ts.map +1 -0
- package/dist/js/next/components/Wizard/WizardBody.js +12 -0
- package/dist/js/next/components/Wizard/WizardBody.js.map +1 -0
- package/dist/js/next/components/Wizard/WizardContext.d.ts +49 -0
- package/dist/js/next/components/Wizard/WizardContext.d.ts.map +1 -0
- package/dist/js/next/components/Wizard/WizardContext.js +40 -0
- package/dist/js/next/components/Wizard/WizardContext.js.map +1 -0
- package/dist/js/next/components/Wizard/WizardFooter.d.ts +28 -0
- package/dist/js/next/components/Wizard/WizardFooter.d.ts.map +1 -0
- package/dist/js/next/components/Wizard/WizardFooter.js +16 -0
- package/dist/js/next/components/Wizard/WizardFooter.js.map +1 -0
- package/dist/js/next/components/Wizard/WizardHeader.d.ts +21 -0
- package/dist/js/next/components/Wizard/WizardHeader.d.ts.map +1 -0
- package/dist/js/next/components/Wizard/WizardHeader.js +18 -0
- package/dist/js/next/components/Wizard/WizardHeader.js.map +1 -0
- package/dist/js/next/components/Wizard/WizardNav.d.ts +15 -0
- package/dist/js/next/components/Wizard/WizardNav.d.ts.map +1 -0
- package/dist/js/next/components/Wizard/WizardNav.js +18 -0
- package/dist/js/next/components/Wizard/WizardNav.js.map +1 -0
- package/dist/js/next/components/Wizard/WizardNavItem.d.ts +25 -0
- package/dist/js/next/components/Wizard/WizardNavItem.d.ts.map +1 -0
- package/dist/js/next/components/Wizard/WizardNavItem.js +37 -0
- package/dist/js/next/components/Wizard/WizardNavItem.js.map +1 -0
- package/dist/js/next/components/Wizard/WizardStep.d.ts +20 -0
- package/dist/js/next/components/Wizard/WizardStep.d.ts.map +1 -0
- package/dist/js/next/components/Wizard/WizardStep.js +10 -0
- package/dist/js/next/components/Wizard/WizardStep.js.map +1 -0
- package/dist/js/next/components/Wizard/WizardToggle.d.ts +26 -0
- package/dist/js/next/components/Wizard/WizardToggle.d.ts.map +1 -0
- package/dist/js/next/components/Wizard/WizardToggle.js +86 -0
- package/dist/js/next/components/Wizard/WizardToggle.js.map +1 -0
- package/dist/js/next/components/Wizard/hooks/index.d.ts +2 -0
- package/dist/js/next/components/Wizard/hooks/index.d.ts.map +1 -0
- package/dist/js/next/components/Wizard/hooks/index.js +6 -0
- package/dist/js/next/components/Wizard/hooks/index.js.map +1 -0
- package/dist/js/next/components/Wizard/hooks/useWizardFooter.d.ts +8 -0
- package/dist/js/next/components/Wizard/hooks/useWizardFooter.d.ts.map +1 -0
- package/dist/js/next/components/Wizard/hooks/useWizardFooter.js +25 -0
- package/dist/js/next/components/Wizard/hooks/useWizardFooter.js.map +1 -0
- package/dist/js/next/components/Wizard/index.d.ts +12 -0
- package/dist/js/next/components/Wizard/index.d.ts.map +1 -0
- package/dist/js/next/components/Wizard/index.js +17 -0
- package/dist/js/next/components/Wizard/index.js.map +1 -0
- package/dist/js/next/components/Wizard/types.d.ts +69 -0
- package/dist/js/next/components/Wizard/types.d.ts.map +1 -0
- package/dist/js/next/components/Wizard/types.js +29 -0
- package/dist/js/next/components/Wizard/types.js.map +1 -0
- package/dist/js/next/components/Wizard/utils.d.ts +15 -0
- package/dist/js/next/components/Wizard/utils.d.ts.map +1 -0
- package/dist/js/next/components/Wizard/utils.js +41 -0
- package/dist/js/next/components/Wizard/utils.js.map +1 -0
- package/dist/js/next/components/index.d.ts +1 -1
- package/dist/js/next/components/index.d.ts.map +1 -1
- package/dist/js/next/components/index.js +1 -1
- package/dist/js/next/components/index.js.map +1 -1
- package/dist/umd/react-core.css +230 -230
- package/dist/umd/react-core.min.css +734 -734
- package/package.json +5 -5
- package/src/components/Card/examples/Card.md +67 -38
- package/src/components/Wizard/examples/Wizard.md +21 -4
- package/src/demos/CardDemos.md +4 -0
- package/src/next/components/Wizard/Wizard.tsx +184 -0
- package/src/next/components/Wizard/WizardBody.tsx +34 -0
- package/src/next/components/Wizard/WizardContext.tsx +104 -0
- package/src/next/components/Wizard/WizardFooter.tsx +63 -0
- package/src/next/components/Wizard/WizardHeader.tsx +53 -0
- package/src/next/components/Wizard/WizardNav.tsx +41 -0
- package/src/next/components/Wizard/WizardNavItem.tsx +103 -0
- package/src/next/components/Wizard/WizardStep.tsx +23 -0
- package/src/next/components/Wizard/WizardToggle.tsx +209 -0
- package/src/next/components/Wizard/__tests__/Wizard.test.tsx +298 -0
- package/src/next/components/Wizard/examples/Wizard.md +125 -0
- package/src/next/components/Wizard/examples/WizardBasic.tsx +22 -0
- package/src/next/components/Wizard/examples/WizardCustomNav.tsx +46 -0
- package/src/next/components/Wizard/examples/WizardKitchenSink.tsx +170 -0
- package/src/next/components/Wizard/hooks/index.ts +1 -0
- package/src/next/components/Wizard/hooks/useWizardFooter.tsx +22 -0
- package/src/next/components/Wizard/index.ts +11 -0
- package/src/next/components/Wizard/types.tsx +101 -0
- package/src/next/components/Wizard/utils.ts +47 -0
- package/src/next/components/index.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,33 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 4.235.1 (2022-08-24)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @patternfly/react-core
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# 4.235.0 (2022-08-23)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* **WizardComposable:** Created composable spinoff of wizard w/ enhancements ([#7703](https://github.com/patternfly/patternfly-react/issues/7703)) ([76eab29](https://github.com/patternfly/patternfly-react/commit/76eab29b640e2f71cd9bd5d42f58fa8dd0eba799))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## 4.234.4 (2022-08-23)
|
|
26
|
+
|
|
27
|
+
**Note:** Version bump only for package @patternfly/react-core
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
6
33
|
## 4.234.3 (2022-08-23)
|
|
7
34
|
|
|
8
35
|
**Note:** Version bump only for package @patternfly/react-core
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DefaultWizardFooterProps, DefaultWizardNavProps, WizardNavStepFunction, CustomWizardNavFunction } from './types';
|
|
3
|
+
import { WizardStepProps } from './WizardStep';
|
|
4
|
+
/**
|
|
5
|
+
* Wrapper for all steps and hosts state, including navigation helpers, within context.
|
|
6
|
+
* The WizardContext provided by default gives any child of wizard access to those resources.
|
|
7
|
+
*/
|
|
8
|
+
export interface WizardProps extends React.HTMLProps<HTMLDivElement> {
|
|
9
|
+
/** Step components */
|
|
10
|
+
children: React.ReactElement<WizardStepProps> | React.ReactElement<WizardStepProps>[];
|
|
11
|
+
/** Wizard header */
|
|
12
|
+
header?: React.ReactNode;
|
|
13
|
+
/** Wizard footer */
|
|
14
|
+
footer?: DefaultWizardFooterProps | React.ReactElement;
|
|
15
|
+
/** Default wizard nav props or a custom WizardNav (with callback) */
|
|
16
|
+
nav?: DefaultWizardNavProps | CustomWizardNavFunction;
|
|
17
|
+
/** The initial index the wizard is to start on (1 or higher). Defaults to 1. */
|
|
18
|
+
startIndex?: number;
|
|
19
|
+
/** Additional classes spread to the wizard */
|
|
20
|
+
className?: string;
|
|
21
|
+
/** Custom width of the wizard */
|
|
22
|
+
width?: number | string;
|
|
23
|
+
/** Custom height of the wizard */
|
|
24
|
+
height?: number | string;
|
|
25
|
+
/** Callback function when a step in the nav is clicked */
|
|
26
|
+
onNavByIndex?: WizardNavStepFunction;
|
|
27
|
+
/** Callback function after next button is clicked */
|
|
28
|
+
onNext?: WizardNavStepFunction;
|
|
29
|
+
/** Callback function after back button is clicked */
|
|
30
|
+
onBack?: WizardNavStepFunction;
|
|
31
|
+
/** Callback function to save at the end of the wizard, if not specified uses onClose */
|
|
32
|
+
onSave?: () => void;
|
|
33
|
+
/** Callback function to close the wizard */
|
|
34
|
+
onClose?: () => void;
|
|
35
|
+
}
|
|
36
|
+
export declare const Wizard: {
|
|
37
|
+
(props: WizardProps): JSX.Element;
|
|
38
|
+
displayName: string;
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=Wizard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Wizard.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/Wizard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EACL,wBAAwB,EACxB,qBAAqB,EAGrB,qBAAqB,EACrB,uBAAuB,EACxB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAI/C;;;GAGG;AAEH,MAAM,WAAW,WAAY,SAAQ,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC;IAClE,sBAAsB;IACtB,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,eAAe,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC,eAAe,CAAC,EAAE,CAAC;IACtF,oBAAoB;IACpB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,oBAAoB;IACpB,MAAM,CAAC,EAAE,wBAAwB,GAAG,KAAK,CAAC,YAAY,CAAC;IACvD,qEAAqE;IACrE,GAAG,CAAC,EAAE,qBAAqB,GAAG,uBAAuB,CAAC;IACtD,gFAAgF;IAChF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8CAA8C;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iCAAiC;IACjC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,kCAAkC;IAClC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,0DAA0D;IAC1D,YAAY,CAAC,EAAE,qBAAqB,CAAC;IACrC,qDAAqD;IACrD,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,qDAAqD;IACrD,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,wFAAwF;IACxF,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,4CAA4C;IAC5C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,eAAO,MAAM,MAAM;YAAW,WAAW;;CA4FxC,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { css } from '@patternfly/react-styles';
|
|
4
|
+
import styles from '@patternfly/react-styles/css/components/Wizard/wizard';
|
|
5
|
+
import { isCustomWizardFooter, isWizardParentStep } from './types';
|
|
6
|
+
import { buildSteps, normalizeNavStep } from './utils';
|
|
7
|
+
import { useWizardContext, WizardContextProvider } from './WizardContext';
|
|
8
|
+
import { WizardFooter } from './WizardFooter';
|
|
9
|
+
import { WizardToggle } from './WizardToggle';
|
|
10
|
+
export const Wizard = (props) => {
|
|
11
|
+
const { startIndex = 1, children, footer, onNavByIndex, onNext, onBack, onSave, onClose } = props, internalProps = __rest(props, ["startIndex", "children", "footer", "onNavByIndex", "onNext", "onBack", "onSave", "onClose"]);
|
|
12
|
+
const [currentStepIndex, setCurrentStepIndex] = React.useState(startIndex);
|
|
13
|
+
const steps = buildSteps(children);
|
|
14
|
+
const goToStepByIndex = (index) => {
|
|
15
|
+
const lastStepIndex = steps.length;
|
|
16
|
+
if (index < 1) {
|
|
17
|
+
index = 1;
|
|
18
|
+
}
|
|
19
|
+
else if (index > lastStepIndex) {
|
|
20
|
+
index = lastStepIndex;
|
|
21
|
+
}
|
|
22
|
+
const currStep = steps[index - 1];
|
|
23
|
+
const prevStep = steps[currentStepIndex - 1];
|
|
24
|
+
setCurrentStepIndex(index);
|
|
25
|
+
return onNavByIndex === null || onNavByIndex === void 0 ? void 0 : onNavByIndex(normalizeNavStep(currStep), normalizeNavStep(prevStep));
|
|
26
|
+
};
|
|
27
|
+
const goToNextStep = () => {
|
|
28
|
+
// Save when on the last step, otherwise close
|
|
29
|
+
if (currentStepIndex >= steps.length) {
|
|
30
|
+
if (onSave) {
|
|
31
|
+
return onSave();
|
|
32
|
+
}
|
|
33
|
+
return onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
34
|
+
}
|
|
35
|
+
let currStep = steps[currentStepIndex];
|
|
36
|
+
let newStepIndex = currentStepIndex + 1;
|
|
37
|
+
const prevStep = steps[currentStepIndex - 1];
|
|
38
|
+
// Skip parent step and focus on the first sub-step if they exist
|
|
39
|
+
if (isWizardParentStep(currStep)) {
|
|
40
|
+
newStepIndex += 1;
|
|
41
|
+
currStep = steps[currentStepIndex + 1];
|
|
42
|
+
}
|
|
43
|
+
setCurrentStepIndex(newStepIndex);
|
|
44
|
+
return onNext === null || onNext === void 0 ? void 0 : onNext(normalizeNavStep(currStep), normalizeNavStep(prevStep));
|
|
45
|
+
};
|
|
46
|
+
const goToPrevStep = () => {
|
|
47
|
+
if (steps.length < currentStepIndex) {
|
|
48
|
+
// Previous step was removed, just update the currentStep state
|
|
49
|
+
setCurrentStepIndex(steps.length);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
let currStep = steps[currentStepIndex - 2];
|
|
53
|
+
let newStepIndex = currentStepIndex - 1;
|
|
54
|
+
const prevStep = steps[currentStepIndex - 1];
|
|
55
|
+
// // Skip parent step and focus on the step prior
|
|
56
|
+
if (isWizardParentStep(currStep)) {
|
|
57
|
+
newStepIndex -= 1;
|
|
58
|
+
currStep = steps[currentStepIndex - 3];
|
|
59
|
+
}
|
|
60
|
+
setCurrentStepIndex(newStepIndex);
|
|
61
|
+
return onBack === null || onBack === void 0 ? void 0 : onBack(normalizeNavStep(currStep), normalizeNavStep(prevStep));
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
const goToStepById = (id) => {
|
|
65
|
+
const stepIndex = steps.findIndex(step => step.id === id) + 1;
|
|
66
|
+
stepIndex > 0 && setCurrentStepIndex(stepIndex);
|
|
67
|
+
};
|
|
68
|
+
const goToStepByName = (name) => {
|
|
69
|
+
const stepIndex = steps.findIndex(step => step.name === name) + 1;
|
|
70
|
+
stepIndex > 0 && setCurrentStepIndex(stepIndex);
|
|
71
|
+
};
|
|
72
|
+
return (React.createElement(WizardContextProvider, { steps: steps, currentStepIndex: currentStepIndex, footer: isCustomWizardFooter(footer) && footer, onNext: goToNextStep, onBack: goToPrevStep, onClose: onClose, goToStepById: goToStepById, goToStepByName: goToStepByName, goToStepByIndex: goToStepByIndex },
|
|
73
|
+
React.createElement(WizardInternal, Object.assign({}, internalProps, { footer: footer }), children)));
|
|
74
|
+
};
|
|
75
|
+
// eslint-disable-next-line patternfly-react/no-anonymous-functions
|
|
76
|
+
const WizardInternal = (_a) => {
|
|
77
|
+
var _b;
|
|
78
|
+
var { height, width, className, header, footer, nav } = _a, divProps = __rest(_a, ["height", "width", "className", "header", "footer", "nav"]);
|
|
79
|
+
const { activeStep, steps, footer: customFooter, onNext, onBack, onClose, goToStepByIndex } = useWizardContext();
|
|
80
|
+
const wizardFooter = customFooter || (React.createElement(WizardFooter, Object.assign({ activeStep: activeStep, onNext: onNext, onBack: onBack, onClose: onClose, disableBackButton: (activeStep === null || activeStep === void 0 ? void 0 : activeStep.id) === ((_b = steps[0]) === null || _b === void 0 ? void 0 : _b.id) }, footer)));
|
|
81
|
+
return (React.createElement("div", Object.assign({ className: css(styles.wizard, className), style: Object.assign(Object.assign({}, (height ? { height } : {})), (width ? { width } : {})) }, divProps),
|
|
82
|
+
header,
|
|
83
|
+
React.createElement(WizardToggle, { steps: steps, activeStep: activeStep, footer: wizardFooter, nav: nav, goToStepByIndex: goToStepByIndex })));
|
|
84
|
+
};
|
|
85
|
+
Wizard.displayName = 'Wizard';
|
|
86
|
+
//# sourceMappingURL=Wizard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Wizard.js","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/Wizard.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,MAAM,MAAM,uDAAuD,CAAC;AAE3E,OAAO,EAGL,oBAAoB,EACpB,kBAAkB,EAGnB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAE1E,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAoC9C,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,KAAkB,EAAE,EAAE;IAC3C,MAAM,EAAE,UAAU,GAAG,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,KAAuB,KAAK,EAAvB,aAAa,UAAK,KAAK,EAA7G,6FAAqG,CAAQ,CAAC;IACpH,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;IAC3E,MAAM,KAAK,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;IAEnC,MAAM,eAAe,GAAG,CAAC,KAAa,EAAE,EAAE;QACxC,MAAM,aAAa,GAAG,KAAK,CAAC,MAAM,CAAC;QAEnC,IAAI,KAAK,GAAG,CAAC,EAAE;YACb,KAAK,GAAG,CAAC,CAAC;SACX;aAAM,IAAI,KAAK,GAAG,a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AAU,EAAE,UAAU,EACtB,MAAM,EAAE,YAAY,EACpB,GAAG,EAAE,GAAG,EACR,eAAe,EAAE,eAAe,GAChC,CACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,WAAW,GAAG,QAAQ,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Used as a wrapper for WizardStep content, where the wrapping element is customizable.
|
|
4
|
+
*/
|
|
5
|
+
export interface WizardBodyProps {
|
|
6
|
+
children?: React.ReactNode | React.ReactNode[];
|
|
7
|
+
/** Set to true to remove the default body padding */
|
|
8
|
+
hasNoBodyPadding?: boolean;
|
|
9
|
+
/** An aria-label to use for the wrapper element */
|
|
10
|
+
'aria-label'?: string;
|
|
11
|
+
/** Sets the aria-labelledby attribute for the wrapper element */
|
|
12
|
+
'aria-labelledby'?: string;
|
|
13
|
+
/** Component used as the wrapping content container */
|
|
14
|
+
wrapperElement?: React.ElementType;
|
|
15
|
+
}
|
|
16
|
+
export declare const WizardBody: {
|
|
17
|
+
({ children, hasNoBodyPadding, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, wrapperElement: Wrapper }: WizardBodyProps): JSX.Element;
|
|
18
|
+
displayName: string;
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=WizardBody.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WizardBody.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardBody.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B;;GAEG;AAEH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;IAC/C,qDAAqD;IACrD,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,mDAAmD;IACnD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iEAAiE;IACjE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,uDAAuD;IACvD,cAAc,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;CACpC;AAED,eAAO,MAAM,UAAU;0HAMpB,eAAe;;CAIjB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styles from '@patternfly/react-styles/css/components/Wizard/wizard';
|
|
3
|
+
import { css } from '@patternfly/react-styles';
|
|
4
|
+
export const WizardBody = ({ children, hasNoBodyPadding = false, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, wrapperElement: Wrapper = 'div' }) => (React.createElement(Wrapper, { "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, className: css(styles.wizardMain) },
|
|
5
|
+
React.createElement("div", { className: css(styles.wizardMainBody, hasNoBodyPadding && styles.modifiers.noPadding) }, children)));
|
|
6
|
+
WizardBody.displayName = 'WizardBody';
|
|
7
|
+
//# sourceMappingURL=WizardBody.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WizardBody.js","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardBody.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,MAAM,MAAM,uDAAuD,CAAC;AAC3E,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAkB/C,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EACzB,QAAQ,EACR,gBAAgB,GAAG,KAAK,EACxB,YAAY,EAAE,SAAS,EACvB,iBAAiB,EAAE,cAAc,EACjC,cAAc,EAAE,OAAO,GAAG,KAAK,EACf,EAAE,EAAE,CAAC,CACrB,oBAAC,OAAO,kBAAa,SAAS,qBAAmB,cAAc,EAAE,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC;IAChG,6BAAK,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,cAAc,EAAE,gBAAgB,IAAI,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,IAAG,QAAQ,CAAO,CACpG,CACX,CAAC;AAEF,UAAU,CAAC,WAAW,GAAG,YAAY,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { WizardControlStep } from './types';
|
|
3
|
+
export interface WizardContextProps {
|
|
4
|
+
/** List of steps */
|
|
5
|
+
steps: WizardControlStep[];
|
|
6
|
+
/** Active step */
|
|
7
|
+
activeStep: WizardControlStep;
|
|
8
|
+
/** Footer element */
|
|
9
|
+
footer: React.ReactElement;
|
|
10
|
+
/** Navigate to the next step */
|
|
11
|
+
onNext: () => void;
|
|
12
|
+
/** Navigate to the previous step */
|
|
13
|
+
onBack: () => void;
|
|
14
|
+
/** Close the wizard */
|
|
15
|
+
onClose: () => void;
|
|
16
|
+
/** Navigate to step by ID */
|
|
17
|
+
goToStepById: (id: number | string) => void;
|
|
18
|
+
/** Navigate to step by name */
|
|
19
|
+
goToStepByName: (name: string) => void;
|
|
20
|
+
/** Navigate to step by index */
|
|
21
|
+
goToStepByIndex: (index: number) => void;
|
|
22
|
+
/** Update the footer with any react element */
|
|
23
|
+
setFooter: (footer: React.ReactElement) => void;
|
|
24
|
+
}
|
|
25
|
+
export declare const WizardContext: React.Context<WizardContextProps>;
|
|
26
|
+
interface WizardContextRenderProps {
|
|
27
|
+
steps: WizardControlStep[];
|
|
28
|
+
activeStep: WizardControlStep;
|
|
29
|
+
footer: React.ReactElement;
|
|
30
|
+
onNext(): void;
|
|
31
|
+
onBack(): void;
|
|
32
|
+
onClose(): void;
|
|
33
|
+
}
|
|
34
|
+
export interface WizardContextProviderProps {
|
|
35
|
+
steps: WizardControlStep[];
|
|
36
|
+
currentStepIndex: number;
|
|
37
|
+
footer: React.ReactElement;
|
|
38
|
+
children: React.ReactElement | ((props: WizardContextRenderProps) => React.ReactElement);
|
|
39
|
+
onNext(): void;
|
|
40
|
+
onBack(): void;
|
|
41
|
+
onClose(): void;
|
|
42
|
+
goToStepById(id: number | string): void;
|
|
43
|
+
goToStepByName(name: string): void;
|
|
44
|
+
goToStepByIndex(index: number): void;
|
|
45
|
+
}
|
|
46
|
+
export declare const WizardContextProvider: React.FunctionComponent<WizardContextProviderProps>;
|
|
47
|
+
export declare const useWizardContext: () => WizardContextProps;
|
|
48
|
+
export {};
|
|
49
|
+
//# sourceMappingURL=WizardContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WizardContext.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAG5C,MAAM,WAAW,kBAAkB;IACjC,oBAAoB;IACpB,KAAK,EAAE,iBAAiB,EAAE,CAAC;IAC3B,kBAAkB;IAClB,UAAU,EAAE,iBAAiB,CAAC;IAC9B,qBAAqB;IACrB,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC;IAC3B,gCAAgC;IAChC,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,oCAAoC;IACpC,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,uBAAuB;IACvB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,6BAA6B;IAC7B,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;IAC5C,+BAA+B;IAC/B,cAAc,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,gCAAgC;IAChC,eAAe,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,+CAA+C;IAC/C,SAAS,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,YAAY,KAAK,IAAI,CAAC;CACjD;AAED,eAAO,MAAM,aAAa,mCAAgD,CAAC;AAE3E,UAAU,wBAAwB;IAChC,KAAK,EAAE,iBAAiB,EAAE,CAAC;IAC3B,UAAU,EAAE,iBAAiB,CAAC;IAC9B,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC;IAC3B,MAAM,IAAI,IAAI,CAAC;IACf,MAAM,IAAI,IAAI,CAAC;IACf,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,MAAM,WAAW,0BAA0B;IACzC,KAAK,EAAE,iBAAiB,EAAE,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC;IAC3B,QAAQ,EAAE,KAAK,CAAC,YAAY,GAAG,CAAC,CAAC,KAAK,EAAE,wBAAwB,KAAK,KAAK,CAAC,YAAY,CAAC,CAAC;IACzF,MAAM,IAAI,IAAI,CAAC;IACf,MAAM,IAAI,IAAI,CAAC;IACf,OAAO,IAAI,IAAI,CAAC;IAChB,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACxC,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtC;AAGD,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,iBAAiB,CAAC,0BAA0B,CAiDrF,CAAC;AAEF,eAAO,MAAM,gBAAgB,0BAAwC,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { getActiveStep } from './utils';
|
|
3
|
+
export const WizardContext = React.createContext({});
|
|
4
|
+
// eslint-disable-next-line patternfly-react/no-anonymous-functions
|
|
5
|
+
export const WizardContextProvider = ({ steps: initialSteps, footer: initialFooter, currentStepIndex, children, onNext, onBack, onClose, goToStepById, goToStepByName, goToStepByIndex }) => {
|
|
6
|
+
const [steps, setSteps] = React.useState(initialSteps);
|
|
7
|
+
const [footer, setFooter] = React.useState(initialFooter);
|
|
8
|
+
const activeStep = getActiveStep(steps, currentStepIndex);
|
|
9
|
+
// When the active step changes and the newly active step isn't visited, set the visited flag to true.
|
|
10
|
+
React.useEffect(() => {
|
|
11
|
+
if (activeStep && !(activeStep === null || activeStep === void 0 ? void 0 : activeStep.visited)) {
|
|
12
|
+
setSteps(prevSteps => prevSteps.map(step => {
|
|
13
|
+
if (step.id === activeStep.id) {
|
|
14
|
+
return Object.assign(Object.assign({}, step), { visited: true });
|
|
15
|
+
}
|
|
16
|
+
return step;
|
|
17
|
+
}));
|
|
18
|
+
}
|
|
19
|
+
}, [activeStep]);
|
|
20
|
+
return (React.createElement(WizardContext.Provider, { value: {
|
|
21
|
+
steps,
|
|
22
|
+
activeStep,
|
|
23
|
+
footer,
|
|
24
|
+
onNext,
|
|
25
|
+
onBack,
|
|
26
|
+
onClose,
|
|
27
|
+
goToStepById,
|
|
28
|
+
goToStepByName,
|
|
29
|
+
goToStepByIndex,
|
|
30
|
+
setFooter
|
|
31
|
+
} }, typeof children === 'function' ? children({ activeStep, steps, footer, onNext, onBack, onClose }) : children));
|
|
32
|
+
};
|
|
33
|
+
export const useWizardContext = () => React.useContext(WizardContext);
|
|
34
|
+
//# sourceMappingURL=WizardContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WizardContext.js","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAyBxC,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC,EAAwB,CAAC,CAAC;AAwB3E,mEAAmE;AACnE,MAAM,CAAC,MAAM,qBAAqB,GAAwD,CAAC,EACzF,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,aAAa,EACrB,gBAAgB,EAChB,QAAQ,EACR,MAAM,EACN,MAAM,EACN,OAAO,EACP,YAAY,EACZ,cAAc,EACd,eAAe,EAChB,EAAE,EAAE;IACH,M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React from 'react';
|
|
2
|
+
import { WizardControlStep, WizardNavStepFunction } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Hosts the standard structure of a footer with ties to the active step so that text for buttons can vary from step to step.
|
|
5
|
+
*/
|
|
6
|
+
export interface WizardFooterProps {
|
|
7
|
+
/** The currently active WizardStep */
|
|
8
|
+
activeStep: WizardControlStep;
|
|
9
|
+
/** Next button callback */
|
|
10
|
+
onNext: () => WizardNavStepFunction | void;
|
|
11
|
+
/** Back button callback */
|
|
12
|
+
onBack: () => WizardNavStepFunction | void;
|
|
13
|
+
/** Cancel link callback */
|
|
14
|
+
onClose: () => void;
|
|
15
|
+
/** Custom text for the Next button. The activeStep's nextButtonText takes precedence. */
|
|
16
|
+
nextButtonText?: React.ReactNode;
|
|
17
|
+
/** Custom text for the Back button */
|
|
18
|
+
backButtonText?: React.ReactNode;
|
|
19
|
+
/** Custom text for the Cancel link */
|
|
20
|
+
cancelButtonText?: React.ReactNode;
|
|
21
|
+
/** Optional flag to disable the first step's back button */
|
|
22
|
+
disableBackButton?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare const WizardFooter: {
|
|
25
|
+
({ onNext, onBack, onClose, activeStep, disableBackButton, nextButtonText, backButtonText, cancelButtonText }: WizardFooterProps): JSX.Element;
|
|
26
|
+
displayName: string;
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=WizardFooter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WizardFooter.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardFooter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAEnE;;GAEG;AAEH,MAAM,WAAW,iBAAiB;IAChC,sCAAsC;IACtC,UAAU,EAAE,iBAAiB,CAAC;IAC9B,2BAA2B;IAC3B,MAAM,EAAE,MAAM,qBAAqB,GAAG,IAAI,CAAC;IAC3C,2BAA2B;IAC3B,MAAM,EAAE,MAAM,qBAAqB,GAAG,IAAI,CAAC;IAC3C,2BAA2B;IAC3B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,yFAAyF;IACzF,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACjC,sCAAsC;IACtC,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACjC,sCAAsC;IACtC,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACnC,4DAA4D;IAC5D,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,eAAO,MAAM,YAAY;mHAStB,iBAAiB;;CAoBnB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { css } from '@patternfly/react-styles';
|
|
3
|
+
import styles from '@patternfly/react-styles/css/components/Wizard/wizard';
|
|
4
|
+
import { Button, ButtonVariant } from '../../../components/Button';
|
|
5
|
+
export const WizardFooter = ({ onNext, onBack, onClose, activeStep, disableBackButton, nextButtonText = 'Next', backButtonText = 'Back', cancelButtonText = 'Cancel' }) => (React.createElement("footer", { className: css(styles.wizardFooter) },
|
|
6
|
+
React.createElement(Button, { variant: ButtonVariant.primary, type: "submit", onClick: onNext, isDisabled: activeStep === null || activeStep === void 0 ? void 0 : activeStep.disableNext }, (activeStep === null || activeStep === void 0 ? void 0 : activeStep.nextButtonText) || nextButtonText),
|
|
7
|
+
!(activeStep === null || activeStep === void 0 ? void 0 : activeStep.hideBackButton) && (React.createElement(Button, { variant: ButtonVariant.secondary, onClick: onBack, isDisabled: disableBackButton }, backButtonText)),
|
|
8
|
+
!(activeStep === null || activeStep === void 0 ? void 0 : activeStep.hideCancelButton) && (React.createElement("div", { className: styles.wizardFooterCancel },
|
|
9
|
+
React.createElement(Button, { variant: ButtonVariant.link, onClick: onClose }, cancelButtonText)))));
|
|
10
|
+
WizardFooter.displayName = 'WizardFooter';
|
|
11
|
+
//# sourceMappingURL=WizardFooter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WizardFooter.js","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardFooter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,MAAM,MAAM,uDAAuD,CAAC;AAE3E,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AA0BnE,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAC3B,MAAM,EACN,MAAM,EACN,OAAO,EACP,UAAU,EACV,iBAAiB,EACjB,cAAc,GAAG,MAAM,EACvB,cAAc,GAAG,MAAM,EACvB,gBAAgB,GAAG,QAAQ,EACT,EAAE,EAAE,CAAC,CACvB,gCAAQ,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC;IACzC,oBAAC,MAAM,IAAC,OAAO,EAAE,aAAa,CAAC,OAAO,EAAE,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,WAAW,IACvG,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,cAAc,KAAI,cAAc,CACtC;IAER,CAAC,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,cAAc,CAAA,IAAI,CAC9B,oBAAC,MAAM,IAAC,OAAO,EAAE,aAAa,CAAC,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,iBAAiB,IACrF,cAAc,CACR,CACV;IAEA,CAAC,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,gBAAgB,CAAA,IAAI,CAChC,6BAAK,SAAS,EAAE,MAAM,CAAC,kBAAkB;QACvC,oBAAC,MAAM,IAAC,OAAO,EAAE,aAAa,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,IAClD,gBAAgB,CACV,CACL,CACP,CACM,CACV,CAAC;AAEF,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface WizardHeaderProps {
|
|
3
|
+
/** Callback function called when the X (Close) button is clicked */
|
|
4
|
+
onClose?: () => void;
|
|
5
|
+
/** Title of the wizard */
|
|
6
|
+
title: string;
|
|
7
|
+
/** Description of the wizard */
|
|
8
|
+
description?: React.ReactNode;
|
|
9
|
+
/** Component type of the description */
|
|
10
|
+
descriptionComponent?: 'div' | 'p';
|
|
11
|
+
/** Flag indicating whether the close button should be in the header */
|
|
12
|
+
hideClose?: boolean;
|
|
13
|
+
/** Aria-label applied to the X (Close) button */
|
|
14
|
+
closeButtonAriaLabel?: string;
|
|
15
|
+
/** id for the title */
|
|
16
|
+
titleId?: string;
|
|
17
|
+
/** id for the description */
|
|
18
|
+
descriptionId?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare const WizardHeader: React.FunctionComponent<WizardHeaderProps>;
|
|
21
|
+
//# sourceMappingURL=WizardHeader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WizardHeader.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,MAAM,WAAW,iBAAiB;IAChC,oEAAoE;IACpE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,0BAA0B;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,gCAAgC;IAChC,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,wCAAwC;IACxC,oBAAoB,CAAC,EAAE,KAAK,GAAG,GAAG,CAAC;IACnC,uEAAuE;IACvE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iDAAiD;IACjD,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,uBAAuB;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6BAA6B;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAyBnE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import styles from '@patternfly/react-styles/css/components/Wizard/wizard';
|
|
3
|
+
import { css } from '@patternfly/react-styles';
|
|
4
|
+
import { Button } from '../../../components/Button';
|
|
5
|
+
import { Title } from '../../../components/Title';
|
|
6
|
+
import TimesIcon from '@patternfly/react-icons/dist/esm/icons/times-icon';
|
|
7
|
+
export const WizardHeader = ({ onClose = () => undefined, title, description, hideClose, closeButtonAriaLabel, titleId, descriptionComponent: Component = 'p', descriptionId }) => (React.createElement("div", { className: css(styles.wizardHeader) },
|
|
8
|
+
!hideClose && (React.createElement(Button, { variant: "plain", className: css(styles.wizardClose), "aria-label": closeButtonAriaLabel, onClick: onClose },
|
|
9
|
+
React.createElement(TimesIcon, { "aria-hidden": "true" }))),
|
|
10
|
+
React.createElement(Title, { headingLevel: "h2", size: "3xl", className: css(styles.wizardTitle), "aria-label": title, id: titleId }, title || React.createElement(React.Fragment, null, "\u00A0")),
|
|
11
|
+
description && (React.createElement(Component, { className: css(styles.wizardDescription), id: descriptionId }, description))));
|
|
12
|
+
WizardHeader.displayName = 'WizardHeader';
|
|
13
|
+
//# sourceMappingURL=WizardHeader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WizardHeader.js","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,MAAM,MAAM,uDAAuD,CAAC;AAC3E,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAClD,OAAO,SAAS,MAAM,mDAAmD,CAAC;AAqB1E,MAAM,CAAC,MAAM,YAAY,GAA+C,CAAC,EACvE,OAAO,GAAG,GAAG,EAAE,CAAC,SAAS,EACzB,KAAK,EACL,WAAW,EACX,SAAS,EACT,oBAAoB,EACpB,OAAO,EACP,oBAAoB,EAAE,SAAS,GAAG,GAAG,EACrC,aAAa,EACK,EAAE,EAAE,CAAC,CACvB,6BAAK,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC;IACrC,CAAC,SAAS,IAAI,CACb,oBAAC,MAAM,IAAC,OAAO,EAAC,OAAO,EAAC,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,gBAAc,oBAAoB,EAAE,OAAO,EAAE,OAAO;QAC5G,oBAAC,SAAS,mBAAa,MAAM,GAAG,CACzB,CACV;IACD,oBAAC,KAAK,IAAC,YAAY,EAAC,IAAI,EAAC,IAAI,EAAC,KAAK,EAAC,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,gBAAc,KAAK,EAAE,EAAE,EAAE,OAAO,IACnG,KAAK,IAAI,mDAAW,CACf;IACP,WAAW,IAAI,CACd,oBAAC,SAAS,IAAC,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,iBAAiB,CAAC,EAAE,EAAE,EAAE,aAAa,IACnE,WAAW,CACF,CACb,CACG,CACP,CAAC;AACF,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface WizardNavProps {
|
|
3
|
+
/** children should be WizardNavItem components */
|
|
4
|
+
children?: any;
|
|
5
|
+
/** Aria-label applied to the nav element */
|
|
6
|
+
'aria-label'?: string;
|
|
7
|
+
/** Sets the aria-labelledby attribute on the nav element */
|
|
8
|
+
'aria-labelledby'?: string;
|
|
9
|
+
/** Whether the nav is expanded */
|
|
10
|
+
isOpen?: boolean;
|
|
11
|
+
/** True to return the inner list without the wrapping nav element */
|
|
12
|
+
returnList?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare const WizardNav: React.FunctionComponent<WizardNavProps>;
|
|
15
|
+
//# sourceMappingURL=WizardNav.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WizardNav.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardNav.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,WAAW,cAAc;IAC7B,kDAAkD;IAClD,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,4CAA4C;IAC5C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,4DAA4D;IAC5D,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kCAAkC;IAClC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,qEAAqE;IACrE,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,iBAAiB,CAAC,cAAc,CAsB7D,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import styles from '@patternfly/react-styles/css/components/Wizard/wizard';
|
|
3
|
+
import { css } from '@patternfly/react-styles';
|
|
4
|
+
export const WizardNav = ({ children, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, isOpen = false, returnList = false }) => {
|
|
5
|
+
const innerList = React.createElement("ol", { className: css(styles.wizardNavList) }, children);
|
|
6
|
+
if (returnList) {
|
|
7
|
+
return innerList;
|
|
8
|
+
}
|
|
9
|
+
return (React.createElement("nav", { className: css(styles.wizardNav, isOpen && styles.modifiers.expanded), "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy },
|
|
10
|
+
React.createElement("ol", { className: css(styles.wizardNavList) }, children)));
|
|
11
|
+
};
|
|
12
|
+
WizardNav.displayName = 'WizardNav';
|
|
13
|
+
//# sourceMappingURL=WizardNav.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WizardNav.js","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardNav.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,MAAM,MAAM,uDAAuD,CAAC;AAC3E,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAe/C,MAAM,CAAC,MAAM,SAAS,GAA4C,CAAC,EACjE,QAAQ,EACR,YAAY,EAAE,SAAS,EACvB,iBAAiB,EAAE,cAAc,EACjC,MAAM,GAAG,KAAK,EACd,UAAU,GAAG,KAAK,EACH,EAAE,EAAE;IACnB,MAAM,SAAS,GAAG,4BAAI,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,aAAa,CAAC,IAAG,QAAQ,CAAM,CAAC;IAE5E,IAAI,UAAU,EAAE;QACd,OAAO,SAAS,CAAC;KAClB;IAED,OAAO,CACL,6BACE,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,IAAI,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,gBACzD,SAAS,qBACJ,cAAc;QAE/B,4BAAI,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,aAAa,CAAC,IAAG,QAAQ,CAAM,CACrD,CACP,CAAC;AACJ,CAAC,CAAC;AACF,SAAS,CAAC,WAAW,GAAG,WAAW,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface WizardNavItemProps {
|
|
3
|
+
/** Can nest a WizardNav component for substeps */
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
/** The content to display in the nav item */
|
|
6
|
+
content?: React.ReactNode;
|
|
7
|
+
/** Whether the nav item is the currently active item */
|
|
8
|
+
isCurrent?: boolean;
|
|
9
|
+
/** Whether the nav item is disabled */
|
|
10
|
+
isDisabled?: boolean;
|
|
11
|
+
/** The step passed into the onNavItemClick callback */
|
|
12
|
+
step: number;
|
|
13
|
+
/** Callback for when the nav item is clicked */
|
|
14
|
+
onNavItemClick?: (step: number) => any;
|
|
15
|
+
/** Component used to render WizardNavItem */
|
|
16
|
+
navItemComponent?: 'button' | 'a';
|
|
17
|
+
/** An optional url to use for when using an anchor component */
|
|
18
|
+
href?: string;
|
|
19
|
+
/** Flag indicating that this NavItem has child steps and is expandable */
|
|
20
|
+
isExpandable?: boolean;
|
|
21
|
+
/** The id for the nav item */
|
|
22
|
+
id?: string | number;
|
|
23
|
+
}
|
|
24
|
+
export declare const WizardNavItem: React.FunctionComponent<WizardNavItemProps>;
|
|
25
|
+
//# sourceMappingURL=WizardNavItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WizardNavItem.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardNavItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,MAAM,WAAW,kBAAkB;IACjC,kDAAkD;IAClD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,6CAA6C;IAC7C,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,wDAAwD;IACxD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,uCAAuC;IACvC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,uDAAuD;IACvD,IAAI,EAAE,MAAM,CAAC;IACb,gDAAgD;IAChD,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,GAAG,CAAC;IACvC,6CAA6C;IAC7C,gBAAgB,CAAC,EAAE,QAAQ,GAAG,GAAG,CAAC;IAClC,gEAAgE;IAChE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0EAA0E;IAC1E,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,8BAA8B;IAC9B,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,iBAAiB,CAAC,kBAAkB,CAyErE,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { css } from '@patternfly/react-styles';
|
|
4
|
+
import styles from '@patternfly/react-styles/css/components/Wizard/wizard';
|
|
5
|
+
import AngleRightIcon from '@patternfly/react-icons/dist/esm/icons/angle-right-icon';
|
|
6
|
+
export const WizardNavItem = (_a) => {
|
|
7
|
+
var { children = null, content = '', isCurrent = false, isDisabled = false, step, onNavItemClick = () => undefined, navItemComponent = 'button', href = null, isExpandable = false, id } = _a, rest = __rest(_a, ["children", "content", "isCurrent", "isDisabled", "step", "onNavItemClick", "navItemComponent", "href", "isExpandable", "id"]);
|
|
8
|
+
const NavItemComponent = navItemComponent;
|
|
9
|
+
const [isExpanded, setIsExpanded] = React.useState(false);
|
|
10
|
+
React.useEffect(() => {
|
|
11
|
+
setIsExpanded(isCurrent);
|
|
12
|
+
}, [isCurrent]);
|
|
13
|
+
if (navItemComponent === 'a' && !href && process.env.NODE_ENV !== 'production') {
|
|
14
|
+
// eslint-disable-next-line no-console
|
|
15
|
+
console.error('WizardNavItem: When using an anchor, please provide an href');
|
|
16
|
+
}
|
|
17
|
+
const btnProps = {
|
|
18
|
+
disabled: isDisabled
|
|
19
|
+
};
|
|
20
|
+
const linkProps = {
|
|
21
|
+
tabIndex: isDisabled ? -1 : undefined,
|
|
22
|
+
href
|
|
23
|
+
};
|
|
24
|
+
return (React.createElement("li", { className: css(styles.wizardNavItem, isExpandable && styles.modifiers.expandable, isExpandable && isExpanded && styles.modifiers.expanded) },
|
|
25
|
+
React.createElement(NavItemComponent, Object.assign({}, rest, (navItemComponent === 'a' ? Object.assign({}, linkProps) : Object.assign({}, btnProps)), (id && { id: id.toString() }), { onClick: () => (isExpandable ? setIsExpanded(!isExpanded || isCurrent) : onNavItemClick(step)), className: css(styles.wizardNavLink, isCurrent && styles.modifiers.current, isDisabled && styles.modifiers.disabled), "aria-disabled": isDisabled ? true : null, "aria-current": isCurrent && !children ? 'step' : false }, (isExpandable && { 'aria-expanded': isExpanded })), isExpandable ? (React.createElement(React.Fragment, null,
|
|
26
|
+
React.createElement("span", { className: css(styles.wizardNavLinkText) }, content),
|
|
27
|
+
React.createElement("span", { className: css(styles.wizardNavLinkToggle) },
|
|
28
|
+
React.createElement("span", { className: css(styles.wizardNavLinkToggleIcon) },
|
|
29
|
+
React.createElement(AngleRightIcon, null))))) : (content)),
|
|
30
|
+
children));
|
|
31
|
+
};
|
|
32
|
+
WizardNavItem.displayName = 'WizardNavItem';
|
|
33
|
+
//# sourceMappingURL=WizardNavItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WizardNavItem.js","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardNavItem.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,MAAM,MAAM,uDAAuD,CAAC;AAC3E,OAAO,cAAc,MAAM,yDAAyD,CAAC;AAyBrF,MAAM,CAAC,MAAM,aAAa,GAAgD,CAAC,EAYtD,EAAE,EAAE;QAZkD,EACzE,QAAQ,GAAG,IAAI,EACf,OAAO,GAAG,EAAE,EACZ,SAAS,GAAG,KAAK,EACjB,UAAU,GAAG,KAAK,EAClB,IAAI,EACJ,cAAc,GAAG,GAAG,EAAE,CAAC,SAAS,EAChC,gBAAgB,GAAG,QAAQ,EAC3B,IAAI,GAAG,IAAI,EACX,YAAY,GAAG,KAAK,EACpB,EAAE,OAEiB,EADhB,IAAI,cAXkE,8HAY1E,CADQ;IAEP,MAAM,gBAA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,CAAC,SAAS,CAAC,OAAO,EACrC,UAAU,IAAI,MAAM,CAAC,SAAS,CAAC,QAAQ,CACxC,mBACc,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,kBACzB,SAAS,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,IACjD,CAAC,YAAY,IAAI,EAAE,eAAe,EAAE,UAAU,EAAE,CAAC,GAEpD,YAAY,CAAC,CAAC,CAAC,CACd;YACE,8BAAM,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,iBAAiB,CAAC,IAAG,OAAO,CAAQ;YAChE,8BAAM,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,mBAAmB,CAAC;gBAC9C,8BAAM,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,uBAAuB,CAAC;oBAClD,oBAAC,cAAc,OAAG,CACb,CACF,CACN,CACJ,CAAC,CAAC,CAAC,CACF,OAAO,CACR,CACgB;QAClB,QAAQ,CACN,CACN,CAAC;AACJ,CAAC,CAAC;AACF,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { WizardControlStep } from './types';
|
|
3
|
+
import { WizardBodyProps } from './WizardBody';
|
|
4
|
+
/**
|
|
5
|
+
* Used as a passthrough of step properties for Wizard and all supporting child components.
|
|
6
|
+
* Also acts as a wrapper for content, with an optional inclusion of WizardBody.
|
|
7
|
+
*/
|
|
8
|
+
export interface WizardStepProps extends Omit<WizardControlStep, 'parentId' | 'subStepIds' | 'visited'> {
|
|
9
|
+
/** Optional for when the step is used as a parent to sub-steps */
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
/** Props for WizardBody that wraps content by default. Can be set to null for exclusion of WizardBody. */
|
|
12
|
+
body?: WizardBodyProps | null;
|
|
13
|
+
/** Optional list of sub-steps */
|
|
14
|
+
steps?: React.ReactElement<WizardStepProps>[];
|
|
15
|
+
}
|
|
16
|
+
export declare const WizardStep: {
|
|
17
|
+
({ body, children }: WizardStepProps): JSX.Element;
|
|
18
|
+
displayName: string;
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=WizardStep.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WizardStep.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardStep.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAc,eAAe,EAAE,MAAM,cAAc,CAAC;AAE3D;;;GAGG;AAEH,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,iBAAiB,EAAE,UAAU,GAAG,YAAY,GAAG,SAAS,CAAC;IACrG,kEAAkE;IAClE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,0GAA0G;IAC1G,IAAI,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;IAC9B,iCAAiC;IACjC,KAAK,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,eAAe,CAAC,EAAE,CAAC;CAC/C;AAED,eAAO,MAAM,UAAU;yBAAwB,eAAe;;CACwB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { WizardBody } from './WizardBody';
|
|
3
|
+
export const WizardStep = ({ body, children }) => body === undefined ? React.createElement(WizardBody, Object.assign({}, body), children) : React.createElement(React.Fragment, null, children);
|
|
4
|
+
WizardStep.displayName = 'WizardStep';
|
|
5
|
+
//# sourceMappingURL=WizardStep.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WizardStep.js","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardStep.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,UAAU,EAAmB,MAAM,cAAc,CAAC;AAgB3D,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAmB,EAAE,EAAE,CAChE,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,oBAAC,UAAU,oBAAK,IAAI,GAAG,QAAQ,CAAc,CAAC,CAAC,CAAC,0CAAG,QAAQ,CAAI,CAAC;AAEvF,UAAU,CAAC,WAAW,GAAG,YAAY,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { WizardControlStep, CustomWizardNavFunction, DefaultWizardNavProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Used to toggle between step content, including the body and footer. This is also where the nav and its expandability is controlled.
|
|
5
|
+
*/
|
|
6
|
+
export interface WizardToggleProps {
|
|
7
|
+
/** List of steps and/or sub-steps */
|
|
8
|
+
steps: WizardControlStep[];
|
|
9
|
+
/** The currently active WizardStep */
|
|
10
|
+
activeStep: WizardControlStep;
|
|
11
|
+
/** The WizardFooter */
|
|
12
|
+
footer: React.ReactElement;
|
|
13
|
+
/** Custom WizardNav or callback used to create a default WizardNav */
|
|
14
|
+
nav: DefaultWizardNavProps | CustomWizardNavFunction;
|
|
15
|
+
/** Navigate using the step index */
|
|
16
|
+
goToStepByIndex: (index: number) => void;
|
|
17
|
+
/** The button's aria-label */
|
|
18
|
+
'aria-label'?: string;
|
|
19
|
+
/** Flag to unmount inactive steps instead of hiding. Defaults to true */
|
|
20
|
+
unmountInactiveSteps?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare const WizardToggle: {
|
|
23
|
+
({ steps, activeStep, footer, nav, goToStepByIndex, unmountInactiveSteps, "aria-label": ariaLabel }: WizardToggleProps): JSX.Element;
|
|
24
|
+
displayName: string;
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=WizardToggle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WizardToggle.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardToggle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,qBAAqB,EAKtB,MAAM,SAAS,CAAC;AAEjB;;GAEG;AAEH,MAAM,WAAW,iBAAiB;IAChC,qCAAqC;IACrC,KAAK,EAAE,iBAAiB,EAAE,CAAC;IAC3B,sCAAsC;IACtC,UAAU,EAAE,iBAAiB,CAAC;IAC9B,uBAAuB;IACvB,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC;IAC3B,sEAAsE;IACtE,GAAG,EAAE,qBAAqB,GAAG,uBAAuB,CAAC;IACrD,oCAAoC;IACpC,eAAe,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,8BAA8B;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,yEAAyE;IACzE,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,eAAO,MAAM,YAAY;yGAQtB,iBAAiB;;CA8JnB,CAAC"}
|