@acorex/modules 18.1.5 → 18.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (194) hide show
  1. package/application-management/index.d.ts +2 -0
  2. package/application-management/lib/application-management.module.d.ts +0 -2
  3. package/application-management/lib/application-management.route.d.ts +2 -0
  4. package/application-management/lib/application-management.service.d.ts +14 -3
  5. package/application-management/lib/application-management.source.d.ts +7 -0
  6. package/application-management/lib/application-management.types.d.ts +50 -0
  7. package/application-management/lib/entity.loader.d.ts +9 -0
  8. package/application-management/lib/menu.provider.d.ts +5 -0
  9. package/application-management/lib/services/application-management.service.d.ts +10 -0
  10. package/application-management/lib/services/module-management.service.d.ts +10 -0
  11. package/auth/lib/auth.module.d.ts +4 -7
  12. package/auth/lib/menu.provider.d.ts +5 -0
  13. package/backend/lib/data/api/data-provider.d.ts +1 -0
  14. package/backend/lib/data/index.d.ts +0 -1
  15. package/backend/lib/data/local/local-data-provider.d.ts +1 -0
  16. package/conversation/README.md +3 -0
  17. package/conversation/index.d.ts +5 -0
  18. package/conversation/lib/comments/comment-list-view.component.d.ts +66 -0
  19. package/conversation/lib/comments/comment-lookup-popup.component.d.ts +10 -0
  20. package/conversation/lib/comments/comment.module.d.ts +25 -0
  21. package/conversation/lib/comments/comments.service.d.ts +5 -0
  22. package/conversation/lib/comments/comments.type.d.ts +74 -0
  23. package/conversation/lib/conversation.module.d.ts +8 -0
  24. package/esm2022/application-management/index.mjs +3 -1
  25. package/esm2022/application-management/lib/application-management.module.mjs +27 -47
  26. package/esm2022/application-management/lib/application-management.route.mjs +29 -0
  27. package/esm2022/application-management/lib/application-management.service.mjs +15 -15
  28. package/esm2022/application-management/lib/application-management.source.mjs +8 -0
  29. package/esm2022/application-management/lib/application-management.types.mjs +2 -0
  30. package/esm2022/application-management/lib/entities/applications.entity.mjs +8 -8
  31. package/esm2022/application-management/lib/entities/modules.entity.mjs +12 -15
  32. package/esm2022/application-management/lib/entities/property.entity.mjs +1 -2
  33. package/esm2022/application-management/lib/entity.loader.mjs +46 -0
  34. package/esm2022/application-management/lib/layouts/module-entity-detail-view/module-entity-detail-view.component.mjs +3 -3
  35. package/esm2022/application-management/lib/menu.provider.mjs +30 -0
  36. package/esm2022/application-management/lib/services/application-management.service.mjs +17 -0
  37. package/esm2022/application-management/lib/services/module-management.service.mjs +17 -0
  38. package/esm2022/auth/lib/account/app-chooser/app-chooser-slot.component.mjs +2 -2
  39. package/esm2022/auth/lib/account/profile/profile-slot.component.mjs +7 -4
  40. package/esm2022/auth/lib/auth.module.mjs +20 -14
  41. package/esm2022/auth/lib/login/password/password.component.mjs +2 -2
  42. package/esm2022/auth/lib/menu.provider.mjs +53 -0
  43. package/esm2022/backend/lib/backend.module.mjs +22 -26
  44. package/esm2022/backend/lib/data/api/data-provider.mjs +9 -1
  45. package/esm2022/backend/lib/data/index.mjs +1 -2
  46. package/esm2022/backend/lib/data/local/local-data-provider.mjs +11 -1
  47. package/esm2022/conversation/acorex-modules-conversation.mjs +5 -0
  48. package/esm2022/conversation/index.mjs +6 -0
  49. package/esm2022/conversation/lib/comments/comment-list-view.component.mjs +393 -0
  50. package/esm2022/conversation/lib/comments/comment-lookup-popup.component.mjs +56 -0
  51. package/esm2022/conversation/lib/comments/comment.module.mjs +89 -0
  52. package/esm2022/conversation/lib/comments/comments.service.mjs +4 -0
  53. package/esm2022/conversation/lib/comments/comments.type.mjs +2 -0
  54. package/esm2022/conversation/lib/conversation.module.mjs +17 -0
  55. package/esm2022/form-management/lib/form-management.module.mjs +32 -9
  56. package/esm2022/form-management/lib/menu.provider.mjs +35 -0
  57. package/esm2022/notification-management/index.mjs +3 -1
  58. package/esm2022/notification-management/lib/admin-notification-slot/admin-notification-item/admin-notification-item.component.mjs +8 -16
  59. package/esm2022/notification-management/lib/admin-notification-slot/admin-notification-panel/admin-notification-panel.component.mjs +31 -7
  60. package/esm2022/notification-management/lib/admin-notification-slot/admin-notification-slot/admin-notification-slot.component.mjs +3 -3
  61. package/esm2022/notification-management/lib/entities/my-notification.mjs +243 -0
  62. package/esm2022/notification-management/lib/entities/notification-channel.entity.mjs +2 -3
  63. package/esm2022/notification-management/lib/entities/notification-log.entity.mjs +180 -0
  64. package/esm2022/notification-management/lib/entity.loader.mjs +41 -0
  65. package/esm2022/notification-management/lib/menu.provider.mjs +57 -0
  66. package/esm2022/notification-management/lib/notification-management-mock-data.mjs +2 -2
  67. package/esm2022/notification-management/lib/notification-management.module.mjs +34 -39
  68. package/esm2022/notification-management/lib/notification-management.type.mjs +1 -1
  69. package/esm2022/notification-management/lib/notification.service.mjs +1 -1
  70. package/esm2022/{language-management/acorex-modules-language-management.mjs → platform-management/acorex-modules-platform-management.mjs} +1 -1
  71. package/esm2022/platform-management/index.mjs +5 -0
  72. package/esm2022/platform-management/lib/comments/comment-management.service.mjs +18 -0
  73. package/esm2022/platform-management/lib/global-variables/entities/global-variable.entity.mjs +295 -0
  74. package/esm2022/platform-management/lib/global-variables/entity.loader.mjs +26 -0
  75. package/esm2022/platform-management/lib/global-variables/global-variables.service.mjs +16 -0
  76. package/esm2022/platform-management/lib/global-variables/global-variables.types.mjs +2 -0
  77. package/esm2022/platform-management/lib/global-variables/index.mjs +5 -0
  78. package/esm2022/platform-management/lib/languages/entities/language.entity.mjs +234 -0
  79. package/esm2022/platform-management/lib/languages/entity.loader.mjs +26 -0
  80. package/esm2022/platform-management/lib/languages/index.mjs +5 -0
  81. package/esm2022/platform-management/lib/languages/language-management.service.mjs +16 -0
  82. package/esm2022/platform-management/lib/languages/language.types.mjs +2 -0
  83. package/esm2022/platform-management/lib/menu.provider.mjs +52 -0
  84. package/esm2022/platform-management/lib/platform-management.module.mjs +82 -0
  85. package/esm2022/template-management/index.mjs +7 -3
  86. package/esm2022/template-management/lib/entities/category.entity.mjs +234 -0
  87. package/esm2022/template-management/lib/entities/index.mjs +4 -0
  88. package/esm2022/template-management/lib/entities/template-variable.entity.mjs +124 -120
  89. package/esm2022/template-management/lib/entities/text-template.entity.mjs +386 -0
  90. package/esm2022/template-management/lib/entity.loader.mjs +36 -0
  91. package/esm2022/template-management/lib/menu.provider.mjs +43 -0
  92. package/esm2022/template-management/lib/template-management.module.mjs +53 -37
  93. package/esm2022/template-management/lib/template-management.types.mjs +2 -0
  94. package/esm2022/template-management/lib/template.service.mjs +17 -0
  95. package/esm2022/template-management/lib/text-management.source.mjs +3 -0
  96. package/esm2022/template-management/lib/text-template-category.service.mjs +17 -0
  97. package/fesm2022/{acorex-modules-application-management-module-designer.component-CFLXuP2G.mjs → acorex-modules-application-management-module-designer.component-BCaCCEXO.mjs} +2 -2
  98. package/fesm2022/{acorex-modules-application-management-module-designer.component-CFLXuP2G.mjs.map → acorex-modules-application-management-module-designer.component-BCaCCEXO.mjs.map} +1 -1
  99. package/fesm2022/acorex-modules-application-management.mjs +191 -81
  100. package/fesm2022/acorex-modules-application-management.mjs.map +1 -1
  101. package/fesm2022/{acorex-modules-auth-acorex-modules-auth-iGiPFEeb.mjs → acorex-modules-auth-acorex-modules-auth-D2WBJhj6.mjs} +86 -26
  102. package/fesm2022/acorex-modules-auth-acorex-modules-auth-D2WBJhj6.mjs.map +1 -0
  103. package/fesm2022/{acorex-modules-auth-app-chooser.component-BB3SIzCP.mjs → acorex-modules-auth-app-chooser.component-B7BwymT_.mjs} +2 -2
  104. package/fesm2022/{acorex-modules-auth-app-chooser.component-BB3SIzCP.mjs.map → acorex-modules-auth-app-chooser.component-B7BwymT_.mjs.map} +1 -1
  105. package/fesm2022/{acorex-modules-auth-login.module-ChEv9c5I.mjs → acorex-modules-auth-login.module-BjvPlYQZ.mjs} +4 -4
  106. package/fesm2022/{acorex-modules-auth-login.module-ChEv9c5I.mjs.map → acorex-modules-auth-login.module-BjvPlYQZ.mjs.map} +1 -1
  107. package/fesm2022/{acorex-modules-auth-master.layout-CZv3BD5c.mjs → acorex-modules-auth-master.layout-CeqMPrx8.mjs} +2 -2
  108. package/fesm2022/{acorex-modules-auth-master.layout-CZv3BD5c.mjs.map → acorex-modules-auth-master.layout-CeqMPrx8.mjs.map} +1 -1
  109. package/fesm2022/{acorex-modules-auth-password.component-CxZ1weks.mjs → acorex-modules-auth-password.component-87NrYq3i.mjs} +3 -3
  110. package/fesm2022/acorex-modules-auth-password.component-87NrYq3i.mjs.map +1 -0
  111. package/fesm2022/{acorex-modules-auth-password.component-CPWiBXdG.mjs → acorex-modules-auth-password.component-X3BUidi1.mjs} +2 -2
  112. package/fesm2022/{acorex-modules-auth-password.component-CPWiBXdG.mjs.map → acorex-modules-auth-password.component-X3BUidi1.mjs.map} +1 -1
  113. package/fesm2022/{acorex-modules-auth-routes-C7r2Jm6s.mjs → acorex-modules-auth-routes-D1JZT2cF.mjs} +2 -2
  114. package/fesm2022/{acorex-modules-auth-routes-C7r2Jm6s.mjs.map → acorex-modules-auth-routes-D1JZT2cF.mjs.map} +1 -1
  115. package/fesm2022/{acorex-modules-auth-two-factor.module-BgkJYe7T.mjs → acorex-modules-auth-two-factor.module-C28ix6Wr.mjs} +2 -2
  116. package/fesm2022/{acorex-modules-auth-two-factor.module-BgkJYe7T.mjs.map → acorex-modules-auth-two-factor.module-C28ix6Wr.mjs.map} +1 -1
  117. package/fesm2022/acorex-modules-auth.mjs +1 -1
  118. package/fesm2022/acorex-modules-backend.mjs +40 -232
  119. package/fesm2022/acorex-modules-backend.mjs.map +1 -1
  120. package/fesm2022/acorex-modules-conversation.mjs +550 -0
  121. package/fesm2022/acorex-modules-conversation.mjs.map +1 -0
  122. package/fesm2022/acorex-modules-form-management.mjs +63 -7
  123. package/fesm2022/acorex-modules-form-management.mjs.map +1 -1
  124. package/fesm2022/acorex-modules-notification-management.mjs +594 -63
  125. package/fesm2022/acorex-modules-notification-management.mjs.map +1 -1
  126. package/fesm2022/acorex-modules-platform-management.mjs +757 -0
  127. package/fesm2022/acorex-modules-platform-management.mjs.map +1 -0
  128. package/fesm2022/acorex-modules-template-management.mjs +618 -204
  129. package/fesm2022/acorex-modules-template-management.mjs.map +1 -1
  130. package/form-management/lib/form-management.module.d.ts +2 -2
  131. package/form-management/lib/menu.provider.d.ts +5 -0
  132. package/notification-management/index.d.ts +2 -0
  133. package/notification-management/lib/admin-notification-slot/admin-notification-item/admin-notification-item.component.d.ts +0 -4
  134. package/notification-management/lib/admin-notification-slot/admin-notification-panel/admin-notification-panel.component.d.ts +7 -2
  135. package/{template-management/lib/entities/global-template.entity.d.ts → notification-management/lib/entities/my-notification.d.ts} +1 -1
  136. package/notification-management/lib/entities/notification-log.entity.d.ts +3 -0
  137. package/notification-management/lib/entity.loader.d.ts +9 -0
  138. package/notification-management/lib/menu.provider.d.ts +5 -0
  139. package/notification-management/lib/notification-management-mock-data.d.ts +2 -3
  140. package/notification-management/lib/notification-management.module.d.ts +1 -7
  141. package/notification-management/lib/notification-management.service.d.ts +2 -2
  142. package/notification-management/lib/notification-management.type.d.ts +1 -1
  143. package/notification-management/lib/notification.service.d.ts +3 -4
  144. package/package.json +18 -12
  145. package/platform-management/README.md +4 -0
  146. package/platform-management/index.d.ts +4 -0
  147. package/platform-management/lib/comments/comment-management.service.d.ts +10 -0
  148. package/platform-management/lib/global-variables/entities/global-variable.entity.d.ts +3 -0
  149. package/platform-management/lib/global-variables/entity.loader.d.ts +9 -0
  150. package/platform-management/lib/global-variables/global-variables.service.d.ts +10 -0
  151. package/platform-management/lib/global-variables/global-variables.types.d.ts +7 -0
  152. package/platform-management/lib/global-variables/index.d.ts +4 -0
  153. package/platform-management/lib/languages/entity.loader.d.ts +9 -0
  154. package/platform-management/lib/languages/index.d.ts +4 -0
  155. package/platform-management/lib/languages/language-management.service.d.ts +10 -0
  156. package/platform-management/lib/languages/language.types.d.ts +5 -0
  157. package/platform-management/lib/menu.provider.d.ts +5 -0
  158. package/platform-management/lib/platform-management.module.d.ts +6 -0
  159. package/template-management/index.d.ts +6 -2
  160. package/template-management/lib/entities/category.entity.d.ts +3 -0
  161. package/template-management/lib/entities/index.d.ts +3 -0
  162. package/template-management/lib/entities/template-variable.entity.d.ts +1 -1
  163. package/template-management/lib/entities/text-template.entity.d.ts +3 -0
  164. package/template-management/lib/entity.loader.d.ts +9 -0
  165. package/template-management/lib/menu.provider.d.ts +5 -0
  166. package/template-management/lib/template-management.module.d.ts +4 -10
  167. package/template-management/lib/template-management.types.d.ts +19 -0
  168. package/template-management/lib/template.service.d.ts +10 -0
  169. package/template-management/lib/text-management.source.d.ts +2 -0
  170. package/template-management/lib/text-template-category.service.d.ts +10 -0
  171. package/backend/lib/data/api/comment.mock.service.d.ts +0 -62
  172. package/backend/lib/data/api/notification.mock.service.d.ts +0 -34
  173. package/esm2022/backend/lib/data/api/comment.mock.service.mjs +0 -142
  174. package/esm2022/backend/lib/data/api/notification.mock.service.mjs +0 -71
  175. package/esm2022/language-management/index.mjs +0 -2
  176. package/esm2022/language-management/lib/entities/language.entity.mjs +0 -242
  177. package/esm2022/language-management/lib/language-management.module.mjs +0 -39
  178. package/esm2022/language-management/lib/notification-management.service.mjs +0 -23
  179. package/esm2022/template-management/lib/entities/global-template.entity.mjs +0 -298
  180. package/esm2022/template-management/lib/template-management-mock-data.mjs +0 -11
  181. package/esm2022/template-management/lib/template-management.service.mjs +0 -24
  182. package/fesm2022/acorex-modules-auth-acorex-modules-auth-iGiPFEeb.mjs.map +0 -1
  183. package/fesm2022/acorex-modules-auth-password.component-CxZ1weks.mjs.map +0 -1
  184. package/fesm2022/acorex-modules-language-management-language.entity-CwD5FHGc.mjs +0 -266
  185. package/fesm2022/acorex-modules-language-management-language.entity-CwD5FHGc.mjs.map +0 -1
  186. package/fesm2022/acorex-modules-language-management.mjs +0 -46
  187. package/fesm2022/acorex-modules-language-management.mjs.map +0 -1
  188. package/language-management/README.md +0 -3
  189. package/language-management/index.d.ts +0 -1
  190. package/language-management/lib/language-management.module.d.ts +0 -12
  191. package/language-management/lib/notification-management.service.d.ts +0 -9
  192. package/template-management/lib/template-management-mock-data.d.ts +0 -7
  193. package/template-management/lib/template-management.service.d.ts +0 -9
  194. /package/{language-management/lib → platform-management/lib/languages}/entities/language.entity.d.ts +0 -0
