@carbon/ibm-products 1.11.1 → 1.11.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -61,23 +61,23 @@ export var CreateFullPageStep = /*#__PURE__*/forwardRef(function (_ref, ref) {
61
61
  shouldIncludeStep: shouldIncludeStep,
62
62
  secondaryLabel: secondaryLabel,
63
63
  title: title
64
- }); // This useEffect reports back the onNext and onMount values so that they can be used
64
+ }); // This useEffect reports back the onMount value so that they can be used
65
65
  // in the appropriate custom hooks.
66
66
 
67
67
  useEffect(function () {
68
68
  if (stepNumber === (stepsContext === null || stepsContext === void 0 ? void 0 : stepsContext.currentStep) && (previousState === null || previousState === void 0 ? void 0 : previousState.currentStep) !== (stepsContext === null || stepsContext === void 0 ? void 0 : stepsContext.currentStep)) {
69
- stepsContext === null || stepsContext === void 0 ? void 0 : stepsContext.setOnNext(onNext);
70
69
  stepsContext === null || stepsContext === void 0 ? void 0 : stepsContext.setOnMount(onMount);
71
70
  }
72
- }, [onMount, onNext, stepsContext, stepNumber, previousState === null || previousState === void 0 ? void 0 : previousState.currentStep]);
71
+ }, [onMount, stepsContext, stepNumber, previousState === null || previousState === void 0 ? void 0 : previousState.currentStep]);
73
72
  useEffect(function () {
74
73
  setShouldIncludeStep(includeStep);
75
- }, [includeStep, stepsContext, title]); // Whenever we are the current step, supply our disableSubmit value to the
74
+ }, [includeStep, stepsContext, title]); // Whenever we are the current step, supply our disableSubmit and onNext values to the
76
75
  // steps container context so that it can manage the 'Next' button appropriately.
77
76
 
78
77
  useEffect(function () {
79
78
  if (stepNumber === (stepsContext === null || stepsContext === void 0 ? void 0 : stepsContext.currentStep)) {
80
79
  stepsContext.setIsDisabled(disableSubmit);
80
+ stepsContext === null || stepsContext === void 0 ? void 0 : stepsContext.setOnNext(onNext); // needs to be updated here otherwise there could be stale state values from only initially setting onNext
81
81
  }
82
82
  }, [stepsContext, stepNumber, disableSubmit, onNext]);
83
83
  return stepsContext ? /*#__PURE__*/React.createElement("section", _extends({}, rest, {
@@ -63,24 +63,24 @@ export var CreateTearsheetStep = /*#__PURE__*/forwardRef(function (_ref, ref) {
63
63
  shouldIncludeStep: shouldIncludeStep,
64
64
  secondaryLabel: secondaryLabel,
65
65
  title: title
66
- }); // This useEffect reports back the onNext and onMount values so that they can be used
66
+ }); // This useEffect reports back the onMount value so that they can be used
67
67
  // in the appropriate custom hooks.
68
68
 
69
69
  useEffect(function () {
70
70
  if (stepNumber === (stepsContext === null || stepsContext === void 0 ? void 0 : stepsContext.currentStep) && (previousState === null || previousState === void 0 ? void 0 : previousState.currentStep) !== (stepsContext === null || stepsContext === void 0 ? void 0 : stepsContext.currentStep)) {
71
- stepsContext === null || stepsContext === void 0 ? void 0 : stepsContext.setOnNext(onNext);
72
71
  stepsContext === null || stepsContext === void 0 ? void 0 : stepsContext.setOnMount(onMount);
73
72
  }
74
- }, [onMount, onNext, stepsContext, stepNumber, previousState === null || previousState === void 0 ? void 0 : previousState.currentStep]); // Used to take the `includeStep` prop and use it as a local state value
73
+ }, [onMount, stepsContext, stepNumber, previousState === null || previousState === void 0 ? void 0 : previousState.currentStep]); // Used to take the `includeStep` prop and use it as a local state value
75
74
 
76
75
  useEffect(function () {
77
76
  setShouldIncludeStep(includeStep);
78
- }, [includeStep, stepsContext, title]); // Whenever we are the current step, supply our disableSubmit value to the
77
+ }, [includeStep, stepsContext, title]); // Whenever we are the current step, supply our disableSubmit and onNext values to the
79
78
  // steps container context so that it can manage the 'Next' button appropriately.
80
79
 
81
80
  useEffect(function () {
82
81
  if (stepNumber === (stepsContext === null || stepsContext === void 0 ? void 0 : stepsContext.currentStep)) {
83
82
  stepsContext.setIsDisabled(disableSubmit);
83
+ stepsContext === null || stepsContext === void 0 ? void 0 : stepsContext.setOnNext(onNext); // needs to be updated here otherwise there could be stale state values from only initially setting onNext
84
84
  }
85
85
  }, [stepsContext, stepNumber, disableSubmit, onNext]);
86
86
  return stepsContext ? /*#__PURE__*/React.createElement("div", _extends({}, rest, {
@@ -81,23 +81,23 @@ var CreateFullPageStep = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref
81
81
  shouldIncludeStep: shouldIncludeStep,
82
82
  secondaryLabel: secondaryLabel,
83
83
  title: title
84
- }); // This useEffect reports back the onNext and onMount values so that they can be used
84
+ }); // This useEffect reports back the onMount value so that they can be used
85
85
  // in the appropriate custom hooks.
