fix(core): update

This commit is contained in:
Philipp Kunz 2021-09-09 00:35:10 +02:00
parent 20755775ea
commit 3b99796073

View File

@ -14,6 +14,8 @@ import * as domtools from '@designestate/dees-domtools';
export interface IStep { export interface IStep {
title: string; title: string;
content: TemplateResult; content: TemplateResult;
validationFunc?: (stepper: DeesStepper, htmlElement: HTMLElement) => Promise<any>;
validationFuncCalled?: boolean;
} }
declare global { declare global {
@ -200,6 +202,10 @@ export class DeesStepper extends DeesElement {
easing: 'easeInOutQuint' easing: 'easeInOutQuint'
}, stepperContainer); }, stepperContainer);
} }
if (!this.selectedStep.validationFuncCalled && this.selectedStep.validationFunc) {
this.selectedStep.validationFuncCalled = true;
await this.selectedStep.validationFunc(this, selectedStepElement);
}
this.scroller.to(scrollPosition); this.scroller.to(scrollPosition);
} }