@@ -1,48 +1,44 @@
1
1
  import * as i1$2 from '@acorex/platform/common';
2
- import { AXPComponentSlotModule, AXPDataGenerator, AXPEntityStorageService, AXPEntityDataProviderImpl, AXPEntityQueryType, AXPEntityCommandScope } from '@acorex/platform/common';
3
- import { AXPEntityDefinitionRegistryService } from '@acorex/platform/layout/entity';
2
+ import { AXP_MENU_PROVIDER, AXPComponentSlotModule, AXPEntityStorageService, AXPEntityDataProviderImpl, AXPDataGenerator, AXPEntityQueryType, AXPEntityCommandScope } from '@acorex/platform/common';
3
+ import { AXP_ENTITY_DEFINITION_LOADER } from '@acorex/platform/layout/entity';
4
4
  import * as i0 from '@angular/core';
5
- import { input, output, inject, computed, Component, ChangeDetectionStrategy, signal, effect, Injector, NgModule, Optional, Inject, Injectable } from '@angular/core';
5
+ import { input, output, computed, Component, ChangeDetectionStrategy, inject, signal, effect, Injector, Injectable, NgModule } from '@angular/core';
6
6
  import * as i4$1 from '@acorex/components/badge';
7
7
  import { AXBadgeModule } from '@acorex/components/badge';
8
8
  import * as i1$1 from '@acorex/components/button';
9
9
  import { AXButtonModule } from '@acorex/components/button';
10
- import * as i3 from '@acorex/components/decorators';
10
+ import * as i2 from '@acorex/components/decorators';
11
11
  import { AXDecoratorModule } from '@acorex/components/decorators';
12
12
  import * as i4$2 from '@acorex/components/popover';
13
13
  import { AXPopoverModule } from '@acorex/components/popover';
14
14
  import * as i1 from '@angular/common';
15
15
  import { CommonModule } from '@angular/common';
16
- import * as i4 from '@acorex/components/avatar';
16
+ import * as i3 from '@acorex/components/avatar';
17
17
  import { AXAvatarModule } from '@acorex/components/avatar';
18
- import * as i5 from '@acorex/components/image';
18
+ import * as i4 from '@acorex/components/image';
19
19
  import { AXImageModule } from '@acorex/components/image';
20
- import * as i6 from '@acorex/core/format';
20
+ import * as i5 from '@acorex/core/format';
21
21
  import { AXFormatModule } from '@acorex/core/format';
