matcha-components 19.137.0 → 19.139.0
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.
|
@@ -2803,26 +2803,42 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
2803
2803
|
|
|
2804
2804
|
class MatchaStepperStateService {
|
|
2805
2805
|
constructor() {
|
|
2806
|
-
this.steps
|
|
2807
|
-
this.
|
|
2806
|
+
this.steps = [];
|
|
2807
|
+
this._steps$ = new BehaviorSubject([]);
|
|
2808
|
+
this.steps$ = this._steps$.asObservable();
|
|
2809
|
+
this._activeStep$ = new BehaviorSubject(0);
|
|
2810
|
+
this.activeStep$ = this._activeStep$.asObservable();
|
|
2811
|
+
this.pendingActiveStep = null;
|
|
2808
2812
|
}
|
|
2809
2813
|
setSteps(steps) {
|
|
2810
|
-
this.steps
|
|
2814
|
+
this.steps = steps;
|
|
2815
|
+
this._steps$.next(steps);
|
|
2816
|
+
// Se havia um índice pendente, aplica agora
|
|
2817
|
+
if (this.pendingActiveStep !== null) {
|
|
2818
|
+
this.setActiveStep(this.pendingActiveStep);
|
|
2819
|
+
this.pendingActiveStep = null;
|
|
2820
|
+
}
|
|
2811
2821
|
}
|
|
2812
2822
|
setActiveStep(index) {
|
|
2813
|
-
this.
|
|
2823
|
+
if (this.steps.length === 0) {
|
|
2824
|
+
// Steps ainda não definidos, guarda para depois
|
|
2825
|
+
this.pendingActiveStep = index;
|
|
2826
|
+
return;
|
|
2827
|
+
}
|
|
2828
|
+
if (index >= 0 && index < this.steps.length) {
|
|
2829
|
+
this._activeStep$.next(index);
|
|
2830
|
+
}
|
|
2814
2831
|
}
|
|
2815
2832
|
nextStep() {
|
|
2816
|
-
const
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
this.activeStep$.next(current + 1);
|
|
2833
|
+
const current = this._activeStep$.value;
|
|
2834
|
+
if (current < this.steps.length - 1) {
|
|
2835
|
+
this._activeStep$.next(current + 1);
|
|
2820
2836
|
}
|
|
2821
2837
|
}
|
|
2822
2838
|
prevStep() {
|
|
2823
|
-
const current = this.
|
|
2839
|
+
const current = this._activeStep$.value;
|
|
2824
2840
|
if (current > 0) {
|
|
2825
|
-
this.
|
|
2841
|
+
this._activeStep$.next(current - 1);
|
|
2826
2842
|
}
|
|
2827
2843
|
}
|
|
2828
2844
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: MatchaStepperStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
@@ -2833,8 +2849,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
2833
2849
|
}] });
|
|
2834
2850
|
|
|
2835
2851
|
class MatchaStepperComponent {
|
|
2836
|
-
|
|
2837
|
-
|
|
2852
|
+
constructor(stepperState) {
|
|
2853
|
+
this.stepperState = stepperState;
|
|
2854
|
+
this.active = 0;
|
|
2855
|
+
}
|
|
2856
|
+
ngOnChanges(changes) {
|
|
2857
|
+
if (changes['active'] && typeof changes['active'].currentValue === 'number') {
|
|
2858
|
+
this.stepperState.setActiveStep(this.active);
|
|
2859
|
+
}
|
|
2860
|
+
}
|
|
2861
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: MatchaStepperComponent, deps: [{ token: MatchaStepperStateService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2862
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: MatchaStepperComponent, isStandalone: false, selector: "matcha-stepper", inputs: { active: "active" }, providers: [MatchaStepperStateService], usesOnChanges: true, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true }); }
|
|
2838
2863
|
}
|
|
2839
2864
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: MatchaStepperComponent, decorators: [{
|
|
2840
2865
|
type: Component,
|
|
@@ -2844,7 +2869,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
2844
2869
|
providers: [MatchaStepperStateService],
|
|
2845
2870
|
standalone: false
|
|
2846
2871
|
}]
|
|
2847
|
-
}] }
|
|
2872
|
+
}], ctorParameters: () => [{ type: MatchaStepperStateService }], propDecorators: { active: [{
|
|
2873
|
+
type: Input
|
|
2874
|
+
}] } });
|
|
2848
2875
|
|
|
2849
2876
|
class MatchaStepperContentComponent {
|
|
2850
2877
|
constructor(stepperState) {
|
|
@@ -2897,7 +2924,7 @@ class MatchaStepperControllerComponent {
|
|
|
2897
2924
|
this.activeStep = 0;
|
|
2898
2925
|
}
|
|
2899
2926
|
ngOnInit() {
|
|
2900
|
-
this.stepperState.steps$.subscribe(steps => this.steps = steps);
|
|
2927
|
+
this.stepperState.steps$.subscribe((steps) => this.steps = steps);
|
|
2901
2928
|
this.stepperState.activeStep$.subscribe(step => this.activeStep = step);
|
|
2902
2929
|
}
|
|
2903
2930
|
goToStep(index) {
|