1
- import { AfterViewInit , Component , ViewChild } from '@angular/core' ;
1
+ import { AfterViewInit , ChangeDetectorRef , Component , ViewChild } from '@angular/core' ;
2
+ import { growVerIn , growVerOut , slideInLeft , slideOutRight } from 'igniteui-angular' ;
3
+ import { ToggleAnimationSettings } from 'projects/igniteui-angular/src/lib/expansion-panel/toggle-animation-component' ;
2
4
import { IgxStepperOrienatation } from 'projects/igniteui-angular/src/lib/stepper/common' ;
3
5
import { IgxStepperComponent } from 'projects/igniteui-angular/src/lib/stepper/igx-stepper.component' ;
4
6
@@ -8,6 +10,12 @@ import { IgxStepperComponent } from 'projects/igniteui-angular/src/lib/stepper/i
8
10
} )
9
11
export class IgxStepperSampleComponent implements AfterViewInit {
10
12
@ViewChild ( 'stepper' , { static : true } ) public stepper : IgxStepperComponent ;
13
+ public animationType = 'slide' ;
14
+ public animationSettings : ToggleAnimationSettings = {
15
+ openAnimation : growVerIn ,
16
+ closeAnimation : growVerOut
17
+ } ;
18
+ public animationDuration = 320 ;
11
19
// public stepType = IgxStepType.Full;
12
20
// public labelPos = IgxStepperLabelPosition.Bottom;
13
21
// public stepTypes = [
@@ -25,26 +33,58 @@ export class IgxStepperSampleComponent implements AfterViewInit {
25
33
// { label: 'Start', labelPos: IgxStepperLabelPosition.Start,
26
34
// selected: this.labelPos === IgxStepperLabelPosition.Start, togglable: true }
27
35
// ];
36
+ public horizontalAnimationTypes = [ ] ;
37
+
38
+ public verticalAnimations = [ ] ;
39
+
40
+ constructor ( private cdr : ChangeDetectorRef ) {
41
+ this . horizontalAnimationTypes = [
42
+ { label : 'slide' , animationType : 'slide' , selected : this . animationType === 'slide' , togglable : true } ,
43
+ { label : 'fade' , animationType : 'fade' , selected : this . animationType === 'fade' , togglable : true } ,
44
+ { label : 'none' , animationType : 'none' , selected : this . animationType === 'none' , togglable : true }
45
+ ] ;
46
+ this . verticalAnimations = [
47
+ {
48
+ label : 'default' ,
49
+ animationSettings : { openAnimation : growVerIn , closeAnimation : growVerOut } ,
50
+ selected : this . animationSettings . openAnimation === growVerIn ,
51
+ togglable : true
52
+ } ,
53
+ {
54
+ label : 'custom' ,
55
+ animationSettings : { openAnimation : slideInLeft , closeAnimation : slideOutRight } ,
56
+ selected : this . animationSettings . openAnimation === slideOutRight ,
57
+ togglable : true
58
+ }
59
+ ] ;
60
+ }
61
+
28
62
public ngAfterViewInit ( ) {
29
- // requestAnimationFrame(() => {
30
- // this.stepper.steps[1].completedStyle = IgxStepperProgressLine.Dashed;
31
- // });
32
63
}
64
+
33
65
// public toggleStepTypes(event){
34
66
// this.stepType = this.stepTypes[event.index].stepType;
35
67
// }
68
+
69
+ public toggleHorizontalAnimations ( event ) {
70
+ this . animationType = this . horizontalAnimationTypes [ event . index ] . animationType ;
71
+ }
72
+
73
+ public toggleVerticalAnimations ( event ) {
74
+ this . animationSettings = this . verticalAnimations [ event . index ] . animationSettings ;
75
+ }
36
76
// public toggleLabelPos(event){
37
77
// this.labelPos = this.labelPositions[event.index].labelPos;
38
78
// }
39
79
40
- public activeChanged ( event , step ) {
41
- console . log ( 'ACTIVE CHANGED' ) ;
42
- console . log ( event , step ) ;
80
+
81
+ public activeChanged ( event ) {
82
+ console . log ( 'GOLQM ACTIVE CHANGED' ) ;
83
+ // console.log(event);
43
84
}
44
85
45
- public activeStepChanged ( ev ) {
46
- console . log ( 'ACTIVE STEP CHANGED' ) ;
47
- console . log ( ev ) ;
86
+ public activeStepChange ( ev ) {
87
+ console . log ( 'MALUK CHANGE' , ev ) ;
48
88
}
49
89
50
90
public activeStepChanging ( ev ) {
0 commit comments