22
- import { AXPSessionService } from '@acorex/platform/auth';
23
- import { Router } from '@angular/router';
24
- import * as i2 from '@acorex/components/tabs';
22
+ import * as i2$1 from '@acorex/components/tabs';
25
23
  import { AXTabsModule } from '@acorex/components/tabs';
26
24
  import { AXToastService } from '@acorex/components/toast';
27
- import { applySortArray, applyFilterArray } from '@acorex/platform/core';
25
+ import { AXPSessionService } from '@acorex/platform/auth';
26
+ import { Router } from '@angular/router';
27
+ import { AXTranslationService } from '@acorex/core/translation';
28
28
  import { AXPWidgetsCatalog } from '@acorex/platform/layout/builder';
29
+ import { applySortArray, applyFilterArray } from '@acorex/platform/core';
29
30
 
30
31
  class AXMAdminNotificationItemComponent {
31
32
  constructor() {
32
33
  this.data = input.required();
33
34
  this.onPressNotificationItem = output();
34
- this.router = inject(Router);
35
- this.sessionStorage = inject(AXPSessionService);
36
35
  this.differentTime = computed(() => Date.now() - this.data().createAt.getTime());
37
36
  }
38
37
  pressNotificationItem(id) {
39
38
  this.onPressNotificationItem.emit(id);
40
- //const [module, entity] = this.data().RelativeType?.split('.') as [string, string];
41
- //const url = `${this.sessionStorage.application?.name}/m/${module}/e/${entity}/${this.data().RelativeId}`;
42
- //console.log(url);
43
39
  }
44
40
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMAdminNotificationItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
45
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: AXMAdminNotificationItemComponent, isStandalone: true, selector: "axp-master-notification-item", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { onPressNotificationItem: "onPressNotificationItem" }, ngImport: i0, template: "<div\n class=\"notification-item\"\n [id]=\"data().id\"\n (click)=\"pressNotificationItem(data().id)\"\n [class]=\"[data().template.prority, data().readAt ? 'read' : 'unread']\"\n>\n <ax-avatar look=\"rounded\" color=\"primary\">\n @if(data().user.image){\n <ax-image src=\"https://i.pravatar.cc/300\"></ax-image>\n }@else {\n <ax-icon>\n <i class=\"fa-solid fa-lock\"></i>\n </ax-icon>\n }\n </ax-avatar>\n <div>\n <div class=\"notification-item-title\">{{ data().title }}</div>\n <div class=\"notification-item-body\">{{ data().body }}</div>\n @if(true){\n <div>\n <div class=\"notification-file\">\n <ax-avatar color=\"primary\">\n <ax-icon>\n <i class=\"fa-solid fa-file-word ax-text-2xl\"></i>\n </ax-icon>\n </ax-avatar>\n <div>\n <div class=\"notification-file-name\">New project details.docx</div>\n <div class=\"notification-file-size\">250 KB</div>\n </div>\n <ax-button look=\"blank\">\n <ax-icon>\n <i class=\"fa-solid fa-download\"></i>\n </ax-icon>\n </ax-button>\n </div>\n </div>\n }\n <div class=\"notification-item-time\">{{ differentTime() | format : 'timeleft' | async }}</div>\n </div>\n @if(!data().template.isPinned){\n <div class=\"pin-notification\">\n <ax-icon>\n <i class=\"fa-solid fa-thumbtack\"></i>\n </ax-icon>\n </div>\n }\n</div>\n", styles: [".notification-item{position:relative;display:flex;cursor:pointer;gap:.75rem;overflow-x:hidden;padding:1rem}.notification-item.read{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.notification-item.unread{background:rgb(var(--ax-color-on-surface))}.notification-item:hover{background:rgba(var(--ax-color-primary-400),.1)}.notification-item.Notice:before,.notification-item.Danger:before,.notification-item.Warning:before{content:\"\";position:absolute;height:95%;width:.2rem;inset-inline-start:0;top:50%;transform:translateY(-50%)}.notification-item.Notice:before{background:rgb(var(--ax-color-success-500))}.notification-item.Danger:before{background:rgb(var(--ax-color-danger-500))}.notification-item.Warning:before{background:rgb(var(--ax-color-warning-500))}.notification-item ax-avatar ax-badge{position:absolute;bottom:0;inset-inline-end:.25rem;top:auto;border-width:1px;--tw-border-opacity: 1;border-color:rgba(var(--ax-color-surface),var(--tw-border-opacity))}.notification-item>div{display:flex;flex:1 1 0%;flex-direction:column}.notification-item>div .notification-item-title,.notification-item>div .notification-file-name{max-width:20rem;font-size:1rem;font-weight:600;line-height:1.5rem}.notification-item>div .notification-item-time,.notification-item>div .notification-file-size{font-size:.875rem;line-height:1.25rem;--tw-text-opacity: 1;color:rgba(var(--ax-color-neutral-400),var(--tw-text-opacity))}.notification-item>div .notification-item-body{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;max-width:20rem;font-size:.875rem;font-weight:400;line-height:1.5rem}.notification-item>ax-badge{position:absolute;top:1rem;inset-inline-end:1rem}.notification-item .notification-file{margin-top:.5rem;margin-bottom:.5rem;display:flex;gap:.5rem;border-radius:.5rem;border-width:1px;--tw-bg-opacity: 1;background-color:rgba(var(--ax-color-surface),var(--tw-bg-opacity));padding:.5rem}.notification-item .notification-file>div{flex:1 1 0%}.notification-item .pin-notification{position:absolute;top:0;right:0;--tw-rotate: 45deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));padding:1rem;--tw-text-opacity: 1;color:rgba(var(--ax-color-neutral-400),var(--tw-text-opacity))}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i1$1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "type", "responsiveOn", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "responsiveOnChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i3.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "ngmodule", type: AXAvatarModule }, { kind: "component", type: i4.AXAvatarComponent, selector: "ax-avatar", inputs: ["color", "size", "look"], outputs: ["sizeChange"] }, { kind: "ngmodule", type: AXImageModule }, { kind: "component", type: i5.AXImageComponent, selector: "ax-image", inputs: ["overlayMode", "src", "alt", "priority", "lazy"], outputs: ["onLoad", "onError"] }, { kind: "ngmodule", type: AXBadgeModule }, { kind: "ngmodule", type: AXFormatModule }, { kind: "pipe", type: i6.AXFormatPipe, name: "format" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
41
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: AXMAdminNotificationItemComponent, isStandalone: true, selector: "axp-master-notification-item", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { onPressNotificationItem: "onPressNotificationItem" }, ngImport: i0, template: "<div\n class=\"notification-item\"\n [id]=\"data().id\"\n (click)=\"pressNotificationItem(data().id)\"\n [class]=\"[data().template.prority, data().readAt ? 'read' : 'unread']\"\n>\n <ax-avatar look=\"rounded\" color=\"primary\">\n @if(data().user.image){\n <ax-image src=\"https://i.pravatar.cc/300\"></ax-image>\n }@else {\n <ax-icon>\n <i class=\"fa-solid fa-lock\"></i>\n </ax-icon>\n }\n </ax-avatar>\n <div>\n <div class=\"notification-item-title\">{{ data().title }}</div>\n <div class=\"notification-item-body\">{{ data().body }}</div>\n <!-- @if(false){\n <div>\n <div class=\"notification-file\">\n <ax-avatar color=\"primary\">\n <ax-icon>\n <i class=\"fa-solid fa-file-word ax-text-2xl\"></i>\n </ax-icon>\n </ax-avatar>\n <div>\n <div class=\"notification-file-name\">New project details.docx</div>\n <div class=\"notification-file-size\">250 KB</div>\n </div>\n <ax-button look=\"blank\">\n <ax-icon>\n <i class=\"fa-solid fa-download\"></i>\n </ax-icon>\n </ax-button>\n </div>\n </div>\n } -->\n <div class=\"notification-item-time\">{{ differentTime() | format : 'timeleft' | async }}</div>\n </div>\n @if(!data().template.isPinned){\n <div class=\"pin-notification\">\n <ax-icon>\n <i class=\"fa-solid fa-thumbtack\"></i>\n </ax-icon>\n </div>\n }\n</div>\n", styles: [".notification-item{position:relative;display:flex;cursor:pointer;gap:.75rem;overflow-x:hidden;padding:1rem}.notification-item.read{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.notification-item.unread{background:rgb(var(--ax-color-on-surface))}.notification-item.Notice:before,.notification-item.Danger:before,.notification-item.Warning:before{content:\"\";position:absolute;height:95%;width:.2rem;inset-inline-start:0;top:50%;transform:translateY(-50%)}.notification-item.Notice:before{background:rgb(var(--ax-color-success-500))}.notification-item.Danger:before{background:rgb(var(--ax-color-danger-500))}.notification-item.Warning:before{background:rgb(var(--ax-color-warning-500))}.notification-item ax-avatar ax-badge{position:absolute;bottom:0;inset-inline-end:.25rem;top:auto;border-width:1px;--tw-border-opacity: 1;border-color:rgba(var(--ax-color-surface),var(--tw-border-opacity))}.notification-item>div{display:flex;flex:1 1 0%;flex-direction:column}.notification-item>div .notification-item-title,.notification-item>div .notification-file-name{max-width:20rem;font-size:1rem;font-weight:600;line-height:1.5rem}.notification-item>div .notification-item-time,.notification-item>div .notification-file-size{font-size:.875rem;line-height:1.25rem;--tw-text-opacity: 1;color:rgba(var(--ax-color-neutral-400),var(--tw-text-opacity))}.notification-item>div .notification-item-body{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;max-width:20rem;font-size:.875rem;font-weight:400;line-height:1.5rem}.notification-item>ax-badge{position:absolute;top:1rem;inset-inline-end:1rem}.notification-item .notification-file{margin-top:.5rem;margin-bottom:.5rem;display:flex;gap:.5rem;border-radius:.5rem;border-width:1px;--tw-bg-opacity: 1;background-color:rgba(var(--ax-color-surface),var(--tw-bg-opacity));padding:.5rem}.notification-item .notification-file>div{flex:1 1 0%}.notification-item .pin-notification{position:absolute;top:0;right:0;--tw-rotate: 45deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));padding:1rem;--tw-text-opacity: 1;color:rgba(var(--ax-color-neutral-400),var(--tw-text-opacity))}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: AXButtonModule }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i2.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "ngmodule", type: AXAvatarModule }, { kind: "component", type: i3.AXAvatarComponent, selector: "ax-avatar", inputs: ["color", "size", "look"], outputs: ["sizeChange"] }, { kind: "ngmodule", type: AXImageModule }, { kind: "component", type: i4.AXImageComponent, selector: "ax-image", inputs: ["overlayMode", "src", "alt", "priority", "lazy"], outputs: ["onLoad", "onError"] }, { kind: "ngmodule", type: AXBadgeModule }, { kind: "ngmodule", type: AXFormatModule }, { kind: "pipe", type: i5.AXFormatPipe, name: "format" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
46
42
  }
47
43
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMAdminNotificationItemComponent, decorators: [{
48
44
  type: Component,
@@ -54,7 +50,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
54
50
  AXImageModule,
55
51
  AXBadgeModule,
56
52
  AXFormatModule,
57
- ], template: "<div\n class=\"notification-item\"\n [id]=\"data().id\"\n (click)=\"pressNotificationItem(data().id)\"\n [class]=\"[data().template.prority, data().readAt ? 'read' : 'unread']\"\n>\n <ax-avatar look=\"rounded\" color=\"primary\">\n @if(data().user.image){\n <ax-image src=\"https://i.pravatar.cc/300\"></ax-image>\n }@else {\n <ax-icon>\n <i class=\"fa-solid fa-lock\"></i>\n </ax-icon>\n }\n </ax-avatar>\n <div>\n <div class=\"notification-item-title\">{{ data().title }}</div>\n <div class=\"notification-item-body\">{{ data().body }}</div>\n @if(true){\n <div>\n <div class=\"notification-file\">\n <ax-avatar color=\"primary\">\n <ax-icon>\n <i class=\"fa-solid fa-file-word ax-text-2xl\"></i>\n </ax-icon>\n </ax-avatar>\n <div>\n <div class=\"notification-file-name\">New project details.docx</div>\n <div class=\"notification-file-size\">250 KB</div>\n </div>\n <ax-button look=\"blank\">\n <ax-icon>\n <i class=\"fa-solid fa-download\"></i>\n </ax-icon>\n </ax-button>\n </div>\n </div>\n }\n <div class=\"notification-item-time\">{{ differentTime() | format : 'timeleft' | async }}</div>\n </div>\n @if(!data().template.isPinned){\n <div class=\"pin-notification\">\n <ax-icon>\n <i class=\"fa-solid fa-thumbtack\"></i>\n </ax-icon>\n </div>\n }\n</div>\n", styles: [".notification-item{position:relative;display:flex;cursor:pointer;gap:.75rem;overflow-x:hidden;padding:1rem}.notification-item.read{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.notification-item.unread{background:rgb(var(--ax-color-on-surface))}.notification-item:hover{background:rgba(var(--ax-color-primary-400),.1)}.notification-item.Notice:before,.notification-item.Danger:before,.notification-item.Warning:before{content:\"\";position:absolute;height:95%;width:.2rem;inset-inline-start:0;top:50%;transform:translateY(-50%)}.notification-item.Notice:before{background:rgb(var(--ax-color-success-500))}.notification-item.Danger:before{background:rgb(var(--ax-color-danger-500))}.notification-item.Warning:before{background:rgb(var(--ax-color-warning-500))}.notification-item ax-avatar ax-badge{position:absolute;bottom:0;inset-inline-end:.25rem;top:auto;border-width:1px;--tw-border-opacity: 1;border-color:rgba(var(--ax-color-surface),var(--tw-border-opacity))}.notification-item>div{display:flex;flex:1 1 0%;flex-direction:column}.notification-item>div .notification-item-title,.notification-item>div .notification-file-name{max-width:20rem;font-size:1rem;font-weight:600;line-height:1.5rem}.notification-item>div .notification-item-time,.notification-item>div .notification-file-size{font-size:.875rem;line-height:1.25rem;--tw-text-opacity: 1;color:rgba(var(--ax-color-neutral-400),var(--tw-text-opacity))}.notification-item>div .notification-item-body{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;max-width:20rem;font-size:.875rem;font-weight:400;line-height:1.5rem}.notification-item>ax-badge{position:absolute;top:1rem;inset-inline-end:1rem}.notification-item .notification-file{margin-top:.5rem;margin-bottom:.5rem;display:flex;gap:.5rem;border-radius:.5rem;border-width:1px;--tw-bg-opacity: 1;background-color:rgba(var(--ax-color-surface),var(--tw-bg-opacity));padding:.5rem}.notification-item .notification-file>div{flex:1 1 0%}.notification-item .pin-notification{position:absolute;top:0;right:0;--tw-rotate: 45deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));padding:1rem;--tw-text-opacity: 1;color:rgba(var(--ax-color-neutral-400),var(--tw-text-opacity))}\n"] }]
53
+ ], template: "<div\n class=\"notification-item\"\n [id]=\"data().id\"\n (click)=\"pressNotificationItem(data().id)\"\n [class]=\"[data().template.prority, data().readAt ? 'read' : 'unread']\"\n>\n <ax-avatar look=\"rounded\" color=\"primary\">\n @if(data().user.image){\n <ax-image src=\"https://i.pravatar.cc/300\"></ax-image>\n }@else {\n <ax-icon>\n <i class=\"fa-solid fa-lock\"></i>\n </ax-icon>\n }\n </ax-avatar>\n <div>\n <div class=\"notification-item-title\">{{ data().title }}</div>\n <div class=\"notification-item-body\">{{ data().body }}</div>\n <!-- @if(false){\n <div>\n <div class=\"notification-file\">\n <ax-avatar color=\"primary\">\n <ax-icon>\n <i class=\"fa-solid fa-file-word ax-text-2xl\"></i>\n </ax-icon>\n </ax-avatar>\n <div>\n <div class=\"notification-file-name\">New project details.docx</div>\n <div class=\"notification-file-size\">250 KB</div>\n </div>\n <ax-button look=\"blank\">\n <ax-icon>\n <i class=\"fa-solid fa-download\"></i>\n </ax-icon>\n </ax-button>\n </div>\n </div>\n } -->\n <div class=\"notification-item-time\">{{ differentTime() | format : 'timeleft' | async }}</div>\n </div>\n @if(!data().template.isPinned){\n <div class=\"pin-notification\">\n <ax-icon>\n <i class=\"fa-solid fa-thumbtack\"></i>\n </ax-icon>\n </div>\n }\n</div>\n", styles: [".notification-item{position:relative;display:flex;cursor:pointer;gap:.75rem;overflow-x:hidden;padding:1rem}.notification-item.read{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.notification-item.unread{background:rgb(var(--ax-color-on-surface))}.notification-item.Notice:before,.notification-item.Danger:before,.notification-item.Warning:before{content:\"\";position:absolute;height:95%;width:.2rem;inset-inline-start:0;top:50%;transform:translateY(-50%)}.notification-item.Notice:before{background:rgb(var(--ax-color-success-500))}.notification-item.Danger:before{background:rgb(var(--ax-color-danger-500))}.notification-item.Warning:before{background:rgb(var(--ax-color-warning-500))}.notification-item ax-avatar ax-badge{position:absolute;bottom:0;inset-inline-end:.25rem;top:auto;border-width:1px;--tw-border-opacity: 1;border-color:rgba(var(--ax-color-surface),var(--tw-border-opacity))}.notification-item>div{display:flex;flex:1 1 0%;flex-direction:column}.notification-item>div .notification-item-title,.notification-item>div .notification-file-name{max-width:20rem;font-size:1rem;font-weight:600;line-height:1.5rem}.notification-item>div .notification-item-time,.notification-item>div .notification-file-size{font-size:.875rem;line-height:1.25rem;--tw-text-opacity: 1;color:rgba(var(--ax-color-neutral-400),var(--tw-text-opacity))}.notification-item>div .notification-item-body{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;max-width:20rem;font-size:.875rem;font-weight:400;line-height:1.5rem}.notification-item>ax-badge{position:absolute;top:1rem;inset-inline-end:1rem}.notification-item .notification-file{margin-top:.5rem;margin-bottom:.5rem;display:flex;gap:.5rem;border-radius:.5rem;border-width:1px;--tw-bg-opacity: 1;background-color:rgba(var(--ax-color-surface),var(--tw-bg-opacity));padding:.5rem}.notification-item .notification-file>div{flex:1 1 0%}.notification-item .pin-notification{position:absolute;top:0;right:0;--tw-rotate: 45deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));padding:1rem;--tw-text-opacity: 1;color:rgba(var(--ax-color-neutral-400),var(--tw-text-opacity))}\n"] }]
58
54
  }] });
