30 lines
710 B
TypeScript
30 lines
710 B
TypeScript
import {Component, EventEmitter, Input, Output} from '@angular/core';
|
|
import {JsonPipe} from '@angular/common';
|
|
|
|
@Component({
|
|
selector: 'sae-stepper',
|
|
imports: [
|
|
JsonPipe
|
|
],
|
|
templateUrl: './stepper.html',
|
|
styleUrl: './stepper.scss'
|
|
})
|
|
export class Stepper {
|
|
@Input() currentStep: number = 1;
|
|
@Input() minStep: number = 1;
|
|
@Input() maxStep: number = 3;
|
|
@Input() stepArray: Array<number> = [1, 2, 3];
|
|
@Output() changedStep: EventEmitter<any> = new EventEmitter();
|
|
|
|
constructor() {
|
|
this.stepArray = []
|
|
for (let ii = this.currentStep; ii < this.maxStep; ii++) {
|
|
|
|
this.stepArray.push(ii)
|
|
}
|
|
}
|
|
|
|
onClickStep(newValue: number) {
|
|
this.changedStep.emit(newValue)
|
|
}
|
|
}
|