shared.module.ts 4.8 KB

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