@npm_leadtech/legal-lib-components 7.93.0 → 7.94.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.
@@ -36,6 +36,13 @@ export const Wizard = ({ children, isHashEnabled = false, classNames }) => {
36
36
  };
37
37
  const footer = getSpecificComponentByDisplayName(FOOTER);
38
38
  const header = getSpecificComponentByDisplayName(HEADER);
39
- const memoizedNavigationControls = useMemo(() => ({ goToStepByIndex, nextStep, previousStep, setStepByHash, currentStep: step }), [goToStepByIndex, nextStep, previousStep, setStepByHash, step]);
39
+ const memoizedNavigationControls = useMemo(() => ({
40
+ goToStepByIndex,
41
+ nextStep,
42
+ previousStep,
43
+ setStepByHash,
44
+ currentStep: step,
45
+ totalSteps: filteredChilds.length
46
+ }), [goToStepByIndex, nextStep, previousStep, setStepByHash, step, filteredChilds.length]);
40
47
  return (_jsxs(WizardContext.Provider, { value: memoizedNavigationControls, children: [header, _jsxs("div", { className: classNames, children: [currentStep, footer] })] }));
41
48
  };
@@ -48,8 +48,15 @@ export const Wizard: React.FC<WizardProps> = ({ children, isHashEnabled = false,
48
48
  const header = getSpecificComponentByDisplayName(HEADER)
49
49
 
50
50
  const memoizedNavigationControls = useMemo(
51
- () => ({ goToStepByIndex, nextStep, previousStep, setStepByHash, currentStep: step }),
52
- [goToStepByIndex, nextStep, previousStep, setStepByHash, step]
51
+ () => ({
52
+ goToStepByIndex,
53
+ nextStep,
54
+ previousStep,
55
+ setStepByHash,
56
+ currentStep: step,
57
+ totalSteps: filteredChilds.length
58
+ }),
59
+ [goToStepByIndex, nextStep, previousStep, setStepByHash, step, filteredChilds.length]
53
60
  )
54
61
 
55
62
  return (
@@ -4,6 +4,7 @@ interface WizardContextInterFace {
4
4
  goToStepByIndex: (step: number) => void;
5
5
  setStepByHash: (hash: string) => void;
6
6
  currentStep: number;
7
+ totalSteps: number;
7
8
  }
8
9
  export declare const WizardContext: import("react").Context<WizardContextInterFace>;
9
10
  export {};
@@ -4,5 +4,6 @@ export const WizardContext = createContext({
4
4
  nextStep: () => { },
5
5
  goToStepByIndex: () => { },
6
6
  setStepByHash: () => { },
7
- currentStep: 0
7
+ currentStep: 0,
8
+ totalSteps: 0
8
9
  });
@@ -6,6 +6,7 @@ interface WizardContextInterFace {
6
6
  goToStepByIndex: (step: number) => void
7
7
  setStepByHash: (hash: string) => void
8
8
  currentStep: number
9
+ totalSteps: number
9
10
  }
10
11
 
11
12
  export const WizardContext = createContext<WizardContextInterFace>({
@@ -13,5 +14,6 @@ export const WizardContext = createContext<WizardContextInterFace>({
13
14
  nextStep: () => {},
14
15
  goToStepByIndex: () => {},
15
16
  setStepByHash: () => {},
16
- currentStep: 0
17
+ currentStep: 0,
18
+ totalSteps: 0
17
19
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@npm_leadtech/legal-lib-components",
3
- "version": "7.93.0",
3
+ "version": "7.94.0",
4
4
  "license": "ISC",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",