@mediusinc/mng-commons 5.5.0-rc.4 → 6.0.0-rc.2

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 (267) hide show
  1. package/core/action/action-parameters.model.d.ts +4 -4
  2. package/core/data-providers/base.data-provider.d.ts +4 -7
  3. package/core/data-providers/lookup.data-provider.d.ts +2 -2
  4. package/core/descriptors/model.descriptor.d.ts +1 -7
  5. package/core/descriptors/tableview.descriptor.d.ts +5 -5
  6. package/core/helpers/route.d.ts +0 -1
  7. package/core/helpers/type-helpers.d.ts +8 -0
  8. package/core/index.d.ts +0 -3
  9. package/core/models/menu.model.d.ts +0 -4
  10. package/core/services/commons.service.d.ts +0 -32
  11. package/core/services/tokens/module-config.token.d.ts +0 -28
  12. package/esm2022/core/action/action-parameters.model.mjs +1 -1
  13. package/esm2022/core/data-providers/base.data-provider.mjs +2 -4
  14. package/esm2022/core/data-providers/lookup.data-provider.mjs +1 -1
  15. package/esm2022/core/descriptors/model.descriptor.mjs +1 -1
  16. package/esm2022/core/descriptors/tableview.descriptor.mjs +1 -1
  17. package/esm2022/core/helpers/type-helpers.mjs +1 -1
  18. package/esm2022/core/index.mjs +1 -4
  19. package/esm2022/core/models/menu.model.mjs +1 -1
  20. package/esm2022/core/services/commons.service.mjs +1 -34
  21. package/esm2022/core/services/tokens/module-config.token.mjs +1 -1
  22. package/esm2022/filter/descriptors/filter-lookup.descriptor.mjs +5 -86
  23. package/esm2022/filter/descriptors/filter.descriptor.mjs +7 -29
  24. package/esm2022/form/api/data-providers/lookup-data-provider.factory.mjs +14 -41
  25. package/esm2022/form/api/data-providers/lookup.data-provider.mjs +3 -3
  26. package/esm2022/model/class/data-providers/base-from-class-data-provider.factory.mjs +5 -0
  27. package/esm2022/model/class/descriptors/model-class.descriptor.mjs +28 -0
  28. package/esm2022/model/class/descriptors/type-class.descriptor.mjs +6 -0
  29. package/esm2022/model/class/helpers/model.mjs +53 -0
  30. package/esm2022/model/class/index.mjs +8 -0
  31. package/esm2022/model/class/mediusinc-mng-commons-model-class.mjs +5 -0
  32. package/esm2022/model/data-providers/base-from-type-data-provider.factory.mjs +11 -6
  33. package/esm2022/model/descriptors/model.descriptor.mjs +11 -54
  34. package/esm2022/model/descriptors/type.descriptor.mjs +2 -10
  35. package/esm2022/model/index.mjs +1 -2
  36. package/esm2022/table/api/class/class-table-attribute-converter.mjs +80 -0
  37. package/esm2022/table/api/class/class-table-attribute.model.mjs +2 -0
  38. package/esm2022/table/api/class/class-table-data-provider.factory.mjs +5 -0
  39. package/esm2022/table/api/class/class-table-descriptor-helpers.mjs +99 -0
  40. package/esm2022/table/api/class/class-table-descriptor.factory.mjs +21 -0
  41. package/esm2022/table/api/class/index.mjs +6 -0
  42. package/esm2022/table/api/class/mediusinc-mng-commons-table-api-class.mjs +5 -0
  43. package/esm2022/table/api/data-providers/table-data-provider.factory.mjs +14 -41
  44. package/esm2022/table/api/data-providers/table.data-provider.mjs +3 -9
  45. package/esm2022/table/api/descriptors/column.descriptor.mjs +8 -3
  46. package/esm2022/table/api/descriptors/table-descriptor.factory.mjs +10 -77
  47. package/esm2022/table/api/descriptors/table.descriptor.mjs +3 -3
  48. package/esm2022/table/api/helpers/column-converter.mjs +25 -0
  49. package/esm2022/table/api/helpers/table-data-provider-descriptor-convert.mjs +4 -4
  50. package/esm2022/table/api/index.mjs +2 -4
  51. package/esm2022/table/api/models/table-columns.model.mjs +1 -1
  52. package/esm2022/table/components/column-value/column-value.component.mjs +4 -3
  53. package/esm2022/table/components/filter/filter-active-tag/filter-active-tag.component.mjs +3 -3
  54. package/esm2022/table/components/filter/filter-form/filter-form.component.mjs +5 -5
  55. package/esm2022/table/components/table/table.component.mjs +6 -8
  56. package/esm2022/tableview/action/components/action/action.component.mjs +1 -1
  57. package/esm2022/tableview/action/components/editor/injector-context/action-editor-injector-context.component.mjs +10 -6
  58. package/esm2022/tableview/action/helpers/action-execution.mjs +1 -1
  59. package/esm2022/tableview/action/models/execution/action-context.model.mjs +1 -1
  60. package/esm2022/tableview/action/models/execution/action-instance.model.mjs +1 -1
  61. package/esm2022/tableview/action/services/action-executor.service.mjs +11 -11
  62. package/esm2022/tableview/action/services/data-provider-executor.service.mjs +18 -3
  63. package/esm2022/tableview/api/action/descriptors/action-confirmation.descriptor.mjs +1 -1
  64. package/esm2022/tableview/api/action/descriptors/action-descriptor.factory.mjs +13 -104
  65. package/esm2022/tableview/api/action/descriptors/action-editor-descriptor.factory.mjs +15 -62
  66. package/esm2022/tableview/api/action/descriptors/action-editor.descriptor.mjs +3 -63
  67. package/esm2022/tableview/api/action/descriptors/action-link-descriptor.factory.mjs +17 -30
  68. package/esm2022/tableview/api/action/descriptors/action-link.descriptor.mjs +1 -1
  69. package/esm2022/tableview/api/action/descriptors/action.descriptor.mjs +6 -29
  70. package/esm2022/tableview/api/action/descriptors/editor-action-descriptor.factory.mjs +21 -0
  71. package/esm2022/tableview/api/action/descriptors/editor-action-editor-descriptor.factory.mjs +21 -0
  72. package/esm2022/tableview/api/action/descriptors/table-action-descriptor.factory.mjs +37 -0
  73. package/esm2022/tableview/api/action/descriptors/table-action-editor-descriptor.factory.mjs +40 -0
  74. package/esm2022/tableview/api/action/helpers/data-provider-executors.mjs +25 -5
  75. package/esm2022/tableview/api/action/models/action-descriptor.types.mjs +1 -1
  76. package/esm2022/tableview/api/action/models/action-error.model.mjs +1 -1
  77. package/esm2022/tableview/api/action/models/execution/action-context-validation.model.mjs +1 -1
  78. package/esm2022/tableview/api/action/models/execution/action-context.model.mjs +1 -1
  79. package/esm2022/tableview/api/action/models/execution/action-instance.model.mjs +1 -1
  80. package/esm2022/tableview/api/action/models/tableview-action-default-categories.model.mjs +6 -6
  81. package/esm2022/tableview/api/action/services/data-provider-executor.service.mjs +3 -3
  82. package/esm2022/tableview/api/class/editor/class-editor-attribute-converter.mjs +85 -0
  83. package/esm2022/tableview/api/class/editor/class-editor-attribute.model.mjs +2 -0
  84. package/esm2022/tableview/api/class/editor/class-editor-data-provider.factory.mjs +5 -0
  85. package/esm2022/tableview/api/class/editor/class-editor-descriptor-helpers.mjs +95 -0
  86. package/esm2022/tableview/api/class/editor/class-editor-descriptor.factory.mjs +21 -0
  87. package/esm2022/tableview/api/class/index.mjs +13 -0
  88. package/esm2022/tableview/api/class/mediusinc-mng-commons-tableview-api-class.mjs +5 -0
  89. package/esm2022/tableview/api/class/tableview/class-tableview-attribute-converter.mjs +35 -0
  90. package/esm2022/tableview/api/class/tableview/class-tableview-attribute.model.mjs +2 -0
  91. package/esm2022/tableview/api/class/tableview/class-tableview-data-provider.factory.mjs +5 -0
  92. package/esm2022/tableview/api/class/tableview/class-tableview-descriptor-helpers.mjs +111 -0
  93. package/esm2022/tableview/api/class/tableview/class-tableview-descriptor.factory.mjs +26 -0
  94. package/esm2022/tableview/api/editor/data-providers/editor-data-provider.factory.mjs +14 -32
  95. package/esm2022/tableview/api/editor/data-providers/editor.data-provider.mjs +40 -7
  96. package/esm2022/tableview/api/editor/descriptors/editor-descriptor.factory.mjs +7 -73
  97. package/esm2022/tableview/api/editor/descriptors/editor.descriptor.mjs +49 -134
  98. package/esm2022/tableview/api/editor/descriptors/field-base.descriptor.mjs +11 -2
  99. package/esm2022/tableview/api/editor/descriptors/field-lookup.descriptor.mjs +3 -5
  100. package/esm2022/tableview/api/editor/descriptors/field-many.descriptor.mjs +2 -18
  101. package/esm2022/tableview/api/editor/descriptors/wrappers/editor-descriptor-nested-object-wrapper.mjs +51 -0
  102. package/esm2022/tableview/api/editor/models/editor-fields.model.mjs +1 -1
  103. package/esm2022/tableview/api/editor/models/form-editor.event.mjs +1 -1
  104. package/esm2022/tableview/api/index.mjs +8 -8
  105. package/esm2022/tableview/api/tableview/data-providers/tableview-data-provider.factory.mjs +13 -51
  106. package/esm2022/tableview/api/tableview/data-providers/tableview.data-provider.mjs +19 -11
  107. package/esm2022/tableview/api/tableview/descriptors/tableview-descriptor.factory.mjs +19 -96
  108. package/esm2022/tableview/api/tableview/descriptors/tableview.descriptor.mjs +29 -182
  109. package/esm2022/tableview/api/tableview/helpers/tableview-create.mjs +8 -6
  110. package/esm2022/tableview/api/tableview/helpers/tableview-data-provider-descriptor-convert.mjs +4 -4
  111. package/esm2022/tableview/api/tableview/helpers/tableview-default-actions.mjs +117 -99
  112. package/esm2022/tableview/api/tableview/helpers/tableview-input-builder.mjs +164 -7
  113. package/esm2022/tableview/api/tableview/models/tableview-descriptor-fields-manage-helper.type.mjs +2 -0
  114. package/esm2022/tableview/api/tableview/models/tableview-descriptor-helper.type.mjs +2 -0
  115. package/esm2022/tableview/api/tableview/models/tableview-input.model.mjs +1 -1
  116. package/esm2022/tableview/api/tableview/models/tableview-route.model.mjs +1 -1
  117. package/esm2022/tableview/editor/components/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.mjs +6 -6
  118. package/esm2022/tableview/editor/helpers/editor-field.mjs +3 -3
  119. package/esm2022/tableview/editor/helpers/editor-formly.mjs +4 -4
  120. package/esm2022/tableview/editor/helpers/field-create.mjs +21 -0
  121. package/esm2022/tableview/index.mjs +3 -2
  122. package/esm2022/tableview/tableview/components/route/tableview-route.component.mjs +1 -1
  123. package/esm2022/tableview/tableview/components/tableview/tableview.component.mjs +3 -1
  124. package/fesm2022/mediusinc-mng-commons-core.mjs +687 -781
  125. package/fesm2022/mediusinc-mng-commons-core.mjs.map +1 -1
  126. package/fesm2022/mediusinc-mng-commons-filter.mjs +10 -113
  127. package/fesm2022/mediusinc-mng-commons-filter.mjs.map +1 -1
  128. package/fesm2022/mediusinc-mng-commons-form-api.mjs +15 -42
  129. package/fesm2022/mediusinc-mng-commons-form-api.mjs.map +1 -1
  130. package/fesm2022/mediusinc-mng-commons-model-class.mjs +97 -0
  131. package/fesm2022/mediusinc-mng-commons-model-class.mjs.map +1 -0
  132. package/fesm2022/mediusinc-mng-commons-model.mjs +23 -137
  133. package/fesm2022/mediusinc-mng-commons-model.mjs.map +1 -1
  134. package/fesm2022/mediusinc-mng-commons-table-api-class.mjs +204 -0
  135. package/fesm2022/mediusinc-mng-commons-table-api-class.mjs.map +1 -0
  136. package/fesm2022/mediusinc-mng-commons-table-api.mjs +55 -319
  137. package/fesm2022/mediusinc-mng-commons-table-api.mjs.map +1 -1
  138. package/fesm2022/mediusinc-mng-commons-table.mjs +14 -15
  139. package/fesm2022/mediusinc-mng-commons-table.mjs.map +1 -1
  140. package/fesm2022/mediusinc-mng-commons-tableview-api-class.mjs +367 -0
  141. package/fesm2022/mediusinc-mng-commons-tableview-api-class.mjs.map +1 -0
  142. package/fesm2022/mediusinc-mng-commons-tableview-api.mjs +715 -1298
  143. package/fesm2022/mediusinc-mng-commons-tableview-api.mjs.map +1 -1
  144. package/fesm2022/mediusinc-mng-commons-tableview.mjs +67 -27
  145. package/fesm2022/mediusinc-mng-commons-tableview.mjs.map +1 -1
  146. package/filter/descriptors/filter-lookup.descriptor.d.ts +1 -26
  147. package/filter/descriptors/filter.descriptor.d.ts +5 -12
  148. package/form/api/data-providers/lookup-data-provider.factory.d.ts +17 -20
  149. package/form/api/data-providers/lookup.data-provider.d.ts +3 -3
  150. package/model/class/README.md +8 -0
  151. package/model/class/data-providers/base-from-class-data-provider.factory.d.ts +3 -0
  152. package/model/class/descriptors/model-class.descriptor.d.ts +12 -0
  153. package/model/class/descriptors/type-class.descriptor.d.ts +3 -0
  154. package/model/{helpers → class/helpers}/model.d.ts +1 -2
  155. package/model/class/index.d.ts +4 -0
  156. package/model/data-providers/base-from-type-data-provider.factory.d.ts +13 -6
  157. package/model/descriptors/model.descriptor.d.ts +12 -27
  158. package/model/descriptors/type.descriptor.d.ts +0 -5
  159. package/model/index.d.ts +0 -1
  160. package/package.json +25 -7
  161. package/table/api/class/README.md +10 -0
  162. package/table/api/{helpers/class-attribute-converter.d.ts → class/class-table-attribute-converter.d.ts} +2 -9
  163. package/table/api/{models → class}/class-table-attribute.model.d.ts +1 -1
  164. package/table/api/class/class-table-data-provider.factory.d.ts +4 -0
  165. package/table/api/{helpers/table-descriptor-helpers.d.ts → class/class-table-descriptor-helpers.d.ts} +2 -4
  166. package/table/api/class/class-table-descriptor.factory.d.ts +11 -0
  167. package/table/api/class/index.d.ts +5 -0
  168. package/table/api/data-providers/table-data-provider.factory.d.ts +17 -20
  169. package/table/api/data-providers/table.data-provider.d.ts +4 -12
  170. package/table/api/descriptors/column.descriptor.d.ts +5 -2
  171. package/table/api/descriptors/table-descriptor.factory.d.ts +3 -39
  172. package/table/api/descriptors/table.descriptor.d.ts +3 -3
  173. package/table/api/helpers/column-converter.d.ts +7 -0
  174. package/table/api/helpers/table-data-provider-descriptor-convert.d.ts +3 -3
  175. package/table/api/index.d.ts +1 -3
  176. package/table/api/models/table-columns.model.d.ts +2 -2
  177. package/table/components/column-value/column-value.component.d.ts +1 -0
  178. package/table/components/filter/filter-active-tag/filter-active-tag.component.d.ts +1 -1
  179. package/table/components/filter/filter-form/filter-form.component.d.ts +1 -1
  180. package/table/components/filter/filter-overlay-with-tag/filter-overlay-with-tag.component.d.ts +1 -1
  181. package/table/components/table/table.component.d.ts +0 -9
  182. package/tableview/action/components/action/action.component.d.ts +2 -2
  183. package/tableview/action/components/editor/action-editor.component.d.ts +1 -1
  184. package/tableview/action/components/editor/injector-context/action-editor-injector-context.component.d.ts +6 -5
  185. package/tableview/action/components/localization/data-language-dropdown.component.d.ts +3 -3
  186. package/tableview/action/components/table/action-table.component.d.ts +3 -3
  187. package/tableview/action/helpers/action-execution.d.ts +1 -1
  188. package/tableview/action/models/execution/action-context.model.d.ts +3 -3
  189. package/tableview/action/models/execution/action-instance.model.d.ts +5 -5
  190. package/tableview/action/services/action-executor.service.d.ts +7 -7
  191. package/tableview/action/services/data-provider-executor.service.d.ts +16 -16
  192. package/tableview/action/services/view-container.service.d.ts +1 -1
  193. package/tableview/api/action/descriptors/action-confirmation.descriptor.d.ts +1 -1
  194. package/tableview/api/action/descriptors/action-descriptor.factory.d.ts +20 -31
  195. package/tableview/api/action/descriptors/action-editor-descriptor.factory.d.ts +18 -25
  196. package/tableview/api/action/descriptors/action-editor.descriptor.d.ts +22 -40
  197. package/tableview/api/action/descriptors/action-link-descriptor.factory.d.ts +21 -13
  198. package/tableview/api/action/descriptors/action-link.descriptor.d.ts +3 -3
  199. package/tableview/api/action/descriptors/action.descriptor.d.ts +31 -33
  200. package/tableview/api/action/descriptors/editor-action-descriptor.factory.d.ts +21 -0
  201. package/tableview/api/action/descriptors/editor-action-editor-descriptor.factory.d.ts +21 -0
  202. package/tableview/api/action/descriptors/table-action-descriptor.factory.d.ts +36 -0
  203. package/tableview/api/action/descriptors/table-action-editor-descriptor.factory.d.ts +40 -0
  204. package/tableview/api/action/helpers/data-provider-executors.d.ts +13 -8
  205. package/tableview/api/action/models/action-descriptor.types.d.ts +2 -2
  206. package/tableview/api/action/models/action-error.model.d.ts +1 -1
  207. package/tableview/api/action/models/execution/action-context-validation.model.d.ts +2 -2
  208. package/tableview/api/action/models/execution/action-context.model.d.ts +2 -2
  209. package/tableview/api/action/models/execution/action-instance.model.d.ts +1 -1
  210. package/tableview/api/action/models/tableview-action-default-categories.model.d.ts +5 -5
  211. package/tableview/api/action/services/data-provider-executor.service.d.ts +26 -25
  212. package/tableview/api/class/README.md +13 -0
  213. package/tableview/api/{editor/helpers/class-attribute-converter.d.ts → class/editor/class-editor-attribute-converter.d.ts} +2 -2
  214. package/tableview/api/{editor/models/class-tableview-attribute.model.d.ts → class/editor/class-editor-attribute.model.d.ts} +1 -1
  215. package/tableview/api/class/editor/class-editor-data-provider.factory.d.ts +4 -0
  216. package/tableview/api/{editor/helpers/editor-descriptor-helpers.d.ts → class/editor/class-editor-descriptor-helpers.d.ts} +2 -5
  217. package/tableview/api/class/editor/class-editor-descriptor.factory.d.ts +11 -0
  218. package/tableview/api/class/index.d.ts +10 -0
  219. package/tableview/api/{tableview/helpers/class-attribute-converter.d.ts → class/tableview/class-tableview-attribute-converter.d.ts} +1 -1
  220. package/tableview/api/{tableview/models → class/tableview}/class-tableview-attribute.model.d.ts +2 -2
  221. package/tableview/api/class/tableview/class-tableview-data-provider.factory.d.ts +4 -0
  222. package/tableview/api/{tableview/helpers/tableview-descriptor-helpers.d.ts → class/tableview/class-tableview-descriptor-helpers.d.ts} +1 -2
  223. package/tableview/api/class/tableview/class-tableview-descriptor.factory.d.ts +12 -0
  224. package/tableview/api/editor/data-providers/editor-data-provider.factory.d.ts +17 -16
  225. package/tableview/api/editor/data-providers/editor.data-provider.d.ts +64 -29
  226. package/tableview/api/editor/descriptors/editor-descriptor.factory.d.ts +5 -38
  227. package/tableview/api/editor/descriptors/editor.descriptor.d.ts +48 -112
  228. package/tableview/api/editor/descriptors/field-base.descriptor.d.ts +8 -1
  229. package/tableview/api/editor/descriptors/field-lookup.descriptor.d.ts +2 -3
  230. package/tableview/api/editor/descriptors/field-many.descriptor.d.ts +3 -11
  231. package/tableview/api/editor/descriptors/wrappers/editor-descriptor-nested-object-wrapper.d.ts +25 -0
  232. package/tableview/api/editor/models/editor-fields.model.d.ts +25 -21
  233. package/tableview/api/editor/models/form-editor.event.d.ts +0 -4
  234. package/tableview/api/index.d.ts +7 -6
  235. package/tableview/api/tableview/data-providers/tableview-data-provider.factory.d.ts +20 -25
  236. package/tableview/api/tableview/data-providers/tableview.data-provider.d.ts +22 -22
  237. package/tableview/api/tableview/descriptors/tableview-descriptor.factory.d.ts +20 -50
  238. package/tableview/api/tableview/descriptors/tableview.descriptor.d.ts +69 -163
  239. package/tableview/api/tableview/helpers/tableview-create.d.ts +18 -5
  240. package/tableview/api/tableview/helpers/tableview-data-provider-descriptor-convert.d.ts +2 -2
  241. package/tableview/api/tableview/helpers/tableview-default-actions.d.ts +73 -20
  242. package/tableview/api/tableview/helpers/tableview-input-builder.d.ts +87 -9
  243. package/tableview/api/tableview/models/tableview-descriptor-fields-manage-helper.type.d.ts +9 -0
  244. package/tableview/api/tableview/models/tableview-descriptor-helper.type.d.ts +2 -0
  245. package/tableview/api/tableview/models/tableview-input.model.d.ts +1 -1
  246. package/tableview/api/tableview/models/tableview-route.model.d.ts +1 -1
  247. package/tableview/editor/helpers/field-create.d.ts +9 -0
  248. package/tableview/index.d.ts +2 -1
  249. package/tableview/tableview/components/route/tableview-route.component.d.ts +1 -1
  250. package/tableview/tableview/components/tableview/tableview.component.d.ts +6 -6
  251. package/version-info.json +5 -5
  252. package/core/components/pages/error/error.page.component.d.ts +0 -11
  253. package/core/components/pages/not-found/not-found.page.component.d.ts +0 -11
  254. package/core/data-providers/base-data-provider.factory.d.ts +0 -13
  255. package/esm2022/core/components/pages/error/error.page.component.mjs +0 -24
  256. package/esm2022/core/components/pages/not-found/not-found.page.component.mjs +0 -24
  257. package/esm2022/core/data-providers/base-data-provider.factory.mjs +0 -28
  258. package/esm2022/model/helpers/model.mjs +0 -71
  259. package/esm2022/table/api/helpers/class-attribute-converter.mjs +0 -104
  260. package/esm2022/table/api/helpers/table-descriptor-helpers.mjs +0 -98
  261. package/esm2022/table/api/models/class-table-attribute.model.mjs +0 -2
  262. package/esm2022/tableview/api/editor/helpers/class-attribute-converter.mjs +0 -85
  263. package/esm2022/tableview/api/editor/helpers/editor-descriptor-helpers.mjs +0 -95
  264. package/esm2022/tableview/api/editor/models/class-tableview-attribute.model.mjs +0 -2
  265. package/esm2022/tableview/api/tableview/helpers/class-attribute-converter.mjs +0 -34
  266. package/esm2022/tableview/api/tableview/helpers/tableview-descriptor-helpers.mjs +0 -110
  267. package/esm2022/tableview/api/tableview/models/class-tableview-attribute.model.mjs +0 -2
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
- import { computed, signal, Component, ChangeDetectionStrategy, InjectionToken, inject, DestroyRef, effect, Injectable, Injector, ElementRef, ApplicationRef, ViewContainerRef, EventEmitter, EnvironmentInjector, createComponent, Directive, Input, Output, TemplateRef, input, booleanAttribute, numberAttribute, Pipe, untracked, APP_INITIALIZER, ErrorHandler } from '@angular/core';
3
- import * as i3$1 from '@ngx-translate/core';
2
+ import { computed, signal, Component, ChangeDetectionStrategy, inject, Injector, ElementRef, ApplicationRef, ViewContainerRef, EventEmitter, EnvironmentInjector, createComponent, Directive, Input, Output, TemplateRef, input, effect, booleanAttribute, numberAttribute, Pipe, untracked, InjectionToken, DestroyRef, Injectable, APP_INITIALIZER, ErrorHandler } from '@angular/core';
3
+ import * as i4 from '@ngx-translate/core';
4
4
  import { TranslateModule, TranslateService } from '@ngx-translate/core';
