shared.module.ts 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. import { OverlayModule } from '@angular/cdk/overlay';
  2. import { CommonModule } from '@angular/common';
  3. import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
  4. import { FormsModule, ReactiveFormsModule } from '@angular/forms';
  5. import { RouterModule } from '@angular/router';
  6. import { ClarityModule } from '@clr/angular';
  7. import { NgSelectModule } from '@ng-select/ng-select';
  8. import { TranslateModule } from '@ngx-translate/core';
  9. import { NgxPaginationModule } from 'ngx-pagination';
  10. import { ActionBarItemsComponent } from './components/action-bar-items/action-bar-items.component';
  11. import {
  12. ActionBarComponent,
  13. ActionBarLeftComponent,
  14. ActionBarRightComponent,
  15. } from './components/action-bar/action-bar.component';
  16. import { DisabledDirective } from './directives/disabled.directive';
  17. import { IfPermissionsDirective } from './directives/if-permissions.directive';
  18. import { HasPermissionPipe } from './pipes/has-permission.pipe';
  19. import { ModalService } from './providers/modal/modal.service';
  20. import { CanDeactivateDetailGuard } from './providers/routing/can-deactivate-detail-guard';
  21. import {
  22. AffixedInputComponent,
  23. AssetFileInputComponent,
  24. AssetGalleryComponent,
  25. AssetPickerDialogComponent,
  26. ChannelBadgeComponent,
  27. ChipComponent,
  28. ConfigurableInputComponent,
  29. CurrencyInputComponent,
  30. CurrencyNamePipe,
  31. CustomerLabelComponent,
  32. CustomFieldControlComponent,
  33. DataTableColumnComponent,
  34. DataTableComponent,
  35. DatetimePickerComponent,
  36. DialogButtonsDirective,
  37. DialogComponentOutletComponent,
  38. DialogTitleDirective,
  39. DropdownComponent,
  40. DropdownItemDirective,
  41. DropdownMenuComponent,
  42. DropdownTriggerDirective,
  43. EntityInfoComponent,
  44. FacetValueChipComponent,
  45. FacetValueSelectorComponent,
  46. FileSizePipe,
  47. FormattedAddressComponent,
  48. FormFieldComponent,
  49. FormFieldControlDirective,
  50. FormItemComponent,
  51. ItemsPerPageControlsComponent,
  52. LabeledDataComponent,
  53. LanguageSelectorComponent,
  54. ModalDialogComponent,
  55. ObjectTreeComponent,
  56. OrderStateLabelComponent,
  57. PaginationControlsComponent,
  58. PercentageSuffixInputComponent,
  59. RichTextEditorComponent,
  60. SelectToggleComponent,
  61. SentenceCasePipe,
  62. SimpleDialogComponent,
  63. SortPipe,
  64. StringToColorPipe,
  65. TableRowActionComponent,
  66. TitleInputComponent,
  67. } from './shared-declarations';
  68. const IMPORTS = [
  69. ClarityModule,
  70. CommonModule,
  71. FormsModule,
  72. ReactiveFormsModule,
  73. RouterModule,
  74. NgSelectModule,
  75. NgxPaginationModule,
  76. TranslateModule,
  77. OverlayModule,
  78. ];
  79. const DECLARATIONS = [
  80. ActionBarComponent,
  81. ActionBarLeftComponent,
  82. ActionBarRightComponent,
  83. ConfigurableInputComponent,
  84. AffixedInputComponent,
  85. ChipComponent,
  86. CurrencyInputComponent,
  87. CurrencyNamePipe,
  88. CustomerLabelComponent,
  89. CustomFieldControlComponent,
  90. DataTableComponent,
  91. DataTableColumnComponent,
  92. FacetValueSelectorComponent,
  93. ItemsPerPageControlsComponent,
  94. PaginationControlsComponent,
  95. TableRowActionComponent,
  96. FacetValueChipComponent,
  97. FileSizePipe,
  98. FormFieldComponent,
  99. FormFieldControlDirective,
  100. FormItemComponent,
  101. ModalDialogComponent,
  102. PercentageSuffixInputComponent,
  103. DialogComponentOutletComponent,
  104. DialogButtonsDirective,
  105. DialogTitleDirective,
  106. SelectToggleComponent,
  107. LanguageSelectorComponent,
  108. RichTextEditorComponent,
  109. SimpleDialogComponent,
  110. TitleInputComponent,
  111. SentenceCasePipe,
  112. DropdownComponent,
  113. DropdownMenuComponent,
  114. SortPipe,
  115. DropdownTriggerDirective,
  116. DropdownItemDirective,
  117. OrderStateLabelComponent,
  118. FormattedAddressComponent,
  119. LabeledDataComponent,
  120. StringToColorPipe,
  121. ObjectTreeComponent,
  122. IfPermissionsDirective,
  123. HasPermissionPipe,
  124. ActionBarItemsComponent,
  125. DisabledDirective,
  126. AssetFileInputComponent,
  127. AssetGalleryComponent,
  128. AssetPickerDialogComponent,
  129. EntityInfoComponent,
  130. DatetimePickerComponent,
  131. ChannelBadgeComponent,
  132. ];
  133. @NgModule({
  134. imports: IMPORTS,
  135. exports: [...IMPORTS, ...DECLARATIONS],
  136. declarations: DECLARATIONS,
  137. providers: [
  138. // This needs to be shared, since lazy-loaded
  139. // modules have their own entryComponents which
  140. // are unknown to the CoreModule instance of ModalService.
  141. // See https://github.com/angular/angular/issues/14324#issuecomment-305650763
  142. ModalService,
  143. CanDeactivateDetailGuard,
  144. ],
  145. entryComponents: [ModalDialogComponent, SimpleDialogComponent, AssetPickerDialogComponent],
  146. schemas: [CUSTOM_ELEMENTS_SCHEMA],
  147. })
  148. export class SharedModule {}