@mediusinc/mng-commons 5.0.0-rc.1 → 5.0.0-rc.3

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 (245) hide show
  1. package/core/data-providers/base-data-provider.factory.d.ts +13 -0
  2. package/core/data-providers/base.data-provider.d.ts +2 -14
  3. package/core/descriptors/editor.descriptor.d.ts +1 -1
  4. package/core/descriptors/tableview.descriptor.d.ts +5 -5
  5. package/core/directives/component.directive.d.ts +2 -2
  6. package/core/index.d.ts +1 -0
  7. package/core/router/route-builder.d.ts +149 -26
  8. package/core/router/routes-builder.d.ts +28 -13
  9. package/core/security/permission.service.d.ts +1 -0
  10. package/core/services/commons-router.service.d.ts +3 -3
  11. package/core/services/commons.service.d.ts +31 -42
  12. package/core/services/tokens/module-config.token.d.ts +2 -2
  13. package/esm2022/core/components/notification/notification-wrapper.component.mjs +5 -5
  14. package/esm2022/core/components/pages/error/error.page.component.mjs +5 -5
  15. package/esm2022/core/components/pages/not-found/not-found.page.component.mjs +5 -5
  16. package/esm2022/core/data-providers/base-data-provider.factory.mjs +28 -0
  17. package/esm2022/core/data-providers/base.data-provider.mjs +1 -31
  18. package/esm2022/core/descriptors/editor.descriptor.mjs +1 -1
  19. package/esm2022/core/descriptors/tableview.descriptor.mjs +1 -1
  20. package/esm2022/core/directives/component.directive.mjs +12 -9
  21. package/esm2022/core/directives/dialog-keydown-handler.directive.mjs +3 -3
  22. package/esm2022/core/directives/template.directive.mjs +3 -3
  23. package/esm2022/core/index.mjs +2 -1
  24. package/esm2022/core/pipes/boolean.pipe.mjs +3 -3
  25. package/esm2022/core/pipes/class-map.pipe.mjs +3 -3
  26. package/esm2022/core/pipes/enum.pipe.mjs +3 -3
  27. package/esm2022/core/pipes/enumerate-async.pipe.mjs +3 -3
  28. package/esm2022/core/pipes/enumerate.pipe.mjs +3 -3
  29. package/esm2022/core/pipes/getter.pipe.mjs +3 -3
  30. package/esm2022/core/pipes/i18n-property.pipe.mjs +3 -3
  31. package/esm2022/core/pipes/json-path.pipe.mjs +3 -3
  32. package/esm2022/core/pipes/parametrize.pipe.mjs +3 -3
  33. package/esm2022/core/pipes/template.pipe.mjs +3 -3
  34. package/esm2022/core/router/route-builder.mjs +211 -84
  35. package/esm2022/core/router/routes-builder.mjs +41 -43
  36. package/esm2022/core/security/permission.service.mjs +7 -5
  37. package/esm2022/core/services/commons-init.service.mjs +5 -5
  38. package/esm2022/core/services/commons-router.service.mjs +18 -17
  39. package/esm2022/core/services/commons.service.mjs +112 -169
  40. package/esm2022/core/services/local-storage-config.service.mjs +3 -3
  41. package/esm2022/core/services/tokens/module-config.token.mjs +1 -1
  42. package/esm2022/filter/descriptors/filter-lookup.descriptor.mjs +4 -4
  43. package/esm2022/form/api/data-providers/lookup-data-provider.factory.mjs +31 -0
  44. package/esm2022/form/api/data-providers/lookup.data-provider.mjs +1 -31
  45. package/esm2022/form/api/index.mjs +2 -1
  46. package/esm2022/form/components/autocomplete/autocomplete.component.mjs +105 -102
  47. package/esm2022/form/components/date-range/date-range.component.mjs +3 -3
  48. package/esm2022/form/components/dropdown/dropdown.component.mjs +148 -90
  49. package/esm2022/form/directives/input-trim.directive.mjs +3 -3
  50. package/esm2022/model/data-providers/base-from-type-data-provider.factory.mjs +8 -0
  51. package/esm2022/model/descriptors/enum.descriptor.mjs +3 -6
  52. package/esm2022/model/descriptors/model.descriptor.mjs +22 -9
  53. package/esm2022/model/descriptors/type.descriptor.mjs +3 -9
  54. package/esm2022/model/index.mjs +3 -1
  55. package/esm2022/table/api/data-providers/table-data-provider.factory.mjs +33 -0
  56. package/esm2022/table/api/data-providers/table.data-provider.mjs +1 -31
  57. package/esm2022/table/api/descriptors/sort.descriptor.mjs +2 -2
  58. package/esm2022/table/api/descriptors/table-descriptor.factory.mjs +89 -0
  59. package/esm2022/table/api/descriptors/table.descriptor.mjs +4 -139
  60. package/esm2022/table/api/helpers/table-descriptor-helpers.mjs +97 -0
  61. package/esm2022/table/api/index.mjs +4 -1
  62. package/esm2022/table/components/column-filter-full/column-filter-full.component.mjs +8 -9
  63. package/esm2022/table/components/column-value/column-value.component.mjs +4 -4
  64. package/esm2022/table/components/table/table.component.mjs +7 -7
  65. package/esm2022/table/pipes/locale-default-row-class.pipe.mjs +5 -5
  66. package/esm2022/table/pipes/table-column-filter-class.pipe.mjs +3 -3
  67. package/esm2022/table/services/data-list.service.mjs +4 -4
  68. package/esm2022/tableview/action/components/action/action.component.mjs +142 -190
  69. package/esm2022/tableview/action/components/editor/action-editor.component.mjs +58 -68
  70. package/esm2022/tableview/action/components/editor/injector-context/action-editor-injector-context.component.mjs +133 -154
  71. package/esm2022/tableview/action/components/localization/data-language-dropdown.component.mjs +22 -40
  72. package/esm2022/tableview/action/components/route/action-route.component.mjs +21 -26
  73. package/esm2022/tableview/action/components/table/action-table.component.mjs +4 -4
  74. package/esm2022/tableview/action/models/execution/action-instance.model.mjs +1 -1
  75. package/esm2022/tableview/action/services/action-executor.service.mjs +10 -10
  76. package/esm2022/tableview/action/services/component-action-executor.service.mjs +3 -3
  77. package/esm2022/tableview/action/services/data-provider-executor.service.mjs +3 -3
  78. package/esm2022/tableview/action/services/navigation.service.mjs +6 -5
  79. package/esm2022/tableview/action/services/root-action-executor.service.mjs +3 -3
  80. package/esm2022/tableview/action/services/view-container.service.mjs +8 -24
  81. package/esm2022/tableview/api/action/descriptors/action-descriptor.factory.mjs +119 -0
  82. package/esm2022/tableview/api/action/descriptors/action-editor-descriptor.factory.mjs +77 -0
  83. package/esm2022/tableview/api/action/descriptors/action-editor.descriptor.mjs +28 -80
  84. package/esm2022/tableview/api/action/descriptors/action-link-descriptor.factory.mjs +45 -0
  85. package/esm2022/tableview/api/action/descriptors/action-link.descriptor.mjs +1 -32
  86. package/esm2022/tableview/api/action/descriptors/action.descriptor.mjs +3 -69
  87. package/esm2022/tableview/api/action/models/action-component.model.mjs +1 -1
  88. package/esm2022/tableview/api/action/models/execution/action-instance.model.mjs +1 -1
  89. package/esm2022/tableview/api/action/models/execution/view-container.model.mjs +1 -1
  90. package/esm2022/tableview/api/editor/data-providers/editor-data-provider.factory.mjs +33 -0
  91. package/esm2022/tableview/api/editor/data-providers/editor.data-provider.mjs +1 -31
  92. package/esm2022/tableview/api/editor/descriptors/editor-descriptor.factory.mjs +81 -0
  93. package/esm2022/tableview/api/editor/descriptors/editor.descriptor.mjs +24 -161
  94. package/esm2022/tableview/api/editor/descriptors/field-action.descriptor.mjs +1 -1
  95. package/esm2022/tableview/api/editor/descriptors/field-base.descriptor.mjs +13 -5
  96. package/esm2022/tableview/api/editor/descriptors/field-group.descriptor.mjs +3 -3
  97. package/esm2022/tableview/api/editor/descriptors/field-lookup.descriptor.mjs +4 -4
  98. package/esm2022/tableview/api/editor/descriptors/field-many.descriptor.mjs +3 -3
  99. package/esm2022/tableview/api/editor/descriptors/field-validation.descriptor.mjs +1 -1
  100. package/esm2022/tableview/api/editor/descriptors/field.descriptor.mjs +36 -7
  101. package/esm2022/tableview/api/editor/helpers/editor-descriptor-helpers.mjs +95 -0
  102. package/esm2022/tableview/api/editor/helpers/field-validators.mjs +17 -27
  103. package/esm2022/tableview/api/editor/models/editor-fields.model.mjs +1 -1
  104. package/esm2022/tableview/api/editor/models/field-action-context.model.mjs +1 -1
  105. package/esm2022/tableview/api/editor/models/field-validation.model.mjs +2 -0
  106. package/esm2022/tableview/api/editor/models/field.model.mjs +1 -1
  107. package/esm2022/tableview/api/editor/models/form-editor.event.mjs +1 -1
  108. package/esm2022/tableview/api/editor/models/form-editor.interface.mjs +1 -1
  109. package/esm2022/tableview/api/editor/models/formly-custom-field.model.mjs +3 -3
  110. package/esm2022/tableview/api/editor/models/formly-field.model.mjs +1 -1
  111. package/esm2022/tableview/api/index.mjs +11 -1
  112. package/esm2022/tableview/api/tableview/data-providers/tableview-data-provider.factory.mjs +47 -0
  113. package/esm2022/tableview/api/tableview/data-providers/tableview.data-provider.mjs +5 -46
  114. package/esm2022/tableview/api/tableview/descriptors/tableview-descriptor.factory.mjs +111 -0
  115. package/esm2022/tableview/api/tableview/descriptors/tableview.descriptor.mjs +26 -186
  116. package/esm2022/tableview/api/tableview/helpers/files-export.mjs +2 -2
  117. package/esm2022/tableview/api/tableview/helpers/tableview-create.mjs +5 -5
  118. package/esm2022/tableview/api/tableview/helpers/tableview-default-actions.mjs +53 -18
  119. package/esm2022/tableview/api/tableview/helpers/tableview-descriptor-helpers.mjs +110 -0
  120. package/esm2022/tableview/api/tableview/helpers/tableview-input-builder.mjs +2 -2
  121. package/esm2022/tableview/editor/components/editor/form-editor.component.mjs +163 -138
  122. package/esm2022/tableview/editor/components/formly/fields/formly-field-action/formly-field-action.component.mjs +9 -5
  123. package/esm2022/tableview/editor/components/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component.mjs +13 -16
  124. package/esm2022/tableview/editor/components/formly/fields/formly-field-custom/formly-field-custom.component.mjs +3 -3
  125. package/esm2022/tableview/editor/components/formly/fields/formly-field-datepicker/formly-field-datepicker.component.mjs +103 -0
  126. package/esm2022/tableview/editor/components/formly/fields/formly-field-dropdown/formly-field-dropdown.component.mjs +12 -16
  127. package/esm2022/tableview/editor/components/formly/fields/formly-field-fieldset/formly-field-fieldset.component.mjs +3 -3
  128. package/esm2022/tableview/editor/components/formly/fields/formly-field-input/formly-field-input.component.mjs +36 -53
  129. package/esm2022/tableview/editor/components/formly/fields/formly-field-label/formly-field-label.component.mjs +3 -3
  130. package/esm2022/tableview/editor/components/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.mjs +20 -24
  131. package/esm2022/tableview/editor/components/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.mjs +24 -28
  132. package/esm2022/tableview/editor/components/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.mjs +30 -31
  133. package/esm2022/tableview/editor/components/formly/fields/formly-field-tabs/formly-field-tabs.component.mjs +3 -3
  134. package/esm2022/tableview/editor/components/formly/wrappers/formly-field-no-label-wrapper/formly-field-no-label-wrapper.component.mjs +3 -3
  135. package/esm2022/tableview/editor/components/formly/wrappers/formly-field-wrapper/formly-field-wrapper.component.mjs +3 -3
  136. package/esm2022/tableview/editor/helpers/editor-formly.mjs +85 -56
  137. package/esm2022/tableview/editor/helpers/formly-config.mjs +5 -3
  138. package/esm2022/tableview/editor/models/formly-config.model.mjs +1 -1
  139. package/esm2022/tableview/editor/services/form-editor.service.mjs +96 -0
  140. package/esm2022/tableview/index.mjs +2 -1
  141. package/esm2022/tableview/tableview/components/route/tableview-route.component.mjs +10 -10
  142. package/esm2022/tableview/tableview/components/tableview/tableview.component.mjs +26 -43
  143. package/esm2022/tableview/tableview/router/tableview-route-builder.mjs +17 -43
  144. package/fesm2022/mediusinc-mng-commons-core.mjs +460 -390
  145. package/fesm2022/mediusinc-mng-commons-core.mjs.map +1 -1
  146. package/fesm2022/mediusinc-mng-commons-filter.mjs +3 -3
  147. package/fesm2022/mediusinc-mng-commons-filter.mjs.map +1 -1
  148. package/fesm2022/mediusinc-mng-commons-form-api.mjs +18 -18
  149. package/fesm2022/mediusinc-mng-commons-form-api.mjs.map +1 -1
  150. package/fesm2022/mediusinc-mng-commons-form.mjs +257 -195
  151. package/fesm2022/mediusinc-mng-commons-form.mjs.map +1 -1
  152. package/fesm2022/mediusinc-mng-commons-model.mjs +43 -33
  153. package/fesm2022/mediusinc-mng-commons-model.mjs.map +1 -1
  154. package/fesm2022/mediusinc-mng-commons-table-api.mjs +192 -146
  155. package/fesm2022/mediusinc-mng-commons-table-api.mjs.map +1 -1
  156. package/fesm2022/mediusinc-mng-commons-table.mjs +26 -27
  157. package/fesm2022/mediusinc-mng-commons-table.mjs.map +1 -1
  158. package/fesm2022/mediusinc-mng-commons-tableview-api.mjs +906 -665
  159. package/fesm2022/mediusinc-mng-commons-tableview-api.mjs.map +1 -1
  160. package/fesm2022/mediusinc-mng-commons-tableview.mjs +1015 -960
  161. package/fesm2022/mediusinc-mng-commons-tableview.mjs.map +1 -1
  162. package/form/api/data-providers/lookup-data-provider.factory.d.ts +18 -0
  163. package/form/api/data-providers/lookup.data-provider.d.ts +2 -14
  164. package/form/api/index.d.ts +1 -0
  165. package/form/components/autocomplete/autocomplete.component.d.ts +33 -24
  166. package/form/components/dropdown/dropdown.component.d.ts +38 -25
  167. package/model/data-providers/base-from-type-data-provider.factory.d.ts +8 -0
  168. package/model/descriptors/enum.descriptor.d.ts +1 -2
  169. package/model/descriptors/model.descriptor.d.ts +11 -4
  170. package/model/descriptors/type.descriptor.d.ts +2 -4
  171. package/model/index.d.ts +1 -0
  172. package/package.json +1 -1
  173. package/table/api/data-providers/table-data-provider.factory.d.ts +18 -0
  174. package/table/api/data-providers/table.data-provider.d.ts +2 -14
  175. package/table/api/descriptors/table-descriptor.factory.d.ts +44 -0
  176. package/table/api/descriptors/table.descriptor.d.ts +4 -65
  177. package/table/api/helpers/table-descriptor-helpers.d.ts +44 -0
  178. package/table/api/index.d.ts +3 -0
  179. package/table/components/column-filter-full/column-filter-full.component.d.ts +5 -4
  180. package/table/components/table/table.component.d.ts +11 -11
  181. package/table/services/data-list.service.d.ts +9 -10
  182. package/tableview/action/components/action/action.component.d.ts +37 -44
  183. package/tableview/action/components/editor/action-editor.component.d.ts +20 -18
  184. package/tableview/action/components/editor/injector-context/action-editor-injector-context.component.d.ts +24 -26
  185. package/tableview/action/components/localization/data-language-dropdown.component.d.ts +11 -14
  186. package/tableview/action/components/route/action-route.component.d.ts +7 -12
  187. package/tableview/action/components/table/action-table.component.d.ts +3 -3
  188. package/tableview/action/models/execution/action-instance.model.d.ts +2 -1
  189. package/tableview/action/services/view-container.service.d.ts +3 -9
  190. package/tableview/api/action/descriptors/action-descriptor.factory.d.ts +36 -0
  191. package/tableview/api/action/descriptors/action-editor-descriptor.factory.d.ts +31 -0
  192. package/tableview/api/action/descriptors/action-editor.descriptor.d.ts +25 -37
  193. package/tableview/api/action/descriptors/action-link-descriptor.factory.d.ts +15 -0
  194. package/tableview/api/action/descriptors/action-link.descriptor.d.ts +1 -9
  195. package/tableview/api/action/descriptors/action.descriptor.d.ts +4 -27
  196. package/tableview/api/action/models/action-component.model.d.ts +8 -8
  197. package/tableview/api/action/models/execution/action-instance.model.d.ts +2 -1
  198. package/tableview/api/action/models/execution/view-container.model.d.ts +4 -3
  199. package/tableview/api/editor/data-providers/editor-data-provider.factory.d.ts +18 -0
  200. package/tableview/api/editor/data-providers/editor.data-provider.d.ts +2 -14
  201. package/tableview/api/editor/descriptors/editor-descriptor.factory.d.ts +44 -0
  202. package/tableview/api/editor/descriptors/editor.descriptor.d.ts +44 -105
  203. package/tableview/api/editor/descriptors/field-action.descriptor.d.ts +3 -3
  204. package/tableview/api/editor/descriptors/field-base.descriptor.d.ts +35 -33
  205. package/tableview/api/editor/descriptors/field-group.descriptor.d.ts +8 -7
  206. package/tableview/api/editor/descriptors/field-lookup.descriptor.d.ts +2 -2
  207. package/tableview/api/editor/descriptors/field-many.descriptor.d.ts +8 -8
  208. package/tableview/api/editor/descriptors/field-validation.descriptor.d.ts +10 -13
  209. package/tableview/api/editor/descriptors/field.descriptor.d.ts +16 -1
  210. package/tableview/api/editor/helpers/editor-descriptor-helpers.d.ts +43 -0
  211. package/tableview/api/editor/helpers/field-validators.d.ts +7 -3
  212. package/tableview/api/editor/models/editor-fields.model.d.ts +25 -21
  213. package/tableview/api/editor/models/field-action-context.model.d.ts +10 -8
  214. package/tableview/api/editor/models/field-validation.model.d.ts +26 -0
  215. package/tableview/api/editor/models/field.model.d.ts +0 -10
  216. package/tableview/api/editor/models/form-editor.event.d.ts +26 -16
  217. package/tableview/api/editor/models/form-editor.interface.d.ts +38 -8
  218. package/tableview/api/editor/models/formly-custom-field.model.d.ts +1 -1
  219. package/tableview/api/editor/models/formly-field.model.d.ts +9 -7
  220. package/tableview/api/index.d.ts +10 -0
  221. package/tableview/api/tableview/data-providers/tableview-data-provider.factory.d.ts +25 -0
  222. package/tableview/api/tableview/data-providers/tableview.data-provider.d.ts +3 -20
  223. package/tableview/api/tableview/descriptors/tableview-descriptor.factory.d.ts +49 -0
  224. package/tableview/api/tableview/descriptors/tableview.descriptor.d.ts +41 -102
  225. package/tableview/api/tableview/helpers/tableview-create.d.ts +2 -2
  226. package/tableview/api/tableview/helpers/tableview-default-actions.d.ts +4 -2
  227. package/tableview/api/tableview/helpers/tableview-descriptor-helpers.d.ts +42 -0
  228. package/tableview/api/tableview/helpers/tableview-input-builder.d.ts +1 -1
  229. package/tableview/editor/components/editor/form-editor.component.d.ts +54 -36
  230. package/tableview/editor/components/formly/fields/formly-field-action/formly-field-action.component.d.ts +5 -3
  231. package/tableview/editor/components/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component.d.ts +1 -0
  232. package/tableview/editor/components/formly/fields/formly-field-datepicker/formly-field-datepicker.component.d.ts +22 -0
  233. package/tableview/editor/components/formly/fields/formly-field-dropdown/formly-field-dropdown.component.d.ts +1 -1
  234. package/tableview/editor/components/formly/fields/formly-field-input/formly-field-input.component.d.ts +5 -7
  235. package/tableview/editor/components/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.d.ts +1 -1
  236. package/tableview/editor/components/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.d.ts +3 -4
  237. package/tableview/editor/components/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.d.ts +3 -5
  238. package/tableview/editor/helpers/editor-formly.d.ts +11 -10
  239. package/tableview/editor/models/formly-config.model.d.ts +1 -1
  240. package/tableview/editor/services/form-editor.service.d.ts +39 -0
  241. package/tableview/index.d.ts +1 -0
  242. package/tableview/tableview/components/route/tableview-route.component.d.ts +2 -2
  243. package/tableview/tableview/components/tableview/tableview.component.d.ts +11 -10
  244. package/tableview/tableview/router/tableview-route-builder.d.ts +7 -13
  245. package/version-info.json +11 -0
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, Directive, computed, signal, Component, ChangeDetectionStrategy, InjectionToken, Injectable, Injector, ElementRef, ApplicationRef, ViewContainerRef, EventEmitter, createComponent, Input, Output, TemplateRef, booleanAttribute, numberAttribute, Pipe, APP_INITIALIZER, ErrorHandler } from '@angular/core';
2
+ import { inject, Directive, computed, signal, Component, ChangeDetectionStrategy, InjectionToken, DestroyRef, effect, Injectable, Injector, ElementRef, ApplicationRef, ViewContainerRef, EventEmitter, EnvironmentInjector, createComponent, Input, Output, TemplateRef, booleanAttribute, numberAttribute, Pipe, APP_INITIALIZER, ErrorHandler } from '@angular/core';
3
3
  import * as i3$1 from '@ngx-translate/core';
