OpenSlides/client/src/app/shared/shared.module.ts

150 lines
4.8 KiB
TypeScript
Raw Normal View History

import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { CommonModule } from '@angular/common';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
// MaterialUI modules
import {
MatButtonModule,
MatCheckboxModule,
MatToolbarModule,
MatCardModule,
MatInputModule,
MatProgressSpinnerModule,
MatSidenavModule,
2018-08-08 17:25:39 +02:00
MatSnackBarModule,
MatTableModule,
2018-08-09 13:27:04 +02:00
MatPaginatorModule,
2018-09-18 18:27:14 +02:00
MatSortModule,
MatTooltipModule,
MatDatepickerModule,
MatNativeDateModule,
DateAdapter,
2018-09-30 18:43:20 +02:00
MatIconModule,
MatButtonToggleModule
} from '@angular/material';
import { MatAutocompleteModule } from '@angular/material/autocomplete';
import { MatChipsModule } from '@angular/material';
2018-09-30 18:43:20 +02:00
import { MatRadioModule } from '@angular/material';
import { NgxMatSelectSearchModule } from 'ngx-mat-select-search';
import { MatDialogModule } from '@angular/material/dialog';
import { MatListModule } from '@angular/material/list';
import { MatExpansionModule } from '@angular/material/expansion';
import { MatMenuModule } from '@angular/material/menu';
2018-08-16 17:03:39 +02:00
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatSelectModule } from '@angular/material/select';
// ngx-translate
import { TranslateModule } from '@ngx-translate/core';
// directives
import { PermsDirective } from './directives/perms.directive';
import { DomChangeDirective } from './directives/dom-change.directive';
// components
import { HeadBarComponent } from './components/head-bar/head-bar.component';
import { FooterComponent } from './components/footer/footer.component';
import { LegalNoticeContentComponent } from './components/legal-notice-content/legal-notice-content.component';
import { PrivacyPolicyContentComponent } from './components/privacy-policy-content/privacy-policy-content.component';
import { SearchValueSelectorComponent } from './components/search-value-selector/search-value-selector.component';
import { OpenSlidesDateAdapter } from './date-adapter';
2018-10-01 15:36:16 +02:00
import { PromptDialogComponent } from './components/prompt-dialog/prompt-dialog.component';
/**
* Share Module for all "dumb" components and pipes.
*
* These components don not import and inject services from core or other features
* in their constructors.
*
* Should receive all data though attributes in the template of the component using them.
* No dependency to the rest of our application.
*/
@NgModule({
imports: [
CommonModule,
FormsModule,
2018-08-16 17:03:39 +02:00
MatFormFieldModule,
MatSelectModule,
ReactiveFormsModule,
MatAutocompleteModule,
MatButtonModule,
MatCheckboxModule,
MatToolbarModule,
MatDatepickerModule,
MatNativeDateModule,
MatCardModule,
MatInputModule,
2018-08-08 17:25:39 +02:00
MatTableModule,
2018-08-09 13:27:04 +02:00
MatSortModule,
2018-08-08 17:25:39 +02:00
MatPaginatorModule,
MatProgressSpinnerModule,
MatSidenavModule,
MatListModule,
MatExpansionModule,
MatMenuModule,
MatDialogModule,
MatSnackBarModule,
MatChipsModule,
2018-09-18 18:27:14 +02:00
MatTooltipModule,
// TODO: there is an error with missing icons
// we either wait or include a fixed version manually (dirty)
// https://github.com/google/material-design-icons/issues/786
MatIconModule,
2018-09-30 18:43:20 +02:00
MatRadioModule,
MatButtonToggleModule,
TranslateModule.forChild(),
RouterModule,
NgxMatSelectSearchModule
],
exports: [
FormsModule,
MatAutocompleteModule,
2018-08-16 17:03:39 +02:00
MatFormFieldModule,
MatSelectModule,
ReactiveFormsModule,
MatButtonModule,
MatCheckboxModule,
MatToolbarModule,
MatCardModule,
MatDatepickerModule,
MatInputModule,
2018-08-08 17:25:39 +02:00
MatTableModule,
2018-08-09 13:27:04 +02:00
MatSortModule,
2018-08-08 17:25:39 +02:00
MatPaginatorModule,
MatProgressSpinnerModule,
MatSidenavModule,
MatListModule,
MatExpansionModule,
MatMenuModule,
MatDialogModule,
MatSnackBarModule,
MatChipsModule,
2018-09-18 18:27:14 +02:00
MatTooltipModule,
MatIconModule,
2018-09-30 18:43:20 +02:00
MatRadioModule,
MatButtonToggleModule,
NgxMatSelectSearchModule,
TranslateModule,
PermsDirective,
DomChangeDirective,
FooterComponent,
HeadBarComponent,
SearchValueSelectorComponent,
LegalNoticeContentComponent,
2018-10-01 15:36:16 +02:00
PrivacyPolicyContentComponent,
PromptDialogComponent
],
declarations: [
PermsDirective,
DomChangeDirective,
HeadBarComponent,
FooterComponent,
LegalNoticeContentComponent,
PrivacyPolicyContentComponent,
2018-10-01 15:36:16 +02:00
SearchValueSelectorComponent,
PromptDialogComponent
],
providers: [{ provide: DateAdapter, useClass: OpenSlidesDateAdapter }]
})
export class SharedModule {}