shared.module.ts 4.9 KB

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