4
4
  import { TranslateModule, TranslateService } from '@ngx-translate/core';
5
5
  import * as i3 from 'primeng/confirmdialog';
@@ -10,16 +10,16 @@ import * as i1 from 'primeng/toast';
10
10
  import { ToastModule } from 'primeng/toast';
11
11
  import { DialogService, DynamicDialogComponent } from 'primeng/dynamicdialog';
12
12
  import * as i2 from 'primeng/api';
13
- import { PrimeNGConfig, FilterService, MessageService, ConfirmationService } from 'primeng/api';
14
- import * as i1$1 from '@angular/router';
13
+ import { PrimeNGConfig, MessageService, ConfirmationService } from 'primeng/api';
15
14
  import { Router, NavigationEnd, RouterLink, NavigationStart, RouteConfigLoadStart, RouteConfigLoadEnd, NavigationCancel, NavigationError } from '@angular/router';
16
15
  import * as i2$1 from 'primeng/button';
17
16
  import { ButtonModule } from 'primeng/button';
17
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
18
18
  import { Title } from '@angular/platform-browser';
19
- import { BehaviorSubject, ReplaySubject, distinctUntilChanged, isObservable, of, mergeMap, combineLatest, Observable, tap, Subject, take, throwError } from 'rxjs';
20
19
  import { filter, map, first, catchError } from 'rxjs/operators';
21
20
  import { DatePipe } from '@angular/common';
22
21
  import { HttpErrorResponse, HttpClient, HttpBackend } from '@angular/common/http';
22
+ import { isObservable, of, mergeMap, combineLatest, Observable, tap, ReplaySubject, Subject, take, throwError } from 'rxjs';
23
23
  import 'reflect-metadata';
24
24
 
25
25
  class DialogKeydownHandlerDirective {
@@ -56,10 +56,10 @@ class DialogKeydownHandlerDirective {
56
56
  }
57
57
  this.dialogsWithKeydownListener.forEach(c => c.bindDocumentKeydownListener());
58
58
  }
59
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: DialogKeydownHandlerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
60
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.2", type: DialogKeydownHandlerDirective, isStandalone: true, selector: "[mngDialogKeydownHandler]", ngImport: i0 }); }
59
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: DialogKeydownHandlerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
60
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.4", type: DialogKeydownHandlerDirective, isStandalone: true, selector: "[mngDialogKeydownHandler]", ngImport: i0 }); }
61
61
  }
