shared.module.ts 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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. ChannelAssignmentControlComponent,
  27. ChannelBadgeComponent,
  28. ChannelLabelPipe,
  29. ChipComponent,
  30. ConfigurableInputComponent,
  31. CurrencyInputComponent,
  32. CurrencyNamePipe,
  33. CustomerLabelComponent,
  34. CustomFieldControlComponent,
  35. DataTableColumnComponent,
  36. DataTableComponent,
  37. DatetimePickerComponent,
  38. DialogButtonsDirective,
  39. DialogComponentOutletComponent,
  40. DialogTitleDirective,
  41. DropdownComponent,
  42. DropdownItemDirective,
  43. DropdownMenuComponent,
  44. DropdownTriggerDirective,
  45. EntityInfoComponent,
  46. FacetValueChipComponent,
  47. FacetValueSelectorComponent,
  48. FileSizePipe,
  49. FormattedAddressComponent,
  50. FormFieldComponent,
  51. FormFieldControlDirective,
  52. FormItemComponent,
  53. ItemsPerPageControlsComponent,
  54. LabeledDataComponent,
  55. LanguageSelectorComponent,
  56. ModalDialogComponent,
  57. ObjectTreeComponent,
  58. OrderStateLabelComponent,
  59. PaginationControlsComponent,
  60. PercentageSuffixInputComponent,
  61. RichTextEditorComponent,
  62. SelectToggleComponent,
  63. SentenceCasePipe,
  64. SimpleDialogComponent,
  65. SortPipe,
  66. StringToColorPipe,
  67. TableRowActionComponent,
  68. TitleInputComponent,
  69. } from './shared-declarations';
  70. const IMPORTS = [
  71. ClarityModule,
  72. CommonModule,
  73. FormsModule,
  74. ReactiveFormsModule,
  75. RouterModule,
  76. NgSelectModule,
  77. NgxPaginationModule,
  78. TranslateModule,
  79. OverlayModule,
  80. ];
  81. const DECLARATIONS = [
  82. ActionBarComponent,
  83. ActionBarLeftComponent,
  84. ActionBarRightComponent,
  85. ConfigurableInputComponent,
  86. AffixedInputComponent,
  87. ChipComponent,
  88. CurrencyInputComponent,
  89. CurrencyNamePipe,
  90. CustomerLabelComponent,
  91. CustomFieldControlComponent,
  92. DataTableComponent,
  93. DataTableColumnComponent,
  94. FacetValueSelectorComponent,
  95. ItemsPerPageControlsComponent,
  96. PaginationControlsComponent,
  97. TableRowActionComponent,
  98. FacetValueChipComponent,
  99. FileSizePipe,
  100. FormFieldComponent,
  101. FormFieldControlDirective,
  102. FormItemComponent,
  103. ModalDialogComponent,
  104. PercentageSuffixInputComponent,
  105. DialogComponentOutletComponent,
  106. DialogButtonsDirective,
  107. DialogTitleDirective,
  108. SelectToggleComponent,
  109. LanguageSelectorComponent,
  110. RichTextEditorComponent,
  111. SimpleDialogComponent,
  112. TitleInputComponent,
  113. SentenceCasePipe,
  114. DropdownComponent,
  115. DropdownMenuComponent,
  116. SortPipe,
  117. DropdownTriggerDirective,
  118. DropdownItemDirective,
  119. OrderStateLabelComponent,
  120. FormattedAddressComponent,
  121. LabeledDataComponent,
  122. StringToColorPipe,
  123. ObjectTreeComponent,
  124. IfPermissionsDirective,
  125. HasPermissionPipe,
  126. ActionBarItemsComponent,
  127. DisabledDirective,
  128. AssetFileInputComponent,
  129. AssetGalleryComponent,
  130. AssetPickerDialogComponent,
  131. EntityInfoComponent,
  132. DatetimePickerComponent,
  133. ChannelBadgeComponent,
  134. ChannelAssignmentControlComponent,
  135. ChannelLabelPipe,
  136. ];
  137. @NgModule({
  138. imports: IMPORTS,
  139. exports: [...IMPORTS, ...DECLARATIONS],
  140. declarations: DECLARATIONS,
  141. providers: [
  142. // This needs to be shared, since lazy-loaded
  143. // modules have their own entryComponents which
  144. // are unknown to the CoreModule instance of ModalService.
  145. // See https://github.com/angular/angular/issues/14324#issuecomment-305650763
  146. ModalService,
  147. CanDeactivateDetailGuard,
  148. ],
  149. entryComponents: [ModalDialogComponent, SimpleDialogComponent, AssetPickerDialogComponent],
  150. schemas: [CUSTOM_ELEMENTS_SCHEMA],
  151. })
  152. export class SharedModule {}