@patternfly/react-core 4.249.0 → 4.250.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/esm/next/components/Select/Select.d.ts +28 -0
- package/dist/esm/next/components/Select/Select.d.ts.map +1 -0
- package/dist/esm/next/components/Select/Select.js +62 -0
- package/dist/esm/next/components/Select/Select.js.map +1 -0
- package/dist/esm/next/components/Select/SelectGroup.d.ts +12 -0
- package/dist/esm/next/components/Select/SelectGroup.d.ts.map +1 -0
- package/dist/esm/next/components/Select/SelectGroup.js +10 -0
- package/dist/esm/next/components/Select/SelectGroup.js.map +1 -0
- package/dist/esm/next/components/Select/SelectList.d.ts +10 -0
- package/dist/esm/next/components/Select/SelectList.d.ts.map +1 -0
- package/dist/esm/next/components/Select/SelectList.js +10 -0
- package/dist/esm/next/components/Select/SelectList.js.map +1 -0
- package/dist/esm/next/components/Select/SelectOption.d.ts +20 -0
- package/dist/esm/next/components/Select/SelectOption.d.ts.map +1 -0
- package/dist/esm/next/components/Select/SelectOption.js +10 -0
- package/dist/esm/next/components/Select/SelectOption.js.map +1 -0
- package/dist/esm/next/components/Select/index.d.ts +5 -0
- package/dist/esm/next/components/Select/index.d.ts.map +1 -0
- package/dist/esm/next/components/Select/index.js +5 -0
- package/dist/esm/next/components/Select/index.js.map +1 -0
- package/dist/esm/next/components/Wizard/Wizard.d.ts +9 -7
- package/dist/esm/next/components/Wizard/Wizard.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/Wizard.js +62 -48
- 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 +1 -1
- package/dist/esm/next/components/Wizard/WizardBody.js.map +1 -1
- package/dist/esm/next/components/Wizard/WizardContext.d.ts +21 -20
- package/dist/esm/next/components/Wizard/WizardContext.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/WizardContext.js +63 -32
- package/dist/esm/next/components/Wizard/WizardContext.js.map +1 -1
- package/dist/esm/next/components/Wizard/WizardFooter.d.ts +20 -6
- package/dist/esm/next/components/Wizard/WizardFooter.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/WizardFooter.js +13 -4
- 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/WizardHeader.js +2 -2
- package/dist/esm/next/components/Wizard/WizardHeader.js.map +1 -1
- package/dist/esm/next/components/Wizard/WizardNav.d.ts +5 -5
- package/dist/esm/next/components/Wizard/WizardNav.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/WizardNav.js +3 -4
- package/dist/esm/next/components/Wizard/WizardNav.js.map +1 -1
- package/dist/esm/next/components/Wizard/WizardNavInternal.d.ts +14 -0
- package/dist/esm/next/components/Wizard/WizardNavInternal.d.ts.map +1 -0
- package/dist/esm/next/components/Wizard/WizardNavInternal.js +49 -0
- package/dist/esm/next/components/Wizard/WizardNavInternal.js.map +1 -0
- package/dist/esm/next/components/Wizard/WizardNavItem.d.ts +12 -8
- package/dist/esm/next/components/Wizard/WizardNavItem.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/WizardNavItem.js +23 -12
- package/dist/esm/next/components/Wizard/WizardNavItem.js.map +1 -1
- package/dist/esm/next/components/Wizard/WizardStep.d.ts +22 -6
- package/dist/esm/next/components/Wizard/WizardStep.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/WizardStep.js +20 -1
- package/dist/esm/next/components/Wizard/WizardStep.js.map +1 -1
- package/dist/esm/next/components/Wizard/WizardToggle.d.ts +9 -15
- package/dist/esm/next/components/Wizard/WizardToggle.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/WizardToggle.js +15 -50
- package/dist/esm/next/components/Wizard/WizardToggle.js.map +1 -1
- package/dist/esm/next/components/Wizard/hooks/useWizardFooter.d.ts +2 -2
- package/dist/esm/next/components/Wizard/hooks/useWizardFooter.d.ts.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 +37 -46
- package/dist/esm/next/components/Wizard/types.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/types.js +10 -2
- package/dist/esm/next/components/Wizard/types.js.map +1 -1
- package/dist/esm/next/components/Wizard/utils.d.ts +4 -5
- package/dist/esm/next/components/Wizard/utils.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/utils.js +20 -13
- package/dist/esm/next/components/Wizard/utils.js.map +1 -1
- package/dist/esm/next/components/index.d.ts +2 -1
- package/dist/esm/next/components/index.d.ts.map +1 -1
- package/dist/esm/next/components/index.js +2 -1
- package/dist/esm/next/components/index.js.map +1 -1
- package/dist/js/next/components/Select/Select.d.ts +28 -0
- package/dist/js/next/components/Select/Select.d.ts.map +1 -0
- package/dist/js/next/components/Select/Select.js +65 -0
- package/dist/js/next/components/Select/Select.js.map +1 -0
- package/dist/js/next/components/Select/SelectGroup.d.ts +12 -0
- package/dist/js/next/components/Select/SelectGroup.d.ts.map +1 -0
- package/dist/js/next/components/Select/SelectGroup.js +14 -0
- package/dist/js/next/components/Select/SelectGroup.js.map +1 -0
- package/dist/js/next/components/Select/SelectList.d.ts +10 -0
- package/dist/js/next/components/Select/SelectList.d.ts.map +1 -0
- package/dist/js/next/components/Select/SelectList.js +14 -0
- package/dist/js/next/components/Select/SelectList.js.map +1 -0
- package/dist/js/next/components/Select/SelectOption.d.ts +20 -0
- package/dist/js/next/components/Select/SelectOption.d.ts.map +1 -0
- package/dist/js/next/components/Select/SelectOption.js +14 -0
- package/dist/js/next/components/Select/SelectOption.js.map +1 -0
- package/dist/js/next/components/Select/index.d.ts +5 -0
- package/dist/js/next/components/Select/index.d.ts.map +1 -0
- package/dist/js/next/components/Select/index.js +8 -0
- package/dist/js/next/components/Select/index.js.map +1 -0
- package/dist/js/next/components/Wizard/Wizard.d.ts +9 -7
- package/dist/js/next/components/Wizard/Wizard.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/Wizard.js +59 -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 +1 -1
- package/dist/js/next/components/Wizard/WizardBody.js.map +1 -1
- package/dist/js/next/components/Wizard/WizardContext.d.ts +21 -20
- package/dist/js/next/components/Wizard/WizardContext.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/WizardContext.js +61 -30
- package/dist/js/next/components/Wizard/WizardContext.js.map +1 -1
- package/dist/js/next/components/Wizard/WizardFooter.d.ts +20 -6
- package/dist/js/next/components/Wizard/WizardFooter.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/WizardFooter.js +15 -6
- 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/WizardHeader.js +2 -2
- package/dist/js/next/components/Wizard/WizardHeader.js.map +1 -1
- package/dist/js/next/components/Wizard/WizardNav.d.ts +5 -5
- package/dist/js/next/components/Wizard/WizardNav.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/WizardNav.js +3 -4
- package/dist/js/next/components/Wizard/WizardNav.js.map +1 -1
- package/dist/js/next/components/Wizard/WizardNavInternal.d.ts +14 -0
- package/dist/js/next/components/Wizard/WizardNavInternal.d.ts.map +1 -0
- package/dist/js/next/components/Wizard/WizardNavInternal.js +54 -0
- package/dist/js/next/components/Wizard/WizardNavInternal.js.map +1 -0
- package/dist/js/next/components/Wizard/WizardNavItem.d.ts +12 -8
- package/dist/js/next/components/Wizard/WizardNavItem.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/WizardNavItem.js +23 -12
- package/dist/js/next/components/Wizard/WizardNavItem.js.map +1 -1
- package/dist/js/next/components/Wizard/WizardStep.d.ts +22 -6
- package/dist/js/next/components/Wizard/WizardStep.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/WizardStep.js +20 -1
- package/dist/js/next/components/Wizard/WizardStep.js.map +1 -1
- package/dist/js/next/components/Wizard/WizardToggle.d.ts +9 -15
- package/dist/js/next/components/Wizard/WizardToggle.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/WizardToggle.js +15 -51
- package/dist/js/next/components/Wizard/WizardToggle.js.map +1 -1
- package/dist/js/next/components/Wizard/hooks/useWizardFooter.d.ts +2 -2
- package/dist/js/next/components/Wizard/hooks/useWizardFooter.d.ts.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 +37 -46
- package/dist/js/next/components/Wizard/types.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/types.js +12 -3
- package/dist/js/next/components/Wizard/types.js.map +1 -1
- package/dist/js/next/components/Wizard/utils.d.ts +4 -5
- package/dist/js/next/components/Wizard/utils.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/utils.js +24 -15
- package/dist/js/next/components/Wizard/utils.js.map +1 -1
- package/dist/js/next/components/index.d.ts +2 -1
- package/dist/js/next/components/index.d.ts.map +1 -1
- package/dist/js/next/components/index.js +2 -1
- package/dist/js/next/components/index.js.map +1 -1
- package/dist/umd/react-core.min.css +940 -940
- package/package.json +2 -2
- package/src/next/components/Select/Select.tsx +129 -0
- package/src/next/components/Select/SelectGroup.tsx +24 -0
- package/src/next/components/Select/SelectList.tsx +21 -0
- package/src/next/components/Select/SelectOption.tsx +31 -0
- package/src/next/components/Select/examples/Select.md +37 -0
- package/src/next/components/Select/examples/SelectBasic.tsx +54 -0
- package/src/next/components/Select/examples/SelectCheckbox.tsx +67 -0
- package/src/next/components/Select/examples/SelectGrouped.tsx +63 -0
- package/src/next/components/Select/examples/SelectMultiTypeahead.tsx +195 -0
- package/src/next/components/Select/examples/SelectTypeahead.tsx +191 -0
- package/src/next/components/Select/index.ts +4 -0
- package/src/next/components/Wizard/Wizard.tsx +107 -64
- package/src/next/components/Wizard/WizardBody.tsx +4 -4
- package/src/next/components/Wizard/WizardContext.tsx +117 -65
- package/src/next/components/Wizard/WizardFooter.tsx +39 -17
- package/src/next/components/Wizard/WizardHeader.tsx +6 -3
- package/src/next/components/Wizard/WizardNav.tsx +9 -10
- package/src/next/components/Wizard/WizardNavInternal.tsx +137 -0
- package/src/next/components/Wizard/WizardNavItem.tsx +47 -20
- package/src/next/components/Wizard/WizardStep.tsx +52 -7
- package/src/next/components/Wizard/WizardToggle.tsx +24 -142
- package/src/next/components/Wizard/__tests__/Wizard.test.tsx +10 -13
- package/src/next/components/Wizard/__tests__/WizardBody.test.tsx +3 -3
- package/src/next/components/Wizard/__tests__/WizardFooter.test.tsx +11 -14
- package/src/next/components/Wizard/__tests__/WizardStep.test.tsx +100 -0
- package/src/next/components/Wizard/__tests__/WizardToggle.test.tsx +4 -4
- package/src/next/components/Wizard/examples/Wizard.md +40 -15
- package/src/next/components/Wizard/examples/WizardBasic.tsx +2 -2
- package/src/next/components/Wizard/examples/WizardCustomNav.tsx +4 -4
- package/src/next/components/Wizard/examples/WizardKitchenSink.tsx +126 -60
- package/src/next/components/Wizard/hooks/__tests__/useWizardFooter.test.tsx +23 -34
- package/src/next/components/Wizard/hooks/useWizardFooter.tsx +5 -5
- package/src/next/components/Wizard/types.tsx +59 -53
- package/src/next/components/Wizard/utils.ts +25 -16
- package/src/next/components/index.ts +2 -1
|
@@ -4,7 +4,26 @@ exports.WizardStep = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
6
|
const WizardBody_1 = require("./WizardBody");
|
|
7
|
-
const
|
|
7
|
+
const useWizardFooter_1 = require("./hooks/useWizardFooter");
|
|
8
|
+
const WizardContext_1 = require("./WizardContext");
|
|
9
|
+
const WizardStep = ({ children, body, id, footer, isHidden, isDisabled, navItem, status }) => {
|
|
10
|
+
const { currentStep, setStep, toggleStep } = WizardContext_1.useWizardContext();
|
|
11
|
+
useWizardFooter_1.useWizardFooter(footer, id);
|
|
12
|
+
// Update the controlled step when a change is detected with select properties
|
|
13
|
+
react_1.default.useEffect(() => {
|
|
14
|
+
if ((currentStep === null || currentStep === void 0 ? void 0 : currentStep.id) === id && (isDisabled || navItem || status || !(currentStep === null || currentStep === void 0 ? void 0 : currentStep.isVisited))) {
|
|
15
|
+
setStep(Object.assign(Object.assign(Object.assign(Object.assign({ id }, (isDisabled && { isDisabled })), (navItem && { navItem })), (status && { status })), (!(currentStep === null || currentStep === void 0 ? void 0 : currentStep.isVisited) && { isVisited: true })));
|
|
16
|
+
}
|
|
17
|
+
}, [id, setStep, currentStep === null || currentStep === void 0 ? void 0 : currentStep.id, isDisabled, navItem, status, currentStep === null || currentStep === void 0 ? void 0 : currentStep.isVisited]);
|
|
18
|
+
// Toggle visibility when the isHidden flag updates.
|
|
19
|
+
// Wizard's hasUnmountedSteps prop must be set to false for visibility changes to take effect.
|
|
20
|
+
react_1.default.useEffect(() => {
|
|
21
|
+
if (isHidden !== undefined) {
|
|
22
|
+
toggleStep(id, isHidden);
|
|
23
|
+
}
|
|
24
|
+
}, [toggleStep, id, isHidden]);
|
|
25
|
+
return body || body === undefined ? react_1.default.createElement(WizardBody_1.WizardBody, Object.assign({}, body), children) : react_1.default.createElement(react_1.default.Fragment, null, children);
|
|
26
|
+
};
|
|
8
27
|
exports.WizardStep = WizardStep;
|
|
9
28
|
exports.WizardStep.displayName = 'WizardStep';
|
|
10
29
|
//# sourceMappingURL=WizardStep.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardStep.js","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardStep.tsx"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAG1B,6CAA2D;
|
|
1
|
+
{"version":3,"file":"WizardStep.js","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardStep.tsx"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAG1B,6CAA2D;AAC3D,6DAA0D;AAC1D,mDAAmD;AAgC5C,MAAM,UAAU,GAAG,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAmB,EAAE,EAAE;IACnH,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,gCAAgB,EAAE,CAAC;IAEhE,iCAAe,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAE5B,8EAA8E;IAC9E,eAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,EAAE,MAAK,EAAE,IAAI,CAAC,UAAU,IAAI,OAAO,IAAI,MAAM,IAAI,CAAC,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,SAAS,CAAA,CAAC,EAAE;YAC1F,OAAO,2DACL,EAAE,IACC,CAAC,UAAU,IAAI,EAAE,UAAU,EAAE,CAAC,GAC9B,CAAC,OAAO,IAAI,EAAE,OAAO,EAAE,CAAC,GACxB,CAAC,MAAM,IAAI,EAAE,MAAM,EAAE,CAAC,GAEtB,CAAC,CAAC,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,SAAS,CAAA,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EACnD,CAAC;SACJ;IACH,CAAC,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,SAAS,CAAC,CAAC,CAAC;IAExF,oDAAoD;IACpD,8FAA8F;IAC9F,eAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,QAAQ,KAAK,SAAS,EAAE;YAC1B,UAAU,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;SAC1B;IACH,CAAC,EAAE,CAAC,UAAU,EAAE,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC;IAE/B,OAAO,IAAI,IAAI,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,8BAAC,uBAAU,oBAAK,IAAI,GAAG,QAAQ,CAAc,CAAC,CAAC,CAAC,8DAAG,QAAQ,CAAI,CAAC;AACtG,CAAC,CAAC;AA5BW,QAAA,UAAU,cA4BrB;AAEF,kBAAU,CAAC,WAAW,GAAG,YAAY,CAAC"}
|
|
@@ -1,35 +1,29 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { WizardNavProps } from '../Wizard';
|
|
3
|
-
import { WizardControlStep
|
|
3
|
+
import { WizardControlStep } from './types';
|
|
4
4
|
/**
|
|
5
|
-
* Used to toggle between step content, including the body and footer. This is also where the
|
|
5
|
+
* Used to toggle between step content, including the body and footer. This is also where the navigation and its expandability is controlled.
|
|
6
6
|
*/
|
|
7
7
|
export interface WizardToggleProps {
|
|
8
8
|
/** List of steps and/or sub-steps */
|
|
9
9
|
steps: WizardControlStep[];
|
|
10
|
-
/** The
|
|
11
|
-
|
|
10
|
+
/** The current step */
|
|
11
|
+
currentStep: WizardControlStep;
|
|
12
12
|
/** Wizard footer */
|
|
13
13
|
footer: React.ReactElement;
|
|
14
|
-
/** Wizard
|
|
14
|
+
/** Wizard navigation */
|
|
15
15
|
nav: React.ReactElement<WizardNavProps>;
|
|
16
16
|
/** The expandable dropdown button's aria-label */
|
|
17
17
|
'aria-label'?: string;
|
|
18
18
|
/** Flag to unmount inactive steps instead of hiding. Defaults to true */
|
|
19
|
-
|
|
20
|
-
/** Flag to determine whether the dropdown
|
|
19
|
+
hasUnmountedSteps?: boolean;
|
|
20
|
+
/** Flag to determine whether the dropdown navigation is expanded */
|
|
21
21
|
isNavExpanded?: boolean;
|
|
22
|
-
/** Callback to expand or collapse the dropdown
|
|
22
|
+
/** Callback to expand or collapse the dropdown navigation */
|
|
23
23
|
toggleNavExpanded?: () => void;
|
|
24
24
|
}
|
|
25
25
|
export declare const WizardToggle: {
|
|
26
|
-
({ steps,
|
|
26
|
+
({ steps, currentStep, footer, nav, isNavExpanded, toggleNavExpanded, hasUnmountedSteps, "aria-label": ariaLabel }: WizardToggleProps): JSX.Element;
|
|
27
27
|
displayName: string;
|
|
28
28
|
};
|
|
29
|
-
interface WizardToggleInternalProps extends Pick<WizardToggleProps, 'unmountInactiveSteps'> {
|
|
30
|
-
/** Custom WizardNav or callback used to create a default WizardNav */
|
|
31
|
-
nav?: DefaultWizardNavProps | CustomWizardNavFunction;
|
|
32
|
-
}
|
|
33
|
-
export declare const WizardToggleInternal: ({ nav, unmountInactiveSteps }: WizardToggleInternalProps) => JSX.Element;
|
|
34
|
-
export {};
|
|
35
29
|
//# sourceMappingURL=WizardToggle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardToggle.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardToggle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,
|
|
1
|
+
{"version":3,"file":"WizardToggle.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardToggle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAmB,MAAM,SAAS,CAAC;AAE7D;;GAEG;AAEH,MAAM,WAAW,iBAAiB;IAChC,qCAAqC;IACrC,KAAK,EAAE,iBAAiB,EAAE,CAAC;IAC3B,uBAAuB;IACvB,WAAW,EAAE,iBAAiB,CAAC;IAC/B,oBAAoB;IACpB,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC;IAC3B,wBAAwB;IACxB,GAAG,EAAE,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC;IACxC,kDAAkD;IAClD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,yEAAyE;IACzE,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,oEAAoE;IACpE,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,6DAA6D;IAC7D,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;CAChC;AAED,eAAO,MAAM,YAAY;wHAStB,iBAAiB;;CAwEnB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.WizardToggle = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
6
|
const react_styles_1 = require("@patternfly/react-styles");
|
|
@@ -8,17 +8,17 @@ const wizard_1 = tslib_1.__importDefault(require("@patternfly/react-styles/css/c
|
|
|
8
8
|
const angle_right_icon_1 = tslib_1.__importDefault(require('@patternfly/react-icons/dist/js/icons/angle-right-icon'));
|
|
9
9
|
const caret_down_icon_1 = tslib_1.__importDefault(require('@patternfly/react-icons/dist/js/icons/caret-down-icon'));
|
|
10
10
|
const constants_1 = require("../../../helpers/constants");
|
|
11
|
-
const Wizard_1 = require("../Wizard");
|
|
12
11
|
const types_1 = require("./types");
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
12
|
+
const WizardToggle = ({ steps, currentStep, footer, nav, isNavExpanded, toggleNavExpanded, hasUnmountedSteps = true, 'aria-label': ariaLabel = 'Wizard toggle' }) => {
|
|
13
|
+
const isActiveSubStep = types_1.isWizardSubStep(currentStep);
|
|
14
|
+
const nonSubSteps = steps.filter(step => !types_1.isWizardSubStep(step));
|
|
15
|
+
const wizardToggleIndex = nonSubSteps.indexOf(types_1.isWizardSubStep(currentStep) ? steps.find(step => step.id === currentStep.parentId) : currentStep) + 1;
|
|
16
16
|
const handleKeyClicks = react_1.default.useCallback((event) => {
|
|
17
17
|
if (isNavExpanded && event.key === constants_1.KeyTypes.Escape) {
|
|
18
18
|
toggleNavExpanded();
|
|
19
19
|
}
|
|
20
20
|
}, [isNavExpanded, toggleNavExpanded]);
|
|
21
|
-
// Open/close collapsable
|
|
21
|
+
// Open/close collapsable navigation on keydown event
|
|
22
22
|
react_1.default.useEffect(() => {
|
|
23
23
|
const target = typeof document !== 'undefined' ? document.body : null;
|
|
24
24
|
target === null || target === void 0 ? void 0 : target.addEventListener('keydown', handleKeyClicks, false);
|
|
@@ -26,11 +26,11 @@ const WizardToggle = ({ steps, activeStep, footer, nav, isNavExpanded, toggleNav
|
|
|
26
26
|
target === null || target === void 0 ? void 0 : target.removeEventListener('keydown', handleKeyClicks, false);
|
|
27
27
|
};
|
|
28
28
|
}, [handleKeyClicks]);
|
|
29
|
-
// Only render the
|
|
30
|
-
const bodyContent =
|
|
31
|
-
?
|
|
29
|
+
// Only render the current step when hasUnmountedSteps is true
|
|
30
|
+
const bodyContent = hasUnmountedSteps
|
|
31
|
+
? currentStep === null || currentStep === void 0 ? void 0 : currentStep.component
|
|
32
32
|
: steps.map(step => {
|
|
33
|
-
if ((
|
|
33
|
+
if ((currentStep === null || currentStep === void 0 ? void 0 : currentStep.name) === step.name) {
|
|
34
34
|
return step.component;
|
|
35
35
|
}
|
|
36
36
|
return (react_1.default.createElement("div", { key: step.id, style: { display: 'none' } }, step.component));
|
|
@@ -38,10 +38,12 @@ const WizardToggle = ({ steps, activeStep, footer, nav, isNavExpanded, toggleNav
|
|
|
38
38
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
39
39
|
react_1.default.createElement("button", { onClick: toggleNavExpanded, className: react_styles_1.css(wizard_1.default.wizardToggle, isNavExpanded && 'pf-m-expanded'), "aria-label": ariaLabel, "aria-expanded": isNavExpanded },
|
|
40
40
|
react_1.default.createElement("span", { className: react_styles_1.css(wizard_1.default.wizardToggleList) },
|
|
41
|
-
react_1.default.createElement("span", { className: react_styles_1.css(wizard_1.default.wizardToggleListItem) },
|
|
42
|
-
|
|
41
|
+
react_1.default.createElement("span", { className: react_styles_1.css(wizard_1.default.wizardToggleListItem) },
|
|
42
|
+
react_1.default.createElement("span", { className: react_styles_1.css(wizard_1.default.wizardToggleNum) }, wizardToggleIndex),
|
|
43
|
+
" ", currentStep === null || currentStep === void 0 ? void 0 :
|
|
44
|
+
currentStep.name,
|
|
43
45
|
isActiveSubStep && react_1.default.createElement(angle_right_icon_1.default, { className: react_styles_1.css(wizard_1.default.wizardToggleSeparator), "aria-hidden": "true" })),
|
|
44
|
-
isActiveSubStep && react_1.default.createElement("span", { className: react_styles_1.css(wizard_1.default.wizardToggleListItem) },
|
|
46
|
+
isActiveSubStep && react_1.default.createElement("span", { className: react_styles_1.css(wizard_1.default.wizardToggleListItem) }, currentStep === null || currentStep === void 0 ? void 0 : currentStep.name)),
|
|
45
47
|
react_1.default.createElement("span", { className: react_styles_1.css(wizard_1.default.wizardToggleIcon) },
|
|
46
48
|
react_1.default.createElement(caret_down_icon_1.default, { "aria-hidden": "true" }))),
|
|
47
49
|
react_1.default.createElement("div", { className: react_styles_1.css(wizard_1.default.wizardOuterWrap) },
|
|
@@ -51,43 +53,5 @@ const WizardToggle = ({ steps, activeStep, footer, nav, isNavExpanded, toggleNav
|
|
|
51
53
|
footer)));
|
|
52
54
|
};
|
|
53
55
|
exports.WizardToggle = WizardToggle;
|
|
54
|
-
const WizardToggleInternal = ({ nav, unmountInactiveSteps }) => {
|
|
55
|
-
const [isNavExpanded, setIsNavExpanded] = react_1.default.useState(false);
|
|
56
|
-
const { activeStep, steps, footer, goToStepByIndex } = WizardContext_1.useWizardContext();
|
|
57
|
-
const wizardNav = react_1.default.useMemo(() => {
|
|
58
|
-
if (types_1.isCustomWizardNav(nav)) {
|
|
59
|
-
return nav(isNavExpanded, steps, activeStep, goToStepByIndex);
|
|
60
|
-
}
|
|
61
|
-
const navProps = Object.assign({ isExpanded: isNavExpanded, 'aria-label': (nav === null || nav === void 0 ? void 0 : nav.ariaLabel) || 'Wizard nav' }, ((nav === null || nav === void 0 ? void 0 : nav.ariaLabelledBy) && { 'aria-labelledby': nav === null || nav === void 0 ? void 0 : nav.ariaLabelledBy }));
|
|
62
|
-
return (react_1.default.createElement(Wizard_1.WizardNav, Object.assign({}, navProps), steps.map((step, index) => {
|
|
63
|
-
var _a;
|
|
64
|
-
const stepIndex = index + 1;
|
|
65
|
-
const stepNavItem = step.navItem && react_1.default.createElement(react_1.default.Fragment, { key: step.id }, step.navItem);
|
|
66
|
-
if (types_1.isWizardParentStep(step)) {
|
|
67
|
-
let firstSubStepIndex;
|
|
68
|
-
let hasActiveChild = false;
|
|
69
|
-
const subNavItems = (_a = step.subStepIds) === null || _a === void 0 ? void 0 : _a.map((subStepId, index) => {
|
|
70
|
-
const subStep = steps.find(step => step.id === subStepId);
|
|
71
|
-
const subStepIndex = steps.indexOf(subStep) + 1;
|
|
72
|
-
if (index === 0) {
|
|
73
|
-
firstSubStepIndex = subStepIndex;
|
|
74
|
-
}
|
|
75
|
-
if ((activeStep === null || activeStep === void 0 ? void 0 : activeStep.id) === subStep.id) {
|
|
76
|
-
hasActiveChild = true;
|
|
77
|
-
}
|
|
78
|
-
return subStep.navItem ? (react_1.default.createElement(react_1.default.Fragment, { key: subStep.id }, subStep.navItem)) : (react_1.default.createElement(Wizard_1.WizardNavItem, { key: subStep.id, id: subStep.id, content: subStep.name, isCurrent: (activeStep === null || activeStep === void 0 ? void 0 : activeStep.id) === subStep.id, isDisabled: subStep.isDisabled || ((nav === null || nav === void 0 ? void 0 : nav.forceStepVisit) && !subStep.visited), step: subStepIndex, onNavItemClick: goToStepByIndex }));
|
|
79
|
-
});
|
|
80
|
-
const hasEnabledChildren = react_1.default.Children.toArray(subNavItems).some(child => react_1.default.isValidElement(child) && !child.props.isDisabled);
|
|
81
|
-
return (stepNavItem || (react_1.default.createElement(Wizard_1.WizardNavItem, { key: step.id, id: step.id, content: step.name, isExpandable: nav === null || nav === void 0 ? void 0 : nav.isExpandable, isCurrent: hasActiveChild, isDisabled: !hasEnabledChildren, step: firstSubStepIndex, onNavItemClick: goToStepByIndex },
|
|
82
|
-
react_1.default.createElement(Wizard_1.WizardNav, Object.assign({}, navProps, { returnList: true }), subNavItems))));
|
|
83
|
-
}
|
|
84
|
-
if (types_1.isWizardBasicStep(step)) {
|
|
85
|
-
return (stepNavItem || (react_1.default.createElement(Wizard_1.WizardNavItem, { key: step.id, id: step.id, content: step.name, isCurrent: (activeStep === null || activeStep === void 0 ? void 0 : activeStep.id) === step.id, isDisabled: step.isDisabled || ((nav === null || nav === void 0 ? void 0 : nav.forceStepVisit) && !step.visited), step: stepIndex, onNavItemClick: goToStepByIndex })));
|
|
86
|
-
}
|
|
87
|
-
})));
|
|
88
|
-
}, [activeStep, goToStepByIndex, isNavExpanded, nav, steps]);
|
|
89
|
-
return (react_1.default.createElement(exports.WizardToggle, { nav: wizardNav, footer: footer, steps: steps, activeStep: activeStep, isNavExpanded: isNavExpanded, toggleNavExpanded: () => setIsNavExpanded(prevIsExpanded => !prevIsExpanded), unmountInactiveSteps: unmountInactiveSteps }));
|
|
90
|
-
};
|
|
91
|
-
exports.WizardToggleInternal = WizardToggleInternal;
|
|
92
56
|
exports.WizardToggle.displayName = 'WizardToggle';
|
|
93
57
|
//# sourceMappingURL=WizardToggle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardToggle.js","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardToggle.tsx"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAE1B,2DAA+C;AAC/C,2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C1F,eAAe,IAAI,8BAAC,0BAAc,IAAC,SAAS,EAAE,kBAAG,CAAC,gBAAM,CAAC,qBAAqB,CAAC,iBAAc,MAAM,GAAG,CAClG;gBACN,eAAe,IAAI,wCAAM,SAAS,EAAE,kBAAG,CAAC,gBAAM,CAAC,oBAAoB,CAAC,IAAG,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,IAAI,CAAQ,CAC5F;YAEP,wCAAM,SAAS,EAAE,kBAAG,CAAC,gBAAM,CAAC,gBAAgB,CAAC;gBAC3C,8BAAC,yBAAa,mBAAa,MAAM,GAAG,CAC/B,CACA;QACT,uCAAK,SAAS,EAAE,kBAAG,CAAC,gBAAM,CAAC,eAAe,CAAC;YACzC,uCAAK,SAAS,EAAE,kBAAG,CAAC,gBAAM,CAAC,eAAe,CAAC;gBACxC,GAAG;gBACH,WAAW,CACR;YAEL,MAAM,CACH,CACL,CACJ,CAAC;AACJ,CAAC,CAAC;AAjFW,QAAA,YAAY,gBAiFvB;AAEF,oBAAY,CAAC,WAAW,GAAG,cAAc,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { WizardFooterProps } from '../WizardFooter';
|
|
3
3
|
/**
|
|
4
4
|
* Set a unique footer for the wizard. stepId is only required if inactive steps are hidden instead of unmounted.
|
|
5
5
|
* @param footer
|
|
6
6
|
* @param stepId
|
|
7
7
|
*/
|
|
8
|
-
export declare const useWizardFooter: (footer:
|
|
8
|
+
export declare const useWizardFooter: (footer: React.ReactElement | Partial<WizardFooterProps>, stepId?: string | number) => void;
|
|
9
9
|
//# sourceMappingURL=useWizardFooter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWizardFooter.d.ts","sourceRoot":"","sources":["../../../../../../src/next/components/Wizard/hooks/useWizardFooter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useWizardFooter.d.ts","sourceRoot":"","sources":["../../../../../../src/next/components/Wizard/hooks/useWizardFooter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD;;;;GAIG;AACH,eAAO,MAAM,eAAe,WAAY,MAAM,YAAY,GAAG,QAAQ,iBAAiB,CAAC,WAAW,MAAM,GAAG,MAAM,SAahH,CAAC"}
|
|
@@ -10,16 +10,16 @@ const WizardContext_1 = require("../WizardContext");
|
|
|
10
10
|
* @param stepId
|
|
11
11
|
*/
|
|
12
12
|
const useWizardFooter = (footer, stepId) => {
|
|
13
|
-
const {
|
|
13
|
+
const { currentStep, setFooter } = WizardContext_1.useWizardContext();
|
|
14
14
|
react_1.default.useEffect(() => {
|
|
15
|
-
if (!stepId ||
|
|
15
|
+
if (footer && (!stepId || (currentStep === null || currentStep === void 0 ? void 0 : currentStep.id) === stepId)) {
|
|
16
16
|
setFooter(footer);
|
|
17
17
|
// Reset the footer on unmount.
|
|
18
18
|
return () => {
|
|
19
19
|
setFooter(null);
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
}, [
|
|
22
|
+
}, [currentStep, footer, setFooter, stepId]);
|
|
23
23
|
};
|
|
24
24
|
exports.useWizardFooter = useWizardFooter;
|
|
25
25
|
//# sourceMappingURL=useWizardFooter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWizardFooter.js","sourceRoot":"","sources":["../../../../../../src/next/components/Wizard/hooks/useWizardFooter.tsx"],"names":[],"mappings":";;;;AAAA,0DAA0B;
|
|
1
|
+
{"version":3,"file":"useWizardFooter.js","sourceRoot":"","sources":["../../../../../../src/next/components/Wizard/hooks/useWizardFooter.tsx"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAE1B,oDAAoD;AAGpD;;;;GAIG;AACI,MAAM,eAAe,GAAG,CAAC,MAAuD,EAAE,MAAwB,EAAE,EAAE;IACnH,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,GAAG,gCAAgB,EAAE,CAAC;IAEtD,eAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,MAAM,IAAI,CAAC,CAAC,MAAM,IAAI,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,EAAE,MAAK,MAAM,CAAC,EAAE;YACrD,SAAS,CAAC,MAAM,CAAC,CAAC;YAElB,+BAA+B;YAC/B,OAAO,GAAG,EAAE;gBACV,SAAS,CAAC,IAAI,CAAC,CAAC;YAClB,CAAC,CAAC;SACH;IACH,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;AAC/C,CAAC,CAAC;AAbW,QAAA,eAAe,mBAa1B"}
|
|
@@ -1,74 +1,65 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { WizardNavProps, WizardNavItemProps } from '../Wizard';
|
|
2
|
+
import { WizardNavProps, WizardNavItemProps, WizardFooterProps } from '../Wizard';
|
|
3
3
|
/** Type used to define 'basic' steps, or in other words, steps that are neither parents or children of parents. */
|
|
4
4
|
export interface WizardBasicStep {
|
|
5
|
-
/** Name of the step's
|
|
5
|
+
/** Name of the step's navigation item */
|
|
6
6
|
name: React.ReactNode;
|
|
7
7
|
/** Unique identifier */
|
|
8
8
|
id: string | number;
|
|
9
|
-
/** Flag to disable the step's
|
|
9
|
+
/** Flag to disable the step's navigation item */
|
|
10
10
|
isDisabled?: boolean;
|
|
11
11
|
/** Flag to represent whether the step has been visited (navigated to) */
|
|
12
|
-
|
|
13
|
-
/**
|
|
12
|
+
isVisited?: boolean;
|
|
13
|
+
/** Flag to determine whether the step is hidden */
|
|
14
|
+
isHidden?: boolean;
|
|
15
|
+
/** Content shown when the step's navigation item is selected. When treated as a parent step, only sub-step content will be shown. */
|
|
14
16
|
component?: React.ReactElement;
|
|
15
|
-
/**
|
|
16
|
-
navItem?:
|
|
17
|
-
/**
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
/** Replaces the step's navigation item or its properties. */
|
|
18
|
+
navItem?: WizardNavItemType;
|
|
19
|
+
/** Replaces the step's footer. The step's footer takes precedance over the wizard's footer. */
|
|
20
|
+
footer?: React.ReactElement | Partial<WizardFooterProps>;
|
|
21
|
+
/** Used to determine icon next to the step's navItem */
|
|
22
|
+
status?: 'default' | 'error';
|
|
23
|
+
}
|
|
24
|
+
export declare enum WizardNavItemStatus {
|
|
25
|
+
Default = "default",
|
|
26
|
+
Error = "error"
|
|
25
27
|
}
|
|
26
28
|
/** Type used to define parent steps. */
|
|
27
29
|
export interface WizardParentStep extends WizardBasicStep {
|
|
28
30
|
/** Nested step IDs */
|
|
29
|
-
subStepIds: string[];
|
|
31
|
+
subStepIds: (string | number)[];
|
|
30
32
|
}
|
|
31
33
|
/** Type used to define sub-steps. */
|
|
32
34
|
export interface WizardSubStep extends WizardBasicStep {
|
|
33
35
|
/** Unique identifier of the parent step */
|
|
34
36
|
parentId: string | number;
|
|
35
37
|
}
|
|
36
|
-
/** Used to customize aspects of the Wizard's default navigation. */
|
|
37
|
-
export interface DefaultWizardNavProps {
|
|
38
|
-
/** Flag indicating nav items with sub steps are expandable */
|
|
39
|
-
isExpandable?: boolean;
|
|
40
|
-
/** Aria-label for the Nav */
|
|
41
|
-
ariaLabel?: string;
|
|
42
|
-
/** Sets aria-labelledby on nav element */
|
|
43
|
-
ariaLabelledBy?: string;
|
|
44
|
-
/** Disable step nav items until they are visited */
|
|
45
|
-
forceStepVisit?: boolean;
|
|
46
|
-
}
|
|
47
|
-
/** Used to customize aspects of the Wizard's default footer. */
|
|
48
|
-
export interface DefaultWizardFooterProps {
|
|
49
|
-
/** The Next button text */
|
|
50
|
-
nextButtonText?: React.ReactNode;
|
|
51
|
-
/** The Back button text */
|
|
52
|
-
backButtonText?: React.ReactNode;
|
|
53
|
-
/** The Cancel button text */
|
|
54
|
-
cancelButtonText?: React.ReactNode;
|
|
55
|
-
/** Next button callback */
|
|
56
|
-
onNext?: () => WizardNavStepFunction | void;
|
|
57
|
-
/** Back button callback */
|
|
58
|
-
onBack?: () => WizardNavStepFunction | void;
|
|
59
|
-
/** Cancel link callback */
|
|
60
|
-
onClose?: () => void;
|
|
61
|
-
}
|
|
62
38
|
/** Encompasses all step type variants that are internally controlled by the Wizard. */
|
|
63
39
|
export declare type WizardControlStep = WizardBasicStep | WizardParentStep | WizardSubStep;
|
|
64
40
|
/** Callback for the Wizard's 'onNext', 'onBack', and 'onNavByIndex' properties. */
|
|
65
41
|
export declare type WizardNavStepFunction = (currentStep: WizardNavStepData, previousStep: WizardNavStepData) => void;
|
|
66
42
|
/** Data returned for either parameter of WizardNavStepFunction. */
|
|
67
|
-
export
|
|
43
|
+
export interface WizardNavStepData {
|
|
44
|
+
/** Unique identifier */
|
|
45
|
+
id: string | number;
|
|
46
|
+
/** Name of the step */
|
|
47
|
+
name: string;
|
|
48
|
+
/** Index of the step (starts at 1) */
|
|
49
|
+
index: number;
|
|
50
|
+
}
|
|
51
|
+
export declare type WizardFooterType = Partial<WizardFooterProps> | CustomWizardFooterFunction | React.ReactElement;
|
|
52
|
+
export declare type WizardNavType = Partial<WizardNavProps> | CustomWizardNavFunction | React.ReactElement;
|
|
53
|
+
export declare type WizardNavItemType = Partial<WizardNavItemProps> | CustomWizardNavItemFunction | React.ReactElement;
|
|
68
54
|
/** Callback for the Wizard's 'nav' property. Returns element which replaces the Wizard's default navigation. */
|
|
69
|
-
export declare type CustomWizardNavFunction = (isExpanded: boolean, steps: WizardControlStep[],
|
|
70
|
-
|
|
71
|
-
export declare
|
|
55
|
+
export declare type CustomWizardNavFunction = (isExpanded: boolean, steps: WizardControlStep[], currentStep: WizardControlStep, goToStepByIndex: (index: number) => void) => React.ReactElement<WizardNavProps>;
|
|
56
|
+
/** Callback for the Wizard's 'navItem' property. Returns element which replaces the WizardStep's default navigation item. */
|
|
57
|
+
export declare type CustomWizardNavItemFunction = (step: WizardControlStep, currentStep: WizardControlStep, steps: WizardControlStep[], goToStepByIndex: (index: number) => void) => React.ReactElement<WizardNavItemProps>;
|
|
58
|
+
/** Callback for the Wizard's 'footer' property. Returns element which replaces the Wizard's default footer. */
|
|
59
|
+
export declare type CustomWizardFooterFunction = (currentStep: WizardControlStep, onNext: () => void, onBack: () => void, onClose: () => void) => React.ReactElement<WizardFooterProps>;
|
|
60
|
+
export declare function isCustomWizardNav(nav: WizardNavType): nav is CustomWizardNavFunction | React.ReactElement;
|
|
61
|
+
export declare function isCustomWizardNavItem(navItem: WizardNavItemType): navItem is CustomWizardNavItemFunction | React.ReactElement;
|
|
62
|
+
export declare function isCustomWizardFooter(footer: WizardFooterType): footer is CustomWizardFooterFunction | React.ReactElement;
|
|
72
63
|
export declare function isWizardBasicStep(step: WizardControlStep): step is WizardBasicStep;
|
|
73
64
|
export declare function isWizardSubStep(step: WizardControlStep): step is WizardSubStep;
|
|
74
65
|
export declare function isWizardParentStep(step: WizardControlStep): step is WizardParentStep;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/types.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/types.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAElF,mHAAmH;AACnH,MAAM,WAAW,eAAe;IAC9B,yCAAyC;IACzC,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,wBAAwB;IACxB,EAAE,EAAE,MAA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iB,CAAC,IAAI,EAAE,iBAAiB,GAAG,IAAI,IAAI,eAAe,CAElF;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,iBAAiB,GAAG,IAAI,IAAI,aAAa,CAE9E;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,iBAAiB,GAAG,IAAI,IAAI,gBAAgB,CAEpF"}
|
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isWizardParentStep = exports.isWizardSubStep = exports.isWizardBasicStep = exports.isCustomWizardFooter = exports.isCustomWizardNav = void 0;
|
|
3
|
+
exports.isWizardParentStep = exports.isWizardSubStep = exports.isWizardBasicStep = exports.isCustomWizardFooter = exports.isCustomWizardNavItem = exports.isCustomWizardNav = exports.WizardNavItemStatus = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
var WizardNavItemStatus;
|
|
7
|
+
(function (WizardNavItemStatus) {
|
|
8
|
+
WizardNavItemStatus["Default"] = "default";
|
|
9
|
+
WizardNavItemStatus["Error"] = "error";
|
|
10
|
+
})(WizardNavItemStatus = exports.WizardNavItemStatus || (exports.WizardNavItemStatus = {}));
|
|
6
11
|
function isCustomWizardNav(nav) {
|
|
7
|
-
return typeof nav === 'function';
|
|
12
|
+
return typeof nav === 'function' || react_1.default.isValidElement(nav);
|
|
8
13
|
}
|
|
9
14
|
exports.isCustomWizardNav = isCustomWizardNav;
|
|
15
|
+
function isCustomWizardNavItem(navItem) {
|
|
16
|
+
return typeof navItem === 'function' || react_1.default.isValidElement(navItem);
|
|
17
|
+
}
|
|
18
|
+
exports.isCustomWizardNavItem = isCustomWizardNavItem;
|
|
10
19
|
function isCustomWizardFooter(footer) {
|
|
11
|
-
return react_1.default.isValidElement(footer);
|
|
20
|
+
return typeof footer === 'function' || react_1.default.isValidElement(footer);
|
|
12
21
|
}
|
|
13
22
|
exports.isCustomWizardFooter = isCustomWizardFooter;
|
|
14
23
|
function isWizardBasicStep(step) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/types.tsx"],"names":[],"mappings":";;;;AAAA,0DAA0B;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/types.tsx"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAyB1B,IAAY,mBAGX;AAHD,WAAY,mBAAmB;IAC7B,0CAAmB,CAAA;IACnB,sCAAe,CAAA;AACjB,CAAC,EAHW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAG9B;AA0DD,SAAgB,iBAAiB,CAAC,GAAkB;IAClD,OAAO,OAAO,GAAG,KAAK,UAAU,IAAI,eAAK,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;AAChE,CAAC;AAFD,8CAEC;AAED,SAAgB,qBAAqB,CACnC,OAA0B;IAE1B,OAAO,OAAO,OAAO,KAAK,UAAU,IAAI,eAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;AACxE,CAAC;AAJD,sDAIC;AAED,SAAgB,oBAAoB,CAClC,MAAwB;IAExB,OAAO,OAAO,MAAM,KAAK,UAAU,IAAI,eAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;AACtE,CAAC;AAJD,oDAIC;AAED,SAAgB,iBAAiB,CAAC,IAAuB;;IACvD,OAAO,CAAA,MAAC,IAAyB,0CAAE,UAAU,MAAK,SAAS,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;AACxF,CAAC;AAFD,8CAEC;AAED,SAAgB,eAAe,CAAC,IAAuB;;IACrD,OAAO,CAAA,MAAC,IAAsB,0CAAE,QAAQ,MAAK,SAAS,CAAC;AACzD,CAAC;AAFD,0CAEC;AAED,SAAgB,kBAAkB,CAAC,IAAuB;;IACxD,OAAO,CAAA,MAAC,IAAyB,0CAAE,UAAU,MAAK,SAAS,CAAC;AAC9D,CAAC;AAFD,gDAEC"}
|
|
@@ -7,9 +7,8 @@ import { WizardStepProps } from './WizardStep';
|
|
|
7
7
|
* @returns WizardControlStep[]
|
|
8
8
|
*/
|
|
9
9
|
export declare const buildSteps: (children: React.ReactElement<WizardStepProps> | React.ReactElement<WizardStepProps>[]) => WizardControlStep[];
|
|
10
|
-
export declare
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export declare const getActiveStep: (steps: WizardControlStep[], currentStepIndex: number) => WizardControlStep;
|
|
10
|
+
export declare function isWizardStep(child: any | React.ReactElement<WizardStepProps>): child is React.ReactElement<WizardStepProps>;
|
|
11
|
+
export declare const normalizeStep: ({ children, steps, body, ...controlStep }: WizardStepProps) => WizardControlStep;
|
|
12
|
+
export declare const normalizeNavStep: (navStep: WizardControlStep, steps: WizardControlStep[]) => WizardNavStepData;
|
|
13
|
+
export declare const getCurrentStep: (steps: WizardControlStep[], currentStepIndex: number) => WizardControlStep;
|
|
15
14
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAc,eAAe,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAc,eAAe,EAAE,MAAM,cAAc,CAAC;AAE3D;;;;GAIG;AACH,eAAO,MAAM,UAAU,aAAc,MAAM,YAAY,CAAC,eAAe,CAAC,GAAG,MAAM,YAAY,CAAC,eAAe,CAAC,EAAE,wBAyBxG,CAAC;AAET,wBAAgB,YAAY,CAC1B,KAAK,EAAE,GAAG,GAAG,KAAK,CAAC,YAAY,CAAC,eAAe,CAAC,GAC/C,KAAK,IAAI,KAAK,CAAC,YAAY,CAAC,eAAe,CAAC,CAK9C;AAGD,eAAO,MAAM,aAAa,8CAA+C,eAAe,KAAG,iBAC9E,CAAC;AAEd,eAAO,MAAM,gBAAgB,YAAa,iBAAiB,SAAS,iBAAiB,EAAE,KAAG,iBAIxF,CAAC;AAEH,eAAO,MAAM,cAAc,UAAW,iBAAiB,EAAE,oBAAoB,MAAM,sBACzB,CAAC"}
|
|
@@ -1,27 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getCurrentStep = 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");
|
|
7
|
-
function hasWizardStepProps(props) {
|
|
8
|
-
return props.name !== undefined && props.id !== undefined;
|
|
9
|
-
}
|
|
10
7
|
/**
|
|
11
8
|
* Accumulate list of step & sub-step props pulled from child components
|
|
12
9
|
* @param children
|
|
13
10
|
* @returns WizardControlStep[]
|
|
14
11
|
*/
|
|
15
12
|
const buildSteps = (children) => react_1.default.Children.toArray(children).reduce((acc, child) => {
|
|
16
|
-
if (
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const _a = child.props, { steps: subSteps, id, children } = _a, stepProps = tslib_1.__rest(_a, ["steps", "id", "children"]);
|
|
20
|
-
acc.push(Object.assign(Object.assign({ id, component: child }, stepProps), (subSteps && {
|
|
13
|
+
if (isWizardStep(child)) {
|
|
14
|
+
const { steps: subSteps, id } = child.props;
|
|
15
|
+
acc.push(Object.assign(Object.assign({ component: child }, exports.normalizeStep(child.props)), (subSteps && {
|
|
21
16
|
subStepIds: subSteps === null || subSteps === void 0 ? void 0 : subSteps.map(subStep => {
|
|
22
|
-
|
|
23
|
-
const _a = subStep.props, { children } = _a, subStepProps = tslib_1.__rest(_a, ["children"]);
|
|
24
|
-
acc.push(Object.assign(Object.assign({}, subStepProps), { component: subStep, parentId: id }));
|
|
17
|
+
acc.push(Object.assign(Object.assign({}, exports.normalizeStep(subStep.props)), { component: subStep, parentId: id }));
|
|
25
18
|
return subStep.props.id;
|
|
26
19
|
})
|
|
27
20
|
})));
|
|
@@ -32,8 +25,24 @@ const buildSteps = (children) => react_1.default.Children.toArray(children).redu
|
|
|
32
25
|
return acc;
|
|
33
26
|
}, []);
|
|
34
27
|
exports.buildSteps = buildSteps;
|
|
35
|
-
|
|
28
|
+
function isWizardStep(child) {
|
|
29
|
+
var _a, _b;
|
|
30
|
+
return ((react_1.default.isValidElement(child) && child.type === WizardStep_1.WizardStep) ||
|
|
31
|
+
(((_a = child.props) === null || _a === void 0 ? void 0 : _a.name) !== undefined && ((_b = child.props) === null || _b === void 0 ? void 0 : _b.id) !== undefined));
|
|
32
|
+
}
|
|
33
|
+
exports.isWizardStep = isWizardStep;
|
|
34
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
35
|
+
const normalizeStep = (_a) => {
|
|
36
|
+
var { children, steps, body } = _a, controlStep = tslib_1.__rest(_a, ["children", "steps", "body"]);
|
|
37
|
+
return controlStep;
|
|
38
|
+
};
|
|
39
|
+
exports.normalizeStep = normalizeStep;
|
|
40
|
+
const normalizeNavStep = (navStep, steps) => ({
|
|
41
|
+
id: navStep.id,
|
|
42
|
+
name: navStep.name.toString(),
|
|
43
|
+
index: steps.indexOf(navStep) + 1
|
|
44
|
+
});
|
|
36
45
|
exports.normalizeNavStep = normalizeNavStep;
|
|
37
|
-
const
|
|
38
|
-
exports.
|
|
46
|
+
const getCurrentStep = (steps, currentStepIndex) => steps.find((_, index) => index + 1 === currentStepIndex);
|
|
47
|
+
exports.getCurrentStep = getCurrentStep;
|
|
39
48
|
//# 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
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/utils.ts"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAG1B,6CAA2D;AAE3D;;;;GAIG;AACI,MAAM,UAAU,GAAG,CAAC,QAAqF,EAAE,EAAE,CAClH,eAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,GAAwB,EAAE,KAA6C,EAAE,EAAE;IAClH,IAAI,YAAY,CAAC,KAAK,CAAC,EAAE;QACvB,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC;QAE5C,GAAG,CAAC,IAAI,+BACN,SAAS,EAAE,KAAK,IACb,qBAAa,CAAC,KAAK,CAAC,KAAK,CAAC,GAC1B,CAAC,QAAQ,IAAI;YACd,UAAU,EAAE,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,GAAG,CAAC,OAAO,CAAC,EAAE;gBAClC,GAAG,CAAC,IAAI,iCACH,qBAAa,CAAC,OAAO,CAAC,KAAK,CAAC,KAC/B,SAAS,EAAE,OAAO,EAClB,QAAQ,EAAE,EAAE,IACZ,CAAC;gBAEH,OAAO,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YAC1B,CAAC,CAAC;SACH,CAAC,EACF,CAAC;KACJ;SAAM;QACL,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;KACpE;IAED,OAAO,GAAG,CAAC;AACb,CAAC,EAAE,EAAE,CAAC,CAAC;AAzBI,QAAA,UAAU,cAyBd;AAET,SAAgB,YAAY,CAC1B,KAAgD;;IAEhD,OAAO,CACL,CAAC,eAAK,CAAC,cAAc,CAAC,KAAK,CAAC,IAAK,KAA6C,CAAC,IAAI,KAAK,uBAAU,CAAC;QACnG,CAAC,CAAA,MAAA,KAAK,CAAC,KAAK,0CAAE,IAAI,MAAK,SAAS,IAAI,CAAA,MAAA,KAAK,CAAC,KAAK,0CAAE,EAAE,MAAK,SAAS,CAAC,CACnE,CAAC;AACJ,CAAC;AAPD,oCAOC;AAED,6DAA6D;AACtD,MAAM,aAAa,GAAG,CAAC,EAA0D,EAAqB,EAAE;QAAjF,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,OAAmC,EAA9B,WAAW,sBAAvC,6BAAyC,CAAF;IACnE,OAAA,WAAW,CAAA;CAAA,CAAC;AADD,QAAA,aAAa,iBACZ;AAEP,MAAM,gBAAgB,GAAG,CAAC,OAA0B,EAAE,KAA0B,EAAqB,EAAE,CAAC,CAAC;IAC9G,EAAE,EAAE,OAAO,CAAC,EAAE;IACd,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE;IAC7B,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC;CAClC,CAAC,CAAC;AAJU,QAAA,gBAAgB,oBAI1B;AAEI,MAAM,cAAc,GAAG,CAAC,KAA0B,EAAE,gBAAwB,EAAE,EAAE,CACrF,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,GAAG,CAAC,KAAK,gBAAgB,CAAC,CAAC;AAD9C,QAAA,cAAc,kBACgC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/next/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/next/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./Wizard"), exports);
|
|
5
4
|
tslib_1.__exportStar(require("./Dropdown"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./Select"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./Wizard"), exports);
|
|
6
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/next/components/index.ts"],"names":[],"mappings":";;;AAAA,mDAAyB;AACzB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/next/components/index.ts"],"names":[],"mappings":";;;AAAA,qDAA2B;AAC3B,mDAAyB;AACzB,mDAAyB"}
|