62
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: DialogKeydownHandlerDirective, decorators: [{
62
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: DialogKeydownHandlerDirective, decorators: [{
63
63
  type: Directive,
64
64
  args: [{
65
65
  standalone: true,
@@ -97,12 +97,12 @@ class NotificationWrapperComponent {
97
97
  this.dialogNotification.set(null);
98
98
  }
99
99
  }
100
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: NotificationWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
101
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.2", type: NotificationWrapperComponent, isStandalone: true, selector: "mng-notification-wrapper", ngImport: i0, template: "<ng-content></ng-content>\n<p-confirmDialog appendTo=\"body\" [baseZIndex]=\"50\"></p-confirmDialog>\n\n<p-toast [baseZIndex]=\"50\">\n <ng-template let-message pTemplate=\"message\">\n <span [class]=\"'p-toast-message-icon pi ' + getNotificationIconClass(message)\"></span>\n <div class=\"p-toast-message-text\">\n <div class=\"p-toast-summary\">{{ message.summary }}</div>\n <div class=\"p-toast-detail\">{{ message.detail.slice(0, notificationCutoff) + (message.detail.length > notificationCutoff ? '...' : '') }}</div>\n @if (message.detail.length > notificationCutoff) {\n <div (click)=\"onShowNotificationInDialog(message)\" class=\"p-link font-semibold text-sm mt-2 flex align-items-center\">\n <i class=\"pi pi-chevron-down mr-1\"></i>{{ 'notification.details' | translate }}\n </div>\n }\n </div>\n </ng-template>\n</p-toast>\n\n<p-dialog\n [visible]=\"isDialogNotificationVisible()\"\n (visibleChange)=\"onDialogNotificationVisibilityChange($event)\"\n [styleClass]=\"'p-fluid mng-dialog mng-dialog-xs ' + 'mng-message-detail-dialog mng-message-detail-dialog-' + (dialogNotification()?.severity ?? '')\">\n <ng-template pTemplate=\"header\" mngDialogKeydownHandler>\n <span class=\"p-dialog-title font-bold mng-dialog-success\">\n <span [class]=\"'mr-2 pi ' + getNotificationIconClass(dialogNotification())\"></span>\n {{ dialogNotification()?.summary ?? '' }}\n </span>\n </ng-template>\n <div>\n {{ dialogNotification()?.detail ?? '' }}\n </div>\n</p-dialog>\n", dependencies: [{ kind: "ngmodule", type: ToastModule }, { kind: "component", type: i1.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "life", "style", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "breakpoints"], outputs: ["onClose"] }, { kind: "directive", type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "ngmodule", type: ConfirmDialogModule }, { kind: "component", type: i3.ConfirmDialog, selector: "p-confirmDialog", inputs: ["header", "icon", "message", "style", "styleClass", "maskStyleClass", "acceptIcon", "acceptLabel", "closeAriaLabel", "acceptAriaLabel", "acceptVisible", "rejectIcon", "rejectLabel", "rejectAriaLabel", "rejectVisible", "acceptButtonStyleClass", "rejectButtonStyleClass", "closeOnEscape", "dismissableMask", "blockScroll", "rtl", "closable", "appendTo", "key", "autoZIndex", "baseZIndex", "transitionOptions", "focusTrap", "defaultFocus", "breakpoints", "visible", "position"], outputs: ["onHide"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i3$1.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: DialogModule }, { kind: "component", type: i5.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "visible", "style", "position"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "directive", type: DialogKeydownHandlerDirective, selector: "[mngDialogKeydownHandler]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
100
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: NotificationWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
101
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.4", type: NotificationWrapperComponent, isStandalone: true, selector: "mng-notification-wrapper", ngImport: i0, template: "<ng-content></ng-content>\n<p-confirmDialog appendTo=\"body\" [baseZIndex]=\"50\"></p-confirmDialog>\n\n<p-toast [baseZIndex]=\"50\">\n <ng-template let-message pTemplate=\"message\">\n <span [class]=\"'p-toast-message-icon pi ' + getNotificationIconClass(message)\"></span>\n <div class=\"p-toast-message-text\">\n <div class=\"p-toast-summary\">{{ message.summary }}</div>\n @if (message.detail) {\n <div class=\"p-toast-detail\">{{ message.detail.slice(0, notificationCutoff) + (message.detail.length > notificationCutoff ? '...' : '') }}</div>\n @if (message.detail.length > notificationCutoff) {\n <div (click)=\"onShowNotificationInDialog(message)\" class=\"p-link font-semibold text-sm mt-2 flex align-items-center\">\n <i class=\"pi pi-chevron-down mr-1\"></i>{{ 'notification.details' | translate }}\n </div>\n }\n }\n </div>\n </ng-template>\n</p-toast>\n\n<p-dialog\n [visible]=\"isDialogNotificationVisible()\"\n (visibleChange)=\"onDialogNotificationVisibilityChange($event)\"\n [styleClass]=\"'p-fluid mng-dialog mng-dialog-xs ' + 'mng-message-detail-dialog mng-message-detail-dialog-' + (dialogNotification()?.severity ?? '')\">\n <ng-template pTemplate=\"header\" mngDialogKeydownHandler>\n <span class=\"p-dialog-title font-bold mng-dialog-success\">\n <span [class]=\"'mr-2 pi ' + getNotificationIconClass(dialogNotification())\"></span>\n {{ dialogNotification()?.summary ?? '' }}\n </span>\n </ng-template>\n <div>\n {{ dialogNotification()?.detail ?? '' }}\n </div>\n</p-dialog>\n", dependencies: [{ kind: "ngmodule", type: ToastModule }, { kind: "component", type: i1.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "life", "style", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "breakpoints"], outputs: ["onClose"] }, { kind: "directive", type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "ngmodule", type: ConfirmDialogModule }, { kind: "component", type: i3.ConfirmDialog, selector: "p-confirmDialog", inputs: ["header", "icon", "message", "style", "styleClass", "maskStyleClass", "acceptIcon", "acceptLabel", "closeAriaLabel", "acceptAriaLabel", "acceptVisible", "rejectIcon", "rejectLabel", "rejectAriaLabel", "rejectVisible", "acceptButtonStyleClass", "rejectButtonStyleClass", "closeOnEscape", "dismissableMask", "blockScroll", "rtl", "closable", "appendTo", "key", "autoZIndex", "baseZIndex", "transitionOptions", "focusTrap", "defaultFocus", "breakpoints", "visible", "position"], outputs: ["onHide"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i3$1.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: DialogModule }, { kind: "component", type: i5.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "visible", "style", "position"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "directive", type: DialogKeydownHandlerDirective, selector: "[mngDialogKeydownHandler]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
102
102
  }
103
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: NotificationWrapperComponent, decorators: [{
103
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: NotificationWrapperComponent, decorators: [{
104
104
  type: Component,
105
- args: [{ selector: 'mng-notification-wrapper', standalone: true, imports: [ToastModule, ConfirmDialogModule, TranslateModule, DialogModule, DialogKeydownHandlerDirective], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>\n<p-confirmDialog appendTo=\"body\" [baseZIndex]=\"50\"></p-confirmDialog>\n\n<p-toast [baseZIndex]=\"50\">\n <ng-template let-message pTemplate=\"message\">\n <span [class]=\"'p-toast-message-icon pi ' + getNotificationIconClass(message)\"></span>\n <div class=\"p-toast-message-text\">\n <div class=\"p-toast-summary\">{{ message.summary }}</div>\n <div class=\"p-toast-detail\">{{ message.detail.slice(0, notificationCutoff) + (message.detail.length > notificationCutoff ? '...' : '') }}</div>\n @if (message.detail.length > notificationCutoff) {\n <div (click)=\"onShowNotificationInDialog(message)\" class=\"p-link font-semibold text-sm mt-2 flex align-items-center\">\n <i class=\"pi pi-chevron-down mr-1\"></i>{{ 'notification.details' | translate }}\n </div>\n }\n </div>\n </ng-template>\n</p-toast>\n\n<p-dialog\n [visible]=\"isDialogNotificationVisible()\"\n (visibleChange)=\"onDialogNotificationVisibilityChange($event)\"\n [styleClass]=\"'p-fluid mng-dialog mng-dialog-xs ' + 'mng-message-detail-dialog mng-message-detail-dialog-' + (dialogNotification()?.severity ?? '')\">\n <ng-template pTemplate=\"header\" mngDialogKeydownHandler>\n <span class=\"p-dialog-title font-bold mng-dialog-success\">\n <span [class]=\"'mr-2 pi ' + getNotificationIconClass(dialogNotification())\"></span>\n {{ dialogNotification()?.summary ?? '' }}\n </span>\n </ng-template>\n <div>\n {{ dialogNotification()?.detail ?? '' }}\n </div>\n</p-dialog>\n" }]
105
+ args: [{ selector: 'mng-notification-wrapper', standalone: true, imports: [ToastModule, ConfirmDialogModule, TranslateModule, DialogModule, DialogKeydownHandlerDirective], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>\n<p-confirmDialog appendTo=\"body\" [baseZIndex]=\"50\"></p-confirmDialog>\n\n<p-toast [baseZIndex]=\"50\">\n <ng-template let-message pTemplate=\"message\">\n <span [class]=\"'p-toast-message-icon pi ' + getNotificationIconClass(message)\"></span>\n <div class=\"p-toast-message-text\">\n <div class=\"p-toast-summary\">{{ message.summary }}</div>\n @if (message.detail) {\n <div class=\"p-toast-detail\">{{ message.detail.slice(0, notificationCutoff) + (message.detail.length > notificationCutoff ? '...' : '') }}</div>\n @if (message.detail.length > notificationCutoff) {\n <div (click)=\"onShowNotificationInDialog(message)\" class=\"p-link font-semibold text-sm mt-2 flex align-items-center\">\n <i class=\"pi pi-chevron-down mr-1\"></i>{{ 'notification.details' | translate }}\n </div>\n }\n }\n </div>\n </ng-template>\n</p-toast>\n\n<p-dialog\n [visible]=\"isDialogNotificationVisible()\"\n (visibleChange)=\"onDialogNotificationVisibilityChange($event)\"\n [styleClass]=\"'p-fluid mng-dialog mng-dialog-xs ' + 'mng-message-detail-dialog mng-message-detail-dialog-' + (dialogNotification()?.severity ?? '')\">\n <ng-template pTemplate=\"header\" mngDialogKeydownHandler>\n <span class=\"p-dialog-title font-bold mng-dialog-success\">\n <span [class]=\"'mr-2 pi ' + getNotificationIconClass(dialogNotification())\"></span>\n {{ dialogNotification()?.summary ?? '' }}\n </span>\n </ng-template>\n <div>\n {{ dialogNotification()?.detail ?? '' }}\n </div>\n</p-dialog>\n" }]
106
106
  }] });
107
107
 
108
108
  class ACommonsErrorBase extends Error {
@@ -398,190 +398,127 @@ const BROWSER_STORAGE_IT = new InjectionToken('BROWSER_STORAGE');
398
398
  const COMMONS_MODULE_CONFIG_IT = new InjectionToken('COMMONS_MODULE_CONFIG');
399
399
 
400
400
  class CommonsService {
401
- constructor() {
402
- // internal
403
- this.logger = inject(LoggerService).create('CommonsService');
404
- this.router = inject(Router);
405
- this.primengConfig = inject(PrimeNGConfig);
406
- this.translate = inject(TranslateService);
407
- this.titleService = inject(Title);
408
- this.filterService = inject(FilterService);
409
- this.moduleConfig = inject(COMMONS_MODULE_CONFIG_IT, { optional: true });
410
- this.localStorage = inject(BROWSER_STORAGE_IT);
411
- // breadcrumbs
412
- this.breadcrumbHomeSubject = new BehaviorSubject({
413
- icon: 'pi pi-home',
414
- routerLink: '/'
415
- });
416
- this.breadcrumbsSubject = new BehaviorSubject([]);
417
- // visual
418
- this._colorScheme = 'light';
419
- this.userSubject = new ReplaySubject(1);
420
- this._userRoles = [];
421
- this.userRolesSubject = new BehaviorSubject([]);
422
- // language
423
- this.languageSubject = new ReplaySubject(1);
424
- this.dataLanguageSubject = new ReplaySubject(1);
425
- }
426
- // APP section
427
- get appName() {
428
- return this.moduleConfig?.app?.name ?? 'app.name';
429
- }
430
- get appOwner() {
431
- return this.moduleConfig?.app?.owner ?? 'app.owner';
432
- }
433
- get appLogoLight() {
434
- return this.moduleConfig?.app?.logoPathLight ? this.moduleConfig.app.logoPathLight : this.moduleConfig?.app?.logoPath ?? 'assets/layout/images/logo.png';
435
- }
436
- get appLogoDark() {
437
- return this.moduleConfig?.app?.logoPathDark ? this.moduleConfig.app.logoPathDark : this.moduleConfig?.app?.logoPath ?? 'assets/layout/images/logo.png';
438
- }
439
- get appLogoNameLight() {
440
- return this.moduleConfig?.app?.logoNamePathLight
441
- ? this.moduleConfig.app.logoNamePathLight
442
- : this.moduleConfig?.app?.logoNamePath ?? 'assets/layout/images/logo-appname.png';
443
- }
444
- get appLogoNameDark() {
445
- return this.moduleConfig?.app?.logoNamePathDark ? this.moduleConfig.app.logoNamePathDark : this.moduleConfig?.app?.logoNamePath ?? 'assets/layout/images/logo-appname.png';
446
- }
447
- get appLanguages() {
448
- return this.moduleConfig?.app?.languages ?? ['en'];
401
+ getDefaultLocale() {
402
+ const browserLang = this.translate.getBrowserLang();
403
+ if (browserLang && this.appLocales().some(l => l === browserLang)) {
404
+ return browserLang;
405
+ }
406
+ return this.appLocales()?.length > 0 ? this.appLocales()[0] : 'en';
449
407
  }
450
- get appLanguage() {
408
+ initAppLocale() {
451
409
  const lsLang = this.localStorage.getItem('lang');
452
- if (lsLang && this.appLanguages.some(l => l === lsLang)) {
410
+ if (lsLang && this.appLocales().some(l => l === lsLang)) {
453
411
  return lsLang;
454
412
  }
455
- return null;
413
+ return this.getDefaultLocale();
456
414
  }
457
- set appLanguage(language) {
458
- if (language === null) {
459
- this.localStorage.removeItem('lang');
460
- this.languageSubject.next(language);
461
- return;
462
- }
463
- if (this.appLanguages.some(l => l === language)) {
464
- this.localStorage.setItem('lang', language);
465
- this.languageSubject.next(language);
415
+ setAppLocale(language) {
416
+ if (this.appLocales().some(l => l === language)) {
466
417
  this.translate.use(language);
418
+ this._appLocale.set(language);
419
+ if (language !== this.getDefaultLocale())
420
+ this.localStorage.setItem('lang', language);
421
+ else
422
+ this.localStorage.removeItem('lang');
467
423
  }
468
424
  }
469
- get appLanguage$() {
470
- return this.languageSubject.asObservable().pipe(distinctUntilChanged());
471
- }
472
- initLanguage() {
473
- const browserLang = this.translate.getBrowserLang();
474
- if (browserLang && this.appLanguages.some(l => l === browserLang)) {
475
- this.appLanguage = browserLang;
476
- return browserLang;
477
- }
478
- const defaultLanguage = this.appLanguages?.length > 0 ? this.appLanguages[0] : 'en';
479
- this.appLanguage = defaultLanguage;
480
- return defaultLanguage;
481
- }
482
- getOrInitLanguage() {
483
- return this.appLanguage || this.initLanguage();
484
- }
485
- get appDataLanguages() {
486
- return this.moduleConfig?.app?.dataLanguages ?? ['en'];
425
+ clearAppLocale() {
426
+ this.localStorage.removeItem('lang');
427
+ this._appLocale.set(this.getDefaultLocale());
487
428
  }
488
- get appDataLanguageDefault() {
489
- return this.appDataLanguages[0];
490
- }
491
- get appDataLanguage() {
429
+ initAppDataLocale() {
492
430
  const dataLang = this.localStorage.getItem('dataLang');
493
- if (dataLang && this.appDataLanguages.some(dl => dl === dataLang)) {
431
+ if (dataLang && this.appDataLocales().some(dl => dl === dataLang)) {
494
432
  return dataLang;
495
433
  }
496
- return this.defaultDataLanguage;
434
+ return this.appDataLocales()?.length > 0 ? this.getDefaultLocale() : 'en';
497
435
  }
498
- set appDataLanguage(dataLanguage) {
499
- if (dataLanguage === null) {
500
- this.localStorage.removeItem('dataLang');
501
- this.dataLanguageSubject.next(dataLanguage);
502
- return;
503
- }
504
- if (this.appDataLanguages.some(dl => dl === dataLanguage)) {
505
- this.localStorage.setItem('dataLang', dataLanguage);
506
- this.dataLanguageSubject.next(dataLanguage);
436
+ setAppDataLocale(dataLocale) {
437
+ if (this.appDataLocales().some(dl => dl === dataLocale)) {
438
+ this._appDataLocale.set(dataLocale);
439
+ if (dataLocale !== this.getDefaultLocale())
440
+ this.localStorage.setItem('dataLang', dataLocale);
441
+ else
442
+ this.localStorage.removeItem('dataLang');
507
443
  }
508
444
  }
509
- get appDataLanguage$() {
510
- return this.dataLanguageSubject.asObservable().pipe(distinctUntilChanged());
511
- }
512
- // We assume, that default data language is the first one from the array of all available data languages
513
- get defaultDataLanguage() {
514
- return this.appDataLanguages[0];
515
- }
516
- get appVersion() {
517
- return this.moduleConfig?.app?.version;
518
- }
519
- // BREADCRUMB section
520
- get breadcrumbHome$() {
521
- return this.breadcrumbHomeSubject.asObservable();
445
+ clearAppDataLocale() {
446
+ this.localStorage.removeItem('lang');
447
+ this._appDataLocale.set(this.getDefaultLocale());
522
448
  }
523
- get breadcrumbs$() {
524
- return this.breadcrumbsSubject.asObservable();
525
- }
526
- // VISUAL section
527
- get colorSchemeIsLight() {
528
- return this._colorScheme === 'light';
529
- }
530
- get colorSchemeIsDark() {
531
- return this._colorScheme === 'dark';
532
- }
533
- // USER section
534
- get user() {
535
- return this._user;
536
- }
537
- set user(user) {
538
- this._user = user;
539
- this.userSubject.next(user);
540
- }
541
- get user$() {
542
- return this.userSubject.asObservable();
543
- }
544
- get userRoles() {
545
- return this._userRoles;
546
- }
547
- set userRoles(roles) {
548
- this._userRoles = roles;
549
- this.userRolesSubject.next(roles);
550
- }
551
- get userRoles$() {
552
- return this.userRolesSubject.asObservable();
553
- }
554
- reset() {
449
+ constructor() {
450
+ // internal
451
+ this.logger = inject(LoggerService).create('CommonsService');
452
+ this.router = inject(Router);
453
+ this.primengConfig = inject(PrimeNGConfig);
454
+ this.translate = inject(TranslateService);
455
+ this.titleService = inject(Title);
456
+ this.moduleConfig = inject(COMMONS_MODULE_CONFIG_IT, { optional: true });
457
+ this.localStorage = inject(BROWSER_STORAGE_IT);
458
+ this.destroyRef = inject(DestroyRef);
459
+ // breadcrumbs
460
+ this.breadcrumbHome = signal({
461
+ icon: 'pi pi-home',
462
+ routerLink: '/'
463
+ });
464
+ this.breadcrumbs = signal([]);
555
465
  // visual
556
- this._colorScheme = this.moduleConfig?.app?.colorScheme ?? 'light';
466
+ this.colorScheme = signal(this.moduleConfig?.app?.colorScheme ?? 'light');
467
+ this.colorSchemeIsLight = computed(() => this.colorScheme() === 'light');
468
+ // user
469
+ this.user = signal(undefined);
470
+ this.userRoles = signal([]);
471
+ // APP section
472
+ this.appName = signal(this.moduleConfig?.app?.name ?? 'app.name');
473
+ this.appOwner = signal(this.moduleConfig?.app?.owner ?? 'app.owner');
474
+ this.appLogoLight = signal(this.moduleConfig?.app?.logoPathLight ? this.moduleConfig.app.logoPathLight : this.moduleConfig?.app?.logoPath ?? 'assets/layout/images/logo.png');
475
+ this.appLogoDark = signal(this.moduleConfig?.app?.logoPathDark ? this.moduleConfig.app.logoPathDark : this.moduleConfig?.app?.logoPath ?? 'assets/layout/images/logo.png');
476
+ this.appLogo = computed(() => (this.colorSchemeIsLight() ? this.appLogoDark() : this.appLogoLight()));
477
+ this.appLogoNameLight = signal(this.moduleConfig?.app?.logoPathDark ? this.moduleConfig.app.logoPathDark : this.moduleConfig?.app?.logoPath ?? 'assets/layout/images/logo.png');
478
+ this.appLogoNameDark = signal(this.moduleConfig?.app?.logoNamePathDark ? this.moduleConfig.app.logoNamePathDark : this.moduleConfig?.app?.logoNamePath ?? 'assets/layout/images/logo-appname.png');
479
+ this.appLogoName = computed(() => (this.colorSchemeIsLight() ? this.appLogoNameDark() : this.appLogoNameLight()));
480
+ this.appLocales = signal(this.moduleConfig?.app?.locales ?? ['en']);
481
+ this._appLocale = signal(this.initAppLocale());
482
+ this.appLocale = computed(() => this._appLocale());
483
+ this.appDataLocales = signal(this.moduleConfig?.app?.dataLocales ?? ['en']);
484
+ this._appDataLocale = signal(this.initAppDataLocale());
485
+ this.appDataLocale = computed(() => this._appDataLocale());
486
+ this.appVersion = signal(this.moduleConfig?.app?.version);
557
487
  // ripple
558
488
  this.primengConfig.ripple = true;
559
- // translate
560
- this.translate.langs = this.appLanguages;
561
- const lang = this.getOrInitLanguage();
562
- this.languageSubject.next(lang);
563
- this.dataLanguageSubject.next(this.appDataLanguage);
564
- this.translate.use(lang);
565
- this.translate.get('mngPrime').subscribe(value => this.primengConfig.setTranslation(value));
566
- this.routerEventsSubscription?.unsubscribe();
567
- this.routerEventsSubscription = this.router.events
489
+ effect(() => {
490
+ const appLocales = this.appLocales();
491
+ if (appLocales) {
492
+ this.setAppLocale(this.initAppLocale());
493
+ this.translate.langs = this.appLocales();
494
+ }
495
+ const appDataLocales = this.appDataLocales();
496
+ if (appDataLocales)
497
+ this.setAppDataLocale(this.initAppDataLocale());
498
+ }, { allowSignalWrites: true });
499
+ this.router.events
568
500
  .pipe(
569
501
  // Filter the NavigationEnd events as the breadcrumb is updated only when the route reaches its end
570
- filter(event => event instanceof NavigationEnd))
502
+ filter(event => event instanceof NavigationEnd), takeUntilDestroyed())
571
503
  .subscribe(() => {
572
504
  this.updateBreadcrumbs();
573
505
  this.setPageTitle();
574
506
  });
575
- this.translateLangChangeSubscription?.unsubscribe();
576
- this.translateLangChangeSubscription = this.translate.onLangChange.subscribe(() => {
507
+ this.translate.onLangChange.pipe(takeUntilDestroyed()).subscribe(() => {
577
508
  this.updateBreadcrumbs();
578
509
  this.setPageTitle();
579
510
  });
580
- this.logger.debug('Reset');
511
+ this.translate
512
+ .stream('mngPrime')
513
+ .pipe(takeUntilDestroyed())
514
+ .subscribe(value => this.primengConfig.setTranslation(value));
515
+ }
516
+ initialize() {
517
+ this.logger.debug('Initialize');
581
518
  }
582
519
  // BREADCRUMB actions
583
520
  findBreadcrumbItem(item) {
584
- const items = this.breadcrumbsSubject.value;
521
+ const items = this.breadcrumbs();
585
522
  if (item.id) {
586
523
  return items.find(i => i.id && i.id === item.id) ?? null;
587
524
  }
@@ -601,7 +538,7 @@ class CommonsService {
601
538
  return null;
602
539
  }
603
540
  updateBreadcrumbItem(item) {
604
- const items = [...this.breadcrumbsSubject.value];
541
+ const items = [...this.breadcrumbs()];
605
542
  let posIdx = -1;
606
543
  if (item.id) {
607
544
  posIdx = items.findIndex(i => i.id && i.id === item.id);
@@ -627,7 +564,7 @@ class CommonsService {
627
564
  ...item,
628
565
  updated: true
629
566
  };
630
- this.breadcrumbsSubject.next(items);
567
+ this.breadcrumbs.set(items);
631
568
  return true;
632
569
  }
633
570
  updateBreadcrumbs() {
@@ -643,13 +580,16 @@ class CommonsService {
643
580
  const homeBreadcrumb = this.generateHomeBreadcrumb(rootRoute);
644
581
  if (homeBreadcrumb) {
645
582
  if (homeBreadcrumb.label) {
646
- this.breadcrumbHomeTranslateSubscription = this.translate.get(homeBreadcrumb.label).subscribe(i18n => {
583
+ this.breadcrumbHomeTranslateSubscription = this.translate
584
+ .get(homeBreadcrumb.label)
585
+ .pipe(takeUntilDestroyed(this.destroyRef))
586
+ .subscribe(i18n => {
647
587
  homeBreadcrumb.label = i18n;
648
- this.breadcrumbHomeSubject.next(homeBreadcrumb);
588
+ this.breadcrumbHome.set(homeBreadcrumb);
649
589
  });
650
590
  }
651
591
  else {
652
- this.breadcrumbHomeSubject.next(homeBreadcrumb);
592
+ this.breadcrumbHome.set(homeBreadcrumb);
653
593
  }
654
594
  }
655
595
  const breadcrumbs = [];
@@ -659,7 +599,10 @@ class CommonsService {
659
599
  });
660
600
  const i18nKeys = breadcrumbs.filter(b => typeof b.label === 'string').map(b => b.label);
661
601
  if (i18nKeys.length > 0) {
662
- this.breadcrumbsTranslateSubscription = this.translate.get(i18nKeys).subscribe(i18n => {
602
+ this.breadcrumbsTranslateSubscription = this.translate
603
+ .get(i18nKeys)
604
+ .pipe(takeUntilDestroyed(this.destroyRef))
605
+ .subscribe(i18n => {
663
606
  // Construct the breadcrumb hierarchy
664
607
  breadcrumbs.forEach(b => {
665
608
  if (b.label && i18n[b.label]) {
@@ -667,11 +610,11 @@ class CommonsService {
667
610
  }
668
611
  });
669
612
  // Emit the new breadcrumbs
670
- this.breadcrumbsSubject.next(breadcrumbs);
613
+ this.breadcrumbs.set(breadcrumbs);
671
614
  });
672
615
  }
673
616
  else {
674
- this.breadcrumbsSubject.next(breadcrumbs);
617
+ this.breadcrumbs.set(breadcrumbs);
675
618
  }
676
619
  }
677
620
  generateHomeBreadcrumb(route) {
@@ -769,35 +712,35 @@ class CommonsService {
769
712
  titlePieces.push(this.translate.instant('app.name'));
770
713
  return titlePieces.join(' - ');
771
714
  }
772
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: CommonsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
773
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: CommonsService }); }
715
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: CommonsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
716
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: CommonsService }); }
774
717
  }
775
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: CommonsService, decorators: [{
718
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: CommonsService, decorators: [{
776
719
  type: Injectable
777
- }] });
720
+ }], ctorParameters: () => [] });
778
721
 
779
722
  class ErrorPageComponent {
780
723
  constructor(commons) {
781
724
  this.commons = commons;
782
725
  }
783
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: ErrorPageComponent, deps: [{ token: CommonsService }], target: i0.ɵɵFactoryTarget.Component }); }
784
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.2", type: ErrorPageComponent, isStandalone: true, selector: "mng-error-page", ngImport: i0, template: "<div [class]=\"'exception-body min-h-screen ' + (commons.colorSchemeIsLight ? 'layout-light' : 'layout-dark')\">\n <div class=\"exception-container min-h-screen flex align-items-center justify-content-center flex-column bg-auto md:bg-contain bg-no-repeat\">\n <div class=\"exception-panel text-center flex align-items-center justify-content-center flex-column\">\n <h1 class=\"text-red-400 mb-0\">{{ 'pages.notFound.title' | translate }}</h1>\n <h3 class=\"text-red-300\">{{ 'pages.notFound.subtitle' | translate }}</h3>\n <button type=\"button\" pButton [label]=\"'general.returnHome' | translate\" [routerLink]=\"['/']\"></button>\n </div>\n <div class=\"exception-footer align-items-center flex\">\n <img [src]=\"commons.colorSchemeIsLight ? commons.appLogoDark : commons.appLogoLight\" class=\"exception-logo\" alt=\"App logo\" />\n <img [src]=\"commons.colorSchemeIsLight ? commons.appLogoNameDark : commons.appLogoNameLight\" class=\"exception-appname ml-3\" alt=\"App name\" />\n </div>\n </div>\n</div>\n", styles: [".exception-body{background:var(--surface-ground)}.exception-body .exception-container{background:var(--exception-pages-image);background-repeat:no-repeat;background-size:contain;box-sizing:border-box}.exception-body .exception-container .exception-panel{box-sizing:border-box;flex-grow:1;margin-top:3rem;margin-bottom:3rem}.exception-body .exception-container .exception-panel h1{font-size:140px;font-weight:900;text-shadow:0 0 50px rgba(252,97,97,.2)}.exception-body .exception-container .exception-panel h3{font-size:80px;font-weight:900;margin-top:-90px;margin-bottom:50px}.exception-body .exception-container .exception-panel button{margin-top:50px}.exception-body .exception-container .exception-footer{margin-bottom:2rem}.exception-body .exception-container .exception-footer .exception-logo{width:34px}.exception-body .exception-container .exception-footer .exception-appname{width:72px}\n"], dependencies: [{ kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i2$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i3$1.TranslatePipe, name: "translate" }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
726
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ErrorPageComponent, deps: [{ token: CommonsService }], target: i0.ɵɵFactoryTarget.Component }); }
727
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: ErrorPageComponent, isStandalone: true, selector: "mng-error-page", ngImport: i0, template: "<div [class]=\"'exception-body min-h-screen ' + (commons.colorSchemeIsLight() ? 'layout-light' : 'layout-dark')\">\n <div class=\"exception-container min-h-screen flex align-items-center justify-content-center flex-column bg-auto md:bg-contain bg-no-repeat\">\n <div class=\"exception-panel text-center flex align-items-center justify-content-center flex-column\">\n <h1 class=\"text-red-400 mb-0\">{{ 'pages.notFound.title' | translate }}</h1>\n <h3 class=\"text-red-300\">{{ 'pages.notFound.subtitle' | translate }}</h3>\n <button type=\"button\" pButton [label]=\"'general.returnHome' | translate\" [routerLink]=\"['/']\"></button>\n </div>\n <div class=\"exception-footer align-items-center flex\">\n <img [src]=\"commons.appLogo()\" class=\"exception-logo\" alt=\"App logo\" />\n <img [src]=\"commons.appLogoName()\" class=\"exception-appname ml-3\" alt=\"App name\" />\n </div>\n </div>\n</div>\n", styles: [".exception-body{background:var(--surface-ground)}.exception-body .exception-container{background:var(--exception-pages-image);background-repeat:no-repeat;background-size:contain;box-sizing:border-box}.exception-body .exception-container .exception-panel{box-sizing:border-box;flex-grow:1;margin-top:3rem;margin-bottom:3rem}.exception-body .exception-container .exception-panel h1{font-size:140px;font-weight:900;text-shadow:0 0 50px rgba(252,97,97,.2)}.exception-body .exception-container .exception-panel h3{font-size:80px;font-weight:900;margin-top:-90px;margin-bottom:50px}.exception-body .exception-container .exception-panel button{margin-top:50px}.exception-body .exception-container .exception-footer{margin-bottom:2rem}.exception-body .exception-container .exception-footer .exception-logo{width:34px}.exception-body .exception-container .exception-footer .exception-appname{width:72px}\n"], dependencies: [{ kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i2$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i3$1.TranslatePipe, name: "translate" }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
785
728
  }
786
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: ErrorPageComponent, decorators: [{
729
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ErrorPageComponent, decorators: [{
787
730
  type: Component,
788
- args: [{ standalone: true, selector: 'mng-error-page', imports: [ButtonModule, TranslateModule, RouterLink], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [class]=\"'exception-body min-h-screen ' + (commons.colorSchemeIsLight ? 'layout-light' : 'layout-dark')\">\n <div class=\"exception-container min-h-screen flex align-items-center justify-content-center flex-column bg-auto md:bg-contain bg-no-repeat\">\n <div class=\"exception-panel text-center flex align-items-center justify-content-center flex-column\">\n <h1 class=\"text-red-400 mb-0\">{{ 'pages.notFound.title' | translate }}</h1>\n <h3 class=\"text-red-300\">{{ 'pages.notFound.subtitle' | translate }}</h3>\n <button type=\"button\" pButton [label]=\"'general.returnHome' | translate\" [routerLink]=\"['/']\"></button>\n </div>\n <div class=\"exception-footer align-items-center flex\">\n <img [src]=\"commons.colorSchemeIsLight ? commons.appLogoDark : commons.appLogoLight\" class=\"exception-logo\" alt=\"App logo\" />\n <img [src]=\"commons.colorSchemeIsLight ? commons.appLogoNameDark : commons.appLogoNameLight\" class=\"exception-appname ml-3\" alt=\"App name\" />\n </div>\n </div>\n</div>\n", styles: [".exception-body{background:var(--surface-ground)}.exception-body .exception-container{background:var(--exception-pages-image);background-repeat:no-repeat;background-size:contain;box-sizing:border-box}.exception-body .exception-container .exception-panel{box-sizing:border-box;flex-grow:1;margin-top:3rem;margin-bottom:3rem}.exception-body .exception-container .exception-panel h1{font-size:140px;font-weight:900;text-shadow:0 0 50px rgba(252,97,97,.2)}.exception-body .exception-container .exception-panel h3{font-size:80px;font-weight:900;margin-top:-90px;margin-bottom:50px}.exception-body .exception-container .exception-panel button{margin-top:50px}.exception-body .exception-container .exception-footer{margin-bottom:2rem}.exception-body .exception-container .exception-footer .exception-logo{width:34px}.exception-body .exception-container .exception-footer .exception-appname{width:72px}\n"] }]
731
+ args: [{ standalone: true, selector: 'mng-error-page', imports: [ButtonModule, TranslateModule, RouterLink], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [class]=\"'exception-body min-h-screen ' + (commons.colorSchemeIsLight() ? 'layout-light' : 'layout-dark')\">\n <div class=\"exception-container min-h-screen flex align-items-center justify-content-center flex-column bg-auto md:bg-contain bg-no-repeat\">\n <div class=\"exception-panel text-center flex align-items-center justify-content-center flex-column\">\n <h1 class=\"text-red-400 mb-0\">{{ 'pages.notFound.title' | translate }}</h1>\n <h3 class=\"text-red-300\">{{ 'pages.notFound.subtitle' | translate }}</h3>\n <button type=\"button\" pButton [label]=\"'general.returnHome' | translate\" [routerLink]=\"['/']\"></button>\n </div>\n <div class=\"exception-footer align-items-center flex\">\n <img [src]=\"commons.appLogo()\" class=\"exception-logo\" alt=\"App logo\" />\n <img [src]=\"commons.appLogoName()\" class=\"exception-appname ml-3\" alt=\"App name\" />\n </div>\n </div>\n</div>\n", styles: [".exception-body{background:var(--surface-ground)}.exception-body .exception-container{background:var(--exception-pages-image);background-repeat:no-repeat;background-size:contain;box-sizing:border-box}.exception-body .exception-container .exception-panel{box-sizing:border-box;flex-grow:1;margin-top:3rem;margin-bottom:3rem}.exception-body .exception-container .exception-panel h1{font-size:140px;font-weight:900;text-shadow:0 0 50px rgba(252,97,97,.2)}.exception-body .exception-container .exception-panel h3{font-size:80px;font-weight:900;margin-top:-90px;margin-bottom:50px}.exception-body .exception-container .exception-panel button{margin-top:50px}.exception-body .exception-container .exception-footer{margin-bottom:2rem}.exception-body .exception-container .exception-footer .exception-logo{width:34px}.exception-body .exception-container .exception-footer .exception-appname{width:72px}\n"] }]
789
732
  }], ctorParameters: () => [{ type: CommonsService }] });
790
733
 
791
734
  class NotFoundPageComponent {
792
735
  constructor(commons) {
793
736
  this.commons = commons;
794
737
  }
795
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: NotFoundPageComponent, deps: [{ token: CommonsService }], target: i0.ɵɵFactoryTarget.Component }); }
796
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.2", type: NotFoundPageComponent, isStandalone: true, selector: "mng-not-found-page", ngImport: i0, template: "<div [class]=\"'exception-body min-h-screen ' + (commons.colorSchemeIsLight ? 'layout-light' : 'layout-dark')\">\n <div class=\"exception-container min-h-screen flex align-items-center justify-content-center flex-column bg-auto md:bg-contain bg-no-repeat\">\n <div class=\"exception-panel text-center flex align-items-center justify-content-center flex-column\">\n <h1 class=\"text-red-400 mb-0\">{{ 'pages.notFound.title' | translate }}</h1>\n <h3 class=\"text-red-300\">{{ 'pages.notFound.subtitle' | translate }}</h3>\n <p>{{ 'pages.notFound.message' | translate }}</p>\n <button type=\"button\" pButton [label]=\"'general.returnHome' | translate\" [routerLink]=\"['/']\"></button>\n </div>\n <div class=\"exception-footer align-items-center flex\">\n <img [src]=\"commons.colorSchemeIsLight ? commons.appLogoDark : commons.appLogoLight\" class=\"exception-logo\" alt=\"App logo\" />\n <img [src]=\"commons.colorSchemeIsLight ? commons.appLogoNameDark : commons.appLogoNameLight\" class=\"exception-appname ml-3\" alt=\"App name\" />\n </div>\n </div>\n</div>\n", styles: [".exception-body{background:var(--surface-ground)}.exception-body .exception-container{background:var(--exception-pages-image);background-repeat:no-repeat;background-size:contain;box-sizing:border-box}.exception-body .exception-container .exception-panel{box-sizing:border-box;flex-grow:1;margin-top:3rem;margin-bottom:3rem}.exception-body .exception-container .exception-panel h1{font-size:140px;font-weight:900;text-shadow:0 0 50px rgba(252,97,97,.2)}.exception-body .exception-container .exception-panel h3{font-size:80px;font-weight:900;margin-top:-90px;margin-bottom:50px}.exception-body .exception-container .exception-panel p{font-size:24px;font-weight:400;max-width:320px}.exception-body .exception-container .exception-panel button{margin-top:50px}.exception-body .exception-container .exception-footer{margin-bottom:2rem}.exception-body .exception-container .exception-footer .exception-logo{width:34px}.exception-body .exception-container .exception-footer .exception-appname{width:72px}\n"], dependencies: [{ kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i2$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i3$1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
738
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: NotFoundPageComponent, deps: [{ token: CommonsService }], target: i0.ɵɵFactoryTarget.Component }); }
739
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: NotFoundPageComponent, isStandalone: true, selector: "mng-not-found-page", ngImport: i0, template: "<div [class]=\"'exception-body min-h-screen ' + (commons.colorSchemeIsLight() ? 'layout-light' : 'layout-dark')\">\n <div class=\"exception-container min-h-screen flex align-items-center justify-content-center flex-column bg-auto md:bg-contain bg-no-repeat\">\n <div class=\"exception-panel text-center flex align-items-center justify-content-center flex-column\">\n <h1 class=\"text-red-400 mb-0\">{{ 'pages.notFound.title' | translate }}</h1>\n <h3 class=\"text-red-300\">{{ 'pages.notFound.subtitle' | translate }}</h3>\n <p>{{ 'pages.notFound.message' | translate }}</p>\n <button type=\"button\" pButton [label]=\"'general.returnHome' | translate\" [routerLink]=\"['/']\"></button>\n </div>\n <div class=\"exception-footer align-items-center flex\">\n <img [src]=\"commons.appLogo()\" class=\"exception-logo\" alt=\"App logo\" />\n <img [src]=\"commons.appLogoName()\" class=\"exception-appname ml-3\" alt=\"App name\" />\n </div>\n </div>\n</div>\n", styles: [".exception-body{background:var(--surface-ground)}.exception-body .exception-container{background:var(--exception-pages-image);background-repeat:no-repeat;background-size:contain;box-sizing:border-box}.exception-body .exception-container .exception-panel{box-sizing:border-box;flex-grow:1;margin-top:3rem;margin-bottom:3rem}.exception-body .exception-container .exception-panel h1{font-size:140px;font-weight:900;text-shadow:0 0 50px rgba(252,97,97,.2)}.exception-body .exception-container .exception-panel h3{font-size:80px;font-weight:900;margin-top:-90px;margin-bottom:50px}.exception-body .exception-container .exception-panel p{font-size:24px;font-weight:400;max-width:320px}.exception-body .exception-container .exception-panel button{margin-top:50px}.exception-body .exception-container .exception-footer{margin-bottom:2rem}.exception-body .exception-container .exception-footer .exception-logo{width:34px}.exception-body .exception-container .exception-footer .exception-appname{width:72px}\n"], dependencies: [{ kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i2$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i3$1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
797
740
  }
798
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: NotFoundPageComponent, decorators: [{
741
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: NotFoundPageComponent, decorators: [{
799
742
  type: Component,
800
- args: [{ standalone: true, selector: 'mng-not-found-page', imports: [ButtonModule, RouterLink, TranslateModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [class]=\"'exception-body min-h-screen ' + (commons.colorSchemeIsLight ? 'layout-light' : 'layout-dark')\">\n <div class=\"exception-container min-h-screen flex align-items-center justify-content-center flex-column bg-auto md:bg-contain bg-no-repeat\">\n <div class=\"exception-panel text-center flex align-items-center justify-content-center flex-column\">\n <h1 class=\"text-red-400 mb-0\">{{ 'pages.notFound.title' | translate }}</h1>\n <h3 class=\"text-red-300\">{{ 'pages.notFound.subtitle' | translate }}</h3>\n <p>{{ 'pages.notFound.message' | translate }}</p>\n <button type=\"button\" pButton [label]=\"'general.returnHome' | translate\" [routerLink]=\"['/']\"></button>\n </div>\n <div class=\"exception-footer align-items-center flex\">\n <img [src]=\"commons.colorSchemeIsLight ? commons.appLogoDark : commons.appLogoLight\" class=\"exception-logo\" alt=\"App logo\" />\n <img [src]=\"commons.colorSchemeIsLight ? commons.appLogoNameDark : commons.appLogoNameLight\" class=\"exception-appname ml-3\" alt=\"App name\" />\n </div>\n </div>\n</div>\n", styles: [".exception-body{background:var(--surface-ground)}.exception-body .exception-container{background:var(--exception-pages-image);background-repeat:no-repeat;background-size:contain;box-sizing:border-box}.exception-body .exception-container .exception-panel{box-sizing:border-box;flex-grow:1;margin-top:3rem;margin-bottom:3rem}.exception-body .exception-container .exception-panel h1{font-size:140px;font-weight:900;text-shadow:0 0 50px rgba(252,97,97,.2)}.exception-body .exception-container .exception-panel h3{font-size:80px;font-weight:900;margin-top:-90px;margin-bottom:50px}.exception-body .exception-container .exception-panel p{font-size:24px;font-weight:400;max-width:320px}.exception-body .exception-container .exception-panel button{margin-top:50px}.exception-body .exception-container .exception-footer{margin-bottom:2rem}.exception-body .exception-container .exception-footer .exception-logo{width:34px}.exception-body .exception-container .exception-footer .exception-appname{width:72px}\n"] }]
743
+ args: [{ standalone: true, selector: 'mng-not-found-page', imports: [ButtonModule, RouterLink, TranslateModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [class]=\"'exception-body min-h-screen ' + (commons.colorSchemeIsLight() ? 'layout-light' : 'layout-dark')\">\n <div class=\"exception-container min-h-screen flex align-items-center justify-content-center flex-column bg-auto md:bg-contain bg-no-repeat\">\n <div class=\"exception-panel text-center flex align-items-center justify-content-center flex-column\">\n <h1 class=\"text-red-400 mb-0\">{{ 'pages.notFound.title' | translate }}</h1>\n <h3 class=\"text-red-300\">{{ 'pages.notFound.subtitle' | translate }}</h3>\n <p>{{ 'pages.notFound.message' | translate }}</p>\n <button type=\"button\" pButton [label]=\"'general.returnHome' | translate\" [routerLink]=\"['/']\"></button>\n </div>\n <div class=\"exception-footer align-items-center flex\">\n <img [src]=\"commons.appLogo()\" class=\"exception-logo\" alt=\"App logo\" />\n <img [src]=\"commons.appLogoName()\" class=\"exception-appname ml-3\" alt=\"App name\" />\n </div>\n </div>\n</div>\n", styles: [".exception-body{background:var(--surface-ground)}.exception-body .exception-container{background:var(--exception-pages-image);background-repeat:no-repeat;background-size:contain;box-sizing:border-box}.exception-body .exception-container .exception-panel{box-sizing:border-box;flex-grow:1;margin-top:3rem;margin-bottom:3rem}.exception-body .exception-container .exception-panel h1{font-size:140px;font-weight:900;text-shadow:0 0 50px rgba(252,97,97,.2)}.exception-body .exception-container .exception-panel h3{font-size:80px;font-weight:900;margin-top:-90px;margin-bottom:50px}.exception-body .exception-container .exception-panel p{font-size:24px;font-weight:400;max-width:320px}.exception-body .exception-container .exception-panel button{margin-top:50px}.exception-body .exception-container .exception-footer{margin-bottom:2rem}.exception-body .exception-container .exception-footer .exception-logo{width:34px}.exception-body .exception-container .exception-footer .exception-appname{width:72px}\n"] }]
801
744
  }], ctorParameters: () => [{ type: CommonsService }] });
802
745
 
803
746
  class FilterMatchMode {
@@ -1334,36 +1277,33 @@ class DataProviderInst {
1334
1277
  return true;
1335
1278
  }
1336
1279
  }
1280
+
1337
1281
  class DataProvider extends DataProviderInst {
1338
1282
  constructor() {
1339
1283
  super(undefined, undefined);
1340
1284
  }
1341
1285
  static create() {
1342
- return new DataProviderInst(undefined, undefined);
1286
+ return dataProviderBase();
1343
1287
  }
1344
1288
  static fromClass(type) {
1345
- return new DataProviderInst(type, undefined);
1289
+ return dataProviderFromClass(type);
1346
1290
  }
1347
1291
  static fromClassWithService(type, serviceType) {
1348
- return new DataProviderInst(type, serviceType);
1292
+ return dataProviderFromClass(type, serviceType);
1349
1293
  }
1350
1294
  static fromService(serviceType) {
1351
- return new DataProviderInst(undefined, serviceType);
1352
- }
1353
- static fromAnyParam(type, serviceType) {
1354
- if (typeof type !== 'undefined') {
1355
- return typeof serviceType !== 'undefined'
1356
- ? DataProvider.fromClassWithService(type, serviceType)
1357
- : DataProvider.fromClass(type);
1358
- }
1359
- else if (typeof serviceType !== 'undefined') {
1360
- return DataProvider.fromService(serviceType);
1361
- }
1362
- else {
1363
- return DataProvider.create();
1364
- }
1295
+ return dataProviderWithService(serviceType);
1365
1296
  }
1366
1297
  }
1298
+ function dataProviderBase() {
1299
+ return new DataProviderInst(undefined, undefined);
1300
+ }
1301
+ function dataProviderWithService(serviceType) {
1302
+ return new DataProviderInst(undefined, serviceType);
1303
+ }
1304
+ function dataProviderFromClass(type, serviceType) {
1305
+ return new DataProviderInst(type, serviceType);
1306
+ }
1367
1307
 
1368
1308
  class ComponentDirective {
1369
1309
  constructor() {
@@ -1385,17 +1325,20 @@ class ComponentDirective {
1385
1325
  if (!component) {
1386
1326
  throw new CommonsInternalError(`Component cannot be created, no component (${this.component}) or no or invalid injection token provided (${this.componentIt}).`);
1387
1327
  }
1328
+ const elementInjector = this.parentInjector ?? this.injector;
1329
+ const environmentInjector = elementInjector.get(EnvironmentInjector, null, { optional: true }) ?? this.applicationRef.injector;
1388
1330
  if (this.attachToHost) {
1389
1331
  this.componentRef = createComponent(component, {
1390
1332
  hostElement: this.elementRef.nativeElement,
1391
- environmentInjector: this.applicationRef.injector,
1392
- elementInjector: this.nodeInjector ?? this.injector
1333
+ environmentInjector: environmentInjector,
1334
+ elementInjector: elementInjector
1393
1335
  });
1394
1336
  }
1395
1337
  else {
1396
1338
  this.viewContainerRef.clear();
1397
1339
  this.componentRef = this.viewContainerRef.createComponent(component, {
1398
- injector: this.nodeInjector ?? undefined
1340
+ environmentInjector: environmentInjector,
1341
+ injector: elementInjector
1399
1342
  });
1400
1343
  }
1401
1344
  if (this.inputs) {
@@ -1408,10 +1351,10 @@ class ComponentDirective {
1408
1351
  }
1409
1352
  this.componentInstanceEventEmitter.next(this.componentRef.instance);
1410
1353
  }
1411
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: ComponentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1412
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.2", type: ComponentDirective, isStandalone: true, selector: "[mngComponent]", inputs: { component: ["mngComponent", "component"], componentIt: ["injectionToken", "componentIt"], inputs: "inputs", attachToHost: "attachToHost", nodeInjector: "nodeInjector" }, outputs: { componentInstanceEventEmitter: "instanceCreated" }, ngImport: i0 }); }
1354
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ComponentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1355
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.4", type: ComponentDirective, isStandalone: true, selector: "[mngComponent]", inputs: { component: ["mngComponent", "component"], componentIt: ["injectionToken", "componentIt"], inputs: "inputs", attachToHost: "attachToHost", parentInjector: "parentInjector" }, outputs: { componentInstanceEventEmitter: "instanceCreated" }, ngImport: i0 }); }
1413
1356
  }
1414
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: ComponentDirective, decorators: [{
1357
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ComponentDirective, decorators: [{
1415
1358
  type: Directive,
1416
1359
  args: [{
1417
1360
  standalone: true,
@@ -1427,7 +1370,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImpor
1427
1370
  type: Input
1428
1371
  }], attachToHost: [{
1429
1372
  type: Input
1430
- }], nodeInjector: [{
1373
+ }], parentInjector: [{
1431
1374
  type: Input
1432
1375
  }], componentInstanceEventEmitter: [{
1433
1376
  type: Output,
@@ -1445,10 +1388,10 @@ class TemplateDirective {
1445
1388
  getViewContainerRef() {
1446
1389
  return this.viewContainerRef;
1447
1390
  }
1448
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: TemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1449
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.2", type: TemplateDirective, isStandalone: true, selector: "[mngTemplate]", inputs: { type: "type", name: ["mngTemplate", "name"] }, ngImport: i0 }); }
1391
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: TemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1392
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.4", type: TemplateDirective, isStandalone: true, selector: "[mngTemplate]", inputs: { type: "type", name: ["mngTemplate", "name"] }, ngImport: i0 }); }
1450
1393
  }
1451
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: TemplateDirective, decorators: [{
1394
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: TemplateDirective, decorators: [{
1452
1395
  type: Directive,
1453
1396
  args: [{
1454
1397
  standalone: true,
@@ -2352,10 +2295,10 @@ class BooleanPipe {
2352
2295
  return value;
2353
2296
  }
2354
2297
  }
2355
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: BooleanPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
2356
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.2", ngImport: i0, type: BooleanPipe, isStandalone: true, name: "mngBoolean" }); }
2298
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: BooleanPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
2299
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.4", ngImport: i0, type: BooleanPipe, isStandalone: true, name: "mngBoolean" }); }
2357
2300
  }
2358
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: BooleanPipe, decorators: [{
2301
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: BooleanPipe, decorators: [{
2359
2302
  type: Pipe,
2360
2303
  args: [{
2361
2304
  standalone: true,
@@ -2373,10 +2316,10 @@ class ClassMapPipe {
2373
2316
  return className ?? '';
2374
2317
  }
2375
2318
  }
2376
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: ClassMapPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
2377
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.2", ngImport: i0, type: ClassMapPipe, isStandalone: true, name: "mngClassMap" }); }
2319
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ClassMapPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
2320
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.4", ngImport: i0, type: ClassMapPipe, isStandalone: true, name: "mngClassMap" }); }
2378
2321
  }
2379
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: ClassMapPipe, decorators: [{
2322
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ClassMapPipe, decorators: [{
2380
2323
  type: Pipe,
2381
2324
  args: [{
2382
2325
  standalone: true,
@@ -2396,10 +2339,10 @@ class EnumPipe {
2396
2339
  }
2397
2340
  return i18nPath ? `${i18nPath}.${enumConstantName}` : enumConstantName;
2398
2341
  }
2399
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: EnumPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
2400
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.2", ngImport: i0, type: EnumPipe, isStandalone: true, name: "mngEnum" }); }
2342
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: EnumPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
2343
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.4", ngImport: i0, type: EnumPipe, isStandalone: true, name: "mngEnum" }); }
2401
2344
  }
2402
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: EnumPipe, decorators: [{
2345
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: EnumPipe, decorators: [{
2403
2346
  type: Pipe,
2404
2347
  args: [{
2405
2348
  standalone: true,
@@ -2418,10 +2361,10 @@ class JsonPathPipe {
2418
2361
  transform(value, path = '') {
2419
2362
  return getObjectPropertyByPath(value, path);
2420
2363
  }
2421
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: JsonPathPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
2422
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.2", ngImport: i0, type: JsonPathPipe, isStandalone: true, name: "mngJsonPath" }); }
2364
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: JsonPathPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
2365
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.4", ngImport: i0, type: JsonPathPipe, isStandalone: true, name: "mngJsonPath" }); }
2423
2366
  }
2424
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: JsonPathPipe, decorators: [{
2367
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: JsonPathPipe, decorators: [{
2425
2368
  type: Pipe,
2426
2369
  args: [{
2427
2370
  standalone: true,
@@ -2448,10 +2391,10 @@ class EnumeratePipe {
2448
2391
  })
2449
2392
  .join(valueSeparator);
2450
2393
  }
2451
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: EnumeratePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
2452
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.2", ngImport: i0, type: EnumeratePipe, isStandalone: true, name: "mngEnumerate" }); }
2394
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: EnumeratePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
2395
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.4", ngImport: i0, type: EnumeratePipe, isStandalone: true, name: "mngEnumerate" }); }
2453
2396
  }
2454
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: EnumeratePipe, decorators: [{
2397
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: EnumeratePipe, decorators: [{
2455
2398
  type: Pipe,
2456
2399
  args: [{
2457
2400
  standalone: true,
@@ -2493,10 +2436,10 @@ class EnumerateAsyncPipe {
2493
2436
  }))));
2494
2437
  }), map(i => i.join(valueSeparator)));
2495
2438
  }
2496
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: EnumerateAsyncPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
2497
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.2", ngImport: i0, type: EnumerateAsyncPipe, isStandalone: true, name: "mngEnumerateAsync" }); }
2439
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: EnumerateAsyncPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
2440
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.4", ngImport: i0, type: EnumerateAsyncPipe, isStandalone: true, name: "mngEnumerateAsync" }); }
2498
2441
  }
2499
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: EnumerateAsyncPipe, decorators: [{
2442
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: EnumerateAsyncPipe, decorators: [{
2500
2443
  type: Pipe,
2501
2444
  args: [{
2502
2445
  standalone: true,
@@ -2512,10 +2455,10 @@ class GetterPipe {
2512
2455
  }
2513
2456
  return value;
2514
2457
  }
2515
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: GetterPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
2516
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.2", ngImport: i0, type: GetterPipe, isStandalone: true, name: "mngGetter" }); }
2458
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: GetterPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
2459
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.4", ngImport: i0, type: GetterPipe, isStandalone: true, name: "mngGetter" }); }
2517
2460
  }
2518
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: GetterPipe, decorators: [{
2461
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: GetterPipe, decorators: [{
2519
2462
  type: Pipe,
2520
2463
  args: [{
2521
2464
  standalone: true,
@@ -2528,10 +2471,10 @@ class I18nPropertyPipe {
2528
2471
  transform(property, model) {
2529
2472
  return getI18nTypePropertyKey(model.i18nBaseKey, property);
2530
2473
  }
2531
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: I18nPropertyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
2532
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.2", ngImport: i0, type: I18nPropertyPipe, isStandalone: true, name: "mngI18nProperty" }); }
2474
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: I18nPropertyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
2475
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.4", ngImport: i0, type: I18nPropertyPipe, isStandalone: true, name: "mngI18nProperty" }); }
2533
2476
  }
2534
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: I18nPropertyPipe, decorators: [{
2477
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: I18nPropertyPipe, decorators: [{
2535
2478
  type: Pipe,
2536
2479
  args: [{
2537
2480
  standalone: true,
@@ -2610,10 +2553,10 @@ class ParametrizePipe {
2610
2553
  parametrizeString(s, params) {
2611
2554
  return s.replace(/{{\s?([^{}\s]*)\s?}}/g, (subs, key) => this.jsonPath.transform(params, key) ?? subs);
2612
2555
  }
2613
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: ParametrizePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
2614
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.2", ngImport: i0, type: ParametrizePipe, isStandalone: true, name: "mngParametrize" }); }
2556
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ParametrizePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
2557
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.4", ngImport: i0, type: ParametrizePipe, isStandalone: true, name: "mngParametrize" }); }
2615
2558
  }
2616
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: ParametrizePipe, decorators: [{
2559
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ParametrizePipe, decorators: [{
2617
2560
  type: Pipe,
2618
2561
  args: [{
2619
2562
  standalone: true,
@@ -2632,10 +2575,10 @@ class TemplatePipe {
2632
2575
  }
2633
2576
  return value;
2634
2577
  }
2635
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: TemplatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
2636
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.2", ngImport: i0, type: TemplatePipe, isStandalone: true, name: "template" }); }
2578
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: TemplatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
2579
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.4", ngImport: i0, type: TemplatePipe, isStandalone: true, name: "template" }); }
2637
2580
  }
2638
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: TemplatePipe, decorators: [{
2581
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: TemplatePipe, decorators: [{
2639
2582
  type: Pipe,
2640
2583
  args: [{
2641
2584
  standalone: true,
@@ -2869,6 +2812,7 @@ class PermissionService {
2869
2812
  this.injector = inject(Injector);
2870
2813
  this.commons = inject(CommonsService);
2871
2814
  this.logger = inject(LoggerService).create('AuthorizationService');
2815
+ this.userRoles$ = toObservable(this.commons.userRoles());
2872
2816
  }
2873
2817
  isPermitted(permissions, route, actionCtx) {
2874
2818
  switch (permissions.authorizationType) {
@@ -2879,7 +2823,7 @@ class PermissionService {
2879
2823
  case PermissionTypeEnum.Service:
2880
2824
  return this.isPermittedService(permissions, route, actionCtx);
2881
2825
  default:
2882
- return this.commons.userRoles$.pipe(map(ur => isPermitted(permissions, ur)));
2826
+ return this.userRoles$.pipe(map(ur => isPermitted(permissions, ur)));
2883
2827
  }
2884
2828
  }
2885
2829
  isPermittedAll(permission, route, actionCtx) {
@@ -2896,10 +2840,10 @@ class PermissionService {
2896
2840
  }
2897
2841
  return serviceInstance.isPermitted(route, this.router.routerState.snapshot, actionCtx);
2898
2842
  }
2899
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: PermissionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2900
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: PermissionService }); }
2843
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: PermissionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2844
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: PermissionService }); }
2901
2845
  }
2902
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: PermissionService, decorators: [{
2846
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: PermissionService, decorators: [{
2903
2847
  type: Injectable
2904
2848
  }] });
2905
2849
 
@@ -2926,89 +2870,95 @@ class RouteBuilder {
2926
2870
  this.routePath = [this.route.path];
2927
2871
  }
2928
2872
  }
2929
- static create(path, component) {
2930
- return new RouteBuilder({
2931
- path: path,
2932
- component: component
2933
- });
2934
- }
2935
- static createRedirect(path, redirectTo, pathMatch = 'prefix') {
2936
- return new RouteBuilder({
2937
- path: path,
2938
- redirectTo: redirectTo,
2939
- pathMatch: pathMatch
2940
- });
2941
- }
2942
- static createLazyRouteModule(path, loadChildren, canMatch) {
2943
- const route = { path: path, loadChildren: loadChildren };
2944
- if (canMatch?.length) {
2945
- route.canMatch = canMatch;
2946
- }
2947
- return new RouteBuilder(route);
2948
- }
2949
- static createLazyRouteComponent(path, loadComponent, canMatch) {
2950
- const route = { path: path, loadComponent: loadComponent };
2951
- if (canMatch?.length) {
2952
- route.canMatch = canMatch;
2953
- }
2954
- return new RouteBuilder(route);
2955
- }
2956
- static createFromRoute(route) {
2957
- return new RouteBuilder(route);
2958
- }
2873
+ /**
2874
+ * Sets the link to root Routes builder.
2875
+ *
2876
+ * @param {RoutesBuilder} routesBuilder - The routes builder to set as the root.
2877
+ */
2959
2878
  withRoot(routesBuilder) {
2960
2879
  this.root = routesBuilder;
2961
2880
  return this;
2962
2881
  }
2882
+ /**
2883
+ * Sets the link to parent Route builder.
2884
+ *
2885
+ * @param {RouteBuilder} parent - The parent route builder.
2886
+ */
2963
2887
  withParent(parent) {
2964
2888
  this.parent = parent;
2965
2889
  this.routePath = removeRouteEmptyPathSegments([...this.parent.routePath, this.route.path ?? '']);
2966
2890
  return this;
2967
2891
  }
2892
+ /**
2893
+ * Sets the breadcrumb.
2894
+ *
2895
+ * @param {BreadcrumbType} breadcrumb - Breadcrumb configuration.
2896
+ */
2968
2897
  withBreadcrumb(breadcrumb) {
2969
- this.breadcrumb = breadcrumb;
2970
2898
  this.routeData.breadcrumb = breadcrumb;
2971
2899
  return this;
2972
2900
  }
2901
+ /**
2902
+ * Sets the page title for the current route.
2903
+ *
2904
+ * @param {string} pageTitle - The title of the page.
2905
+ */
2973
2906
  withPageTitle(pageTitle) {
2974
- this.pageTitle = pageTitle;
2975
2907
  this.routeData.pageTitle = pageTitle;
2976
2908
  return this;
2977
2909
  }
2978
- withRedirectTo(redirectTo) {
2979
- this.route.redirectTo = redirectTo;
2980
- return this;
2981
- }
2982
- withPathMatch(pathMatch) {
2983
- this.route.pathMatch = pathMatch;
2984
- return this;
2985
- }
2910
+ /**
2911
+ * Sets the page title and the breadcrumb.
2912
+ *
2913
+ * @param {string} title - The title of the page and breadcrumb.
2914
+ */
2986
2915
  withTitle(title) {
2987
2916
  this.withPageTitle(title);
2988
2917
  this.withBreadcrumb(title);
2989
2918
  return this;
2990
2919
  }
2991
- withCanActivate(diToken) {
2920
+ /**
2921
+ * Adds a can activate guard to route.
2922
+ *
2923
+ * @param {CanActivateFn} fn - The CanActivate function to be added.
2924
+ */
2925
+ withCanActivate(fn) {
2992
2926
  if (!this.route.canActivate) {
2993
2927
  this.route.canActivate = [];
2994
2928
  }
2995
- this.route.canActivate.push(diToken);
2929
+ this.route.canActivate.push(fn);
2996
2930
  return this;
2997
2931
  }
2998
- withCanDeactivate(diToken) {
2932
+ /**
2933
+ * Adds a can deactivate guard to route.
2934
+ *
2935
+ * @param {CanDeactivateFn} fn - The CanActivate function to be added.
2936
+ */
2937
+ withCanDeactivate(fn) {
2999
2938
  if (!this.route.canDeactivate) {
3000
2939
  this.route.canDeactivate = [];
3001
2940
  }
3002
- this.route.canDeactivate.push(diToken);
2941
+ this.route.canDeactivate.push(fn);
3003
2942
  return this;
3004
2943
  }
3005
- withResolver(diToken, name) {
2944
+ /**
2945
+ * Adds a resolver to route.
2946
+ *
2947
+ * @param {string} name - Name of the resolver.
2948
+ * @param {CanDeactivateFn} fn - The CanActivate function to be added.
2949
+ */
2950
+ withResolver(name, fn) {
3006
2951
  if (!this.route.resolve) {
3007
2952
  this.route.resolve = {};
3008
2953
  }
3009
- this.route.resolve[name] = diToken;
2954
+ this.route.resolve[name] = fn;
3010
2955
  return this;
3011
2956
  }
2957
+ /**
2958
+ * Adds a provider to the route.
2959
+ *
2960
+ * @param {Provider | EnvironmentProviders} provider - The provider to add.
2961
+ */
3012
2962
  withProvider(provider) {
3013
2963
  if (!this.route.providers) {
3014
2964
  this.route.providers = [];
@@ -3016,19 +2966,49 @@ class RouteBuilder {
3016
2966
  this.route.providers.push(provider);
3017
2967
  return this;
3018
2968
  }
3019
- withData(data) {
3020
- if (!data.breadcrumb) {
3021
- data.breadcrumb = null;
3022
- }
3023
- this.routeData = data;
2969
+ /**
2970
+ * Sets the data for the route.
2971
+ *
2972
+ * @param {CommonsRouteData} data - The data to set for the route.
2973
+ * @param {boolean} [merge=true] - If the data should be merged with current data setup (true by default) - page title and breadcrumb config are carried over.
2974
+ */
2975
+ withData(data, merge = true) {
2976
+ this.routeData = merge
2977
+ ? {
2978
+ ...this.routeData,
2979
+ ...data
2980
+ }
2981
+ : {
2982
+ breadcrumb: null,
2983
+ ...data
2984
+ };
3024
2985
  return this;
3025
2986
  }
3026
- withCommonsMenuItem(menuItem) {
3027
- this.menuItem = menuItem;
2987
+ /**
2988
+ * Updates the menu item of route. Merging with current configuration (set with {withMenuItem}) takes place.
2989
+ *
2990
+ * @param {CommonsMenuItem} opts - The opts properties to be merged on existing menu item for route.
2991
+ */
2992
+ withMenuItemOpts(opts) {
2993
+ if (!this.menuItem) {
2994
+ this.menuItem = {};
2995
+ }
2996
+ this.menuItem = {
2997
+ ...this.menuItem,
2998
+ ...opts
2999
+ };
3028
3000
  return this;
3029
3001
  }
3002
+ /**
3003
+ * Sets the menu item (basic). For more options, see the {withMenuItemFromOpts}.
3004
+ *
3005
+ * @param {string} [icon] - The icon for the menu item.
3006
+ * @param {string} [label] - The label for the menu item.
3007
+ * @param {Array<string>} [routerLink] - The router link for the menu item.
3008
+ * @param {boolean} [breadcrumb=false] - Indicates whether to display breadcrumb for the menu item.
3009
+ */
3030
3010
  withMenuItem(icon, label, routerLink, breadcrumb = false) {
3031
- this.menuItem = this.createMenuItem(icon, label, routerLink);
3011
+ this.menuItem = createMenuItem(icon, label, routerLink);
3032
3012
  if (breadcrumb && label) {
3033
3013
  this.withBreadcrumb({
3034
3014
  label: label
@@ -3037,35 +3017,40 @@ class RouteBuilder {
3037
3017
  return this;
3038
3018
  }
3039
3019
  /**
3040
- * Adds menu item child to this instance of menu item.
3041
- * @param label Label.
3042
- * @param icon Icon.
3043
- * @param routerLink Router link.
3044
- * @param afterRouteChildren If false, menu item child will be appended before route children menu items, at the end otherwise.
3020
+ * Adds menu item child to route's menu item. If no menu item is present, children will be appended directly to parent/root menu item.
3021
+ *
3022
+ * @param {string} [icon] - The icon for the menu item.
3023
+ * @param {string} [label] - The label for the menu item.
3024
+ * @param {Array<string>} [routerLink] - The router link for the menu item.
3025
+ * @param {boolean} [afterRouteChildren=false] If false, menu item child will be appended before route's children menu items, at the end otherwise.
3045
3026
  */
3046
- withMenuItemChild(label, icon, routerLink, afterRouteChildren = false) {
3027
+ withMenuItemChild(icon, label, routerLink, afterRouteChildren = false) {
3047
3028
  if (afterRouteChildren) {
3048
- this.menuItemChildrenAfter.push(this.createMenuItem(icon, label, routerLink));
3029
+ this.menuItemChildrenAfter.push(createMenuItem(icon, label, routerLink));
3049
3030
  }
3050
3031
  else {
3051
- this.menuItemChildren.push(this.createMenuItem(icon, label, routerLink));
3032
+ this.menuItemChildren.push(createMenuItem(icon, label, routerLink));
3052
3033
  }
3053
3034
  return this;
3054
3035
  }
3055
3036
  /**
3056
- * Adds menu item child to this instance of menu item.
3057
- * @param menuItem Configuration object for menu item.
3058
- * @param afterRouteChildren If false, menu item child will be appended before route children menu items, at the end otherwise.
3037
+ * Adds menu item child from opts to route's menu item. If no menu item is present, children will be appended directly to parent/root menu item.
3038
+ *
3039
+ * @param {CommonsMenuItem} opts - The opts properties to be merged on existing menu item for route.
3040
+ * @param {boolean} [afterRouteChildren=false] If false, menu item child will be appended before route's children menu items, at the end otherwise.
3059
3041
  */
3060
- withCommonsMenuItemChild(menuItem, afterRouteChildren = false) {
3042
+ withMenuItemChildFromOpts(opts, afterRouteChildren = false) {
3061
3043
  if (afterRouteChildren) {
3062
- this.menuItemChildrenAfter.push(menuItem);
3044
+ this.menuItemChildrenAfter.push(opts);
3063
3045
  }
3064
3046
  else {
3065
- this.menuItemChildren.push(menuItem);
3047
+ this.menuItemChildren.push(opts);
3066
3048
  }
3067
3049
  return this;
3068
3050
  }
3051
+ /**
3052
+ * Sets the menu item's children to be generated lazily from route's lazy loaded routes after the chunk is loaded to runtime.
3053
+ */
3069
3054
  withMenuItemLazyChildren() {
3070
3055
  if (!this.menuItem) {
3071
3056
  this.menuItem = {};
@@ -3073,16 +3058,34 @@ class RouteBuilder {
3073
3058
  this.menuItem.lazyChildren = true;
3074
3059
  return this;
3075
3060
  }
3061
+ /**
3062
+ * Sets the permissions on the route.
3063
+ *
3064
+ * @param {APermissions} permissions - The permissions to be set on the route.
3065
+ */
3076
3066
  withPermissions(permissions) {
3077
3067
  this.permissions = permissions;
3078
3068
  this.withCanActivate(permissionGuard);
3079
3069
  return this;
3080
3070
  }
3071
+ /**
3072
+ * Adds a child route to the current route.
3073
+ *
3074
+ * @param {string} path - The path of the child route.
3075
+ * @param {Type<any>} component - The component associated with the child route.
3076
+ * @param {RouteBuilderAdjustFnType} [adjustFn] - An optional function to adjust the child route builder.
3077
+ */
3081
3078
  addChild(path, component, adjustFn) {
3082
- const childRouteBuilder = RouteBuilder.create(path, component);
3079
+ const childRouteBuilder = createRoute(path, component);
3083
3080
  adjustFn?.(childRouteBuilder);
3084
3081
  return this.addChildBuilder(childRouteBuilder);
3085
3082
  }
3083
+ /**
3084
+ * Adds a child builder to the current route.
3085
+ *
3086
+ * @param {RouteBuilder} builder - The child builder to be added.
3087
+ * @return {this} - The current builder with the added child builder.
3088
+ */
3086
3089
  addChildBuilder(builder) {
3087
3090
  builder.withParent(this);
3088
3091
  if (this.root) {
@@ -3091,6 +3094,11 @@ class RouteBuilder {
3091
3094
  this.children.push(builder);
3092
3095
  return this;
3093
3096
  }
3097
+ /**
3098
+ * Builds an Angular route based on configurations.
3099
+ *
3100
+ * @returns {Route} The built Angular route.
3101
+ */
3094
3102
  build() {
3095
3103
  const angularRoute = {
3096
3104
  ...this.route
@@ -3141,6 +3149,11 @@ class RouteBuilder {
3141
3149
  }
3142
3150
  return angularRoute;
3143
3151
  }
3152
+ /**
3153
+ * Builds the menu items.
3154
+ *
3155
+ * @returns {Array<CommonsMenuItem>} - The built menu items.
3156
+ */
3144
3157
  buildMenu() {
3145
3158
  const menuItemBuild = this.menuItem ? { ...this.menuItem } : null;
3146
3159
  const routeChildrenMenuItems = this.children.flatMap(child => child.buildMenu());
@@ -3168,7 +3181,7 @@ class RouteBuilder {
3168
3181
  if (!menuItemBuild) {
3169
3182
  return menuItemChildrenBuild;
3170
3183
  }
3171
- menuItemBuild.label = menuItemBuild.label ?? this.pageTitle;
3184
+ menuItemBuild.label = menuItemBuild.label ?? this.routeData.pageTitle;
3172
3185
  if (typeof menuItemBuild.routerLink === 'string') {
3173
3186
  menuItemBuild.routerLink = [menuItemBuild.routerLink];
3174
3187
  }
@@ -3187,19 +3200,6 @@ class RouteBuilder {
3187
3200
  }
3188
3201
  return [menuItemBuild];
3189
3202
  }
3190
- createMenuItem(icon, label, routerLink) {
3191
- const menuItem = {};
3192
- if (icon) {
3193
- menuItem.icon = icon;
3194
- }
3195
- if (label) {
3196
- menuItem.label = label;
3197
- }
3198
- if (routerLink) {
3199
- menuItem.routerLink = routerLink;
3200
- }
3201
- return menuItem;
3202
- }
3203
3203
  findMenuItemGuards() {
3204
3204
  const guards = [];
3205
3205
  if (this.route.canActivate?.length) {
@@ -3231,59 +3231,128 @@ class RouteBuilder {
3231
3231
  return undefined;
3232
3232
  }
3233
3233
  }
3234
-
3235
- class RoutesBuilder {
3236
- constructor(layoutRoute) {
3237
- this.routes = [];
3238
- this.layoutRoute = layoutRoute?.withRoot(this);
3239
- this.currentRoute = layoutRoute;
3234
+ function createMenuItem(icon, label, routerLink) {
3235
+ const menuItem = {};
3236
+ if (icon) {
3237
+ menuItem.icon = icon;
3240
3238
  }
3241
- static create() {
3242
- return new RoutesBuilder();
3239
+ if (label) {
3240
+ menuItem.label = label;
3243
3241
  }
3244
- addAngularRoute(route, builderAdjustFn) {
3245
- const builder = RouteBuilder.createFromRoute(route);
3246
- builderAdjustFn?.(builder);
3247
- return this.addRouteBuilder(builder);
3242
+ if (routerLink) {
3243
+ menuItem.routerLink = routerLink;
3244
+ }
3245
+ return menuItem;
3246
+ }
3247
+ /**
3248
+ * Creates a new instance of RouteBuilder with the given path and component.
3249
+ *
3250
+ * @param {string} path - The path for the route.
3251
+ * @param {Type<any>} component - The component for the route.
3252
+ * @return {RouteBuilder} - A new instance of RouteBuilder.
3253
+ */
3254
+ function createRoute(path, component) {
3255
+ return new RouteBuilder({
3256
+ path: path,
3257
+ component: component
3258
+ });
3259
+ }
3260
+ /**
3261
+ * Creates a redirect route for the given path.
3262
+ *
3263
+ * @param {string} path - The path to match against.
3264
+ * @param {string} redirectTo - The URL path to redirect to.
3265
+ * @param {'full' | 'prefix'} [pathMatch='prefix'] - The path matching strategy ('full' or 'prefix').
3266
+ * @return {RouteBuilder} - A new instance of the RouteBuilder class with the redirect route configuration.
3267
+ */
3268
+ function createRouteRedirect(path, redirectTo, pathMatch = 'prefix') {
3269
+ return new RouteBuilder({
3270
+ path: path,
3271
+ redirectTo: redirectTo,
3272
+ pathMatch: pathMatch
3273
+ });
3274
+ }
3275
+ /**
3276
+ * Creates a lazy route module (or routes).
3277
+ *
3278
+ * @param {string} path - The path for the route.
3279
+ * @param {LoadChildren} loadChildren - The function that loads the lazy module (or routes).
3280
+ * @param {Array<any>} [canMatch] - An optional array of objects that can match the route.
3281
+ * @returns {RouteBuilder} - A new instance of RouteBuilder class.
3282
+ */
3283
+ function createLazyChildrenRoute(path, loadChildren, canMatch) {
3284
+ const route = { path: path, loadChildren: loadChildren };
3285
+ if (canMatch?.length) {
3286
+ route.canMatch = canMatch;
3248
3287
  }
3249
- addRouteRedirect(path, redirectTo, pathMatch = 'prefix') {
3250
- return this.addRouteBuilder(RouteBuilder.createRedirect(path, redirectTo, pathMatch));
3288
+ return new RouteBuilder(route);
3289
+ }
3290
+ /**
3291
+ * Creates a lazy route component.
3292
+ *
3293
+ * @param {string} path - The path for the route.
3294
+ * @param {() => Type<unknown> | Observable<Type<unknown> | DefaultExport<Type<unknown>>> | Promise<Type<unknown> | DefaultExport<Type<unknown>>>} loadComponent - The function that loads the component for the route.
3295
+ * @param {Array<any>} [canMatch] - The array of values that determine if the route can match.
3296
+ * @returns {RouteBuilder} - An instance of RouteBuilder with the created route.
3297
+ */
3298
+ function createLazyRoute(path, loadComponent, canMatch) {
3299
+ const route = { path: path, loadComponent: loadComponent };
3300
+ if (canMatch?.length) {
3301
+ route.canMatch = canMatch;
3251
3302
  }
3252
- addLazyRouteComponent(path, loadComponent, canMatch, builderAdjustFn) {
3253
- const builder = RouteBuilder.createLazyRouteComponent(path, loadComponent, canMatch);
3254
- builderAdjustFn?.(builder);
3255
- return this.addRouteBuilder(builder);
3303
+ return new RouteBuilder(route);
3304
+ }
3305
+
3306
+ class RoutesBuilder {
3307
+ constructor() {
3308
+ this.routes = [];
3256
3309
  }
3257
- addLazyRouteModule(path, loadChildren, canMatch, builderAdjustFn) {
3258
- const builder = RouteBuilder.createLazyRouteModule(path, loadChildren, canMatch);
3310
+ /**
3311
+ * Adds an Angular route to the current route configuration.
3312
+ *
3313
+ * @param {Route} route - The Angular route object to be added.
3314
+ * @param {RouteBuilderAdjustFnType} [builderAdjustFn] - Optional function to adjust the route builder before adding.
3315
+ */
3316
+ addFromNgRoute(route, builderAdjustFn) {
3317
+ const builder = new RouteBuilder(route);
3259
3318
  builderAdjustFn?.(builder);
3260
- return this.addRouteBuilder(builder);
3319
+ return this.add(builder);
3261
3320
  }
3262
- addRoute(path, component, builderAdjustFn) {
3263
- const builder = RouteBuilder.create(path, component);
3264
- builderAdjustFn?.(builder);
3265
- return this.addRouteBuilder(builder);
3321
+ /**
3322
+ * Adds a route redirect to the Angular route.
3323
+ *
3324
+ * @param {string} path - The path for the redirect.
3325
+ * @param {string} redirectTo - The target route to redirect.
3326
+ * @param {'full' | 'prefix'} pathMatch - The matching strategy for the redirect. Default is 'prefix'.
3327
+ */
3328
+ addRedirect(path, redirectTo, pathMatch = 'prefix') {
3329
+ return this.addFromNgRoute({
3330
+ path: path,
3331
+ redirectTo: redirectTo,
3332
+ pathMatch: pathMatch
3333
+ });
3266
3334
  }
3267
- addRouteBuilder(routeBuilder) {
3268
- this.currentRoute = routeBuilder.withRoot(this);
3335
+ /**
3336
+ * Adds a route to the routes.
3337
+ *
3338
+ * @param {RouteBuilder} routeBuilder - The route builder object representing the route to be added.
3339
+ */
3340
+ add(routeBuilder) {
3269
3341
  this.routes.push(routeBuilder);
3270
3342
  return this;
3271
3343
  }
3272
3344
  build() {
3273
- let angularRoutes = [];
3274
- for (const route of this.routes) {
3275
- angularRoutes.push(route.build());
3276
- }
3277
- if (this.layoutRoute) {
3278
- const layoutAngularRoute = this.layoutRoute.build();
3279
- if (angularRoutes.length > 0) {
3280
- layoutAngularRoute.children = angularRoutes;
3281
- }
3282
- angularRoutes = [layoutAngularRoute];
3283
- }
3284
- return angularRoutes;
3345
+ return this.routes.map(r => r.build());
3285
3346
  }
3286
3347
  }
3348
+ /**
3349
+ * Creates a new instance of the RoutesBuilder class.
3350
+ *
3351
+ * @return {RoutesBuilder} A new instance of the RoutesBuilder class.
3352
+ */
3353
+ function createRoutes() {
3354
+ return new RoutesBuilder();
3355
+ }
3287
3356
 
3288
3357
  /**
3289
3358
  * Maps an Observable of data with optional totalCount and data to a data list result object with provided defaults of empty array and count 0.
@@ -3483,21 +3552,13 @@ class CommonsConfigurationService {
3483
3552
  }
3484
3553
 
3485
3554
  class CommonsRouterService {
3486
- constructor(router) {
3487
- this.router = router;
3555
+ constructor() {
3556
+ this.router = inject(Router);
3488
3557
  this.logger = inject(LoggerService).create('CommonsRouterService');
3489
3558
  this.routesLoadedPropKey = '_loadedRoutes';
3490
3559
  this.currentNavigationModuleKeys = [];
3491
3560
  this.lazyLoadedRoutesConfig = {};
3492
- }
3493
- getRouteLoadedChildren(path) {
3494
- return this.getOrCreateRouteForModule(this.getModulePathFromRouterLink(path)).loadedRoutes;
3495
- }
3496
- getRouteLoadedChildren$(path) {
3497
- return this.getOrCreateRouteForModule(this.getModulePathFromRouterLink(path)).loadedRoutesSubject.asObservable().pipe(first());
3498
- }
3499
- initialize() {
3500
- this.router.events.subscribe(event => {
3561
+ this.router.events.pipe(takeUntilDestroyed()).subscribe(event => {
3501
3562
  if (event instanceof NavigationStart) {
3502
3563
  this.startNavigation(event.url);
3503
3564
  }
@@ -3512,6 +3573,15 @@ class CommonsRouterService {
3512
3573
  }
3513
3574
  });
3514
3575
  }
3576
+ getRouteLoadedChildren(path) {
3577
+ return this.getOrCreateRouteForModule(this.getModulePathFromRouterLink(path)).loadedRoutes;
3578
+ }
3579
+ getRouteLoadedChildren$(path) {
3580
+ return this.getOrCreateRouteForModule(this.getModulePathFromRouterLink(path)).loadedRoutesSubject.asObservable().pipe(first());
3581
+ }
3582
+ initialize() {
3583
+ this.logger.debug('Initialized.');
3584
+ }
3515
3585
  startNavigation(url) {
3516
3586
  this.currentNavigationPath = url.split('?')[0].split('#')[0];
3517
3587
  this.currentNavigationModuleKeys = [];
@@ -3648,12 +3718,12 @@ class CommonsRouterService {
3648
3718
  getModulePathFromRouterLink(path) {
3649
3719
  return ('/' + (Array.isArray(path) ? path.join('/') : path)).replace(/\/\//g, '/');
3650
3720
  }
3651
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: CommonsRouterService, deps: [{ token: i1$1.Router }], target: i0.ɵɵFactoryTarget.Injectable }); }
3652
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: CommonsRouterService }); }
3721
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: CommonsRouterService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
3722
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: CommonsRouterService }); }
3653
3723
  }
3654
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: CommonsRouterService, decorators: [{
3724
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: CommonsRouterService, decorators: [{
3655
3725
  type: Injectable
3656
- }], ctorParameters: () => [{ type: i1$1.Router }] });
3726
+ }], ctorParameters: () => [] });
3657
3727
 
3658
3728
  var CommonsInitEventEnum;
3659
3729
  (function (CommonsInitEventEnum) {
@@ -3738,7 +3808,7 @@ class CommonsInitService {
3738
3808
  this.commonsInitServiceEvents.next(CommonsInitEventEnum.CommonsInitEnd);
3739
3809
  this.commonsInitServiceEvents.complete();
3740
3810
  this.isInitializedSubject.next(true);
3741
- return this.commons.reset();
3811
+ return this.commons.initialize();
3742
3812
  }), catchError(err => {
3743
3813
  ctxLogger.warn('Commons initialization failed with error', err);
3744
3814
  this.commonsInitServiceEvents.next(CommonsInitEventEnum.CommonsInitError);
@@ -3747,10 +3817,10 @@ class CommonsInitService {
3747
3817
  return throwError(() => err);
3748
3818
  }));
3749
3819
  }
3750
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: CommonsInitService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
3751
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: CommonsInitService }); }
3820
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: CommonsInitService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
3821
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: CommonsInitService }); }
3752
3822
  }
3753
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: CommonsInitService, decorators: [{
3823
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: CommonsInitService, decorators: [{
3754
3824
  type: Injectable
3755
3825
  }] });
3756
3826
 
@@ -3774,10 +3844,10 @@ class LocalStorageService {
3774
3844
  removeItem(type, key) {
3775
3845
  localStorage.removeItem(this.buildLocalStorageKey(type, key));
3776
3846
  }
3777
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: LocalStorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
3778
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: LocalStorageService }); }
3847
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: LocalStorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
3848
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: LocalStorageService }); }
3779
3849
  }
3780
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: LocalStorageService, decorators: [{
3850
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: LocalStorageService, decorators: [{
3781
3851
  type: Injectable
3782
3852
  }] });
3783
3853
 
@@ -3878,5 +3948,5 @@ function provideCommons(config, ...features) {
3878
3948
  * Generated bundle index. Do not edit.
3879
3949
  */
3880
3950
 
3881
- export { ACommonsErrorBase, APermissions, BROWSER_STORAGE_IT, BooleanPipe, COMMONS_INITIALIZER_IT, COMMONS_MODULE_CONFIG_IT, ClassMapPipe, CommonsConfigurationService, CommonsErrorHandler, CommonsFeatureTypeEnum, CommonsHttpError, CommonsInitEventEnum, CommonsInitService, CommonsInternalError, CommonsRouterService, CommonsService, ComponentDirective, DataProvider, DataProviderInst, DialogKeydownHandlerDirective, EnumName, EnumPipe, EnumerateAsyncPipe, EnumeratePipe, ErrorPageComponent, FilterMatchMode, GetterPipe, I18nPropertyPipe, JsonPathPipe, LOG_PUBLISHERS, LocalStorageService, LogLevelEnum, LogPublisherConsoleService, LoggerService, NotFoundPageComponent, NotificationWrapperComponent, ParametrizePipe, PermissionService, PermissionTypeEnum, Permissions, RouteBuilder, RoutesBuilder, StyleLevelEnum, StyleSizeEnum, Styles, TemplateDirective, TemplatePipe, TypeName, TypeRegistry, adjustRouteMenuLazyChildrenRouterLinks, angularDateFormatHasSeconds, angularDateFormatHasTime, appendRoutePathToBasePath, boolean$Attribute, commonsActionErrorContextToString, commonsErrorToString, commonsInitializerProvider, copyDataListParams, dataListParamsFilterToUrlQuery, dataListParamsFilterValueToUrlString, dataListParamsFiltersToUrlQuery, dataListParamsSortToUrlQuery, dataListParamsToUrlQuery, dateToIsoString, defineReflectEnumName, defineReflectTypeName, doesUrlMatchRouterLink, errorCauseToString, errorToString, escapeHtml, escapeHtmlAny, findReflectEnumName, findReflectTypeName, findTemplateByName, flattenObjectKeys, fromAngularDateFormatToPrime, fromEnumConstantsAsValueArray, fromEnumValuesAsValueArray, fromSubscribeError, fromTableLoadToDataListParams, fromUrlQueryToDataListParams, getEnumConstantName, getEnumConstantNameFromObject, getEnumConstantNames, getEnumConstantNamesFromObject, getEnumConstantValuesAsNumber, getEnumConstantValuesAsString, getEnumerationI18nBaseKey, getErrorLogLevel, getErrorName, getHttpErrorResponse, getHttpErrorResponseStatus, getI18n, getI18nAsync, getI18nClassGroupKey, getI18nClassKeyBasePath, getI18nClassName, getI18nClassNameAsync, getI18nClassParams, getI18nClassParamsAsync, getI18nClassPropertyKey, getI18nClassTabKey, getI18nErrorParams, getI18nForError, getI18nTypeGroupKey, getI18nTypeKeyBasePath, getI18nTypeName, getI18nTypeNameAsync, getI18nTypeParams, getI18nTypeParamsAsync, getI18nTypePropertyKey, getI18nTypeTabKey, getObjectGetters, getObjectProperties, getObjectPropertyByPath, httpErrorResponseToString, isHttpErrorResponse, isPermitted, isRbacPermitted, itemIdToDefined, itemIdToNumber, itemIdToString, mapToDataList, mergeDataListParamsWithDefaults, number$Attribute, objectDeepCopy, objectDeepMerge, permissionGuard, populateI18nParams, populateI18nTypeParams, provideCommons, reflectEnumNameKey, reflectTypeNameExists, reflectTypeNameKey, removeRouteEmptyPathSegments, selectEnumerationI18n, selectI18n, stringify, toEnumerationI18nEnumerate, toObservable, toastMessage, valueToDefined };
3951
+ export { ACommonsErrorBase, APermissions, BROWSER_STORAGE_IT, BooleanPipe, COMMONS_INITIALIZER_IT, COMMONS_MODULE_CONFIG_IT, ClassMapPipe, CommonsConfigurationService, CommonsErrorHandler, CommonsFeatureTypeEnum, CommonsHttpError, CommonsInitEventEnum, CommonsInitService, CommonsInternalError, CommonsRouterService, CommonsService, ComponentDirective, DataProvider, DataProviderInst, DialogKeydownHandlerDirective, EnumName, EnumPipe, EnumerateAsyncPipe, EnumeratePipe, ErrorPageComponent, FilterMatchMode, GetterPipe, I18nPropertyPipe, JsonPathPipe, LOG_PUBLISHERS, LocalStorageService, LogLevelEnum, LogPublisherConsoleService, LoggerService, NotFoundPageComponent, NotificationWrapperComponent, ParametrizePipe, PermissionService, PermissionTypeEnum, Permissions, RouteBuilder, RoutesBuilder, StyleLevelEnum, StyleSizeEnum, Styles, TemplateDirective, TemplatePipe, TypeName, TypeRegistry, adjustRouteMenuLazyChildrenRouterLinks, angularDateFormatHasSeconds, angularDateFormatHasTime, appendRoutePathToBasePath, boolean$Attribute, commonsActionErrorContextToString, commonsErrorToString, commonsInitializerProvider, copyDataListParams, createLazyChildrenRoute, createLazyRoute, createRoute, createRouteRedirect, createRoutes, dataListParamsFilterToUrlQuery, dataListParamsFilterValueToUrlString, dataListParamsFiltersToUrlQuery, dataListParamsSortToUrlQuery, dataListParamsToUrlQuery, dataProviderBase, dataProviderFromClass, dataProviderWithService, dateToIsoString, defineReflectEnumName, defineReflectTypeName, doesUrlMatchRouterLink, errorCauseToString, errorToString, escapeHtml, escapeHtmlAny, findReflectEnumName, findReflectTypeName, findTemplateByName, flattenObjectKeys, fromAngularDateFormatToPrime, fromEnumConstantsAsValueArray, fromEnumValuesAsValueArray, fromSubscribeError, fromTableLoadToDataListParams, fromUrlQueryToDataListParams, getEnumConstantName, getEnumConstantNameFromObject, getEnumConstantNames, getEnumConstantNamesFromObject, getEnumConstantValuesAsNumber, getEnumConstantValuesAsString, getEnumerationI18nBaseKey, getErrorLogLevel, getErrorName, getHttpErrorResponse, getHttpErrorResponseStatus, getI18n, getI18nAsync, getI18nClassGroupKey, getI18nClassKeyBasePath, getI18nClassName, getI18nClassNameAsync, getI18nClassParams, getI18nClassParamsAsync, getI18nClassPropertyKey, getI18nClassTabKey, getI18nErrorParams, getI18nForError, getI18nTypeGroupKey, getI18nTypeKeyBasePath, getI18nTypeName, getI18nTypeNameAsync, getI18nTypeParams, getI18nTypeParamsAsync, getI18nTypePropertyKey, getI18nTypeTabKey, getObjectGetters, getObjectProperties, getObjectPropertyByPath, httpErrorResponseToString, isHttpErrorResponse, isPermitted, isRbacPermitted, itemIdToDefined, itemIdToNumber, itemIdToString, mapToDataList, mergeDataListParamsWithDefaults, number$Attribute, objectDeepCopy, objectDeepMerge, permissionGuard, populateI18nParams, populateI18nTypeParams, provideCommons, reflectEnumNameKey, reflectTypeNameExists, reflectTypeNameKey, removeRouteEmptyPathSegments, selectEnumerationI18n, selectI18n, stringify, toEnumerationI18nEnumerate, toObservable, toastMessage, valueToDefined };
3882
3952
  //# sourceMappingURL=mediusinc-mng-commons-core.mjs.map