5
5
  import * as i3 from 'primeng/confirmdialog';
6
6
  import { ConfirmDialogModule } from 'primeng/confirmdialog';
@@ -10,16 +10,14 @@ import * as i1 from 'primeng/toast';
10
10
  import { ToastModule } from 'primeng/toast';
11
11
  import * as i2 from 'primeng/api';
12
12
  import { PrimeNGConfig, MessageService, ConfirmationService } from 'primeng/api';
13
- import { Router, NavigationEnd, RouterLink, NavigationStart, RouteConfigLoadStart, RouteConfigLoadEnd, NavigationCancel, NavigationError } from '@angular/router';
14
- import * as i2$1 from 'primeng/button';
15
- import { ButtonModule } from 'primeng/button';
16
- import { takeUntilDestroyed, toObservable as toObservable$1 } from '@angular/core/rxjs-interop';
17
- import { Title } from '@angular/platform-browser';
18
- import { filter, map, first, catchError } from 'rxjs/operators';
19
- import { DatePipe } from '@angular/common';
20
13
  import { HttpErrorResponse, HttpClient, HttpBackend } from '@angular/common/http';
14
+ import { DatePipe } from '@angular/common';
21
15
  import { isObservable, of, mergeMap, combineLatest, Observable, tap, ReplaySubject, Subject, take, throwError as throwError$1 } from 'rxjs';