59
55
 
60
56
  class AXMNotificationService {
@@ -65,6 +61,8 @@ class AXMAdminNotificationPanelComponent {
65
61
  this.onNewNotfication = output();
66
62
  this.notificationService = inject(AXMNotificationService);
67
63
  this.toastService = inject(AXToastService);
64
+ this.router = inject(Router);
65
+ this.sessionService = inject(AXPSessionService);
68
66
  this.notifications = signal(undefined);
69
67
  this.totalNotifications = signal(undefined);
70
68
  this.tabItems = computed(() => this.getTabItems(this.notifications()), {
@@ -73,9 +71,6 @@ class AXMAdminNotificationPanelComponent {
73
71
  this.activeTab = signal('All');
74
72
  this.NewNotification = computed(() => this.getNewNotification(this.tabItems()));
75
73
  this.NewNotificationEffect = effect(() => this.onNewNotfication.emit(this.NewNotification()));
76
- this.onPressNotificationItem = (id) => {
77
- this.notifications.update((old) => old?.map((item) => (item.id === id && !item.readAt ? { ...item, readAt: new Date() } : item)));
78
- };
79
74
  }
80
75
  changeActiveTab(tab) {
81
76
  this.activeTab.set(tab);
@@ -150,7 +145,27 @@ class AXMAdminNotificationPanelComponent {
150
145
  }
151
146
  }
152
147
  //
153
- markAllAsRead() {
148
+ async markAsRead(id) {
149
+ try {
150
+ const payload = { id: [id] };
151
+ await this.notificationService.markAsRead(payload);
152
+ this.toggleRead(id);
153
+ }
154
+ catch (error) { }
155
+ }
156
+ toggleRead(id) {
157
+ this.notifications.update((old) => old?.map((item) => (item.id === id ? { ...item, readAt: item.readAt ? null : new Date() } : item)));
158
+ }
159
+ async markAllAsRead() {
160
+ try {
161
+ await this.notificationService.markAsRead();
162
+ this.toggleMarkAllAsRead();
163
+ }
164
+ catch (error) {
165
+ console.error(error);
166
+ }
167
+ }
168
+ toggleMarkAllAsRead() {
154
169
  this.notifications.update((notification) => notification?.map((item) => {
155
170
  if (!item.readAt) {
156
171
  return { ...item, readAt: new Date() };
@@ -158,8 +173,11 @@ class AXMAdminNotificationPanelComponent {
158
173
  return item;
159
174
  }));
160
175
  }
176
+ viewAllNotifications() {
177
+ this.router.navigate([`${this.sessionService.application?.name}/m/notification-management/e/my-notification/list`]);
178
+ }
161
179
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMAdminNotificationPanelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
162
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: AXMAdminNotificationPanelComponent, isStandalone: true, selector: "axm-admin-notification-panel", outputs: { onNewNotfication: "onNewNotfication" }, ngImport: i0, template: "<div class=\"ax-p-4 ax-flex ax-justify-between ax-items-center\">\n <span class=\"ax-text-xl\">Notifications</span>\n <ax-button color=\"default\" look=\"blank\">\n <ax-icon>\n <i class=\"fa-regular fa-gear fa-lg\"></i>\n </ax-icon>\n </ax-button>\n</div>\n<ax-tabs [content]=\"cons\" look=\"with-line\" location=\"bottom\">\n @for(tab of tabItems(); track tab.text){\n <ax-tab-item [text]=\"tab.text\" [active]=\"activeTab() === tab.text\" (activeChange)=\"changeActiveTab(tab.text)\">\n <ax-suffix>\n @if(tab.count){\n <ax-badge [color]=\"activeTab() === tab.text ? 'primary' : 'ghost'\" [text]=\"tab.count.toString()\"></ax-badge>\n }\n </ax-suffix>\n <ax-content>\n <div class=\"ax-max-h-[50vh] ax-overflow-y-auto\">\n @for(notif of getNotificationItems(tab.text); track notif.id){\n <axp-master-notification-item\n [data]=\"notif\"\n (onPressNotificationItem)=\"onPressNotificationItem($event)\"\n ></axp-master-notification-item>\n }\n </div>\n <div class=\"ax-flex ax-gap-4 ax-justify-between ax-p-4 ax-border-t ax-border-default\">\n <ax-button\n [disabled]=\"NewNotification() === 0\"\n color=\"ghost\"\n text=\"Mark all as read\"\n (onClick)=\"markAllAsRead()\"\n ></ax-button>\n <ax-button color=\"primary\" text=\"View all notifications\"></ax-button>\n </div>\n </ax-content>\n </ax-tab-item>\n }\n</ax-tabs>\n\n<ng-template [axTabContent] #cons=\"axTabContent\"></ng-template>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i1$1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "type", "responsiveOn", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "responsiveOnChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXTabsModule }, { kind: "component", type: i2.AXTabsComponent, selector: "ax-tabs", inputs: ["look", "location", "fitParent", "minWidth", "content"], outputs: ["onActiveTabChanged"] }, { kind: "component", type: i2.AXTabItemComponent, selector: "ax-tab-item", inputs: ["disabled", "text", "key", "headerTemplate", "active"], outputs: ["disabledChange", "onClick", "onBlur", "onFocus", "activeChange"] }, { kind: "directive", type: i2.AXTabContentDirective, selector: "[axTabContent]", inputs: ["axTabContent"], exportAs: ["axTabContent"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i3.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i3.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-sub-title, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXBadgeModule }, { kind: "component", type: i4$1.AXBadgeComponent, selector: "ax-badge", inputs: ["color", "look", "text"] }, { kind: "ngmodule", type: AXPopoverModule }, { kind: "component", type: AXMAdminNotificationItemComponent, selector: "axp-master-notification-item", inputs: ["data"], outputs: ["onPressNotificationItem"] }, { kind: "ngmodule", type: AXFormatModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
180
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: AXMAdminNotificationPanelComponent, isStandalone: true, selector: "axm-admin-notification-panel", outputs: { onNewNotfication: "onNewNotfication" }, ngImport: i0, template: "<div class=\"ax-p-4 ax-flex ax-justify-between ax-items-center\">\n <span class=\"ax-text-xl\">Notifications</span>\n <ax-button color=\"default\" look=\"blank\">\n <ax-icon>\n <i class=\"fa-regular fa-gear fa-lg\"></i>\n </ax-icon>\n </ax-button>\n</div>\n<ax-tabs [content]=\"cons\" look=\"with-line\" location=\"bottom\">\n @for(tab of tabItems(); track tab.text){\n <ax-tab-item [text]=\"tab.text\" [active]=\"activeTab() === tab.text\" (activeChange)=\"changeActiveTab(tab.text)\">\n <ax-suffix>\n @if(tab.count){\n <ax-badge [color]=\"activeTab() === tab.text ? 'primary' : 'ghost'\" [text]=\"tab.count.toString()\"></ax-badge>\n }\n </ax-suffix>\n <ax-content>\n <div class=\"ax-max-h-[50vh] ax-overflow-y-auto\">\n @for(notif of getNotificationItems(tab.text); track notif.id){\n <axp-master-notification-item\n [data]=\"notif\"\n (onPressNotificationItem)=\"markAsRead($event)\"\n ></axp-master-notification-item>\n }\n </div>\n <div class=\"ax-flex ax-gap-4 ax-justify-between ax-p-4 ax-border-t ax-border-default\">\n <ax-button\n [disabled]=\"NewNotification() === 0\"\n color=\"ghost\"\n text=\"Mark all as read\"\n (onClick)=\"markAllAsRead()\"\n ></ax-button>\n <ax-button color=\"primary\" text=\"View all notifications\" (onClick)=\"viewAllNotifications()\"></ax-button>\n </div>\n </ax-content>\n </ax-tab-item>\n }\n</ax-tabs>\n\n<ng-template [axTabContent] #cons=\"axTabContent\"></ng-template>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i1$1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "type", "responsiveOn", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "responsiveOnChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXTabsModule }, { kind: "component", type: i2$1.AXTabsComponent, selector: "ax-tabs", inputs: ["look", "location", "fitParent", "minWidth", "content"], outputs: ["onActiveTabChanged"] }, { kind: "component", type: i2$1.AXTabItemComponent, selector: "ax-tab-item", inputs: ["disabled", "text", "key", "headerTemplate", "active"], outputs: ["disabledChange", "onClick", "onBlur", "onFocus", "activeChange"] }, { kind: "directive", type: i2$1.AXTabContentDirective, selector: "[axTabContent]", inputs: ["axTabContent"], exportAs: ["axTabContent"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i2.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i2.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-sub-title, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXBadgeModule }, { kind: "component", type: i4$1.AXBadgeComponent, selector: "ax-badge", inputs: ["color", "look", "text"] }, { kind: "ngmodule", type: AXPopoverModule }, { kind: "component", type: AXMAdminNotificationItemComponent, selector: "axp-master-notification-item", inputs: ["data"], outputs: ["onPressNotificationItem"] }, { kind: "ngmodule", type: AXFormatModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
163
181
  }
164
182
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMAdminNotificationPanelComponent, decorators: [{
165
183
  type: Component,
@@ -172,7 +190,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
172
190
  AXPopoverModule,
173
191
  AXMAdminNotificationItemComponent,
174
192
  AXFormatModule,
175
- ], template: "<div class=\"ax-p-4 ax-flex ax-justify-between ax-items-center\">\n <span class=\"ax-text-xl\">Notifications</span>\n <ax-button color=\"default\" look=\"blank\">\n <ax-icon>\n <i class=\"fa-regular fa-gear fa-lg\"></i>\n </ax-icon>\n </ax-button>\n</div>\n<ax-tabs [content]=\"cons\" look=\"with-line\" location=\"bottom\">\n @for(tab of tabItems(); track tab.text){\n <ax-tab-item [text]=\"tab.text\" [active]=\"activeTab() === tab.text\" (activeChange)=\"changeActiveTab(tab.text)\">\n <ax-suffix>\n @if(tab.count){\n <ax-badge [color]=\"activeTab() === tab.text ? 'primary' : 'ghost'\" [text]=\"tab.count.toString()\"></ax-badge>\n }\n </ax-suffix>\n <ax-content>\n <div class=\"ax-max-h-[50vh] ax-overflow-y-auto\">\n @for(notif of getNotificationItems(tab.text); track notif.id){\n <axp-master-notification-item\n [data]=\"notif\"\n (onPressNotificationItem)=\"onPressNotificationItem($event)\"\n ></axp-master-notification-item>\n }\n </div>\n <div class=\"ax-flex ax-gap-4 ax-justify-between ax-p-4 ax-border-t ax-border-default\">\n <ax-button\n [disabled]=\"NewNotification() === 0\"\n color=\"ghost\"\n text=\"Mark all as read\"\n (onClick)=\"markAllAsRead()\"\n ></ax-button>\n <ax-button color=\"primary\" text=\"View all notifications\"></ax-button>\n </div>\n </ax-content>\n </ax-tab-item>\n }\n</ax-tabs>\n\n<ng-template [axTabContent] #cons=\"axTabContent\"></ng-template>\n" }]
193
+ ], template: "<div class=\"ax-p-4 ax-flex ax-justify-between ax-items-center\">\n <span class=\"ax-text-xl\">Notifications</span>\n <ax-button color=\"default\" look=\"blank\">\n <ax-icon>\n <i class=\"fa-regular fa-gear fa-lg\"></i>\n </ax-icon>\n </ax-button>\n</div>\n<ax-tabs [content]=\"cons\" look=\"with-line\" location=\"bottom\">\n @for(tab of tabItems(); track tab.text){\n <ax-tab-item [text]=\"tab.text\" [active]=\"activeTab() === tab.text\" (activeChange)=\"changeActiveTab(tab.text)\">\n <ax-suffix>\n @if(tab.count){\n <ax-badge [color]=\"activeTab() === tab.text ? 'primary' : 'ghost'\" [text]=\"tab.count.toString()\"></ax-badge>\n }\n </ax-suffix>\n <ax-content>\n <div class=\"ax-max-h-[50vh] ax-overflow-y-auto\">\n @for(notif of getNotificationItems(tab.text); track notif.id){\n <axp-master-notification-item\n [data]=\"notif\"\n (onPressNotificationItem)=\"markAsRead($event)\"\n ></axp-master-notification-item>\n }\n </div>\n <div class=\"ax-flex ax-gap-4 ax-justify-between ax-p-4 ax-border-t ax-border-default\">\n <ax-button\n [disabled]=\"NewNotification() === 0\"\n color=\"ghost\"\n text=\"Mark all as read\"\n (onClick)=\"markAllAsRead()\"\n ></ax-button>\n <ax-button color=\"primary\" text=\"View all notifications\" (onClick)=\"viewAllNotifications()\"></ax-button>\n </div>\n </ax-content>\n </ax-tab-item>\n }\n</ax-tabs>\n\n<ng-template [axTabContent] #cons=\"axTabContent\"></ng-template>\n" }]
176
194
  }] });
