shared.module.ts 5.1 KB

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