Skip to content

Commit 713d97f

Browse files
authored
Remove unnecesarry index.ts files (#192)
- remove unnecessary index.ts files - cleanup imports - cleanup imports in tests - remove "Created by ..." statements
1 parent 73def2a commit 713d97f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+411
-364
lines changed

src/lib/archwizard.module.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
import {CommonModule} from '@angular/common';
22
import {ModuleWithProviders, NgModule} from '@angular/core';
3-
4-
import {WizardCompletionStepComponent, WizardComponent, WizardNavigationBarComponent, WizardStepComponent} from './components';
5-
import {
6-
EnableBackLinksDirective,
7-
GoToStepDirective,
8-
NextStepDirective,
9-
OptionalStepDirective,
10-
PreviousStepDirective,
11-
ResetWizardDirective,
12-
SelectedStepDirective,
13-
WizardCompletionStepDirective,
14-
WizardStepDirective,
15-
WizardStepSymbolDirective,
16-
WizardStepTitleDirective
17-
} from './directives';
3+
import {WizardCompletionStepComponent} from './components/wizard-completion-step.component';
4+
import {WizardNavigationBarComponent} from './components/wizard-navigation-bar.component';
5+
import {WizardStepComponent} from './components/wizard-step.component';
6+
import {WizardComponent} from './components/wizard.component';
7+
import {EnableBackLinksDirective} from './directives/enable-back-links.directive';
8+
import {GoToStepDirective} from './directives/go-to-step.directive';
9+
import {NextStepDirective} from './directives/next-step.directive';
10+
import {OptionalStepDirective} from './directives/optional-step.directive';
11+
import {PreviousStepDirective} from './directives/previous-step.directive';
12+
import {ResetWizardDirective} from './directives/reset-wizard.directive';
13+
import {SelectedStepDirective} from './directives/selected-step.directive';
14+
import {WizardCompletionStepDirective} from './directives/wizard-completion-step.directive';
15+
import {WizardStepSymbolDirective} from './directives/wizard-step-symbol.directive';
16+
import {WizardStepTitleDirective} from './directives/wizard-step-title.directive';
17+
import {WizardStepDirective} from './directives/wizard-step.directive';
1818

1919
/**
2020
* The module defining all the content inside `angular-archwizard`

src/lib/components/index.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/lib/components/wizard-completion-step.component.spec.ts

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
1-
/**
2-
* Created by marc on 20.05.17.
3-
*/
4-
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
5-
import {WizardCompletionStepComponent} from './wizard-completion-step.component';
61
import {Component} from '@angular/core';
7-
import {MovingDirection} from '../util/moving-direction.enum';
2+
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
83
import {By} from '@angular/platform-browser';
94
import {ArchwizardModule} from '../archwizard.module';
10-
import {WizardState} from '../navigation/wizard-state.model';
115
import {NavigationMode} from '../navigation/navigation-mode.interface';
6+
import {WizardState} from '../navigation/wizard-state.model';
7+
import {MovingDirection} from '../util/moving-direction.enum';
8+
import {WizardCompletionStepComponent} from './wizard-completion-step.component';
129

1310
@Component({
1411
selector: 'aw-test-wizard',
1512
template: `
1613
<aw-wizard>
17-
<aw-wizard-step stepTitle='Steptitle 1' (stepEnter)="enterInto($event, 1)" (stepExit)="exitFrom($event, 1)">Step 1</aw-wizard-step>
18-
<aw-wizard-step stepTitle='Steptitle 2' [canExit]="isValid"
19-
awOptionalStep (stepEnter)="enterInto($event, 2)" (stepExit)="exitFrom($event, 2)">Step 2</aw-wizard-step>
20-
<aw-wizard-completion-step stepTitle='Completion steptitle 3' (stepEnter)="enterInto($event, 3)">Step 3</aw-wizard-completion-step>
14+
<aw-wizard-step stepTitle='Steptitle 1' (stepEnter)="enterInto($event, 1)" (stepExit)="exitFrom($event, 1)">
15+
Step 1
16+
</aw-wizard-step>
17+
<aw-wizard-step stepTitle='Steptitle 2' [canExit]="isValid" awOptionalStep (stepEnter)="enterInto($event, 2)"
18+
(stepExit)="exitFrom($event, 2)">
19+
Step 2
20+
</aw-wizard-step>
21+
<aw-wizard-completion-step stepTitle='Completion steptitle 3' (stepEnter)="enterInto($event, 3)">
22+
Step 3
23+
</aw-wizard-completion-step>
2124
</aw-wizard>
2225
`
2326
})

src/lib/components/wizard-completion-step.component.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
/**
2-
* Created by marc on 20.05.17.
3-
*/
4-
51
import {Component, forwardRef, ViewEncapsulation} from '@angular/core';
6-
import {WizardCompletionStep, WizardStep} from '../util';
2+
import {WizardCompletionStep} from '../util/wizard-completion-step.interface';
3+
import {WizardStep} from '../util/wizard-step.interface';
74

85
/**
96
* The `aw-wizard-completion-step` component can be used to define a completion/success step at the end of your wizard

src/lib/components/wizard-navigation-bar.component.spec.ts

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
1+
import {Component, ViewChild} from '@angular/core';
12
import {async, ComponentFixture, fakeAsync, TestBed, tick} from '@angular/core/testing';
2-
import {Component, DebugElement, ViewChild} from '@angular/core';
3-
import {WizardNavigationBarComponent} from './wizard-navigation-bar.component';
4-
import {WizardComponent} from './wizard.component';
53
import {By} from '@angular/platform-browser';
64
import {ArchwizardModule} from '../archwizard.module';
75
import {NavigationMode} from '../navigation/navigation-mode.interface';
86
import {WizardState} from '../navigation/wizard-state.model';
7+
import {WizardNavigationBarComponent} from './wizard-navigation-bar.component';
8+
import {WizardComponent} from './wizard.component';
99

1010
@Component({
1111
selector: 'aw-test-wizard',
1212
template: `
1313
<aw-wizard>
14-
<aw-wizard-step stepTitle='Steptitle 1' [stepId]="firstStepId">Step 1</aw-wizard-step>
15-
<aw-wizard-step stepTitle='Steptitle 2' awOptionalStep>Step 2</aw-wizard-step>
16-
<aw-wizard-step stepTitle='Steptitle 3'>Step 3</aw-wizard-step>
14+
<aw-wizard-step stepTitle='Steptitle 1' [stepId]="firstStepId">
15+
Step 1
16+
</aw-wizard-step>
17+
<aw-wizard-step stepTitle='Steptitle 2' awOptionalStep>
18+
Step 2
19+
</aw-wizard-step>
20+
<aw-wizard-step stepTitle='Steptitle 3'>
21+
Step 3
22+
</aw-wizard-step>
1723
</aw-wizard>
1824
`
1925
})
@@ -528,7 +534,7 @@ describe('WizardNavigationBarComponent', () => {
528534
});
529535

530536
it('should show the correct step titles', () => {
531-
let navigationLinks = wizardTestFixture.debugElement.queryAll(By.css('aw-wizard-navigation-bar ul li a'));
537+
const navigationLinks = wizardTestFixture.debugElement.queryAll(By.css('aw-wizard-navigation-bar ul li a'));
532538

533539
expect(navigationLinks.length).toBe(3);
534540
expect(navigationLinks[0].nativeElement.innerText).toBe('STEPTITLE 1');
@@ -540,7 +546,7 @@ describe('WizardNavigationBarComponent', () => {
540546
wizardTest.wizard.navBarDirection = 'right-to-left';
541547
wizardTestFixture.detectChanges();
542548

543-
let navigationLinks = wizardTestFixture.debugElement.queryAll(By.css('aw-wizard-navigation-bar ul li a'));
549+
const navigationLinks = wizardTestFixture.debugElement.queryAll(By.css('aw-wizard-navigation-bar ul li a'));
544550

545551
expect(navigationLinks.length).toBe(3);
546552
expect(navigationLinks[0].nativeElement.innerText).toBe('STEPTITLE 3');

src/lib/components/wizard-navigation-bar.component.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {Component, Input, ViewEncapsulation} from '@angular/core';
2-
import {NavigationMode, WizardState} from '../navigation';
3-
import {WizardStep} from '../util';
2+
import {NavigationMode} from '../navigation/navigation-mode.interface';
3+
import {WizardState} from '../navigation/wizard-state.model';
4+
import {WizardStep} from '../util/wizard-step.interface';
45

56
/**
67
* The `aw-wizard-navigation-bar` component contains the navigation bar inside a [[WizardComponent]].
@@ -29,13 +30,6 @@ export class WizardNavigationBarComponent {
2930
@Input()
3031
public direction = 'left-to-right';
3132

32-
/**
33-
* The navigation mode
34-
*/
35-
public get navigationMode(): NavigationMode {
36-
return this.wizardState.navigationMode;
37-
}
38-
3933
/**
4034
* Constructor
4135
*
@@ -44,6 +38,13 @@ export class WizardNavigationBarComponent {
4438
constructor(public wizardState: WizardState) {
4539
}
4640

41+
/**
42+
* The navigation mode
43+
*/
44+
public get navigationMode(): NavigationMode {
45+
return this.wizardState.navigationMode;
46+
}
47+
4748
/**
4849
* Returns all [[WizardStep]]s contained in the wizard
4950
*

src/lib/components/wizard-step.component.spec.ts

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
1-
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
2-
import {WizardStepComponent} from './wizard-step.component';
31
import {Component} from '@angular/core';
4-
import {MovingDirection} from '../util/moving-direction.enum';
2+
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
53
import {By} from '@angular/platform-browser';
64
import {ArchwizardModule} from '../archwizard.module';
75
import {NavigationMode} from '../navigation/navigation-mode.interface';
86
import {WizardState} from '../navigation/wizard-state.model';
7+
import {MovingDirection} from '../util/moving-direction.enum';
8+
import {WizardStepComponent} from './wizard-step.component';
99

1010
@Component({
1111
selector: 'aw-test-wizard',
1212
template: `
1313
<aw-wizard>
14-
<aw-wizard-step stepTitle='Steptitle 1' (stepEnter)="enterInto($event, 1)" (stepExit)="exitFrom($event, 1)">Step 1</aw-wizard-step>
15-
<aw-wizard-step stepTitle='Steptitle 2' [canExit]="isValid"
16-
awOptionalStep (stepEnter)="enterInto($event, 2)" (stepExit)="exitFrom($event, 2)">Step 2</aw-wizard-step>
17-
<aw-wizard-step stepTitle='Steptitle 3' (stepEnter)="enterInto($event, 3)" (stepExit)="exitFrom($event, 3)">Step 3</aw-wizard-step>
14+
<aw-wizard-step stepTitle='Steptitle 1' (stepEnter)="enterInto($event, 1)" (stepExit)="exitFrom($event, 1)">
15+
Step 1
16+
</aw-wizard-step>
17+
<aw-wizard-step stepTitle='Steptitle 2' [canExit]="isValid" awOptionalStep (stepEnter)="enterInto($event, 2)"
18+
(stepExit)="exitFrom($event, 2)">
19+
Step 2
20+
</aw-wizard-step>
21+
<aw-wizard-step stepTitle='Steptitle 3' (stepEnter)="enterInto($event, 3)" (stepExit)="exitFrom($event, 3)">
22+
Step 3
23+
</aw-wizard-step>
1824
</aw-wizard>
1925
`
2026
})

src/lib/components/wizard-step.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {Component, forwardRef, ViewEncapsulation} from '@angular/core';
2-
import {WizardStep} from '../util';
2+
import {WizardStep} from '../util/wizard-step.interface';
33

44
/**
55
* The `aw-wizard-step` component is used to define a normal step inside a wizard.

src/lib/components/wizard.component.spec.ts

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
1-
import {async, ComponentFixture, fakeAsync, TestBed, tick} from '@angular/core/testing';
21
import {AfterViewInit, ChangeDetectorRef, Component, ViewChild} from '@angular/core';
3-
import {WizardComponent} from './wizard.component';
2+
import {async, ComponentFixture, fakeAsync, TestBed, tick} from '@angular/core/testing';
43
import {By} from '@angular/platform-browser';
54
import {ArchwizardModule} from '../archwizard.module';
6-
import {WizardState} from '../navigation/wizard-state.model';
5+
import {FreeNavigationMode} from '../navigation/free-navigation-mode';
76
import {NavigationMode} from '../navigation/navigation-mode.interface';
87
import {StrictNavigationMode} from '../navigation/strict-navigation-mode';
9-
import {FreeNavigationMode} from '../navigation/free-navigation-mode';
8+
import {WizardState} from '../navigation/wizard-state.model';
9+
import {WizardComponent} from './wizard.component';
1010

1111
@Component({
1212
selector: 'aw-test-wizard',
1313
template: `
1414
<aw-wizard [navigationMode]="navigationMode" [disableNavigationBar]="disableNavigationBar" [defaultStepIndex]="defaultStepIndex">
15-
<aw-wizard-step stepTitle='Steptitle 1' *ngIf="showStep1">Step 1</aw-wizard-step>
16-
<aw-wizard-step stepTitle='Steptitle 2'>Step 2</aw-wizard-step>
17-
<aw-wizard-step stepTitle='Steptitle 3' *ngIf="showStep3">Step 3</aw-wizard-step>
15+
<aw-wizard-step stepTitle='Steptitle 1' *ngIf="showStep1">
16+
Step 1
17+
</aw-wizard-step>
18+
<aw-wizard-step stepTitle='Steptitle 2'>
19+
Step 2
20+
</aw-wizard-step>
21+
<aw-wizard-step stepTitle='Steptitle 3' *ngIf="showStep3">
22+
Step 3
23+
</aw-wizard-step>
1824
</aw-wizard>
1925
`
2026
})

src/lib/components/wizard.component.ts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ import {
99
SimpleChanges,
1010
ViewEncapsulation
1111
} from '@angular/core';
12-
import {NavigationMode, WizardState} from '../navigation';
13-
import {WizardStep} from '../util';
12+
import {NavigationMode} from '../navigation/navigation-mode.interface';
13+
import {WizardState} from '../navigation/wizard-state.model';
14+
import {WizardStep} from '../util/wizard-step.interface';
1415

1516
/**
1617
* The `aw-wizard` component defines the root component of a wizard.
@@ -101,6 +102,14 @@ export class WizardComponent implements OnChanges, AfterContentInit {
101102
@Input()
102103
public disableNavigationBar = false;
103104

105+
/**
106+
* Constructor
107+
*
108+
* @param model The model for this wizard component
109+
*/
110+
constructor(public model: WizardState) {
111+
}
112+
104113
/**
105114
* Returns true if this wizard uses a horizontal orientation.
106115
* The wizard uses a horizontal orientation, iff the navigation bar is shown at the top or bottom of this wizard
@@ -130,14 +139,6 @@ export class WizardComponent implements OnChanges, AfterContentInit {
130139
return this.model.navigationMode;
131140
}
132141

133-
/**
134-
* Constructor
135-
*
136-
* @param model The model for this wizard component
137-
*/
138-
constructor(public model: WizardState) {
139-
}
140-
141142
/**
142143
* Updates the model after certain input values have changed
143144
*

0 commit comments

Comments
 (0)