177
195
 
178
196
  class AXMAdminNotificationSlotComponent {
@@ -183,7 +201,7 @@ class AXMAdminNotificationSlotComponent {
183
201
  this.totalNewNotification.set(value);
184
202
  }
185
203
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMAdminNotificationSlotComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
186
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: AXMAdminNotificationSlotComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: "<ax-button color=\"secondary\" class=\"ax-relative\" look=\"blank\" #notification>\n <ax-icon>\n <i class=\"fa-regular fa-bell ax-text-slate-400 dark:ax-text-slate-200\"></i>\n </ax-icon>\n <ax-suffix class=\"ax-absolute ax-top-0 ax-left-1/2\">\n @if(totalNewNotification()){\n <ax-badge color=\"success\" [text]=\"totalNewNotification().toString()\"></ax-badge>\n }\n </ax-suffix>\n</ax-button>\n<ax-popover [target]=\"notification\" [openOn]=\"'toggle'\" [closeOn]=\"'clickOut'\" [adaptivityEnabled]=\"true\">\n <div class=\"ax-bg-surface ax-border ax-border-default ax-rounded-md ax-shadow-md ax-w-full\">\n <axm-admin-notification-panel (onNewNotfication)=\"setTotalNewNotification($event)\"> </axm-admin-notification-panel>\n </div>\n</ax-popover>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i1$1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "type", "responsiveOn", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "responsiveOnChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i3.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i3.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-sub-title, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXBadgeModule }, { kind: "component", type: i4$1.AXBadgeComponent, selector: "ax-badge", inputs: ["color", "look", "text"] }, { kind: "ngmodule", type: AXPopoverModule }, { kind: "component", type: i4$2.AXPopoverComponent, selector: "ax-popover", inputs: ["offsetX", "offsetY", "target", "placement", "content", "openOn", "closeOn", "hasBackdrop", "openAfter", "closeAfter", "backdropClass", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "component", type: AXMAdminNotificationPanelComponent, selector: "axm-admin-notification-panel", outputs: ["onNewNotfication"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
204
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: AXMAdminNotificationSlotComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: "<ax-button color=\"secondary\" class=\"ax-relative\" look=\"blank\" #notification>\n <ax-icon>\n <i class=\"fa-regular fa-bell\"></i>\n </ax-icon>\n <ax-suffix class=\"ax-absolute ax-top-0 ax-left-1/2\">\n @if(totalNewNotification()){\n <ax-badge color=\"success\" [text]=\"totalNewNotification().toString()\"></ax-badge>\n }\n </ax-suffix>\n</ax-button>\n<ax-popover [target]=\"notification\" [openOn]=\"'toggle'\" [closeOn]=\"'clickOut'\" [adaptivityEnabled]=\"true\">\n <div class=\"ax-bg-surface ax-border ax-border-default ax-rounded-md ax-shadow-md ax-w-full\">\n <axm-admin-notification-panel (onNewNotfication)=\"setTotalNewNotification($event)\"> </axm-admin-notification-panel>\n </div>\n</ax-popover>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i1$1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "type", "responsiveOn", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "responsiveOnChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i2.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i2.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-sub-title, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXBadgeModule }, { kind: "component", type: i4$1.AXBadgeComponent, selector: "ax-badge", inputs: ["color", "look", "text"] }, { kind: "ngmodule", type: AXPopoverModule }, { kind: "component", type: i4$2.AXPopoverComponent, selector: "ax-popover", inputs: ["offsetX", "offsetY", "target", "placement", "content", "openOn", "closeOn", "hasBackdrop", "openAfter", "closeAfter", "backdropClass", "panelClass", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "component", type: AXMAdminNotificationPanelComponent, selector: "axm-admin-notification-panel", outputs: ["onNewNotfication"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
187
205
  }
188
206
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMAdminNotificationSlotComponent, decorators: [{
189
207
  type: Component,
@@ -195,42 +213,122 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
195
213
  AXPopoverModule,
196
214
  AXMAdminNotificationItemComponent,
197
215
  AXMAdminNotificationPanelComponent,
198
- ], template: "<ax-button color=\"secondary\" class=\"ax-relative\" look=\"blank\" #notification>\n <ax-icon>\n <i class=\"fa-regular fa-bell ax-text-slate-400 dark:ax-text-slate-200\"></i>\n </ax-icon>\n <ax-suffix class=\"ax-absolute ax-top-0 ax-left-1/2\">\n @if(totalNewNotification()){\n <ax-badge color=\"success\" [text]=\"totalNewNotification().toString()\"></ax-badge>\n }\n </ax-suffix>\n</ax-button>\n<ax-popover [target]=\"notification\" [openOn]=\"'toggle'\" [closeOn]=\"'clickOut'\" [adaptivityEnabled]=\"true\">\n <div class=\"ax-bg-surface ax-border ax-border-default ax-rounded-md ax-shadow-md ax-w-full\">\n <axm-admin-notification-panel (onNewNotfication)=\"setTotalNewNotification($event)\"> </axm-admin-notification-panel>\n </div>\n</ax-popover>\n" }]
216
+ ], template: "<ax-button color=\"secondary\" class=\"ax-relative\" look=\"blank\" #notification>\n <ax-icon>\n <i class=\"fa-regular fa-bell\"></i>\n </ax-icon>\n <ax-suffix class=\"ax-absolute ax-top-0 ax-left-1/2\">\n @if(totalNewNotification()){\n <ax-badge color=\"success\" [text]=\"totalNewNotification().toString()\"></ax-badge>\n }\n </ax-suffix>\n</ax-button>\n<ax-popover [target]=\"notification\" [openOn]=\"'toggle'\" [closeOn]=\"'clickOut'\" [adaptivityEnabled]=\"true\">\n <div class=\"ax-bg-surface ax-border ax-border-default ax-rounded-md ax-shadow-md ax-w-full\">\n <axm-admin-notification-panel (onNewNotfication)=\"setTotalNewNotification($event)\"> </axm-admin-notification-panel>\n </div>\n</ax-popover>\n" }]
199
217
  }] });