16
+ import { map, filter, first, catchError } from 'rxjs/operators';
22
17
  import 'reflect-metadata';
18
+ import { takeUntilDestroyed, toObservable as toObservable$1 } from '@angular/core/rxjs-interop';
19
+ import { Title } from '@angular/platform-browser';
20
+ import { Router, NavigationEnd, NavigationStart, RouteConfigLoadStart, RouteConfigLoadEnd, NavigationCancel, NavigationError } from '@angular/router';
23
21
  import { DialogService } from 'primeng/dynamicdialog';
24
22
 
25
23
  class NotificationWrapperComponent {
@@ -54,7 +52,7 @@ class NotificationWrapperComponent {
54
52
  }
55
53
  }
56
54
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: NotificationWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
57
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.12", 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 ' + getMessageIcon(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 appendTo=\"body\"\n draggable=\"false\"\n modal=\"true\">\n <ng-template pTemplate=\"header\" mngDialogKeydownHandler>\n <span class=\"p-dialog-title font-bold mng-dialog-success\">\n <span [class]=\"'mr-2 pi ' + dialogNotificationIconClass()\"></span>\n {{ dialogNotification()?.summary ?? '' }}\n </span>\n </ng-template>\n <div class=\"mng-notification-details\">\n {{ dialogNotification()?.detail ?? '' }}\n </div>\n</p-dialog>\n", styles: [".mng-notification-details{white-space:pre-wrap;word-wrap:break-word}\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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
55
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.12", 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 ' + getMessageIcon(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 appendTo=\"body\"\n draggable=\"false\"\n modal=\"true\">\n <ng-template pTemplate=\"header\" mngDialogKeydownHandler>\n <span class=\"p-dialog-title font-bold mng-dialog-success\">\n <span [class]=\"'mr-2 pi ' + dialogNotificationIconClass()\"></span>\n {{ dialogNotification()?.summary ?? '' }}\n </span>\n </ng-template>\n <div class=\"mng-notification-details\">\n {{ dialogNotification()?.detail ?? '' }}\n </div>\n</p-dialog>\n", styles: [".mng-notification-details{white-space:pre-wrap;word-wrap:break-word}\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: i4.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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
58
56
  }
59
57
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: NotificationWrapperComponent, decorators: [{
60
58
  type: Component,
@@ -213,672 +211,155 @@ function angularDateFormatHasSeconds(ngDateFormat) {
213
211
  return /[sS]/.test(ngDateFormat);
214
212
  }
215
213
 
216
- var LogLevelEnum;
217
- (function (LogLevelEnum) {
218
- LogLevelEnum[LogLevelEnum["Trace"] = 0] = "Trace";
219
- LogLevelEnum[LogLevelEnum["Debug"] = 1] = "Debug";
220
- LogLevelEnum[LogLevelEnum["Log"] = 2] = "Log";
221
- LogLevelEnum[LogLevelEnum["Info"] = 3] = "Info";
222
- LogLevelEnum[LogLevelEnum["Warning"] = 4] = "Warning";
223
- LogLevelEnum[LogLevelEnum["Error"] = 5] = "Error";
224
- })(LogLevelEnum || (LogLevelEnum = {}));
225
-
226
- class LoggerService {
227
- static { this._instance = new LoggerService(); }
228
- static { this._isInit = false; }
229
- static { this._publishers = []; }
230
- static { this._entriesBuffer = []; }
231
- static { this._categoryInstances = {}; }
232
- static { this._timestampFormat = 'yyyy-MM-dd HH:mm:ss.SSS'; }
233
- constructor() {
234
- // Temporary settings that cover logging calls before initialisation
235
- this.defaultLogLevel = LogLevelEnum.Info;
236
- this.datePipe = new DatePipe('en-US');
237
- // empty
238
- }
239
- static get() {
240
- return LoggerService._instance;
241
- }
242
- static configure(config) {
243
- if (config.timestampFormat) {
244
- LoggerService._timestampFormat = config.timestampFormat;
245
- }
246
- }
247
- static init(configurationService, publishers) {
248
- if (LoggerService._isInit) {
249
- return;
250
- }
251
- LoggerService._configurationService = configurationService;
252
- LoggerService._publishers = publishers;
253
- LoggerService._isInit = true;
254
- LoggerService._flushBuffer();
255
- }
256
- static _flushBuffer() {
257
- if (!LoggerService._isInit) {
258
- return;
214
+ class FilterMatchMode {
215
+ static { this.Equals = 'equals'; }
216
+ static { this.EqualsAbbr = 'eq'; }
217
+ static { this.NotEquals = 'notEquals'; }
218
+ static { this.NotEqualsAbbr = 'ne'; }
219
+ static { this.Contains = 'contains'; }
220
+ static { this.ContainsAbbr = 'cn'; }
221
+ static { this.NotContains = 'notContains'; }
222
+ static { this.NotContainsAbbr = 'nc'; }
223
+ static { this.In = 'in'; }
224
+ static { this.InAbbr = 'in'; }
225
+ static { this.NotIn = 'notIn'; }
226
+ static { this.NotInAbbr = 'ni'; }
227
+ static { this.StartsWith = 'startsWith'; }
228
+ static { this.StartsWithAbbr = 'sw'; }
229
+ static { this.EndsWith = 'endsWith'; }
230
+ static { this.EndsWithAbbr = 'ew'; }
231
+ static { this.LessThan = 'lessThan'; }
232
+ static { this.LessThanAbbr = 'lt'; }
233
+ static { this.LessThanOrEqualTo = 'lessThanOrEqualTo'; }
234
+ static { this.LessThanOrEqualToAbbr = 'le'; }
235
+ static { this.GreaterThan = 'greaterThan'; }
236
+ static { this.GreaterThanAbbr = 'gt'; }
237
+ static { this.GreaterThanOrEqualTo = 'greaterThanOrEqualTo'; }
238
+ static { this.GreaterThanOrEqualToAbbr = 'ge'; }
239
+ static { this.Between = 'between'; }
240
+ static { this.BetweenAbbr = 'bt'; }
241
+ static { this.Exists = 'exists'; }
242
+ static { this.ExistsAbbr = 'ex'; }
243
+ static { this.DoesNotExist = 'doesNotExist'; }
244
+ static { this.DoesNotExistAbbr = 'nx'; }
245
+ static getAbbreviation(mode) {
246
+ switch (mode) {
247
+ case FilterMatchMode.Equals:
248
+ return FilterMatchMode.EqualsAbbr;
249
+ case FilterMatchMode.NotEquals:
250
+ return FilterMatchMode.NotEqualsAbbr;
251
+ case FilterMatchMode.Contains:
252
+ return FilterMatchMode.ContainsAbbr;
253
+ case FilterMatchMode.NotContains:
254
+ return FilterMatchMode.NotContainsAbbr;
255
+ case FilterMatchMode.In:
256
+ return FilterMatchMode.InAbbr;
257
+ case FilterMatchMode.NotIn:
258
+ return FilterMatchMode.NotInAbbr;
259
+ case FilterMatchMode.StartsWith:
260
+ return FilterMatchMode.StartsWithAbbr;
261
+ case FilterMatchMode.EndsWith:
262
+ return FilterMatchMode.EndsWithAbbr;
263
+ case FilterMatchMode.LessThan:
264
+ return FilterMatchMode.LessThanAbbr;
265
+ case FilterMatchMode.LessThanOrEqualTo:
266
+ return FilterMatchMode.LessThanOrEqualToAbbr;
267
+ case FilterMatchMode.GreaterThan:
268
+ return FilterMatchMode.GreaterThanAbbr;
269
+ case FilterMatchMode.GreaterThanOrEqualTo:
270
+ return FilterMatchMode.GreaterThanOrEqualToAbbr;
271
+ case FilterMatchMode.Between:
272
+ return FilterMatchMode.BetweenAbbr;
273
+ case FilterMatchMode.Exists:
274
+ return FilterMatchMode.ExistsAbbr;
275
+ case FilterMatchMode.DoesNotExist:
276
+ return FilterMatchMode.DoesNotExistAbbr;
277
+ default:
278
+ return null;
259
279
  }
260
- LoggerService._entriesBuffer.forEach(e => this._instance._log(e));
261
- LoggerService._entriesBuffer = [];
262
280
  }
263
- static create(category) {
264
- return LoggerService._instance.create(category);
265
- }
266
- create(category) {
267
- if (this.category) {
268
- throw new CommonsInternalError(`Cannot create logger with category inside another category (${this.category}). Must create logger on root.`);
269
- }
270
- if (LoggerService._categoryInstances[category]) {
271
- return LoggerService._categoryInstances[category];
281
+ static fromAbbreviation(abbr) {
282
+ switch (abbr) {
283
+ case FilterMatchMode.EqualsAbbr:
284
+ return FilterMatchMode.Equals;
285
+ case FilterMatchMode.NotEqualsAbbr:
286
+ return FilterMatchMode.NotEquals;
287
+ case FilterMatchMode.ContainsAbbr:
288
+ return FilterMatchMode.Contains;
289
+ case FilterMatchMode.NotContainsAbbr:
290
+ return FilterMatchMode.NotContains;
291
+ case FilterMatchMode.InAbbr:
292
+ return FilterMatchMode.In;
293
+ case FilterMatchMode.NotInAbbr:
294
+ return FilterMatchMode.NotIn;
295
+ case FilterMatchMode.StartsWithAbbr:
296
+ return FilterMatchMode.StartsWith;
297
+ case FilterMatchMode.EndsWithAbbr:
298
+ return FilterMatchMode.EndsWith;
299
+ case FilterMatchMode.LessThanAbbr:
300
+ return FilterMatchMode.LessThan;
301
+ case FilterMatchMode.LessThanOrEqualToAbbr:
302
+ return FilterMatchMode.LessThanOrEqualTo;
303
+ case FilterMatchMode.GreaterThanAbbr:
304
+ return FilterMatchMode.GreaterThan;
305
+ case FilterMatchMode.GreaterThanOrEqualToAbbr:
306
+ return FilterMatchMode.GreaterThanOrEqualTo;
307
+ case FilterMatchMode.BetweenAbbr:
308
+ return FilterMatchMode.Between;
309
+ case FilterMatchMode.ExistsAbbr:
310
+ return FilterMatchMode.Exists;
311
+ case FilterMatchMode.DoesNotExistAbbr:
312
+ return FilterMatchMode.DoesNotExist;
313
+ default:
314
+ return null;
272
315
  }
273
- const logger = new LoggerService();
274
- logger.category = category;
275
- LoggerService._categoryInstances[category] = logger;
276
- return logger;
277
316
  }
278
- _processLog(msgOrError, logLevel, category = undefined, data) {
279
- const [timestamp, timestampFormatted] = [...this._getTimestamps()];
280
- const logEntry = {
281
- level: logLevel,
282
- message: typeof msgOrError === 'string' ? msgOrError : msgOrError.message,
283
- data: data,
284
- category: this.category ?? category,
285
- timestamp: timestamp,
286
- timestampFormatted: timestampFormatted ?? undefined
287
- };
288
- if (msgOrError instanceof Error) {
289
- // set error from message param
290
- logEntry.error = msgOrError;
291
- }
292
- else if (data?.length && data[0] instanceof Error) {
293
- // if first data is error, also consider as error
294
- logEntry.error = data[0];
295
- logEntry.data = data.splice(1);
296
- }
297
- this._log(logEntry);
317
+ }
318
+
319
+ /**
320
+ * Converts a TableLazyLoadEvent to DataListParams.
321
+ *
322
+ * @param {TableLazyLoadEvent} event - The event containing the data to convert.
323
+ * @return {DataListParams} - The converted DataListParams object.
324
+ */
325
+ function fromTableLoadToDataListParams(event) {
326
+ const params = {};
327
+ if (event.first != null) {
328
+ params.offset = event.first;
298
329
  }
299
- _getTimestamps() {
300
- const timestamp = new Date();
301
- const timestampFormatted = this.datePipe.transform(timestamp, LoggerService._timestampFormat) ?? dateToIsoString(timestamp);
302
- return [timestamp, timestampFormatted];
330
+ if (event.rows != null) {
331
+ params.limit = event.rows;
303
332
  }
304
- _log(log) {
305
- if (!LoggerService._isInit) {
306
- // add to buffer
307
- LoggerService._entriesBuffer.push(log);
308
- return;
309
- }
310
- const logConfig = (LoggerService._configurationService?.getConfigValue)?.('log');
311
- if ((this.category && log.level < (logConfig?.category?.[this.category]?.level ?? logConfig?.level ?? this.defaultLogLevel)) ||
312
- (!this.category && log.level < (logConfig?.level ?? this.defaultLogLevel))) {
313
- return;
314
- }
315
- if (logConfig?.timestampFormat) {
316
- log.timestampFormatted = this.datePipe.transform(log.timestamp, logConfig.timestampFormat) ?? undefined;
317
- }
318
- LoggerService._publishers.forEach(p => p.addEntry(log));
333
+ if (typeof event.globalFilter === 'string') {
334
+ params.search = event.globalFilter;
319
335
  }
320
- trace(msgOrError, ...data) {
321
- this._processLog(msgOrError, LogLevelEnum.Trace, undefined, data);
336
+ else if (Array.isArray(event.globalFilter) && event.globalFilter.length > 0) {
337
+ params.search = event.globalFilter[0];
322
338
  }
323
- debug(msgOrError, ...data) {
324
- this._processLog(msgOrError, LogLevelEnum.Debug, undefined, data);
339
+ if (Array.isArray(event.multiSortMeta) && event.multiSortMeta.length > 0) {
340
+ params.sort = event.multiSortMeta.map(m => ({ property: m.field, ascending: m.order >= 0 }));
325
341
  }
326
- log(msgOrError, logLevel = LogLevelEnum.Log, category = undefined, ...data) {
327
- this._processLog(msgOrError, logLevel, category, data);
328
- }
329
- logEntry(logEntry) {
330
- const [timestamp, timestampFormatted] = [...this._getTimestamps()];
331
- const logEntryFinal = {
332
- timestamp: timestamp,
333
- timestampFormatted: timestampFormatted ?? undefined,
334
- category: this.category ?? logEntry.category,
335
- message: '',
336
- messageDetails: logEntry.messageDetails,
337
- level: LogLevelEnum.Log,
338
- ...logEntry
339
- };
340
- this._log(logEntryFinal);
341
- }
342
- info(msgOrError, ...data) {
343
- this._processLog(msgOrError, LogLevelEnum.Info, undefined, data);
344
- }
345
- warn(msgOrError, ...data) {
346
- this._processLog(msgOrError, LogLevelEnum.Warning, undefined, data);
347
- }
348
- error(msgOrError, ...data) {
349
- this._processLog(msgOrError, LogLevelEnum.Error, undefined, data);
350
- }
351
- }
352
-
353
- const BROWSER_STORAGE_IT = new InjectionToken('BROWSER_STORAGE');
354
-
355
- const COMMONS_MODULE_CONFIG_IT = new InjectionToken('COMMONS_MODULE_CONFIG');
356
-
357
- class CommonsService {
358
- getDefaultLocale() {
359
- const browserLang = this.translate.getBrowserLang();
360
- if (browserLang && this.appLocales().some(l => l === browserLang)) {
361
- return browserLang;
362
- }
363
- return this.appLocales()?.length > 0 ? this.appLocales()[0] : 'en';
364
- }
365
- initAppLocale() {
366
- const lsLang = this.localStorage.getItem('lang');
367
- if (lsLang && this.appLocales().some(l => l === lsLang)) {
368
- return lsLang;
369
- }
370
- return this.getDefaultLocale();
371
- }
372
- setAppLocale(language) {
373
- if (this.appLocales().some(l => l === language)) {
374
- this.translate.use(language);
375
- this._appLocale.set(language);
376
- if (language !== this.getDefaultLocale())
377
- this.localStorage.setItem('lang', language);
378
- else
379
- this.localStorage.removeItem('lang');
380
- }
381
- }
382
- clearAppLocale() {
383
- this.localStorage.removeItem('lang');
384
- this._appLocale.set(this.getDefaultLocale());
385
- }
386
- initAppDataLocale() {
387
- const dataLang = this.localStorage.getItem('dataLang');
388
- if (dataLang && this.appDataLocales().some(dl => dl === dataLang)) {
389
- return dataLang;
390
- }
391
- return this.appDataLocales()?.length > 0 ? this.getDefaultLocale() : 'en';
392
- }
393
- setAppDataLocale(dataLocale) {
394
- if (this.appDataLocales().some(dl => dl === dataLocale)) {
395
- this._appDataLocale.set(dataLocale);
396
- if (dataLocale !== this.getDefaultLocale())
397
- this.localStorage.setItem('dataLang', dataLocale);
398
- else
399
- this.localStorage.removeItem('dataLang');
400
- }
401
- }
402
- clearAppDataLocale() {
403
- this.localStorage.removeItem('lang');
404
- this._appDataLocale.set(this.getDefaultLocale());
405
- }
406
- constructor() {
407
- // internal
408
- this.logger = inject(LoggerService).create('CommonsService');
409
- this.router = inject(Router);
410
- this.primengConfig = inject(PrimeNGConfig);
411
- this.translate = inject(TranslateService);
412
- this.titleService = inject(Title);
413
- this.moduleConfig = inject(COMMONS_MODULE_CONFIG_IT, { optional: true });
414
- this.localStorage = inject(BROWSER_STORAGE_IT);
415
- this.destroyRef = inject(DestroyRef);
416
- // breadcrumbs
417
- this.breadcrumbHome = signal({
418
- icon: 'pi pi-home',
419
- routerLink: '/'
420
- });
421
- this.breadcrumbs = signal([]);
422
- // visual
423
- /**
424
- * @deprecated Use layout colorScheme instead.
425
- */
426
- this.colorScheme = signal(this.moduleConfig?.app?.colorScheme ?? 'light');
427
- /**
428
- * @deprecated Use layout colorScheme instead.
429
- */
430
- this.colorSchemeIsLight = computed(() => this.colorScheme() === 'light');
431
- // user
432
- this.user = signal(undefined);
433
- this.userRoles = signal([]);
434
- // APP section
435
- this.appName = signal(this.moduleConfig?.app?.name ?? 'app.name');
436
- this.appOwner = signal(this.moduleConfig?.app?.owner ?? 'app.owner');
437
- /**
438
- * @deprecated Use layout app logo instead.
439
- */
440
- this.appLogoLight = signal(this.moduleConfig?.app?.logoPathLight ? this.moduleConfig.app.logoPathLight : (this.moduleConfig?.app?.logoPath ?? 'assets/layout/images/logo.png'));
441
- /**
442
- * @deprecated Use layout app logo instead.
443
- */
444
- this.appLogoDark = signal(this.moduleConfig?.app?.logoPathDark ? this.moduleConfig.app.logoPathDark : (this.moduleConfig?.app?.logoPath ?? 'assets/layout/images/logo.png'));
445
- /**
446
- * @deprecated Use layout app logo instead.
447
- */
448
- this.appLogo = computed(() => (this.colorSchemeIsLight() ? this.appLogoLight() : this.appLogoDark()));
449
- /**
450
- * @deprecated Use layout app logo instead.
451
- */
452
- this.appLogoNameLight = signal(this.moduleConfig?.app?.logoNamePathLight ? this.moduleConfig.app.logoNamePathLight : (this.moduleConfig?.app?.logoNamePath ?? 'assets/layout/images/logo-appname.png'));
453
- /**
454
- * @deprecated Use layout app logo instead.
455
- */
456
- this.appLogoNameDark = signal(this.moduleConfig?.app?.logoNamePathDark ? this.moduleConfig.app.logoNamePathDark : (this.moduleConfig?.app?.logoNamePath ?? 'assets/layout/images/logo-appname.png'));
457
- /**
458
- * @deprecated Use layout app logo instead.
459
- */
460
- this.appLogoName = computed(() => (this.colorSchemeIsLight() ? this.appLogoNameLight() : this.appLogoNameDark()));
461
- this.appLocales = signal(this.moduleConfig?.app?.locales ?? ['en']);
462
- this._appLocale = signal(this.initAppLocale());
463
- this.appLocale = computed(() => this._appLocale());
464
- this.appDataLocales = signal(this.moduleConfig?.app?.dataLocales ?? ['en']);
465
- this._appDataLocale = signal(this.initAppDataLocale());
466
- this.appDataLocale = computed(() => this._appDataLocale());
467
- this.appVersion = signal(this.moduleConfig?.app?.version);
468
- // ripple
469
- this.primengConfig.ripple = true;
470
- effect(() => {
471
- const appLocales = this.appLocales();
472
- if (appLocales) {
473
- this.setAppLocale(this.initAppLocale());
474
- this.translate.langs = this.appLocales();
475
- }
476
- const appDataLocales = this.appDataLocales();
477
- if (appDataLocales)
478
- this.setAppDataLocale(this.initAppDataLocale());
479
- }, { allowSignalWrites: true });
480
- this.router.events
481
- .pipe(
482
- // Filter the NavigationEnd events as the breadcrumb is updated only when the route reaches its end
483
- filter(event => event instanceof NavigationEnd), takeUntilDestroyed())
484
- .subscribe(() => {
485
- this.updateBreadcrumbs();
486
- this.setPageTitle();
487
- });
488
- this.translate.onLangChange.pipe(takeUntilDestroyed()).subscribe(() => {
489
- this.updateBreadcrumbs();
490
- this.setPageTitle();
491
- });
492
- this.translate
493
- .stream('mngPrime')
494
- .pipe(takeUntilDestroyed())
495
- .subscribe(value => this.primengConfig.setTranslation(value));
496
- }
497
- initialize() {
498
- this.logger.debug('Initialize');
499
- }
500
- // BREADCRUMB actions
501
- findBreadcrumbItem(item) {
502
- const items = this.breadcrumbs();
503
- if (item.id) {
504
- return items.find(i => i.id && i.id === item.id) ?? null;
505
- }
506
- else if (item.routerLink) {
507
- const routerLinkStr = Array.isArray(item.routerLink) ? item.routerLink.join('/') : item.routerLink;
508
- return items.find(i => i.routerLink && (Array.isArray(i.routerLink) ? i.routerLink.join('/') : i.routerLink) === routerLinkStr) ?? null;
509
- }
510
- else if (item.positionIndex) {
511
- return items.find(i => i.positionIndex && i.positionIndex === i.positionIndex) ?? null;
512
- }
513
- else if (item.label) {
514
- return items.find(i => i.label && i.label === i.label) ?? null;
515
- }
516
- else if (item.icon) {
517
- return items.find(i => i.icon && i.icon === i.icon) ?? null;
518
- }
519
- return null;
520
- }
521
- updateBreadcrumbItem(item) {
522
- const items = [...this.breadcrumbs()];
523
- let posIdx = -1;
524
- if (item.id) {
525
- posIdx = items.findIndex(i => i.id && i.id === item.id);
526
- }
527
- else if (item.routerLink) {
528
- const routerLinkStr = Array.isArray(item.routerLink) ? item.routerLink.join('/') : item.routerLink;
529
- posIdx = items.findIndex(i => i.routerLink && (Array.isArray(i.routerLink) ? i.routerLink.join('/') : i.routerLink) === routerLinkStr);
530
- }
531
- else if (item.positionIndex) {
532
- posIdx = items.findIndex(i => i.positionIndex && i.positionIndex === i.positionIndex);
533
- }
534
- else if (item.label) {
535
- posIdx = items.findIndex(i => i.label && i.label === i.label);
536
- }
537
- else if (item.icon) {
538
- posIdx = items.findIndex(i => i.icon && i.icon === i.icon);
539
- }
540
- if (posIdx < 0) {
541
- return false;
542
- }
543
- items[posIdx] = {
544
- ...items[posIdx],
545
- ...item,
546
- updated: true
547
- };
548
- this.breadcrumbs.set(items);
549
- return true;
550
- }
551
- updateBreadcrumbs() {
552
- if (this.breadcrumbsTranslateSubscription) {
553
- this.breadcrumbsTranslateSubscription.unsubscribe();
554
- this.breadcrumbsTranslateSubscription = undefined;
555
- }
556
- if (this.breadcrumbHomeTranslateSubscription) {
557
- this.breadcrumbHomeTranslateSubscription.unsubscribe();
558
- this.breadcrumbHomeTranslateSubscription = undefined;
559
- }
560
- const rootRoute = this.router.routerState.snapshot.root;
561
- const homeBreadcrumb = this.generateHomeBreadcrumb(rootRoute);
562
- if (homeBreadcrumb) {
563
- if (homeBreadcrumb.label) {
564
- this.breadcrumbHomeTranslateSubscription = this.translate
565
- .get(homeBreadcrumb.label)
566
- .pipe(takeUntilDestroyed(this.destroyRef))
567
- .subscribe(i18n => {
568
- homeBreadcrumb.label = i18n;
569
- this.breadcrumbHome.set(homeBreadcrumb);
570
- });
571
- }
572
- else {
573
- this.breadcrumbHome.set(homeBreadcrumb);
574
- }
575
- }
576
- const breadcrumbs = [];
577
- this.generateBreadcrumbs(rootRoute, [], breadcrumbs);
578
- breadcrumbs.forEach((b, idx) => {
579
- b.positionIndex = idx;
580
- });
581
- const i18nKeys = breadcrumbs.filter(b => typeof b.label === 'string').map(b => b.label);
582
- if (i18nKeys.length > 0) {
583
- this.breadcrumbsTranslateSubscription = this.translate
584
- .get(i18nKeys)
585
- .pipe(takeUntilDestroyed(this.destroyRef))
586
- .subscribe(i18n => {
587
- // Construct the breadcrumb hierarchy
588
- breadcrumbs.forEach(b => {
589
- if (b.label && i18n[b.label]) {
590
- b.label = i18n[b.label];
591
- }
592
- });
593
- // Emit the new breadcrumbs
594
- this.breadcrumbs.set(breadcrumbs);
595
- });
596
- }
597
- else {
598
- this.breadcrumbs.set(breadcrumbs);
599
- }
600
- }
601
- generateHomeBreadcrumb(route) {
602
- if (!route) {
603
- return null;
604
- }
605
- const routeData = route.data;
606
- const breadcrumbRouteData = routeData?.breadcrumb;
607
- if (breadcrumbRouteData && typeof breadcrumbRouteData === 'object' && 'isHome' in breadcrumbRouteData) {
608
- if (breadcrumbRouteData.isHome === false) {
609
- return null;
610
- }
611
- const breadcrumb = this.createBreadcrumb('/', breadcrumbRouteData, true);
612
- if (breadcrumb) {
613
- if (typeof breadcrumb.icon === 'undefined') {
614
- breadcrumb.icon = 'pi pi-home';
615
- }
616
- return breadcrumb;
617
- }
618
- }
619
- else {
620
- return this.generateHomeBreadcrumb(route.firstChild);
621
- }
622
- return null;
623
- }
624
- generateBreadcrumbs(route, parentUrlSegments, breadcrumbs) {
625
- if (!route) {
626
- return;
627
- }
628
- const routeData = route.data;
629
- const routeUrlSegments = parentUrlSegments.concat(route.url.map(url => url.path));
630
- const routeUrl = `/${routeUrlSegments.join('/')}`;
631
- if (routeData?.breadcrumb) {
632
- const breadcrumbRouteData = routeData.breadcrumb;
633
- if (Array.isArray(breadcrumbRouteData)) {
634
- for (const breadcrumbRouteDataItem of breadcrumbRouteData) {
635
- const breadcrumb = this.createBreadcrumb(routeUrl, breadcrumbRouteDataItem);
636
- if (breadcrumb) {
637
- breadcrumbs.push(breadcrumb);
638
- }
639
- }
640
- }
641
- else if (typeof breadcrumbRouteData === 'function') {
642
- breadcrumbs.push(...breadcrumbRouteData(routeUrl, route));
643
- }
644
- else {
645
- const breadcrumb = this.createBreadcrumb(routeUrl, breadcrumbRouteData);
646
- if (breadcrumb) {
647
- breadcrumbs.push(breadcrumb);
648
- }
649
- }
650
- }
651
- this.generateBreadcrumbs(route.firstChild, routeUrlSegments, breadcrumbs);
652
- }
653
- createBreadcrumb(routeUrl, routeBreadcrumb, includeHome = false) {
654
- const existingBreadcrumb = this.findBreadcrumbItem({ routerLink: routeUrl });
655
- if (existingBreadcrumb?.updated) {
656
- return existingBreadcrumb;
657
- }
658
- if (typeof routeBreadcrumb === 'string') {
659
- // check for updated existing breadcrumb
660
- return {
661
- id: routeUrl,
662
- label: routeBreadcrumb,
663
- routerLink: routeUrl
664
- };
665
- }
666
- else {
667
- if (!includeHome && typeof routeBreadcrumb.isHome !== 'undefined') {
668
- // home should not be included
669
- return null;
670
- }
671
- if (typeof routeBreadcrumb.routerLink === 'undefined') {
672
- routeBreadcrumb.routerLink = routeUrl;
673
- }
674
- routeBreadcrumb.id = routeUrl;
675
- return routeBreadcrumb;
676
- }
677
- }
678
- // TITLE section
679
- setPageTitle(title) {
680
- let currentRoute = this.router.routerState.snapshot.root;
681
- while (currentRoute.firstChild) {
682
- currentRoute = currentRoute.firstChild;
683
- }
684
- const routeData = currentRoute.data;
685
- const pageTitle = title ?? routeData.pageTitle;
686
- this.titleService.setTitle(this.formatPageTitle(pageTitle));
687
- }
688
- formatPageTitle(titlePrefix) {
689
- const titlePieces = [];
690
- if (titlePrefix) {
691
- titlePieces.push(this.translate.instant(titlePrefix));
692
- }
693
- titlePieces.push(this.translate.instant('app.name'));
694
- return titlePieces.join(' - ');
695
- }
696
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: CommonsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
697
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: CommonsService }); }
698
- }
699
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: CommonsService, decorators: [{
700
- type: Injectable
701
- }], ctorParameters: () => [] });
702
-
703
- /**
704
- * @deprecated Use ErrorPageComponent from layout instead.
705
- */
706
- class ErrorPageComponent {
707
- constructor(commons) {
708
- this.commons = commons;
709
- }
710
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: ErrorPageComponent, deps: [{ token: CommonsService }], target: i0.ɵɵFactoryTarget.Component }); }
711
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.12", type: ErrorPageComponent, isStandalone: true, selector: "mng-error-page-deprecated", 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", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }, { 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 }); }
712
- }
713
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: ErrorPageComponent, decorators: [{
714
- type: Component,
715
- args: [{ standalone: true, selector: 'mng-error-page-deprecated', 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"] }]
716
- }], ctorParameters: () => [{ type: CommonsService }] });
717
-
718
- /**
719
- * @deprecated Use ErrorPageComponent from layout instead.
720
- */
721
- class NotFoundPageComponent {
722
- constructor(commons) {
723
- this.commons = commons;
724
- }
725
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: NotFoundPageComponent, deps: [{ token: CommonsService }], target: i0.ɵɵFactoryTarget.Component }); }
726
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.12", type: NotFoundPageComponent, isStandalone: true, selector: "mng-not-found-page-deprecated", 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", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }, { 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 }); }
727
- }
728
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: NotFoundPageComponent, decorators: [{
729
- type: Component,
730
- args: [{ standalone: true, selector: 'mng-not-found-page-deprecated', 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"] }]
731
- }], ctorParameters: () => [{ type: CommonsService }] });
732
-
733
- class FilterMatchMode {
734
- static { this.Equals = 'equals'; }
735
- static { this.EqualsAbbr = 'eq'; }
736
- static { this.NotEquals = 'notEquals'; }
737
- static { this.NotEqualsAbbr = 'ne'; }
738
- static { this.Contains = 'contains'; }
739
- static { this.ContainsAbbr = 'cn'; }
740
- static { this.NotContains = 'notContains'; }
741
- static { this.NotContainsAbbr = 'nc'; }
742
- static { this.In = 'in'; }
743
- static { this.InAbbr = 'in'; }
744
- static { this.NotIn = 'notIn'; }
745
- static { this.NotInAbbr = 'ni'; }
746
- static { this.StartsWith = 'startsWith'; }
747
- static { this.StartsWithAbbr = 'sw'; }
748
- static { this.EndsWith = 'endsWith'; }
749
- static { this.EndsWithAbbr = 'ew'; }
750
- static { this.LessThan = 'lessThan'; }
751
- static { this.LessThanAbbr = 'lt'; }
752
- static { this.LessThanOrEqualTo = 'lessThanOrEqualTo'; }
753
- static { this.LessThanOrEqualToAbbr = 'le'; }
754
- static { this.GreaterThan = 'greaterThan'; }
755
- static { this.GreaterThanAbbr = 'gt'; }
756
- static { this.GreaterThanOrEqualTo = 'greaterThanOrEqualTo'; }
757
- static { this.GreaterThanOrEqualToAbbr = 'ge'; }
758
- static { this.Between = 'between'; }
759
- static { this.BetweenAbbr = 'bt'; }
760
- static { this.Exists = 'exists'; }
761
- static { this.ExistsAbbr = 'ex'; }
762
- static { this.DoesNotExist = 'doesNotExist'; }
763
- static { this.DoesNotExistAbbr = 'nx'; }
764
- static getAbbreviation(mode) {
765
- switch (mode) {
766
- case FilterMatchMode.Equals:
767
- return FilterMatchMode.EqualsAbbr;
768
- case FilterMatchMode.NotEquals:
769
- return FilterMatchMode.NotEqualsAbbr;
770
- case FilterMatchMode.Contains:
771
- return FilterMatchMode.ContainsAbbr;
772
- case FilterMatchMode.NotContains:
773
- return FilterMatchMode.NotContainsAbbr;
774
- case FilterMatchMode.In:
775
- return FilterMatchMode.InAbbr;
776
- case FilterMatchMode.NotIn:
777
- return FilterMatchMode.NotInAbbr;
778
- case FilterMatchMode.StartsWith:
779
- return FilterMatchMode.StartsWithAbbr;
780
- case FilterMatchMode.EndsWith:
781
- return FilterMatchMode.EndsWithAbbr;
782
- case FilterMatchMode.LessThan:
783
- return FilterMatchMode.LessThanAbbr;
784
- case FilterMatchMode.LessThanOrEqualTo:
785
- return FilterMatchMode.LessThanOrEqualToAbbr;
786
- case FilterMatchMode.GreaterThan:
787
- return FilterMatchMode.GreaterThanAbbr;
788
- case FilterMatchMode.GreaterThanOrEqualTo:
789
- return FilterMatchMode.GreaterThanOrEqualToAbbr;
790
- case FilterMatchMode.Between:
791
- return FilterMatchMode.BetweenAbbr;
792
- case FilterMatchMode.Exists:
793
- return FilterMatchMode.ExistsAbbr;
794
- case FilterMatchMode.DoesNotExist:
795
- return FilterMatchMode.DoesNotExistAbbr;
796
- default:
797
- return null;
798
- }
799
- }
800
- static fromAbbreviation(abbr) {
801
- switch (abbr) {
802
- case FilterMatchMode.EqualsAbbr:
803
- return FilterMatchMode.Equals;
804
- case FilterMatchMode.NotEqualsAbbr:
805
- return FilterMatchMode.NotEquals;
806
- case FilterMatchMode.ContainsAbbr:
807
- return FilterMatchMode.Contains;
808
- case FilterMatchMode.NotContainsAbbr:
809
- return FilterMatchMode.NotContains;
810
- case FilterMatchMode.InAbbr:
811
- return FilterMatchMode.In;
812
- case FilterMatchMode.NotInAbbr:
813
- return FilterMatchMode.NotIn;
814
- case FilterMatchMode.StartsWithAbbr:
815
- return FilterMatchMode.StartsWith;
816
- case FilterMatchMode.EndsWithAbbr:
817
- return FilterMatchMode.EndsWith;
818
- case FilterMatchMode.LessThanAbbr:
819
- return FilterMatchMode.LessThan;
820
- case FilterMatchMode.LessThanOrEqualToAbbr:
821
- return FilterMatchMode.LessThanOrEqualTo;
822
- case FilterMatchMode.GreaterThanAbbr:
823
- return FilterMatchMode.GreaterThan;
824
- case FilterMatchMode.GreaterThanOrEqualToAbbr:
825
- return FilterMatchMode.GreaterThanOrEqualTo;
826
- case FilterMatchMode.BetweenAbbr:
827
- return FilterMatchMode.Between;
828
- case FilterMatchMode.ExistsAbbr:
829
- return FilterMatchMode.Exists;
830
- case FilterMatchMode.DoesNotExistAbbr:
831
- return FilterMatchMode.DoesNotExist;
832
- default:
833
- return null;
834
- }
835
- }
836
- }
837
-
838
- /**
839
- * Converts a TableLazyLoadEvent to DataListParams.
840
- *
841
- * @param {TableLazyLoadEvent} event - The event containing the data to convert.
842
- * @return {DataListParams} - The converted DataListParams object.
843
- */
844
- function fromTableLoadToDataListParams(event) {
845
- const params = {};
846
- if (event.first != null) {
847
- params.offset = event.first;
848
- }
849
- if (event.rows != null) {
850
- params.limit = event.rows;
851
- }
852
- if (typeof event.globalFilter === 'string') {
853
- params.search = event.globalFilter;
854
- }
855
- else if (Array.isArray(event.globalFilter) && event.globalFilter.length > 0) {
856
- params.search = event.globalFilter[0];
857
- }
858
- if (Array.isArray(event.multiSortMeta) && event.multiSortMeta.length > 0) {
859
- params.sort = event.multiSortMeta.map(m => ({ property: m.field, ascending: m.order >= 0 }));
860
- }
861
- if (event.filters) {
862
- params.filters = Object.keys(event.filters).reduce((acc, key) => {
863
- const filter = {};
864
- const eventFilter = event.filters?.[key];
865
- if (Array.isArray(eventFilter)) {
866
- filter.value = eventFilter[0].value;
867
- filter.matchMode = eventFilter[0].matchMode;
868
- filter.caseSensitive = eventFilter[0].caseSensitive;
869
- }
870
- else if (eventFilter !== undefined) {
871
- filter.value = eventFilter.value;
872
- filter.matchMode = eventFilter.matchMode;
873
- filter.caseSensitive = eventFilter.caseSensitive;
874
- }
875
- // handle search case sensitivity to be also written on searchCaseSensitive
876
- if (key === 'global' && typeof params.search === 'string' && filter.caseSensitive !== undefined) {
877
- params.searchCaseSensitive = filter.caseSensitive;
878
- return acc;
879
- }
880
- return { ...acc, [key]: filter };
881
- }, {});
342
+ if (event.filters) {
343
+ params.filters = Object.keys(event.filters).reduce((acc, key) => {
344
+ const filter = {};
345
+ const eventFilter = event.filters?.[key];
346
+ if (Array.isArray(eventFilter)) {
347
+ filter.value = eventFilter[0].value;
348
+ filter.matchMode = eventFilter[0].matchMode;
349
+ filter.caseSensitive = eventFilter[0].caseSensitive;
350
+ }
351
+ else if (eventFilter !== undefined) {
352
+ filter.value = eventFilter.value;
353
+ filter.matchMode = eventFilter.matchMode;
354
+ filter.caseSensitive = eventFilter.caseSensitive;
355
+ }
356
+ // handle search case sensitivity to be also written on searchCaseSensitive
357
+ if (key === 'global' && typeof params.search === 'string' && filter.caseSensitive !== undefined) {
358
+ params.searchCaseSensitive = filter.caseSensitive;
359
+ return acc;
360
+ }
361
+ return { ...acc, [key]: filter };
362
+ }, {});
882
363
  }
883
364
  return params;
884
365
  }
@@ -1302,12 +783,10 @@ function dataListParamsFilterValueToUrlString(value, allowNull = false) {
1302
783
  *
1303
784
  * @tparam Model - The type of data this data provider will handle.
1304
785
  * @tparam Service - The type of service used by this data provider (optional).
1305
- * @tparam ModelClass - The model type for the data provider (optional).
1306
786
  * @tparam ServiceClass - The service type for the data provider (optional).
1307
787
  */
1308
788
  class DataProviderInst {
1309
- constructor(classType, serviceType) {
1310
- this.classType = classType;
789
+ constructor(serviceType) {
1311
790
  this.serviceType = serviceType;
1312
791
  }
1313
792
  get isDataProvider() {
@@ -1315,33 +794,6 @@ class DataProviderInst {
1315
794
  }
1316
795
  }
1317
796
 
1318
- class DataProvider extends DataProviderInst {
1319
- constructor() {
1320
- super(undefined, undefined);
1321
- }
1322
- static create() {
1323
- return dataProviderBase();
1324
- }
1325
- static fromClass(type) {
1326
- return dataProviderFromClass(type);
1327
- }
1328
- static fromClassWithService(type, serviceType) {
1329
- return dataProviderFromClass(type, serviceType);
1330
- }
1331
- static fromService(serviceType) {
1332
- return dataProviderWithService(serviceType);
1333
- }
1334
- }
1335
- function dataProviderBase() {
1336
- return new DataProviderInst(undefined, undefined);
1337
- }
1338
- function dataProviderWithService(serviceType) {
1339
- return new DataProviderInst(undefined, serviceType);
1340
- }
1341
- function dataProviderFromClass(type, serviceType) {
1342
- return new DataProviderInst(type, serviceType);
1343
- }
1344
-
1345
797
  class ComponentDirective {
1346
798
  constructor() {
1347
799
  this.injector = inject(Injector);
@@ -1535,22 +987,159 @@ function getEnumConstantName(enumType, value) {
1535
987
  if (typeof value === 'string') {
1536
988
  return getEnumConstantNames(enumType).find(c => enumType[c] === value) ?? null;
1537
989
  }
1538
- else {
1539
- return typeof enumType[value] !== 'undefined' ? enumType[value] : null;
990
+ else {
991
+ return typeof enumType[value] !== 'undefined' ? enumType[value] : null;
992
+ }
993
+ }
994
+ /**
995
+ * Gets constant name for value.
996
+ * @param enumObj Enum object.
997
+ * @param value Value of enum constant.
998
+ */
999
+ function getEnumConstantNameFromObject(enumObj, value) {
1000
+ const enumObjAny = enumObj;
1001
+ if (typeof value === 'string') {
1002
+ return getEnumConstantNamesFromObject(enumObj).find(c => enumObjAny[c] === value) ?? null;
1003
+ }
1004
+ else {
1005
+ return typeof enumObjAny[value] !== 'undefined' ? enumObjAny[value] : null;
1006
+ }
1007
+ }
1008
+
1009
+ var LogLevelEnum;
1010
+ (function (LogLevelEnum) {
1011
+ LogLevelEnum[LogLevelEnum["Trace"] = 0] = "Trace";
1012
+ LogLevelEnum[LogLevelEnum["Debug"] = 1] = "Debug";
1013
+ LogLevelEnum[LogLevelEnum["Log"] = 2] = "Log";
1014
+ LogLevelEnum[LogLevelEnum["Info"] = 3] = "Info";
1015
+ LogLevelEnum[LogLevelEnum["Warning"] = 4] = "Warning";
1016
+ LogLevelEnum[LogLevelEnum["Error"] = 5] = "Error";
1017
+ })(LogLevelEnum || (LogLevelEnum = {}));
1018
+
1019
+ class LoggerService {
1020
+ static { this._instance = new LoggerService(); }
1021
+ static { this._isInit = false; }
1022
+ static { this._publishers = []; }
1023
+ static { this._entriesBuffer = []; }
1024
+ static { this._categoryInstances = {}; }
1025
+ static { this._timestampFormat = 'yyyy-MM-dd HH:mm:ss.SSS'; }
1026
+ constructor() {
1027
+ // Temporary settings that cover logging calls before initialisation
1028
+ this.defaultLogLevel = LogLevelEnum.Info;
1029
+ this.datePipe = new DatePipe('en-US');
1030
+ // empty
1031
+ }
1032
+ static get() {
1033
+ return LoggerService._instance;
1034
+ }
1035
+ static configure(config) {
1036
+ if (config.timestampFormat) {
1037
+ LoggerService._timestampFormat = config.timestampFormat;
1038
+ }
1039
+ }
1040
+ static init(configurationService, publishers) {
1041
+ if (LoggerService._isInit) {
1042
+ return;
1043
+ }
1044
+ LoggerService._configurationService = configurationService;
1045
+ LoggerService._publishers = publishers;
1046
+ LoggerService._isInit = true;
1047
+ LoggerService._flushBuffer();
1048
+ }
1049
+ static _flushBuffer() {
1050
+ if (!LoggerService._isInit) {
1051
+ return;
1052
+ }
1053
+ LoggerService._entriesBuffer.forEach(e => this._instance._log(e));
1054
+ LoggerService._entriesBuffer = [];
1055
+ }
1056
+ static create(category) {
1057
+ return LoggerService._instance.create(category);
1058
+ }
1059
+ create(category) {
1060
+ if (this.category) {
1061
+ throw new CommonsInternalError(`Cannot create logger with category inside another category (${this.category}). Must create logger on root.`);
1062
+ }
1063
+ if (LoggerService._categoryInstances[category]) {
1064
+ return LoggerService._categoryInstances[category];
1065
+ }
1066
+ const logger = new LoggerService();
1067
+ logger.category = category;
1068
+ LoggerService._categoryInstances[category] = logger;
1069
+ return logger;
1070
+ }
1071
+ _processLog(msgOrError, logLevel, category = undefined, data) {
1072
+ const [timestamp, timestampFormatted] = [...this._getTimestamps()];
1073
+ const logEntry = {
1074
+ level: logLevel,
1075
+ message: typeof msgOrError === 'string' ? msgOrError : msgOrError.message,
1076
+ data: data,
1077
+ category: this.category ?? category,
1078
+ timestamp: timestamp,
1079
+ timestampFormatted: timestampFormatted ?? undefined
1080
+ };
1081
+ if (msgOrError instanceof Error) {
1082
+ // set error from message param
1083
+ logEntry.error = msgOrError;
1084
+ }
1085
+ else if (data?.length && data[0] instanceof Error) {
1086
+ // if first data is error, also consider as error
1087
+ logEntry.error = data[0];
1088
+ logEntry.data = data.splice(1);
1089
+ }
1090
+ this._log(logEntry);
1091
+ }
1092
+ _getTimestamps() {
1093
+ const timestamp = new Date();
1094
+ const timestampFormatted = this.datePipe.transform(timestamp, LoggerService._timestampFormat) ?? dateToIsoString(timestamp);
1095
+ return [timestamp, timestampFormatted];
1096
+ }
1097
+ _log(log) {
1098
+ if (!LoggerService._isInit) {
1099
+ // add to buffer
1100
+ LoggerService._entriesBuffer.push(log);
1101
+ return;
1102
+ }
1103
+ const logConfig = (LoggerService._configurationService?.getConfigValue)?.('log');
1104
+ if ((this.category && log.level < (logConfig?.category?.[this.category]?.level ?? logConfig?.level ?? this.defaultLogLevel)) ||
1105
+ (!this.category && log.level < (logConfig?.level ?? this.defaultLogLevel))) {
1106
+ return;
1107
+ }
1108
+ if (logConfig?.timestampFormat) {
1109
+ log.timestampFormatted = this.datePipe.transform(log.timestamp, logConfig.timestampFormat) ?? undefined;
1110
+ }
1111
+ LoggerService._publishers.forEach(p => p.addEntry(log));
1112
+ }
1113
+ trace(msgOrError, ...data) {
1114
+ this._processLog(msgOrError, LogLevelEnum.Trace, undefined, data);
1540
1115
  }
1541
- }
1542
- /**
1543
- * Gets constant name for value.
1544
- * @param enumObj Enum object.
1545
- * @param value Value of enum constant.
1546
- */
1547
- function getEnumConstantNameFromObject(enumObj, value) {
1548
- const enumObjAny = enumObj;
1549
- if (typeof value === 'string') {
1550
- return getEnumConstantNamesFromObject(enumObj).find(c => enumObjAny[c] === value) ?? null;
1116
+ debug(msgOrError, ...data) {
1117
+ this._processLog(msgOrError, LogLevelEnum.Debug, undefined, data);
1551
1118
  }
1552
- else {
1553
- return typeof enumObjAny[value] !== 'undefined' ? enumObjAny[value] : null;
1119
+ log(msgOrError, logLevel = LogLevelEnum.Log, category = undefined, ...data) {
1120
+ this._processLog(msgOrError, logLevel, category, data);
1121
+ }
1122
+ logEntry(logEntry) {
1123
+ const [timestamp, timestampFormatted] = [...this._getTimestamps()];
1124
+ const logEntryFinal = {
1125
+ timestamp: timestamp,
1126
+ timestampFormatted: timestampFormatted ?? undefined,
1127
+ category: this.category ?? logEntry.category,
1128
+ message: '',
1129
+ messageDetails: logEntry.messageDetails,
1130
+ level: LogLevelEnum.Log,
1131
+ ...logEntry
1132
+ };
1133
+ this._log(logEntryFinal);
1134
+ }
1135
+ info(msgOrError, ...data) {
1136
+ this._processLog(msgOrError, LogLevelEnum.Info, undefined, data);
1137
+ }
1138
+ warn(msgOrError, ...data) {
1139
+ this._processLog(msgOrError, LogLevelEnum.Warning, undefined, data);
1140
+ }
1141
+ error(msgOrError, ...data) {
1142
+ this._processLog(msgOrError, LogLevelEnum.Error, undefined, data);
1554
1143
  }
1555
1144
  }
1556
1145
 
@@ -2738,98 +2327,415 @@ class TypeRegistry {
2738
2327
  get typeMap() {
2739
2328
  return this._typeMap;
2740
2329
  }
2741
- get enumMap() {
2742
- return this._enumMap;
2330
+ get enumMap() {
2331
+ return this._enumMap;
2332
+ }
2333
+ /**
2334
+ * Only use one instance of object (out of Angular context)
2335
+ */
2336
+ static get() {
2337
+ return TypeRegistry._instance;
2338
+ }
2339
+ findAttributeDefinitionByClassType(type, attributeName) {
2340
+ const typeName = findReflectTypeName(type);
2341
+ return typeName ? this.findAttributeDefinition(typeName, attributeName) : null;
2342
+ }
2343
+ findAttributeDefinition(typeName, attributeName) {
2344
+ const attributeDefs = this.findAttributesDefinition(typeName);
2345
+ if (!attributeDefs) {
2346
+ return null;
2347
+ }
2348
+ for (const attribute of attributeDefs) {
2349
+ if (attribute.name === attributeName) {
2350
+ return attribute;
2351
+ }
2352
+ }
2353
+ return null;
2354
+ }
2355
+ findAttributesDefinitionByClassType(type) {
2356
+ const typeName = findReflectTypeName(type);
2357
+ return typeName ? this.findAttributesDefinition(typeName) : null;
2358
+ }
2359
+ findAttributesDefinition(typeName) {
2360
+ const typeDef = this.findType(typeName);
2361
+ if (!typeDef || typeof typeDef.getAttributeTypeMap !== 'function') {
2362
+ return null;
2363
+ }
2364
+ return typeDef.getAttributeTypeMap();
2365
+ }
2366
+ findByClassType(type) {
2367
+ const typeName = findReflectTypeName(type);
2368
+ return typeName ? this.findType(typeName) : null;
2369
+ }
2370
+ findType(typeName) {
2371
+ return this._typeMap[typeName];
2372
+ }
2373
+ findEnum(enumName) {
2374
+ return this._enumMap[enumName];
2375
+ }
2376
+ registerTypes(types) {
2377
+ for (const key in types) {
2378
+ this.registerType(types[key], key);
2379
+ }
2380
+ }
2381
+ registerType(type, optTypeName) {
2382
+ // try to find name from metadata
2383
+ let typeName;
2384
+ if (reflectTypeNameExists(type)) {
2385
+ // defined name from optional type name
2386
+ typeName = findReflectTypeName(type) ?? undefined;
2387
+ }
2388
+ else if (optTypeName) {
2389
+ typeName = optTypeName;
2390
+ // register metadata
2391
+ defineReflectTypeName(type, typeName);
2392
+ }
2393
+ if (!typeName) {
2394
+ // this._logger.debug(`WARNING: registering type ${type} failed, because typeName could not be determined and optional name was not provided.`);
2395
+ LoggerService.get().log(`WARNING: registering type ${type} failed, because typeName could not be determined and optional name was not provided.`, LogLevelEnum.Debug, this._logCategory);
2396
+ return;
2397
+ }
2398
+ if (typeof this._typeMap[typeName] !== 'undefined') {
2399
+ // this._logger.debug(`WARNING: registering type ${type} under key ${typeName} skipped, because type already exists for this key.`);
2400
+ LoggerService.get().log(`WARNING: registering type ${type} under key ${typeName} skipped, because type already exists for this key.`, LogLevelEnum.Debug, this._logCategory);
2401
+ }
2402
+ else {
2403
+ this._typeMap[typeName] = type;
2404
+ }
2405
+ }
2406
+ registerEnums(enums) {
2407
+ for (const key in enums) {
2408
+ this.registerEnum(enums[key], key);
2409
+ }
2410
+ }
2411
+ registerEnum(enumType, enumName) {
2412
+ // try to find name from decorator
2413
+ defineReflectEnumName(enumType, enumName);
2414
+ if (typeof this._enumMap[enumName] !== 'undefined') {
2415
+ LoggerService.get().log(`Registering enum ${enumName} skipped, because enum already exists.`, LogLevelEnum.Debug, this._logCategory);
2416
+ }
2417
+ else {
2418
+ this._enumMap[enumName] = enumType;
2419
+ }
2420
+ }
2421
+ }
2422
+
2423
+ const BROWSER_STORAGE_IT = new InjectionToken('BROWSER_STORAGE');
2424
+
2425
+ const COMMONS_MODULE_CONFIG_IT = new InjectionToken('COMMONS_MODULE_CONFIG');
2426
+
2427
+ class CommonsService {
2428
+ getDefaultLocale() {
2429
+ const browserLang = this.translate.getBrowserLang();
2430
+ if (browserLang && this.appLocales().some(l => l === browserLang)) {
2431
+ return browserLang;
2432
+ }
2433
+ return this.appLocales()?.length > 0 ? this.appLocales()[0] : 'en';
2434
+ }
2435
+ initAppLocale() {
2436
+ const lsLang = this.localStorage.getItem('lang');
2437
+ if (lsLang && this.appLocales().some(l => l === lsLang)) {
2438
+ return lsLang;
2439
+ }
2440
+ return this.getDefaultLocale();
2441
+ }
2442
+ setAppLocale(language) {
2443
+ if (this.appLocales().some(l => l === language)) {
2444
+ this.translate.use(language);
2445
+ this._appLocale.set(language);
2446
+ if (language !== this.getDefaultLocale())
2447
+ this.localStorage.setItem('lang', language);
2448
+ else
2449
+ this.localStorage.removeItem('lang');
2450
+ }
2451
+ }
2452
+ clearAppLocale() {
2453
+ this.localStorage.removeItem('lang');
2454
+ this._appLocale.set(this.getDefaultLocale());
2455
+ }
2456
+ initAppDataLocale() {
2457
+ const dataLang = this.localStorage.getItem('dataLang');
2458
+ if (dataLang && this.appDataLocales().some(dl => dl === dataLang)) {
2459
+ return dataLang;
2460
+ }
2461
+ return this.appDataLocales()?.length > 0 ? this.getDefaultLocale() : 'en';
2462
+ }
2463
+ setAppDataLocale(dataLocale) {
2464
+ if (this.appDataLocales().some(dl => dl === dataLocale)) {
2465
+ this._appDataLocale.set(dataLocale);
2466
+ if (dataLocale !== this.getDefaultLocale())
2467
+ this.localStorage.setItem('dataLang', dataLocale);
2468
+ else
2469
+ this.localStorage.removeItem('dataLang');
2470
+ }
2471
+ }
2472
+ clearAppDataLocale() {
2473
+ this.localStorage.removeItem('lang');
2474
+ this._appDataLocale.set(this.getDefaultLocale());
2475
+ }
2476
+ constructor() {
2477
+ // internal
2478
+ this.logger = inject(LoggerService).create('CommonsService');
2479
+ this.router = inject(Router);
2480
+ this.primengConfig = inject(PrimeNGConfig);
2481
+ this.translate = inject(TranslateService);
2482
+ this.titleService = inject(Title);
2483
+ this.moduleConfig = inject(COMMONS_MODULE_CONFIG_IT, { optional: true });
2484
+ this.localStorage = inject(BROWSER_STORAGE_IT);
2485
+ this.destroyRef = inject(DestroyRef);
2486
+ // breadcrumbs
2487
+ this.breadcrumbHome = signal({
2488
+ icon: 'pi pi-home',
2489
+ routerLink: '/'
2490
+ });
2491
+ this.breadcrumbs = signal([]);
2492
+ // user
2493
+ this.user = signal(undefined);
2494
+ this.userRoles = signal([]);
2495
+ // APP section
2496
+ this.appName = signal(this.moduleConfig?.app?.name ?? 'app.name');
2497
+ this.appOwner = signal(this.moduleConfig?.app?.owner ?? 'app.owner');
2498
+ this.appLocales = signal(this.moduleConfig?.app?.locales ?? ['en']);
2499
+ this._appLocale = signal(this.initAppLocale());
2500
+ this.appLocale = computed(() => this._appLocale());
2501
+ this.appDataLocales = signal(this.moduleConfig?.app?.dataLocales ?? ['en']);
2502
+ this._appDataLocale = signal(this.initAppDataLocale());
2503
+ this.appDataLocale = computed(() => this._appDataLocale());
2504
+ this.appVersion = signal(this.moduleConfig?.app?.version);
2505
+ // ripple
2506
+ this.primengConfig.ripple = true;
2507
+ effect(() => {
2508
+ const appLocales = this.appLocales();
2509
+ if (appLocales) {
2510
+ this.setAppLocale(this.initAppLocale());
2511
+ this.translate.langs = this.appLocales();
2512
+ }
2513
+ const appDataLocales = this.appDataLocales();
2514
+ if (appDataLocales)
2515
+ this.setAppDataLocale(this.initAppDataLocale());
2516
+ }, { allowSignalWrites: true });
2517
+ this.router.events
2518
+ .pipe(
2519
+ // Filter the NavigationEnd events as the breadcrumb is updated only when the route reaches its end
2520
+ filter(event => event instanceof NavigationEnd), takeUntilDestroyed())
2521
+ .subscribe(() => {
2522
+ this.updateBreadcrumbs();
2523
+ this.setPageTitle();
2524
+ });
2525
+ this.translate.onLangChange.pipe(takeUntilDestroyed()).subscribe(() => {
2526
+ this.updateBreadcrumbs();
2527
+ this.setPageTitle();
2528
+ });
2529
+ this.translate
2530
+ .stream('mngPrime')
2531
+ .pipe(takeUntilDestroyed())
2532
+ .subscribe(value => this.primengConfig.setTranslation(value));
2533
+ }
2534
+ initialize() {
2535
+ this.logger.debug('Initialize');
2743
2536
  }
2744
- /**
2745
- * Only use one instance of object (out of Angular context)
2746
- */
2747
- static get() {
2748
- return TypeRegistry._instance;
2537
+ // BREADCRUMB actions
2538
+ findBreadcrumbItem(item) {
2539
+ const items = this.breadcrumbs();
2540
+ if (item.id) {
2541
+ return items.find(i => i.id && i.id === item.id) ?? null;
2542
+ }
2543
+ else if (item.routerLink) {
2544
+ const routerLinkStr = Array.isArray(item.routerLink) ? item.routerLink.join('/') : item.routerLink;
2545
+ return items.find(i => i.routerLink && (Array.isArray(i.routerLink) ? i.routerLink.join('/') : i.routerLink) === routerLinkStr) ?? null;
2546
+ }
2547
+ else if (item.positionIndex) {
2548
+ return items.find(i => i.positionIndex && i.positionIndex === i.positionIndex) ?? null;
2549
+ }
2550
+ else if (item.label) {
2551
+ return items.find(i => i.label && i.label === i.label) ?? null;
2552
+ }
2553
+ else if (item.icon) {
2554
+ return items.find(i => i.icon && i.icon === i.icon) ?? null;
2555
+ }
2556
+ return null;
2749
2557
  }
2750
- findAttributeDefinitionByClassType(type, attributeName) {
2751
- const typeName = findReflectTypeName(type);
2752
- return typeName ? this.findAttributeDefinition(typeName, attributeName) : null;
2558
+ updateBreadcrumbItem(item) {
2559
+ const items = [...this.breadcrumbs()];
2560
+ let posIdx = -1;
2561
+ if (item.id) {
2562
+ posIdx = items.findIndex(i => i.id && i.id === item.id);
2563
+ }
2564
+ else if (item.routerLink) {
2565
+ const routerLinkStr = Array.isArray(item.routerLink) ? item.routerLink.join('/') : item.routerLink;
2566
+ posIdx = items.findIndex(i => i.routerLink && (Array.isArray(i.routerLink) ? i.routerLink.join('/') : i.routerLink) === routerLinkStr);
2567
+ }
2568
+ else if (item.positionIndex) {
2569
+ posIdx = items.findIndex(i => i.positionIndex && i.positionIndex === i.positionIndex);
2570
+ }
2571
+ else if (item.label) {
2572
+ posIdx = items.findIndex(i => i.label && i.label === i.label);
2573
+ }
2574
+ else if (item.icon) {
2575
+ posIdx = items.findIndex(i => i.icon && i.icon === i.icon);
2576
+ }
2577
+ if (posIdx < 0) {
2578
+ return false;
2579
+ }
2580
+ items[posIdx] = {
2581
+ ...items[posIdx],
2582
+ ...item,
2583
+ updated: true
2584
+ };
2585
+ this.breadcrumbs.set(items);
2586
+ return true;
2753
2587
  }
2754
- findAttributeDefinition(typeName, attributeName) {
2755
- const attributeDefs = this.findAttributesDefinition(typeName);
2756
- if (!attributeDefs) {
2757
- return null;
2588
+ updateBreadcrumbs() {
2589
+ if (this.breadcrumbsTranslateSubscription) {
2590
+ this.breadcrumbsTranslateSubscription.unsubscribe();
2591
+ this.breadcrumbsTranslateSubscription = undefined;
2758
2592
  }
2759
- for (const attribute of attributeDefs) {
2760
- if (attribute.name === attributeName) {
2761
- return attribute;
2593
+ if (this.breadcrumbHomeTranslateSubscription) {
2594
+ this.breadcrumbHomeTranslateSubscription.unsubscribe();
2595
+ this.breadcrumbHomeTranslateSubscription = undefined;
2596
+ }
2597
+ const rootRoute = this.router.routerState.snapshot.root;
2598
+ const homeBreadcrumb = this.generateHomeBreadcrumb(rootRoute);
2599
+ if (homeBreadcrumb) {
2600
+ if (homeBreadcrumb.label) {
2601
+ this.breadcrumbHomeTranslateSubscription = this.translate
2602
+ .get(homeBreadcrumb.label)
2603
+ .pipe(takeUntilDestroyed(this.destroyRef))
2604
+ .subscribe(i18n => {
2605
+ homeBreadcrumb.label = i18n;
2606
+ this.breadcrumbHome.set(homeBreadcrumb);
2607
+ });
2608
+ }
2609
+ else {
2610
+ this.breadcrumbHome.set(homeBreadcrumb);
2762
2611
  }
2763
2612
  }
2764
- return null;
2765
- }
2766
- findAttributesDefinitionByClassType(type) {
2767
- const typeName = findReflectTypeName(type);
2768
- return typeName ? this.findAttributesDefinition(typeName) : null;
2613
+ const breadcrumbs = [];
2614
+ this.generateBreadcrumbs(rootRoute, [], breadcrumbs);
2615
+ breadcrumbs.forEach((b, idx) => {
2616
+ b.positionIndex = idx;
2617
+ });
2618
+ const i18nKeys = breadcrumbs.filter(b => typeof b.label === 'string').map(b => b.label);
2619
+ if (i18nKeys.length > 0) {
2620
+ this.breadcrumbsTranslateSubscription = this.translate
2621
+ .get(i18nKeys)
2622
+ .pipe(takeUntilDestroyed(this.destroyRef))
2623
+ .subscribe(i18n => {
2624
+ // Construct the breadcrumb hierarchy
2625
+ breadcrumbs.forEach(b => {
2626
+ if (b.label && i18n[b.label]) {
2627
+ b.label = i18n[b.label];
2628
+ }
2629
+ });
2630
+ // Emit the new breadcrumbs
2631
+ this.breadcrumbs.set(breadcrumbs);
2632
+ });
2633
+ }
2634
+ else {
2635
+ this.breadcrumbs.set(breadcrumbs);
2636
+ }
2769
2637
  }
2770
- findAttributesDefinition(typeName) {
2771
- const typeDef = this.findType(typeName);
2772
- if (!typeDef || typeof typeDef.getAttributeTypeMap !== 'function') {
2638
+ generateHomeBreadcrumb(route) {
2639
+ if (!route) {
2773
2640
  return null;
2774
2641
  }
2775
- return typeDef.getAttributeTypeMap();
2776
- }
2777
- findByClassType(type) {
2778
- const typeName = findReflectTypeName(type);
2779
- return typeName ? this.findType(typeName) : null;
2780
- }
2781
- findType(typeName) {
2782
- return this._typeMap[typeName];
2783
- }
2784
- findEnum(enumName) {
2785
- return this._enumMap[enumName];
2786
- }
2787
- registerTypes(types) {
2788
- for (const key in types) {
2789
- this.registerType(types[key], key);
2642
+ const routeData = route.data;
2643
+ const breadcrumbRouteData = routeData?.breadcrumb;
2644
+ if (breadcrumbRouteData && typeof breadcrumbRouteData === 'object' && 'isHome' in breadcrumbRouteData) {
2645
+ if (breadcrumbRouteData.isHome === false) {
2646
+ return null;
2647
+ }
2648
+ const breadcrumb = this.createBreadcrumb('/', breadcrumbRouteData, true);
2649
+ if (breadcrumb) {
2650
+ if (typeof breadcrumb.icon === 'undefined') {
2651
+ breadcrumb.icon = 'pi pi-home';
2652
+ }
2653
+ return breadcrumb;
2654
+ }
2655
+ }
2656
+ else {
2657
+ return this.generateHomeBreadcrumb(route.firstChild);
2790
2658
  }
2659
+ return null;
2791
2660
  }
2792
- registerType(type, optTypeName) {
2793
- // try to find name from metadata
2794
- let typeName;
2795
- if (reflectTypeNameExists(type)) {
2796
- // defined name from optional type name
2797
- typeName = findReflectTypeName(type) ?? undefined;
2661
+ generateBreadcrumbs(route, parentUrlSegments, breadcrumbs) {
2662
+ if (!route) {
2663
+ return;
2798
2664
  }
2799
- else if (optTypeName) {
2800
- typeName = optTypeName;
2801
- // register metadata
2802
- defineReflectTypeName(type, typeName);
2665
+ const routeData = route.data;
2666
+ const routeUrlSegments = parentUrlSegments.concat(route.url.map(url => url.path));
2667
+ const routeUrl = `/${routeUrlSegments.join('/')}`;
2668
+ if (routeData?.breadcrumb) {
2669
+ const breadcrumbRouteData = routeData.breadcrumb;
2670
+ if (Array.isArray(breadcrumbRouteData)) {
2671
+ for (const breadcrumbRouteDataItem of breadcrumbRouteData) {
2672
+ const breadcrumb = this.createBreadcrumb(routeUrl, breadcrumbRouteDataItem);
2673
+ if (breadcrumb) {
2674
+ breadcrumbs.push(breadcrumb);
2675
+ }
2676
+ }
2677
+ }
2678
+ else if (typeof breadcrumbRouteData === 'function') {
2679
+ breadcrumbs.push(...breadcrumbRouteData(routeUrl, route));
2680
+ }
2681
+ else {
2682
+ const breadcrumb = this.createBreadcrumb(routeUrl, breadcrumbRouteData);
2683
+ if (breadcrumb) {
2684
+ breadcrumbs.push(breadcrumb);
2685
+ }
2686
+ }
2803
2687
  }
2804
- if (!typeName) {
2805
- // this._logger.debug(`WARNING: registering type ${type} failed, because typeName could not be determined and optional name was not provided.`);
2806
- LoggerService.get().log(`WARNING: registering type ${type} failed, because typeName could not be determined and optional name was not provided.`, LogLevelEnum.Debug, this._logCategory);
2807
- return;
2688
+ this.generateBreadcrumbs(route.firstChild, routeUrlSegments, breadcrumbs);
2689
+ }
2690
+ createBreadcrumb(routeUrl, routeBreadcrumb, includeHome = false) {
2691
+ const existingBreadcrumb = this.findBreadcrumbItem({ routerLink: routeUrl });
2692
+ if (existingBreadcrumb?.updated) {
2693
+ return existingBreadcrumb;
2808
2694
  }
2809
- if (typeof this._typeMap[typeName] !== 'undefined') {
2810
- // this._logger.debug(`WARNING: registering type ${type} under key ${typeName} skipped, because type already exists for this key.`);
2811
- LoggerService.get().log(`WARNING: registering type ${type} under key ${typeName} skipped, because type already exists for this key.`, LogLevelEnum.Debug, this._logCategory);
2695
+ if (typeof routeBreadcrumb === 'string') {
2696
+ // check for updated existing breadcrumb
2697
+ return {
2698
+ id: routeUrl,
2699
+ label: routeBreadcrumb,
2700
+ routerLink: routeUrl
2701
+ };
2812
2702
  }
2813
2703
  else {
2814
- this._typeMap[typeName] = type;
2704
+ if (!includeHome && typeof routeBreadcrumb.isHome !== 'undefined') {
2705
+ // home should not be included
2706
+ return null;
2707
+ }
2708
+ if (typeof routeBreadcrumb.routerLink === 'undefined') {
2709
+ routeBreadcrumb.routerLink = routeUrl;
2710
+ }
2711
+ routeBreadcrumb.id = routeUrl;
2712
+ return routeBreadcrumb;
2815
2713
  }
2816
2714
  }
2817
- registerEnums(enums) {
2818
- for (const key in enums) {
2819
- this.registerEnum(enums[key], key);
2715
+ // TITLE section
2716
+ setPageTitle(title) {
2717
+ let currentRoute = this.router.routerState.snapshot.root;
2718
+ while (currentRoute.firstChild) {
2719
+ currentRoute = currentRoute.firstChild;
2820
2720
  }
2721
+ const routeData = currentRoute.data;
2722
+ const pageTitle = title ?? routeData.pageTitle;
2723
+ this.titleService.setTitle(this.formatPageTitle(pageTitle));
2821
2724
  }
2822
- registerEnum(enumType, enumName) {
2823
- // try to find name from decorator
2824
- defineReflectEnumName(enumType, enumName);
2825
- if (typeof this._enumMap[enumName] !== 'undefined') {
2826
- LoggerService.get().log(`Registering enum ${enumName} skipped, because enum already exists.`, LogLevelEnum.Debug, this._logCategory);
2827
- }
2828
- else {
2829
- this._enumMap[enumName] = enumType;
2725
+ formatPageTitle(titlePrefix) {
2726
+ const titlePieces = [];
2727
+ if (titlePrefix) {
2728
+ titlePieces.push(this.translate.instant(titlePrefix));
2830
2729
  }
2730
+ titlePieces.push(this.translate.instant('app.name'));
2731
+ return titlePieces.join(' - ');
2831
2732
  }
2733
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: CommonsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2734
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: CommonsService }); }
2832
2735
  }
2736
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: CommonsService, decorators: [{
2737
+ type: Injectable
2738
+ }], ctorParameters: () => [] });
2833
2739
 
2834
2740
  var PermissionTypeEnum;
2835
2741
  (function (PermissionTypeEnum) {
@@ -4132,5 +4038,5 @@ function provideCommons(config, ...features) {
4132
4038
  * Generated bundle index. Do not edit.
4133
4039
  */
4134
4040
 
4135
- export { ACommonsErrorBase, APermissions, BROWSER_STORAGE_IT, BooleanPipe, COMMONS_INITIALIZER_IT, COMMONS_MODULE_CONFIG_IT, ClassMapPipe, CommonsConfigurationService, CommonsErrorHandler, CommonsFeatureTypeEnum, CommonsHttpError, CommonsInitEventEnum, CommonsInitService, CommonsInternalError, CommonsRouterService, CommonsService, CommonsStorageService, ComponentDirective, DataProvider, DataProviderInst, EnumName, EnumPipe, EnumerateAsyncPipe, EnumeratePipe, ErrorPageComponent, FilterMatchMode, GetterPipe, I18nPropertyPipe, JsonPathPipe, LOG_PUBLISHERS, LogLevelEnum, LogPublisherConsoleService, LoggerService, NotFoundPageComponent, NotificationWrapperComponent, ParametrizePipe, PermissionService, PermissionTypeEnum, Permissions, RerenderDirective, RouteBuilder, RoutesBuilder, StyleLevelEnum, StyleSizeEnum, Styles, TemplateDirective, TemplatePipe, TypeName, TypeRegistry, adjustRouteMenuLazyChildrenRouterLinks, angularDateFormatHasSeconds, angularDateFormatHasTime, appendRoutePathToBasePath, boolean$Attribute, booleanOrUndefinedAttribute, commonsActionErrorContextToString, commonsErrorToString, commonsInitializerProvider, copyDataListParams, createLazyChildrenRoute, createLazyRoute, createRoute, createRouteRedirect, createRoutes, dataListParamsFilterToUrlQuery, dataListParamsFilterValueToUrlString, dataListParamsFiltersToUrlQuery, dataListParamsSortToUrlQuery, dataListParamsToUrlQuery, dataProviderBase, dataProviderFromClass, dataProviderWithService, dateToIsoString, defineReflectEnumName, defineReflectTypeName, doesUrlMatchRouterLink, effectWithDeps, errorCauseToString, errorToString, escapeHtml, escapeHtmlAny, findReflectEnumName, findReflectTypeName, findTemplateByName, flattenObjectKeys, fromAngularDateFormatToPrime, fromAngularNumberFormatToFractions, fromEnumConstantsAsValueArray, fromEnumValuesAsValueArray, fromSubscribeError, fromTableLoadToDataListParams, fromUrlQueryToDataListParams, getEnumConstantName, getEnumConstantNameFromObject, getEnumConstantNames, getEnumConstantNamesFromObject, getEnumConstantValues, getEnumConstantValuesAsNumber, getEnumConstantValuesAsString, getEnumerationI18nBaseKey, getErrorLogLevel, getErrorName, getHttpErrorResponse, getHttpErrorResponseStatus, getHttpErrorResponseStatusText, getI18n, getI18nAsync, 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, throwError, toEnumerationI18nEnumerate, toObservable, toastMessage, valueToDefined };
4041
+ export { ACommonsErrorBase, APermissions, BROWSER_STORAGE_IT, BooleanPipe, COMMONS_INITIALIZER_IT, COMMONS_MODULE_CONFIG_IT, ClassMapPipe, CommonsConfigurationService, CommonsErrorHandler, CommonsFeatureTypeEnum, CommonsHttpError, CommonsInitEventEnum, CommonsInitService, CommonsInternalError, CommonsRouterService, CommonsService, CommonsStorageService, ComponentDirective, DataProviderInst, EnumName, EnumPipe, EnumerateAsyncPipe, EnumeratePipe, FilterMatchMode, GetterPipe, I18nPropertyPipe, JsonPathPipe, LOG_PUBLISHERS, LogLevelEnum, LogPublisherConsoleService, LoggerService, NotificationWrapperComponent, ParametrizePipe, PermissionService, PermissionTypeEnum, Permissions, RerenderDirective, RouteBuilder, RoutesBuilder, StyleLevelEnum, StyleSizeEnum, Styles, TemplateDirective, TemplatePipe, TypeName, TypeRegistry, adjustRouteMenuLazyChildrenRouterLinks, angularDateFormatHasSeconds, angularDateFormatHasTime, appendRoutePathToBasePath, boolean$Attribute, booleanOrUndefinedAttribute, commonsActionErrorContextToString, commonsErrorToString, commonsInitializerProvider, copyDataListParams, createLazyChildrenRoute, createLazyRoute, createRoute, createRouteRedirect, createRoutes, dataListParamsFilterToUrlQuery, dataListParamsFilterValueToUrlString, dataListParamsFiltersToUrlQuery, dataListParamsSortToUrlQuery, dataListParamsToUrlQuery, dateToIsoString, defineReflectEnumName, defineReflectTypeName, doesUrlMatchRouterLink, effectWithDeps, errorCauseToString, errorToString, escapeHtml, escapeHtmlAny, findReflectEnumName, findReflectTypeName, findTemplateByName, flattenObjectKeys, fromAngularDateFormatToPrime, fromAngularNumberFormatToFractions, fromEnumConstantsAsValueArray, fromEnumValuesAsValueArray, fromSubscribeError, fromTableLoadToDataListParams, fromUrlQueryToDataListParams, getEnumConstantName, getEnumConstantNameFromObject, getEnumConstantNames, getEnumConstantNamesFromObject, getEnumConstantValues, getEnumConstantValuesAsNumber, getEnumConstantValuesAsString, getEnumerationI18nBaseKey, getErrorLogLevel, getErrorName, getHttpErrorResponse, getHttpErrorResponseStatus, getHttpErrorResponseStatusText, getI18n, getI18nAsync, 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, throwError, toEnumerationI18nEnumerate, toObservable, toastMessage, valueToDefined };
4136
4042
  //# sourceMappingURL=mediusinc-mng-commons-core.mjs.map