diff options
Diffstat (limited to 'webapp/src/app/@theme/theme.module.ts')
-rw-r--r-- | webapp/src/app/@theme/theme.module.ts | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/webapp/src/app/@theme/theme.module.ts b/webapp/src/app/@theme/theme.module.ts new file mode 100644 index 0000000..d786226 --- /dev/null +++ b/webapp/src/app/@theme/theme.module.ts @@ -0,0 +1,99 @@ +import { ModuleWithProviders, NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; + +import { + NbActionsModule, + NbCardModule, + NbLayoutModule, + NbMenuModule, + NbRouteTabsetModule, + NbSearchModule, + NbSidebarModule, + NbTabsetModule, + NbThemeModule, + NbUserModule, + NbCheckboxModule, +} from '@nebular/theme'; + +import { + FooterComponent, + HeaderComponent, + SearchInputComponent, + ThemeSettingsComponent, + ThemeSwitcherComponent, + // XDS_MODS TinyMCEComponent, +} from './components'; +import { CapitalizePipe, PluralPipe, RoundPipe, TimingPipe } from './pipes'; +import { + OneColumnLayoutComponent, + SampleLayoutComponent, + XdsLayoutComponent, // XDS_MODS + ThreeColumnsLayoutComponent, + TwoColumnsLayoutComponent, +} from './layouts'; +import { DEFAULT_THEME } from './styles/theme.default'; +import { COSMIC_THEME } from './styles/theme.cosmic'; + +const BASE_MODULES = [CommonModule, FormsModule, ReactiveFormsModule]; + +const NB_MODULES = [ + NbCardModule, + NbLayoutModule, + NbTabsetModule, + NbRouteTabsetModule, + NbMenuModule, + NbUserModule, + NbActionsModule, + NbSearchModule, + NbSidebarModule, + NbCheckboxModule, + NgbModule, +]; + +const COMPONENTS = [ + ThemeSwitcherComponent, + HeaderComponent, + FooterComponent, + SearchInputComponent, + ThemeSettingsComponent, + // XDS_MODS TinyMCEComponent, + OneColumnLayoutComponent, + SampleLayoutComponent, + XdsLayoutComponent, // XDS_MODS + ThreeColumnsLayoutComponent, + TwoColumnsLayoutComponent, +]; + +const PIPES = [ + CapitalizePipe, + PluralPipe, + RoundPipe, + TimingPipe, +]; + +const NB_THEME_PROVIDERS = [ + ...NbThemeModule.forRoot( + { + name: 'default', // XDS_MODS + }, + [ DEFAULT_THEME, COSMIC_THEME ], + ).providers, + ...NbSidebarModule.forRoot().providers, + ...NbMenuModule.forRoot().providers, +]; + +@NgModule({ + imports: [...BASE_MODULES, ...NB_MODULES], + exports: [...BASE_MODULES, ...NB_MODULES, ...COMPONENTS, ...PIPES], + declarations: [...COMPONENTS, ...PIPES], +}) +export class ThemeModule { + static forRoot(): ModuleWithProviders { + return <ModuleWithProviders>{ + ngModule: ThemeModule, + providers: [...NB_THEME_PROVIDERS], + }; + } +} |