thingsboard/ui-ngx/src/app/shared/shared.module.ts

453 lines
18 KiB
TypeScript
Raw Normal View History

///
2021-01-11 13:42:16 +02:00
/// Copyright © 2016-2021 The Thingsboard Authors
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
2021-08-19 18:52:39 +03:00
import { NgModule, SecurityContext } from '@angular/core';
import { CommonModule, DatePipe } from '@angular/common';
2020-02-11 10:35:05 +02:00
import { FooterComponent } from '@shared/components/footer.component';
import { LogoComponent } from '@shared/components/logo.component';
import { TbSnackBarComponent, ToastDirective } from '@shared/components/toast.directive';
import { BreadcrumbComponent } from '@shared/components/breadcrumb.component';
import { FlowInjectionToken, NgxFlowModule } from '@flowjs/ngx-flow';
2020-02-18 19:01:21 +02:00
import { NgxFlowchartModule } from 'ngx-flowchart/dist/ngx-flowchart';
import Flow from '@flowjs/flow.js';
2020-02-10 13:15:29 +02:00
import { MatAutocompleteModule } from '@angular/material/autocomplete';
import { MatButtonModule } from '@angular/material/button';
import { MatCardModule } from '@angular/material/card';
import { MatCheckboxModule } from '@angular/material/checkbox';
import { MatChipsModule } from '@angular/material/chips';
import { MatDatepickerModule } from '@angular/material/datepicker';
import { MatDialogModule } from '@angular/material/dialog';
import { MatDividerModule } from '@angular/material/divider';
import { MatExpansionModule } from '@angular/material/expansion';
import { MatGridListModule } from '@angular/material/grid-list';
import { MatIconModule } from '@angular/material/icon';
import { MatInputModule } from '@angular/material/input';
import { MatMenuModule } from '@angular/material/menu';
import { MatPaginatorModule } from '@angular/material/paginator';
import { MatProgressBarModule } from '@angular/material/progress-bar';
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
import { MatRadioModule } from '@angular/material/radio';
import { MatSelectModule } from '@angular/material/select';
import { MatSidenavModule } from '@angular/material/sidenav';
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
import { MatSliderModule } from '@angular/material/slider';
import { MatSnackBarModule } from '@angular/material/snack-bar';
import { MatSortModule } from '@angular/material/sort';
import { MatStepperModule } from '@angular/material/stepper';
import { MatTableModule } from '@angular/material/table';
import { MatTabsModule } from '@angular/material/tabs';
import { MatToolbarModule } from '@angular/material/toolbar';
import { MatTooltipModule } from '@angular/material/tooltip';
2021-03-02 12:04:45 +02:00
import { MatListModule } from '@angular/material/list';
import { MatDatetimepickerModule, MatNativeDatetimeModule } from '@mat-datetimepicker/core';
import { NgxDaterangepickerMd } from 'ngx-daterangepicker-material';
import { GridsterModule } from 'angular-gridster2';
import { FlexLayoutModule } from '@angular/flex-layout';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
2020-08-17 13:22:57 +03:00
import { ShareModule as ShareButtonsModule } from 'ngx-sharebuttons';
import { HotkeyModule } from 'angular2-hotkeys';
import { ColorPickerModule } from 'ngx-color-picker';
import { NgxHmCarouselModule } from 'ngx-hm-carousel';
import { UserMenuComponent } from '@shared/components/user-menu.component';
2020-02-11 10:35:05 +02:00
import { NospacePipe } from '@shared/pipe/nospace.pipe';
import { TranslateModule } from '@ngx-translate/core';
import { TbCheckboxComponent } from '@shared/components/tb-checkbox.component';
import { HelpComponent } from '@shared/components/help.component';
import { TbAnchorComponent } from '@shared/components/tb-anchor.component';
import { MillisecondsToTimeStringPipe } from '@shared/pipe/milliseconds-to-time-string.pipe';
import { TimewindowComponent } from '@shared/components/time/timewindow.component';
import { OverlayModule } from '@angular/cdk/overlay';
import { TimewindowPanelComponent } from '@shared/components/time/timewindow-panel.component';
import { TimeintervalComponent } from '@shared/components/time/timeinterval.component';
import { DatetimePeriodComponent } from '@shared/components/time/datetime-period.component';
import { EnumToArrayPipe } from '@shared/pipe/enum-to-array.pipe';
import { ClipboardModule } from 'ngx-clipboard';
2019-08-29 20:04:59 +03:00
import { ValueInputComponent } from '@shared/components/value-input.component';
2021-08-19 18:52:39 +03:00
import { MarkdownModule, MarkedOptions } from 'ngx-markdown';
import { FullscreenDirective } from '@shared/components/fullscreen.directive';
import { HighlightPipe } from '@shared/pipe/highlight.pipe';
import { DashboardAutocompleteComponent } from '@shared/components/dashboard-autocomplete.component';
import { EntitySubTypeAutocompleteComponent } from '@shared/components/entity/entity-subtype-autocomplete.component';
2020-02-11 10:35:05 +02:00
import { EntitySubTypeSelectComponent } from '@shared/components/entity/entity-subtype-select.component';
import { EntityAutocompleteComponent } from '@shared/components/entity/entity-autocomplete.component';
import { EntityListComponent } from '@shared/components/entity/entity-list.component';
2020-02-11 10:35:05 +02:00
import { EntityTypeSelectComponent } from '@shared/components/entity/entity-type-select.component';
import { EntitySelectComponent } from '@shared/components/entity/entity-select.component';
import { DatetimeComponent } from '@shared/components/time/datetime.component';
2020-02-11 10:35:05 +02:00
import { EntityKeysListComponent } from '@shared/components/entity/entity-keys-list.component';
import { SocialSharePanelComponent } from '@shared/components/socialshare-panel.component';
2019-08-27 20:07:09 +03:00
import { RelationTypeAutocompleteComponent } from '@shared/components/relation/relation-type-autocomplete.component';
2020-02-11 10:35:05 +02:00
import { EntityListSelectComponent } from '@shared/components/entity/entity-list-select.component';
import { JsonObjectEditComponent } from '@shared/components/json-object-edit.component';
2019-09-03 19:31:16 +03:00
import { FooterFabButtonsComponent } from '@shared/components/footer-fab-buttons.component';
2020-02-11 10:35:05 +02:00
import { CircularProgressDirective } from '@shared/components/circular-progress.directive';
import {
FabActionsDirective,
FabToolbarComponent,
FabTriggerDirective
} from '@shared/components/fab-toolbar.component';
import { DashboardSelectPanelComponent } from '@shared/components/dashboard-select-panel.component';
import { DashboardSelectComponent } from '@shared/components/dashboard-select.component';
2020-02-11 10:35:05 +02:00
import { WidgetsBundleSelectComponent } from '@shared/components/widgets-bundle-select.component';
import { KeyboardShortcutPipe } from '@shared/pipe/keyboard-shortcut.pipe';
import { TbErrorComponent } from '@shared/components/tb-error.component';
import { EntityTypeListComponent } from '@shared/components/entity/entity-type-list.component';
import { EntitySubTypeListComponent } from '@shared/components/entity/entity-subtype-list.component';
import { TruncatePipe } from '@shared/pipe/truncate.pipe';
import { TbJsonPipe } from '@shared/pipe/tbJson.pipe';
2020-02-11 10:35:05 +02:00
import { ColorPickerDialogComponent } from '@shared/components/dialog/color-picker-dialog.component';
import { MatChipDraggableDirective } from '@shared/components/mat-chip-draggable.directive';
import { ColorInputComponent } from '@shared/components/color-input.component';
import { JsFuncComponent } from '@shared/components/js-func.component';
import { JsonFormComponent } from '@shared/components/json-form/json-form.component';
2020-02-11 10:56:43 +02:00
import { ConfirmDialogComponent } from '@shared/components/dialog/confirm-dialog.component';
import { AlertDialogComponent } from '@shared/components/dialog/alert-dialog.component';
import { TodoDialogComponent } from '@shared/components/dialog/todo-dialog.component';
2019-10-24 19:52:19 +03:00
import { MaterialIconsDialogComponent } from '@shared/components/dialog/material-icons-dialog.component';
import { MaterialIconSelectComponent } from '@shared/components/material-icon-select.component';
2020-02-11 10:35:05 +02:00
import { ImageInputComponent } from '@shared/components/image-input.component';
import { FileInputComponent } from '@shared/components/file-input.component';
2019-12-24 16:27:09 +02:00
import { NodeScriptTestDialogComponent } from '@shared/components/dialog/node-script-test-dialog.component';
2020-02-11 10:35:05 +02:00
import { MessageTypeAutocompleteComponent } from '@shared/components/message-type-autocomplete.component';
import { JsonContentComponent } from '@shared/components/json-content.component';
import { KeyValMapComponent } from '@shared/components/kv-map.component';
import { TbCheatSheetComponent } from '@shared/components/cheatsheet.component';
import { TbHotkeysDirective } from '@shared/components/hotkeys.directive';
2020-01-31 20:26:08 +02:00
import { NavTreeComponent } from '@shared/components/nav-tree.component';
2020-02-03 17:29:01 +02:00
import { LedLightComponent } from '@shared/components/led-light.component';
import { TbJsonToStringDirective } from '@shared/components/directives/tb-json-to-string.directive';
import { JsonObjectEditDialogComponent } from '@shared/components/dialog/json-object-edit-dialog.component';
import { HistorySelectorComponent } from './components/time/history-selector/history-selector.component';
import { EntityGatewaySelectComponent } from '@shared/components/entity/entity-gateway-select.component';
2021-03-02 12:04:45 +02:00
import { DndModule } from 'ngx-drag-drop';
import { QueueTypeListComponent } from '@shared/components/queue/queue-type-list.component';
import { ContactComponent } from '@shared/components/contact.component';
import { TimezoneSelectComponent } from '@shared/components/time/timezone-select.component';
import { FileSizePipe } from '@shared/pipe/file-size.pipe';
2021-03-03 15:41:47 +02:00
import { WidgetsBundleSearchComponent } from '@shared/components/widgets-bundle-search.component';
2021-03-12 12:15:35 +02:00
import { SelectableColumnsPipe } from '@shared/pipe/selectable-columns.pipe';
import { QuickTimeIntervalComponent } from '@shared/components/time/quick-time-interval.component';
2021-05-31 18:15:31 +03:00
import { OtaPackageAutocompleteComponent } from '@shared/components/ota-package/ota-package-autocomplete.component';
import { MAT_DATE_LOCALE } from '@angular/material/core';
2021-06-04 20:49:01 +03:00
import { CopyButtonComponent } from '@shared/components/button/copy-button.component';
import { TogglePasswordComponent } from '@shared/components/button/toggle-password.component';
import { HelpPopupComponent } from '@shared/components/help-popup.component';
import { TbPopoverComponent, TbPopoverDirective, TbPopoverService } from '@shared/components/popover.component';
import { TbStringTemplateOutletDirective } from '@shared/components/directives/sring-template-outlet.directive';
import { TbComponentOutletDirective} from '@shared/components/directives/component-outlet.directive';
import { HelpMarkdownComponent } from '@shared/components/help-markdown.component';
import { MarkedOptionsService } from '@shared/components/marked-options.service';
@NgModule({
providers: [
DatePipe,
2019-08-12 19:34:23 +03:00
MillisecondsToTimeStringPipe,
EnumToArrayPipe,
HighlightPipe,
TruncatePipe,
TbJsonPipe,
FileSizePipe,
{
provide: FlowInjectionToken,
useValue: Flow
},
{
provide: MAT_DATE_LOCALE,
useValue: 'en-GB'
},
TbPopoverService
],
declarations: [
FooterComponent,
LogoComponent,
2019-09-03 19:31:16 +03:00
FooterFabButtonsComponent,
ToastDirective,
FullscreenDirective,
CircularProgressDirective,
MatChipDraggableDirective,
TbHotkeysDirective,
TbAnchorComponent,
TbPopoverComponent,
TbStringTemplateOutletDirective,
TbComponentOutletDirective,
TbPopoverDirective,
HelpComponent,
HelpMarkdownComponent,
HelpPopupComponent,
TbCheckboxComponent,
TbSnackBarComponent,
TbErrorComponent,
TbCheatSheetComponent,
BreadcrumbComponent,
UserMenuComponent,
2019-08-12 19:34:23 +03:00
TimewindowComponent,
TimewindowPanelComponent,
TimeintervalComponent,
QuickTimeIntervalComponent,
DashboardSelectComponent,
DashboardSelectPanelComponent,
2019-08-12 19:34:23 +03:00
DatetimePeriodComponent,
2019-08-19 20:09:41 +03:00
DatetimeComponent,
TimezoneSelectComponent,
2019-08-29 20:04:59 +03:00
ValueInputComponent,
2019-08-12 19:34:23 +03:00
DashboardAutocompleteComponent,
2019-08-13 19:58:35 +03:00
EntitySubTypeAutocompleteComponent,
EntitySubTypeSelectComponent,
EntitySubTypeListComponent,
2019-08-14 19:55:24 +03:00
EntityAutocompleteComponent,
2019-08-15 20:39:56 +03:00
EntityListComponent,
2019-08-19 20:09:41 +03:00
EntityTypeSelectComponent,
EntitySelectComponent,
EntityKeysListComponent,
2019-08-27 20:07:09 +03:00
EntityListSelectComponent,
EntityTypeListComponent,
QueueTypeListComponent,
2019-08-27 20:07:09 +03:00
RelationTypeAutocompleteComponent,
SocialSharePanelComponent,
2019-08-27 20:07:09 +03:00
JsonObjectEditComponent,
2019-12-27 16:35:11 +02:00
JsonContentComponent,
JsFuncComponent,
FabTriggerDirective,
FabActionsDirective,
FabToolbarComponent,
WidgetsBundleSelectComponent,
2020-02-11 10:56:43 +02:00
ConfirmDialogComponent,
AlertDialogComponent,
TodoDialogComponent,
ColorPickerDialogComponent,
2019-10-24 19:52:19 +03:00
MaterialIconsDialogComponent,
ColorInputComponent,
2019-10-24 19:52:19 +03:00
MaterialIconSelectComponent,
2019-12-24 16:27:09 +02:00
NodeScriptTestDialogComponent,
JsonFormComponent,
ImageInputComponent,
2019-11-08 14:17:15 +02:00
FileInputComponent,
2019-12-27 16:35:11 +02:00
MessageTypeAutocompleteComponent,
KeyValMapComponent,
2020-01-31 20:26:08 +02:00
NavTreeComponent,
2020-02-03 17:29:01 +02:00
LedLightComponent,
NospacePipe,
2019-08-12 19:34:23 +03:00
MillisecondsToTimeStringPipe,
EnumToArrayPipe,
2019-09-25 19:37:29 +03:00
HighlightPipe,
TruncatePipe,
TbJsonPipe,
FileSizePipe,
2021-03-12 12:15:35 +02:00
SelectableColumnsPipe,
KeyboardShortcutPipe,
TbJsonToStringDirective,
JsonObjectEditDialogComponent,
HistorySelectorComponent,
EntityGatewaySelectComponent,
2021-03-03 15:41:47 +02:00
ContactComponent,
2021-05-31 18:15:31 +03:00
OtaPackageAutocompleteComponent,
2021-06-04 20:49:01 +03:00
WidgetsBundleSearchComponent,
CopyButtonComponent,
TogglePasswordComponent
],
imports: [
CommonModule,
RouterModule,
TranslateModule,
MatButtonModule,
MatCheckboxModule,
MatIconModule,
MatCardModule,
MatProgressBarModule,
MatInputModule,
MatSnackBarModule,
MatSidenavModule,
MatToolbarModule,
MatMenuModule,
MatGridListModule,
MatDialogModule,
MatSelectModule,
MatTooltipModule,
MatTableModule,
MatPaginatorModule,
MatSortModule,
MatProgressSpinnerModule,
MatDividerModule,
MatTabsModule,
MatRadioModule,
MatSlideToggleModule,
MatDatepickerModule,
MatNativeDatetimeModule,
MatDatetimepickerModule,
NgxDaterangepickerMd.forRoot(),
MatSliderModule,
MatExpansionModule,
MatStepperModule,
MatAutocompleteModule,
2019-08-15 20:39:56 +03:00
MatChipsModule,
2021-03-02 12:04:45 +02:00
MatListModule,
2019-09-03 19:31:16 +03:00
GridsterModule,
ClipboardModule,
FlexLayoutModule.withConfig({addFlexToParent: false}),
FormsModule,
ReactiveFormsModule,
OverlayModule,
ShareButtonsModule,
HotkeyModule,
ColorPickerModule,
NgxHmCarouselModule,
2021-03-02 12:04:45 +02:00
DndModule,
2019-11-15 16:12:24 +02:00
NgxFlowModule,
2021-08-19 18:52:39 +03:00
NgxFlowchartModule,
// ngx-markdown
MarkdownModule.forRoot({
sanitize: SecurityContext.NONE,
markedOptions: {
provide: MarkedOptions,
useClass: MarkedOptionsService
2021-08-19 18:52:39 +03:00
}
})
],
exports: [
FooterComponent,
LogoComponent,
2019-09-03 19:31:16 +03:00
FooterFabButtonsComponent,
ToastDirective,
FullscreenDirective,
CircularProgressDirective,
MatChipDraggableDirective,
TbHotkeysDirective,
TbAnchorComponent,
TbStringTemplateOutletDirective,
TbComponentOutletDirective,
TbPopoverDirective,
HelpComponent,
HelpMarkdownComponent,
HelpPopupComponent,
TbCheckboxComponent,
TbErrorComponent,
TbCheatSheetComponent,
BreadcrumbComponent,
UserMenuComponent,
2019-08-12 19:34:23 +03:00
TimewindowComponent,
TimewindowPanelComponent,
TimeintervalComponent,
QuickTimeIntervalComponent,
DashboardSelectComponent,
2019-08-12 19:34:23 +03:00
DatetimePeriodComponent,
2019-08-19 20:09:41 +03:00
DatetimeComponent,
TimezoneSelectComponent,
2019-08-12 19:34:23 +03:00
DashboardAutocompleteComponent,
2019-08-13 19:58:35 +03:00
EntitySubTypeAutocompleteComponent,
EntitySubTypeSelectComponent,
EntitySubTypeListComponent,
2019-08-14 19:55:24 +03:00
EntityAutocompleteComponent,
2019-08-15 20:39:56 +03:00
EntityListComponent,
2019-08-19 20:09:41 +03:00
EntityTypeSelectComponent,
EntitySelectComponent,
EntityKeysListComponent,
2019-08-27 20:07:09 +03:00
EntityListSelectComponent,
EntityTypeListComponent,
QueueTypeListComponent,
2019-08-27 20:07:09 +03:00
RelationTypeAutocompleteComponent,
SocialSharePanelComponent,
2019-08-27 20:07:09 +03:00
JsonObjectEditComponent,
2019-12-27 16:35:11 +02:00
JsonContentComponent,
JsFuncComponent,
FabTriggerDirective,
FabActionsDirective,
FabToolbarComponent,
WidgetsBundleSelectComponent,
2019-08-29 20:04:59 +03:00
ValueInputComponent,
MatButtonModule,
MatCheckboxModule,
MatIconModule,
MatCardModule,
MatProgressBarModule,
MatInputModule,
MatSnackBarModule,
MatSidenavModule,
MatToolbarModule,
MatMenuModule,
MatGridListModule,
MatDialogModule,
MatSelectModule,
MatTooltipModule,
MatTableModule,
MatPaginatorModule,
MatSortModule,
MatProgressSpinnerModule,
MatDividerModule,
MatTabsModule,
MatRadioModule,
MatSlideToggleModule,
MatDatepickerModule,
MatNativeDatetimeModule,
MatDatetimepickerModule,
NgxDaterangepickerMd,
MatSliderModule,
MatExpansionModule,
MatStepperModule,
MatAutocompleteModule,
2019-08-15 20:39:56 +03:00
MatChipsModule,
2021-03-02 12:04:45 +02:00
MatListModule,
2019-09-03 19:31:16 +03:00
GridsterModule,
ClipboardModule,
FlexLayoutModule,
FormsModule,
ReactiveFormsModule,
OverlayModule,
ShareButtonsModule,
HotkeyModule,
ColorPickerModule,
NgxHmCarouselModule,
2021-03-02 12:04:45 +02:00
DndModule,
2019-11-15 16:12:24 +02:00
NgxFlowchartModule,
2021-08-19 18:52:39 +03:00
MarkdownModule,
2020-02-11 11:20:08 +02:00
ConfirmDialogComponent,
AlertDialogComponent,
TodoDialogComponent,
ColorPickerDialogComponent,
2019-10-24 19:52:19 +03:00
MaterialIconsDialogComponent,
ColorInputComponent,
2019-10-24 19:52:19 +03:00
MaterialIconSelectComponent,
2019-12-24 16:27:09 +02:00
NodeScriptTestDialogComponent,
JsonFormComponent,
ImageInputComponent,
2019-11-08 14:17:15 +02:00
FileInputComponent,
2019-12-27 16:35:11 +02:00
MessageTypeAutocompleteComponent,
KeyValMapComponent,
2020-01-31 20:26:08 +02:00
NavTreeComponent,
2020-02-03 17:29:01 +02:00
LedLightComponent,
NospacePipe,
2019-08-12 19:34:23 +03:00
MillisecondsToTimeStringPipe,
EnumToArrayPipe,
HighlightPipe,
TruncatePipe,
TbJsonPipe,
2019-09-25 19:37:29 +03:00
KeyboardShortcutPipe,
FileSizePipe,
2021-03-12 12:15:35 +02:00
SelectableColumnsPipe,
TranslateModule,
JsonObjectEditDialogComponent,
HistorySelectorComponent,
EntityGatewaySelectComponent,
2021-03-03 15:41:47 +02:00
ContactComponent,
2021-05-31 18:15:31 +03:00
OtaPackageAutocompleteComponent,
2021-06-04 20:49:01 +03:00
WidgetsBundleSearchComponent,
CopyButtonComponent,
TogglePasswordComponent
]
})
export class SharedModule { }