200
218
 
201
- class AXMNotificationManagementModule {
202
- static forRoot() {
203
- return {
204
- ngModule: AXMNotificationManagementModule,
205
- providers: [
206
- {
207
- provide: 'AXP_REGISTER_TEMPLATE_NoTIFICATION',
208
- useFactory: async (entityRegistry, injector) => {
209
- const notificationTemplateEntity = await (await Promise.resolve().then(function () { return notification_entity; })).notificationEntityFactory(injector);
210
- entityRegistry.register(notificationTemplateEntity);
211
- //
212
- const notificationChannelEntity = await (await Promise.resolve().then(function () { return notificationChannel_entity; })).notificationChannelEntityFactory(injector);
213
- entityRegistry.register(notificationChannelEntity);
214
- //
215
- const notificationEntity = await (await Promise.resolve().then(function () { return notification_entity; })).notificationEntityFactory(injector);
216
- entityRegistry.register(notificationEntity);
219
+ class AXMNotificationModuleEntityLoader {
220
+ constructor() {
221
+ this.injector = inject(Injector);
222
+ }
223
+ async get(moduleName, entityName) {
224
+ return new Promise(async (resolve) => {
225
+ switch (entityName) {
226
+ case 'notificationTemplate': {
227
+ const entity = (await Promise.resolve().then(function () { return notificationTemplate_entity; })).notificationTemplateEntityFactory;
228
+ resolve(entity(this.injector));
229
+ break;
230
+ }
231
+ case 'notificationChannel': {
232
+ const entity = (await Promise.resolve().then(function () { return notificationChannel_entity; })).notificationChannelEntityFactory;
233
+ resolve(entity(this.injector));
234
+ break;
235
+ }
236
+ case 'my-notification': {
237
+ const entity = (await Promise.resolve().then(function () { return myNotification; })).myNotificationEntityFactory;
238
+ resolve(entity(this.injector));
239
+ break;
240
+ }
241
+ case 'notification': {
242
+ const entity = (await Promise.resolve().then(function () { return notification_entity; })).notificationEntityFactory;
243
+ resolve(entity(this.injector));
244
+ break;
245
+ }
246
+ default:
247
+ resolve(null);
248
+ }
249
+ });
250
+ }
251
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMNotificationModuleEntityLoader, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
252
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMNotificationModuleEntityLoader }); }
253
+ }
254
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMNotificationModuleEntityLoader, decorators: [{
255
+ type: Injectable
256
+ }] });
257
+
258
+ class AXMNotificationManagmentModuleMenuProvider {
259
+ constructor() {
260
+ this.translateService = inject(AXTranslationService);
261
+ }
262
+ async items() {
263
+ const scope = "notification"; // Scope for translation lookup
264
+ return [
265
+ {
266
+ items: [
267
+ {
268
+ text: await this.translateService.translateAsync('myNotifications', { scope }),
269
+ path: '/demo/m/notification-management/e/my-notification/list',
270
+ data: {
271
+ // requiredPermission: '',
272
+ },
217
273
  },
218
- deps: [AXPEntityDefinitionRegistryService, Injector], // Add any dependencies if needed
274
+ ],
275
+ insertAt: {
276
+ target: 'edit-profile',
219
277
  },
220
- ],
221
- };
278
+ },
279
+ {
280
+ items: [
281
+ {
282
+ priority: 9001,
283
+ text: await this.translateService.translateAsync('notificationManagement', { scope }),
284
+ icon: 'fa-solid fa-bells',
285
+ data: {
286
+ // requiredPermission: 'demo.admin.settings',
287
+ },
288
+ children: [
289
+ {
290
+ text: await this.translateService.translateAsync('template', { scope }),
291
+ path: '/demo/m/notification-management/e/notificationTemplate/list',
292
+ icon: 'fa-solid fa-file-invoice',
293
+ data: {
294
+ // requiredPermission: '',
295
+ },
296
+ },
297
+ {
298
+ text: await this.translateService.translateAsync('report', { scope }),
299
+ path: '/demo/m/notification-management/e/notification/list',
300
+ icon: 'fa-solid fa-file-chart-column',
301
+ data: {
302
+ // requiredPermission: '',
303
+ },
304
+ },
305
+ ],
306
+ },
307
+ ],
308
+ },
309
+ ];
222
310
  }
