-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(package): individual module imports for navigation components (#393
) This allows components to be imported individually without having to install an unused, optional dependency. Deprecations - NavigationItemConfig: Use NavigationBaseConfig, VerticalNavigationConfig, or ApplicationLauncherConfig - NavigationModule: Use ApplicationLauncherModule or VerticalNavigationModule
- Loading branch information
Showing
18 changed files
with
205 additions
and
113 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
src/app/navigation/application-launcher/application-launcher-config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { NavigationConfigBase } from '../navigation-config-base'; | ||
|
||
/** | ||
* A config containing properties for application launcher items | ||
*/ | ||
export class ApplicationLauncherConfig extends NavigationConfigBase {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/app/navigation/application-launcher/application-launcher.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { CommonModule } from '@angular/common'; | ||
import { NgModule } from '@angular/core'; | ||
|
||
import { BsDropdownConfig, BsDropdownModule } from 'ngx-bootstrap/dropdown'; | ||
|
||
import { ApplicationLauncherComponent } from './application-launcher.component'; | ||
|
||
/** | ||
* A module containing objects associated with the navigation components | ||
*/ | ||
@NgModule({ | ||
imports: [ | ||
BsDropdownModule.forRoot(), | ||
CommonModule | ||
], | ||
declarations: [ApplicationLauncherComponent], | ||
exports: [ApplicationLauncherComponent], | ||
providers: [BsDropdownConfig] | ||
}) | ||
export class ApplicationLauncherModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export { ApplicationLauncherComponent } from './application-launcher.component'; | ||
export { ApplicationLauncherConfig } from './application-launcher-config'; | ||
export { ApplicationLauncherModule } from './application-launcher.module'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
export { NavigationItemConfig } from './navigation-item-config'; | ||
export { NavigationModule } from './navigation.module'; | ||
export { VerticalNavigationComponent } from './vertical-navigation/vertical-navigation.component'; | ||
export { ApplicationLauncherComponent } from './application-launcher/application-launcher.component'; | ||
export { NavigationConfigBase } from './navigation-config-base'; | ||
export { NavigationItemConfig } from './navigation-item-config'; // @deprecated | ||
export { NavigationModule } from './navigation.module'; // @deprecated | ||
|
||
export * from './application-launcher/index'; | ||
export * from './vertical-navigation/index'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/** | ||
* A config containing properties for navigation items | ||
*/ | ||
export class NavigationConfigBase { | ||
/** | ||
* Title for the navigation item | ||
*/ | ||
title: string; | ||
|
||
/** | ||
* The icon class to use for icons displayed to the left of text | ||
*/ | ||
iconStyleClass?: string; | ||
|
||
/** | ||
* Link to navigate to | ||
*/ | ||
url?: string; | ||
|
||
/** | ||
* Badges to display information about the navigation item | ||
*/ | ||
badges?: any[]; | ||
|
||
/** | ||
* Navigation children (used for secondary and tertiary navigation) | ||
*/ | ||
children?: NavigationConfigBase[]; | ||
|
||
/** | ||
* Indicate if the item should be active on load | ||
*/ | ||
activeOnLoad?: boolean; | ||
|
||
/** | ||
* Track the active state of the navigation item | ||
*/ | ||
trackActiveState?: boolean; | ||
|
||
/** | ||
* Track the hover state of the navigation item | ||
*/ | ||
trackHoverState?: boolean; | ||
|
||
/** | ||
* Indicates if the child secondary menu is opened | ||
*/ | ||
secondaryCollapsed?: boolean; | ||
|
||
/** | ||
* Indicates if the child tertiary menu is opened | ||
*/ | ||
tertiaryCollapsed?: boolean; | ||
|
||
/** | ||
* Indicates if this is a mobile item | ||
*/ | ||
mobileItem?: boolean; | ||
|
||
/** | ||
* Internal variable used for hovering timeout | ||
*/ | ||
hoverTimeout?: any; | ||
|
||
/** | ||
* Internal variable used for blur timeout | ||
*/ | ||
blurTimeout?: any; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,15 @@ | ||
import { NavigationConfigBase } from './navigation-config-base'; | ||
import {VerticalNavigationConfig} from './vertical-navigation/vertical-navigation-config'; | ||
|
||
/** | ||
* A config containing properties for navigation items | ||
* | ||
* @deprecated Use NavigationConfigBase | ||
*/ | ||
export class NavigationItemConfig { | ||
|
||
/** | ||
* Title for the navigation item | ||
*/ | ||
title: string; | ||
|
||
/** | ||
* The icon class to use for icons displayed to the left of text | ||
*/ | ||
iconStyleClass?: string; | ||
|
||
/** | ||
* Link to navigate to | ||
*/ | ||
url?: string; | ||
|
||
/** | ||
* Badges to display information about the navigation item | ||
*/ | ||
badges?: any[]; | ||
|
||
/** | ||
* Navigation children (used for secondary and tertiary navigation) | ||
*/ | ||
children?: NavigationItemConfig[]; | ||
|
||
/** | ||
* Indicate if the item should be active on load | ||
*/ | ||
activeOnLoad?: boolean; | ||
|
||
/** | ||
* Track the active state of the navigation item | ||
*/ | ||
trackActiveState?: boolean; | ||
|
||
/** | ||
* Track the hover state of the navigation item | ||
*/ | ||
trackHoverState?: boolean; | ||
|
||
/** | ||
* Indicates if the child secondary menu is opened | ||
*/ | ||
secondaryCollapsed?: boolean; | ||
|
||
/** | ||
* Indicates if the child tertiary menu is opened | ||
*/ | ||
tertiaryCollapsed?: boolean; | ||
|
||
/** | ||
* Indicates if this is a mobile item | ||
*/ | ||
mobileItem?: boolean; | ||
|
||
/** | ||
* Internal variable used for hovering timeout | ||
*/ | ||
hoverTimeout?: any; | ||
|
||
/** | ||
* Internal variable used for blur timeout | ||
*/ | ||
blurTimeout?: any; | ||
export class NavigationItemConfig extends NavigationConfigBase { | ||
constructor() { | ||
super(); | ||
console.log('patternfly-ng: NavigationItemConfig is deprecated; use NavigationConfigBase, ' + | ||
'ApplicationLauncherConfig, or VerticalNavigationConfig'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
src/app/navigation/vertical-navigation/example/vertical-navigation-example.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export { VerticalNavigationComponent } from './vertical-navigation.component'; | ||
export { VerticalNavigationConfig } from './vertical-navigation-config'; | ||
export { VerticalNavigationModule } from './vertical-navigation.module'; |
6 changes: 6 additions & 0 deletions
6
src/app/navigation/vertical-navigation/vertical-navigation-config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { NavigationConfigBase } from '../navigation-config-base'; | ||
|
||
/** | ||
* A config containing properties for vertical navigation items | ||
*/ | ||
export class VerticalNavigationConfig extends NavigationConfigBase {} |
Oops, something went wrong.