dynamic-mui 1.0.69 → 1.0.70

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.
@@ -156,27 +156,31 @@ function Stepper(_ref) {
156
156
  // dispatch({ type: 'SET_STEPS', MuiSteps: newMuiSteps });
157
157
  // }
158
158
  }, [onChange]);
159
- const renderStepButtons = (index, isScreenChange) => /*#__PURE__*/_react.default.createElement(_material.Box, {
160
- sx: {
161
- mb: 2
162
- }
163
- }, /*#__PURE__*/_react.default.createElement(_material.Button, _extends({
164
- variant: "contained",
165
- onClick: () => handleStepChange('NEXT_STEP', isScreenChange, index === MuiSteps.length - 1),
166
- sx: {
167
- mt: 1,
168
- mr: 1
169
- }
170
- }, attributes.MuiButtonAttributes.next, index === MuiSteps.length - 1 && {
171
- ...attributes.MuiButtonAttributes.final
172
- }), index === MuiSteps.length - 1 ? 'Finish' : 'Continue'), /*#__PURE__*/_react.default.createElement(_material.Button, _extends({
173
- disabled: index === 0,
174
- onClick: () => handleStepChange('PREVIOUS_STEP', isScreenChange, false),
175
- sx: {
176
- mt: 1,
177
- mr: 1
178
- }
179
- }, attributes.MuiButtonAttributes.back), "Back"));
159
+ const renderStepButtons = function (index, isScreenChange) {
160
+ let mandatoryIds = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
161
+ return /*#__PURE__*/_react.default.createElement(_material.Box, {
162
+ sx: {
163
+ mb: 2
164
+ }
165
+ }, /*#__PURE__*/_react.default.createElement(_material.Button, _extends({
166
+ variant: "contained",
167
+ onClick: () => handleStepChange('NEXT_STEP', isScreenChange, index === MuiSteps.length - 1),
168
+ disabled: mandatoryIds.some(id => !patch[id]),
169
+ sx: {
170
+ mt: 1,
171
+ mr: 1
172
+ }
173
+ }, attributes.MuiButtonAttributes.next, index === MuiSteps.length - 1 && {
174
+ ...attributes.MuiButtonAttributes.final
175
+ }), index === MuiSteps.length - 1 ? 'Finish' : 'Continue'), /*#__PURE__*/_react.default.createElement(_material.Button, _extends({
176
+ disabled: index === 0,
177
+ onClick: () => handleStepChange('PREVIOUS_STEP', isScreenChange, false),
178
+ sx: {
179
+ mt: 1,
180
+ mr: 1
181
+ }
182
+ }, attributes.MuiButtonAttributes.back), "Back"));
183
+ };
180
184
  return /*#__PURE__*/_react.default.createElement(_material.Box, _extends({
181
185
  sx: {
182
186
  maxWidth: 400
@@ -193,7 +197,7 @@ function Stepper(_ref) {
193
197
  }, attributes.MuiStepLabelAttributes), step.label), /*#__PURE__*/_react.default.createElement(_material.StepContent, attributes.MuiStepContentAttributes, step.components ? /*#__PURE__*/_react.default.createElement(_stepperComponents.default, {
194
198
  onUpdate: handleUpdate,
195
199
  components: (0, _helper.updatePatchData)(step.components, stepperResponse, attributes.id, response)
196
- }) : /*#__PURE__*/_react.default.createElement(_material.Typography, null, step.description), renderStepButtons(index, step.isScreenChange))))));
200
+ }) : /*#__PURE__*/_react.default.createElement(_material.Typography, null, step.description), renderStepButtons(index, step.isScreenChange, step.mandatoryIds))))));
197
201
  }
198
202
  Stepper.propTypes = process.env.NODE_ENV !== "production" ? {
199
203
  attributes: _propTypes.default.shape({
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "files": {
3
- "main.js": "/DinakaranS/-dynamic-mui/build/bundle.036bacf5.js",
3
+ "main.js": "/DinakaranS/-dynamic-mui/build/bundle.7bf57cc2.js",
4
4
  "index.html": "/DinakaranS/-dynamic-mui/index.html"
5
5
  },
6
6
  "entrypoints": [
7
- "build/bundle.036bacf5.js"
7
+ "build/bundle.7bf57cc2.js"
8
8
  ]
9
9
  }