@educarehq/solaris-components 0.5.6 → 0.5.7

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.
@@ -3243,8 +3243,9 @@ class SolarisDialogStepsContainer {
3243
3243
  return;
3244
3244
  }
3245
3245
  const step = this.steps[this.currentStepIndex()];
3246
- if (step?.actions?.length) {
3247
- this.dialogRef.updateActions(step.actions.map(action => ({
3246
+ const customActions = this.resolveStepActions(step);
3247
+ if (customActions.length) {
3248
+ this.dialogRef.updateActions(customActions.map(action => ({
3248
3249
  ...action,
3249
3250
  disabled: action.disabled || this.loading(),
3250
3251
  })));
@@ -3290,6 +3291,20 @@ class SolarisDialogStepsContainer {
3290
3291
  };
3291
3292
  this.dialogRef.updateActions([leftAction, rightAction]);
3292
3293
  }
3294
+ resolveStepActions(step) {
3295
+ if (!step?.actions) {
3296
+ return [];
3297
+ }
3298
+ if (typeof step.actions === 'function') {
3299
+ return step.actions({
3300
+ index: this.currentStepIndex(),
3301
+ loading: this.loading(),
3302
+ isFirstStep: this.isFirstStep(),
3303
+ isLastStep: this.isLastStep(),
3304
+ });
3305
+ }
3306
+ return step.actions;
3307
+ }
3293
3308
  resolveInitialStepIndex() {
3294
3309
  if (!this.steps.length) {
3295
3310
  return 0;