223
- /**
224
- * @ignore
225
- */
226
- constructor(instances) { }
227
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMNotificationManagementModule, deps: [{ token: 'AXP_REGISTER_TEMPLATE_NoTIFICATION', optional: true }], target: i0.ɵɵFactoryTarget.NgModule }); }
311
+ }
312
+
313
+ class AXMNotificationManagementModule {
314
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMNotificationManagementModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
228
315
  static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.0", ngImport: i0, type: AXMNotificationManagementModule, imports: [i1$2.AXPComponentSlotModule] }); }
229
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMNotificationManagementModule, imports: [AXPComponentSlotModule.forChild({
316
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMNotificationManagementModule, providers: [
317
+ {
318
+ provide: AXP_ENTITY_DEFINITION_LOADER,
319
+ useClass: AXMNotificationModuleEntityLoader,
320
+ multi: true,
321
+ },
322
+ {
323
+ provide: AXP_MENU_PROVIDER,
324
+ useClass: AXMNotificationManagmentModuleMenuProvider,
325
+ multi: true,
326
+ },
327
+ ], imports: [AXPComponentSlotModule.forChild({
230
328
  'header-end': [
231
329
  {
232
330
  name: 'notification',
233
- component: AXMAdminNotificationSlotComponent
331
+ component: AXMAdminNotificationSlotComponent,
234
332
  },
235
333
  ],
236
334
  })] }); }
@@ -243,20 +341,273 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
243
341
  'header-end': [
244
342
  {
245
343
  name: 'notification',
246
- component: AXMAdminNotificationSlotComponent
344
+ component: AXMAdminNotificationSlotComponent,
247
345
  },
248
346
  ],
249
347
  }),
250
348
  ],
251
349
  exports: [],
252
350
  declarations: [],
351
+ providers: [
352
+ {
353
+ provide: AXP_ENTITY_DEFINITION_LOADER,
354
+ useClass: AXMNotificationModuleEntityLoader,
355
+ multi: true,
356
+ },
357
+ {
358
+ provide: AXP_MENU_PROVIDER,
359
+ useClass: AXMNotificationManagmentModuleMenuProvider,
360
+ multi: true,
361
+ },
362
+ ],
253
363
  }]
254
- }], ctorParameters: () => [{ type: undefined, decorators: [{
255
- type: Optional
256
- }, {
257
- type: Inject,
258
- args: ['AXP_REGISTER_TEMPLATE_NoTIFICATION']
259
- }] }] });
364
+ }] });
365
+
366
+ async function myNotificationEntityFactory(injector) {
367
+ const storageService = injector.get(AXPEntityStorageService);
368
+ const dataProvider = new AXPEntityDataProviderImpl(storageService, 'notifications');
369
+ const entityDef = {
370
+ module: 'notification-management',
371
+ name: 'notification',
372
+ source: 'notification-management.notification',
373
+ title: 'My Notifications',
374
+ formats: {
375
+ individual: 'Notification',
376
+ plural: 'My Notifications',
377
+ },
378
+ groups: [
379
+ { id: 'data', title: 'Data' },
380
+ { id: 'content', title: 'Content' },
381
+ { id: 'action', title: 'Action' },
382
+ { id: 'user', title: 'User' },
383
+ { id: 'template', title: 'Template' },
384
+ ],
385
+ properties: [
386
+ {
387
+ name: 'id',
388
+ title: 'ID',
389
+ groupId: 'data',
390
+ schema: {
391
+ dataType: 'string',
392
+ hidden: true,
393
+ nullable: false,
394
+ readonly: true,
395
+ unique: { enabled: true },
396
+ },
397
+ },
398
+ {
399
+ name: 'title',
400
+ title: 'Title',
401
+ groupId: 'data',
402
+ schema: {
403
+ dataType: 'string',
404
+ interface: {
405
+ type: AXPWidgetsCatalog.text,
406
+ },
407
+ },
408
+ },
409
+ {
410
+ name: 'body',
411
+ title: 'Body',
412
+ groupId: 'data',
413
+ schema: {
414
+ dataType: 'string',
415
+ interface: {
416
+ type: AXPWidgetsCatalog.largeText,
417
+ },
418
+ },
419
+ },
420
+ {
421
+ name: 'channel',
422
+ title: 'Channel',
423
+ groupId: 'data',
424
+ schema: {
425
+ dataType: 'string',
426
+ interface: {
427
+ type: AXPWidgetsCatalog.select,
428
+ options: { dataSource: ['InApp', 'Email', 'SMS'], multiple: false },
429
+ },
430
+ },
431
+ },
432
+ {
433
+ name: 'content.type',
434
+ title: 'Content Data',
435
+ groupId: 'content',
436
+ schema: {
437
+ dataType: 'object',
438
+ interface: {
439
+ type: AXPWidgetsCatalog.richText,
440
+ },
441
+ },
442
+ },
443
+ {
444
+ name: 'action.type',
445
+ title: 'Action Type',
446
+ groupId: 'action',
447
+ schema: {
448
+ dataType: 'string',
449
+ interface: {
450
+ type: AXPWidgetsCatalog.select,
451
+ options: { dataSource: ['Link', 'Entity', 'Popup'], multiple: false },
452
+ },
453
+ },
454
+ },
455
+ {
456
+ name: 'User.name',
457
+ title: 'Username',
458
+ groupId: 'user',
459
+ schema: {
460
+ dataType: 'string',
461
+ interface: {
462
+ type: AXPWidgetsCatalog.text,
463
+ },
464
+ },
465
+ },
466
+ {
467
+ name: 'template.category',
468
+ title: 'Category',
469
+ groupId: 'template',
470
+ schema: {
471
+ dataType: 'string',
472
+ interface: {
473
+ type: AXPWidgetsCatalog.select,
474
+ options: { dataSource: ['Inbox', 'Archive'], multiple: false },
475
+ },
476
+ },
477
+ },
478
+ {
479
+ name: 'template.prority',
480
+ title: 'Prority',
481
+ groupId: 'template',
482
+ schema: {
483
+ dataType: 'string',
484
+ interface: {
485
+ type: AXPWidgetsCatalog.select,
486
+ options: { dataSource: ['Warning', 'Danger', 'Notice'], multiple: false },
487
+ },
488
+ },
489
+ },
490
+ {
491
+ name: 'template.isPinned',
492
+ title: 'Is Pinned',
493
+ groupId: 'template',
494
+ schema: {
495
+ dataType: 'boolean',
496
+ interface: {
497
+ type: AXPWidgetsCatalog.checkbox,
498
+ options: {
499
+ label: 'Is Pinned',
500
+ },
501
+ },
502
+ },
503
+ },
504
+ {
505
+ name: 'readAt',
506
+ title: 'Read At',
507
+ groupId: 'data',
508
+ schema: {
509
+ dataType: 'datetime',
510
+ interface: {
511
+ type: AXPWidgetsCatalog.dateTime,
512
+ options: { format: 'date' },
513
+ },
514
+ },
515
+ },
516
+ {
517
+ name: 'createAt',
518
+ title: 'Created At',
519
+ groupId: 'data',
520
+ schema: {
521
+ dataType: 'datetime',
522
+ interface: {
523
+ type: AXPWidgetsCatalog.dateTime,
524
+ options: { format: 'date' },
525
+ },
526
+ },
527
+ },
528
+ ],
529
+ columns: [
530
+ { name: 'title' },
531
+ { name: 'body' },
532
+ { name: 'channel' },
533
+ { name: 'user.name' },
534
+ { name: 'template.category' },
535
+ { name: 'template.prority' },
536
+ { name: 'createAt' },
537
+ { name: 'readAt' },
538
+ ],
539
+ commands: {
540
+ create: {
541
+ execute: async (data) => {
542
+ console.log('CREATE', data);
543
+ const entity = Object.assign(data, { id: AXPDataGenerator.uuid() });
544
+ await dataProvider.insertOne(entity);
545
+ return entity;
546
+ },
547
+ },
548
+ delete: {
549
+ execute: async (id) => {
550
+ console.log('CREATE', id);
551
+ await dataProvider.deleteOne(id);
552
+ },
553
+ },
554
+ update: {
555
+ execute: async (data) => {
556
+ await dataProvider.updateOne(data.id, data);
557
+ },
558
+ },
559
+ },
560
+ queries: {
561
+ byKey: {
562
+ execute: async (id) => {
563
+ return await dataProvider.getOne(id);
564
+ },
565
+ type: AXPEntityQueryType.Single,
566
+ },
567
+ list: {
568
+ execute: async (e) => {
569
+ const list = await dataProvider.getAll();
570
+ return {
571
+ total: list.length,
572
+ items: list.slice(e.skip, e.skip + e.take),
573
+ };
574
+ },
575
+ type: AXPEntityQueryType.List,
576
+ },
577
+ },
578
+ interfaces: {
579
+ master: {
580
+ create: { sections: [{ id: 'content' }, { id: 'action' }, { id: 'user' }, { id: 'template' }] },
581
+ update: { sections: [{ id: 'content' }, { id: 'action' }, { id: 'user' }, { id: 'template' }] },
582
+ list: {
583
+ actions: [
584
+ // {
585
+ // title: 'Create New',
586
+ // command: 'create-entity',
587
+ // priority: 'primary',
588
+ // type: 'create',
589
+ // scope: AXPEntityCommandScope.TypeLevel,
590
+ // },
591
+ {
592
+ title: 'Delete',
593
+ command: 'delete-entity',
594
+ priority: 'primary',
595
+ type: 'delete',
596
+ scope: AXPEntityCommandScope.Selected,
597
+ },
598
+ ],
599
+ views: [{ name: 'all', title: 'All Notifications', fixed: true, columns: [], conditions: [], sorts: [] }],
600
+ },
601
+ },
602
+ },
603
+ };
604
+ return entityDef;
605
+ }
606
+
607
+ var myNotification = /*#__PURE__*/Object.freeze({
608
+ __proto__: null,
609
+ myNotificationEntityFactory: myNotificationEntityFactory
610
+ });
260
611
 
