@patternfly/react-core 4.276.5 → 4.276.6
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 +8 -0
- package/dist/esm/next/components/Wizard/WizardContext.d.ts +1 -1
- package/dist/esm/next/components/Wizard/WizardContext.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/WizardContext.js +3 -3
- package/dist/esm/next/components/Wizard/WizardContext.js.map +1 -1
- package/dist/esm/next/components/Wizard/WizardStep.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/WizardStep.js +16 -3
- package/dist/esm/next/components/Wizard/WizardStep.js.map +1 -1
- package/dist/esm/next/components/Wizard/hooks/index.d.ts +0 -1
- package/dist/esm/next/components/Wizard/hooks/index.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/hooks/index.js +0 -1
- package/dist/esm/next/components/Wizard/hooks/index.js.map +1 -1
- package/dist/js/next/components/Wizard/WizardContext.d.ts +1 -1
- package/dist/js/next/components/Wizard/WizardContext.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/WizardContext.js +3 -3
- package/dist/js/next/components/Wizard/WizardContext.js.map +1 -1
- package/dist/js/next/components/Wizard/WizardStep.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/WizardStep.js +16 -3
- package/dist/js/next/components/Wizard/WizardStep.js.map +1 -1
- package/dist/js/next/components/Wizard/hooks/index.d.ts +0 -1
- package/dist/js/next/components/Wizard/hooks/index.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/hooks/index.js +1 -3
- package/dist/js/next/components/Wizard/hooks/index.js.map +1 -1
- package/next/components/Wizard/WizardContext.d.ts +1 -1
- package/next/components/Wizard/WizardContext.d.ts.map +1 -1
- package/next/components/Wizard/WizardContext.js +3 -3
- package/next/components/Wizard/WizardContext.js.map +1 -1
- package/next/components/Wizard/WizardStep.d.ts.map +1 -1
- package/next/components/Wizard/WizardStep.js +16 -3
- package/next/components/Wizard/WizardStep.js.map +1 -1
- package/next/components/Wizard/hooks/index.d.ts +0 -1
- package/next/components/Wizard/hooks/index.d.ts.map +1 -1
- package/next/components/Wizard/hooks/index.js +0 -1
- package/next/components/Wizard/hooks/index.js.map +1 -1
- package/package.json +2 -2
- package/src/next/components/Wizard/WizardContext.tsx +12 -4
- package/src/next/components/Wizard/WizardStep.tsx +16 -4
- package/src/next/components/Wizard/hooks/index.ts +0 -1
- package/dist/esm/next/components/Wizard/hooks/useGetMergedSteps.d.ts +0 -9
- package/dist/esm/next/components/Wizard/hooks/useGetMergedSteps.d.ts.map +0 -1
- package/dist/esm/next/components/Wizard/hooks/useGetMergedSteps.js +0 -33
- package/dist/esm/next/components/Wizard/hooks/useGetMergedSteps.js.map +0 -1
- package/dist/js/next/components/Wizard/hooks/useGetMergedSteps.d.ts +0 -9
- package/dist/js/next/components/Wizard/hooks/useGetMergedSteps.d.ts.map +0 -1
- package/dist/js/next/components/Wizard/hooks/useGetMergedSteps.js +0 -38
- package/dist/js/next/components/Wizard/hooks/useGetMergedSteps.js.map +0 -1
- package/next/components/Wizard/hooks/useGetMergedSteps.d.ts +0 -9
- package/next/components/Wizard/hooks/useGetMergedSteps.d.ts.map +0 -1
- package/next/components/Wizard/hooks/useGetMergedSteps.js +0 -33
- package/next/components/Wizard/hooks/useGetMergedSteps.js.map +0 -1
- package/src/next/components/Wizard/hooks/useGetMergedSteps.tsx +0 -45
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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.276.6](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-core@4.276.5...@patternfly/react-core@4.276.6) (2023-01-27)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @patternfly/react-core
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## 4.276.5 (2023-01-24)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @patternfly/react-core
|
|
@@ -35,7 +35,7 @@ export interface WizardContextProviderProps {
|
|
|
35
35
|
children: React.ReactElement;
|
|
36
36
|
onNext(event: React.MouseEvent<HTMLButtonElement>, steps: WizardStepType[]): void;
|
|
37
37
|
onBack(event: React.MouseEvent<HTMLButtonElement>, steps: WizardStepType[]): void;
|
|
38
|
-
onClose(event: React.MouseEvent<HTMLButtonElement>): void;
|
|
38
|
+
onClose?(event: React.MouseEvent<HTMLButtonElement>): void;
|
|
39
39
|
goToStepById(steps: WizardStepType[], id: number | string): void;
|
|
40
40
|
goToStepByName(steps: WizardStepType[], name: string): void;
|
|
41
41
|
goToStepByIndex(event: React.MouseEvent<HTMLButtonElement> | React.MouseEvent<HTMLAnchorElement>, steps: WizardStepType[], index: number): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardContext.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAyC,cAAc,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"WizardContext.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAyC,cAAc,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAElG,OAAO,EAAgB,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEjE,MAAM,WAAW,kBAAkB;IACjC,oBAAoB;IACpB,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,mBAAmB;IACnB,UAAU,EAAE,cAAc,CAAC;IAC3B,qBAAqB;IACrB,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC;IAC3B,uBAAuB;IACvB,KAAK,EAAE,MAAM,IAA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AAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAAC;IAC3D,YAAY,CAAC,KAAK,EAAE,cAAc,EAAE,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACjE,cAAc,CAAC,KAAK,EAAE,cAAc,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5D,eAAe,CACb,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAChF,KAAK,EAAE,cAAc,EAAE,EACvB,KAAK,EAAE,MAAM,GACZ,IAAI,CAAC;CACT;AAED,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,iBAAiB,CAAC,0BAA0B,CA8FrF,CAAC;AAIF,eAAO,MAAM,gBAAgB,0BAAwC,CAAC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { isCustomWizardFooter, isWizardSubStep } from './types';
|
|
3
3
|
import { getActiveStep } from './utils';
|
|
4
|
-
import { useGetMergedSteps } from './hooks';
|
|
5
4
|
import { WizardFooter } from './WizardFooter';
|
|
6
5
|
export const WizardContext = React.createContext({});
|
|
7
6
|
export const WizardContextProvider = ({ steps: initialSteps, footer: initialFooter, activeStepIndex, children, onNext, onBack, onClose, goToStepById, goToStepByName, goToStepByIndex }) => {
|
|
8
7
|
const [currentSteps, setCurrentSteps] = React.useState(initialSteps);
|
|
9
8
|
const [currentFooter, setCurrentFooter] = React.useState(typeof initialFooter !== 'function' ? initialFooter : undefined);
|
|
10
|
-
|
|
9
|
+
// Combined initial and current state steps
|
|
10
|
+
const steps = React.useMemo(() => currentSteps.map((currentStepProps, index) => (Object.assign(Object.assign({}, currentStepProps), initialSteps[index]))), [initialSteps, currentSteps]);
|
|
11
11
|
const activeStep = React.useMemo(() => getActiveStep(steps, activeStepIndex), [activeStepIndex, steps]);
|
|
12
|
-
const close = React.useCallback(() => onClose(null), [onClose]);
|
|
12
|
+
const close = React.useCallback(() => onClose === null || onClose === void 0 ? void 0 : onClose(null), [onClose]);
|
|
13
13
|
const goToNextStep = React.useCallback(() => onNext(null, steps), [onNext, steps]);
|
|
14
14
|
const goToPrevStep = React.useCallback(() => onBack(null, steps), [onBack, steps]);
|
|
15
15
|
const footer = React.useMemo(() => {
|
|
@@ -1 +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,oBAAoB,EAAE,eAAe,EAAoC,MAAM,SAAS,CAAC;AAClG,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,
|
|
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,oBAAoB,EAAE,eAAe,EAAoC,MAAM,SAAS,CAAC;AAClG,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,YAAY,EAAqB,MAAM,gBAAgB,CAAC;AA6BjE,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC,EAAwB,CAAC,CAAC;AAmB3E,MAAM,CAAC,MAAM,qBAAqB,GAAwD,CAAC,EACzF,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,aAAa,EACrB,eAAe,EACf,QAAQ,EACR,MAAM,EACN,MAAM,EACN,OAAO,EACP,YAAY,EACZ,cAAc,EACd,eAAe,EAChB,EAAE,EAAE;IACH,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;IACrE,MAAM,CAAC,aAAa,EAAE,gB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AE,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,EAAE,UAAU,CAAC,GAAG,IAAI,CAAC;IAClE,iCAAiC;IACjC,KAAK,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,eAAe,CAAC,EAAE,CAAC;IAC9C,iDAAiD;IACjD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,mDAAmD;IACnD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,6DAA6D;IAC7D,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,+FAA+F;IAC/F,MAAM,CAAC,EAAE,KAAK,CAAC,YAAY,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACzD,gEAAgE;IAChE,MAAM,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAC7B,mFAAmF;IACnF,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,eAAO,MAAM,UAAU;+CAA8C,eAAe;;CAkCnF,CAAC"}
|
|
@@ -6,12 +6,25 @@ export const WizardStep = (_a) => {
|
|
|
6
6
|
var { children, steps: _subSteps } = _a, props = __rest(_a, ["children", "steps"]);
|
|
7
7
|
const { activeStep, setStep } = useWizardContext();
|
|
8
8
|
const { id, name, body, isDisabled, isHidden, navItem, footer, status } = props;
|
|
9
|
+
const isParentStep = isWizardParentStep(activeStep);
|
|
9
10
|
// Update step in context when props change or when the step is active has yet to be marked as visited.
|
|
10
11
|
React.useEffect(() => {
|
|
11
|
-
const shouldUpdateIsVisited = !isWizardParentStep(activeStep) && id === (activeStep === null || activeStep === void 0 ? void 0 : activeStep.id) && !(activeStep === null || activeStep === void 0 ? void 0 : activeStep.isVisited);
|
|
12
12
|
setStep(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ id,
|
|
13
|
-
name }, (body && { body })), (isDisabled && { isDisabled })), (isHidden && { isHidden })), (navItem && { navItem })), (footer && { footer })), (status && { status })), (
|
|
14
|
-
}, [
|
|
13
|
+
name }, (body && { body })), (isDisabled && { isDisabled })), (isHidden && { isHidden })), (navItem && { navItem })), (footer && { footer })), (status && { status })), (!isParentStep && id === (activeStep === null || activeStep === void 0 ? void 0 : activeStep.id) && !(activeStep === null || activeStep === void 0 ? void 0 : activeStep.isVisited) && { isVisited: true })));
|
|
14
|
+
}, [
|
|
15
|
+
body,
|
|
16
|
+
footer,
|
|
17
|
+
id,
|
|
18
|
+
isDisabled,
|
|
19
|
+
isHidden,
|
|
20
|
+
name,
|
|
21
|
+
navItem,
|
|
22
|
+
status,
|
|
23
|
+
isParentStep,
|
|
24
|
+
setStep,
|
|
25
|
+
activeStep === null || activeStep === void 0 ? void 0 : activeStep.id,
|
|
26
|
+
activeStep === null || activeStep === void 0 ? void 0 : activeStep.isVisited
|
|
27
|
+
]);
|
|
15
28
|
return React.createElement(React.Fragment, null, children);
|
|
16
29
|
};
|
|
17
30
|
WizardStep.displayName = 'WizardStep';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardStep.js","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardStep.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAqB,MAAM,SAAS,CAAC;AAEhE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAgCnD,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EAAyD,EAAE,EAAE;QAA7D,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,OAA6B,EAAxB,KAAK,cAAtC,qBAAwC,CAAF;IAC/D,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,gBAAgB,EAAE,CAAC;IACnD,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"WizardStep.js","sourceRoot":"","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ACJ,MAAM;QACN,EAAE;QACF,UAAU;QACV,QAAQ;QACR,IAAI;QACJ,OAAO;QACP,MAAM;QACN,YAAY;QACZ,OAAO;QACP,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,EAAE;QACd,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,SAAS;KACtB,CAAC,CAAC;IAEH,OAAO,0CAAG,QAAQ,CAAI,CAAC;AACzB,CAAC,CAAC;AAEF,UAAU,CAAC,WAAW,GAAG,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/next/components/Wizard/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/next/components/Wizard/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/next/components/Wizard/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/next/components/Wizard/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -35,7 +35,7 @@ export interface WizardContextProviderProps {
|
|
|
35
35
|
children: React.ReactElement;
|
|
36
36
|
onNext(event: React.MouseEvent<HTMLButtonElement>, steps: WizardStepType[]): void;
|
|
37
37
|
onBack(event: React.MouseEvent<HTMLButtonElement>, steps: WizardStepType[]): void;
|
|
38
|
-
onClose(event: React.MouseEvent<HTMLButtonElement>): void;
|
|
38
|
+
onClose?(event: React.MouseEvent<HTMLButtonElement>): void;
|
|
39
39
|
goToStepById(steps: WizardStepType[], id: number | string): void;
|
|
40
40
|
goToStepByName(steps: WizardStepType[], name: string): void;
|
|
41
41
|
goToStepByIndex(event: React.MouseEvent<HTMLButtonElement> | React.MouseEvent<HTMLAnchorElement>, steps: WizardStepType[], index: number): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardContext.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAyC,cAAc,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"WizardContext.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAyC,cAAc,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAElG,OAAO,EAAgB,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEjE,MAAM,WAAW,kBAAkB;IACjC,oBAAoB;IACpB,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,mBAAmB;IACnB,UAAU,EAAE,cAAc,CAAC;IAC3B,qBAAqB;IACrB,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC;IAC3B,uBAAuB;IACvB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,gCAAgC;IAChC,YAAY,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,oCAAoC;IACpC,YAAY,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,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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F,KAAK,EAAE,cAAc,EAAE,EACvB,KAAK,EAAE,MAAM,GACZ,IAAI,CAAC;CACT;AAED,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,iBAAiB,CAAC,0BAA0B,CA8FrF,CAAC;AAIF,eAAO,MAAM,gBAAgB,0BAAwC,CAAC"}
|
|
@@ -5,15 +5,15 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
6
|
const types_1 = require("./types");
|
|
7
7
|
const utils_1 = require("./utils");
|
|
8
|
-
const hooks_1 = require("./hooks");
|
|
9
8
|
const WizardFooter_1 = require("./WizardFooter");
|
|
10
9
|
exports.WizardContext = react_1.default.createContext({});
|
|
11
10
|
const WizardContextProvider = ({ steps: initialSteps, footer: initialFooter, activeStepIndex, children, onNext, onBack, onClose, goToStepById, goToStepByName, goToStepByIndex }) => {
|
|
12
11
|
const [currentSteps, setCurrentSteps] = react_1.default.useState(initialSteps);
|
|
13
12
|
const [currentFooter, setCurrentFooter] = react_1.default.useState(typeof initialFooter !== 'function' ? initialFooter : undefined);
|
|
14
|
-
|
|
13
|
+
// Combined initial and current state steps
|
|
14
|
+
const steps = react_1.default.useMemo(() => currentSteps.map((currentStepProps, index) => (Object.assign(Object.assign({}, currentStepProps), initialSteps[index]))), [initialSteps, currentSteps]);
|
|
15
15
|
const activeStep = react_1.default.useMemo(() => (0, utils_1.getActiveStep)(steps, activeStepIndex), [activeStepIndex, steps]);
|
|
16
|
-
const close = react_1.default.useCallback(() => onClose(null), [onClose]);
|
|
16
|
+
const close = react_1.default.useCallback(() => onClose === null || onClose === void 0 ? void 0 : onClose(null), [onClose]);
|
|
17
17
|
const goToNextStep = react_1.default.useCallback(() => onNext(null, steps), [onNext, steps]);
|
|
18
18
|
const goToPrevStep = react_1.default.useCallback(() => onBack(null, steps), [onBack, steps]);
|
|
19
19
|
const footer = react_1.default.useMemo(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardContext.js","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardContext.tsx"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAE1B,mCAAkG;AAClG,mCAAwC;AACxC,
|
|
1
|
+
{"version":3,"file":"WizardContext.js","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardContext.tsx"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAE1B,mCAAkG;AAClG,mCAAwC;AACxC,iDAAiE;AA6BpD,QAAA,aAAa,GAAG,eAAK,CAAC,aAAa,CAAC,EAAwB,CAAC,CAAC;AAmBpE,MAAM,qBAAqB,GAAwD,CAAC,EACzF,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,aAAa,EACrB,eAAe,EACf,QAAQ,EACR,MAAM,EACN,MAAM,EACN,OAAO,EACP,YAAY,EACZ,cAAc,EACd,eAAe,EAChB,EAAE,EAAE;IACH,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,eAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;IACrE,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,eAAK,CAAC,QAAQ,CACtD,OAAO,aAAa,KAAK,UAAU,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,CAChE,CAAC;IAEF,2CAA2C;IAC3C,MAAM,KAAK,GAAG,eAAK,CAAC,OAAO,CACzB,GAAG,EAAE,CACH,YAAY,CAAC,GAAG,CAAC,CAAC,gBAAgB,EAAE,KAAK,EAAE,EAAE,CAAC,iCACzC,gBAAgB,GAChB,YAAY,CAAC,KAAK,CAAC,EACtB,CAAC,EACL,CAAC,YAAY,EAAE,YAAY,CAAC,CAC7B,CAAC;IACF,MAAM,UAAU,GAAG,eAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAA,qBAAa,EAAC,KAAK,EAAE,eAAe,CAAC,EAAE,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC,CAAC;IAExG,MAAM,KAAK,G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CAAC;IAC7B,mFAAmF;IACnF,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,eAAO,MAAM,UAAU;+CAA8C,eAAe;;CAkCnF,CAAC"}
|
|
@@ -9,12 +9,25 @@ const WizardStep = (_a) => {
|
|
|
9
9
|
var { children, steps: _subSteps } = _a, props = tslib_1.__rest(_a, ["children", "steps"]);
|
|
10
10
|
const { activeStep, setStep } = (0, WizardContext_1.useWizardContext)();
|
|
11
11
|
const { id, name, body, isDisabled, isHidden, navItem, footer, status } = props;
|
|
12
|
+
const isParentStep = (0, types_1.isWizardParentStep)(activeStep);
|
|
12
13
|
// Update step in context when props change or when the step is active has yet to be marked as visited.
|
|
13
14
|
react_1.default.useEffect(() => {
|
|
14
|
-
const shouldUpdateIsVisited = !(0, types_1.isWizardParentStep)(activeStep) && id === (activeStep === null || activeStep === void 0 ? void 0 : activeStep.id) && !(activeStep === null || activeStep === void 0 ? void 0 : activeStep.isVisited);
|
|
15
15
|
setStep(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ id,
|
|
16
|
-
name }, (body && { body })), (isDisabled && { isDisabled })), (isHidden && { isHidden })), (navItem && { navItem })), (footer && { footer })), (status && { status })), (
|
|
17
|
-
}, [
|
|
16
|
+
name }, (body && { body })), (isDisabled && { isDisabled })), (isHidden && { isHidden })), (navItem && { navItem })), (footer && { footer })), (status && { status })), (!isParentStep && id === (activeStep === null || activeStep === void 0 ? void 0 : activeStep.id) && !(activeStep === null || activeStep === void 0 ? void 0 : activeStep.isVisited) && { isVisited: true })));
|
|
17
|
+
}, [
|
|
18
|
+
body,
|
|
19
|
+
footer,
|
|
20
|
+
id,
|
|
21
|
+
isDisabled,
|
|
22
|
+
isHidden,
|
|
23
|
+
name,
|
|
24
|
+
navItem,
|
|
25
|
+
status,
|
|
26
|
+
isParentStep,
|
|
27
|
+
setStep,
|
|
28
|
+
activeStep === null || activeStep === void 0 ? void 0 : activeStep.id,
|
|
29
|
+
activeStep === null || activeStep === void 0 ? void 0 : activeStep.isVisited
|
|
30
|
+
]);
|
|
18
31
|
return react_1.default.createElement(react_1.default.Fragment, null, children);
|
|
19
32
|
};
|
|
20
33
|
exports.WizardStep = WizardStep;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardStep.js","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardStep.tsx"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAE1B,mCAAgE;AAEhE,mDAAmD;AAgC5C,MAAM,UAAU,GAAG,CAAC,EAAyD,EAAE,EAAE;QAA7D,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,OAA6B,EAAxB,KAAK,sBAAtC,qBAAwC,CAAF;IAC/D,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,IAAA,gCAAgB,GAAE,CAAC;IACnD,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"WizardStep.js","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardStep.tsx"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAE1B,mCAAgE;AAEhE,mDAAmD;AAgC5C,MAAM,UAAU,GAAG,CAAC,EAAyD,EAAE,EAAE;QAA7D,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,OAA6B,EAAxB,KAAK,sBAAtC,qBAAwC,CAAF;IAC/D,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,IAAA,gCAAgB,GAAE,CAAC;IACnD,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAChF,MAAM,YAAY,GAAG,IAAA,0BAAkB,EAAC,UAAU,CAAC,CAAC;IAEpD,uGAAuG;IACvG,eAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,OAAO,qGACL,EAAE;YACF,IAAI,IACD,CAAC,IAAI,IAAI,EAAE,IAAI,EAAE,CAAC,GAClB,CAAC,UAAU,IAAI,EAAE,UAAU,EAAE,CAAC,GAC9B,CAAC,QAAQ,IAAI,EAAE,QAAQ,EAAE,CAAC,GAC1B,CAAC,OAAO,IAAI,EAAE,OAAO,EAAE,CAAC,GACxB,CAAC,MAAM,IAAI,EAAE,MAAM,EAAE,CAAC,GACtB,CAAC,MAAM,IAAI,EAAE,MAAM,EAAE,CAAC,GACtB,CAAC,CAAC,YAAY,IAAI,EAAE,MAAK,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,EAAE,CAAA,IAAI,CAAC,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,SAAS,CAAA,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAC5F,CAAC;IACL,CAAC,EAAE;QACD,IAAI;QACJ,MAAM;QACN,EAAE;QACF,UAAU;QACV,QAAQ;QACR,IAAI;QACJ,OAAO;QACP,MAAM;QACN,YAAY;QACZ,OAAO;QACP,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,EAAE;QACd,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,SAAS;KACtB,CAAC,CAAC;IAEH,OAAO,8DAAG,QAAQ,CAAI,CAAC;AACzB,CAAC,CAAC;AAlCW,QAAA,UAAU,cAkCrB;AAEF,kBAAU,CAAC,WAAW,GAAG,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/next/components/Wizard/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/next/components/Wizard/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.useWizardFooter = void 0;
|
|
4
4
|
var useWizardFooter_1 = require("./useWizardFooter");
|
|
5
5
|
Object.defineProperty(exports, "useWizardFooter", { enumerable: true, get: function () { return useWizardFooter_1.useWizardFooter; } });
|
|
6
|
-
var useGetMergedSteps_1 = require("./useGetMergedSteps");
|
|
7
|
-
Object.defineProperty(exports, "useGetMergedSteps", { enumerable: true, get: function () { return useGetMergedSteps_1.useGetMergedSteps; } });
|
|
8
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/next/components/Wizard/hooks/index.ts"],"names":[],"mappings":";;;AAAA,qDAAoD;AAA3C,kHAAA,eAAe,OAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/next/components/Wizard/hooks/index.ts"],"names":[],"mappings":";;;AAAA,qDAAoD;AAA3C,kHAAA,eAAe,OAAA"}
|
|
@@ -35,7 +35,7 @@ export interface WizardContextProviderProps {
|
|
|
35
35
|
children: React.ReactElement;
|
|
36
36
|
onNext(event: React.MouseEvent<HTMLButtonElement>, steps: WizardStepType[]): void;
|
|
37
37
|
onBack(event: React.MouseEvent<HTMLButtonElement>, steps: WizardStepType[]): void;
|
|
38
|
-
onClose(event: React.MouseEvent<HTMLButtonElement>): void;
|
|
38
|
+
onClose?(event: React.MouseEvent<HTMLButtonElement>): void;
|
|
39
39
|
goToStepById(steps: WizardStepType[], id: number | string): void;
|
|
40
40
|
goToStepByName(steps: WizardStepType[], name: string): void;
|
|
41
41
|
goToStepByIndex(event: React.MouseEvent<HTMLButtonElement> | React.MouseEvent<HTMLAnchorElement>, steps: WizardStepType[], index: number): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardContext.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAyC,cAAc,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"WizardContext.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAyC,cAAc,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAElG,OAAO,EAAgB,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEjE,MAAM,WAAW,kBAAkB;IACjC,oBAAoB;IACpB,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,mBAAmB;IACnB,UAAU,EAAE,cAAc,CAAC;IAC3B,qBAAqB;IACrB,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC;IAC3B,uBAAuB;IACvB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,gCAAgC;IAChC,YAAY,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,oCAAoC;IACpC,YAAY,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,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,GAAG,OAAO,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAC7E,qBAAqB;IACrB,O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C"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { isCustomWizardFooter, isWizardSubStep } from './types';
|
|
3
3
|
import { getActiveStep } from './utils';
|
|
4
|
-
import { useGetMergedSteps } from './hooks';
|
|
5
4
|
import { WizardFooter } from './WizardFooter';
|
|
6
5
|
export const WizardContext = React.createContext({});
|
|
7
6
|
export const WizardContextProvider = ({ steps: initialSteps, footer: initialFooter, activeStepIndex, children, onNext, onBack, onClose, goToStepById, goToStepByName, goToStepByIndex }) => {
|
|
8
7
|
const [currentSteps, setCurrentSteps] = React.useState(initialSteps);
|
|
9
8
|
const [currentFooter, setCurrentFooter] = React.useState(typeof initialFooter !== 'function' ? initialFooter : undefined);
|
|
10
|
-
|
|
9
|
+
// Combined initial and current state steps
|
|
10
|
+
const steps = React.useMemo(() => currentSteps.map((currentStepProps, index) => (Object.assign(Object.assign({}, currentStepProps), initialSteps[index]))), [initialSteps, currentSteps]);
|
|
11
11
|
const activeStep = React.useMemo(() => getActiveStep(steps, activeStepIndex), [activeStepIndex, steps]);
|
|
12
|
-
const close = React.useCallback(() => onClose(null), [onClose]);
|
|
12
|
+
const close = React.useCallback(() => onClose === null || onClose === void 0 ? void 0 : onClose(null), [onClose]);
|
|
13
13
|
const goToNextStep = React.useCallback(() => onNext(null, steps), [onNext, steps]);
|
|
14
14
|
const goToPrevStep = React.useCallback(() => onBack(null, steps), [onBack, steps]);
|
|
15
15
|
const footer = React.useMemo(() => {
|
|
@@ -1 +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,oBAAoB,EAAE,eAAe,EAAoC,MAAM,SAAS,CAAC;AAClG,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"W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ED,eAAO,MAAM,UAAU;+CAA8C,eAAe;;CAkCnF,CAAC"}
|
|
@@ -6,12 +6,25 @@ export const WizardStep = (_a) => {
|
|
|
6
6
|
var { children, steps: _subSteps } = _a, props = __rest(_a, ["children", "steps"]);
|
|
7
7
|
const { activeStep, setStep } = useWizardContext();
|
|
8
8
|
const { id, name, body, isDisabled, isHidden, navItem, footer, status } = props;
|
|
9
|
+
const isParentStep = isWizardParentStep(activeStep);
|
|
9
10
|
// Update step in context when props change or when the step is active has yet to be marked as visited.
|
|
10
11
|
React.useEffect(() => {
|
|
11
|
-
const shouldUpdateIsVisited = !isWizardParentStep(activeStep) && id === (activeStep === null || activeStep === void 0 ? void 0 : activeStep.id) && !(activeStep === null || activeStep === void 0 ? void 0 : activeStep.isVisited);
|
|
12
12
|
setStep(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ id,
|
|
13
|
-
name }, (body && { body })), (isDisabled && { isDisabled })), (isHidden && { isHidden })), (navItem && { navItem })), (footer && { footer })), (status && { status })), (
|
|
14
|
-
}, [
|
|
13
|
+
name }, (body && { body })), (isDisabled && { isDisabled })), (isHidden && { isHidden })), (navItem && { navItem })), (footer && { footer })), (status && { status })), (!isParentStep && id === (activeStep === null || activeStep === void 0 ? void 0 : activeStep.id) && !(activeStep === null || activeStep === void 0 ? void 0 : activeStep.isVisited) && { isVisited: true })));
|
|
14
|
+
}, [
|
|
15
|
+
body,
|
|
16
|
+
footer,
|
|
17
|
+
id,
|
|
18
|
+
isDisabled,
|
|
19
|
+
isHidden,
|
|
20
|
+
name,
|
|
21
|
+
navItem,
|
|
22
|
+
status,
|
|
23
|
+
isParentStep,
|
|
24
|
+
setStep,
|
|
25
|
+
activeStep === null || activeStep === void 0 ? void 0 : activeStep.id,
|
|
26
|
+
activeStep === null || activeStep === void 0 ? void 0 : activeStep.isVisited
|
|
27
|
+
]);
|
|
15
28
|
return React.createElement(React.Fragment, null, children);
|
|
16
29
|
};
|
|
17
30
|
WizardStep.displayName = 'WizardStep';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardStep.js","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardStep.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAqB,MAAM,SAAS,CAAC;AAEhE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAgCnD,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EAAyD,EAAE,EAAE;QAA7D,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,OAA6B,EAAxB,KAAK,cAAtC,qBAAwC,CAAF;IAC/D,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,gBAAgB,EAAE,CAAC;IACnD,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"WizardStep.js","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardStep.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAqB,MAAM,SAAS,CAAC;AAEhE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAgCnD,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EAAyD,EAAE,EAAE;QAA7D,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,OAA6B,EAAxB,KAAK,cAAtC,qBAAwC,CAAF;IAC/D,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,gBAAgB,EAAE,CAAC;IACnD,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAChF,MAAM,YAAY,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC;IAEpD,uGAAuG;IACvG,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,OAAO,qGACL,EAAE;YACF,IAAI,IACD,CAAC,IAAI,IAAI,EAAE,IAAI,EAAE,CAAC,GAClB,CAAC,UAAU,IAAI,EAAE,UAAU,EAAE,CAAC,GAC9B,CAAC,QAAQ,IAAI,EAAE,QAAQ,EAAE,CAAC,GAC1B,CAAC,OAAO,IAAI,EAAE,OAAO,EAAE,CAAC,GACxB,CAAC,MAAM,IAAI,EAAE,MAAM,EAAE,CAAC,GACtB,CAAC,MAAM,IAAI,EAAE,MAAM,EAAE,CAAC,GACtB,CAAC,CAAC,YAAY,IAAI,EAAE,MAAK,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,EAAE,CAAA,IAAI,CAAC,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,SAAS,CAAA,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAC5F,CAAC;IACL,CAAC,EAAE;QACD,IAAI;QACJ,MAAM;QACN,EAAE;QACF,UAAU;QACV,QAAQ;QACR,IAAI;QACJ,OAAO;QACP,MAAM;QACN,YAAY;QACZ,OAAO;QACP,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,EAAE;QACd,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,SAAS;KACtB,CAAC,CAAC;IAEH,OAAO,0CAAG,QAAQ,CAAI,CAAC;AACzB,CAAC,CAAC;AAEF,UAAU,CAAC,WAAW,GAAG,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/next/components/Wizard/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/next/components/Wizard/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/next/components/Wizard/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/next/components/Wizard/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "4.276.
|
|
3
|
+
"version": "4.276.6",
|
|
4
4
|
"description": "This library provides a set of common React components for use with the PatternFly reference implementation.",
|
|
5
5
|
"main": "dist/js/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"react": "^16.8 || ^17 || ^18",
|
|
72
72
|
"react-dom": "^16.8 || ^17 || ^18"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "e2d787cd453afc07405d7f5f10eb6b64a215b064"
|
|
75
75
|
}
|
|
@@ -2,7 +2,6 @@ import React from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { isCustomWizardFooter, isWizardSubStep, WizardStepType, WizardFooterType } from './types';
|
|
4
4
|
import { getActiveStep } from './utils';
|
|
5
|
-
import { useGetMergedSteps } from './hooks';
|
|
6
5
|
import { WizardFooter, WizardFooterProps } from './WizardFooter';
|
|
7
6
|
|
|
8
7
|
export interface WizardContextProps {
|
|
@@ -41,7 +40,7 @@ export interface WizardContextProviderProps {
|
|
|
41
40
|
children: React.ReactElement;
|
|
42
41
|
onNext(event: React.MouseEvent<HTMLButtonElement>, steps: WizardStepType[]): void;
|
|
43
42
|
onBack(event: React.MouseEvent<HTMLButtonElement>, steps: WizardStepType[]): void;
|
|
44
|
-
onClose(event: React.MouseEvent<HTMLButtonElement>): void;
|
|
43
|
+
onClose?(event: React.MouseEvent<HTMLButtonElement>): void;
|
|
45
44
|
goToStepById(steps: WizardStepType[], id: number | string): void;
|
|
46
45
|
goToStepByName(steps: WizardStepType[], name: string): void;
|
|
47
46
|
goToStepByIndex(
|
|
@@ -67,10 +66,19 @@ export const WizardContextProvider: React.FunctionComponent<WizardContextProvide
|
|
|
67
66
|
const [currentFooter, setCurrentFooter] = React.useState(
|
|
68
67
|
typeof initialFooter !== 'function' ? initialFooter : undefined
|
|
69
68
|
);
|
|
70
|
-
|
|
69
|
+
|
|
70
|
+
// Combined initial and current state steps
|
|
71
|
+
const steps = React.useMemo(
|
|
72
|
+
() =>
|
|
73
|
+
currentSteps.map((currentStepProps, index) => ({
|
|
74
|
+
...currentStepProps,
|
|
75
|
+
...initialSteps[index]
|
|
76
|
+
})),
|
|
77
|
+
[initialSteps, currentSteps]
|
|
78
|
+
);
|
|
71
79
|
const activeStep = React.useMemo(() => getActiveStep(steps, activeStepIndex), [activeStepIndex, steps]);
|
|
72
80
|
|
|
73
|
-
const close = React.useCallback(() => onClose(null), [onClose]);
|
|
81
|
+
const close = React.useCallback(() => onClose?.(null), [onClose]);
|
|
74
82
|
const goToNextStep = React.useCallback(() => onNext(null, steps), [onNext, steps]);
|
|
75
83
|
const goToPrevStep = React.useCallback(() => onBack(null, steps), [onBack, steps]);
|
|
76
84
|
|
|
@@ -37,11 +37,10 @@ export interface WizardStepProps {
|
|
|
37
37
|
export const WizardStep = ({ children, steps: _subSteps, ...props }: WizardStepProps) => {
|
|
38
38
|
const { activeStep, setStep } = useWizardContext();
|
|
39
39
|
const { id, name, body, isDisabled, isHidden, navItem, footer, status } = props;
|
|
40
|
+
const isParentStep = isWizardParentStep(activeStep);
|
|
40
41
|
|
|
41
42
|
// Update step in context when props change or when the step is active has yet to be marked as visited.
|
|
42
43
|
React.useEffect(() => {
|
|
43
|
-
const shouldUpdateIsVisited = !isWizardParentStep(activeStep) && id === activeStep?.id && !activeStep?.isVisited;
|
|
44
|
-
|
|
45
44
|
setStep({
|
|
46
45
|
id,
|
|
47
46
|
name,
|
|
@@ -51,9 +50,22 @@ export const WizardStep = ({ children, steps: _subSteps, ...props }: WizardStepP
|
|
|
51
50
|
...(navItem && { navItem }),
|
|
52
51
|
...(footer && { footer }),
|
|
53
52
|
...(status && { status }),
|
|
54
|
-
...(
|
|
53
|
+
...(!isParentStep && id === activeStep?.id && !activeStep?.isVisited && { isVisited: true })
|
|
55
54
|
});
|
|
56
|
-
}, [
|
|
55
|
+
}, [
|
|
56
|
+
body,
|
|
57
|
+
footer,
|
|
58
|
+
id,
|
|
59
|
+
isDisabled,
|
|
60
|
+
isHidden,
|
|
61
|
+
name,
|
|
62
|
+
navItem,
|
|
63
|
+
status,
|
|
64
|
+
isParentStep,
|
|
65
|
+
setStep,
|
|
66
|
+
activeStep?.id,
|
|
67
|
+
activeStep?.isVisited
|
|
68
|
+
]);
|
|
57
69
|
|
|
58
70
|
return <>{children}</>;
|
|
59
71
|
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { WizardStepType } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Get stable ref of combined initial (prop provided) and current (context stored) steps.
|
|
4
|
-
* @param initialSteps
|
|
5
|
-
* @param currentSteps
|
|
6
|
-
* @returns WizardStepType[]
|
|
7
|
-
*/
|
|
8
|
-
export declare const useGetMergedSteps: (initialSteps: WizardStepType[], currentSteps: WizardStepType[]) => WizardStepType[];
|
|
9
|
-
//# sourceMappingURL=useGetMergedSteps.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useGetMergedSteps.d.ts","sourceRoot":"","sources":["../../../../../../src/next/components/Wizard/hooks/useGetMergedSteps.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,iBAAkB,cAAc,EAAE,gBAAgB,cAAc,EAAE,KAAG,cAAc,EAkChH,CAAC"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import isEqual from 'fast-deep-equal';
|
|
3
|
-
/**
|
|
4
|
-
* Get stable ref of combined initial (prop provided) and current (context stored) steps.
|
|
5
|
-
* @param initialSteps
|
|
6
|
-
* @param currentSteps
|
|
7
|
-
* @returns WizardStepType[]
|
|
8
|
-
*/
|
|
9
|
-
export const useGetMergedSteps = (initialSteps, currentSteps) => {
|
|
10
|
-
const initialStepsRef = React.useRef(initialSteps);
|
|
11
|
-
const currentStepsRef = React.useRef(currentSteps);
|
|
12
|
-
// Check each value within the array of initialSteps (props) and currentSteps (context).
|
|
13
|
-
// If any value changes for either of these, update the reference.
|
|
14
|
-
if (!isEqual(initialStepsRef.current, initialSteps)) {
|
|
15
|
-
initialStepsRef.current = initialSteps;
|
|
16
|
-
}
|
|
17
|
-
if (!isEqual(currentStepsRef.current, currentSteps)) {
|
|
18
|
-
currentStepsRef.current = currentSteps;
|
|
19
|
-
}
|
|
20
|
-
// Combine both initial and current steps, where prop provided values
|
|
21
|
-
// take precedence over what's stored in context.
|
|
22
|
-
const mergedSteps = React.useMemo(() => initialSteps.reduce((acc, initialStepProps, index) => {
|
|
23
|
-
const currentStepProps = currentSteps[index];
|
|
24
|
-
if (initialStepProps.id === currentStepProps.id) {
|
|
25
|
-
acc.push(Object.assign(Object.assign({}, currentStepProps), initialStepProps));
|
|
26
|
-
}
|
|
27
|
-
return acc;
|
|
28
|
-
}, []),
|
|
29
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
30
|
-
[initialStepsRef.current, currentStepsRef.current]);
|
|
31
|
-
return mergedSteps;
|
|
32
|
-
};
|
|
33
|
-
//# sourceMappingURL=useGetMergedSteps.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useGetMergedSteps.js","sourceRoot":"","sources":["../../../../../../src/next/components/Wizard/hooks/useGetMergedSteps.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,OAAO,MAAM,iBAAiB,CAAC;AAGtC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,YAA8B,EAAE,YAA8B,EAAoB,EAAE;IACpH,MAAM,eAAe,GAAG,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IACnD,MAAM,eAAe,GAAG,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IAEnD,wFAAwF;IACxF,kEAAkE;IAClE,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,OAAO,EAAE,YAAY,CAAC,EAAE;QACnD,eAAe,CAAC,OAAO,GAAG,YAAY,CAAC;KACxC;IACD,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,OAAO,EAAE,YAAY,CAAC,EAAE;QACnD,eAAe,CAAC,OAAO,GAAG,YAAY,CAAC;KACxC;IAED,qEAAqE;IACrE,iDAAiD;IACjD,MAAM,WAAW,GAAG,KAAK,CAAC,OAAO,CAC/B,GAAG,EAAE,CACH,YAAY,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,gBAAgB,EAAE,KAAK,EAAE,EAAE;QACnD,MAAM,gBAAgB,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;QAE7C,IAAI,gBAAgB,CAAC,EAAE,KAAK,gBAAgB,CAAC,EAAE,EAAE;YAC/C,GAAG,CAAC,IAAI,iCACH,gBAAgB,GAChB,gBAAgB,EACnB,CAAC;SACJ;QAED,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAE,CAAC;IACR,uDAAuD;IACvD,CAAC,eAAe,CAAC,OAAO,EAAE,eAAe,CAAC,OAAO,CAAC,CACnD,CAAC;IAEF,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { WizardStepType } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Get stable ref of combined initial (prop provided) and current (context stored) steps.
|
|
4
|
-
* @param initialSteps
|
|
5
|
-
* @param currentSteps
|
|
6
|
-
* @returns WizardStepType[]
|
|
7
|
-
*/
|
|
8
|
-
export declare const useGetMergedSteps: (initialSteps: WizardStepType[], currentSteps: WizardStepType[]) => WizardStepType[];
|
|
9
|
-
//# sourceMappingURL=useGetMergedSteps.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useGetMergedSteps.d.ts","sourceRoot":"","sources":["../../../../../../src/next/components/Wizard/hooks/useGetMergedSteps.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,iBAAkB,cAAc,EAAE,gBAAgB,cAAc,EAAE,KAAG,cAAc,EAkChH,CAAC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useGetMergedSteps = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
-
const fast_deep_equal_1 = tslib_1.__importDefault(require("fast-deep-equal"));
|
|
7
|
-
/**
|
|
8
|
-
* Get stable ref of combined initial (prop provided) and current (context stored) steps.
|
|
9
|
-
* @param initialSteps
|
|
10
|
-
* @param currentSteps
|
|
11
|
-
* @returns WizardStepType[]
|
|
12
|
-
*/
|
|
13
|
-
const useGetMergedSteps = (initialSteps, currentSteps) => {
|
|
14
|
-
const initialStepsRef = react_1.default.useRef(initialSteps);
|
|
15
|
-
const currentStepsRef = react_1.default.useRef(currentSteps);
|
|
16
|
-
// Check each value within the array of initialSteps (props) and currentSteps (context).
|
|
17
|
-
// If any value changes for either of these, update the reference.
|
|
18
|
-
if (!(0, fast_deep_equal_1.default)(initialStepsRef.current, initialSteps)) {
|
|
19
|
-
initialStepsRef.current = initialSteps;
|
|
20
|
-
}
|
|
21
|
-
if (!(0, fast_deep_equal_1.default)(currentStepsRef.current, currentSteps)) {
|
|
22
|
-
currentStepsRef.current = currentSteps;
|
|
23
|
-
}
|
|
24
|
-
// Combine both initial and current steps, where prop provided values
|
|
25
|
-
// take precedence over what's stored in context.
|
|
26
|
-
const mergedSteps = react_1.default.useMemo(() => initialSteps.reduce((acc, initialStepProps, index) => {
|
|
27
|
-
const currentStepProps = currentSteps[index];
|
|
28
|
-
if (initialStepProps.id === currentStepProps.id) {
|
|
29
|
-
acc.push(Object.assign(Object.assign({}, currentStepProps), initialStepProps));
|
|
30
|
-
}
|
|
31
|
-
return acc;
|
|
32
|
-
}, []),
|
|
33
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
34
|
-
[initialStepsRef.current, currentStepsRef.current]);
|
|
35
|
-
return mergedSteps;
|
|
36
|
-
};
|
|
37
|
-
exports.useGetMergedSteps = useGetMergedSteps;
|
|
38
|
-
//# sourceMappingURL=useGetMergedSteps.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useGetMergedSteps.js","sourceRoot":"","sources":["../../../../../../src/next/components/Wizard/hooks/useGetMergedSteps.tsx"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAC1B,8EAAsC;AAGtC;;;;;GAKG;AACI,MAAM,iBAAiB,GAAG,CAAC,YAA8B,EAAE,YAA8B,EAAoB,EAAE;IACpH,MAAM,eAAe,GAAG,eAAK,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IACnD,MAAM,eAAe,GAAG,eAAK,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IAEnD,wFAAwF;IACxF,kEAAkE;IAClE,IAAI,CAAC,IAAA,yBAAO,EAAC,eAAe,CAAC,OAAO,EAAE,YAAY,CAAC,EAAE;QACnD,eAAe,CAAC,OAAO,GAAG,YAAY,CAAC;KACxC;IACD,IAAI,CAAC,IAAA,yBAAO,EAAC,eAAe,CAAC,OAAO,EAAE,YAAY,CAAC,EAAE;QACnD,eAAe,CAAC,OAAO,GAAG,YAAY,CAAC;KACxC;IAED,qEAAqE;IACrE,iDAAiD;IACjD,MAAM,WAAW,GAAG,eAAK,CAAC,OAAO,CAC/B,GAAG,EAAE,CACH,YAAY,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,gBAAgB,EAAE,KAAK,EAAE,EAAE;QACnD,MAAM,gBAAgB,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;QAE7C,IAAI,gBAAgB,CAAC,EAAE,KAAK,gBAAgB,CAAC,EAAE,EAAE;YAC/C,GAAG,CAAC,IAAI,iCACH,gBAAgB,GAChB,gBAAgB,EACnB,CAAC;SACJ;QAED,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAE,CAAC;IACR,uDAAuD;IACvD,CAAC,eAAe,CAAC,OAAO,EAAE,eAAe,CAAC,OAAO,CAAC,CACnD,CAAC;IAEF,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC;AAlCW,QAAA,iBAAiB,qBAkC5B"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { WizardStepType } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Get stable ref of combined initial (prop provided) and current (context stored) steps.
|
|
4
|
-
* @param initialSteps
|
|
5
|
-
* @param currentSteps
|
|
6
|
-
* @returns WizardStepType[]
|
|
7
|
-
*/
|
|
8
|
-
export declare const useGetMergedSteps: (initialSteps: WizardStepType[], currentSteps: WizardStepType[]) => WizardStepType[];
|
|
9
|
-
//# sourceMappingURL=useGetMergedSteps.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useGetMergedSteps.d.ts","sourceRoot":"","sources":["../../../../../../src/next/components/Wizard/hooks/useGetMergedSteps.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,iBAAkB,cAAc,EAAE,gBAAgB,cAAc,EAAE,KAAG,cAAc,EAkChH,CAAC"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import isEqual from 'fast-deep-equal';
|
|
3
|
-
/**
|
|
4
|
-
* Get stable ref of combined initial (prop provided) and current (context stored) steps.
|
|
5
|
-
* @param initialSteps
|
|
6
|
-
* @param currentSteps
|
|
7
|
-
* @returns WizardStepType[]
|
|
8
|
-
*/
|
|
9
|
-
export const useGetMergedSteps = (initialSteps, currentSteps) => {
|
|
10
|
-
const initialStepsRef = React.useRef(initialSteps);
|
|
11
|
-
const currentStepsRef = React.useRef(currentSteps);
|
|
12
|
-
// Check each value within the array of initialSteps (props) and currentSteps (context).
|
|
13
|
-
// If any value changes for either of these, update the reference.
|
|
14
|
-
if (!isEqual(initialStepsRef.current, initialSteps)) {
|
|
15
|
-
initialStepsRef.current = initialSteps;
|
|
16
|
-
}
|
|
17
|
-
if (!isEqual(currentStepsRef.current, currentSteps)) {
|
|
18
|
-
currentStepsRef.current = currentSteps;
|
|
19
|
-
}
|
|
20
|
-
// Combine both initial and current steps, where prop provided values
|
|
21
|
-
// take precedence over what's stored in context.
|
|
22
|
-
const mergedSteps = React.useMemo(() => initialSteps.reduce((acc, initialStepProps, index) => {
|
|
23
|
-
const currentStepProps = currentSteps[index];
|
|
24
|
-
if (initialStepProps.id === currentStepProps.id) {
|
|
25
|
-
acc.push(Object.assign(Object.assign({}, currentStepProps), initialStepProps));
|
|
26
|
-
}
|
|
27
|
-
return acc;
|
|
28
|
-
}, []),
|
|
29
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
30
|
-
[initialStepsRef.current, currentStepsRef.current]);
|
|
31
|
-
return mergedSteps;
|
|
32
|
-
};
|
|
33
|
-
//# sourceMappingURL=useGetMergedSteps.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useGetMergedSteps.js","sourceRoot":"","sources":["../../../../../../src/next/components/Wizard/hooks/useGetMergedSteps.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,OAAO,MAAM,iBAAiB,CAAC;AAGtC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,YAA8B,EAAE,YAA8B,EAAoB,EAAE;IACpH,MAAM,eAAe,GAAG,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IACnD,MAAM,eAAe,GAAG,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IAEnD,wFAAwF;IACxF,kEAAkE;IAClE,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,OAAO,EAAE,YAAY,CAAC,EAAE;QACnD,eAAe,CAAC,OAAO,GAAG,YAAY,CAAC;KACxC;IACD,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,OAAO,EAAE,YAAY,CAAC,EAAE;QACnD,eAAe,CAAC,OAAO,GAAG,YAAY,CAAC;KACxC;IAED,qEAAqE;IACrE,iDAAiD;IACjD,MAAM,WAAW,GAAG,KAAK,CAAC,OAAO,CAC/B,GAAG,EAAE,CACH,YAAY,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,gBAAgB,EAAE,KAAK,EAAE,EAAE;QACnD,MAAM,gBAAgB,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;QAE7C,IAAI,gBAAgB,CAAC,EAAE,KAAK,gBAAgB,CAAC,EAAE,EAAE;YAC/C,GAAG,CAAC,IAAI,iCACH,gBAAgB,GAChB,gBAAgB,EACnB,CAAC;SACJ;QAED,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAE,CAAC;IACR,uDAAuD;IACvD,CAAC,eAAe,CAAC,OAAO,EAAE,eAAe,CAAC,OAAO,CAAC,CACnD,CAAC;IAEF,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import isEqual from 'fast-deep-equal';
|
|
3
|
-
import { WizardStepType } from '../types';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Get stable ref of combined initial (prop provided) and current (context stored) steps.
|
|
7
|
-
* @param initialSteps
|
|
8
|
-
* @param currentSteps
|
|
9
|
-
* @returns WizardStepType[]
|
|
10
|
-
*/
|
|
11
|
-
export const useGetMergedSteps = (initialSteps: WizardStepType[], currentSteps: WizardStepType[]): WizardStepType[] => {
|
|
12
|
-
const initialStepsRef = React.useRef(initialSteps);
|
|
13
|
-
const currentStepsRef = React.useRef(currentSteps);
|
|
14
|
-
|
|
15
|
-
// Check each value within the array of initialSteps (props) and currentSteps (context).
|
|
16
|
-
// If any value changes for either of these, update the reference.
|
|
17
|
-
if (!isEqual(initialStepsRef.current, initialSteps)) {
|
|
18
|
-
initialStepsRef.current = initialSteps;
|
|
19
|
-
}
|
|
20
|
-
if (!isEqual(currentStepsRef.current, currentSteps)) {
|
|
21
|
-
currentStepsRef.current = currentSteps;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// Combine both initial and current steps, where prop provided values
|
|
25
|
-
// take precedence over what's stored in context.
|
|
26
|
-
const mergedSteps = React.useMemo(
|
|
27
|
-
() =>
|
|
28
|
-
initialSteps.reduce((acc, initialStepProps, index) => {
|
|
29
|
-
const currentStepProps = currentSteps[index];
|
|
30
|
-
|
|
31
|
-
if (initialStepProps.id === currentStepProps.id) {
|
|
32
|
-
acc.push({
|
|
33
|
-
...currentStepProps,
|
|
34
|
-
...initialStepProps
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return acc;
|
|
39
|
-
}, []),
|
|
40
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
41
|
-
[initialStepsRef.current, currentStepsRef.current]
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
return mergedSteps;
|
|
45
|
-
};
|