Skip to content

Commit

Permalink
Update the index.ts files (#187)
Browse files Browse the repository at this point in the history
- update the index.ts files
- optimize index.ts files
- improve imports in archwizard module
- make IntelliJ happy
  • Loading branch information
madoar committed Feb 22, 2019
1 parent 4851e39 commit df00edd
Show file tree
Hide file tree
Showing 29 changed files with 88 additions and 77 deletions.
44 changes: 36 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,37 @@
export { WizardCompletionStepComponent } from './lib/components/wizard-completion-step.component';
export { WizardNavigationBarComponent } from './lib/components/wizard-navigation-bar.component';
export { WizardStepComponent } from './lib/components/wizard-step.component';
export { WizardComponent } from './lib/components/wizard.component';

export * from './lib/directives';
export * from './lib/navigation';
export * from './lib/util';
// export the components
export {WizardCompletionStepComponent} from './lib/components/wizard-completion-step.component';
export {WizardNavigationBarComponent} from './lib/components/wizard-navigation-bar.component';
export {WizardStepComponent} from './lib/components/wizard-step.component';
export {WizardComponent} from './lib/components/wizard.component';

// export the directives
export {EnableBackLinksDirective} from './lib/directives/enable-back-links.directive';
export {GoToStepDirective} from './lib/directives/go-to-step.directive';
export {NextStepDirective} from './lib/directives/next-step.directive';
export {OptionalStepDirective} from './lib/directives/optional-step.directive';
export {PreviousStepDirective} from './lib/directives/previous-step.directive';
export {ResetWizardDirective} from './lib/directives/reset-wizard.directive';
export {SelectedStepDirective} from './lib/directives/selected-step.directive';
export {WizardCompletionStepDirective} from './lib/directives/wizard-completion-step.directive';
export {WizardStepDirective} from './lib/directives/wizard-step.directive';
export {WizardStepTitleDirective} from './lib/directives/wizard-step-title.directive';

// export the navigation classes
export {FreeNavigationMode} from './lib/navigation/free-navigation-mode';
export {NavigationMode} from './lib/navigation/navigation-mode.interface';
export {SemiStrictNavigationMode} from './lib/navigation/semi-strict-navigation-mode';
export {StrictNavigationMode} from './lib/navigation/strict-navigation-mode';
export {WizardState} from './lib/navigation/wizard-state.model';
export {navigationModeFactory} from './lib/navigation/navigation-mode.provider';

// export the utility functions
export {MovingDirection} from './lib/util/moving-direction.enum';
export {NavigationSymbol} from './lib/util/navigation-symbol.interface';
export {StepId, isStepId} from './lib/util/step-id.interface';
export {StepIndex, isStepIndex} from './lib/util/step-index.interface';
export {StepOffset, isStepOffset} from './lib/util/step-offset.interface';
export {WizardCompletionStep} from './lib/util/wizard-completion-step.interface';
export {WizardStep} from './lib/util/wizard-step.interface';

// export the module
export {ArchwizardModule} from './lib/archwizard.module';
30 changes: 14 additions & 16 deletions src/lib/archwizard.module.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
import {CommonModule} from '@angular/common';
import {ModuleWithProviders, NgModule} from '@angular/core';

import {WizardComponent} from './components/wizard.component';
import {WizardNavigationBarComponent} from './components/wizard-navigation-bar.component';
import {WizardStepComponent} from './components/wizard-step.component';
import {WizardCompletionStepComponent} from './components/wizard-completion-step.component';

import {NextStepDirective} from './directives/next-step.directive';
import {PreviousStepDirective} from './directives/previous-step.directive';
import {OptionalStepDirective} from './directives/optional-step.directive';
import {GoToStepDirective} from './directives/go-to-step.directive';
import {WizardStepSymbolDirective} from './directives/wizard-step-symbol.directive';
import {WizardStepTitleDirective} from './directives/wizard-step-title.directive';
import {EnableBackLinksDirective} from './directives/enable-back-links.directive';
import {WizardStepDirective} from './directives/wizard-step.directive';
import {WizardCompletionStepDirective} from './directives/wizard-completion-step.directive';
import {SelectedStepDirective} from './directives/selected-step.directive';
import {ResetWizardDirective} from './directives/reset-wizard.directive';
import {WizardCompletionStepComponent, WizardComponent, WizardNavigationBarComponent, WizardStepComponent} from './components';
import {
EnableBackLinksDirective,
GoToStepDirective,
NextStepDirective,
OptionalStepDirective,
PreviousStepDirective,
ResetWizardDirective,
SelectedStepDirective,
WizardCompletionStepDirective,
WizardStepDirective,
WizardStepSymbolDirective,
WizardStepTitleDirective
} from './directives';

/**
* The module defining all the content inside `angular-archwizard`
Expand Down
3 changes: 1 addition & 2 deletions src/lib/components/wizard-completion-step.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
*/

import {Component, forwardRef, ViewEncapsulation} from '@angular/core';
import {WizardStep} from '../util/wizard-step.interface';
import {WizardCompletionStep} from '../util/wizard-completion-step.interface';
import {WizardCompletionStep, WizardStep} from '../util';

/**
* The `aw-wizard-completion-step` component can be used to define a completion/success step at the end of your wizard
Expand Down
7 changes: 3 additions & 4 deletions src/lib/components/wizard-navigation-bar.component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {Component, Input, ViewEncapsulation} from '@angular/core';
import {WizardStep} from '../util/wizard-step.interface';
import {WizardState} from '../navigation/wizard-state.model';
import {NavigationMode} from '../navigation/navigation-mode.interface';
import {NavigationMode, WizardState} from '../navigation';
import {WizardStep} from '../util';

/**
* The `aw-wizard-navigation-bar` component contains the navigation bar inside a [[WizardComponent]].
Expand Down Expand Up @@ -116,7 +115,7 @@ export class WizardNavigationBarComponent {
* @returns True if the step can be marked as optional
*/
public isOptional(wizardStep: WizardStep): boolean {
return wizardStep.optional && !wizardStep.completed && !wizardStep.selected && !this.wizardState.completed
return wizardStep.optional && !wizardStep.completed && !wizardStep.selected && !this.wizardState.completed;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/wizard-step.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Component, forwardRef, ViewEncapsulation} from '@angular/core';
import {WizardStep} from '../util/wizard-step.interface';
import {WizardStep} from '../util';

/**
* The `aw-wizard-step` component is used to define a normal step inside a wizard.
Expand Down
7 changes: 3 additions & 4 deletions src/lib/components/wizard.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ import {
SimpleChanges,
ViewEncapsulation
} from '@angular/core';
import {WizardStep} from '../util/wizard-step.interface';
import {WizardState} from '../navigation/wizard-state.model';
import {NavigationMode} from '../navigation/navigation-mode.interface';
import {NavigationMode, WizardState} from '../navigation';
import {WizardStep} from '../util';

/**
* The `aw-wizard` component defines the root component of a wizard.
Expand Down Expand Up @@ -146,7 +145,7 @@ export class WizardComponent implements OnChanges, AfterContentInit {
*/
ngOnChanges(changes: SimpleChanges) {
for (const propName of Object.keys(changes)) {
let change = changes[propName];
const change = changes[propName];

if (!change.firstChange) {
switch (propName) {
Expand Down
3 changes: 1 addition & 2 deletions src/lib/directives/enable-back-links.directive.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {Directive, EventEmitter, Host, OnInit, Output} from '@angular/core';
import {MovingDirection} from '../util/moving-direction.enum';
import {WizardCompletionStep} from '../util/wizard-completion-step.interface';
import {MovingDirection, WizardCompletionStep} from '../util';

/**
* The `awEnableBackLinks` directive can be used to allow the user to leave a [[WizardCompletionStep]] after is has been entered.
Expand Down
8 changes: 2 additions & 6 deletions src/lib/directives/go-to-step.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,8 @@
*/

import {Directive, EventEmitter, HostListener, Input, Optional, Output} from '@angular/core';
import {isStepOffset, StepOffset} from '../util/step-offset.interface';
import {WizardStep} from '../util/wizard-step.interface';
import {WizardState} from '../navigation/wizard-state.model';
import {NavigationMode} from '../navigation/navigation-mode.interface';
import {isStepId, StepId} from '../util/step-id.interface';
import {isStepIndex, StepIndex} from '../util/step-index.interface';
import {isStepId, isStepIndex, isStepOffset, StepId, StepIndex, StepOffset, WizardStep} from '../util';
import {NavigationMode, WizardState} from '../navigation';

/**
* The `awGoToStep` directive can be used to navigate to a given step.
Expand Down
1 change: 1 addition & 0 deletions src/lib/directives/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export {SelectedStepDirective} from './selected-step.directive';
export {WizardCompletionStepDirective} from './wizard-completion-step.directive';
export {WizardStepDirective} from './wizard-step.directive';
export {WizardStepTitleDirective} from './wizard-step-title.directive';
export {WizardStepSymbolDirective} from './wizard-step-symbol.directive';



Expand Down
3 changes: 1 addition & 2 deletions src/lib/directives/next-step.directive.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {Directive, EventEmitter, HostListener, Output} from '@angular/core';
import {NavigationMode} from '../navigation/navigation-mode.interface';
import {WizardState} from '../navigation/wizard-state.model';
import {NavigationMode, WizardState} from '../navigation';

/**
* The `awNextStep` directive can be used to navigate to the next step.
Expand Down
2 changes: 1 addition & 1 deletion src/lib/directives/optional-step.directive.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Directive, Host, OnInit} from '@angular/core';
import {WizardStep} from '../util/wizard-step.interface';
import {WizardStep} from '../util';

/**
* The `awOptionalStep` directive can be used to define an optional `wizard-step`.
Expand Down
3 changes: 1 addition & 2 deletions src/lib/directives/previous-step.directive.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {Directive, EventEmitter, HostListener, Output} from '@angular/core';
import {NavigationMode} from '../navigation/navigation-mode.interface';
import {WizardState} from '../navigation/wizard-state.model';
import {NavigationMode, WizardState} from '../navigation';

/**
* The `awPreviousStep` directive can be used to navigate to the previous step.
Expand Down
3 changes: 1 addition & 2 deletions src/lib/directives/reset-wizard.directive.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {Directive, EventEmitter, HostListener, Output} from '@angular/core';
import {WizardState} from '../navigation/wizard-state.model';
import {NavigationMode} from '../navigation/navigation-mode.interface';
import {NavigationMode, WizardState} from '../navigation';

/**
* The `awResetWizard` directive can be used to reset the wizard to its initial state.
Expand Down
2 changes: 1 addition & 1 deletion src/lib/directives/selected-step.directive.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Directive, Host, OnInit} from '@angular/core';
import {WizardStep} from '../util/wizard-step.interface';
import {WizardStep} from '../util';

/**
* The `awSelectedStep` directive can be used on a [[WizardStep]] to set it as selected after the wizard initialisation or a reset.
Expand Down
3 changes: 1 addition & 2 deletions src/lib/directives/wizard-completion-step.directive.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {Directive, forwardRef} from '@angular/core';
import {WizardStep} from '../util/wizard-step.interface';
import {WizardCompletionStep} from '../util/wizard-completion-step.interface';
import {WizardCompletionStep, WizardStep} from '../util';

/**
* The `awWizardCompletionStep` directive can be used to define a completion/success step at the end of your wizard
Expand Down
2 changes: 1 addition & 1 deletion src/lib/directives/wizard-step.directive.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Directive, forwardRef} from '@angular/core';
import {WizardStep} from '../util/wizard-step.interface';
import {WizardStep} from '../util';

/**
* The `awWizardStep` directive can be used to define a normal step inside a wizard.
Expand Down
4 changes: 2 additions & 2 deletions src/lib/navigation/free-navigation-mode.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {EventEmitter} from '@angular/core';
import {NavigationMode} from './navigation-mode.interface';
import {MovingDirection} from '../util/moving-direction.enum';
import {WizardState} from './wizard-state.model';
import {EventEmitter} from '@angular/core';
import {MovingDirection} from '../util';

/**
* A [[NavigationMode]], which allows the user to navigate without any limitations,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/navigation/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export {FreeNavigationMode} from './free-navigation-mode';
export {NavigationMode} from './navigation-mode.interface';
export * from './navigation-mode.provider';
export {navigationModeFactory} from './navigation-mode.provider';
export {SemiStrictNavigationMode} from './semi-strict-navigation-mode';
export {StrictNavigationMode} from './strict-navigation-mode';
export {WizardState} from './wizard-state.model';
3 changes: 1 addition & 2 deletions src/lib/navigation/navigation-mode.provider.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {FreeNavigationMode} from './free-navigation-mode';
import {SemiStrictNavigationMode} from './semi-strict-navigation-mode';
import {StrictNavigationMode} from './strict-navigation-mode';

import {NavigationMode} from './navigation-mode.interface';
import {WizardState} from './wizard-state.model';

Expand All @@ -22,4 +21,4 @@ export function navigationModeFactory(navigationMode: string, wizardState: Wizar
default:
return new StrictNavigationMode(wizardState);
}
};
}
5 changes: 2 additions & 3 deletions src/lib/navigation/semi-strict-navigation-mode.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import {EventEmitter} from '@angular/core';
import {NavigationMode} from './navigation-mode.interface';
import {MovingDirection} from '../util/moving-direction.enum';
import {WizardCompletionStep} from '../util/wizard-completion-step.interface';
import {WizardState} from './wizard-state.model';
import {EventEmitter} from '@angular/core';
import {MovingDirection, WizardCompletionStep} from '../util';

/**
* A [[NavigationMode]], which allows the user to navigate with some limitations.
Expand Down
2 changes: 1 addition & 1 deletion src/lib/navigation/strict-navigation-mode.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {NavigationMode} from './navigation-mode.interface';
import {MovingDirection} from '../util/moving-direction.enum';
import {WizardState} from './wizard-state.model';
import {EventEmitter} from '@angular/core';
import {MovingDirection} from '../util';

/**
* A [[NavigationMode]], which allows the user to navigate with strict limitations.
Expand Down
3 changes: 1 addition & 2 deletions src/lib/navigation/wizard-state.model.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import {Injectable} from '@angular/core';
import {WizardStep} from '../util/wizard-step.interface';
import {MovingDirection} from '../util/moving-direction.enum';
import {NavigationMode} from './navigation-mode.interface';
import {navigationModeFactory} from './navigation-mode.provider';
import {MovingDirection, WizardStep} from '../util';

/**
* The internal model/state of a wizard.
Expand Down
6 changes: 3 additions & 3 deletions src/lib/util/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export {MovingDirection} from './moving-direction.enum';
export {NavigationSymbol} from './navigation-symbol.interface';
export * from './step-id.interface';
export * from './step-index.interface';
export * from './step-offset.interface';
export {StepId, isStepId} from './step-id.interface';
export {StepIndex, isStepIndex} from './step-index.interface';
export {StepOffset, isStepOffset} from './step-offset.interface';
export {WizardCompletionStep} from './wizard-completion-step.interface';
export {WizardStep} from './wizard-step.interface';
4 changes: 2 additions & 2 deletions src/lib/util/navigation-symbol.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ export interface NavigationSymbol {
/**
* The symbol to be used for a navigation step
*/
symbol: string
symbol: string;

/**
* The font family to be used for this navigation symbol
*/
fontFamily?: string
fontFamily?: string;
}
2 changes: 1 addition & 1 deletion src/lib/util/step-id.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export interface StepId {
/**
* The id of the destination step
*/
stepId: string
stepId: string;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/lib/util/step-index.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export interface StepIndex {
/**
* The index of the destination step
*/
stepIndex: number
stepIndex: number;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/lib/util/step-offset.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface StepOffset {
/**
* The offset to the destination step
*/
stepOffset: number
stepOffset: number;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/lib/util/wizard-completion-step.interface.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {EventEmitter} from '@angular/core';
import {WizardStep} from './wizard-step.interface';
import {MovingDirection} from './moving-direction.enum';
import {EventEmitter} from '@angular/core';

/**
* Basic functionality every wizard completion step needs to provide
Expand Down
5 changes: 2 additions & 3 deletions src/lib/util/wizard-step.interface.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import {MovingDirection} from './moving-direction.enum';
import {WizardStepTitleDirective} from '../directives/wizard-step-title.directive';
import {ContentChild, EventEmitter, HostBinding, Input, Output} from '@angular/core';
import {MovingDirection} from './moving-direction.enum';
import {NavigationSymbol} from './navigation-symbol.interface';
import {WizardStepSymbolDirective} from '../directives/wizard-step-symbol.directive';
import {WizardStepSymbolDirective, WizardStepTitleDirective} from '../directives';

/**
* Basic functionality every type of wizard step needs to provide
Expand Down

0 comments on commit df00edd

Please sign in to comment.