261
612
  const CHANNELS = ['InApp', 'Email', 'SMS'];
262
613
  const TITLES = ['Buy Me!', 'Black Friday', 'New Message'];
@@ -265,7 +616,7 @@ const CATEGORIES = ['Inbox', 'Archive', 'Role'];
265
616
  const TYPES = ['File', 'Person', 'Notification'];
266
617
  const PRORITIES = ['Warning', 'Danger', 'Notice'];
267
618
  const NOTIFICATION_TEMPLATES = Array.from({ length: 5 }).map((_, i) => {
268
- const name = AXPDataGenerator.string;
619
+ const name = AXPDataGenerator.string();
269
620
  return {
270
621
  id: AXPDataGenerator.uuid(),
271
622
  name: name,
@@ -404,7 +755,7 @@ async function notificationChannelEntityFactory(injector) {
404
755
  schema: {
405
756
  dataType: 'string',
406
757
  interface: {
407
- type: AXPWidgetsCatalog.largeText,
758
+ type: AXPWidgetsCatalog.richText,
408
759
  },
409
760
  },
410
761
  validations: [
@@ -474,7 +825,6 @@ async function notificationChannelEntityFactory(injector) {
474
825
  },
475
826
  update: {
476
827
  execute: async (data) => {
477
- debugger;
478
828
  return new Promise((resolve) => {
479
829
  setTimeout(async () => {
480
830
  await dataService.notificationChannelDataProvider.updateOne(data.id, data);
@@ -693,6 +1043,182 @@ var notificationChannel_entity = /*#__PURE__*/Object.freeze({
693
1043
  notificationChannelEntityFactory: notificationChannelEntityFactory
694
1044
  });
695
1045
 
1046
+ async function notificationLogEntityFactory(injector) {
1047
+ const dataService = injector.get(NotificationManagementService);
1048
+ const entityDef = {
1049
+ module: 'notification-management',
1050
+ name: 'notification',
1051
+ source: 'notification-management.notificationLog',
1052
+ title: 'Notification',
1053
+ formats: {
1054
+ individual: 'NotificationLog',
1055
+ plural: 'NotificationLogs',
1056
+ },
1057
+ relatedEntities: [],
1058
+ groups: [
1059
+ {
1060
+ id: 'notification',
1061
+ title: 'Notification',
1062
+ },
1063
+ ],
1064
+ properties: [
1065
+ {
1066
+ name: 'name',
1067
+ title: 'Name',
1068
+ groupId: 'notification',
1069
+ schema: {
1070
+ dataType: 'string',
1071
+ interface: {
1072
+ type: AXPWidgetsCatalog.text,
1073
+ },
1074
+ },
1075
+ },
1076
+ {
1077
+ name: 'title',
1078
+ title: 'Title',
1079
+ groupId: 'notification',
1080
+ schema: {
1081
+ dataType: 'string',
1082
+ interface: {
1083
+ type: AXPWidgetsCatalog.text,
1084
+ },
1085
+ },
1086
+ },
1087
+ {
1088
+ name: 'status',
1089
+ title: 'Status',
1090
+ groupId: 'notification',
1091
+ schema: {
1092
+ dataType: 'string',
1093
+ interface: {
1094
+ type: AXPWidgetsCatalog.richText,
1095
+ },
1096
+ },
1097
+ },
1098
+ ],
1099
+ columns: [{ name: 'name' }, { name: 'title' }, { name: 'body' }, { name: 'user.name' }, { name: 'channel' }],
1100
+ queries: {
1101
+ byKey: {
1102
+ execute: async (id) => {
1103
+ return new Promise((resolve) => {
1104
+ setTimeout(async () => {
1105
+ const entity = await dataService.notificationDataProvider.getOne(id);
1106
+ resolve(entity);
1107
+ }, 500);
1108
+ });
1109
+ },
1110
+ type: AXPEntityQueryType.Single,
1111
+ },
1112
+ list: {
1113
+ execute: async (e) => {
1114
+ const list = await dataService.notificationDataProvider.getAll();
1115
+ const sortedItems = applySortArray(list, e.sort);
1116
+ const filteredItems = applyFilterArray(sortedItems, e.filter ? [e.filter] : []);
1117
+ return Promise.resolve({
1118
+ total: filteredItems.length,
1119
+ items: filteredItems.slice(e.skip, (e.skip ?? 0) + (e.take ?? 0)),
1120
+ });
1121
+ },
1122
+ type: AXPEntityQueryType.List,
1123
+ },
1124
+ },
1125
+ interfaces: {
1126
+ master: {
1127
+ single: {
1128
+ title: '{{title}}',
1129
+ sections: [
1130
+ {
1131
+ id: 'notification',
1132
+ layout: {
1133
+ positions: {
1134
+ lg: {
1135
+ colSpan: 12,
1136
+ },
1137
+ },
1138
+ },
1139
+ },
1140
+ ],
1141
+ properties: [
1142
+ {
1143
+ name: 'name',
1144
+ layout: {
1145
+ positions: {
1146
+ lg: {
1147
+ colSpan: 6,
1148
+ },
1149
+ },
1150
+ },
1151
+ },
1152
+ {
1153
+ name: 'user.name',
1154
+ layout: {
1155
+ positions: {
1156
+ lg: {
1157
+ colSpan: 6,
1158
+ },
1159
+ },
1160
+ },
1161
+ },
1162
+ {
1163
+ name: 'title',
1164
+ layout: {
1165
+ positions: {
1166
+ lg: {
1167
+ colSpan: 12,
1168
+ },
1169
+ },
1170
+ },
1171
+ },
1172
+ {
1173
+ name: 'body',
1174
+ layout: {
1175
+ positions: {
1176
+ lg: {
1177
+ colSpan: 12,
1178
+ },
1179
+ },
1180
+ },
1181
+ },
1182
+ {
1183
+ name: 'channel',
1184
+ layout: {
1185
+ positions: {
1186
+ lg: {
1187
+ colSpan: 6,
1188
+ },
1189
+ },
1190
+ },
1191
+ },
1192
+ ],
1193
+ actions: [],
1194
+ },
1195
+ list: {
1196
+ actions: [
1197
+ {
1198
+ title: 'Details',
1199
+ command: 'open-entity',
1200
+ priority: 'primary',
1201
+ type: 'view',
1202
+ scope: AXPEntityCommandScope.Individual,
1203
+ },
1204
+ ],
1205
+ views: [
1206
+ {
1207
+ name: 'all',
1208
+ title: 'All Items',
1209
+ fixed: true,
1210
+ columns: [],
1211
+ conditions: [],
1212
+ sorts: [],
1213
+ },
1214
+ ],
1215
+ },
1216
+ },
1217
+ },
1218
+ };
1219
+ return entityDef;
1220
+ }
1221
+
696
1222
  async function notificationTemplateEntityFactory(injector) {
697
1223
  const dataService = injector.get(NotificationManagementService);
698
1224
  const entityDef = {
@@ -987,6 +1513,11 @@ async function notificationTemplateEntityFactory(injector) {
987
1513
  return entityDef;
988
1514
  }
989
1515
 
1516
+ var notificationTemplate_entity = /*#__PURE__*/Object.freeze({
1517
+ __proto__: null,
1518
+ notificationTemplateEntityFactory: notificationTemplateEntityFactory
1519
+ });
1520
+
990
1521
  async function notificationEntityFactory(injector) {
991
1522
  const dataService = injector.get(NotificationManagementService);
992
1523
  const entityDef = {
@@ -1199,5 +1730,5 @@ var notification_entity = /*#__PURE__*/Object.freeze({
1199
1730
  * Generated bundle index. Do not edit.
1200
1731
  */
1201
1732
 
1202
- export { AXMNotificationManagementModule, AXMNotificationService, notificationChannelEntityFactory, notificationEntityFactory, notificationTemplateEntityFactory };
1733
+ export { AXMNotificationManagementModule, AXMNotificationService, myNotificationEntityFactory, notificationChannelEntityFactory, notificationEntityFactory, notificationLogEntityFactory, notificationTemplateEntityFactory };
1203
1734
  //# sourceMappingURL=acorex-modules-notification-management.mjs.map