feat: update to Angular 8, Nebular 4 (#2114)

This commit is contained in:
Dmitry Nehaychik 2019-07-02 16:18:09 +03:00 committed by Sergey Andrievskiy
parent 537e6a77b0
commit e9600b4a07
323 changed files with 7421 additions and 14161 deletions

View file

@ -1,56 +1,26 @@
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,
NbPopoverModule,
NbContextMenuModule,
NbProgressBarModule,
NbCalendarModule,
NbCalendarRangeModule,
NbStepperModule,
NbButtonModule,
NbInputModule,
NbAccordionModule,
NbDatepickerModule,
NbDialogModule,
NbWindowModule,
NbListModule,
NbToastrModule,
NbAlertModule,
NbSpinnerModule,
NbRadioModule,
NbSelectModule,
NbChatModule,
NbTooltipModule,
NbCalendarKitModule,
NbIconModule,
NbThemeModule,
} from '@nebular/theme';
import { NbEvaIconsModule } from '@nebular/eva-icons';
import { NbSecurityModule } from '@nebular/security';
import {
FooterComponent,
HeaderComponent,
SearchInputComponent,
ThemeSettingsComponent,
SwitcherComponent,
LayoutDirectionSwitcherComponent,
ThemeSwitcherComponent,
TinyMCEComponent,
ThemeSwitcherListComponent,
ToggleSettingsButtonComponent,
} from './components';
import {
CapitalizePipe,
@ -58,115 +28,67 @@ import {
RoundPipe,
TimingPipe,
NumberWithCommasPipe,
EvaIconsPipe,
} from './pipes';
import {
OneColumnLayoutComponent,
SampleLayoutComponent,
ThreeColumnsLayoutComponent,
TwoColumnsLayoutComponent,
} from './layouts';
import { WindowModeBlockScrollService } from './services/window-mode-block-scroll.service';
import { DEFAULT_THEME } from './styles/theme.default';
import { COSMIC_THEME } from './styles/theme.cosmic';
import { CORPORATE_THEME } from './styles/theme.corporate';
const BASE_MODULES = [CommonModule, FormsModule, ReactiveFormsModule];
import { DARK_THEME } from './styles/theme.dark';
const NB_MODULES = [
NbCardModule,
NbLayoutModule,
NbTabsetModule,
NbRouteTabsetModule,
NbMenuModule,
NbUserModule,
NbActionsModule,
NbSearchModule,
NbSidebarModule,
NbCheckboxModule,
NbPopoverModule,
NbContextMenuModule,
NgbModule,
NbSecurityModule, // *nbIsGranted directive,
NbProgressBarModule,
NbCalendarModule,
NbCalendarRangeModule,
NbStepperModule,
NbSecurityModule,
NbButtonModule,
NbListModule,
NbToastrModule,
NbInputModule,
NbAccordionModule,
NbDatepickerModule,
NbDialogModule,
NbWindowModule,
NbAlertModule,
NbSpinnerModule,
NbRadioModule,
NbSelectModule,
NbChatModule,
NbTooltipModule,
NbCalendarKitModule,
NbIconModule,
NbEvaIconsModule,
];
const COMPONENTS = [
SwitcherComponent,
LayoutDirectionSwitcherComponent,
ThemeSwitcherComponent,
ThemeSwitcherListComponent,
HeaderComponent,
FooterComponent,
SearchInputComponent,
ThemeSettingsComponent,
TinyMCEComponent,
OneColumnLayoutComponent,
SampleLayoutComponent,
ThreeColumnsLayoutComponent,
TwoColumnsLayoutComponent,
ToggleSettingsButtonComponent,
];
const ENTRY_COMPONENTS = [
ThemeSwitcherListComponent,
];
const PIPES = [
CapitalizePipe,
PluralPipe,
RoundPipe,
TimingPipe,
NumberWithCommasPipe,
EvaIconsPipe,
];
const NB_THEME_PROVIDERS = [
...NbThemeModule.forRoot(
{
name: 'cosmic',
},
[ DEFAULT_THEME, COSMIC_THEME, CORPORATE_THEME ],
).providers,
...NbSidebarModule.forRoot().providers,
...NbMenuModule.forRoot().providers,
...NbDatepickerModule.forRoot().providers,
...NbDialogModule.forRoot().providers,
...NbWindowModule.forRoot().providers,
...NbToastrModule.forRoot().providers,
...NbChatModule.forRoot({
messageGoogleMapKey: 'AIzaSyA_wNuCzia92MAmdLRzmqitRGvCF7wCZPY',
}).providers,
];
@NgModule({
imports: [...BASE_MODULES, ...NB_MODULES],
exports: [...BASE_MODULES, ...NB_MODULES, ...COMPONENTS, ...PIPES],
imports: [CommonModule, ...NB_MODULES],
exports: [CommonModule, ...PIPES, ...COMPONENTS],
declarations: [...COMPONENTS, ...PIPES],
entryComponents: [...ENTRY_COMPONENTS],
})
export class ThemeModule {
static forRoot(): ModuleWithProviders {
return <ModuleWithProviders>{
ngModule: ThemeModule,
providers: [...NB_THEME_PROVIDERS],
providers: [
...NbThemeModule.forRoot(
{
name: 'default',
},
[ DEFAULT_THEME, COSMIC_THEME, CORPORATE_THEME, DARK_THEME ],
).providers,
WindowModeBlockScrollService,
],
};
}
}