next-ucap-messenger/projects/ucap-webmessenger-ui/src/lib/ucap-ui.module.ts

99 lines
3.4 KiB
TypeScript
Raw Normal View History

import { MatTooltipModule } from '@angular/material/tooltip';
2019-09-18 06:02:21 +00:00
import { NgModule, ModuleWithProviders } from '@angular/core';
import { CommonModule } from '@angular/common';
2019-10-21 04:36:58 +00:00
import { FlexLayoutModule } from '@angular/flex-layout';
2019-09-18 06:02:21 +00:00
import { MatButtonModule } from '@angular/material/button';
import { MatCardModule } from '@angular/material/card';
import { MatDialogModule } from '@angular/material/dialog';
2019-10-21 04:36:58 +00:00
import { MatIconModule } from '@angular/material/icon';
2019-10-29 09:18:16 +00:00
import { MatProgressBarModule } from '@angular/material/progress-bar';
2019-10-16 09:05:18 +00:00
import { MatSnackBarModule } from '@angular/material/snack-bar';
2019-11-06 04:48:06 +00:00
import { MatToolbarModule } from '@angular/material/toolbar';
2019-09-18 06:02:21 +00:00
2019-09-24 05:53:22 +00:00
import { DragDropModule } from '@angular/cdk/drag-drop';
import { FileUploadQueueComponent } from './components/file-upload-queue.component';
import { FloatActionButtonComponent } from './components/float-action-button.component';
import { FileViewerComponent } from './components/file-viewer.component';
import { BinaryViewerComponent } from './components/file-viewer/binary-viewer.component';
import { DocumentViewerComponent } from './components/file-viewer/document-viewer.component';
import { ImageViewerComponent } from './components/file-viewer/image-viewer.component';
import { SoundViewerComponent } from './components/file-viewer/sound-viewer.component';
import { VideoViewerComponent } from './components/file-viewer/video-viewer.component';
2019-10-17 07:57:37 +00:00
2019-09-18 06:02:21 +00:00
import { BottomSheetService } from './services/bottom-sheet.service';
2019-10-16 09:05:18 +00:00
import { ClipboardService } from './services/clipboard.service';
2019-09-18 06:02:21 +00:00
import { DialogService } from './services/dialog.service';
2019-10-16 09:05:18 +00:00
import { SnackBarService } from './services/snack-bar.service';
2019-09-18 06:02:21 +00:00
2019-10-25 06:56:03 +00:00
import { ClickOutsideDirective } from './directives/click-outside.directive';
2019-10-21 04:36:58 +00:00
import { FileUploadForDirective } from './directives/file-upload-for.directive';
import { ImageDirective } from './directives/image.directive';
2019-10-21 04:36:58 +00:00
2019-09-18 06:02:21 +00:00
import { AlertDialogComponent } from './dialogs/alert.dialog.component';
import { ConfirmDialogComponent } from './dialogs/confirm.dialog.component';
2019-10-21 04:36:58 +00:00
import { BytesPipe } from './pipes/bytes.pipe';
import { LinefeedToHtmlPipe, HtmlToLinefeedPipe } from './pipes/linefeed.pipe';
import { DateToStringForChatRoomListPipe } from './pipes/dates.pipe';
const COMPONENTS = [
FileUploadQueueComponent,
FloatActionButtonComponent,
FileViewerComponent,
BinaryViewerComponent,
DocumentViewerComponent,
ImageViewerComponent,
SoundViewerComponent,
VideoViewerComponent
];
const DIALOGS = [AlertDialogComponent, ConfirmDialogComponent];
2019-10-25 06:56:03 +00:00
const DIRECTIVES = [
ClickOutsideDirective,
FileUploadForDirective,
ImageDirective
];
const PIPES = [
BytesPipe,
LinefeedToHtmlPipe,
HtmlToLinefeedPipe,
DateToStringForChatRoomListPipe
];
const SERVICES = [
BottomSheetService,
ClipboardService,
DialogService,
SnackBarService
];
2019-10-17 07:57:37 +00:00
2019-09-18 06:02:21 +00:00
@NgModule({
2019-09-24 05:53:22 +00:00
imports: [
CommonModule,
2019-10-21 04:36:58 +00:00
FlexLayoutModule,
2019-09-24 05:53:22 +00:00
MatButtonModule,
MatCardModule,
MatDialogModule,
2019-10-21 04:36:58 +00:00
MatIconModule,
2019-10-29 09:18:16 +00:00
MatProgressBarModule,
2019-10-16 09:05:18 +00:00
MatSnackBarModule,
2019-11-06 04:48:06 +00:00
MatToolbarModule,
MatTooltipModule,
2019-09-24 05:53:22 +00:00
DragDropModule
],
2019-10-21 04:36:58 +00:00
exports: [...COMPONENTS, ...DIRECTIVES, ...PIPES],
declarations: [...COMPONENTS, ...DIALOGS, ...DIRECTIVES, ...PIPES],
2019-09-18 06:02:21 +00:00
entryComponents: [...DIALOGS]
})
export class UCapUiModule {
public static forRoot(): ModuleWithProviders<UCapUiModule> {
return {
ngModule: UCapUiModule,
providers: [...SERVICES]
};
}
}