86
86
 
87
87
  (0, _react.useEffect)(function () {
88
88
  if (stepNumber === (stepsContext === null || stepsContext === void 0 ? void 0 : stepsContext.currentStep) && (previousState === null || previousState === void 0 ? void 0 : previousState.currentStep) !== (stepsContext === null || stepsContext === void 0 ? void 0 : stepsContext.currentStep)) {
89
- stepsContext === null || stepsContext === void 0 ? void 0 : stepsContext.setOnNext(onNext);
90
89
  stepsContext === null || stepsContext === void 0 ? void 0 : stepsContext.setOnMount(onMount);
91
90
  }
92
- }, [onMount, onNext, stepsContext, stepNumber, previousState === null || previousState === void 0 ? void 0 : previousState.currentStep]);
91
+ }, [onMount, stepsContext, stepNumber, previousState === null || previousState === void 0 ? void 0 : previousState.currentStep]);
93
92
  (0, _react.useEffect)(function () {
94
93
  setShouldIncludeStep(includeStep);
95
- }, [includeStep, stepsContext, title]); // Whenever we are the current step, supply our disableSubmit value to the
94
+ }, [includeStep, stepsContext, title]); // Whenever we are the current step, supply our disableSubmit and onNext values to the
96
95
  // steps container context so that it can manage the 'Next' button appropriately.
97
96
 
98
97
  (0, _react.useEffect)(function () {
99
98
  if (stepNumber === (stepsContext === null || stepsContext === void 0 ? void 0 : stepsContext.currentStep)) {
100
99
  stepsContext.setIsDisabled(disableSubmit);
100
+ stepsContext === null || stepsContext === void 0 ? void 0 : stepsContext.setOnNext(onNext); // needs to be updated here otherwise there could be stale state values from only initially setting onNext
101
101
  }
102
102
  }, [stepsContext, stepNumber, disableSubmit, onNext]);
103
103
  return stepsContext ? /*#__PURE__*/_react.default.createElement("section", (0, _extends2.default)({}, rest, {
@@ -83,24 +83,24 @@ var CreateTearsheetStep = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, re
83
83
  shouldIncludeStep: shouldIncludeStep,
84
84
  secondaryLabel: secondaryLabel,
85
85
  title: title
86
- }); // This useEffect reports back the onNext and onMount values so that they can be used
86
+ }); // This useEffect reports back the onMount value so that they can be used
87
87
  // in the appropriate custom hooks.
88
88
 
89
89
  (0, _react.useEffect)(function () {
90
90
  if (stepNumber === (stepsContext === null || stepsContext === void 0 ? void 0 : stepsContext.currentStep) && (previousState === null || previousState === void 0 ? void 0 : previousState.currentStep) !== (stepsContext === null || stepsContext === void 0 ? void 0 : stepsContext.currentStep)) {
91
- stepsContext === null || stepsContext === void 0 ? void 0 : stepsContext.setOnNext(onNext);
92
91
  stepsContext === null || stepsContext === void 0 ? void 0 : stepsContext.setOnMount(onMount);
93
92
  }
94
- }, [onMount, onNext, stepsContext, stepNumber, previousState === null || previousState === void 0 ? void 0 : previousState.currentStep]); // Used to take the `includeStep` prop and use it as a local state value
93
+ }, [onMount, stepsContext, stepNumber, previousState === null || previousState === void 0 ? void 0 : previousState.currentStep]); // Used to take the `includeStep` prop and use it as a local state value
95
94
 
96
95
  (0, _react.useEffect)(function () {
97
96
  setShouldIncludeStep(includeStep);
98
- }, [includeStep, stepsContext, title]); // Whenever we are the current step, supply our disableSubmit value to the
97
+ }, [includeStep, stepsContext, title]); // Whenever we are the current step, supply our disableSubmit and onNext values to the
99
98
  // steps container context so that it can manage the 'Next' button appropriately.
100
99
 
101
100
  (0, _react.useEffect)(function () {
102
101
  if (stepNumber === (stepsContext === null || stepsContext === void 0 ? void 0 : stepsContext.currentStep)) {
103
102
  stepsContext.setIsDisabled(disableSubmit);
103
+ stepsContext === null || stepsContext === void 0 ? void 0 : stepsContext.setOnNext(onNext); // needs to be updated here otherwise there could be stale state values from only initially setting onNext
104
104
  }
105
105
  }, [stepsContext, stepNumber, disableSubmit, onNext]);
106
106
  return stepsContext ? /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({}, rest, {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@carbon/ibm-products",
3
3
  "description": "Carbon for IBM Products",
4
- "version": "1.11.1",
4
+ "version": "1.11.2",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "module": "es/index.js",
@@ -88,5 +88,5 @@
88
88
  "react": "^16.8.6 || ^17.0.1",
89
89
  "react-dom": "^16.8.6 || ^17.0.1"
90
90
  },
91
- "gitHead": "dd67992eea35e2e7b27032bade757b9e7037fb23"
91
+ "gitHead": "1327941f8527f6ea940253307039bc99ba0a43f2"
92
92
  }