@mediusinc/mng-commons 5.0.0-rc.0-c31d5206 → 5.0.0-rc.1

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 (1436) hide show
  1. package/README.md +1 -0
  2. package/core/README.md +8 -0
  3. package/core/action/action-data.model.d.ts +3 -0
  4. package/core/action/action-parameters.model.d.ts +17 -0
  5. package/core/components/pages/error/error.page.component.d.ts +8 -0
  6. package/core/components/pages/not-found/not-found.page.component.d.ts +8 -0
  7. package/core/data-list/data-list-params-helpers.d.ts +82 -0
  8. package/core/data-providers/base.data-provider.d.ts +32 -0
  9. package/core/data-providers/lookup.data-provider.d.ts +10 -0
  10. package/core/descriptors/action.descriptor.d.ts +12 -0
  11. package/core/descriptors/column.descriptor.d.ts +3 -0
  12. package/core/descriptors/editor.descriptor.d.ts +11 -0
  13. package/core/descriptors/enum.descriptor.d.ts +6 -0
  14. package/core/descriptors/filter.descriptor.d.ts +3 -0
  15. package/core/descriptors/lookup.descriptor.d.ts +12 -0
  16. package/core/descriptors/model.descriptor.d.ts +8 -0
  17. package/core/descriptors/table.descriptor.d.ts +9 -0
  18. package/core/descriptors/tableview.descriptor.d.ts +11 -0
  19. package/core/directives/component.directive.d.ts +20 -0
  20. package/core/directives/dialog-keydown-handler.directive.d.ts +12 -0
  21. package/core/directives/template.directive.d.ts +12 -0
  22. package/core/enum/enum-helpers.d.ts +49 -0
  23. package/core/enum/enum.model.d.ts +8 -0
  24. package/core/error/error-handler.d.ts +6 -0
  25. package/core/error/error-helpers.d.ts +114 -0
  26. package/core/error/error.model.d.ts +47 -0
  27. package/core/helpers/coercion.d.ts +9 -0
  28. package/core/helpers/date.d.ts +14 -0
  29. package/core/helpers/notification.d.ts +2 -0
  30. package/core/helpers/object.d.ts +27 -0
  31. package/core/helpers/route.d.ts +35 -0
  32. package/core/helpers/string.d.ts +7 -0
  33. package/core/helpers/templates.d.ts +3 -0
  34. package/core/helpers/type-helpers.d.ts +16 -0
  35. package/core/i18n/i18n-common.d.ts +6 -0
  36. package/core/i18n/i18n-error.d.ts +4 -0
  37. package/core/i18n/i18n-type.d.ts +20 -0
  38. package/core/index.d.ts +83 -0
  39. package/core/log/log-publisher-console.service.d.ts +4 -0
  40. package/core/log/log.model.d.ts +40 -0
  41. package/core/log/logger.service.d.ts +33 -0
  42. package/core/models/class-service.model.d.ts +7 -0
  43. package/core/models/getter.model.d.ts +2 -0
  44. package/core/models/i18n.model.d.ts +1 -0
  45. package/core/models/menu.model.d.ts +32 -0
  46. package/core/models/user.model.d.ts +8 -0
  47. package/core/pipes/boolean.pipe.d.ts +7 -0
  48. package/core/pipes/class-map.pipe.d.ts +7 -0
  49. package/core/pipes/enum.pipe.d.ts +8 -0
  50. package/core/pipes/enumerate-async.pipe.d.ts +9 -0
  51. package/core/pipes/enumerate.pipe.d.ts +16 -0
  52. package/core/pipes/getter.pipe.d.ts +8 -0
  53. package/core/pipes/i18n-property.pipe.d.ts +8 -0
  54. package/core/pipes/json-path.pipe.d.ts +13 -0
  55. package/core/pipes/parametrize.pipe.d.ts +12 -0
  56. package/core/pipes/template.pipe.d.ts +8 -0
  57. package/core/provide.d.ts +12 -0
  58. package/core/reflect/type-enum-metadata.d.ts +32 -0
  59. package/core/registry/registry.model.d.ts +8 -0
  60. package/core/registry/type-registry.d.ts +27 -0
  61. package/core/router/route-builder.d.ts +65 -0
  62. package/core/router/router.model.d.ts +13 -0
  63. package/core/router/routes-builder.d.ts +18 -0
  64. package/core/rxjs/map-data-list-result-operator.d.ts +9 -0
  65. package/core/security/permission-helpers.d.ts +3 -0
  66. package/core/security/permission.guard.d.ts +2 -0
  67. package/core/security/permission.service.d.ts +16 -0
  68. package/core/security/permissions.model.d.ts +55 -0
  69. package/core/services/commons-configuration.service.d.ts +69 -0
  70. package/core/services/commons-init.service.d.ts +30 -0
  71. package/core/services/commons-router.service.d.ts +37 -0
  72. package/core/services/commons.service.d.ts +66 -0
  73. package/core/services/local-storage-config.service.d.ts +11 -0
  74. package/core/services/providers/commons-init.provider.d.ts +4 -0
  75. package/core/services/tokens/browser-storage.token.d.ts +2 -0
  76. package/core/services/tokens/commons-init.token.d.ts +3 -0
  77. package/core/services/tokens/log-publisher.token.d.ts +3 -0
  78. package/core/services/tokens/module-config.token.d.ts +34 -0
  79. package/core/styles/style-constants.d.ts +10 -0
  80. package/core/styles/style.model.d.ts +17 -0
  81. package/dev-scripts/version-info.js +1 -1
  82. package/esm2022/core/action/action-data.model.mjs +2 -0
  83. package/esm2022/core/action/action-parameters.model.mjs +2 -0
  84. package/esm2022/core/components/notification/notification-wrapper.component.mjs +50 -0
  85. package/esm2022/core/components/pages/error/error.page.component.mjs +21 -0
  86. package/esm2022/core/components/pages/not-found/not-found.page.component.mjs +21 -0
  87. package/esm2022/core/data-list/data-list-params-helpers.mjs +415 -0
  88. package/esm2022/core/data-list/data-list.model.mjs +2 -0
  89. package/esm2022/core/data-list/filter-match.model.mjs +105 -0
  90. package/esm2022/core/data-providers/base.data-provider.mjs +48 -0
  91. package/esm2022/core/data-providers/lookup.data-provider.mjs +2 -0
  92. package/esm2022/core/descriptors/action.descriptor.mjs +2 -0
  93. package/esm2022/core/descriptors/column.descriptor.mjs +2 -0
  94. package/esm2022/core/descriptors/editor.descriptor.mjs +2 -0
  95. package/esm2022/core/descriptors/enum.descriptor.mjs +2 -0
  96. package/esm2022/core/descriptors/filter.descriptor.mjs +2 -0
  97. package/esm2022/core/descriptors/lookup.descriptor.mjs +2 -0
  98. package/esm2022/core/descriptors/model.descriptor.mjs +2 -0
  99. package/esm2022/core/descriptors/table.descriptor.mjs +2 -0
  100. package/esm2022/core/descriptors/tableview.descriptor.mjs +2 -0
  101. package/esm2022/core/directives/component.directive.mjs +72 -0
  102. package/esm2022/core/directives/dialog-keydown-handler.directive.mjs +49 -0
  103. package/esm2022/core/directives/template.directive.mjs +29 -0
  104. package/esm2022/core/enum/enum-helpers.mjs +81 -0
  105. package/esm2022/core/enum/enum.model.mjs +2 -0
  106. package/esm2022/core/error/error-handler.mjs +20 -0
  107. package/esm2022/core/error/error-helpers.mjs +247 -0
  108. package/esm2022/core/error/error.model.mjs +32 -0
  109. package/esm2022/core/helpers/coercion.mjs +52 -0
  110. package/esm2022/core/helpers/date.mjs +119 -0
  111. package/esm2022/core/helpers/notification.mjs +6 -0
  112. package/esm2022/core/helpers/object.mjs +145 -0
  113. package/esm2022/core/helpers/route.mjs +58 -0
  114. package/esm2022/core/helpers/string.mjs +57 -0
  115. package/esm2022/core/helpers/templates.mjs +4 -0
  116. package/esm2022/core/helpers/type-helpers.mjs +2 -0
  117. package/esm2022/core/i18n/i18n-common.mjs +24 -0
  118. package/esm2022/core/i18n/i18n-error.mjs +27 -0
  119. package/esm2022/core/i18n/i18n-type.mjs +79 -0
  120. package/esm2022/core/index.mjs +105 -0
  121. package/esm2022/core/log/log-publisher-console.service.mjs +40 -0
  122. package/esm2022/core/log/log.model.mjs +10 -0
  123. package/esm2022/core/log/logger.service.mjs +131 -0
  124. package/esm2022/core/mediusinc-mng-commons-core.mjs +5 -0
  125. package/esm2022/core/models/class-attribute.model.mjs +2 -0
  126. package/esm2022/core/models/class-service.model.mjs +2 -0
  127. package/esm2022/core/models/getter.model.mjs +2 -0
  128. package/esm2022/core/models/i18n.model.mjs +2 -0
  129. package/esm2022/core/models/menu.model.mjs +2 -0
  130. package/esm2022/core/models/user.model.mjs +2 -0
  131. package/esm2022/core/models/version.model.mjs +2 -0
  132. package/esm2022/core/pipes/boolean.pipe.mjs +28 -0
  133. package/esm2022/core/pipes/class-map.pipe.mjs +23 -0
  134. package/esm2022/core/pipes/enum.pipe.mjs +27 -0
  135. package/esm2022/core/pipes/enumerate-async.pipe.mjs +36 -0
  136. package/esm2022/core/pipes/enumerate.pipe.mjs +49 -0
  137. package/esm2022/core/pipes/getter.pipe.mjs +21 -0
  138. package/esm2022/core/pipes/i18n-property.pipe.mjs +19 -0
  139. package/esm2022/core/pipes/json-path.pipe.mjs +25 -0
  140. package/esm2022/core/pipes/parametrize.pipe.mjs +86 -0
  141. package/esm2022/core/pipes/template.pipe.mjs +25 -0
  142. package/esm2022/core/provide.mjs +78 -0
  143. package/esm2022/core/reflect/type-enum-decorator.mjs +12 -0
  144. package/esm2022/core/reflect/type-enum-metadata.mjs +62 -0
  145. package/esm2022/core/registry/registry.model.mjs +2 -0
  146. package/esm2022/core/registry/type-registry.mjs +106 -0
  147. package/esm2022/core/router/route-builder.mjs +320 -0
  148. package/esm2022/core/router/router.model.mjs +2 -0
  149. package/esm2022/core/router/routes-builder.mjs +54 -0
  150. package/esm2022/core/rxjs/map-data-list-result-operator.mjs +19 -0
  151. package/esm2022/core/security/permission-helpers.mjs +14 -0
  152. package/esm2022/core/security/permission.guard.mjs +15 -0
  153. package/esm2022/core/security/permission.service.mjs +49 -0
  154. package/esm2022/core/security/permissions.model.mjs +93 -0
  155. package/esm2022/core/services/commons-configuration.service.mjs +174 -0
  156. package/esm2022/core/services/commons-init.service.mjs +111 -0
  157. package/esm2022/core/services/commons-router.service.mjs +180 -0
  158. package/esm2022/core/services/commons.service.mjs +390 -0
  159. package/esm2022/core/services/local-storage-config.service.mjs +29 -0
  160. package/esm2022/core/services/providers/commons-init.provider.mjs +4 -0
  161. package/esm2022/core/services/tokens/browser-storage.token.mjs +3 -0
  162. package/esm2022/core/services/tokens/commons-init.token.mjs +3 -0
  163. package/esm2022/core/services/tokens/log-publisher.token.mjs +3 -0
  164. package/esm2022/core/services/tokens/module-config.token.mjs +3 -0
  165. package/esm2022/core/styles/style-constants.mjs +11 -0
  166. package/esm2022/core/styles/style.model.mjs +20 -0
  167. package/esm2022/filter/descriptors/filter-lookup.descriptor.mjs +185 -0
  168. package/esm2022/filter/descriptors/filter.descriptor.mjs +197 -0
  169. package/esm2022/filter/index.mjs +6 -0
  170. package/esm2022/filter/mediusinc-mng-commons-filter.mjs +5 -0
  171. package/esm2022/filter/models/filter.model.mjs +15 -0
  172. package/esm2022/form/api/data-providers/lookup.data-provider.mjs +45 -0
  173. package/esm2022/form/api/descriptors/action-button.descriptor.mjs +68 -0
  174. package/esm2022/form/api/descriptors/button-style.builder.mjs +174 -0
  175. package/esm2022/form/api/index.mjs +8 -0
  176. package/esm2022/form/api/mediusinc-mng-commons-form-api.mjs +5 -0
  177. package/esm2022/form/api/models/trim.model.mjs +2 -0
  178. package/esm2022/form/components/autocomplete/autocomplete.component.mjs +404 -0
  179. package/esm2022/form/components/date-range/date-range.component.mjs +110 -0
  180. package/esm2022/form/components/dropdown/dropdown.component.mjs +213 -0
  181. package/esm2022/form/directives/input-trim.directive.mjs +55 -0
  182. package/esm2022/form/index.mjs +7 -0
  183. package/esm2022/form/mediusinc-mng-commons-form.mjs +5 -0
  184. package/esm2022/index.mjs +2 -74
  185. package/esm2022/model/descriptors/enum.descriptor.mjs +31 -0
  186. package/esm2022/model/descriptors/model.descriptor.mjs +78 -0
  187. package/esm2022/model/descriptors/type.descriptor.mjs +21 -0
  188. package/esm2022/model/helpers/i18n.mjs +45 -0
  189. package/esm2022/model/helpers/model.mjs +71 -0
  190. package/esm2022/model/index.mjs +8 -0
  191. package/esm2022/model/mediusinc-mng-commons-model.mjs +5 -0
  192. package/esm2022/provide.mjs +6 -0
  193. package/esm2022/table/api/data-providers/table.data-provider.mjs +63 -0
  194. package/esm2022/table/api/descriptors/column.descriptor.mjs +359 -0
  195. package/esm2022/table/api/descriptors/sort.descriptor.mjs +45 -0
  196. package/esm2022/table/api/descriptors/table.descriptor.mjs +778 -0
  197. package/esm2022/table/api/helpers/class-attribute-converter.mjs +104 -0
  198. package/esm2022/table/api/index.mjs +16 -0
  199. package/esm2022/table/api/mediusinc-mng-commons-table-api.mjs +5 -0
  200. package/esm2022/table/api/models/class-table-attribute.model.mjs +2 -0
  201. package/esm2022/table/api/models/column-value.model.mjs +2 -0
  202. package/esm2022/table/api/models/column.model.mjs +21 -0
  203. package/esm2022/table/api/models/table-columns.model.mjs +2 -0
  204. package/esm2022/table/api/models/table-event.model.mjs +2 -0
  205. package/esm2022/table/api/models/table.model.mjs +22 -0
  206. package/esm2022/table/components/column-filter-full/column-filter-full.component.mjs +594 -0
  207. package/esm2022/table/components/column-value/column-value.component.mjs +86 -0
  208. package/esm2022/table/components/table/table.component.mjs +630 -0
  209. package/esm2022/table/helpers/notification.mjs +15 -0
  210. package/esm2022/table/helpers/table-layout-prefs.mjs +10 -0
  211. package/esm2022/table/index.mjs +13 -0
  212. package/esm2022/table/mediusinc-mng-commons-table.mjs +5 -0
  213. package/esm2022/table/models/column-preferences.model.mjs +2 -0
  214. package/esm2022/table/pipes/locale-default-row-class.pipe.mjs +27 -0
  215. package/esm2022/table/pipes/table-column-filter-class.pipe.mjs +25 -0
  216. package/esm2022/table/services/data-list.service.mjs +23 -0
  217. package/esm2022/tableview/action/components/action/action.component.mjs +323 -0
  218. package/esm2022/tableview/action/components/editor/action-editor.component.mjs +97 -0
  219. package/esm2022/tableview/action/components/editor/injector-context/action-editor-injector-context.component.mjs +398 -0
  220. package/esm2022/tableview/action/components/localization/data-language-dropdown.component.mjs +53 -0
  221. package/esm2022/tableview/action/components/route/action-route.component.mjs +152 -0
  222. package/esm2022/tableview/action/components/table/action-table.component.mjs +146 -0
  223. package/esm2022/tableview/action/guards/unsaved-changes.guard.mjs +4 -0
  224. package/esm2022/tableview/action/helpers/i18n.mjs +82 -0
  225. package/esm2022/tableview/action/helpers/notification.mjs +17 -0
  226. package/esm2022/tableview/action/helpers/styles.mjs +32 -0
  227. package/esm2022/tableview/action/models/action-editor-dialog-data.model.mjs +2 -0
  228. package/esm2022/tableview/action/models/can-component-deactivate.model.mjs +2 -0
  229. package/esm2022/tableview/action/models/execution/action-context.model.mjs +56 -0
  230. package/esm2022/tableview/action/models/execution/action-instance-state.model.mjs +32 -0
  231. package/esm2022/tableview/action/models/execution/action-instance.model.mjs +170 -0
  232. package/esm2022/tableview/action/services/action-error-mapper.service.mjs +20 -0
  233. package/esm2022/tableview/action/services/action-executor.service.mjs +767 -0
  234. package/esm2022/tableview/action/services/component-action-executor.service.mjs +19 -0
  235. package/esm2022/tableview/action/services/data-provider-executor.service.mjs +26 -0
  236. package/esm2022/tableview/action/services/navigation.service.mjs +52 -0
  237. package/esm2022/tableview/action/services/providers/provide-action-executor.mjs +9 -0
  238. package/esm2022/tableview/action/services/providers/provide-view-container.mjs +17 -0
  239. package/esm2022/tableview/action/services/root-action-executor.service.mjs +18 -0
  240. package/esm2022/tableview/action/services/tokens/action-editor.token.mjs +3 -0
  241. package/esm2022/tableview/action/services/view-container.service.mjs +56 -0
  242. package/esm2022/tableview/api/action/descriptors/action-confirmation.descriptor.mjs +76 -0
  243. package/esm2022/tableview/api/action/descriptors/action-editor.descriptor.mjs +264 -0
  244. package/esm2022/tableview/api/action/descriptors/action-link.descriptor.mjs +89 -0
  245. package/esm2022/tableview/api/action/descriptors/action.descriptor.mjs +385 -0
  246. package/esm2022/tableview/api/action/helpers/data-provider-executors.mjs +80 -0
  247. package/esm2022/tableview/api/action/models/action-component.model.mjs +2 -0
  248. package/esm2022/tableview/api/action/models/action-descriptor.types.mjs +2 -0
  249. package/esm2022/tableview/api/action/models/action-editor.model.mjs +2 -0
  250. package/esm2022/tableview/api/action/models/action-error.model.mjs +14 -0
  251. package/esm2022/tableview/api/action/models/action.type.mjs +26 -0
  252. package/esm2022/tableview/api/action/models/execution/action-context-validation.model.mjs +2 -0
  253. package/esm2022/tableview/api/action/models/execution/action-context.model.mjs +2 -0
  254. package/esm2022/tableview/api/action/models/execution/action-execution-error.model.mjs +2 -0
  255. package/esm2022/tableview/api/action/models/execution/action-instance-state.model.mjs +32 -0
  256. package/esm2022/tableview/api/action/models/execution/action-instance.model.mjs +2 -0
  257. package/esm2022/tableview/api/action/models/execution/view-container.model.mjs +2 -0
  258. package/esm2022/tableview/api/action/models/tableview-action-default-categories.model.mjs +11 -0
  259. package/esm2022/tableview/api/action/services/data-provider-executor.service.mjs +28 -0
  260. package/esm2022/tableview/api/action/services/tokens/data-language-dropdown.token.mjs +3 -0
  261. package/esm2022/tableview/api/editor/data-providers/editor.data-provider.mjs +104 -0
  262. package/esm2022/tableview/api/editor/descriptors/editor.descriptor.mjs +626 -0
  263. package/esm2022/tableview/api/editor/descriptors/field-action.descriptor.mjs +49 -0
  264. package/esm2022/tableview/api/editor/descriptors/field-base.descriptor.mjs +288 -0
  265. package/esm2022/tableview/api/editor/descriptors/field-group.descriptor.mjs +97 -0
  266. package/esm2022/tableview/api/editor/descriptors/field-lookup.descriptor.mjs +213 -0
  267. package/esm2022/tableview/api/editor/descriptors/field-many.descriptor.mjs +153 -0
  268. package/esm2022/tableview/api/editor/descriptors/field-validation.descriptor.mjs +25 -0
  269. package/esm2022/tableview/api/editor/descriptors/field.descriptor.mjs +343 -0
  270. package/esm2022/tableview/api/editor/helpers/class-attribute-converter.mjs +85 -0
  271. package/esm2022/tableview/api/editor/helpers/field-validators.mjs +33 -0
  272. package/esm2022/tableview/api/editor/models/class-tableview-attribute.model.mjs +2 -0
  273. package/esm2022/tableview/api/editor/models/editor-fields.model.mjs +2 -0
  274. package/esm2022/tableview/api/editor/models/editor.model.mjs +9 -0
  275. package/esm2022/tableview/api/editor/models/field-action-context.model.mjs +2 -0
  276. package/esm2022/tableview/api/editor/models/field.model.mjs +56 -0
  277. package/esm2022/tableview/api/editor/models/form-editor.event.mjs +27 -0
  278. package/esm2022/tableview/api/editor/models/form-editor.interface.mjs +2 -0
  279. package/esm2022/tableview/api/editor/models/formly-custom-field.model.mjs +69 -0
  280. package/esm2022/tableview/api/editor/models/formly-field.model.mjs +2 -0
  281. package/esm2022/tableview/api/editor/models/radio.model.mjs +2 -0
  282. package/esm2022/tableview/api/index.mjs +64 -0
  283. package/esm2022/tableview/api/mediusinc-mng-commons-tableview-api.mjs +5 -0
  284. package/esm2022/tableview/api/tableview/data-providers/tableview.data-provider.mjs +105 -0
  285. package/esm2022/tableview/api/tableview/descriptors/tableview.descriptor.mjs +672 -0
  286. package/esm2022/tableview/api/tableview/helpers/class-attribute-converter.mjs +34 -0
  287. package/esm2022/tableview/api/tableview/helpers/files-export.mjs +34 -0
  288. package/esm2022/tableview/api/tableview/helpers/tableview-create.mjs +24 -0
  289. package/esm2022/tableview/api/tableview/helpers/tableview-default-actions.mjs +240 -0
  290. package/esm2022/tableview/api/tableview/helpers/tableview-input-builder.mjs +162 -0
  291. package/esm2022/tableview/api/tableview/models/class-tableview-attribute.model.mjs +2 -0
  292. package/esm2022/tableview/api/tableview/models/tableview-input.model.mjs +2 -0
  293. package/esm2022/tableview/api/tableview/models/tableview-route.model.mjs +2 -0
  294. package/esm2022/tableview/editor/components/editor/form-editor.component.mjs +285 -0
  295. package/esm2022/tableview/editor/components/formly/fields/formly-field-action/formly-field-action.component.mjs +61 -0
  296. package/esm2022/tableview/editor/components/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component.mjs +54 -0
  297. package/esm2022/tableview/editor/components/formly/fields/formly-field-custom/formly-field-custom.component.mjs +39 -0
  298. package/esm2022/tableview/editor/components/formly/fields/formly-field-dropdown/formly-field-dropdown.component.mjs +49 -0
  299. package/esm2022/tableview/editor/components/formly/fields/formly-field-fieldset/formly-field-fieldset.component.mjs +27 -0
  300. package/esm2022/tableview/editor/components/formly/fields/formly-field-input/formly-field-input.component.mjs +220 -0
  301. package/esm2022/tableview/editor/components/formly/fields/formly-field-label/formly-field-label.component.mjs +24 -0
  302. package/esm2022/tableview/editor/components/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.mjs +215 -0
  303. package/esm2022/tableview/editor/components/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.mjs +217 -0
  304. package/esm2022/tableview/editor/components/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.mjs +196 -0
  305. package/esm2022/tableview/editor/components/formly/fields/formly-field-tabs/formly-field-tabs.component.mjs +18 -0
  306. package/esm2022/tableview/editor/components/formly/wrappers/formly-field-no-label-wrapper/formly-field-no-label-wrapper.component.mjs +33 -0
  307. package/esm2022/tableview/editor/components/formly/wrappers/formly-field-wrapper/formly-field-wrapper.component.mjs +30 -0
  308. package/esm2022/tableview/editor/helpers/editor-formly.mjs +335 -0
  309. package/esm2022/tableview/editor/helpers/formly-config.mjs +260 -0
  310. package/esm2022/tableview/editor/helpers/notification.mjs +11 -0
  311. package/esm2022/tableview/editor/models/formly-config.model.mjs +2 -0
  312. package/esm2022/tableview/editor/services/formly-config.provider.mjs +31 -0
  313. package/esm2022/tableview/index.mjs +62 -0
  314. package/esm2022/tableview/mediusinc-mng-commons-tableview.mjs +5 -0
  315. package/esm2022/tableview/provide.mjs +62 -0
  316. package/esm2022/tableview/tableview/components/route/tableview-route.component.mjs +15 -0
  317. package/esm2022/tableview/tableview/components/tableview/tableview.component.mjs +75 -0
  318. package/esm2022/tableview/tableview/router/tableview-route-builder.mjs +201 -0
  319. package/esm2022/tableview/tableview/services/tableview-feature-config.token.mjs +3 -0
  320. package/fesm2022/mediusinc-mng-commons-core.mjs +3882 -0
  321. package/fesm2022/mediusinc-mng-commons-core.mjs.map +1 -0
  322. package/fesm2022/mediusinc-mng-commons-filter.mjs +402 -0
  323. package/fesm2022/mediusinc-mng-commons-filter.mjs.map +1 -0
  324. package/fesm2022/mediusinc-mng-commons-form-api.mjs +294 -0
  325. package/fesm2022/mediusinc-mng-commons-form-api.mjs.map +1 -0
  326. package/fesm2022/mediusinc-mng-commons-form.mjs +770 -0
  327. package/fesm2022/mediusinc-mng-commons-form.mjs.map +1 -0
  328. package/fesm2022/mediusinc-mng-commons-model.mjs +251 -0
  329. package/fesm2022/mediusinc-mng-commons-model.mjs.map +1 -0
  330. package/fesm2022/mediusinc-mng-commons-table-api.mjs +1391 -0
  331. package/fesm2022/mediusinc-mng-commons-table-api.mjs.map +1 -0
  332. package/fesm2022/mediusinc-mng-commons-table.mjs +1376 -0
  333. package/fesm2022/mediusinc-mng-commons-table.mjs.map +1 -0
  334. package/fesm2022/mediusinc-mng-commons-tableview-api.mjs +4372 -0
  335. package/fesm2022/mediusinc-mng-commons-tableview-api.mjs.map +1 -0
  336. package/fesm2022/mediusinc-mng-commons-tableview.mjs +4691 -0
  337. package/fesm2022/mediusinc-mng-commons-tableview.mjs.map +1 -0
  338. package/fesm2022/mediusinc-mng-commons.mjs +5 -18605
  339. package/fesm2022/mediusinc-mng-commons.mjs.map +1 -1
  340. package/filter/README.md +9 -0
  341. package/filter/descriptors/filter-lookup.descriptor.d.ts +67 -0
  342. package/filter/descriptors/filter.descriptor.d.ts +67 -0
  343. package/filter/index.d.ts +3 -0
  344. package/form/README.md +8 -0
  345. package/form/api/README.md +7 -0
  346. package/form/api/data-providers/lookup.data-provider.d.ts +19 -0
  347. package/form/api/descriptors/action-button.descriptor.d.ts +25 -0
  348. package/form/api/descriptors/button-style.builder.d.ts +68 -0
  349. package/form/api/index.d.ts +4 -0
  350. package/form/components/autocomplete/autocomplete.component.d.ts +82 -0
  351. package/form/components/date-range/date-range.component.d.ts +28 -0
  352. package/form/components/dropdown/dropdown.component.d.ts +55 -0
  353. package/form/directives/input-trim.directive.d.ts +14 -0
  354. package/form/index.d.ts +4 -0
  355. package/index.d.ts +1 -50
  356. package/model/README.md +7 -0
  357. package/model/descriptors/enum.descriptor.d.ts +14 -0
  358. package/model/descriptors/model.descriptor.d.ts +31 -0
  359. package/model/descriptors/type.descriptor.d.ts +10 -0
  360. package/model/helpers/i18n.d.ts +10 -0
  361. package/model/helpers/model.d.ts +5 -0
  362. package/model/index.d.ts +5 -0
  363. package/package.json +61 -25
  364. package/provide.d.ts +7 -0
  365. package/table/README.md +11 -0
  366. package/table/api/README.md +9 -0
  367. package/table/api/data-providers/table.data-provider.d.ts +38 -0
  368. package/table/api/descriptors/column.descriptor.d.ts +148 -0
  369. package/table/api/descriptors/table.descriptor.d.ts +281 -0
  370. package/table/api/helpers/class-attribute-converter.d.ts +22 -0
  371. package/table/api/index.d.ts +11 -0
  372. package/table/api/models/class-table-attribute.model.d.ts +8 -0
  373. package/table/api/models/column-value.model.d.ts +7 -0
  374. package/table/api/models/table-columns.model.d.ts +42 -0
  375. package/table/api/models/table-event.model.d.ts +17 -0
  376. package/table/api/models/table.model.d.ts +35 -0
  377. package/table/components/column-filter-full/column-filter-full.component.d.ts +100 -0
  378. package/table/components/column-value/column-value.component.d.ts +32 -0
  379. package/table/components/table/table.component.d.ts +114 -0
  380. package/table/helpers/notification.d.ts +4 -0
  381. package/table/helpers/table-layout-prefs.d.ts +7 -0
  382. package/table/index.d.ts +8 -0
  383. package/table/models/column-preferences.model.d.ts +12 -0
  384. package/table/pipes/locale-default-row-class.pipe.d.ts +10 -0
  385. package/table/pipes/table-column-filter-class.pipe.d.ts +8 -0
  386. package/table/services/data-list.service.d.ts +16 -0
  387. package/tableview/README.md +13 -0
  388. package/tableview/action/components/action/action.component.d.ts +73 -0
  389. package/tableview/action/components/editor/action-editor.component.d.ts +31 -0
  390. package/tableview/action/components/editor/injector-context/action-editor-injector-context.component.d.ts +76 -0
  391. package/tableview/action/components/localization/data-language-dropdown.component.d.ts +22 -0
  392. package/tableview/action/components/route/action-route.component.d.ts +31 -0
  393. package/tableview/action/components/table/action-table.component.d.ts +48 -0
  394. package/tableview/action/guards/unsaved-changes.guard.d.ts +3 -0
  395. package/tableview/action/helpers/i18n.d.ts +22 -0
  396. package/tableview/action/helpers/notification.d.ts +6 -0
  397. package/tableview/action/helpers/styles.d.ts +5 -0
  398. package/tableview/action/models/action-editor-dialog-data.model.d.ts +11 -0
  399. package/tableview/action/models/execution/action-context.model.d.ts +36 -0
  400. package/tableview/action/models/execution/action-instance-state.model.d.ts +30 -0
  401. package/tableview/action/models/execution/action-instance.model.d.ts +56 -0
  402. package/tableview/action/services/action-error-mapper.service.d.ts +18 -0
  403. package/tableview/action/services/action-executor.service.d.ts +175 -0
  404. package/tableview/action/services/component-action-executor.service.d.ts +9 -0
  405. package/tableview/action/services/data-provider-executor.service.d.ts +23 -0
  406. package/tableview/action/services/navigation.service.d.ts +15 -0
  407. package/tableview/action/services/root-action-executor.service.d.ts +9 -0
  408. package/tableview/action/services/tokens/action-editor.token.d.ts +2 -0
  409. package/tableview/action/services/view-container.service.d.ts +30 -0
  410. package/tableview/api/README.md +11 -0
  411. package/tableview/api/action/descriptors/action-confirmation.descriptor.d.ts +36 -0
  412. package/tableview/api/action/descriptors/action-editor.descriptor.d.ts +117 -0
  413. package/tableview/api/action/descriptors/action-link.descriptor.d.ts +34 -0
  414. package/tableview/api/action/descriptors/action.descriptor.d.ts +151 -0
  415. package/tableview/api/action/helpers/data-provider-executors.d.ts +18 -0
  416. package/tableview/api/action/models/action-component.model.d.ts +12 -0
  417. package/tableview/api/action/models/action-descriptor.types.d.ts +5 -0
  418. package/tableview/api/action/models/action-editor.model.d.ts +4 -0
  419. package/tableview/api/action/models/action-error.model.d.ts +14 -0
  420. package/tableview/api/action/models/action.type.d.ts +21 -0
  421. package/tableview/api/action/models/execution/action-context-validation.model.d.ts +11 -0
  422. package/tableview/api/action/models/execution/action-context.model.d.ts +24 -0
  423. package/tableview/api/action/models/execution/action-execution-error.model.d.ts +4 -0
  424. package/tableview/api/action/models/execution/action-instance-state.model.d.ts +30 -0
  425. package/tableview/api/action/models/execution/action-instance.model.d.ts +31 -0
  426. package/tableview/api/action/models/execution/view-container.model.d.ts +38 -0
  427. package/tableview/api/action/services/data-provider-executor.service.d.ts +38 -0
  428. package/tableview/api/action/services/tokens/data-language-dropdown.token.d.ts +2 -0
  429. package/tableview/api/editor/data-providers/editor.data-provider.d.ts +87 -0
  430. package/tableview/api/editor/descriptors/editor.descriptor.d.ts +366 -0
  431. package/tableview/api/editor/descriptors/field-action.descriptor.d.ts +22 -0
  432. package/tableview/api/editor/descriptors/field-base.descriptor.d.ts +120 -0
  433. package/tableview/api/editor/descriptors/field-group.descriptor.d.ts +41 -0
  434. package/tableview/api/editor/descriptors/field-lookup.descriptor.d.ts +80 -0
  435. package/tableview/api/editor/descriptors/field-many.descriptor.d.ts +61 -0
  436. package/tableview/api/editor/descriptors/field-validation.descriptor.d.ts +19 -0
  437. package/tableview/api/editor/descriptors/field.descriptor.d.ts +168 -0
  438. package/tableview/api/editor/helpers/class-attribute-converter.d.ts +21 -0
  439. package/tableview/api/editor/helpers/field-validators.d.ts +3 -0
  440. package/tableview/api/editor/models/class-tableview-attribute.model.d.ts +7 -0
  441. package/tableview/api/editor/models/editor-fields.model.d.ts +34 -0
  442. package/tableview/api/editor/models/editor.model.d.ts +7 -0
  443. package/tableview/api/editor/models/field-action-context.model.d.ts +24 -0
  444. package/tableview/api/editor/models/field.model.d.ts +66 -0
  445. package/tableview/api/editor/models/form-editor.event.d.ts +55 -0
  446. package/tableview/api/editor/models/formly-custom-field.model.d.ts +27 -0
  447. package/tableview/api/editor/models/formly-field.model.d.ts +18 -0
  448. package/tableview/api/index.d.ts +50 -0
  449. package/tableview/api/tableview/data-providers/tableview.data-provider.d.ts +43 -0
  450. package/tableview/api/tableview/descriptors/tableview.descriptor.d.ts +296 -0
  451. package/tableview/api/tableview/helpers/class-attribute-converter.d.ts +8 -0
  452. package/tableview/api/tableview/helpers/files-export.d.ts +4 -0
  453. package/tableview/api/tableview/helpers/tableview-create.d.ts +16 -0
  454. package/tableview/api/tableview/helpers/tableview-default-actions.d.ts +38 -0
  455. package/tableview/api/tableview/helpers/tableview-input-builder.d.ts +114 -0
  456. package/tableview/api/tableview/models/class-tableview-attribute.model.d.ts +3 -0
  457. package/tableview/api/tableview/models/tableview-input.model.d.ts +8 -0
  458. package/tableview/api/tableview/models/tableview-route.model.d.ts +20 -0
  459. package/tableview/editor/components/editor/form-editor.component.d.ts +50 -0
  460. package/tableview/editor/components/formly/fields/formly-field-action/formly-field-action.component.d.ts +14 -0
  461. package/tableview/editor/components/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component.d.ts +15 -0
  462. package/tableview/editor/components/formly/fields/formly-field-custom/formly-field-custom.component.d.ts +11 -0
  463. package/tableview/editor/components/formly/fields/formly-field-dropdown/formly-field-dropdown.component.d.ts +14 -0
  464. package/tableview/editor/components/formly/fields/formly-field-fieldset/formly-field-fieldset.component.d.ts +12 -0
  465. package/tableview/editor/components/formly/fields/formly-field-input/formly-field-input.component.d.ts +37 -0
  466. package/tableview/editor/components/formly/fields/formly-field-label/formly-field-label.component.d.ts +11 -0
  467. package/tableview/editor/components/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.d.ts +43 -0
  468. package/tableview/editor/components/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.d.ts +23 -0
  469. package/tableview/editor/components/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.d.ts +41 -0
  470. package/tableview/editor/components/formly/fields/formly-field-tabs/formly-field-tabs.component.d.ts +7 -0
  471. package/tableview/editor/components/formly/wrappers/formly-field-no-label-wrapper/formly-field-no-label-wrapper.component.d.ts +11 -0
  472. package/tableview/editor/components/formly/wrappers/formly-field-wrapper/formly-field-wrapper.component.d.ts +9 -0
  473. package/tableview/editor/helpers/editor-formly.d.ts +10 -0
  474. package/tableview/editor/helpers/formly-config.d.ts +18 -0
  475. package/tableview/editor/helpers/notification.d.ts +4 -0
  476. package/tableview/editor/models/formly-config.model.d.ts +5 -0
  477. package/tableview/editor/services/formly-config.provider.d.ts +5 -0
  478. package/tableview/index.d.ts +48 -0
  479. package/tableview/provide.d.ts +8 -0
  480. package/tableview/tableview/components/route/tableview-route.component.d.ts +7 -0
  481. package/tableview/tableview/components/tableview/tableview.component.d.ts +26 -0
  482. package/tableview/tableview/router/tableview-route-builder.d.ts +42 -0
  483. package/tableview/tableview/services/tableview-feature-config.token.d.ts +18 -0
  484. package/assets/fonts/poppins-v20-latin-500.woff +0 -0
  485. package/assets/fonts/poppins-v20-latin-500.woff2 +0 -0
  486. package/assets/fonts/poppins-v20-latin-600.woff +0 -0
  487. package/assets/fonts/poppins-v20-latin-600.woff2 +0 -0
  488. package/assets/fonts/poppins-v20-latin-700.woff +0 -0
  489. package/assets/fonts/poppins-v20-latin-700.woff2 +0 -0
  490. package/assets/fonts/poppins-v20-latin-regular.woff +0 -0
  491. package/assets/fonts/poppins-v20-latin-regular.woff2 +0 -0
  492. package/assets/images/effect-ondark.png +0 -0
  493. package/assets/images/effect-ondark.svg +0 -38
  494. package/assets/images/effect-ondark@2x.png +0 -0
  495. package/assets/images/effect-onlight.png +0 -0
  496. package/assets/images/effect-onlight.svg +0 -38
  497. package/assets/images/effect-onlight@2x.png +0 -0
  498. package/assets/images/pages/exception-ondark.png +0 -0
  499. package/assets/images/pages/exception-onlight.png +0 -0
  500. package/assets/images/pages/login-ondark.png +0 -0
  501. package/assets/images/pages/login-onlight.png +0 -0
  502. package/data-api/README.md +0 -3
  503. package/data-api/class-dto/README.md +0 -3
  504. package/data-api/class-dto/helpers/tableview-crud-create.d.ts +0 -40
  505. package/data-api/class-dto/index.d.ts +0 -7
  506. package/data-api/class-dto/models/query-result.model.d.ts +0 -13
  507. package/data-api/class-dto/obsolete/README.md +0 -3
  508. package/data-api/class-dto/obsolete/helpers/query-param-convert.d.ts +0 -23
  509. package/data-api/class-dto/obsolete/helpers/tableview-crud-create.d.ts +0 -22
  510. package/data-api/class-dto/obsolete/index.d.ts +0 -14
  511. package/data-api/class-dto/obsolete/models/builders/query-param.builder.d.ts +0 -36
  512. package/data-api/class-dto/obsolete/models/filter-match-type.model.d.ts +0 -25
  513. package/data-api/class-dto/obsolete/models/filter-param.model.d.ts +0 -23
  514. package/data-api/class-dto/obsolete/models/query-mode.model.d.ts +0 -16
  515. package/data-api/class-dto/obsolete/models/query-param.model.d.ts +0 -31
  516. package/data-api/class-dto/obsolete/models/query-result.model.d.ts +0 -24
  517. package/data-api/class-dto/obsolete/provide.d.ts +0 -9
  518. package/data-api/class-dto/obsolete/services/api.abstract.service.d.ts +0 -36
  519. package/data-api/class-dto/obsolete/services/crud-api.abstract.service.d.ts +0 -37
  520. package/data-api/class-dto/obsolete/services/get-all-api.abstract.service.d.ts +0 -30
  521. package/data-api/class-dto/obsolete/tableview/tableview-crud.data-provider.d.ts +0 -28
  522. package/data-api/class-dto/obsolete/utils/query-param-map.util.d.ts +0 -22
  523. package/data-api/class-dto/serder/object-serializer.d.ts +0 -26
  524. package/data-api/class-dto/services/api.abstract.service.d.ts +0 -22
  525. package/data-api/class-dto/services/crud-api.abstract.service.d.ts +0 -25
  526. package/data-api/class-dto/services/get-all-api.abstract.service.d.ts +0 -14
  527. package/data-api/class-dto/tableview/tableview-crud.data-provider.d.ts +0 -17
  528. package/data-api/helpers/get-all-params.d.ts +0 -69
  529. package/data-api/helpers/tableview-get-all-params-create.d.ts +0 -14
  530. package/data-api/index.d.ts +0 -5
  531. package/data-api/models/request-params.model.d.ts +0 -61
  532. package/data-api/rxjs/map-to-data-list.operator.d.ts +0 -9
  533. package/data-api/types/extract-get-all-params.type.d.ts +0 -14
  534. package/esm2022/data-api/class-dto/helpers/tableview-crud-create.mjs +0 -40
  535. package/esm2022/data-api/class-dto/index.mjs +0 -13
  536. package/esm2022/data-api/class-dto/mediusinc-mng-commons-data-api-class-dto.mjs +0 -5
  537. package/esm2022/data-api/class-dto/models/query-result.model.mjs +0 -24
  538. package/esm2022/data-api/class-dto/obsolete/helpers/query-param-convert.mjs +0 -103
  539. package/esm2022/data-api/class-dto/obsolete/helpers/tableview-crud-create.mjs +0 -21
  540. package/esm2022/data-api/class-dto/obsolete/index.mjs +0 -21
  541. package/esm2022/data-api/class-dto/obsolete/mediusinc-mng-commons-data-api-class-dto-obsolete.mjs +0 -5
  542. package/esm2022/data-api/class-dto/obsolete/models/builders/query-param.builder.mjs +0 -83
  543. package/esm2022/data-api/class-dto/obsolete/models/filter-match-type.model.mjs +0 -27
  544. package/esm2022/data-api/class-dto/obsolete/models/filter-param.model.mjs +0 -33
  545. package/esm2022/data-api/class-dto/obsolete/models/query-mode.model.mjs +0 -18
  546. package/esm2022/data-api/class-dto/obsolete/models/query-param.model.mjs +0 -68
  547. package/esm2022/data-api/class-dto/obsolete/models/query-result.model.mjs +0 -24
  548. package/esm2022/data-api/class-dto/obsolete/provide.mjs +0 -40
  549. package/esm2022/data-api/class-dto/obsolete/services/api.abstract.service.mjs +0 -70
  550. package/esm2022/data-api/class-dto/obsolete/services/crud-api.abstract.service.mjs +0 -83
  551. package/esm2022/data-api/class-dto/obsolete/services/get-all-api.abstract.service.mjs +0 -38
  552. package/esm2022/data-api/class-dto/obsolete/tableview/tableview-crud.data-provider.mjs +0 -51
  553. package/esm2022/data-api/class-dto/obsolete/utils/query-param-map.util.mjs +0 -57
  554. package/esm2022/data-api/class-dto/serder/object-serializer.mjs +0 -184
  555. package/esm2022/data-api/class-dto/services/api.abstract.service.mjs +0 -55
  556. package/esm2022/data-api/class-dto/services/crud-api.abstract.service.mjs +0 -82
  557. package/esm2022/data-api/class-dto/services/get-all-api.abstract.service.mjs +0 -49
  558. package/esm2022/data-api/class-dto/tableview/tableview-crud.data-provider.mjs +0 -49
  559. package/esm2022/data-api/helpers/get-all-params.mjs +0 -180
  560. package/esm2022/data-api/helpers/tableview-get-all-params-create.mjs +0 -18
  561. package/esm2022/data-api/index.mjs +0 -10
  562. package/esm2022/data-api/mediusinc-mng-commons-data-api.mjs +0 -5
  563. package/esm2022/data-api/models/request-params.model.mjs +0 -2
  564. package/esm2022/data-api/rxjs/map-to-data-list.operator.mjs +0 -19
  565. package/esm2022/data-api/types/extract-get-all-params.type.mjs +0 -2
  566. package/esm2022/lib/components/action/action.component.mjs +0 -314
  567. package/esm2022/lib/components/action/editor/action-editor.component.mjs +0 -98
  568. package/esm2022/lib/components/action/editor/injector-context/action-editor-injector-context.component.mjs +0 -394
  569. package/esm2022/lib/components/action/index.mjs +0 -6
  570. package/esm2022/lib/components/action/localization/data-language-dropdown.component.mjs +0 -53
  571. package/esm2022/lib/components/action/models/action-component.model.mjs +0 -2
  572. package/esm2022/lib/components/action/models/action-execution.model.mjs +0 -323
  573. package/esm2022/lib/components/action/models/index.mjs +0 -4
  574. package/esm2022/lib/components/action/models/tableview-action-default-categories.model.mjs +0 -11
  575. package/esm2022/lib/components/action/route/action-route.component.mjs +0 -141
  576. package/esm2022/lib/components/action/table/action-table.component.mjs +0 -152
  577. package/esm2022/lib/components/form/autocomplete/autocomplete.component.mjs +0 -408
  578. package/esm2022/lib/components/form/date-range/date-range.component.mjs +0 -110
  579. package/esm2022/lib/components/form/dropdown/dropdown.component.mjs +0 -210
  580. package/esm2022/lib/components/form/editor/form-editor.component.mjs +0 -281
  581. package/esm2022/lib/components/form/formly/fields/formly-field-action/formly-field-action.component.mjs +0 -61
  582. package/esm2022/lib/components/form/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component.mjs +0 -54
  583. package/esm2022/lib/components/form/formly/fields/formly-field-custom/formly-custom-field-base.model.mjs +0 -69
  584. package/esm2022/lib/components/form/formly/fields/formly-field-custom/formly-field-custom.component.mjs +0 -39
  585. package/esm2022/lib/components/form/formly/fields/formly-field-dropdown/formly-field-dropdown.component.mjs +0 -49
  586. package/esm2022/lib/components/form/formly/fields/formly-field-fieldset/formly-field-fieldset.component.mjs +0 -27
  587. package/esm2022/lib/components/form/formly/fields/formly-field-input/formly-field-input.component.mjs +0 -220
  588. package/esm2022/lib/components/form/formly/fields/formly-field-label/formly-field-label.component.mjs +0 -24
  589. package/esm2022/lib/components/form/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.mjs +0 -219
  590. package/esm2022/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.mjs +0 -221
  591. package/esm2022/lib/components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.mjs +0 -212
  592. package/esm2022/lib/components/form/formly/fields/formly-field-tabs/formly-field-tabs.component.mjs +0 -18
  593. package/esm2022/lib/components/form/formly/fields/index.mjs +0 -13
  594. package/esm2022/lib/components/form/formly/formly.config.mjs +0 -250
  595. package/esm2022/lib/components/form/formly/index.mjs +0 -2
  596. package/esm2022/lib/components/form/formly/models/formly-config.model.mjs +0 -2
  597. package/esm2022/lib/components/form/formly/models/formly-field.model.mjs +0 -2
  598. package/esm2022/lib/components/form/formly/models/index.mjs +0 -3
  599. package/esm2022/lib/components/form/formly/wrappers/formly-field-no-label-wrapper/formly-field-no-label-wrapper.component.mjs +0 -33
  600. package/esm2022/lib/components/form/formly/wrappers/formly-field-wrapper/formly-field-wrapper.component.mjs +0 -31
  601. package/esm2022/lib/components/form/formly/wrappers/index.mjs +0 -3
  602. package/esm2022/lib/components/form/index.mjs +0 -5
  603. package/esm2022/lib/components/form/models/field-action-context.model.mjs +0 -2
  604. package/esm2022/lib/components/form/models/form-editor.event.mjs +0 -49
  605. package/esm2022/lib/components/form/models/form-editor.interface.mjs +0 -2
  606. package/esm2022/lib/components/form/models/index.mjs +0 -4
  607. package/esm2022/lib/components/layout/breadcrumb.component.mjs +0 -34
  608. package/esm2022/lib/components/layout/footer.component.mjs +0 -19
  609. package/esm2022/lib/components/layout/index.mjs +0 -9
  610. package/esm2022/lib/components/layout/main-layout.component.mjs +0 -53
  611. package/esm2022/lib/components/layout/menu-item.component.mjs +0 -296
  612. package/esm2022/lib/components/layout/menu.component.mjs +0 -34
  613. package/esm2022/lib/components/layout/services/index.mjs +0 -2
  614. package/esm2022/lib/components/layout/services/main-layout.component.service.mjs +0 -196
  615. package/esm2022/lib/components/layout/topbar-user.component.mjs +0 -46
  616. package/esm2022/lib/components/layout/topbar.component.mjs +0 -66
  617. package/esm2022/lib/components/layout/version.component.mjs +0 -60
  618. package/esm2022/lib/components/layoutV2/breadcrumb.component.mjs +0 -30
  619. package/esm2022/lib/components/layoutV2/footer.component.mjs +0 -29
  620. package/esm2022/lib/components/layoutV2/index.mjs +0 -8
  621. package/esm2022/lib/components/layoutV2/main-layout.component.mjs +0 -95
  622. package/esm2022/lib/components/layoutV2/menu-item.component.mjs +0 -275
  623. package/esm2022/lib/components/layoutV2/menu.component.mjs +0 -39
  624. package/esm2022/lib/components/layoutV2/model/index.mjs +0 -3
  625. package/esm2022/lib/components/layoutV2/model/layout-state.model.mjs +0 -2
  626. package/esm2022/lib/components/layoutV2/model/menu.model.mjs +0 -2
  627. package/esm2022/lib/components/layoutV2/services/index.mjs +0 -3
  628. package/esm2022/lib/components/layoutV2/services/main-layout.component.service.mjs +0 -71
  629. package/esm2022/lib/components/layoutV2/services/menu.service.mjs +0 -122
  630. package/esm2022/lib/components/layoutV2/sidebar.component.mjs +0 -62
  631. package/esm2022/lib/components/layoutV2/topbar-user.component.mjs +0 -40
  632. package/esm2022/lib/components/layoutV2/topbar.component.mjs +0 -69
  633. package/esm2022/lib/components/layoutV2/version.component.mjs +0 -63
  634. package/esm2022/lib/components/notification/notification-wrapper.component.mjs +0 -50
  635. package/esm2022/lib/components/pages/error/error.page.component.mjs +0 -21
  636. package/esm2022/lib/components/pages/index.mjs +0 -3
  637. package/esm2022/lib/components/pages/not-found/not-found.page.component.mjs +0 -21
  638. package/esm2022/lib/components/table/column-filter-full/column-filter-full.component.mjs +0 -597
  639. package/esm2022/lib/components/table/column-value/column-value.component.mjs +0 -90
  640. package/esm2022/lib/components/table/models/table.event.mjs +0 -16
  641. package/esm2022/lib/components/table/models/table.interface.mjs +0 -2
  642. package/esm2022/lib/components/table/table-column-filter-class/table-column-filter-class.pipe.mjs +0 -25
  643. package/esm2022/lib/components/table/table.component.mjs +0 -643
  644. package/esm2022/lib/components/tableview/actions/tableview-default-actions.mjs +0 -215
  645. package/esm2022/lib/components/tableview/builders/tableview-builder.mjs +0 -162
  646. package/esm2022/lib/components/tableview/helpers/tableview-create.mjs +0 -24
  647. package/esm2022/lib/components/tableview/index.mjs +0 -7
  648. package/esm2022/lib/components/tableview/models/tableview.model.mjs +0 -2
  649. package/esm2022/lib/components/tableview/route/tableview-route.component.mjs +0 -15
  650. package/esm2022/lib/components/tableview/tableview.component.mjs +0 -82
  651. package/esm2022/lib/data-providers/base.data-provider.mjs +0 -48
  652. package/esm2022/lib/data-providers/editor.data-provider.mjs +0 -105
  653. package/esm2022/lib/data-providers/index.mjs +0 -6
  654. package/esm2022/lib/data-providers/lookup.data-provider.mjs +0 -45
  655. package/esm2022/lib/data-providers/table.data-provider.mjs +0 -64
  656. package/esm2022/lib/data-providers/tableview.data-provider.mjs +0 -105
  657. package/esm2022/lib/descriptors/action/action-button.descriptor.mjs +0 -68
  658. package/esm2022/lib/descriptors/action/action-confirmation.descriptor.mjs +0 -77
  659. package/esm2022/lib/descriptors/action/action-editor.descriptor.mjs +0 -266
  660. package/esm2022/lib/descriptors/action/action-link.descriptor.mjs +0 -89
  661. package/esm2022/lib/descriptors/action/action.descriptor.mjs +0 -383
  662. package/esm2022/lib/descriptors/action/index.mjs +0 -6
  663. package/esm2022/lib/descriptors/editor/editor.descriptor.mjs +0 -510
  664. package/esm2022/lib/descriptors/editor/field-action.descriptor.mjs +0 -50
  665. package/esm2022/lib/descriptors/editor/field-base.descriptor.mjs +0 -285
  666. package/esm2022/lib/descriptors/editor/field-group.descriptor.mjs +0 -97
  667. package/esm2022/lib/descriptors/editor/field-lookup.descriptor.mjs +0 -212
  668. package/esm2022/lib/descriptors/editor/field-many.descriptor.mjs +0 -153
  669. package/esm2022/lib/descriptors/editor/field-validation.descriptor.mjs +0 -25
  670. package/esm2022/lib/descriptors/editor/field.descriptor.mjs +0 -343
  671. package/esm2022/lib/descriptors/editor/index.mjs +0 -9
  672. package/esm2022/lib/descriptors/editor/internal/editor-fields.model.mjs +0 -2
  673. package/esm2022/lib/descriptors/editor/internal/editor.model.mjs +0 -2
  674. package/esm2022/lib/descriptors/filter/filter-lookup.descriptor.mjs +0 -186
  675. package/esm2022/lib/descriptors/filter/filter.descriptor.mjs +0 -198
  676. package/esm2022/lib/descriptors/filter/index.mjs +0 -3
  677. package/esm2022/lib/descriptors/interfaces/field-config.interface.mjs +0 -2
  678. package/esm2022/lib/descriptors/interfaces/index.mjs +0 -3
  679. package/esm2022/lib/descriptors/interfaces/lookup-descriptor.interface.mjs +0 -2
  680. package/esm2022/lib/descriptors/model/enum.descriptor.mjs +0 -31
  681. package/esm2022/lib/descriptors/model/index.mjs +0 -4
  682. package/esm2022/lib/descriptors/model/model.descriptor.mjs +0 -79
  683. package/esm2022/lib/descriptors/model/type.descriptor.mjs +0 -11
  684. package/esm2022/lib/descriptors/table/column.descriptor.mjs +0 -359
  685. package/esm2022/lib/descriptors/table/index.mjs +0 -4
  686. package/esm2022/lib/descriptors/table/internal/table-columns.model.mjs +0 -2
  687. package/esm2022/lib/descriptors/table/internal/table.model.mjs +0 -2
  688. package/esm2022/lib/descriptors/table/sort.descriptor.mjs +0 -45
  689. package/esm2022/lib/descriptors/table/table.descriptor.mjs +0 -751
  690. package/esm2022/lib/descriptors/tableview/index.mjs +0 -2
  691. package/esm2022/lib/descriptors/tableview/internal/tableview.model.mjs +0 -2
  692. package/esm2022/lib/descriptors/tableview/tableview.descriptor.mjs +0 -558
  693. package/esm2022/lib/descriptors/types/action.type.mjs +0 -26
  694. package/esm2022/lib/descriptors/types/column.type.mjs +0 -21
  695. package/esm2022/lib/descriptors/types/editor.type.mjs +0 -8
  696. package/esm2022/lib/descriptors/types/field.type.mjs +0 -56
  697. package/esm2022/lib/descriptors/types/filter.type.mjs +0 -15
  698. package/esm2022/lib/descriptors/types/index.mjs +0 -8
  699. package/esm2022/lib/descriptors/types/table.type.mjs +0 -22
  700. package/esm2022/lib/descriptors/types/trim.type.mjs +0 -2
  701. package/esm2022/lib/directives/component.directive.mjs +0 -66
  702. package/esm2022/lib/directives/dialog-keydown-handler.directive.mjs +0 -49
  703. package/esm2022/lib/directives/index.mjs +0 -5
  704. package/esm2022/lib/directives/input-trim.directive.mjs +0 -55
  705. package/esm2022/lib/directives/template.directive.mjs +0 -29
  706. package/esm2022/lib/error/error.handler.mjs +0 -20
  707. package/esm2022/lib/error/index.mjs +0 -2
  708. package/esm2022/lib/guards/index.mjs +0 -2
  709. package/esm2022/lib/guards/unsaved-changes.guard.mjs +0 -4
  710. package/esm2022/lib/helpers/coercion.mjs +0 -52
  711. package/esm2022/lib/helpers/data-provider-executors.mjs +0 -80
  712. package/esm2022/lib/models/action-editor.model.mjs +0 -2
  713. package/esm2022/lib/models/can-component-deactivate.model.mjs +0 -2
  714. package/esm2022/lib/models/class.model.mjs +0 -2
  715. package/esm2022/lib/models/column-value.model.mjs +0 -2
  716. package/esm2022/lib/models/common-init-event-enum.model.mjs +0 -11
  717. package/esm2022/lib/models/config.model.mjs +0 -2
  718. package/esm2022/lib/models/data-list.model.mjs +0 -2
  719. package/esm2022/lib/models/enum.model.mjs +0 -2
  720. package/esm2022/lib/models/error.model.mjs +0 -44
  721. package/esm2022/lib/models/filter-match.model.mjs +0 -105
  722. package/esm2022/lib/models/index.mjs +0 -20
  723. package/esm2022/lib/models/layout-config.model.mjs +0 -2
  724. package/esm2022/lib/models/log.model.mjs +0 -10
  725. package/esm2022/lib/models/menu.model.mjs +0 -2
  726. package/esm2022/lib/models/radio.model.mjs +0 -2
  727. package/esm2022/lib/models/tableview-attr.model.mjs +0 -2
  728. package/esm2022/lib/models/type-registry.model.mjs +0 -2
  729. package/esm2022/lib/models/user.model.mjs +0 -2
  730. package/esm2022/lib/models/version.model.mjs +0 -2
  731. package/esm2022/lib/models/view-container.model.mjs +0 -2
  732. package/esm2022/lib/pipes/boolean.pipe.mjs +0 -28
  733. package/esm2022/lib/pipes/class-map.pipe.mjs +0 -23
  734. package/esm2022/lib/pipes/enum.pipe.mjs +0 -26
  735. package/esm2022/lib/pipes/enumerate-async.pipe.mjs +0 -41
  736. package/esm2022/lib/pipes/enumerate.pipe.mjs +0 -58
  737. package/esm2022/lib/pipes/getter.pipe.mjs +0 -21
  738. package/esm2022/lib/pipes/i18n-property.pipe.mjs +0 -19
  739. package/esm2022/lib/pipes/index.mjs +0 -12
  740. package/esm2022/lib/pipes/json-path.pipe.mjs +0 -25
  741. package/esm2022/lib/pipes/locale-default-row-class.pipe.mjs +0 -27
  742. package/esm2022/lib/pipes/models/internal/enumrate-pipe-i18n.model.mjs +0 -2
  743. package/esm2022/lib/pipes/models/internal/index.mjs +0 -2
  744. package/esm2022/lib/pipes/parametrize.pipe.mjs +0 -86
  745. package/esm2022/lib/pipes/template.pipe.mjs +0 -26
  746. package/esm2022/lib/provide.mjs +0 -101
  747. package/esm2022/lib/registry/type.registry.mjs +0 -106
  748. package/esm2022/lib/router/index.mjs +0 -4
  749. package/esm2022/lib/router/models/index.mjs +0 -2
  750. package/esm2022/lib/router/models/router.model.mjs +0 -2
  751. package/esm2022/lib/router/route-builder.mjs +0 -347
  752. package/esm2022/lib/router/routes-builder.mjs +0 -69
  753. package/esm2022/lib/router/tableview-route-builder.mjs +0 -201
  754. package/esm2022/lib/security/authorization.guard.mjs +0 -15
  755. package/esm2022/lib/security/authorization.service.mjs +0 -51
  756. package/esm2022/lib/security/authorization.util.mjs +0 -16
  757. package/esm2022/lib/security/index.mjs +0 -4
  758. package/esm2022/lib/security/model/authorization.type.mjs +0 -8
  759. package/esm2022/lib/security/model/index.mjs +0 -4
  760. package/esm2022/lib/security/model/permission-service.interface.mjs +0 -2
  761. package/esm2022/lib/security/model/permissions.model.mjs +0 -87
  762. package/esm2022/lib/services/action/action-executor.service.mjs +0 -747
  763. package/esm2022/lib/services/action/component-action-executor.service.mjs +0 -19
  764. package/esm2022/lib/services/action/index.mjs +0 -5
  765. package/esm2022/lib/services/action/provide-action-executor.mjs +0 -9
  766. package/esm2022/lib/services/action/root-action-executor.service.mjs +0 -18
  767. package/esm2022/lib/services/action-error-mapper.service.mjs +0 -20
  768. package/esm2022/lib/services/commons-init.service.mjs +0 -100
  769. package/esm2022/lib/services/commons.service.mjs +0 -459
  770. package/esm2022/lib/services/configuration.service.mjs +0 -174
  771. package/esm2022/lib/services/data-provider-executor.service.mjs +0 -52
  772. package/esm2022/lib/services/index.mjs +0 -12
  773. package/esm2022/lib/services/internal/commons-init.provider.mjs +0 -4
  774. package/esm2022/lib/services/internal/index.mjs +0 -2
  775. package/esm2022/lib/services/log-publisher-console.service.mjs +0 -40
  776. package/esm2022/lib/services/logger.service.mjs +0 -130
  777. package/esm2022/lib/services/mng-localstorage-config.service.mjs +0 -30
  778. package/esm2022/lib/services/navigation.service.mjs +0 -55
  779. package/esm2022/lib/services/providers/formly-config.provider.mjs +0 -31
  780. package/esm2022/lib/services/providers/index.mjs +0 -2
  781. package/esm2022/lib/services/router.service.mjs +0 -183
  782. package/esm2022/lib/services/tokens/browser-storage.token.mjs +0 -6
  783. package/esm2022/lib/services/tokens/commons-init.token.mjs +0 -3
  784. package/esm2022/lib/services/tokens/default-setting.token.mjs +0 -3
  785. package/esm2022/lib/services/tokens/index.mjs +0 -6
  786. package/esm2022/lib/services/tokens/log-publisher.token.mjs +0 -3
  787. package/esm2022/lib/services/tokens/module-config.token.mjs +0 -3
  788. package/esm2022/lib/services/version.service.mjs +0 -49
  789. package/esm2022/lib/services/view/index.mjs +0 -3
  790. package/esm2022/lib/services/view/provide-view-container.mjs +0 -17
  791. package/esm2022/lib/services/view/view-container.service.mjs +0 -59
  792. package/esm2022/lib/styles/button-style.builder.mjs +0 -174
  793. package/esm2022/lib/styles/index.mjs +0 -3
  794. package/esm2022/lib/styles/models/index.mjs +0 -3
  795. package/esm2022/lib/styles/models/style-level.enum.mjs +0 -12
  796. package/esm2022/lib/styles/models/style-size.enum.mjs +0 -9
  797. package/esm2022/lib/styles/styles.util.mjs +0 -42
  798. package/esm2022/lib/types/action-descriptor.types.mjs +0 -2
  799. package/esm2022/lib/types/data-provider.types.mjs +0 -2
  800. package/esm2022/lib/types/getter.type.mjs +0 -2
  801. package/esm2022/lib/types/i18n.type.mjs +0 -2
  802. package/esm2022/lib/types/index.mjs +0 -8
  803. package/esm2022/lib/types/localstorage-config-value.type.mjs +0 -2
  804. package/esm2022/lib/types/type.decorator.mjs +0 -12
  805. package/esm2022/lib/types/type.model.mjs +0 -2
  806. package/esm2022/lib/utils/data-list-params.util.mjs +0 -416
  807. package/esm2022/lib/utils/date.util.mjs +0 -136
  808. package/esm2022/lib/utils/decorator-metadata.util.mjs +0 -61
  809. package/esm2022/lib/utils/editor-formly.util.mjs +0 -339
  810. package/esm2022/lib/utils/enum.util.mjs +0 -83
  811. package/esm2022/lib/utils/error.util.mjs +0 -247
  812. package/esm2022/lib/utils/export.util.mjs +0 -21
  813. package/esm2022/lib/utils/file.util.mjs +0 -18
  814. package/esm2022/lib/utils/i18n.util.mjs +0 -274
  815. package/esm2022/lib/utils/index.mjs +0 -14
  816. package/esm2022/lib/utils/model.util.mjs +0 -73
  817. package/esm2022/lib/utils/notification.util.mjs +0 -45
  818. package/esm2022/lib/utils/object.util.mjs +0 -135
  819. package/esm2022/lib/utils/route.util.mjs +0 -60
  820. package/esm2022/lib/utils/string.util.mjs +0 -59
  821. package/esm2022/lib/utils/tableview.util.mjs +0 -193
  822. package/esm2022/lib/validators/field.validator.mjs +0 -33
  823. package/esm2022/lib/validators/index.mjs +0 -2
  824. package/fesm2022/mediusinc-mng-commons-data-api-class-dto-obsolete.mjs +0 -698
  825. package/fesm2022/mediusinc-mng-commons-data-api-class-dto-obsolete.mjs.map +0 -1
  826. package/fesm2022/mediusinc-mng-commons-data-api-class-dto.mjs +0 -480
  827. package/fesm2022/mediusinc-mng-commons-data-api-class-dto.mjs.map +0 -1
  828. package/fesm2022/mediusinc-mng-commons-data-api.mjs +0 -224
  829. package/fesm2022/mediusinc-mng-commons-data-api.mjs.map +0 -1
  830. package/lib/components/action/action.component.d.ts +0 -76
  831. package/lib/components/action/editor/action-editor.component.d.ts +0 -33
  832. package/lib/components/action/editor/injector-context/action-editor-injector-context.component.d.ts +0 -80
  833. package/lib/components/action/index.d.ts +0 -5
  834. package/lib/components/action/localization/data-language-dropdown.component.d.ts +0 -24
  835. package/lib/components/action/models/action-component.model.d.ts +0 -13
  836. package/lib/components/action/models/action-execution.model.d.ts +0 -169
  837. package/lib/components/action/models/index.d.ts +0 -3
  838. package/lib/components/action/route/action-route.component.d.ts +0 -31
  839. package/lib/components/action/table/action-table.component.d.ts +0 -49
  840. package/lib/components/form/autocomplete/autocomplete.component.d.ts +0 -83
  841. package/lib/components/form/date-range/date-range.component.d.ts +0 -28
  842. package/lib/components/form/dropdown/dropdown.component.d.ts +0 -54
  843. package/lib/components/form/editor/form-editor.component.d.ts +0 -51
  844. package/lib/components/form/formly/fields/formly-field-action/formly-field-action.component.d.ts +0 -16
  845. package/lib/components/form/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component.d.ts +0 -16
  846. package/lib/components/form/formly/fields/formly-field-custom/formly-custom-field-base.model.d.ts +0 -27
  847. package/lib/components/form/formly/fields/formly-field-custom/formly-field-custom.component.d.ts +0 -12
  848. package/lib/components/form/formly/fields/formly-field-dropdown/formly-field-dropdown.component.d.ts +0 -15
  849. package/lib/components/form/formly/fields/formly-field-fieldset/formly-field-fieldset.component.d.ts +0 -14
  850. package/lib/components/form/formly/fields/formly-field-input/formly-field-input.component.d.ts +0 -39
  851. package/lib/components/form/formly/fields/formly-field-label/formly-field-label.component.d.ts +0 -11
  852. package/lib/components/form/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.d.ts +0 -45
  853. package/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.d.ts +0 -25
  854. package/lib/components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.d.ts +0 -42
  855. package/lib/components/form/formly/fields/formly-field-tabs/formly-field-tabs.component.d.ts +0 -7
  856. package/lib/components/form/formly/fields/index.d.ts +0 -12
  857. package/lib/components/form/formly/formly.config.d.ts +0 -17
  858. package/lib/components/form/formly/index.d.ts +0 -1
  859. package/lib/components/form/formly/models/formly-config.model.d.ts +0 -11
  860. package/lib/components/form/formly/models/formly-field.model.d.ts +0 -17
  861. package/lib/components/form/formly/models/index.d.ts +0 -2
  862. package/lib/components/form/formly/wrappers/formly-field-no-label-wrapper/formly-field-no-label-wrapper.component.d.ts +0 -11
  863. package/lib/components/form/formly/wrappers/formly-field-wrapper/formly-field-wrapper.component.d.ts +0 -11
  864. package/lib/components/form/formly/wrappers/index.d.ts +0 -2
  865. package/lib/components/form/index.d.ts +0 -4
  866. package/lib/components/form/models/field-action-context.model.d.ts +0 -24
  867. package/lib/components/form/models/form-editor.event.d.ts +0 -58
  868. package/lib/components/form/models/index.d.ts +0 -3
  869. package/lib/components/layout/breadcrumb.component.d.ts +0 -13
  870. package/lib/components/layout/footer.component.d.ts +0 -9
  871. package/lib/components/layout/index.d.ts +0 -8
  872. package/lib/components/layout/main-layout.component.d.ts +0 -19
  873. package/lib/components/layout/menu-item.component.d.ts +0 -55
  874. package/lib/components/layout/menu.component.d.ts +0 -16
  875. package/lib/components/layout/services/index.d.ts +0 -1
  876. package/lib/components/layout/services/main-layout.component.service.d.ts +0 -65
  877. package/lib/components/layout/topbar-user.component.d.ts +0 -22
  878. package/lib/components/layout/topbar.component.d.ts +0 -26
  879. package/lib/components/layout/version.component.d.ts +0 -19
  880. package/lib/components/layoutV2/breadcrumb.component.d.ts +0 -10
  881. package/lib/components/layoutV2/footer.component.d.ts +0 -12
  882. package/lib/components/layoutV2/index.d.ts +0 -7
  883. package/lib/components/layoutV2/main-layout.component.d.ts +0 -24
  884. package/lib/components/layoutV2/menu-item.component.d.ts +0 -42
  885. package/lib/components/layoutV2/menu.component.d.ts +0 -14
  886. package/lib/components/layoutV2/model/index.d.ts +0 -2
  887. package/lib/components/layoutV2/model/layout-state.model.d.ts +0 -10
  888. package/lib/components/layoutV2/model/menu.model.d.ts +0 -4
  889. package/lib/components/layoutV2/services/index.d.ts +0 -2
  890. package/lib/components/layoutV2/services/main-layout.component.service.d.ts +0 -17
  891. package/lib/components/layoutV2/services/menu.service.d.ts +0 -22
  892. package/lib/components/layoutV2/sidebar.component.d.ts +0 -19
  893. package/lib/components/layoutV2/topbar-user.component.d.ts +0 -16
  894. package/lib/components/layoutV2/topbar.component.d.ts +0 -22
  895. package/lib/components/layoutV2/version.component.d.ts +0 -19
  896. package/lib/components/pages/error/error.page.component.d.ts +0 -8
  897. package/lib/components/pages/index.d.ts +0 -2
  898. package/lib/components/pages/not-found/not-found.page.component.d.ts +0 -8
  899. package/lib/components/table/column-filter-full/column-filter-full.component.d.ts +0 -101
  900. package/lib/components/table/column-value/column-value.component.d.ts +0 -35
  901. package/lib/components/table/models/table.event.d.ts +0 -17
  902. package/lib/components/table/models/table.interface.d.ts +0 -17
  903. package/lib/components/table/table-column-filter-class/table-column-filter-class.pipe.d.ts +0 -8
  904. package/lib/components/table/table.component.d.ts +0 -123
  905. package/lib/components/tableview/actions/tableview-default-actions.d.ts +0 -36
  906. package/lib/components/tableview/builders/tableview-builder.d.ts +0 -115
  907. package/lib/components/tableview/helpers/tableview-create.d.ts +0 -16
  908. package/lib/components/tableview/index.d.ts +0 -6
  909. package/lib/components/tableview/models/tableview.model.d.ts +0 -8
  910. package/lib/components/tableview/route/tableview-route.component.d.ts +0 -7
  911. package/lib/components/tableview/tableview.component.d.ts +0 -29
  912. package/lib/data-providers/base.data-provider.d.ts +0 -32
  913. package/lib/data-providers/editor.data-provider.d.ts +0 -88
  914. package/lib/data-providers/index.d.ts +0 -5
  915. package/lib/data-providers/lookup.data-provider.d.ts +0 -27
  916. package/lib/data-providers/table.data-provider.d.ts +0 -40
  917. package/lib/data-providers/tableview.data-provider.d.ts +0 -45
  918. package/lib/descriptors/action/action-button.descriptor.d.ts +0 -25
  919. package/lib/descriptors/action/action-confirmation.descriptor.d.ts +0 -36
  920. package/lib/descriptors/action/action-editor.descriptor.d.ts +0 -118
  921. package/lib/descriptors/action/action-link.descriptor.d.ts +0 -34
  922. package/lib/descriptors/action/action.descriptor.d.ts +0 -149
  923. package/lib/descriptors/action/index.d.ts +0 -5
  924. package/lib/descriptors/editor/editor.descriptor.d.ts +0 -270
  925. package/lib/descriptors/editor/field-action.descriptor.d.ts +0 -23
  926. package/lib/descriptors/editor/field-base.descriptor.d.ts +0 -122
  927. package/lib/descriptors/editor/field-group.descriptor.d.ts +0 -42
  928. package/lib/descriptors/editor/field-lookup.descriptor.d.ts +0 -83
  929. package/lib/descriptors/editor/field-many.descriptor.d.ts +0 -63
  930. package/lib/descriptors/editor/field-validation.descriptor.d.ts +0 -19
  931. package/lib/descriptors/editor/field.descriptor.d.ts +0 -167
  932. package/lib/descriptors/editor/index.d.ts +0 -8
  933. package/lib/descriptors/editor/internal/editor-fields.model.d.ts +0 -33
  934. package/lib/descriptors/editor/internal/editor.model.d.ts +0 -15
  935. package/lib/descriptors/filter/filter-lookup.descriptor.d.ts +0 -70
  936. package/lib/descriptors/filter/filter.descriptor.d.ts +0 -66
  937. package/lib/descriptors/filter/index.d.ts +0 -2
  938. package/lib/descriptors/interfaces/field-config.interface.d.ts +0 -9
  939. package/lib/descriptors/interfaces/index.d.ts +0 -2
  940. package/lib/descriptors/interfaces/lookup-descriptor.interface.d.ts +0 -12
  941. package/lib/descriptors/model/enum.descriptor.d.ts +0 -14
  942. package/lib/descriptors/model/index.d.ts +0 -3
  943. package/lib/descriptors/model/model.descriptor.d.ts +0 -31
  944. package/lib/descriptors/model/type.descriptor.d.ts +0 -5
  945. package/lib/descriptors/table/column.descriptor.d.ts +0 -148
  946. package/lib/descriptors/table/index.d.ts +0 -3
  947. package/lib/descriptors/table/internal/table-columns.model.d.ts +0 -42
  948. package/lib/descriptors/table/internal/table.model.d.ts +0 -12
  949. package/lib/descriptors/table/table.descriptor.d.ts +0 -272
  950. package/lib/descriptors/tableview/index.d.ts +0 -1
  951. package/lib/descriptors/tableview/internal/tableview.model.d.ts +0 -11
  952. package/lib/descriptors/tableview/tableview.descriptor.d.ts +0 -193
  953. package/lib/descriptors/types/action.type.d.ts +0 -21
  954. package/lib/descriptors/types/editor.type.d.ts +0 -6
  955. package/lib/descriptors/types/field.type.d.ts +0 -47
  956. package/lib/descriptors/types/index.d.ts +0 -7
  957. package/lib/descriptors/types/table.type.d.ts +0 -18
  958. package/lib/directives/component.directive.d.ts +0 -20
  959. package/lib/directives/dialog-keydown-handler.directive.d.ts +0 -12
  960. package/lib/directives/index.d.ts +0 -4
  961. package/lib/directives/input-trim.directive.d.ts +0 -14
  962. package/lib/directives/template.directive.d.ts +0 -12
  963. package/lib/error/error.handler.d.ts +0 -6
  964. package/lib/error/index.d.ts +0 -1
  965. package/lib/guards/index.d.ts +0 -1
  966. package/lib/guards/unsaved-changes.guard.d.ts +0 -3
  967. package/lib/helpers/coercion.d.ts +0 -9
  968. package/lib/helpers/data-provider-executors.d.ts +0 -19
  969. package/lib/models/action-editor.model.d.ts +0 -15
  970. package/lib/models/column-value.model.d.ts +0 -4
  971. package/lib/models/common-init-event-enum.model.d.ts +0 -9
  972. package/lib/models/config.model.d.ts +0 -53
  973. package/lib/models/enum.model.d.ts +0 -7
  974. package/lib/models/error.model.d.ts +0 -50
  975. package/lib/models/index.d.ts +0 -19
  976. package/lib/models/layout-config.model.d.ts +0 -34
  977. package/lib/models/log.model.d.ts +0 -40
  978. package/lib/models/menu.model.d.ts +0 -32
  979. package/lib/models/tableview-attr.model.d.ts +0 -10
  980. package/lib/models/type-registry.model.d.ts +0 -7
  981. package/lib/models/user.model.d.ts +0 -8
  982. package/lib/models/view-container.model.d.ts +0 -24
  983. package/lib/pipes/boolean.pipe.d.ts +0 -7
  984. package/lib/pipes/class-map.pipe.d.ts +0 -7
  985. package/lib/pipes/enum.pipe.d.ts +0 -8
  986. package/lib/pipes/enumerate-async.pipe.d.ts +0 -14
  987. package/lib/pipes/enumerate.pipe.d.ts +0 -21
  988. package/lib/pipes/getter.pipe.d.ts +0 -8
  989. package/lib/pipes/i18n-property.pipe.d.ts +0 -8
  990. package/lib/pipes/index.d.ts +0 -11
  991. package/lib/pipes/json-path.pipe.d.ts +0 -13
  992. package/lib/pipes/locale-default-row-class.pipe.d.ts +0 -10
  993. package/lib/pipes/models/internal/enumrate-pipe-i18n.model.d.ts +0 -5
  994. package/lib/pipes/models/internal/index.d.ts +0 -1
  995. package/lib/pipes/parametrize.pipe.d.ts +0 -13
  996. package/lib/pipes/template.pipe.d.ts +0 -10
  997. package/lib/provide.d.ts +0 -10
  998. package/lib/registry/type.registry.d.ts +0 -25
  999. package/lib/router/index.d.ts +0 -3
  1000. package/lib/router/models/index.d.ts +0 -1
  1001. package/lib/router/models/router.model.d.ts +0 -31
  1002. package/lib/router/route-builder.d.ts +0 -75
  1003. package/lib/router/routes-builder.d.ts +0 -28
  1004. package/lib/router/tableview-route-builder.d.ts +0 -44
  1005. package/lib/security/authorization.guard.d.ts +0 -2
  1006. package/lib/security/authorization.service.d.ts +0 -17
  1007. package/lib/security/authorization.util.d.ts +0 -5
  1008. package/lib/security/index.d.ts +0 -3
  1009. package/lib/security/model/authorization.type.d.ts +0 -6
  1010. package/lib/security/model/index.d.ts +0 -3
  1011. package/lib/security/model/permission-service.interface.d.ts +0 -6
  1012. package/lib/security/model/permissions.model.d.ts +0 -37
  1013. package/lib/services/action/action-executor.service.d.ts +0 -177
  1014. package/lib/services/action/component-action-executor.service.d.ts +0 -9
  1015. package/lib/services/action/index.d.ts +0 -4
  1016. package/lib/services/action/root-action-executor.service.d.ts +0 -9
  1017. package/lib/services/action-error-mapper.service.d.ts +0 -18
  1018. package/lib/services/commons-init.service.d.ts +0 -22
  1019. package/lib/services/commons.service.d.ts +0 -90
  1020. package/lib/services/configuration.service.d.ts +0 -68
  1021. package/lib/services/data-provider-executor.service.d.ts +0 -60
  1022. package/lib/services/index.d.ts +0 -11
  1023. package/lib/services/internal/commons-init.provider.d.ts +0 -4
  1024. package/lib/services/internal/index.d.ts +0 -1
  1025. package/lib/services/log-publisher-console.service.d.ts +0 -4
  1026. package/lib/services/logger.service.d.ts +0 -33
  1027. package/lib/services/mng-localstorage-config.service.d.ts +0 -11
  1028. package/lib/services/navigation.service.d.ts +0 -15
  1029. package/lib/services/providers/formly-config.provider.d.ts +0 -5
  1030. package/lib/services/providers/index.d.ts +0 -1
  1031. package/lib/services/router.service.d.ts +0 -37
  1032. package/lib/services/tokens/browser-storage.token.d.ts +0 -2
  1033. package/lib/services/tokens/commons-init.token.d.ts +0 -3
  1034. package/lib/services/tokens/default-setting.token.d.ts +0 -2
  1035. package/lib/services/tokens/index.d.ts +0 -5
  1036. package/lib/services/tokens/log-publisher.token.d.ts +0 -3
  1037. package/lib/services/tokens/module-config.token.d.ts +0 -3
  1038. package/lib/services/version.service.d.ts +0 -14
  1039. package/lib/services/view/index.d.ts +0 -2
  1040. package/lib/services/view/view-container.service.d.ts +0 -32
  1041. package/lib/styles/button-style.builder.d.ts +0 -68
  1042. package/lib/styles/index.d.ts +0 -2
  1043. package/lib/styles/models/index.d.ts +0 -2
  1044. package/lib/styles/models/style-level.enum.d.ts +0 -10
  1045. package/lib/styles/models/style-size.enum.d.ts +0 -7
  1046. package/lib/styles/styles.util.d.ts +0 -15
  1047. package/lib/types/action-descriptor.types.d.ts +0 -4
  1048. package/lib/types/data-provider.types.d.ts +0 -3
  1049. package/lib/types/getter.type.d.ts +0 -2
  1050. package/lib/types/i18n.type.d.ts +0 -1
  1051. package/lib/types/index.d.ts +0 -7
  1052. package/lib/types/localstorage-config-value.type.d.ts +0 -1
  1053. package/lib/types/type.model.d.ts +0 -31
  1054. package/lib/utils/data-list-params.util.d.ts +0 -84
  1055. package/lib/utils/date.util.d.ts +0 -20
  1056. package/lib/utils/decorator-metadata.util.d.ts +0 -33
  1057. package/lib/utils/editor-formly.util.d.ts +0 -13
  1058. package/lib/utils/enum.util.d.ts +0 -51
  1059. package/lib/utils/error.util.d.ts +0 -116
  1060. package/lib/utils/export.util.d.ts +0 -5
  1061. package/lib/utils/file.util.d.ts +0 -3
  1062. package/lib/utils/i18n.util.d.ts +0 -85
  1063. package/lib/utils/index.d.ts +0 -13
  1064. package/lib/utils/model.util.d.ts +0 -10
  1065. package/lib/utils/notification.util.d.ts +0 -13
  1066. package/lib/utils/object.util.d.ts +0 -30
  1067. package/lib/utils/route.util.d.ts +0 -37
  1068. package/lib/utils/string.util.d.ts +0 -9
  1069. package/lib/utils/tableview.util.d.ts +0 -53
  1070. package/lib/validators/field.validator.d.ts +0 -3
  1071. package/lib/validators/index.d.ts +0 -1
  1072. package/openapi/angular/README.mustache +0 -226
  1073. package/openapi/angular/api.module.mustache +0 -39
  1074. package/openapi/angular/api.service.mustache +0 -253
  1075. package/openapi/angular/apiInterface.mustache +0 -47
  1076. package/openapi/angular/apis.mustache +0 -12
  1077. package/openapi/angular/config.yaml +0 -23
  1078. package/openapi/angular/configuration.mustache +0 -128
  1079. package/openapi/angular/custom/base-api.service.mustache +0 -14
  1080. package/openapi/angular/custom/helpers.mustache +0 -71
  1081. package/openapi/angular/custom/modelSchema.mustache +0 -46
  1082. package/openapi/angular/custom/schema.mustache +0 -18
  1083. package/openapi/angular/encoder.mustache +0 -20
  1084. package/openapi/angular/git_push.sh.mustache +0 -57
  1085. package/openapi/angular/index.mustache +0 -0
  1086. package/openapi/angular/licenseInfo.mustache +0 -11
  1087. package/openapi/angular/model.mustache +0 -16
  1088. package/openapi/angular/modelAlias.mustache +0 -1
  1089. package/openapi/angular/modelEnum.mustache +0 -21
  1090. package/openapi/angular/modelGeneric.mustache +0 -14
  1091. package/openapi/angular/modelGenericAdditionalProperties.mustache +0 -5
  1092. package/openapi/angular/modelGenericEnums.mustache +0 -30
  1093. package/openapi/angular/modelOneOf.mustache +0 -14
  1094. package/openapi/angular/modelTaggedUnion.mustache +0 -21
  1095. package/openapi/angular/models.mustache +0 -5
  1096. package/openapi/angular/ng-package.mustache +0 -6
  1097. package/openapi/angular/package.mustache +0 -39
  1098. package/openapi/angular/param.mustache +0 -69
  1099. package/openapi/angular/tsconfig.mustache +0 -28
  1100. package/openapi/angular/variables.mustache +0 -9
  1101. package/openapi/node/model.mustache +0 -83
  1102. package/openapi/node/models.mustache +0 -6
  1103. package/scss/common/layout/_breadcrumb.scss +0 -99
  1104. package/scss/common/layout/_config.scss +0 -100
  1105. package/scss/common/layout/_dashboard.scss +0 -16
  1106. package/scss/common/layout/_exception.scss +0 -133
  1107. package/scss/common/layout/_footer.scss +0 -29
  1108. package/scss/common/layout/_help.scss +0 -156
  1109. package/scss/common/layout/_inlinemenu.scss +0 -68
  1110. package/scss/common/layout/_invoice.scss +0 -176
  1111. package/scss/common/layout/_landing.scss +0 -636
  1112. package/scss/common/layout/_layout_dark.scss +0 -23
  1113. package/scss/common/layout/_layout_light.scss +0 -23
  1114. package/scss/common/layout/_loader.scss +0 -17
  1115. package/scss/common/layout/_login.scss +0 -106
  1116. package/scss/common/layout/_main.scss +0 -45
  1117. package/scss/common/layout/_mixins.scss +0 -222
  1118. package/scss/common/layout/_rightmenu.scss +0 -130
  1119. package/scss/common/layout/_topbar.scss +0 -191
  1120. package/scss/common/layout/_typography.scss +0 -68
  1121. package/scss/common/layout/_utils.scss +0 -96
  1122. package/scss/common/layout/_widgets.scss +0 -392
  1123. package/scss/common/layout/menu/_menu.scss +0 -7
  1124. package/scss/common/layout/menu/_menu_common.scss +0 -183
  1125. package/scss/common/layout/menu/_menu_overlay.scss +0 -52
  1126. package/scss/common/layout/menu/_menu_sidebar.scss +0 -233
  1127. package/scss/common/layout/menu/_menu_slim.scss +0 -137
  1128. package/scss/common/layout/menu/_menu_static.scss +0 -70
  1129. package/scss/common/layout/menu/_menu_theme.scss +0 -364
  1130. package/scss/common/theme/_theme_dark.scss +0 -5
  1131. package/scss/common/theme/_theme_light.scss +0 -5
  1132. package/scss/common/theme/designer/_colors.scss +0 -17
  1133. package/scss/common/theme/designer/_common.scss +0 -41
  1134. package/scss/common/theme/designer/_components.scss +0 -102
  1135. package/scss/common/theme/designer/_mixins.scss +0 -203
  1136. package/scss/common/theme/designer/components/button/_button.scss +0 -572
  1137. package/scss/common/theme/designer/components/button/_speeddial.scss +0 -81
  1138. package/scss/common/theme/designer/components/button/_splitbutton.scss +0 -2
  1139. package/scss/common/theme/designer/components/data/_carousel.scss +0 -37
  1140. package/scss/common/theme/designer/components/data/_datatable.scss +0 -266
  1141. package/scss/common/theme/designer/components/data/_dataview.scss +0 -55
  1142. package/scss/common/theme/designer/components/data/_filter.scss +0 -137
  1143. package/scss/common/theme/designer/components/data/_fullcalendar.scss +0 -324
  1144. package/scss/common/theme/designer/components/data/_orderlist.scss +0 -91
  1145. package/scss/common/theme/designer/components/data/_organizationchart.scss +0 -50
  1146. package/scss/common/theme/designer/components/data/_paginator.scss +0 -83
  1147. package/scss/common/theme/designer/components/data/_picklist.scss +0 -91
  1148. package/scss/common/theme/designer/components/data/_timeline.scss +0 -35
  1149. package/scss/common/theme/designer/components/data/_tree.scss +0 -144
  1150. package/scss/common/theme/designer/components/data/_treetable.scss +0 -241
  1151. package/scss/common/theme/designer/components/data/_virtualscroller.scss +0 -28
  1152. package/scss/common/theme/designer/components/file/_fileupload.scss +0 -58
  1153. package/scss/common/theme/designer/components/input/_autocomplete.scss +0 -105
  1154. package/scss/common/theme/designer/components/input/_calendar.scss +0 -212
  1155. package/scss/common/theme/designer/components/input/_cascadeselect.scss +0 -98
  1156. package/scss/common/theme/designer/components/input/_checkbox.scss +0 -85
  1157. package/scss/common/theme/designer/components/input/_chips.scss +0 -43
  1158. package/scss/common/theme/designer/components/input/_colorpicker.scss +0 -19
  1159. package/scss/common/theme/designer/components/input/_dropdown.scss +0 -136
  1160. package/scss/common/theme/designer/components/input/_editor.scss +0 -122
  1161. package/scss/common/theme/designer/components/input/_inputgroup.scss +0 -69
  1162. package/scss/common/theme/designer/components/input/_inputmask.scss +0 -3
  1163. package/scss/common/theme/designer/components/input/_inputnumber.scss +0 -3
  1164. package/scss/common/theme/designer/components/input/_inputswitch.scss +0 -60
  1165. package/scss/common/theme/designer/components/input/_inputtext.scss +0 -97
  1166. package/scss/common/theme/designer/components/input/_listbox.scss +0 -82
  1167. package/scss/common/theme/designer/components/input/_multiselect.scss +0 -165
  1168. package/scss/common/theme/designer/components/input/_password.scss +0 -33
  1169. package/scss/common/theme/designer/components/input/_radiobutton.scss +0 -78
  1170. package/scss/common/theme/designer/components/input/_rating.scss +0 -48
  1171. package/scss/common/theme/designer/components/input/_selectbutton.scss +0 -50
  1172. package/scss/common/theme/designer/components/input/_slider.scss +0 -71
  1173. package/scss/common/theme/designer/components/input/_togglebutton.scss +0 -48
  1174. package/scss/common/theme/designer/components/input/_treeselect.scss +0 -91
  1175. package/scss/common/theme/designer/components/menu/_breadcrumb.scss +0 -42
  1176. package/scss/common/theme/designer/components/menu/_contextmenu.scss +0 -51
  1177. package/scss/common/theme/designer/components/menu/_dock.scss +0 -51
  1178. package/scss/common/theme/designer/components/menu/_megamenu.scss +0 -103
  1179. package/scss/common/theme/designer/components/menu/_menu.scss +0 -41
  1180. package/scss/common/theme/designer/components/menu/_menubar.scss +0 -180
  1181. package/scss/common/theme/designer/components/menu/_panelmenu.scss +0 -136
  1182. package/scss/common/theme/designer/components/menu/_slidemenu.scss +0 -56
  1183. package/scss/common/theme/designer/components/menu/_steps.scss +0 -56
  1184. package/scss/common/theme/designer/components/menu/_tabmenu.scss +0 -49
  1185. package/scss/common/theme/designer/components/menu/_tieredmenu.scss +0 -57
  1186. package/scss/common/theme/designer/components/messages/_inlinemessage.scss +0 -64
  1187. package/scss/common/theme/designer/components/messages/_message.scss +0 -102
  1188. package/scss/common/theme/designer/components/messages/_toast.scss +0 -94
  1189. package/scss/common/theme/designer/components/misc/_avatar.scss +0 -30
  1190. package/scss/common/theme/designer/components/misc/_badge.scss +0 -48
  1191. package/scss/common/theme/designer/components/misc/_blockui.scss +0 -3
  1192. package/scss/common/theme/designer/components/misc/_chip.scss +0 -38
  1193. package/scss/common/theme/designer/components/misc/_inplace.scss +0 -16
  1194. package/scss/common/theme/designer/components/misc/_progressbar.scss +0 -17
  1195. package/scss/common/theme/designer/components/misc/_scrolltop.scss +0 -20
  1196. package/scss/common/theme/designer/components/misc/_skeleton.scss +0 -8
  1197. package/scss/common/theme/designer/components/misc/_tag.scss +0 -35
  1198. package/scss/common/theme/designer/components/misc/_terminal.scss +0 -11
  1199. package/scss/common/theme/designer/components/multimedia/_galleria.scss +0 -141
  1200. package/scss/common/theme/designer/components/multimedia/_image.scss +0 -44
  1201. package/scss/common/theme/designer/components/overlay/_confirmpopup.scss +0 -65
  1202. package/scss/common/theme/designer/components/overlay/_dialog.scss +0 -63
  1203. package/scss/common/theme/designer/components/overlay/_overlaypanel.scss +0 -62
  1204. package/scss/common/theme/designer/components/overlay/_sidebar.scss +0 -27
  1205. package/scss/common/theme/designer/components/overlay/_tooltip.scss +0 -33
  1206. package/scss/common/theme/designer/components/panel/_accordion.scss +0 -119
  1207. package/scss/common/theme/designer/components/panel/_card.scss +0 -30
  1208. package/scss/common/theme/designer/components/panel/_divider.scss +0 -31
  1209. package/scss/common/theme/designer/components/panel/_fieldset.scss +0 -47
  1210. package/scss/common/theme/designer/components/panel/_panel.scss +0 -42
  1211. package/scss/common/theme/designer/components/panel/_scrollpanel.scss +0 -6
  1212. package/scss/common/theme/designer/components/panel/_splitter.scss +0 -19
  1213. package/scss/common/theme/designer/components/panel/_tabview.scss +0 -66
  1214. package/scss/common/theme/designer/components/panel/_toolbar.scss +0 -10
  1215. package/scss/common/theme/extensions/_button.scss +0 -111
  1216. package/scss/common/theme/extensions/_calendar.scss +0 -18
  1217. package/scss/common/theme/extensions/_card.scss +0 -6
  1218. package/scss/common/theme/extensions/_carousel.scss +0 -13
  1219. package/scss/common/theme/extensions/_checkbox.scss +0 -10
  1220. package/scss/common/theme/extensions/_contextmenu.scss +0 -16
  1221. package/scss/common/theme/extensions/_datatable.scss +0 -83
  1222. package/scss/common/theme/extensions/_dialog.scss +0 -14
  1223. package/scss/common/theme/extensions/_fieldset.scss +0 -6
  1224. package/scss/common/theme/extensions/_galleria.scss +0 -25
  1225. package/scss/common/theme/extensions/_megamenu.scss +0 -18
  1226. package/scss/common/theme/extensions/_menu.scss +0 -14
  1227. package/scss/common/theme/extensions/_menubar.scss +0 -14
  1228. package/scss/common/theme/extensions/_orderlist.scss +0 -37
  1229. package/scss/common/theme/extensions/_paginator.scss +0 -19
  1230. package/scss/common/theme/extensions/_panelmenu.scss +0 -20
  1231. package/scss/common/theme/extensions/_password.scss +0 -5
  1232. package/scss/common/theme/extensions/_picklist.scss +0 -37
  1233. package/scss/common/theme/extensions/_radiobutton.scss +0 -8
  1234. package/scss/common/theme/extensions/_sidebar.scss +0 -19
  1235. package/scss/common/theme/extensions/_slidemenu.scss +0 -10
  1236. package/scss/common/theme/extensions/_slider.scss +0 -6
  1237. package/scss/common/theme/extensions/_steps.scss +0 -50
  1238. package/scss/common/theme/extensions/_tieredmenu.scss +0 -14
  1239. package/scss/common/theme/extensions/_toast.scss +0 -6
  1240. package/scss/common/theme/extensions/_tree.scss +0 -35
  1241. package/scss/common/theme/extensions/_treetable.scss +0 -35
  1242. package/scss/common/theme/extensions/_vendor_extensions.scss +0 -27
  1243. package/scss/common/variables/layout/_common.scss +0 -12
  1244. package/scss/common/variables/layout/_layout_dark.scss +0 -70
  1245. package/scss/common/variables/layout/_layout_light.scss +0 -70
  1246. package/scss/common/variables/theme/_theme_dark.scss +0 -937
  1247. package/scss/common/variables/theme/_theme_light.scss +0 -936
  1248. package/scss/layout/default/_mng-variables-layout-dark.scss +0 -2
  1249. package/scss/layout/default/_mng-variables-layout-light.scss +0 -2
  1250. package/scss/layout/default/layout-dark.scss +0 -2
  1251. package/scss/layout/default/layout-light.scss +0 -2
  1252. package/scss/mng-commons-dark-v2.scss +0 -9
  1253. package/scss/mng-commons-dark.scss +0 -5
  1254. package/scss/mng-commons-light-v2.scss +0 -9
  1255. package/scss/mng-commons-light.scss +0 -8
  1256. package/scss/mng-overrides/_layout_action.scss +0 -10
  1257. package/scss/mng-overrides/_layout_dialog.scss +0 -91
  1258. package/scss/mng-overrides/_layout_forms.scss +0 -38
  1259. package/scss/mng-overrides/_layout_menu.scss +0 -10
  1260. package/scss/mng-overrides/_layout_radio.scss +0 -3
  1261. package/scss/mng-overrides/_layout_styles.scss +0 -35
  1262. package/scss/mng-overrides/_layout_topbar.scss +0 -21
  1263. package/scss/mng-overrides/_mixins.scss +0 -69
  1264. package/scss/mng-overrides/_theme_autocomplete.scss +0 -29
  1265. package/scss/mng-overrides/_theme_button.scss +0 -61
  1266. package/scss/mng-overrides/_theme_datatable.scss +0 -160
  1267. package/scss/mng-overrides/_theme_datepicker.scss +0 -21
  1268. package/scss/mng-overrides/_theme_dialog.scss +0 -108
  1269. package/scss/mng-overrides/_theme_dropdown.scss +0 -22
  1270. package/scss/mng-overrides/_theme_fileupload.scss +0 -24
  1271. package/scss/mng-overrides/_theme_forms.scss +0 -29
  1272. package/scss/mng-overrides/_theme_image.scss +0 -27
  1273. package/scss/mng-overrides/_theme_input.scss +0 -27
  1274. package/scss/mng-overrides/_theme_menu.scss +0 -5
  1275. package/scss/mng-overrides/_theme_multiselect.scss +0 -20
  1276. package/scss/mng-overrides/_theme_styles.scss +0 -17
  1277. package/scss/mng-overrides/_theme_tableview.scss +0 -79
  1278. package/scss/mng-overrides/_theme_tabview.scss +0 -11
  1279. package/scss/mng-overrides/_theme_toast.scss +0 -3
  1280. package/scss/mng-overrides/_theme_toolbar.scss +0 -5
  1281. package/scss/mng-overrides/_variables.scss +0 -15
  1282. package/scss/theme/default/_mng-variables-theme-dark.scss +0 -11
  1283. package/scss/theme/default/_mng-variables-theme-light.scss +0 -13
  1284. package/scss/theme/default/theme-dark.scss +0 -2
  1285. package/scss/theme/default/theme-light.scss +0 -2
  1286. package/scss/v2/layout/_animation.scss +0 -53
  1287. package/scss/v2/layout/_breadcrumb.scss +0 -97
  1288. package/scss/v2/layout/_config.scss +0 -42
  1289. package/scss/v2/layout/_content.scss +0 -3
  1290. package/scss/v2/layout/_fonts.scss +0 -32
  1291. package/scss/v2/layout/_layout_dark.scss +0 -12
  1292. package/scss/v2/layout/_layout_light.scss +0 -12
  1293. package/scss/v2/layout/_main.scss +0 -54
  1294. package/scss/v2/layout/_profile.scss +0 -10
  1295. package/scss/v2/layout/_responsive.scss +0 -131
  1296. package/scss/v2/layout/_sidebar_drawer.scss +0 -283
  1297. package/scss/v2/layout/_sidebar_horizontal.scss +0 -168
  1298. package/scss/v2/layout/_sidebar_reveal.scss +0 -201
  1299. package/scss/v2/layout/_sidebar_slim.scss +0 -157
  1300. package/scss/v2/layout/_sidebar_slim_plus.scss +0 -167
  1301. package/scss/v2/layout/_sidebar_vertical.scss +0 -176
  1302. package/scss/v2/layout/_topbar.scss +0 -174
  1303. package/scss/v2/layout/_typography.scss +0 -62
  1304. package/scss/v2/layout/_utils.scss +0 -33
  1305. package/scss/v2/layout/layout.scss +0 -24
  1306. package/scss/v2/layout/mng/_mng_layout_footer.scss +0 -39
  1307. package/scss/v2/layout/mng/_mng_layout_menu.scss +0 -10
  1308. package/scss/v2/layout/mng/_mng_layout_styles.scss +0 -3
  1309. package/scss/v2/layout/mng/_mng_layout_topbar.scss +0 -18
  1310. package/scss/v2/layout/preloading.scss +0 -84
  1311. package/scss/v2/theme/extensions/_fullcalendar.scss +0 -328
  1312. package/scss/v2/theme/theme-base/_colors.scss +0 -17
  1313. package/scss/v2/theme/theme-base/_common.scss +0 -76
  1314. package/scss/v2/theme/theme-base/_components.scss +0 -110
  1315. package/scss/v2/theme/theme-base/_mixins.scss +0 -337
  1316. package/scss/v2/theme/theme-base/components/button/_button.scss +0 -576
  1317. package/scss/v2/theme/theme-base/components/button/_speeddial.scss +0 -96
  1318. package/scss/v2/theme/theme-base/components/button/_splitbutton.scss +0 -348
  1319. package/scss/v2/theme/theme-base/components/data/_carousel.scss +0 -37
  1320. package/scss/v2/theme/theme-base/components/data/_datatable.scss +0 -338
  1321. package/scss/v2/theme/theme-base/components/data/_dataview.scss +0 -46
  1322. package/scss/v2/theme/theme-base/components/data/_filter.scss +0 -137
  1323. package/scss/v2/theme/theme-base/components/data/_orderlist.scss +0 -114
  1324. package/scss/v2/theme/theme-base/components/data/_organizationchart.scss +0 -50
  1325. package/scss/v2/theme/theme-base/components/data/_paginator.scss +0 -92
  1326. package/scss/v2/theme/theme-base/components/data/_picklist.scss +0 -114
  1327. package/scss/v2/theme/theme-base/components/data/_timeline.scss +0 -35
  1328. package/scss/v2/theme/theme-base/components/data/_tree.scss +0 -150
  1329. package/scss/v2/theme/theme-base/components/data/_treetable.scss +0 -255
  1330. package/scss/v2/theme/theme-base/components/data/_virtualscroller.scss +0 -28
  1331. package/scss/v2/theme/theme-base/components/file/_fileupload.scss +0 -64
  1332. package/scss/v2/theme/theme-base/components/input/_autocomplete.scss +0 -136
  1333. package/scss/v2/theme/theme-base/components/input/_calendar.scss +0 -267
  1334. package/scss/v2/theme/theme-base/components/input/_cascadeselect.scss +0 -135
  1335. package/scss/v2/theme/theme-base/components/input/_checkbox.scss +0 -94
  1336. package/scss/v2/theme/theme-base/components/input/_chips.scss +0 -65
  1337. package/scss/v2/theme/theme-base/components/input/_colorpicker.scss +0 -19
  1338. package/scss/v2/theme/theme-base/components/input/_dropdown.scss +0 -151
  1339. package/scss/v2/theme/theme-base/components/input/_editor.scss +0 -122
  1340. package/scss/v2/theme/theme-base/components/input/_inputgroup.scss +0 -74
  1341. package/scss/v2/theme/theme-base/components/input/_inputmask.scss +0 -16
  1342. package/scss/v2/theme/theme-base/components/input/_inputnumber.scss +0 -28
  1343. package/scss/v2/theme/theme-base/components/input/_inputswitch.scss +0 -60
  1344. package/scss/v2/theme/theme-base/components/input/_inputtext.scss +0 -100
  1345. package/scss/v2/theme/theme-base/components/input/_listbox.scss +0 -97
  1346. package/scss/v2/theme/theme-base/components/input/_multiselect.scss +0 -177
  1347. package/scss/v2/theme/theme-base/components/input/_password.scss +0 -52
  1348. package/scss/v2/theme/theme-base/components/input/_radiobutton.scss +0 -78
  1349. package/scss/v2/theme/theme-base/components/input/_rating.scss +0 -60
  1350. package/scss/v2/theme/theme-base/components/input/_selectbutton.scss +0 -50
  1351. package/scss/v2/theme/theme-base/components/input/_slider.scss +0 -71
  1352. package/scss/v2/theme/theme-base/components/input/_togglebutton.scss +0 -48
  1353. package/scss/v2/theme/theme-base/components/input/_treeselect.scss +0 -139
  1354. package/scss/v2/theme/theme-base/components/menu/_breadcrumb.scss +0 -42
  1355. package/scss/v2/theme/theme-base/components/menu/_contextmenu.scss +0 -39
  1356. package/scss/v2/theme/theme-base/components/menu/_dock.scss +0 -95
  1357. package/scss/v2/theme/theme-base/components/menu/_megamenu.scss +0 -55
  1358. package/scss/v2/theme/theme-base/components/menu/_menu.scss +0 -37
  1359. package/scss/v2/theme/theme-base/components/menu/_menubar.scss +0 -140
  1360. package/scss/v2/theme/theme-base/components/menu/_panelmenu.scss +0 -153
  1361. package/scss/v2/theme/theme-base/components/menu/_slidemenu.scss +0 -59
  1362. package/scss/v2/theme/theme-base/components/menu/_steps.scss +0 -56
  1363. package/scss/v2/theme/theme-base/components/menu/_tabmenu.scss +0 -73
  1364. package/scss/v2/theme/theme-base/components/menu/_tieredmenu.scss +0 -43
  1365. package/scss/v2/theme/theme-base/components/messages/_inlinemessage.scss +0 -69
  1366. package/scss/v2/theme/theme-base/components/messages/_message.scss +0 -107
  1367. package/scss/v2/theme/theme-base/components/messages/_toast.scss +0 -99
  1368. package/scss/v2/theme/theme-base/components/misc/_avatar.scss +0 -30
  1369. package/scss/v2/theme/theme-base/components/misc/_badge.scss +0 -48
  1370. package/scss/v2/theme/theme-base/components/misc/_blockui.scss +0 -0
  1371. package/scss/v2/theme/theme-base/components/misc/_chip.scss +0 -42
  1372. package/scss/v2/theme/theme-base/components/misc/_inplace.scss +0 -16
  1373. package/scss/v2/theme/theme-base/components/misc/_progressbar.scss +0 -17
  1374. package/scss/v2/theme/theme-base/components/misc/_scrolltop.scss +0 -25
  1375. package/scss/v2/theme/theme-base/components/misc/_skeleton.scss +0 -8
  1376. package/scss/v2/theme/theme-base/components/misc/_tag.scss +0 -40
  1377. package/scss/v2/theme/theme-base/components/misc/_terminal.scss +0 -12
  1378. package/scss/v2/theme/theme-base/components/multimedia/_galleria.scss +0 -155
  1379. package/scss/v2/theme/theme-base/components/multimedia/_image.scss +0 -49
  1380. package/scss/v2/theme/theme-base/components/overlay/_confirmpopup.scss +0 -70
  1381. package/scss/v2/theme/theme-base/components/overlay/_dialog.scss +0 -69
  1382. package/scss/v2/theme/theme-base/components/overlay/_overlaypanel.scss +0 -64
  1383. package/scss/v2/theme/theme-base/components/overlay/_sidebar.scss +0 -27
  1384. package/scss/v2/theme/theme-base/components/overlay/_tooltip.scss +0 -33
  1385. package/scss/v2/theme/theme-base/components/panel/_accordion.scss +0 -119
  1386. package/scss/v2/theme/theme-base/components/panel/_card.scss +0 -30
  1387. package/scss/v2/theme/theme-base/components/panel/_divider.scss +0 -31
  1388. package/scss/v2/theme/theme-base/components/panel/_fieldset.scss +0 -47
  1389. package/scss/v2/theme/theme-base/components/panel/_panel.scss +0 -63
  1390. package/scss/v2/theme/theme-base/components/panel/_scrollpanel.scss +0 -6
  1391. package/scss/v2/theme/theme-base/components/panel/_splitter.scss +0 -19
  1392. package/scss/v2/theme/theme-base/components/panel/_tabview.scss +0 -82
  1393. package/scss/v2/theme/theme-base/components/panel/_toolbar.scss +0 -11
  1394. package/scss/v2/theme/theme-base/mng/_mng_mixins.scss +0 -69
  1395. package/scss/v2/theme/theme-base/mng/_mng_theme_autocomplete.scss +0 -34
  1396. package/scss/v2/theme/theme-base/mng/_mng_theme_button.scss +0 -68
  1397. package/scss/v2/theme/theme-base/mng/_mng_theme_datatable.scss +0 -153
  1398. package/scss/v2/theme/theme-base/mng/_mng_theme_datepicker.scss +0 -21
  1399. package/scss/v2/theme/theme-base/mng/_mng_theme_dialog.scss +0 -206
  1400. package/scss/v2/theme/theme-base/mng/_mng_theme_dropdown.scss +0 -32
  1401. package/scss/v2/theme/theme-base/mng/_mng_theme_fileupload.scss +0 -24
  1402. package/scss/v2/theme/theme-base/mng/_mng_theme_forms.scss +0 -66
  1403. package/scss/v2/theme/theme-base/mng/_mng_theme_image.scss +0 -27
  1404. package/scss/v2/theme/theme-base/mng/_mng_theme_input.scss +0 -31
  1405. package/scss/v2/theme/theme-base/mng/_mng_theme_menu.scss +0 -5
  1406. package/scss/v2/theme/theme-base/mng/_mng_theme_multiselect.scss +0 -20
  1407. package/scss/v2/theme/theme-base/mng/_mng_theme_styles.scss +0 -17
  1408. package/scss/v2/theme/theme-base/mng/_mng_theme_tableview.scss +0 -97
  1409. package/scss/v2/theme/theme-base/mng/_mng_theme_tabview.scss +0 -11
  1410. package/scss/v2/theme/theme-base/mng/_mng_theme_toast.scss +0 -3
  1411. package/scss/v2/theme/theme-base/mng/_mng_theme_toolbar.scss +0 -5
  1412. package/scss/v2/theme/theme-base/mng/_mng_variables.scss +0 -15
  1413. package/scss/v2/theme/theme-dark/_extensions.scss +0 -100
  1414. package/scss/v2/theme/theme-dark/_variables.scss +0 -940
  1415. package/scss/v2/theme/theme-dark/blue/theme.scss +0 -14
  1416. package/scss/v2/theme/theme-light/_extensions.scss +0 -100
  1417. package/scss/v2/theme/theme-light/_variables.scss +0 -936
  1418. package/scss/v2/theme/theme-light/blue/theme.scss +0 -14
  1419. /package/{lib → core}/components/notification/notification-wrapper.component.d.ts +0 -0
  1420. /package/{lib/models → core/data-list}/data-list.model.d.ts +0 -0
  1421. /package/{lib/models → core/data-list}/filter-match.model.d.ts +0 -0
  1422. /package/{lib/models/class.model.d.ts → core/models/class-attribute.model.d.ts} +0 -0
  1423. /package/{lib → core}/models/version.model.d.ts +0 -0
  1424. /package/{lib/types/type.decorator.d.ts → core/reflect/type-enum-decorator.d.ts} +0 -0
  1425. /package/{lib/descriptors/types/filter.type.d.ts → filter/models/filter.model.d.ts} +0 -0
  1426. /package/{lib/descriptors/types/trim.type.d.ts → form/api/models/trim.model.d.ts} +0 -0
  1427. /package/{assets/i18n → i18n}/en.json +0 -0
  1428. /package/{assets/i18n → i18n}/sl.json +0 -0
  1429. /package/{lib/descriptors/table → table/api/descriptors}/sort.descriptor.d.ts +0 -0
  1430. /package/{lib/descriptors/types/column.type.d.ts → table/api/models/column.model.d.ts} +0 -0
  1431. /package/{lib → tableview/action}/models/can-component-deactivate.model.d.ts +0 -0
  1432. /package/{lib/services/action → tableview/action/services/providers}/provide-action-executor.d.ts +0 -0
  1433. /package/{lib/services/view → tableview/action/services/providers}/provide-view-container.d.ts +0 -0
  1434. /package/{lib/components → tableview/api}/action/models/tableview-action-default-categories.model.d.ts +0 -0
  1435. /package/{lib/components/form → tableview/api/editor}/models/form-editor.interface.d.ts +0 -0
  1436. /package/{lib → tableview/api/editor}/models/radio.model.d.ts +0 -0
@@ -0,0 +1,3882 @@
1
+ import * as i0 from '@angular/core';
2
+ import { inject, Directive, computed, signal, Component, ChangeDetectionStrategy, InjectionToken, Injectable, Injector, ElementRef, ApplicationRef, ViewContainerRef, EventEmitter, createComponent, Input, Output, TemplateRef, booleanAttribute, numberAttribute, Pipe, APP_INITIALIZER, ErrorHandler } from '@angular/core';
3
+ import * as i3$1 from '@ngx-translate/core';
4
+ import { TranslateModule, TranslateService } from '@ngx-translate/core';
5
+ import * as i3 from 'primeng/confirmdialog';
6
+ import { ConfirmDialogModule } from 'primeng/confirmdialog';
7
+ import * as i5 from 'primeng/dialog';
8
+ import { Dialog, DialogModule } from 'primeng/dialog';
9
+ import * as i1 from 'primeng/toast';
10
+ import { ToastModule } from 'primeng/toast';
11
+ import { DialogService, DynamicDialogComponent } from 'primeng/dynamicdialog';
12
+ import * as i2 from 'primeng/api';
13
+ import { PrimeNGConfig, FilterService, MessageService, ConfirmationService } from 'primeng/api';
14
+ import * as i1$1 from '@angular/router';
15
+ import { Router, NavigationEnd, RouterLink, NavigationStart, RouteConfigLoadStart, RouteConfigLoadEnd, NavigationCancel, NavigationError } from '@angular/router';
16
+ import * as i2$1 from 'primeng/button';
17
+ import { ButtonModule } from 'primeng/button';
18
+ import { Title } from '@angular/platform-browser';
19
+ import { BehaviorSubject, ReplaySubject, distinctUntilChanged, isObservable, of, mergeMap, combineLatest, Observable, tap, Subject, take, throwError } from 'rxjs';
20
+ import { filter, map, first, catchError } from 'rxjs/operators';
21
+ import { DatePipe } from '@angular/common';
22
+ import { HttpErrorResponse, HttpClient, HttpBackend } from '@angular/common/http';
23
+ import 'reflect-metadata';
24
+
25
+ class DialogKeydownHandlerDirective {
26
+ constructor() {
27
+ this.dialogService = inject(DialogService);
28
+ this.dynamicDialog = inject(DynamicDialogComponent, { optional: true });
29
+ this.dialog = inject(Dialog, { optional: true });
30
+ this.dialogsWithKeydownListener = [];
31
+ }
32
+ ngOnInit() {
33
+ if (!this.dialog && !this.dynamicDialog) {
34
+ // not a dialog, return
35
+ return;
36
+ }
37
+ this.dialogService.dialogComponentRefMap.forEach(v => {
38
+ if ((this.dialog || v.instance !== this.dynamicDialog) && v.instance.documentKeydownListener) {
39
+ // exclude self dynamic dialog
40
+ this.dialogsWithKeydownListener.push(v.instance);
41
+ v.instance.unbindDocumentKeydownListener();
42
+ }
43
+ });
44
+ if (!this.dialog) {
45
+ // if dialog is present, then do not bind (because it will bind on unbind-ed dynamic dialog
46
+ this.dynamicDialog?.bindDocumentKeydownListener();
47
+ }
48
+ }
49
+ ngOnDestroy() {
50
+ if (!this.dialog && !this.dynamicDialog) {
51
+ // not a dialog, return
52
+ return;
53
+ }
54
+ if (!this.dialog) {
55
+ this.dynamicDialog?.unbindDocumentKeydownListener();
56
+ }
57
+ this.dialogsWithKeydownListener.forEach(c => c.bindDocumentKeydownListener());
58
+ }
59
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: DialogKeydownHandlerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
60
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.2", type: DialogKeydownHandlerDirective, isStandalone: true, selector: "[mngDialogKeydownHandler]", ngImport: i0 }); }
61
+ }
62
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: DialogKeydownHandlerDirective, decorators: [{
63
+ type: Directive,
64
+ args: [{
65
+ standalone: true,
66
+ selector: '[mngDialogKeydownHandler]'
67
+ }]
68
+ }] });
69
+
70
+ class NotificationWrapperComponent {
71
+ constructor() {
72
+ this.notificationCutoff = 70;
73
+ this.isDialogNotificationVisible = computed(() => this.dialogNotification() !== null);
74
+ this.dialogNotification = signal(null);
75
+ }
76
+ getNotificationIconClass(message) {
77
+ if (message?.icon)
78
+ return message.icon;
79
+ switch (message?.severity) {
80
+ case 'info':
81
+ return 'pi-info-circle';
82
+ case 'warning':
83
+ return 'pi-exclamation-triangle';
84
+ case 'error':
85
+ return 'pi-times-circle';
86
+ case 'success':
87
+ return 'pi-check';
88
+ default:
89
+ return '';
90
+ }
91
+ }
92
+ onShowNotificationInDialog(message) {
93
+ this.dialogNotification.set(message);
94
+ }
95
+ onDialogNotificationVisibilityChange(visible) {
96
+ if (!visible) {
97
+ this.dialogNotification.set(null);
98
+ }
99
+ }
100
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: NotificationWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
101
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.2", type: NotificationWrapperComponent, isStandalone: true, selector: "mng-notification-wrapper", ngImport: i0, template: "<ng-content></ng-content>\n<p-confirmDialog appendTo=\"body\" [baseZIndex]=\"50\"></p-confirmDialog>\n\n<p-toast [baseZIndex]=\"50\">\n <ng-template let-message pTemplate=\"message\">\n <span [class]=\"'p-toast-message-icon pi ' + getNotificationIconClass(message)\"></span>\n <div class=\"p-toast-message-text\">\n <div class=\"p-toast-summary\">{{ message.summary }}</div>\n <div class=\"p-toast-detail\">{{ message.detail.slice(0, notificationCutoff) + (message.detail.length > notificationCutoff ? '...' : '') }}</div>\n @if (message.detail.length > notificationCutoff) {\n <div (click)=\"onShowNotificationInDialog(message)\" class=\"p-link font-semibold text-sm mt-2 flex align-items-center\">\n <i class=\"pi pi-chevron-down mr-1\"></i>{{ 'notification.details' | translate }}\n </div>\n }\n </div>\n </ng-template>\n</p-toast>\n\n<p-dialog\n [visible]=\"isDialogNotificationVisible()\"\n (visibleChange)=\"onDialogNotificationVisibilityChange($event)\"\n [styleClass]=\"'p-fluid mng-dialog mng-dialog-xs ' + 'mng-message-detail-dialog mng-message-detail-dialog-' + (dialogNotification()?.severity ?? '')\">\n <ng-template pTemplate=\"header\" mngDialogKeydownHandler>\n <span class=\"p-dialog-title font-bold mng-dialog-success\">\n <span [class]=\"'mr-2 pi ' + getNotificationIconClass(dialogNotification())\"></span>\n {{ dialogNotification()?.summary ?? '' }}\n </span>\n </ng-template>\n <div>\n {{ dialogNotification()?.detail ?? '' }}\n </div>\n</p-dialog>\n", dependencies: [{ kind: "ngmodule", type: ToastModule }, { kind: "component", type: i1.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "life", "style", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "breakpoints"], outputs: ["onClose"] }, { kind: "directive", type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "ngmodule", type: ConfirmDialogModule }, { kind: "component", type: i3.ConfirmDialog, selector: "p-confirmDialog", inputs: ["header", "icon", "message", "style", "styleClass", "maskStyleClass", "acceptIcon", "acceptLabel", "closeAriaLabel", "acceptAriaLabel", "acceptVisible", "rejectIcon", "rejectLabel", "rejectAriaLabel", "rejectVisible", "acceptButtonStyleClass", "rejectButtonStyleClass", "closeOnEscape", "dismissableMask", "blockScroll", "rtl", "closable", "appendTo", "key", "autoZIndex", "baseZIndex", "transitionOptions", "focusTrap", "defaultFocus", "breakpoints", "visible", "position"], outputs: ["onHide"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i3$1.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: DialogModule }, { kind: "component", type: i5.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "visible", "style", "position"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "directive", type: DialogKeydownHandlerDirective, selector: "[mngDialogKeydownHandler]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
102
+ }
103
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: NotificationWrapperComponent, decorators: [{
104
+ type: Component,
105
+ args: [{ selector: 'mng-notification-wrapper', standalone: true, imports: [ToastModule, ConfirmDialogModule, TranslateModule, DialogModule, DialogKeydownHandlerDirective], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>\n<p-confirmDialog appendTo=\"body\" [baseZIndex]=\"50\"></p-confirmDialog>\n\n<p-toast [baseZIndex]=\"50\">\n <ng-template let-message pTemplate=\"message\">\n <span [class]=\"'p-toast-message-icon pi ' + getNotificationIconClass(message)\"></span>\n <div class=\"p-toast-message-text\">\n <div class=\"p-toast-summary\">{{ message.summary }}</div>\n <div class=\"p-toast-detail\">{{ message.detail.slice(0, notificationCutoff) + (message.detail.length > notificationCutoff ? '...' : '') }}</div>\n @if (message.detail.length > notificationCutoff) {\n <div (click)=\"onShowNotificationInDialog(message)\" class=\"p-link font-semibold text-sm mt-2 flex align-items-center\">\n <i class=\"pi pi-chevron-down mr-1\"></i>{{ 'notification.details' | translate }}\n </div>\n }\n </div>\n </ng-template>\n</p-toast>\n\n<p-dialog\n [visible]=\"isDialogNotificationVisible()\"\n (visibleChange)=\"onDialogNotificationVisibilityChange($event)\"\n [styleClass]=\"'p-fluid mng-dialog mng-dialog-xs ' + 'mng-message-detail-dialog mng-message-detail-dialog-' + (dialogNotification()?.severity ?? '')\">\n <ng-template pTemplate=\"header\" mngDialogKeydownHandler>\n <span class=\"p-dialog-title font-bold mng-dialog-success\">\n <span [class]=\"'mr-2 pi ' + getNotificationIconClass(dialogNotification())\"></span>\n {{ dialogNotification()?.summary ?? '' }}\n </span>\n </ng-template>\n <div>\n {{ dialogNotification()?.detail ?? '' }}\n </div>\n</p-dialog>\n" }]
106
+ }] });
107
+
108
+ class ACommonsErrorBase extends Error {
109
+ constructor(message, options) {
110
+ super(message);
111
+ this.name = options?.name ?? 'MngError';
112
+ this.messageCode = options?.messageCode;
113
+ this.location = options?.location ?? window?.location?.href;
114
+ this.cause = options?.cause;
115
+ this.stack = options?.stack ?? (options?.cause ? options.cause.stack : new Error(message).stack);
116
+ this.details = options?.details;
117
+ }
118
+ }
119
+ class CommonsInternalError extends ACommonsErrorBase {
120
+ constructor(message, options) {
121
+ super(message, {
122
+ name: 'CommonsInternalError',
123
+ ...options
124
+ });
125
+ this.type = 'CommonsInternalError';
126
+ }
127
+ }
128
+ class CommonsHttpError extends ACommonsErrorBase {
129
+ constructor(message, httpError, options) {
130
+ super(message, {
131
+ name: 'CommonsHttpError_' + httpError.url,
132
+ cause: httpError,
133
+ ...options
134
+ });
135
+ this.type = 'CommonsHttpError';
136
+ this.httpError = httpError;
137
+ }
138
+ }
139
+
140
+ const ngPrimerFormatSupported = [/d{1,2}/g, /E{1,5}/g, /c{1,5}/g, /M{1,5}/g, /L{1,5}/g, /y{1,4}/g, /Y{1,4}/g];
141
+ const ngPrimeFormatOther = [/G{1,5}/g, /w{1,2}/g, /W/g, /a{1,5}/g, /B{1,5}/g, /b{1,5}/g, /h{1,2}/g, /H{1,2}/g, /m{1,2}/g, /s{1,2}/g, /S{1,3}/g, /z{1,4}/g, /Z{1,5}/g, /O{1,4}/g];
142
+ const ngPrimerFormatMap = {
143
+ // days
144
+ d: 'd',
145
+ dd: 'dd',
146
+ E: 'D',
147
+ EE: 'D',
148
+ EEE: 'D',
149
+ EEEE: 'DD',
150
+ EEEEE: 'D',
151
+ EEEEEE: 'D',
152
+ c: 'd',
153
+ cc: 'dd',
154
+ ccc: 'D',
155
+ cccc: 'DD',
156
+ ccccc: 'D',
157
+ cccccc: 'D',
158
+ // months
159
+ M: 'm',
160
+ MM: 'mm',
161
+ MMM: 'M',
162
+ MMMM: 'MM',
163
+ MMMMM: 'M',
164
+ L: 'm',
165
+ LL: 'mm',
166
+ LLL: 'M',
167
+ LLLL: 'MM',
168
+ LLLLL: 'M',
169
+ // year
170
+ y: 'y',
171
+ yy: 'y',
172
+ yyy: 'yy',
173
+ yyyy: 'yy',
174
+ Y: 'y',
175
+ YY: 'y',
176
+ YYY: 'yy',
177
+ YYYY: 'yy'
178
+ };
179
+ function padNumber(num, size = 2) {
180
+ let str = String(num);
181
+ while (str.length < size) {
182
+ str = '0' + str;
183
+ }
184
+ return str;
185
+ }
186
+ function dateToIsoString(value, type = 'date-time', dateTimeOpts = {}) {
187
+ if (typeof value === 'string') {
188
+ value = new Date(value);
189
+ }
190
+ if (typeof value === 'number') {
191
+ value = new Date(value);
192
+ }
193
+ if (!(value instanceof Date)) {
194
+ return null;
195
+ }
196
+ if (type === 'date') {
197
+ // date only, no time part (and timezone, millis, utc does not matter ...)
198
+ return value.getFullYear() + '-' + padNumber(value.getMonth() + 1) + '-' + padNumber(value.getDate());
199
+ }
200
+ if (dateTimeOpts.utc) {
201
+ let str = value.toISOString();
202
+ if (dateTimeOpts.noMillis) {
203
+ const dotIdx = str.lastIndexOf('.');
204
+ str = str.substring(0, dotIdx) + str.substring(dotIdx + 4, str.length);
205
+ }
206
+ if (dateTimeOpts.noTimezone) {
207
+ str = str.substring(0, str.length - 1);
208
+ }
209
+ return str;
210
+ }
211
+ else {
212
+ let base = value.getFullYear() +
213
+ '-' +
214
+ padNumber(value.getMonth() + 1) +
215
+ '-' +
216
+ padNumber(value.getDate()) +
217
+ 'T' +
218
+ padNumber(value.getHours()) +
219
+ ':' +
220
+ padNumber(value.getMinutes()) +
221
+ ':' +
222
+ padNumber(value.getSeconds());
223
+ if (!dateTimeOpts.noMillis) {
224
+ base += '.' + padNumber(value.getMilliseconds());
225
+ }
226
+ if (!dateTimeOpts.noTimezone) {
227
+ const tzo = -value.getTimezoneOffset(), dif = tzo >= 0 ? '+' : '-';
228
+ base = base + (dif + padNumber(Math.floor(Math.abs(tzo) / 60)) + ':' + padNumber(Math.abs(tzo) % 60));
229
+ }
230
+ return base;
231
+ }
232
+ }
233
+ function fromAngularDateFormatToPrime(ngDateFormat) {
234
+ let primeDateFormat = ngDateFormat;
235
+ for (const regex of ngPrimeFormatOther) {
236
+ primeDateFormat = primeDateFormat.replace(regex, ' ');
237
+ }
238
+ for (const regex of ngPrimerFormatSupported) {
239
+ const matches = [...primeDateFormat.matchAll(regex)].reverse();
240
+ for (const match of matches) {
241
+ if (match.index) {
242
+ const matchStr = match[0];
243
+ const replacement = ngPrimerFormatMap[matchStr] ?? match[0];
244
+ primeDateFormat = primeDateFormat.substring(0, match.index) + replacement + primeDateFormat.substring(match.index + matchStr.length);
245
+ }
246
+ }
247
+ }
248
+ primeDateFormat = primeDateFormat.replace(/\s+\W\s+/g, ' ');
249
+ primeDateFormat = primeDateFormat.replace(/\s\s+/g, ' ');
250
+ return primeDateFormat.trim();
251
+ }
252
+ function angularDateFormatHasTime(ngDateFormat) {
253
+ return /[hHmsS]/.test(ngDateFormat);
254
+ }
255
+ function angularDateFormatHasSeconds(ngDateFormat) {
256
+ return /[sS]/.test(ngDateFormat);
257
+ }
258
+
259
+ var LogLevelEnum;
260
+ (function (LogLevelEnum) {
261
+ LogLevelEnum[LogLevelEnum["Trace"] = 0] = "Trace";
262
+ LogLevelEnum[LogLevelEnum["Debug"] = 1] = "Debug";
263
+ LogLevelEnum[LogLevelEnum["Log"] = 2] = "Log";
264
+ LogLevelEnum[LogLevelEnum["Info"] = 3] = "Info";
265
+ LogLevelEnum[LogLevelEnum["Warning"] = 4] = "Warning";
266
+ LogLevelEnum[LogLevelEnum["Error"] = 5] = "Error";
267
+ })(LogLevelEnum || (LogLevelEnum = {}));
268
+
269
+ class LoggerService {
270
+ static { this._instance = new LoggerService(); }
271
+ static { this._isInit = false; }
272
+ static { this._publishers = []; }
273
+ static { this._entriesBuffer = []; }
274
+ static { this._categoryInstances = {}; }
275
+ static { this._timestampFormat = 'yyyy-MM-dd HH:mm:ss.SSS'; }
276
+ constructor() {
277
+ // Temporary settings that cover logging calls before initialisation
278
+ this.defaultLogLevel = LogLevelEnum.Info;
279
+ this.datePipe = new DatePipe('en-US');
280
+ // empty
281
+ }
282
+ static get() {
283
+ return LoggerService._instance;
284
+ }
285
+ static configure(config) {
286
+ if (config.timestampFormat) {
287
+ LoggerService._timestampFormat = config.timestampFormat;
288
+ }
289
+ }
290
+ static init(configurationService, publishers) {
291
+ if (LoggerService._isInit) {
292
+ return;
293
+ }
294
+ LoggerService._configurationService = configurationService;
295
+ LoggerService._publishers = publishers;
296
+ LoggerService._isInit = true;
297
+ LoggerService._flushBuffer();
298
+ }
299
+ static _flushBuffer() {
300
+ if (!LoggerService._isInit) {
301
+ return;
302
+ }
303
+ LoggerService._entriesBuffer.forEach(e => this._instance._log(e));
304
+ LoggerService._entriesBuffer = [];
305
+ }
306
+ static create(category) {
307
+ return LoggerService._instance.create(category);
308
+ }
309
+ create(category) {
310
+ if (this.category) {
311
+ throw new CommonsInternalError(`Cannot create logger with category inside another category (${this.category}). Must create logger on root.`);
312
+ }
313
+ if (LoggerService._categoryInstances[category]) {
314
+ return LoggerService._categoryInstances[category];
315
+ }
316
+ const logger = new LoggerService();
317
+ logger.category = category;
318
+ LoggerService._categoryInstances[category] = logger;
319
+ return logger;
320
+ }
321
+ _processLog(msgOrError, logLevel, category = undefined, data) {
322
+ const [timestamp, timestampFormatted] = [...this._getTimestamps()];
323
+ const logEntry = {
324
+ level: logLevel,
325
+ message: typeof msgOrError === 'string' ? msgOrError : msgOrError.message,
326
+ data: data,
327
+ category: this.category ?? category,
328
+ timestamp: timestamp,
329
+ timestampFormatted: timestampFormatted ?? undefined
330
+ };
331
+ if (msgOrError instanceof Error) {
332
+ // set error from message param
333
+ logEntry.error = msgOrError;
334
+ }
335
+ else if (data?.length && data[0] instanceof Error) {
336
+ // if first data is error, also consider as error
337
+ logEntry.error = data[0];
338
+ logEntry.data = data.splice(1);
339
+ }
340
+ this._log(logEntry);
341
+ }
342
+ _getTimestamps() {
343
+ const timestamp = new Date();
344
+ const timestampFormatted = this.datePipe.transform(timestamp, LoggerService._timestampFormat) ?? dateToIsoString(timestamp);
345
+ return [timestamp, timestampFormatted];
346
+ }
347
+ _log(log) {
348
+ if (!LoggerService._isInit) {
349
+ // add to buffer
350
+ LoggerService._entriesBuffer.push(log);
351
+ return;
352
+ }
353
+ const logConfig = (LoggerService._configurationService?.getConfigValue)?.('log');
354
+ if ((this.category && log.level < (logConfig?.category?.[this.category]?.level ?? logConfig?.level ?? this.defaultLogLevel)) ||
355
+ (!this.category && log.level < (logConfig?.level ?? this.defaultLogLevel))) {
356
+ return;
357
+ }
358
+ if (logConfig?.timestampFormat) {
359
+ log.timestampFormatted = this.datePipe.transform(log.timestamp, logConfig.timestampFormat) ?? undefined;
360
+ }
361
+ LoggerService._publishers.forEach(p => p.addEntry(log));
362
+ }
363
+ trace(msgOrError, ...data) {
364
+ this._processLog(msgOrError, LogLevelEnum.Trace, undefined, data);
365
+ }
366
+ debug(msgOrError, ...data) {
367
+ this._processLog(msgOrError, LogLevelEnum.Debug, undefined, data);
368
+ }
369
+ log(msgOrError, logLevel = LogLevelEnum.Log, category = undefined, ...data) {
370
+ this._processLog(msgOrError, logLevel, category, data);
371
+ }
372
+ logEntry(logEntry) {
373
+ const [timestamp, timestampFormatted] = [...this._getTimestamps()];
374
+ const logEntryFinal = {
375
+ timestamp: timestamp,
376
+ timestampFormatted: timestampFormatted ?? undefined,
377
+ category: this.category ?? logEntry.category,
378
+ message: '',
379
+ messageDetails: logEntry.messageDetails,
380
+ level: LogLevelEnum.Log,
381
+ ...logEntry
382
+ };
383
+ this._log(logEntryFinal);
384
+ }
385
+ info(msgOrError, ...data) {
386
+ this._processLog(msgOrError, LogLevelEnum.Info, undefined, data);
387
+ }
388
+ warn(msgOrError, ...data) {
389
+ this._processLog(msgOrError, LogLevelEnum.Warning, undefined, data);
390
+ }
391
+ error(msgOrError, ...data) {
392
+ this._processLog(msgOrError, LogLevelEnum.Error, undefined, data);
393
+ }
394
+ }
395
+
396
+ const BROWSER_STORAGE_IT = new InjectionToken('BROWSER_STORAGE');
397
+
398
+ const COMMONS_MODULE_CONFIG_IT = new InjectionToken('COMMONS_MODULE_CONFIG');
399
+
400
+ class CommonsService {
401
+ constructor() {
402
+ // internal
403
+ this.logger = inject(LoggerService).create('CommonsService');
404
+ this.router = inject(Router);
405
+ this.primengConfig = inject(PrimeNGConfig);
406
+ this.translate = inject(TranslateService);
407
+ this.titleService = inject(Title);
408
+ this.filterService = inject(FilterService);
409
+ this.moduleConfig = inject(COMMONS_MODULE_CONFIG_IT, { optional: true });
410
+ this.localStorage = inject(BROWSER_STORAGE_IT);
411
+ // breadcrumbs
412
+ this.breadcrumbHomeSubject = new BehaviorSubject({
413
+ icon: 'pi pi-home',
414
+ routerLink: '/'
415
+ });
416
+ this.breadcrumbsSubject = new BehaviorSubject([]);
417
+ // visual
418
+ this._colorScheme = 'light';
419
+ this.userSubject = new ReplaySubject(1);
420
+ this._userRoles = [];
421
+ this.userRolesSubject = new BehaviorSubject([]);
422
+ // language
423
+ this.languageSubject = new ReplaySubject(1);
424
+ this.dataLanguageSubject = new ReplaySubject(1);
425
+ }
426
+ // APP section
427
+ get appName() {
428
+ return this.moduleConfig?.app?.name ?? 'app.name';
429
+ }
430
+ get appOwner() {
431
+ return this.moduleConfig?.app?.owner ?? 'app.owner';
432
+ }
433
+ get appLogoLight() {
434
+ return this.moduleConfig?.app?.logoPathLight ? this.moduleConfig.app.logoPathLight : this.moduleConfig?.app?.logoPath ?? 'assets/layout/images/logo.png';
435
+ }
436
+ get appLogoDark() {
437
+ return this.moduleConfig?.app?.logoPathDark ? this.moduleConfig.app.logoPathDark : this.moduleConfig?.app?.logoPath ?? 'assets/layout/images/logo.png';
438
+ }
439
+ get appLogoNameLight() {
440
+ return this.moduleConfig?.app?.logoNamePathLight
441
+ ? this.moduleConfig.app.logoNamePathLight
442
+ : this.moduleConfig?.app?.logoNamePath ?? 'assets/layout/images/logo-appname.png';
443
+ }
444
+ get appLogoNameDark() {
445
+ return this.moduleConfig?.app?.logoNamePathDark ? this.moduleConfig.app.logoNamePathDark : this.moduleConfig?.app?.logoNamePath ?? 'assets/layout/images/logo-appname.png';
446
+ }
447
+ get appLanguages() {
448
+ return this.moduleConfig?.app?.languages ?? ['en'];
449
+ }
450
+ get appLanguage() {
451
+ const lsLang = this.localStorage.getItem('lang');
452
+ if (lsLang && this.appLanguages.some(l => l === lsLang)) {
453
+ return lsLang;
454
+ }
455
+ return null;
456
+ }
457
+ set appLanguage(language) {
458
+ if (language === null) {
459
+ this.localStorage.removeItem('lang');
460
+ this.languageSubject.next(language);
461
+ return;
462
+ }
463
+ if (this.appLanguages.some(l => l === language)) {
464
+ this.localStorage.setItem('lang', language);
465
+ this.languageSubject.next(language);
466
+ this.translate.use(language);
467
+ }
468
+ }
469
+ get appLanguage$() {
470
+ return this.languageSubject.asObservable().pipe(distinctUntilChanged());
471
+ }
472
+ initLanguage() {
473
+ const browserLang = this.translate.getBrowserLang();
474
+ if (browserLang && this.appLanguages.some(l => l === browserLang)) {
475
+ this.appLanguage = browserLang;
476
+ return browserLang;
477
+ }
478
+ const defaultLanguage = this.appLanguages?.length > 0 ? this.appLanguages[0] : 'en';
479
+ this.appLanguage = defaultLanguage;
480
+ return defaultLanguage;
481
+ }
482
+ getOrInitLanguage() {
483
+ return this.appLanguage || this.initLanguage();
484
+ }
485
+ get appDataLanguages() {
486
+ return this.moduleConfig?.app?.dataLanguages ?? ['en'];
487
+ }
488
+ get appDataLanguageDefault() {
489
+ return this.appDataLanguages[0];
490
+ }
491
+ get appDataLanguage() {
492
+ const dataLang = this.localStorage.getItem('dataLang');
493
+ if (dataLang && this.appDataLanguages.some(dl => dl === dataLang)) {
494
+ return dataLang;
495
+ }
496
+ return this.defaultDataLanguage;
497
+ }
498
+ set appDataLanguage(dataLanguage) {
499
+ if (dataLanguage === null) {
500
+ this.localStorage.removeItem('dataLang');
501
+ this.dataLanguageSubject.next(dataLanguage);
502
+ return;
503
+ }
504
+ if (this.appDataLanguages.some(dl => dl === dataLanguage)) {
505
+ this.localStorage.setItem('dataLang', dataLanguage);
506
+ this.dataLanguageSubject.next(dataLanguage);
507
+ }
508
+ }
509
+ get appDataLanguage$() {
510
+ return this.dataLanguageSubject.asObservable().pipe(distinctUntilChanged());
511
+ }
512
+ // We assume, that default data language is the first one from the array of all available data languages
513
+ get defaultDataLanguage() {
514
+ return this.appDataLanguages[0];
515
+ }
516
+ get appVersion() {
517
+ return this.moduleConfig?.app?.version;
518
+ }
519
+ // BREADCRUMB section
520
+ get breadcrumbHome$() {
521
+ return this.breadcrumbHomeSubject.asObservable();
522
+ }
523
+ get breadcrumbs$() {
524
+ return this.breadcrumbsSubject.asObservable();
525
+ }
526
+ // VISUAL section
527
+ get colorSchemeIsLight() {
528
+ return this._colorScheme === 'light';
529
+ }
530
+ get colorSchemeIsDark() {
531
+ return this._colorScheme === 'dark';
532
+ }
533
+ // USER section
534
+ get user() {
535
+ return this._user;
536
+ }
537
+ set user(user) {
538
+ this._user = user;
539
+ this.userSubject.next(user);
540
+ }
541
+ get user$() {
542
+ return this.userSubject.asObservable();
543
+ }
544
+ get userRoles() {
545
+ return this._userRoles;
546
+ }
547
+ set userRoles(roles) {
548
+ this._userRoles = roles;
549
+ this.userRolesSubject.next(roles);
550
+ }
551
+ get userRoles$() {
552
+ return this.userRolesSubject.asObservable();
553
+ }
554
+ reset() {
555
+ // visual
556
+ this._colorScheme = this.moduleConfig?.app?.colorScheme ?? 'light';
557
+ // ripple
558
+ this.primengConfig.ripple = true;
559
+ // translate
560
+ this.translate.langs = this.appLanguages;
561
+ const lang = this.getOrInitLanguage();
562
+ this.languageSubject.next(lang);
563
+ this.dataLanguageSubject.next(this.appDataLanguage);
564
+ this.translate.use(lang);
565
+ this.translate.get('mngPrime').subscribe(value => this.primengConfig.setTranslation(value));
566
+ this.routerEventsSubscription?.unsubscribe();
567
+ this.routerEventsSubscription = this.router.events
568
+ .pipe(
569
+ // Filter the NavigationEnd events as the breadcrumb is updated only when the route reaches its end
570
+ filter(event => event instanceof NavigationEnd))
571
+ .subscribe(() => {
572
+ this.updateBreadcrumbs();
573
+ this.setPageTitle();
574
+ });
575
+ this.translateLangChangeSubscription?.unsubscribe();
576
+ this.translateLangChangeSubscription = this.translate.onLangChange.subscribe(() => {
577
+ this.updateBreadcrumbs();
578
+ this.setPageTitle();
579
+ });
580
+ this.logger.debug('Reset');
581
+ }
582
+ // BREADCRUMB actions
583
+ findBreadcrumbItem(item) {
584
+ const items = this.breadcrumbsSubject.value;
585
+ if (item.id) {
586
+ return items.find(i => i.id && i.id === item.id) ?? null;
587
+ }
588
+ else if (item.routerLink) {
589
+ const routerLinkStr = Array.isArray(item.routerLink) ? item.routerLink.join('/') : item.routerLink;
590
+ return items.find(i => i.routerLink && (Array.isArray(i.routerLink) ? i.routerLink.join('/') : i.routerLink) === routerLinkStr) ?? null;
591
+ }
592
+ else if (item.positionIndex) {
593
+ return items.find(i => i.positionIndex && i.positionIndex === i.positionIndex) ?? null;
594
+ }
595
+ else if (item.label) {
596
+ return items.find(i => i.label && i.label === i.label) ?? null;
597
+ }
598
+ else if (item.icon) {
599
+ return items.find(i => i.icon && i.icon === i.icon) ?? null;
600
+ }
601
+ return null;
602
+ }
603
+ updateBreadcrumbItem(item) {
604
+ const items = [...this.breadcrumbsSubject.value];
605
+ let posIdx = -1;
606
+ if (item.id) {
607
+ posIdx = items.findIndex(i => i.id && i.id === item.id);
608
+ }
609
+ else if (item.routerLink) {
610
+ const routerLinkStr = Array.isArray(item.routerLink) ? item.routerLink.join('/') : item.routerLink;
611
+ posIdx = items.findIndex(i => i.routerLink && (Array.isArray(i.routerLink) ? i.routerLink.join('/') : i.routerLink) === routerLinkStr);
612
+ }
613
+ else if (item.positionIndex) {
614
+ posIdx = items.findIndex(i => i.positionIndex && i.positionIndex === i.positionIndex);
615
+ }
616
+ else if (item.label) {
617
+ posIdx = items.findIndex(i => i.label && i.label === i.label);
618
+ }
619
+ else if (item.icon) {
620
+ posIdx = items.findIndex(i => i.icon && i.icon === i.icon);
621
+ }
622
+ if (posIdx < 0) {
623
+ return false;
624
+ }
625
+ items[posIdx] = {
626
+ ...items[posIdx],
627
+ ...item,
628
+ updated: true
629
+ };
630
+ this.breadcrumbsSubject.next(items);
631
+ return true;
632
+ }
633
+ updateBreadcrumbs() {
634
+ if (this.breadcrumbsTranslateSubscription) {
635
+ this.breadcrumbsTranslateSubscription.unsubscribe();
636
+ this.breadcrumbsTranslateSubscription = undefined;
637
+ }
638
+ if (this.breadcrumbHomeTranslateSubscription) {
639
+ this.breadcrumbHomeTranslateSubscription.unsubscribe();
640
+ this.breadcrumbHomeTranslateSubscription = undefined;
641
+ }
642
+ const rootRoute = this.router.routerState.snapshot.root;
643
+ const homeBreadcrumb = this.generateHomeBreadcrumb(rootRoute);
644
+ if (homeBreadcrumb) {
645
+ if (homeBreadcrumb.label) {
646
+ this.breadcrumbHomeTranslateSubscription = this.translate.get(homeBreadcrumb.label).subscribe(i18n => {
647
+ homeBreadcrumb.label = i18n;
648
+ this.breadcrumbHomeSubject.next(homeBreadcrumb);
649
+ });
650
+ }
651
+ else {
652
+ this.breadcrumbHomeSubject.next(homeBreadcrumb);
653
+ }
654
+ }
655
+ const breadcrumbs = [];
656
+ this.generateBreadcrumbs(rootRoute, [], breadcrumbs);
657
+ breadcrumbs.forEach((b, idx) => {
658
+ b.positionIndex = idx;
659
+ });
660
+ const i18nKeys = breadcrumbs.filter(b => typeof b.label === 'string').map(b => b.label);
661
+ if (i18nKeys.length > 0) {
662
+ this.breadcrumbsTranslateSubscription = this.translate.get(i18nKeys).subscribe(i18n => {
663
+ // Construct the breadcrumb hierarchy
664
+ breadcrumbs.forEach(b => {
665
+ if (b.label && i18n[b.label]) {
666
+ b.label = i18n[b.label];
667
+ }
668
+ });
669
+ // Emit the new breadcrumbs
670
+ this.breadcrumbsSubject.next(breadcrumbs);
671
+ });
672
+ }
673
+ else {
674
+ this.breadcrumbsSubject.next(breadcrumbs);
675
+ }
676
+ }
677
+ generateHomeBreadcrumb(route) {
678
+ if (!route) {
679
+ return null;
680
+ }
681
+ const routeData = route.data;
682
+ const breadcrumbRouteData = routeData?.breadcrumb;
683
+ if (breadcrumbRouteData && typeof breadcrumbRouteData === 'object' && 'isHome' in breadcrumbRouteData) {
684
+ if (breadcrumbRouteData.isHome === false) {
685
+ return null;
686
+ }
687
+ const breadcrumb = this.createBreadcrumb('/', breadcrumbRouteData, true);
688
+ if (breadcrumb) {
689
+ if (typeof breadcrumb.icon === 'undefined') {
690
+ breadcrumb.icon = 'pi pi-home';
691
+ }
692
+ return breadcrumb;
693
+ }
694
+ }
695
+ else {
696
+ return this.generateHomeBreadcrumb(route.firstChild);
697
+ }
698
+ return null;
699
+ }
700
+ generateBreadcrumbs(route, parentUrlSegments, breadcrumbs) {
701
+ if (!route) {
702
+ return;
703
+ }
704
+ const routeData = route.data;
705
+ const routeUrlSegments = parentUrlSegments.concat(route.url.map(url => url.path));
706
+ const routeUrl = `/${routeUrlSegments.join('/')}`;
707
+ if (routeData?.breadcrumb) {
708
+ const breadcrumbRouteData = routeData.breadcrumb;
709
+ if (Array.isArray(breadcrumbRouteData)) {
710
+ for (const breadcrumbRouteDataItem of breadcrumbRouteData) {
711
+ const breadcrumb = this.createBreadcrumb(routeUrl, breadcrumbRouteDataItem);
712
+ if (breadcrumb) {
713
+ breadcrumbs.push(breadcrumb);
714
+ }
715
+ }
716
+ }
717
+ else if (typeof breadcrumbRouteData === 'function') {
718
+ breadcrumbs.push(...breadcrumbRouteData(routeUrl, route));
719
+ }
720
+ else {
721
+ const breadcrumb = this.createBreadcrumb(routeUrl, breadcrumbRouteData);
722
+ if (breadcrumb) {
723
+ breadcrumbs.push(breadcrumb);
724
+ }
725
+ }
726
+ }
727
+ this.generateBreadcrumbs(route.firstChild, routeUrlSegments, breadcrumbs);
728
+ }
729
+ createBreadcrumb(routeUrl, routeBreadcrumb, includeHome = false) {
730
+ const existingBreadcrumb = this.findBreadcrumbItem({ routerLink: routeUrl });
731
+ if (existingBreadcrumb?.updated) {
732
+ return existingBreadcrumb;
733
+ }
734
+ if (typeof routeBreadcrumb === 'string') {
735
+ // check for updated existing breadcrumb
736
+ return {
737
+ id: routeUrl,
738
+ label: routeBreadcrumb,
739
+ routerLink: routeUrl
740
+ };
741
+ }
742
+ else {
743
+ if (!includeHome && typeof routeBreadcrumb.isHome !== 'undefined') {
744
+ // home should not be included
745
+ return null;
746
+ }
747
+ if (typeof routeBreadcrumb.routerLink === 'undefined') {
748
+ routeBreadcrumb.routerLink = routeUrl;
749
+ }
750
+ routeBreadcrumb.id = routeUrl;
751
+ return routeBreadcrumb;
752
+ }
753
+ }
754
+ // TITLE section
755
+ setPageTitle(title) {
756
+ let currentRoute = this.router.routerState.snapshot.root;
757
+ while (currentRoute.firstChild) {
758
+ currentRoute = currentRoute.firstChild;
759
+ }
760
+ const routeData = currentRoute.data;
761
+ const pageTitle = title ?? routeData.pageTitle;
762
+ this.titleService.setTitle(this.formatPageTitle(pageTitle));
763
+ }
764
+ formatPageTitle(titlePrefix) {
765
+ const titlePieces = [];
766
+ if (titlePrefix) {
767
+ titlePieces.push(this.translate.instant(titlePrefix));
768
+ }
769
+ titlePieces.push(this.translate.instant('app.name'));
770
+ return titlePieces.join(' - ');
771
+ }
772
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: CommonsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
773
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: CommonsService }); }
774
+ }
775
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: CommonsService, decorators: [{
776
+ type: Injectable
777
+ }] });
778
+
779
+ class ErrorPageComponent {
780
+ constructor(commons) {
781
+ this.commons = commons;
782
+ }
783
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: ErrorPageComponent, deps: [{ token: CommonsService }], target: i0.ɵɵFactoryTarget.Component }); }
784
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.2", type: ErrorPageComponent, isStandalone: true, selector: "mng-error-page", ngImport: i0, template: "<div [class]=\"'exception-body min-h-screen ' + (commons.colorSchemeIsLight ? 'layout-light' : 'layout-dark')\">\n <div class=\"exception-container min-h-screen flex align-items-center justify-content-center flex-column bg-auto md:bg-contain bg-no-repeat\">\n <div class=\"exception-panel text-center flex align-items-center justify-content-center flex-column\">\n <h1 class=\"text-red-400 mb-0\">{{ 'pages.notFound.title' | translate }}</h1>\n <h3 class=\"text-red-300\">{{ 'pages.notFound.subtitle' | translate }}</h3>\n <button type=\"button\" pButton [label]=\"'general.returnHome' | translate\" [routerLink]=\"['/']\"></button>\n </div>\n <div class=\"exception-footer align-items-center flex\">\n <img [src]=\"commons.colorSchemeIsLight ? commons.appLogoDark : commons.appLogoLight\" class=\"exception-logo\" alt=\"App logo\" />\n <img [src]=\"commons.colorSchemeIsLight ? commons.appLogoNameDark : commons.appLogoNameLight\" class=\"exception-appname ml-3\" alt=\"App name\" />\n </div>\n </div>\n</div>\n", styles: [".exception-body{background:var(--surface-ground)}.exception-body .exception-container{background:var(--exception-pages-image);background-repeat:no-repeat;background-size:contain;box-sizing:border-box}.exception-body .exception-container .exception-panel{box-sizing:border-box;flex-grow:1;margin-top:3rem;margin-bottom:3rem}.exception-body .exception-container .exception-panel h1{font-size:140px;font-weight:900;text-shadow:0 0 50px rgba(252,97,97,.2)}.exception-body .exception-container .exception-panel h3{font-size:80px;font-weight:900;margin-top:-90px;margin-bottom:50px}.exception-body .exception-container .exception-panel button{margin-top:50px}.exception-body .exception-container .exception-footer{margin-bottom:2rem}.exception-body .exception-container .exception-footer .exception-logo{width:34px}.exception-body .exception-container .exception-footer .exception-appname{width:72px}\n"], dependencies: [{ kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i2$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i3$1.TranslatePipe, name: "translate" }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
785
+ }
786
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: ErrorPageComponent, decorators: [{
787
+ type: Component,
788
+ args: [{ standalone: true, selector: 'mng-error-page', imports: [ButtonModule, TranslateModule, RouterLink], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [class]=\"'exception-body min-h-screen ' + (commons.colorSchemeIsLight ? 'layout-light' : 'layout-dark')\">\n <div class=\"exception-container min-h-screen flex align-items-center justify-content-center flex-column bg-auto md:bg-contain bg-no-repeat\">\n <div class=\"exception-panel text-center flex align-items-center justify-content-center flex-column\">\n <h1 class=\"text-red-400 mb-0\">{{ 'pages.notFound.title' | translate }}</h1>\n <h3 class=\"text-red-300\">{{ 'pages.notFound.subtitle' | translate }}</h3>\n <button type=\"button\" pButton [label]=\"'general.returnHome' | translate\" [routerLink]=\"['/']\"></button>\n </div>\n <div class=\"exception-footer align-items-center flex\">\n <img [src]=\"commons.colorSchemeIsLight ? commons.appLogoDark : commons.appLogoLight\" class=\"exception-logo\" alt=\"App logo\" />\n <img [src]=\"commons.colorSchemeIsLight ? commons.appLogoNameDark : commons.appLogoNameLight\" class=\"exception-appname ml-3\" alt=\"App name\" />\n </div>\n </div>\n</div>\n", styles: [".exception-body{background:var(--surface-ground)}.exception-body .exception-container{background:var(--exception-pages-image);background-repeat:no-repeat;background-size:contain;box-sizing:border-box}.exception-body .exception-container .exception-panel{box-sizing:border-box;flex-grow:1;margin-top:3rem;margin-bottom:3rem}.exception-body .exception-container .exception-panel h1{font-size:140px;font-weight:900;text-shadow:0 0 50px rgba(252,97,97,.2)}.exception-body .exception-container .exception-panel h3{font-size:80px;font-weight:900;margin-top:-90px;margin-bottom:50px}.exception-body .exception-container .exception-panel button{margin-top:50px}.exception-body .exception-container .exception-footer{margin-bottom:2rem}.exception-body .exception-container .exception-footer .exception-logo{width:34px}.exception-body .exception-container .exception-footer .exception-appname{width:72px}\n"] }]
789
+ }], ctorParameters: () => [{ type: CommonsService }] });
790
+
791
+ class NotFoundPageComponent {
792
+ constructor(commons) {
793
+ this.commons = commons;
794
+ }
795
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: NotFoundPageComponent, deps: [{ token: CommonsService }], target: i0.ɵɵFactoryTarget.Component }); }
796
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.2", type: NotFoundPageComponent, isStandalone: true, selector: "mng-not-found-page", ngImport: i0, template: "<div [class]=\"'exception-body min-h-screen ' + (commons.colorSchemeIsLight ? 'layout-light' : 'layout-dark')\">\n <div class=\"exception-container min-h-screen flex align-items-center justify-content-center flex-column bg-auto md:bg-contain bg-no-repeat\">\n <div class=\"exception-panel text-center flex align-items-center justify-content-center flex-column\">\n <h1 class=\"text-red-400 mb-0\">{{ 'pages.notFound.title' | translate }}</h1>\n <h3 class=\"text-red-300\">{{ 'pages.notFound.subtitle' | translate }}</h3>\n <p>{{ 'pages.notFound.message' | translate }}</p>\n <button type=\"button\" pButton [label]=\"'general.returnHome' | translate\" [routerLink]=\"['/']\"></button>\n </div>\n <div class=\"exception-footer align-items-center flex\">\n <img [src]=\"commons.colorSchemeIsLight ? commons.appLogoDark : commons.appLogoLight\" class=\"exception-logo\" alt=\"App logo\" />\n <img [src]=\"commons.colorSchemeIsLight ? commons.appLogoNameDark : commons.appLogoNameLight\" class=\"exception-appname ml-3\" alt=\"App name\" />\n </div>\n </div>\n</div>\n", styles: [".exception-body{background:var(--surface-ground)}.exception-body .exception-container{background:var(--exception-pages-image);background-repeat:no-repeat;background-size:contain;box-sizing:border-box}.exception-body .exception-container .exception-panel{box-sizing:border-box;flex-grow:1;margin-top:3rem;margin-bottom:3rem}.exception-body .exception-container .exception-panel h1{font-size:140px;font-weight:900;text-shadow:0 0 50px rgba(252,97,97,.2)}.exception-body .exception-container .exception-panel h3{font-size:80px;font-weight:900;margin-top:-90px;margin-bottom:50px}.exception-body .exception-container .exception-panel p{font-size:24px;font-weight:400;max-width:320px}.exception-body .exception-container .exception-panel button{margin-top:50px}.exception-body .exception-container .exception-footer{margin-bottom:2rem}.exception-body .exception-container .exception-footer .exception-logo{width:34px}.exception-body .exception-container .exception-footer .exception-appname{width:72px}\n"], dependencies: [{ kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i2$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i3$1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
797
+ }
798
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: NotFoundPageComponent, decorators: [{
799
+ type: Component,
800
+ args: [{ standalone: true, selector: 'mng-not-found-page', imports: [ButtonModule, RouterLink, TranslateModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [class]=\"'exception-body min-h-screen ' + (commons.colorSchemeIsLight ? 'layout-light' : 'layout-dark')\">\n <div class=\"exception-container min-h-screen flex align-items-center justify-content-center flex-column bg-auto md:bg-contain bg-no-repeat\">\n <div class=\"exception-panel text-center flex align-items-center justify-content-center flex-column\">\n <h1 class=\"text-red-400 mb-0\">{{ 'pages.notFound.title' | translate }}</h1>\n <h3 class=\"text-red-300\">{{ 'pages.notFound.subtitle' | translate }}</h3>\n <p>{{ 'pages.notFound.message' | translate }}</p>\n <button type=\"button\" pButton [label]=\"'general.returnHome' | translate\" [routerLink]=\"['/']\"></button>\n </div>\n <div class=\"exception-footer align-items-center flex\">\n <img [src]=\"commons.colorSchemeIsLight ? commons.appLogoDark : commons.appLogoLight\" class=\"exception-logo\" alt=\"App logo\" />\n <img [src]=\"commons.colorSchemeIsLight ? commons.appLogoNameDark : commons.appLogoNameLight\" class=\"exception-appname ml-3\" alt=\"App name\" />\n </div>\n </div>\n</div>\n", styles: [".exception-body{background:var(--surface-ground)}.exception-body .exception-container{background:var(--exception-pages-image);background-repeat:no-repeat;background-size:contain;box-sizing:border-box}.exception-body .exception-container .exception-panel{box-sizing:border-box;flex-grow:1;margin-top:3rem;margin-bottom:3rem}.exception-body .exception-container .exception-panel h1{font-size:140px;font-weight:900;text-shadow:0 0 50px rgba(252,97,97,.2)}.exception-body .exception-container .exception-panel h3{font-size:80px;font-weight:900;margin-top:-90px;margin-bottom:50px}.exception-body .exception-container .exception-panel p{font-size:24px;font-weight:400;max-width:320px}.exception-body .exception-container .exception-panel button{margin-top:50px}.exception-body .exception-container .exception-footer{margin-bottom:2rem}.exception-body .exception-container .exception-footer .exception-logo{width:34px}.exception-body .exception-container .exception-footer .exception-appname{width:72px}\n"] }]
801
+ }], ctorParameters: () => [{ type: CommonsService }] });
802
+
803
+ class FilterMatchMode {
804
+ static { this.Equals = 'equals'; }
805
+ static { this.EqualsAbbr = 'eq'; }
806
+ static { this.NotEquals = 'notEquals'; }
807
+ static { this.NotEqualsAbbr = 'ne'; }
808
+ static { this.Contains = 'contains'; }
809
+ static { this.ContainsAbbr = 'cn'; }
810
+ static { this.NotContains = 'notContains'; }
811
+ static { this.NotContainsAbbr = 'nc'; }
812
+ static { this.In = 'in'; }
813
+ static { this.InAbbr = 'in'; }
814
+ static { this.NotIn = 'notIn'; }
815
+ static { this.NotInAbbr = 'ni'; }
816
+ static { this.StartsWith = 'startsWith'; }
817
+ static { this.StartsWithAbbr = 'sw'; }
818
+ static { this.EndsWith = 'endsWith'; }
819
+ static { this.EndsWithAbbr = 'ew'; }
820
+ static { this.LessThan = 'lessThan'; }
821
+ static { this.LessThanAbbr = 'lt'; }
822
+ static { this.LessThanOrEqualTo = 'lessThanOrEqualTo'; }
823
+ static { this.LessThanOrEqualToAbbr = 'le'; }
824
+ static { this.GreaterThan = 'greaterThan'; }
825
+ static { this.GreaterThanAbbr = 'gt'; }
826
+ static { this.GreaterThanOrEqualTo = 'greaterThanOrEqualTo'; }
827
+ static { this.GreaterThanOrEqualToAbbr = 'ge'; }
828
+ static { this.Between = 'between'; }
829
+ static { this.BetweenAbbr = 'bt'; }
830
+ static { this.Exists = 'exists'; }
831
+ static { this.ExistsAbbr = 'ex'; }
832
+ static { this.DoesNotExist = 'doesNotExist'; }
833
+ static { this.DoesNotExistAbbr = 'nx'; }
834
+ static getAbbreviation(mode) {
835
+ switch (mode) {
836
+ case FilterMatchMode.Equals:
837
+ return FilterMatchMode.EqualsAbbr;
838
+ case FilterMatchMode.NotEquals:
839
+ return FilterMatchMode.NotEqualsAbbr;
840
+ case FilterMatchMode.Contains:
841
+ return FilterMatchMode.ContainsAbbr;
842
+ case FilterMatchMode.NotContains:
843
+ return FilterMatchMode.NotContainsAbbr;
844
+ case FilterMatchMode.In:
845
+ return FilterMatchMode.InAbbr;
846
+ case FilterMatchMode.NotIn:
847
+ return FilterMatchMode.NotInAbbr;
848
+ case FilterMatchMode.StartsWith:
849
+ return FilterMatchMode.StartsWithAbbr;
850
+ case FilterMatchMode.EndsWith:
851
+ return FilterMatchMode.EndsWithAbbr;
852
+ case FilterMatchMode.LessThan:
853
+ return FilterMatchMode.LessThanAbbr;
854
+ case FilterMatchMode.LessThanOrEqualTo:
855
+ return FilterMatchMode.LessThanOrEqualToAbbr;
856
+ case FilterMatchMode.GreaterThan:
857
+ return FilterMatchMode.GreaterThanAbbr;
858
+ case FilterMatchMode.GreaterThanOrEqualTo:
859
+ return FilterMatchMode.GreaterThanOrEqualToAbbr;
860
+ case FilterMatchMode.Between:
861
+ return FilterMatchMode.BetweenAbbr;
862
+ case FilterMatchMode.Exists:
863
+ return FilterMatchMode.ExistsAbbr;
864
+ case FilterMatchMode.DoesNotExist:
865
+ return FilterMatchMode.DoesNotExistAbbr;
866
+ default:
867
+ return null;
868
+ }
869
+ }
870
+ static fromAbbreviation(abbr) {
871
+ switch (abbr) {
872
+ case FilterMatchMode.EqualsAbbr:
873
+ return FilterMatchMode.Equals;
874
+ case FilterMatchMode.NotEqualsAbbr:
875
+ return FilterMatchMode.NotEquals;
876
+ case FilterMatchMode.ContainsAbbr:
877
+ return FilterMatchMode.Contains;
878
+ case FilterMatchMode.NotContainsAbbr:
879
+ return FilterMatchMode.NotContains;
880
+ case FilterMatchMode.InAbbr:
881
+ return FilterMatchMode.In;
882
+ case FilterMatchMode.NotInAbbr:
883
+ return FilterMatchMode.NotIn;
884
+ case FilterMatchMode.StartsWithAbbr:
885
+ return FilterMatchMode.StartsWith;
886
+ case FilterMatchMode.EndsWithAbbr:
887
+ return FilterMatchMode.EndsWith;
888
+ case FilterMatchMode.LessThanAbbr:
889
+ return FilterMatchMode.LessThan;
890
+ case FilterMatchMode.LessThanOrEqualToAbbr:
891
+ return FilterMatchMode.LessThanOrEqualTo;
892
+ case FilterMatchMode.GreaterThanAbbr:
893
+ return FilterMatchMode.GreaterThan;
894
+ case FilterMatchMode.GreaterThanOrEqualToAbbr:
895
+ return FilterMatchMode.GreaterThanOrEqualTo;
896
+ case FilterMatchMode.BetweenAbbr:
897
+ return FilterMatchMode.Between;
898
+ case FilterMatchMode.ExistsAbbr:
899
+ return FilterMatchMode.Exists;
900
+ case FilterMatchMode.DoesNotExistAbbr:
901
+ return FilterMatchMode.DoesNotExist;
902
+ default:
903
+ return null;
904
+ }
905
+ }
906
+ }
907
+
908
+ /**
909
+ * Converts a TableLazyLoadEvent to DataListParams.
910
+ *
911
+ * @param {TableLazyLoadEvent} event - The event containing the data to convert.
912
+ * @return {DataListParams} - The converted DataListParams object.
913
+ */
914
+ function fromTableLoadToDataListParams(event) {
915
+ const params = {};
916
+ if (event.first != null) {
917
+ params.offset = event.first;
918
+ }
919
+ if (event.rows != null) {
920
+ params.limit = event.rows;
921
+ }
922
+ if (typeof event.globalFilter === 'string') {
923
+ params.search = event.globalFilter;
924
+ }
925
+ else if (Array.isArray(event.globalFilter) && event.globalFilter.length > 0) {
926
+ params.search = event.globalFilter.join(',');
927
+ }
928
+ if (Array.isArray(event.multiSortMeta) && event.multiSortMeta.length > 0) {
929
+ params.sort = event.multiSortMeta.map(m => ({ property: m.field, ascending: m.order >= 0 }));
930
+ }
931
+ if (event.filters) {
932
+ params.filters = Object.keys(event.filters).reduce((acc, key) => {
933
+ const filter = {};
934
+ const eventFilter = event.filters?.[key];
935
+ if (Array.isArray(eventFilter)) {
936
+ filter.value = eventFilter[0].value;
937
+ filter.matchMode = eventFilter[0].matchMode;
938
+ }
939
+ else if (eventFilter !== undefined) {
940
+ filter.value = eventFilter.value;
941
+ filter.matchMode = eventFilter.matchMode;
942
+ }
943
+ return { ...acc, [key]: filter };
944
+ }, {});
945
+ }
946
+ return params;
947
+ }
948
+ /**
949
+ * Converts the given parameters to URL query parameters.
950
+ * Sorts are formatted in Medius data API sort query language: `asc:prop1,desc:prop2`, ...
951
+ * Filter keys are "flattened" in the new object, values are formatted in Medius data API filter query language: `cs:eq:asd`, `in:asd,qwe`, `ex`, ...
952
+ *
953
+ * @param {DataListParams} params - The parameters to convert.
954
+ * @param {DataListParams|null} defaults - The default parameters used if no matching property in params is available. Defaults to { limit: 25, offset: 0 } if not provided.
955
+ * @returns {Params} - The URL query parameters object.
956
+ */
957
+ function dataListParamsToUrlQuery(params, defaults = {
958
+ limit: 25,
959
+ offset: 0
960
+ }) {
961
+ const urlParams = {};
962
+ if (params.limit && params.limit !== defaults?.limit) {
963
+ urlParams['limit'] = params.limit;
964
+ }
965
+ if (params.offset && params.offset !== defaults?.offset) {
966
+ urlParams['offset'] = params.offset;
967
+ }
968
+ if (params.search && params.search !== defaults?.search) {
969
+ urlParams['q'] = params.search;
970
+ }
971
+ if (params.sort && Array.isArray(params.sort) && params.sort.length > 0) {
972
+ if (defaults?.sort == null ||
973
+ !Array.isArray(defaults.sort) ||
974
+ defaults.sort.length === 0 ||
975
+ params.sort.length !== defaults.sort.length ||
976
+ defaults.sort.some((ds, idx) => ds.property !== params.sort[idx].property || (ds.ascending ?? true) !== (params.sort[idx].ascending ?? true))) {
977
+ urlParams['sort'] = dataListParamsSortToUrlQuery(params);
978
+ }
979
+ }
980
+ if (params.filters) {
981
+ Object.keys(params.filters).forEach(k => {
982
+ const paramFilter = params.filters[k];
983
+ const defaultFilter = defaults?.filters?.[k];
984
+ if (defaultFilter &&
985
+ ((Array.isArray(defaultFilter.value) &&
986
+ Array.isArray(paramFilter.value) &&
987
+ defaultFilter.value.length === paramFilter.value.length &&
988
+ defaultFilter.value.every((v, idx) => {
989
+ const value = paramFilter.value[idx];
990
+ if (value instanceof Date && v instanceof Date)
991
+ return value.getTime() === v.getTime();
992
+ else
993
+ return value === v;
994
+ })) || // handle arrays
995
+ defaultFilter.value === paramFilter.value) &&
996
+ defaultFilter.matchMode === paramFilter.matchMode &&
997
+ (defaultFilter.caseSensitive ?? false) === (paramFilter.caseSensitive ?? false)) {
998
+ return;
999
+ }
1000
+ if (paramFilter.value == null && defaultFilter?.value == null) {
1001
+ return;
1002
+ }
1003
+ urlParams[k] = dataListParamsFiltersToUrlQuery(params, k, true);
1004
+ });
1005
+ }
1006
+ if (defaults?.filters) {
1007
+ // add other defaults
1008
+ const paramFilterKeys = params.filters ? Object.keys(params.filters) : [];
1009
+ Object.keys(defaults.filters)
1010
+ .filter(k => paramFilterKeys.indexOf(k) < 0)
1011
+ .forEach(k => {
1012
+ urlParams[k] = dataListParamsFiltersToUrlQuery(defaults, k);
1013
+ });
1014
+ }
1015
+ return urlParams;
1016
+ }
1017
+ /**
1018
+ * Merges the provided parameters with default values and returns the merged object.
1019
+ *
1020
+ * @param {DataListParams} params - The parameters to merge with defaults.
1021
+ * @param {DataListParams} defaults - The default values to merge with params (optional, default is { limit: 25, offset: 0 }).
1022
+ * @returns {DataListParams} - The merged parameters object.
1023
+ */
1024
+ function mergeDataListParamsWithDefaults(params, defaults = {
1025
+ limit: 25,
1026
+ offset: 0
1027
+ }) {
1028
+ const merged = {
1029
+ limit: params.limit ?? defaults.limit,
1030
+ offset: params.offset ?? defaults.offset,
1031
+ search: params.search ?? defaults.search,
1032
+ sort: (params.sort ?? defaults.sort)?.map(s => ({ ...s }))
1033
+ };
1034
+ if (params.filters) {
1035
+ merged.filters = {};
1036
+ Object.entries(params.filters).forEach(([key, value]) => (merged.filters[key] = { ...value }));
1037
+ }
1038
+ if (defaults.filters) {
1039
+ if (!merged.filters)
1040
+ merged.filters = {};
1041
+ Object.entries(defaults.filters).forEach(([key, value]) => {
1042
+ if (merged.filters[key] === undefined) {
1043
+ merged.filters[key] = { ...value };
1044
+ }
1045
+ });
1046
+ }
1047
+ return merged;
1048
+ }
1049
+ /**
1050
+ * Converts an object of parameters to a URL query string for sorting.
1051
+ * Sorts are formatted in Medius data API sort query language: `asc:prop1,desc:prop2`, ...
1052
+ *
1053
+ * @param {DataListParams} params - An optional object containing sort parameters.
1054
+ * @returns A string representing the URL query or undefined if no sort parameters are provided.
1055
+ */
1056
+ function dataListParamsSortToUrlQuery(params) {
1057
+ return params && Array.isArray(params.sort)
1058
+ ? params.sort.map(s => `${s.ascending === true || s.ascending === undefined ? 'asc' : 'desc'}:${String(s.property)}`).join(',')
1059
+ : undefined;
1060
+ }
1061
+ /**
1062
+ * Converts a specific filter parameter (by key) from DataListParams object to a URL query string.
1063
+ * Filter keys are "flattened" in the new object, values are formatted in Medius data API filter query language: `cs:eq:asd`, `in:asd,qwe`, `ex`, ...
1064
+ *
1065
+ * @param {DataListParams<any, Filters> | undefined} params - The DataListParams object containing the filters.
1066
+ * @param {Filters} key - The key of the filter to convert.
1067
+ * @param {boolean} [allowNull=false] - Indicates whether to allow null values in the query string.
1068
+ * @return {string | undefined} - The URL query string representing the specified filter, or undefined if the filter is not found.
1069
+ */
1070
+ function dataListParamsFiltersToUrlQuery(params, key, allowNull = false) {
1071
+ const paramFilter = params?.filters?.[key];
1072
+ return dataListParamsFilterToUrlQuery(paramFilter, allowNull);
1073
+ }
1074
+ /**
1075
+ * Converts a filter to a URL query string.
1076
+ * Filter keys are "flattened" in the new object, values are formatted in Medius data API filter query language: `cs:eq:asd`, `in:asd,qwe`, `ex`, ...
1077
+ *
1078
+ * @param {DataListFilter} paramFilter - The filter object to be converted.
1079
+ * @param {boolean} [allowNull=false] - Indicates whether to allow null values in the filter.
1080
+ * @returns {string|undefined} - The filter converted to a URL query string, or undefined if no filter is provided or the filter has empty or invalid values.
1081
+ * @throws {CommonsInternalError} - If the filter has invalid values.
1082
+ */
1083
+ function dataListParamsFilterToUrlQuery(paramFilter, allowNull = false) {
1084
+ const filterValueAsArray = Array.isArray(paramFilter?.value) ? paramFilter.value.filter(v => v !== undefined && (allowNull || v !== null)) : undefined;
1085
+ if (paramFilter === undefined ||
1086
+ (!allowNull && paramFilter.value == null) ||
1087
+ (typeof paramFilter.value === 'string' && paramFilter.value.length === 0) ||
1088
+ (Array.isArray(filterValueAsArray) && filterValueAsArray.length === 0)) {
1089
+ // no need to include filters for empty values
1090
+ return undefined;
1091
+ }
1092
+ const matchMode = paramFilter.matchMode ?? FilterMatchMode.Equals;
1093
+ if (matchMode === FilterMatchMode.Between && !(Array.isArray(filterValueAsArray) && filterValueAsArray.length === 2)) {
1094
+ throw new CommonsInternalError(`Filter match mode between requires exactly 2 values: ${paramFilter.value}`);
1095
+ }
1096
+ if ((matchMode === FilterMatchMode.In || matchMode === FilterMatchMode.NotIn) && (!Array.isArray(filterValueAsArray) || filterValueAsArray.length === 0)) {
1097
+ throw new CommonsInternalError(`Filter match mode ${matchMode} requires non-empty array: ${paramFilter.value}`);
1098
+ }
1099
+ if ([FilterMatchMode.In, FilterMatchMode.NotIn, FilterMatchMode.Between].indexOf(matchMode) === -1 && Array.isArray(filterValueAsArray)) {
1100
+ throw new CommonsInternalError(`Filter match mode ${matchMode} must not be array: ${paramFilter.value}`);
1101
+ }
1102
+ const noVal = paramFilter.matchMode === FilterMatchMode.Exists || paramFilter.matchMode === FilterMatchMode.DoesNotExist;
1103
+ const urlValuePart = noVal ? '' : `:${dataListParamsFilterValueToUrlString(filterValueAsArray ?? paramFilter.value, allowNull)}`;
1104
+ return `${paramFilter.caseSensitive ? 'cs:' : paramFilter.caseSensitive === false ? 'ci:' : ''}${FilterMatchMode.getAbbreviation(matchMode) ?? matchMode}${urlValuePart}`;
1105
+ }
1106
+ /**
1107
+ * Converts URL query parameters to a DataListParams object.
1108
+ * Sorts are formatted from Medius data API sort query language: `asc:prop1,desc:prop2`, ...
1109
+ * Filter keys are all keys in Params object that are not matched elsewhere, values are formatted from Medius data API filter query language: `cs:eq:asd`, `in:asd,qwe`, `ex`, ...
1110
+ *
1111
+ * @param {Params} urlParams - The URL query parameters.
1112
+ * @return {DataListParams} - The converted DataListParams object.
1113
+ */
1114
+ function fromUrlQueryToDataListParams(urlParams) {
1115
+ const params = {};
1116
+ Object.entries(urlParams).forEach(([urlParamKey, urlParamValue]) => {
1117
+ if (urlParamKey === 'limit') {
1118
+ params.limit = +urlParamValue;
1119
+ if (isNaN(params.limit) || params.limit < 0) {
1120
+ delete params.limit;
1121
+ }
1122
+ }
1123
+ else if (urlParamKey === 'offset') {
1124
+ params.offset = +urlParamValue;
1125
+ if (isNaN(params.offset) || params.offset < 0) {
1126
+ delete params.offset;
1127
+ }
1128
+ }
1129
+ else if (urlParamKey === 'q') {
1130
+ params.search = urlParamValue;
1131
+ }
1132
+ else if (urlParamKey === 'sort') {
1133
+ if (typeof urlParamValue === 'string') {
1134
+ params.sort = urlParamValue.split(',').map(s => {
1135
+ const [direction, property] = s.split(':');
1136
+ return { property: (property ?? direction), ascending: direction !== 'desc' };
1137
+ });
1138
+ }
1139
+ else {
1140
+ throw new CommonsInternalError(`String is expected as value for '${urlParamKey}' when converting from urlParams`);
1141
+ }
1142
+ }
1143
+ else if (typeof urlParamValue === 'string') {
1144
+ if (urlParamValue.length === 0) {
1145
+ // empty string should be ignored
1146
+ return;
1147
+ }
1148
+ const filterParts = urlParamValue.split(':');
1149
+ let partIdx = 0;
1150
+ // case sensitive
1151
+ let caseSensitive = undefined;
1152
+ if (filterParts[partIdx] === 'cs' || filterParts[partIdx] === 'ci') {
1153
+ caseSensitive = filterParts[partIdx++] === 'cs';
1154
+ }
1155
+ // match mode
1156
+ const matchMode = filterParts[partIdx] ? FilterMatchMode.fromAbbreviation(filterParts[partIdx]) ?? filterParts[partIdx] : FilterMatchMode.Equals;
1157
+ partIdx++;
1158
+ const noVal = matchMode === FilterMatchMode.Exists || matchMode === FilterMatchMode.DoesNotExist;
1159
+ // value
1160
+ let value = undefined;
1161
+ if (!noVal) {
1162
+ if (filterParts.length < 2) {
1163
+ return;
1164
+ }
1165
+ if (partIdx === filterParts.length - 1) {
1166
+ value = filterParts[partIdx];
1167
+ }
1168
+ else if (partIdx < filterParts.length) {
1169
+ // array that should not be array, so join back together
1170
+ value = filterParts.slice(partIdx, filterParts.length).join(':');
1171
+ }
1172
+ if (value === undefined && matchMode !== FilterMatchMode.Exists && matchMode !== FilterMatchMode.DoesNotExist) {
1173
+ // if value undefined and match mode expects value, then skip
1174
+ return;
1175
+ }
1176
+ if (value === 'null') {
1177
+ value = null;
1178
+ }
1179
+ if ((matchMode === FilterMatchMode.In || matchMode === FilterMatchMode.NotIn || matchMode === FilterMatchMode.Between) && typeof value === 'string') {
1180
+ let arrayVal = [];
1181
+ // these match modes expect array
1182
+ if (value.indexOf('"') >= 0) {
1183
+ const tokens = [];
1184
+ let currentToken = '';
1185
+ let explicitQuotes = false; //token is quoted, e.g. in:1,2,"22""",",123"""
1186
+ let quotesOpened = false; //token has started processing
1187
+ let quotesExplicitlyClosed = false; //token processing has finished, after single " in quoted mode, or before , in not quoted
1188
+ for (let i = 0; i < value.length; i++) {
1189
+ const c = value[i];
1190
+ // reset the tokenizer when seeing the token separator
1191
+ // only if either:
1192
+ // the quotes have not been opened yet (when there are no characters between separators),
1193
+ // the token has been explicitly closed (when we actually have explicit opening i.e., quotes as the first character)
1194
+ // or we have implicit quotes (i.e., quotes are not the first character)
1195
+ if (c === ',' && (!quotesOpened || quotesExplicitlyClosed || !explicitQuotes)) {
1196
+ tokens.push(currentToken);
1197
+ currentToken = '';
1198
+ quotesOpened = false;
1199
+ quotesExplicitlyClosed = false;
1200
+ explicitQuotes = false;
1201
+ }
1202
+ else if (c == '"') {
1203
+ // escaped double-quotes
1204
+ if (explicitQuotes && i + 1 < value.length && value[i + 1] === '"') {
1205
+ currentToken += c; // Append one double-quote to the current token
1206
+ i++; // Skip the next double-quote
1207
+ }
1208
+ // we encounter quotes again after they were the first character => we close the token
1209
+ else if (explicitQuotes) {
1210
+ quotesExplicitlyClosed = true;
1211
+ }
1212
+ // implicit quotes
1213
+ else if (quotesOpened) {
1214
+ currentToken += c;
1215
+ }
1216
+ // quotes are the first character => explicitly open the token
1217
+ else {
1218
+ currentToken = '';
1219
+ quotesOpened = true;
1220
+ explicitQuotes = true;
1221
+ }
1222
+ }
1223
+ else {
1224
+ if (quotesExplicitlyClosed) {
1225
+ return;
1226
+ }
1227
+ quotesOpened = true;
1228
+ currentToken += c;
1229
+ }
1230
+ }
1231
+ if (quotesOpened && !quotesExplicitlyClosed && explicitQuotes) {
1232
+ return;
1233
+ }
1234
+ // Append the last token after the loop ends
1235
+ tokens.push(currentToken.toString());
1236
+ arrayVal = tokens;
1237
+ }
1238
+ else {
1239
+ arrayVal = value.split(',');
1240
+ }
1241
+ if (matchMode === FilterMatchMode.Between && arrayVal.length !== 2) {
1242
+ return;
1243
+ }
1244
+ value = arrayVal;
1245
+ }
1246
+ if ((typeof value === 'string' && value.length === 0) || (Array.isArray(value) && value.length === 0)) {
1247
+ // filter with empty value is to be ignored
1248
+ return;
1249
+ }
1250
+ }
1251
+ else {
1252
+ caseSensitive = undefined;
1253
+ }
1254
+ if (!params.filters) {
1255
+ params.filters = {};
1256
+ }
1257
+ params.filters[urlParamKey] = { value: value, matchMode: matchMode, caseSensitive: caseSensitive };
1258
+ }
1259
+ });
1260
+ return params;
1261
+ }
1262
+ /**
1263
+ * Makes a copy of the given DataListParams object.
1264
+ *
1265
+ * @param {DataListParams<Sorts, Filters>} params - The DataListParams object to be copied.
1266
+ * @returns {DataListParams<Sorts, Filters>} - Returns a new copy of the DataListParams object.
1267
+ */
1268
+ function copyDataListParams(params) {
1269
+ const copy = {
1270
+ offset: params.offset,
1271
+ limit: params.limit,
1272
+ search: params.search
1273
+ };
1274
+ if (params.sort) {
1275
+ copy.sort = params.sort?.map(s => ({ ...s }));
1276
+ }
1277
+ if (params.filters) {
1278
+ copy.filters = Object.entries(params.filters).reduce((acc, [key, value]) => {
1279
+ const filterValue = value;
1280
+ return {
1281
+ ...acc,
1282
+ [key]: {
1283
+ ...filterValue,
1284
+ value: Array.isArray(filterValue.value) ? [...filterValue.value] : filterValue.value
1285
+ }
1286
+ };
1287
+ }, {});
1288
+ }
1289
+ return copy;
1290
+ }
1291
+ /**
1292
+ * Converts a value to a URL query param string representation.
1293
+ *
1294
+ * @param {unknown} value - The value to be converted.
1295
+ * @param {boolean} [allowNull=false] - Indicates whether null values are allowed.
1296
+ * @returns {string} The URL parameter representation of the value.
1297
+ * @throws {CommonsInternalError} If an undefined value is passed without allowNull set to true.
1298
+ * @throws {CommonsInternalError} If the value is an object (excluding Date).
1299
+ */
1300
+ function dataListParamsFilterValueToUrlString(value, allowNull = false) {
1301
+ if (value === null && allowNull)
1302
+ return 'null';
1303
+ if (value == null)
1304
+ throw new CommonsInternalError('Undefined value cannot be converted to url param.'); // this should not happen, should be filtered out earlier
1305
+ if (Array.isArray(value))
1306
+ return value
1307
+ .map(v => dataListParamsFilterValueToUrlString(v, allowNull))
1308
+ .map(v => (v.indexOf(',') >= 0 || v.indexOf('"') >= 0 ? `"${v.replaceAll('"', '""')}"` : v))
1309
+ .join(',');
1310
+ if (typeof value === 'object') {
1311
+ if (value instanceof Date)
1312
+ return dateToIsoString(value, 'dateTime', { utc: true });
1313
+ else {
1314
+ throw new CommonsInternalError('Filter value cannot be object');
1315
+ }
1316
+ }
1317
+ return String(value);
1318
+ }
1319
+
1320
+ /**
1321
+ * A base data provider class used for handling data operations.
1322
+ *
1323
+ * @tparam Model - The type of data this data provider will handle.
1324
+ * @tparam Service - The type of service used by this data provider (optional).
1325
+ * @tparam ModelClass - The model type for the data provider (optional).
1326
+ * @tparam ServiceClass - The service type for the data provider (optional).
1327
+ */
1328
+ class DataProviderInst {
1329
+ constructor(classType, serviceType) {
1330
+ this.classType = classType;
1331
+ this.serviceType = serviceType;
1332
+ }
1333
+ get isDataProvider() {
1334
+ return true;
1335
+ }
1336
+ }
1337
+ class DataProvider extends DataProviderInst {
1338
+ constructor() {
1339
+ super(undefined, undefined);
1340
+ }
1341
+ static create() {
1342
+ return new DataProviderInst(undefined, undefined);
1343
+ }
1344
+ static fromClass(type) {
1345
+ return new DataProviderInst(type, undefined);
1346
+ }
1347
+ static fromClassWithService(type, serviceType) {
1348
+ return new DataProviderInst(type, serviceType);
1349
+ }
1350
+ static fromService(serviceType) {
1351
+ return new DataProviderInst(undefined, serviceType);
1352
+ }
1353
+ static fromAnyParam(type, serviceType) {
1354
+ if (typeof type !== 'undefined') {
1355
+ return typeof serviceType !== 'undefined'
1356
+ ? DataProvider.fromClassWithService(type, serviceType)
1357
+ : DataProvider.fromClass(type);
1358
+ }
1359
+ else if (typeof serviceType !== 'undefined') {
1360
+ return DataProvider.fromService(serviceType);
1361
+ }
1362
+ else {
1363
+ return DataProvider.create();
1364
+ }
1365
+ }
1366
+ }
1367
+
1368
+ class ComponentDirective {
1369
+ constructor() {
1370
+ this.injector = inject(Injector);
1371
+ this.elementRef = inject(ElementRef);
1372
+ this.applicationRef = inject(ApplicationRef);
1373
+ this.viewContainerRef = inject(ViewContainerRef);
1374
+ this.attachToHost = false;
1375
+ this.componentInstanceEventEmitter = new EventEmitter();
1376
+ }
1377
+ ngOnInit() {
1378
+ let component = null;
1379
+ if (this.component) {
1380
+ component = this.component;
1381
+ }
1382
+ else if (this.componentIt) {
1383
+ component = this.injector.get(this.componentIt, null, { optional: true });
1384
+ }
1385
+ if (!component) {
1386
+ throw new CommonsInternalError(`Component cannot be created, no component (${this.component}) or no or invalid injection token provided (${this.componentIt}).`);
1387
+ }
1388
+ if (this.attachToHost) {
1389
+ this.componentRef = createComponent(component, {
1390
+ hostElement: this.elementRef.nativeElement,
1391
+ environmentInjector: this.applicationRef.injector,
1392
+ elementInjector: this.nodeInjector ?? this.injector
1393
+ });
1394
+ }
1395
+ else {
1396
+ this.viewContainerRef.clear();
1397
+ this.componentRef = this.viewContainerRef.createComponent(component, {
1398
+ injector: this.nodeInjector ?? undefined
1399
+ });
1400
+ }
1401
+ if (this.inputs) {
1402
+ for (const input in this.inputs) {
1403
+ this.componentRef.setInput(input, this.inputs[input]);
1404
+ }
1405
+ }
1406
+ if (this.attachToHost) {
1407
+ this.applicationRef.attachView(this.componentRef.hostView);
1408
+ }
1409
+ this.componentInstanceEventEmitter.next(this.componentRef.instance);
1410
+ }
1411
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: ComponentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1412
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.2", type: ComponentDirective, isStandalone: true, selector: "[mngComponent]", inputs: { component: ["mngComponent", "component"], componentIt: ["injectionToken", "componentIt"], inputs: "inputs", attachToHost: "attachToHost", nodeInjector: "nodeInjector" }, outputs: { componentInstanceEventEmitter: "instanceCreated" }, ngImport: i0 }); }
1413
+ }
1414
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: ComponentDirective, decorators: [{
1415
+ type: Directive,
1416
+ args: [{
1417
+ standalone: true,
1418
+ selector: '[mngComponent]'
1419
+ }]
1420
+ }], propDecorators: { component: [{
1421
+ type: Input,
1422
+ args: [{ alias: 'mngComponent' }]
1423
+ }], componentIt: [{
1424
+ type: Input,
1425
+ args: [{ alias: 'injectionToken' }]
1426
+ }], inputs: [{
1427
+ type: Input
1428
+ }], attachToHost: [{
1429
+ type: Input
1430
+ }], nodeInjector: [{
1431
+ type: Input
1432
+ }], componentInstanceEventEmitter: [{
1433
+ type: Output,
1434
+ args: ['instanceCreated']
1435
+ }] } });
1436
+
1437
+ class TemplateDirective {
1438
+ constructor() {
1439
+ this.template = inject((TemplateRef));
1440
+ this.viewContainerRef = inject(ViewContainerRef);
1441
+ }
1442
+ getType() {
1443
+ return this.name;
1444
+ }
1445
+ getViewContainerRef() {
1446
+ return this.viewContainerRef;
1447
+ }
1448
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: TemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1449
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.2", type: TemplateDirective, isStandalone: true, selector: "[mngTemplate]", inputs: { type: "type", name: ["mngTemplate", "name"] }, ngImport: i0 }); }
1450
+ }
1451
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: TemplateDirective, decorators: [{
1452
+ type: Directive,
1453
+ args: [{
1454
+ standalone: true,
1455
+ selector: '[mngTemplate]'
1456
+ }]
1457
+ }], propDecorators: { type: [{
1458
+ type: Input
1459
+ }], name: [{
1460
+ type: Input,
1461
+ args: [{ required: true, alias: 'mngTemplate' }]
1462
+ }] } });
1463
+
1464
+ /**
1465
+ * Returns array of names for constants in enum.
1466
+ * @param enumType Enum object.
1467
+ */
1468
+ function getEnumConstantNames(enumType) {
1469
+ return getEnumConstantNamesFromObject(enumType);
1470
+ }
1471
+ /**
1472
+ * Returns array of names for constants in enum.
1473
+ * @param enumObj Enum object.
1474
+ */
1475
+ function getEnumConstantNamesFromObject(enumObj) {
1476
+ // in number enum, the numbers are also represented in objects and should be filtered out
1477
+ return Object.keys(enumObj).filter(v => isNaN(+v));
1478
+ }
1479
+ /**
1480
+ * Returns array of string values for constants in enum.
1481
+ * @param enumType Enum object.
1482
+ */
1483
+ function getEnumConstantValuesAsString(enumType) {
1484
+ return Object.keys(enumType).map(v => enumType[v]);
1485
+ }
1486
+ /**
1487
+ * Returns array of number values for constants in enum.
1488
+ * @param enumType Enum object.
1489
+ */
1490
+ function getEnumConstantValuesAsNumber(enumType) {
1491
+ return Object.keys(enumType)
1492
+ .filter(v => !isNaN(+v))
1493
+ .map(v => +v);
1494
+ }
1495
+ /**
1496
+ * Returns array of type EnumValue for all constants in enum.
1497
+ * @param enumType Enum object.
1498
+ * @param nameAsValue If use name of constant as value (optional, default: false).
1499
+ * @param titlePath Base path for title to use as translation (optional).
1500
+ */
1501
+ function fromEnumConstantsAsValueArray(enumType, nameAsValue = false, titlePath) {
1502
+ return getEnumConstantNames(enumType).map(n => ({ name: n, title: `${titlePath ? `${titlePath}.` : ''}${n}`, value: nameAsValue ? n : enumType[n] }));
1503
+ }
1504
+ /**
1505
+ * Returns array of type EnumValue for provided values in enum.
1506
+ * @param enumType Enum object.
1507
+ * @param values Enum values (constants).
1508
+ * @param nameAsValue If use name of constant as value (optional, default: false).
1509
+ * @param titlePath Base path for title to use as translation (optional).
1510
+ */
1511
+ function fromEnumValuesAsValueArray(enumType, values, nameAsValue = false, titlePath) {
1512
+ return values.map(v => {
1513
+ const k = getEnumConstantName(enumType, v);
1514
+ return { name: k, title: `${titlePath ? `${titlePath}.` : ''}${k}`, value: nameAsValue ? k : v };
1515
+ });
1516
+ }
1517
+ /**
1518
+ * Gets constant name for value.
1519
+ * @param enumType Enum object.
1520
+ * @param value Value of enum constant.
1521
+ */
1522
+ function getEnumConstantName(enumType, value) {
1523
+ if (typeof value === 'string') {
1524
+ return getEnumConstantNames(enumType).find(c => enumType[c] === value) ?? null;
1525
+ }
1526
+ else {
1527
+ return typeof enumType[value] !== 'undefined' ? enumType[value] : null;
1528
+ }
1529
+ }
1530
+ /**
1531
+ * Gets constant name for value.
1532
+ * @param enumObj Enum object.
1533
+ * @param value Value of enum constant.
1534
+ */
1535
+ function getEnumConstantNameFromObject(enumObj, value) {
1536
+ const enumObjAny = enumObj;
1537
+ if (typeof value === 'string') {
1538
+ return getEnumConstantNamesFromObject(enumObj).find(c => enumObjAny[c] === value) ?? null;
1539
+ }
1540
+ else {
1541
+ return typeof enumObjAny[value] !== 'undefined' ? enumObjAny[value] : null;
1542
+ }
1543
+ }
1544
+
1545
+ function objectDeepCopy(obj, options) {
1546
+ if (typeof obj !== 'object' || obj === null || Array.isArray(obj)) {
1547
+ return obj;
1548
+ }
1549
+ if (obj instanceof Date) {
1550
+ return new Date(+obj);
1551
+ }
1552
+ let copy;
1553
+ if (options?.mapGettersToProperties) {
1554
+ copy = {};
1555
+ }
1556
+ else {
1557
+ copy = options?.objectPrototype ? Object.create(options.objectPrototype['prototype']) : Object.create(Object.getPrototypeOf(obj));
1558
+ Object.assign(copy, obj);
1559
+ }
1560
+ for (const key of getObjectProperties(obj)) {
1561
+ const prop = obj[key];
1562
+ copy[key] = handleProp(prop, { mapGettersToProperties: options?.mapGettersToProperties });
1563
+ }
1564
+ if (options?.mapGettersToProperties) {
1565
+ for (const getterKey of getObjectGetters(obj)) {
1566
+ const prop = obj[getterKey];
1567
+ copy[getterKey] = handleProp(prop, { mapGettersToProperties: options?.mapGettersToProperties });
1568
+ }
1569
+ }
1570
+ return copy;
1571
+ }
1572
+ function objectDeepMerge(target, source) {
1573
+ if (!isObject(source)) {
1574
+ return target;
1575
+ }
1576
+ for (const key of getObjectProperties(source)) {
1577
+ if (isObject(source[key])) {
1578
+ if (isObject(target[key])) {
1579
+ target[key] = objectDeepMerge(target[key], source[key]);
1580
+ }
1581
+ else {
1582
+ target[key] = objectDeepCopy(source[key]);
1583
+ }
1584
+ }
1585
+ else if (Array.isArray(source[key])) {
1586
+ if (!Array.isArray(target[key])) {
1587
+ target[key] = source[key].map(i => (isObject(i) ? objectDeepMerge({}, i) : i));
1588
+ }
1589
+ }
1590
+ else if (typeof target[key] === 'undefined') {
1591
+ target[key] = source[key];
1592
+ }
1593
+ }
1594
+ return target;
1595
+ }
1596
+ function isObject(obj) {
1597
+ return typeof obj === 'object' && obj !== null && !Array.isArray(obj);
1598
+ }
1599
+ function handleProp(prop, options) {
1600
+ if (Array.isArray(prop)) {
1601
+ return prop.map(i => objectDeepCopy(i, options));
1602
+ }
1603
+ else if (typeof prop === 'object' && prop !== null) {
1604
+ return objectDeepCopy(prop, options);
1605
+ }
1606
+ else {
1607
+ return prop;
1608
+ }
1609
+ }
1610
+ function getObjectProperties(obj) {
1611
+ return Object.keys(obj);
1612
+ }
1613
+ function getObjectGetters(obj) {
1614
+ const getterSet = new Set();
1615
+ let currObj = obj;
1616
+ while (currObj) {
1617
+ const getters = Object.entries(Object.getOwnPropertyDescriptors(currObj))
1618
+ .filter(([, descriptor]) => typeof descriptor.get === 'function')
1619
+ .filter(([key]) => key !== '__proto__')
1620
+ .map(([key]) => key);
1621
+ for (const getter of getters) {
1622
+ getterSet.add(getter);
1623
+ }
1624
+ currObj = Object.getPrototypeOf(currObj);
1625
+ }
1626
+ return Array.from(getterSet);
1627
+ }
1628
+ function getObjectPropertyByPath(value, path) {
1629
+ if (path === '$') {
1630
+ // only return the root
1631
+ return value;
1632
+ }
1633
+ // Check for leading root object notation
1634
+ if (path.startsWith('$')) {
1635
+ path = path.substring(1);
1636
+ }
1637
+ // Check for leading .
1638
+ if (path.startsWith('.')) {
1639
+ path = path.substring(1);
1640
+ }
1641
+ if (path.indexOf('.') >= 0) {
1642
+ const pathSplit = path.split('.');
1643
+ let currValue = value;
1644
+ for (const p of pathSplit) {
1645
+ if (typeof currValue === 'undefined' || currValue === null) {
1646
+ return currValue;
1647
+ }
1648
+ if (!p.length) {
1649
+ // empty path, return current value
1650
+ return currValue;
1651
+ }
1652
+ const leftBracketIdx = p.indexOf('[');
1653
+ if (leftBracketIdx >= 0 && p.endsWith(']')) {
1654
+ // should be reference to array
1655
+ const arrayPath = p.substring(0, leftBracketIdx);
1656
+ const arrayIdx = +p.substring(leftBracketIdx + 1, p.length - 1);
1657
+ const array = currValue[arrayPath];
1658
+ if (Array.isArray(array)) {
1659
+ if (arrayIdx >= 0 && arrayIdx < array.length) {
1660
+ // valid index, continue on the path
1661
+ currValue = array[arrayIdx];
1662
+ continue;
1663
+ }
1664
+ }
1665
+ return undefined;
1666
+ }
1667
+ else if (typeof currValue === 'object') {
1668
+ currValue = currValue[p];
1669
+ }
1670
+ }
1671
+ return currValue;
1672
+ }
1673
+ else {
1674
+ return value[path];
1675
+ }
1676
+ }
1677
+ function flattenObjectKeys(objectModel) {
1678
+ const flatten = (object, parent) => {
1679
+ let results = [];
1680
+ for (const key in object) {
1681
+ const value = object[key];
1682
+ const thisKey = parent ? `${parent}.${key}` : `${key}`;
1683
+ results = results.concat(isObject(value) ? flatten(value, thisKey) : [[`${thisKey}`, value]]);
1684
+ }
1685
+ return results;
1686
+ };
1687
+ return flatten(objectModel);
1688
+ }
1689
+
1690
+ function escapeHtml(value) {
1691
+ return value.replace(/</g, '&lt;').replace(/>/g, '&gt;');
1692
+ }
1693
+ function escapeHtmlAny(value) {
1694
+ if (typeof value === 'string') {
1695
+ return escapeHtml(value);
1696
+ }
1697
+ else if (typeof value === 'object') {
1698
+ const escapedValue = objectDeepCopy(value, { mapGettersToProperties: true });
1699
+ for (const key in value) {
1700
+ if (typeof value[key] === 'string') {
1701
+ escapedValue[key] = escapeHtml(value[key]);
1702
+ }
1703
+ else if (typeof value[key] === 'object') {
1704
+ escapedValue[key] = escapeHtmlAny(value[key]);
1705
+ }
1706
+ else {
1707
+ escapedValue[key] = value[key];
1708
+ }
1709
+ }
1710
+ return escapedValue;
1711
+ }
1712
+ return value;
1713
+ }
1714
+ /**
1715
+ * Stringifies a value - primitives with toString, dates with dateUtil, objects with JSON.stringify.
1716
+ * @param value Any value.
1717
+ */
1718
+ function stringify(value) {
1719
+ if (value === null) {
1720
+ return 'null';
1721
+ }
1722
+ if (typeof value === 'undefined') {
1723
+ return 'undefined';
1724
+ }
1725
+ // eliminate functions, cause they could fall into objects
1726
+ if (typeof value === 'function') {
1727
+ return `Function ${value.name ?? 'anonymous'}()`;
1728
+ }
1729
+ if (typeof value === 'object') {
1730
+ // date is object, but would like it in ISO string representation
1731
+ if (value instanceof Date) {
1732
+ return dateToIsoString(value) ?? 'null';
1733
+ }
1734
+ try {
1735
+ return JSON.stringify(value);
1736
+ }
1737
+ catch (e) {
1738
+ return value.toString();
1739
+ }
1740
+ }
1741
+ // only primitives should be left to be printed like this (string, number, boolean)
1742
+ return value.toString();
1743
+ }
1744
+
1745
+ /**
1746
+ * Converts RxJS subscription error to CommonsError.
1747
+ * @param error Error.
1748
+ * @param name Optional name to write in commons error.
1749
+ * @param details Optional details of error.
1750
+ */
1751
+ function fromSubscribeError(error, name, details) {
1752
+ const opts = {
1753
+ name,
1754
+ details,
1755
+ location: window?.location?.href
1756
+ };
1757
+ if (error instanceof HttpErrorResponse) {
1758
+ return new CommonsHttpError(error.message ?? 'Http Error occurred', error, opts);
1759
+ }
1760
+ else {
1761
+ opts.cause = error;
1762
+ return new CommonsInternalError(error.message ?? 'Internal Error occurred', opts);
1763
+ }
1764
+ }
1765
+ /**
1766
+ * Checks if error is Http error (Angular or Commons).
1767
+ * @param error
1768
+ */
1769
+ function isHttpErrorResponse(error) {
1770
+ return error instanceof HttpErrorResponse || error instanceof CommonsHttpError || error?.httpError instanceof HttpErrorResponse;
1771
+ }
1772
+ /**
1773
+ * Gets HttpErrorResponse from error (Angular or Commons).
1774
+ * @param error Error.
1775
+ */
1776
+ function getHttpErrorResponse(error) {
1777
+ if (error instanceof HttpErrorResponse) {
1778
+ return error;
1779
+ }
1780
+ else if (error instanceof CommonsHttpError) {
1781
+ return error.httpError;
1782
+ }
1783
+ else if (error?.httpError instanceof HttpErrorResponse) {
1784
+ return error.httpError;
1785
+ }
1786
+ else {
1787
+ return null;
1788
+ }
1789
+ }
1790
+ /**
1791
+ * Gets HttpErrorResponse status from error (Angular or Commons).
1792
+ * @param error Error.
1793
+ */
1794
+ function getHttpErrorResponseStatus(error) {
1795
+ return getHttpErrorResponse(error)?.status ?? null;
1796
+ }
1797
+ /**
1798
+ * Get error log level. All is error, except if error is http error with status >=400 and <500.
1799
+ * @param error Error.
1800
+ */
1801
+ function getErrorLogLevel(error) {
1802
+ if (isHttpErrorResponse(error)) {
1803
+ const status = getHttpErrorResponseStatus(error);
1804
+ if (status && status >= 400 && status < 500) {
1805
+ return LogLevelEnum.Warning;
1806
+ }
1807
+ }
1808
+ return LogLevelEnum.Error;
1809
+ }
1810
+ /**
1811
+ * Get error name (prototype name or type from commons error if name is not provided).
1812
+ * @param error Error.
1813
+ */
1814
+ function getErrorName(error) {
1815
+ if (error instanceof ACommonsErrorBase) {
1816
+ return error.name ?? error.type;
1817
+ }
1818
+ else {
1819
+ return error.name;
1820
+ }
1821
+ }
1822
+ /**
1823
+ * Writes http error to string with all headers and body.
1824
+ * @param error Http response error.
1825
+ * @param opts Options for hiding parts of error:
1826
+ * - hideMessage Hides message of error (message include url, status and status text!).
1827
+ * - hideHeaders Hides headers.
1828
+ * - hideBody Hides JSON representation of body.
1829
+ */
1830
+ function httpErrorResponseToString(error, opts) {
1831
+ let str = opts?.hideMessage ? '' : `${error.message}\n`; // message should already include url, status, etc.
1832
+ if (!opts?.hideHeaders) {
1833
+ str += `Http Response Headers: ${error.headers.keys().reduce((acc, key) => `${acc}[${key}: ${error.headers.get(key)}]`, '')}`;
1834
+ }
1835
+ if (!opts?.hideBody) {
1836
+ str += `\nHttp Response Body: ${stringify(error.error)}`;
1837
+ }
1838
+ return str;
1839
+ }
1840
+ /**
1841
+ * Error to string.
1842
+ * @param error Error.
1843
+ * @param opts Options for hiding parts of error:
1844
+ * - hideMessage Hides message of error.
1845
+ * - hideName Hides error name.
1846
+ * - hideCause Hides cause of an error (if present, see @link(errorCauseToString) for other options).
1847
+ * - hideStack Hides stack of an error (if present).
1848
+ * - hideDetails Hides JSON detail's representation of error (if present).
1849
+ * - hideLocation Hides location (URL) where error was thrown.
1850
+ * - hideHttp Hides http error portion of error if http error response (see @link(httpErrorResponseToString) for other options).
1851
+ */
1852
+ function errorToString(error, opts) {
1853
+ if (error instanceof ACommonsErrorBase) {
1854
+ return commonsErrorToString(error, opts);
1855
+ }
1856
+ else if (error instanceof HttpErrorResponse) {
1857
+ return httpErrorResponseToString(error, opts);
1858
+ }
1859
+ const strBlocks = [];
1860
+ if (!opts?.hideMessage) {
1861
+ strBlocks.push(error.message);
1862
+ }
1863
+ if (error.name) {
1864
+ strBlocks.push(`Error name: ${error.name}`);
1865
+ }
1866
+ if (!opts?.hideCause) {
1867
+ strBlocks.push(errorCauseToString(error, opts));
1868
+ }
1869
+ if (!opts?.hideStack && error.stack) {
1870
+ strBlocks.push(`Stack trace:\n${error.stack}`);
1871
+ }
1872
+ return strBlocks.filter(s => s.trim().length > 0).join('\n');
1873
+ }
1874
+ /**
1875
+ * Commons error to string.
1876
+ * @param error Commons error.
1877
+ * @param opts Options for hiding parts of error:
1878
+ * - hideMessage Hides message of error.
1879
+ * - hideName Hides error name.
1880
+ * - hideCause Hides cause of an error (if present, see @link(errorCauseToString) for other options).
1881
+ * - hideStack Hides stack of an error (if present).
1882
+ * - hideDetails Hides JSON detail's representation of error (if present).
1883
+ * - hideLocation Hides location (URL) where error was thrown.
1884
+ * - hideHttp Hides http error portion of error if http error response (see @link(httpErrorResponseToString) for other options).
1885
+ * - hideItems Hides all item information (http body, action context data).
1886
+ * - hideActionData See @link(commonsActionErrorContextToString) for additional info.
1887
+ * - hideQueryParams See @link(commonsActionErrorContextToString) for additional info.
1888
+ */
1889
+ function commonsErrorToString(error, opts) {
1890
+ const strBlocks = [];
1891
+ if (!opts?.hideMessage) {
1892
+ strBlocks.push(`${error.message}${error.messageCode ? ` (code: ${error.messageCode})` : ''}`);
1893
+ }
1894
+ if (!opts?.hideName) {
1895
+ strBlocks.push(`Error name: ${error.name ?? error.type} ${error.name ? `(${error.type})` : ''}`);
1896
+ }
1897
+ if (!opts?.hideLocation && error.location) {
1898
+ strBlocks.push(`Location: ${error.location}`);
1899
+ }
1900
+ let isHttp = false;
1901
+ if (!opts?.hideHttp && error instanceof CommonsHttpError) {
1902
+ strBlocks.push(httpErrorResponseToString(error.httpError, {
1903
+ hideBody: opts?.hideItems || opts?.hideBody,
1904
+ hideHeaders: opts?.hideHeaders,
1905
+ hideMessage: error.message.indexOf(error.httpError.message) >= 0
1906
+ }));
1907
+ isHttp = true;
1908
+ }
1909
+ if (error.type === 'CommonsActionError') {
1910
+ const actionError = error;
1911
+ if (actionError.actionContext) {
1912
+ strBlocks.push(commonsActionErrorContextToString(actionError, opts));
1913
+ }
1914
+ if (!opts?.hideHttp && actionError.httpError instanceof HttpErrorResponse) {
1915
+ strBlocks.push(httpErrorResponseToString(actionError.httpError, {
1916
+ hideBody: opts?.hideItems || opts?.hideBody,
1917
+ hideHeaders: opts?.hideHeaders,
1918
+ hideMessage: error.message.indexOf(actionError.httpError.message) >= 0
1919
+ }));
1920
+ isHttp = true;
1921
+ }
1922
+ }
1923
+ if (!opts?.hideDetails && error.details) {
1924
+ strBlocks.push(`Details: ${stringify(error.details)}`);
1925
+ }
1926
+ if (!opts?.hideCause && (!isHttp || !(error.cause instanceof HttpErrorResponse))) {
1927
+ strBlocks.push(errorCauseToString(error, opts));
1928
+ }
1929
+ if (!opts?.hideStack && error.stack) {
1930
+ strBlocks.push(`Stack trace:\n${error.stack}`);
1931
+ }
1932
+ return strBlocks.filter(s => s.trim().length > 0).join('\n');
1933
+ }
1934
+ /**
1935
+ * Writes commons action error info from context as string.
1936
+ * @param error Commons action error.
1937
+ * @param opts Options for hiding parts of error:
1938
+ * - hideItems Hides all item related information (item, form item, submit item, ...).
1939
+ * - hideActionData Hides action data.
1940
+ * - hideQueryParams Hides query params.
1941
+ */
1942
+ function commonsActionErrorContextToString(error, opts) {
1943
+ let paramsMessage = '';
1944
+ if (error.actionContext?.parameters) {
1945
+ if (error.actionContext?.parameters.itemId) {
1946
+ paramsMessage += `[itemId: ${error.actionContext.parameters.itemId}]`;
1947
+ }
1948
+ if (!opts?.hideItems && error.actionContext?.parameters.item) {
1949
+ paramsMessage += `[item: ${stringify(error.actionContext.parameters.item)}]`;
1950
+ }
1951
+ if (!opts?.hideActionData && error.actionContext?.parameters.actionData) {
1952
+ paramsMessage += Object.entries(error.actionContext?.parameters.actionData).reduce((acc, [key, value]) => `${acc}[actionData ${key}: ${stringify(value)}]`, '');
1953
+ }
1954
+ if (!opts?.hideQueryParams && error.actionContext?.parameters.dataListParams) {
1955
+ paramsMessage += `[dataListParams: ${stringify(error.actionContext.parameters.dataListParams)}]`;
1956
+ }
1957
+ if (!opts?.hideItems && error.actionContext?.parameters.formItem) {
1958
+ paramsMessage += `[formItem: ${stringify(error.actionContext.parameters.formItem)}]`;
1959
+ }
1960
+ if (!opts?.hideItems && error.actionContext?.parameters.submitResult) {
1961
+ paramsMessage += `[formItem: ${stringify(error.actionContext.parameters.submitResult)}]`;
1962
+ }
1963
+ if (error.actionContext?.parameters.locale) {
1964
+ paramsMessage += `[locale: ${stringify(error.actionContext.parameters.locale)}]`;
1965
+ }
1966
+ }
1967
+ return paramsMessage;
1968
+ }
1969
+ /**
1970
+ * Writes cause of an error as string.
1971
+ * @param error Error.
1972
+ * @param opts Options for hiding parts of error:
1973
+ * - causeOnErrorOnly Prints only if cause is instance of error.
1974
+ * - causeAsJson Print error cause as a JSON (by default, if error only message and name will be printed).
1975
+ */
1976
+ function errorCauseToString(error, opts) {
1977
+ // if already logged as http error, check that cause is not also http error (cause it is usually duplicated)
1978
+ if (error.cause && (!opts?.causeOnErrorOnly || error.cause instanceof Error)) {
1979
+ const needsStringify = opts?.causeAsJson || !(error.cause instanceof Error);
1980
+ if (!opts?.causeOnErrorOnly || error.cause instanceof Error) {
1981
+ return ('Caused by: ' +
1982
+ (needsStringify ? stringify(error.cause) : `${error.cause.message}${error.cause.name ? ` (${error.cause.name})` : ''}`));
1983
+ }
1984
+ }
1985
+ return '';
1986
+ }
1987
+
1988
+ class CommonsErrorHandler {
1989
+ constructor() {
1990
+ this.logger = LoggerService.get();
1991
+ }
1992
+ static { this.logCategory = 'ErrorHandler'; }
1993
+ handleError(error) {
1994
+ if (error instanceof ACommonsErrorBase || error instanceof HttpErrorResponse) {
1995
+ const logLevel = getErrorLogLevel(error);
1996
+ this.logger.log(error, logLevel);
1997
+ }
1998
+ else {
1999
+ this.logger.error('Unexpected error occurred', error);
2000
+ }
2001
+ }
2002
+ }
2003
+
2004
+ function boolean$Attribute(value) {
2005
+ return isObservable(value) ? value : of(booleanAttribute(value));
2006
+ }
2007
+ function number$Attribute(value) {
2008
+ return isObservable(value) ? value : of(numberAttribute(value));
2009
+ }
2010
+ const toObservable = (value) => {
2011
+ return isObservable(value) ? value : of(value);
2012
+ };
2013
+ const itemIdToNumber = (value) => {
2014
+ if (typeof value === 'number') {
2015
+ return value;
2016
+ }
2017
+ else if (typeof value === 'string') {
2018
+ const num = +value;
2019
+ if (!isNaN(num)) {
2020
+ return num;
2021
+ }
2022
+ throw new CommonsInternalError(`ItemId is a string, but could not be transformed to number: ${value}`);
2023
+ }
2024
+ else {
2025
+ throw new CommonsInternalError(`ItemId is not a number: ${value}`);
2026
+ }
2027
+ };
2028
+ const itemIdToString = (value) => {
2029
+ if (typeof value === 'string') {
2030
+ return value;
2031
+ }
2032
+ else {
2033
+ throw new CommonsInternalError(`ItemId is not a string: ${value}`);
2034
+ }
2035
+ };
2036
+ const itemIdToDefined = (value) => {
2037
+ if (typeof value === 'undefined') {
2038
+ throw new CommonsInternalError(`ItemId is not defined: ${value}`);
2039
+ }
2040
+ else {
2041
+ return value;
2042
+ }
2043
+ };
2044
+ const valueToDefined = (value) => {
2045
+ if (typeof value === 'undefined' || value === null) {
2046
+ throw new CommonsInternalError(`Value is null or not defined: ${value}`);
2047
+ }
2048
+ else {
2049
+ return value;
2050
+ }
2051
+ };
2052
+
2053
+ function toastMessage(messageService, title, message, severity = 'success', icon) {
2054
+ const notification = { severity: severity, summary: title, detail: message, life: severity === 'error' ? 10000 : 5000, icon: icon };
2055
+ messageService.add(notification);
2056
+ return notification;
2057
+ }
2058
+
2059
+ function removeRouteEmptyPathSegments(path) {
2060
+ const filteredPath = path.filter(ps => typeof ps === 'string' && ps.length > 0);
2061
+ return filteredPath.length > 0 ? filteredPath : [''];
2062
+ }
2063
+ function appendRoutePathToBasePath(basePath, path) {
2064
+ if (path.length > 0) {
2065
+ if (path[0].startsWith('/')) {
2066
+ return path;
2067
+ }
2068
+ else if (path[0].startsWith('../')) {
2069
+ throw new CommonsInternalError('Not implemented', { name: 'RouteUtilsError' });
2070
+ }
2071
+ else {
2072
+ return removeRouteEmptyPathSegments([...basePath, ...path]);
2073
+ }
2074
+ }
2075
+ else {
2076
+ return basePath;
2077
+ }
2078
+ }
2079
+ function doesUrlMatchRouterLink(link, url) {
2080
+ if (typeof url === 'string' && url.startsWith('/')) {
2081
+ url = url.substring(1);
2082
+ }
2083
+ else if (Array.isArray(url) && url.length > 0 && url[0].startsWith('/')) {
2084
+ url[0] = url[0].substring(1);
2085
+ }
2086
+ const routeSegments = Array.isArray(link) ? link : link.split('/');
2087
+ const urlSegments = Array.isArray(url) ? url : url.split('#')[0].split('?')[0].split('/');
2088
+ if (routeSegments.length > 0 && urlSegments.length > 0) {
2089
+ for (let i = 0; i < routeSegments.length; i++) {
2090
+ if (i < urlSegments.length) {
2091
+ if (routeSegments[i] !== urlSegments[i]) {
2092
+ return false;
2093
+ }
2094
+ }
2095
+ else {
2096
+ break;
2097
+ }
2098
+ }
2099
+ return true;
2100
+ }
2101
+ return false;
2102
+ }
2103
+ function adjustRouteMenuLazyChildrenRouterLinks(rootMenuItem, lazyChildren) {
2104
+ return lazyChildren.map(i => {
2105
+ const childMenuItem = { ...i };
2106
+ if (childMenuItem.routerLink) {
2107
+ childMenuItem.routerLink = appendRoutePathToBasePath(rootMenuItem.routerLink, typeof childMenuItem.routerLink === 'string' ? [childMenuItem.routerLink] : childMenuItem.routerLink);
2108
+ }
2109
+ if (Array.isArray(childMenuItem.items)) {
2110
+ childMenuItem.items = adjustRouteMenuLazyChildrenRouterLinks(rootMenuItem, childMenuItem.items);
2111
+ }
2112
+ return childMenuItem;
2113
+ });
2114
+ }
2115
+
2116
+ function findTemplateByName(templates, name) {
2117
+ return templates.find(t => t.getType() === name)?.template ?? null;
2118
+ }
2119
+
2120
+ function getI18nAsync(translate, params, ...keys) {
2121
+ return translate.stream(keys, params).pipe(map(i18n => selectI18n(keys, i18n)));
2122
+ }
2123
+ function getI18n(translate, params, ...keys) {
2124
+ const i18n = translate.instant(keys, params);
2125
+ return selectI18n(keys, i18n);
2126
+ }
2127
+ function populateI18nParams(item, params = {}) {
2128
+ const paramsRes = { ...params };
2129
+ if (item) {
2130
+ paramsRes.item = item;
2131
+ }
2132
+ return paramsRes;
2133
+ }
2134
+ function selectI18n(keys, i18n) {
2135
+ for (const key of keys) {
2136
+ if (key !== i18n[key]) {
2137
+ return i18n[key];
2138
+ }
2139
+ }
2140
+ return null;
2141
+ }
2142
+
2143
+ function getI18nForError(translate, error, params = {}) {
2144
+ const i18nParams = getI18nErrorParams(error, params);
2145
+ if (error.messageCode) {
2146
+ const keys = [`errors.${error.messageCode}`, `messages.${error.messageCode}`];
2147
+ const i18n = getI18n(translate, i18nParams, ...keys);
2148
+ if (i18n) {
2149
+ return i18n;
2150
+ }
2151
+ }
2152
+ return getI18n(translate, i18nParams, error.message);
2153
+ }
2154
+ function getI18nErrorParams(error, params = {}) {
2155
+ const paramsRes = { ...params };
2156
+ paramsRes.errorStatus = '';
2157
+ paramsRes.errorMessage = '';
2158
+ if (isHttpErrorResponse(error)) {
2159
+ const httpError = getHttpErrorResponse(error);
2160
+ paramsRes.errorStatus = httpError?.status;
2161
+ paramsRes.errorMessage = httpError?.message;
2162
+ paramsRes.errorStatusDescription = httpError?.statusText;
2163
+ }
2164
+ paramsRes.error = error;
2165
+ return paramsRes;
2166
+ }
2167
+
2168
+ const reflectTypeNameKey = 'typeName';
2169
+ const reflectEnumNameKey = 'enumName';
2170
+ /**
2171
+ * Defines type name decorator.
2172
+ * @param targetType class.
2173
+ * @param typeName Name of the type.
2174
+ */
2175
+ function defineReflectTypeName(targetType, typeName) {
2176
+ if (!Reflect.hasOwnMetadata(reflectTypeNameKey, targetType)) {
2177
+ Reflect.defineMetadata(reflectTypeNameKey, typeName, targetType);
2178
+ }
2179
+ }
2180
+ /**
2181
+ * Defines enum name decorator.
2182
+ * @param targetType enum object.
2183
+ * @param enumName Name of the enum.
2184
+ */
2185
+ function defineReflectEnumName(targetType, enumName) {
2186
+ if (!Reflect.hasOwnMetadata(reflectEnumNameKey, targetType)) {
2187
+ Reflect.defineMetadata(reflectEnumNameKey, enumName, targetType);
2188
+ }
2189
+ }
2190
+ /**
2191
+ * Gets type name from reflect metadata.
2192
+ * @param type Class.
2193
+ */
2194
+ function findReflectTypeName(type) {
2195
+ if (!type) {
2196
+ return null;
2197
+ }
2198
+ const typeName = Reflect.getMetadata(reflectTypeNameKey, type);
2199
+ if (typeName) {
2200
+ return typeName;
2201
+ }
2202
+ LoggerService.get().debug('WARNING: Reflect metadata could not be found for type, you might experience some issues in production build.', type?.name);
2203
+ return type.name;
2204
+ }
2205
+ /**
2206
+ * Gets type name from either decorator or reflect metadata.
2207
+ * @param type Class.
2208
+ */
2209
+ function reflectTypeNameExists(type) {
2210
+ return Reflect.hasOwnMetadata(reflectTypeNameKey, type);
2211
+ }
2212
+ /**
2213
+ * Gets enum name from either decorator or reflect metadata.
2214
+ * @param enumType Class.
2215
+ */
2216
+ function findReflectEnumName(enumType) {
2217
+ const enumName = Reflect.getMetadata(reflectEnumNameKey, enumType);
2218
+ if (enumName) {
2219
+ return enumName;
2220
+ }
2221
+ LoggerService.get().debug(`WARNING: Reflect metadata could not be found for enum ${typeof enumType === 'object' ? Object.keys(enumType) : enumType}`, {
2222
+ name: 'TypeUtilsError',
2223
+ enumType: enumType
2224
+ });
2225
+ return null;
2226
+ }
2227
+
2228
+ function getI18nClassNameAsync(translate, classType, singular) {
2229
+ const typeName = findReflectTypeName(classType);
2230
+ return getI18nTypeNameAsync(translate, typeName ?? '', singular);
2231
+ }
2232
+ function getI18nClassName(translate, classType, singular) {
2233
+ const typeName = findReflectTypeName(classType);
2234
+ return getI18nTypeName(translate, typeName ?? '', singular);
2235
+ }
2236
+ function getI18nTypeNameAsync(translate, typeName, singular) {
2237
+ const keys = getI18nTypeNameKeys(typeName, singular);
2238
+ return getI18nAsync(translate, undefined, ...keys);
2239
+ }
2240
+ function getI18nTypeName(translate, typeName, singular) {
2241
+ const keys = getI18nTypeNameKeys(typeName, singular);
2242
+ return getI18n(translate, undefined, ...keys);
2243
+ }
2244
+ function getI18nClassTabKey(classType, tab) {
2245
+ const typeName = findReflectTypeName(classType);
2246
+ return getI18nTypeTabKey(typeName ?? '', tab);
2247
+ }
2248
+ function getI18nTypeTabKey(typeName, tab) {
2249
+ return getI18nTypeKeyBasePath(typeName, 'tabs', tab);
2250
+ }
2251
+ function getI18nClassGroupKey(classType, group) {
2252
+ const typeName = findReflectTypeName(classType);
2253
+ return getI18nTypeGroupKey(typeName ?? '', group);
2254
+ }
2255
+ function getI18nTypeGroupKey(typeName, group) {
2256
+ return getI18nTypeKeyBasePath(typeName, 'groups', group);
2257
+ }
2258
+ function getI18nClassPropertyKey(classType, property) {
2259
+ const typeName = findReflectTypeName(classType);
2260
+ return getI18nTypePropertyKey(typeName ?? '', property);
2261
+ }
2262
+ function getI18nTypePropertyKey(typeName, property) {
2263
+ return getI18nTypeKeyBasePath(typeName, 'properties', property);
2264
+ }
2265
+ function getI18nClassKeyBasePath(classType, ...path) {
2266
+ const typeName = findReflectTypeName(classType);
2267
+ return getI18nTypeKeyBasePath(typeName ?? '', ...path);
2268
+ }
2269
+ function getI18nTypeKeyBasePath(typeName, ...path) {
2270
+ return `${typeName.length ? `${typeName}.` : ''}${path.join('.')}`;
2271
+ }
2272
+ function getI18nClassParams(translate, classType, item, params = {}) {
2273
+ const typeName = findReflectTypeName(classType);
2274
+ return getI18nTypeParams(translate, typeName ?? undefined, item, params);
2275
+ }
2276
+ function getI18nTypeParams(translate, typeName, item, params = {}) {
2277
+ const i18nTypeName = typeName ? getI18nTypeName(translate, typeName, true) : null;
2278
+ return populateI18nTypeParams(i18nTypeName ?? undefined, item, params);
2279
+ }
2280
+ function getI18nClassParamsAsync(translate, classType, item, params = {}) {
2281
+ const typeName = findReflectTypeName(classType);
2282
+ return getI18nTypeParamsAsync(translate, typeName ?? undefined, item, params);
2283
+ }
2284
+ function getI18nTypeParamsAsync(translate, typeName, item, params = {}) {
2285
+ return (typeName ? getI18nTypeNameAsync(translate, typeName, true) : of(null)).pipe(map(i18nTypeName => populateI18nTypeParams(i18nTypeName ?? undefined, item, params)));
2286
+ }
2287
+ function populateI18nTypeParams(i18nTypeName, item, params = {}) {
2288
+ const paramsRes = { ...params };
2289
+ if (i18nTypeName) {
2290
+ paramsRes.typeName = i18nTypeName;
2291
+ }
2292
+ return populateI18nParams(item, paramsRes);
2293
+ }
2294
+ function getI18nTypeNameKeys(typeName, singular) {
2295
+ const keys = [];
2296
+ if (typeof singular !== 'undefined') {
2297
+ keys.push(singular ? `${typeName}.nameSingular` : `${typeName}.namePlural`);
2298
+ }
2299
+ keys.push(`${typeName.length ? `${typeName}.` : ''}name`);
2300
+ return keys;
2301
+ }
2302
+
2303
+ /* eslint-disable no-console */
2304
+ class LogPublisherConsoleService {
2305
+ addEntry(entry) {
2306
+ let prefix = `${entry.timestampFormatted}`;
2307
+ if (entry.category)
2308
+ prefix += ` [${entry.category}]`;
2309
+ prefix += ':';
2310
+ const message = `${entry.message}${entry.messageDetails ? `\n${entry.messageDetails}` : ''}`;
2311
+ const logParams = [prefix, message];
2312
+ if (entry.error) {
2313
+ logParams.push(`\n${getErrorName(entry.error)}:`, entry.error);
2314
+ }
2315
+ if (entry.data?.length) {
2316
+ logParams.push(`\nData:\n`, ...entry.data);
2317
+ }
2318
+ switch (entry.level) {
2319
+ case LogLevelEnum.Trace:
2320
+ console.trace(...logParams);
2321
+ break;
2322
+ case LogLevelEnum.Debug:
2323
+ console.debug(...logParams);
2324
+ break;
2325
+ case LogLevelEnum.Log:
2326
+ console.log(...logParams);
2327
+ break;
2328
+ case LogLevelEnum.Info:
2329
+ console.info(...logParams);
2330
+ break;
2331
+ case LogLevelEnum.Warning:
2332
+ console.warn(...logParams);
2333
+ break;
2334
+ case LogLevelEnum.Error:
2335
+ console.error(...logParams);
2336
+ break;
2337
+ }
2338
+ }
2339
+ }
2340
+
2341
+ class BooleanPipe {
2342
+ transform(value, yes, no, icon = false) {
2343
+ if (typeof value === 'boolean') {
2344
+ if (icon) {
2345
+ return value ? yes ?? 'pi pi-check' : no ?? 'pi pi-times';
2346
+ }
2347
+ else {
2348
+ return value ? yes ?? 'general.yes' : no ?? 'general.no';
2349
+ }
2350
+ }
2351
+ else {
2352
+ return value;
2353
+ }
2354
+ }
2355
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: BooleanPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
2356
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.2", ngImport: i0, type: BooleanPipe, isStandalone: true, name: "mngBoolean" }); }
2357
+ }
2358
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: BooleanPipe, decorators: [{
2359
+ type: Pipe,
2360
+ args: [{
2361
+ standalone: true,
2362
+ name: 'mngBoolean',
2363
+ pure: true
2364
+ }]
2365
+ }] });
2366
+
2367
+ class ClassMapPipe {
2368
+ transform(className, classNameMapFn, item) {
2369
+ if (classNameMapFn && typeof classNameMapFn === 'function') {
2370
+ return classNameMapFn(className, item);
2371
+ }
2372
+ else {
2373
+ return className ?? '';
2374
+ }
2375
+ }
2376
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: ClassMapPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
2377
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.2", ngImport: i0, type: ClassMapPipe, isStandalone: true, name: "mngClassMap" }); }
2378
+ }
2379
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: ClassMapPipe, decorators: [{
2380
+ type: Pipe,
2381
+ args: [{
2382
+ standalone: true,
2383
+ name: 'mngClassMap',
2384
+ pure: true
2385
+ }]
2386
+ }] });
2387
+
2388
+ class EnumPipe {
2389
+ transform(value, enumDesc, i18nPath) {
2390
+ if (!value || (typeof value !== 'number' && typeof value !== 'string')) {
2391
+ return value;
2392
+ }
2393
+ const enumConstantName = !enumDesc || enumDesc.nameAsValue ? value : getEnumConstantNameFromObject(enumDesc.type, value) ?? value;
2394
+ if (typeof i18nPath === 'undefined' && enumDesc) {
2395
+ i18nPath = enumDesc.i18nBaseKey === undefined ? findReflectEnumName(enumDesc.type) : null;
2396
+ }
2397
+ return i18nPath ? `${i18nPath}.${enumConstantName}` : enumConstantName;
2398
+ }
2399
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: EnumPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
2400
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.2", ngImport: i0, type: EnumPipe, isStandalone: true, name: "mngEnum" }); }
2401
+ }
2402
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: EnumPipe, decorators: [{
2403
+ type: Pipe,
2404
+ args: [{
2405
+ standalone: true,
2406
+ name: 'mngEnum',
2407
+ pure: true
2408
+ }]
2409
+ }] });
2410
+
2411
+ /**
2412
+ * Imitation of JSONPath Syntax. Supports:
2413
+ * - Root object notation with '$'
2414
+ * - Dot notation (e.g.: $.foo.bar), no bracket notation for properties
2415
+ * - Array notation (e.g.: [0])
2416
+ */
2417
+ class JsonPathPipe {
2418
+ transform(value, path = '') {
2419
+ return getObjectPropertyByPath(value, path);
2420
+ }
2421
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: JsonPathPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
2422
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.2", ngImport: i0, type: JsonPathPipe, isStandalone: true, name: "mngJsonPath" }); }
2423
+ }
2424
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: JsonPathPipe, decorators: [{
2425
+ type: Pipe,
2426
+ args: [{
2427
+ standalone: true,
2428
+ name: 'mngJsonPath',
2429
+ pure: true
2430
+ }]
2431
+ }] });
2432
+
2433
+ class EnumeratePipe {
2434
+ constructor() {
2435
+ this.translate = inject(TranslateService);
2436
+ }
2437
+ transform(value, jsonPath = '$', valueSeparator = ', ', emptyValueReturn = '/', i18nBaseKey = '') {
2438
+ if (!value) {
2439
+ return emptyValueReturn;
2440
+ }
2441
+ i18nBaseKey = getEnumerationI18nBaseKey(i18nBaseKey);
2442
+ return Array.from(value)
2443
+ .map(i => {
2444
+ const itemEnumerate = toEnumerationI18nEnumerate(i, jsonPath, i18nBaseKey);
2445
+ itemEnumerate.i18n = this.translate.instant(itemEnumerate.i18nKey);
2446
+ // return i18n only if used and transl. was found
2447
+ return selectEnumerationI18n(itemEnumerate, i18nBaseKey);
2448
+ })
2449
+ .join(valueSeparator);
2450
+ }
2451
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: EnumeratePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
2452
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.2", ngImport: i0, type: EnumeratePipe, isStandalone: true, name: "mngEnumerate" }); }
2453
+ }
2454
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: EnumeratePipe, decorators: [{
2455
+ type: Pipe,
2456
+ args: [{
2457
+ standalone: true,
2458
+ name: 'mngEnumerate',
2459
+ pure: true
2460
+ }]
2461
+ }] });
2462
+ function getEnumerationI18nBaseKey(baseKey) {
2463
+ return baseKey.endsWith('.') ? baseKey?.substring(0, baseKey.length - 1) : baseKey;
2464
+ }
2465
+ function selectEnumerationI18n(value, baseKey) {
2466
+ return baseKey && value.i18nKey === value.i18n ? value.value : value.i18n;
2467
+ }
2468
+ function toEnumerationI18nEnumerate(value, jsonPath, baseKey) {
2469
+ const valueTrans = new JsonPathPipe().transform(value, jsonPath);
2470
+ const valueAsString = valueTrans.toString();
2471
+ return {
2472
+ value: valueAsString,
2473
+ i18nKey: baseKey ? `${baseKey}.${valueAsString}` : valueAsString,
2474
+ i18n: valueAsString
2475
+ };
2476
+ }
2477
+
2478
+ class EnumerateAsyncPipe {
2479
+ constructor() {
2480
+ this.translate = inject(TranslateService);
2481
+ }
2482
+ transform(value, jsonPath = '$', valueSeparator = ', ', emptyValueReturn = '/', i18nBaseKey = '') {
2483
+ i18nBaseKey = getEnumerationI18nBaseKey(i18nBaseKey);
2484
+ return value.pipe(mergeMap(v => {
2485
+ if (!v) {
2486
+ return of([emptyValueReturn]);
2487
+ }
2488
+ return combineLatest(Array.from(v)
2489
+ .map(ai => toEnumerationI18nEnumerate(ai, jsonPath, i18nBaseKey))
2490
+ .map(i => this.translate.stream(i.i18nKey).pipe(map((i18n) => {
2491
+ i.i18n = i18n;
2492
+ return selectEnumerationI18n(i, i18nBaseKey);
2493
+ }))));
2494
+ }), map(i => i.join(valueSeparator)));
2495
+ }
2496
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: EnumerateAsyncPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
2497
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.2", ngImport: i0, type: EnumerateAsyncPipe, isStandalone: true, name: "mngEnumerateAsync" }); }
2498
+ }
2499
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: EnumerateAsyncPipe, decorators: [{
2500
+ type: Pipe,
2501
+ args: [{
2502
+ standalone: true,
2503
+ name: 'mngEnumerateAsync',
2504
+ pure: true
2505
+ }]
2506
+ }] });
2507
+
2508
+ class GetterPipe {
2509
+ transform(value, getterFn, item) {
2510
+ if (typeof getterFn === 'function') {
2511
+ return getterFn(item, value);
2512
+ }
2513
+ return value;
2514
+ }
2515
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: GetterPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
2516
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.2", ngImport: i0, type: GetterPipe, isStandalone: true, name: "mngGetter" }); }
2517
+ }
2518
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: GetterPipe, decorators: [{
2519
+ type: Pipe,
2520
+ args: [{
2521
+ standalone: true,
2522
+ name: 'mngGetter',
2523
+ pure: true
2524
+ }]
2525
+ }] });
2526
+
2527
+ class I18nPropertyPipe {
2528
+ transform(property, model) {
2529
+ return getI18nTypePropertyKey(model.i18nBaseKey, property);
2530
+ }
2531
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: I18nPropertyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
2532
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.2", ngImport: i0, type: I18nPropertyPipe, isStandalone: true, name: "mngI18nProperty" }); }
2533
+ }
2534
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: I18nPropertyPipe, decorators: [{
2535
+ type: Pipe,
2536
+ args: [{
2537
+ standalone: true,
2538
+ name: 'mngI18nProperty',
2539
+ pure: true
2540
+ }]
2541
+ }] });
2542
+
2543
+ class ParametrizePipe {
2544
+ constructor() {
2545
+ this.jsonPath = new JsonPathPipe();
2546
+ }
2547
+ transform(value, itemId, item, data) {
2548
+ let params = {};
2549
+ if (data) {
2550
+ params = {
2551
+ ...params,
2552
+ ...data
2553
+ };
2554
+ }
2555
+ if (item) {
2556
+ params = {
2557
+ ...params,
2558
+ item: escapeHtmlAny(item)
2559
+ };
2560
+ }
2561
+ if (itemId) {
2562
+ params = {
2563
+ ...params,
2564
+ itemId: itemId
2565
+ };
2566
+ }
2567
+ if (typeof value === 'string') {
2568
+ return this.transformString(value, params);
2569
+ }
2570
+ else if (Array.isArray(value) && value.length > 0 && typeof value[0] === 'string') {
2571
+ return value.map((s) => this.transformString(s, params));
2572
+ }
2573
+ else if (typeof value === 'object') {
2574
+ // process only first level citizens
2575
+ const obj = { ...value };
2576
+ for (const key in obj) {
2577
+ const objProp = obj[key];
2578
+ if (typeof objProp === 'string') {
2579
+ obj[key] = this.transformString(objProp, params);
2580
+ }
2581
+ }
2582
+ return obj;
2583
+ }
2584
+ else {
2585
+ return value;
2586
+ }
2587
+ }
2588
+ transformString(s, params) {
2589
+ if ((s.indexOf('/') >= 0 && s.indexOf(':') >= 0 && !s.startsWith('http://') && !s.startsWith('https://')) || s.startsWith(':')) {
2590
+ // this is router link
2591
+ return s
2592
+ .split('/')
2593
+ .map(s => this.parametrizeStringAsRouterLink(s, params))
2594
+ .join('/');
2595
+ }
2596
+ else {
2597
+ // parametrize normally
2598
+ return this.parametrizeString(s, params);
2599
+ }
2600
+ }
2601
+ parametrizeStringAsRouterLink(s, params) {
2602
+ if (s.startsWith(':')) {
2603
+ const itemProperty = s.substring(1);
2604
+ return this.jsonPath.transform(params, itemProperty) ?? '';
2605
+ }
2606
+ else {
2607
+ return s;
2608
+ }
2609
+ }
2610
+ parametrizeString(s, params) {
2611
+ return s.replace(/{{\s?([^{}\s]*)\s?}}/g, (subs, key) => this.jsonPath.transform(params, key) ?? subs);
2612
+ }
2613
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: ParametrizePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
2614
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.2", ngImport: i0, type: ParametrizePipe, isStandalone: true, name: "mngParametrize" }); }
2615
+ }
2616
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: ParametrizePipe, decorators: [{
2617
+ type: Pipe,
2618
+ args: [{
2619
+ standalone: true,
2620
+ name: 'mngParametrize',
2621
+ pure: true
2622
+ }]
2623
+ }] });
2624
+
2625
+ class TemplatePipe {
2626
+ constructor() {
2627
+ this.parametrizePipe = new ParametrizePipe();
2628
+ }
2629
+ transform(value, template) {
2630
+ if (typeof template === 'string') {
2631
+ return this.parametrizePipe.transform(template, undefined, value);
2632
+ }
2633
+ return value;
2634
+ }
2635
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: TemplatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
2636
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.2", ngImport: i0, type: TemplatePipe, isStandalone: true, name: "template" }); }
2637
+ }
2638
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: TemplatePipe, decorators: [{
2639
+ type: Pipe,
2640
+ args: [{
2641
+ standalone: true,
2642
+ name: 'template',
2643
+ pure: true
2644
+ }]
2645
+ }] });
2646
+
2647
+ function TypeName(typeName) {
2648
+ return function (target) {
2649
+ defineReflectTypeName(target, typeName);
2650
+ };
2651
+ }
2652
+ function EnumName(typeName) {
2653
+ return function (target) {
2654
+ defineReflectEnumName(target, typeName);
2655
+ };
2656
+ }
2657
+
2658
+ class TypeRegistry {
2659
+ constructor() {
2660
+ this._logCategory = 'TypeRegistry';
2661
+ this._typeMap = {};
2662
+ this._enumMap = {};
2663
+ }
2664
+ static { this._instance = new TypeRegistry(); }
2665
+ get typeMap() {
2666
+ return this._typeMap;
2667
+ }
2668
+ get enumMap() {
2669
+ return this._enumMap;
2670
+ }
2671
+ /**
2672
+ * Only use one instance of object (out of Angular context)
2673
+ */
2674
+ static get() {
2675
+ return TypeRegistry._instance;
2676
+ }
2677
+ findAttributeDefinitionByClassType(type, attributeName) {
2678
+ const typeName = findReflectTypeName(type);
2679
+ return typeName ? this.findAttributeDefinition(typeName, attributeName) : null;
2680
+ }
2681
+ findAttributeDefinition(typeName, attributeName) {
2682
+ const attributeDefs = this.findAttributesDefinition(typeName);
2683
+ if (!attributeDefs) {
2684
+ return null;
2685
+ }
2686
+ for (const attribute of attributeDefs) {
2687
+ if (attribute.name === attributeName) {
2688
+ return attribute;
2689
+ }
2690
+ }
2691
+ return null;
2692
+ }
2693
+ findAttributesDefinitionByClassType(type) {
2694
+ const typeName = findReflectTypeName(type);
2695
+ return typeName ? this.findAttributesDefinition(typeName) : null;
2696
+ }
2697
+ findAttributesDefinition(typeName) {
2698
+ const typeDef = this.findType(typeName);
2699
+ if (!typeDef || typeof typeDef.getAttributeTypeMap !== 'function') {
2700
+ return null;
2701
+ }
2702
+ return typeDef.getAttributeTypeMap();
2703
+ }
2704
+ findByClassType(type) {
2705
+ const typeName = findReflectTypeName(type);
2706
+ return typeName ? this.findType(typeName) : null;
2707
+ }
2708
+ findType(typeName) {
2709
+ return this._typeMap[typeName];
2710
+ }
2711
+ findEnum(enumName) {
2712
+ return this._enumMap[enumName];
2713
+ }
2714
+ registerTypes(types) {
2715
+ for (const key in types) {
2716
+ this.registerType(types[key], key);
2717
+ }
2718
+ }
2719
+ registerType(type, optTypeName) {
2720
+ // try to find name from metadata
2721
+ let typeName;
2722
+ if (reflectTypeNameExists(type)) {
2723
+ // defined name from optional type name
2724
+ typeName = findReflectTypeName(type) ?? undefined;
2725
+ }
2726
+ else if (optTypeName) {
2727
+ typeName = optTypeName;
2728
+ // register metadata
2729
+ defineReflectTypeName(type, typeName);
2730
+ }
2731
+ if (!typeName) {
2732
+ // this._logger.debug(`WARNING: registering type ${type} failed, because typeName could not be determined and optional name was not provided.`);
2733
+ LoggerService.get().log(`WARNING: registering type ${type} failed, because typeName could not be determined and optional name was not provided.`, LogLevelEnum.Debug, this._logCategory);
2734
+ return;
2735
+ }
2736
+ if (typeof this._typeMap[typeName] !== 'undefined') {
2737
+ // this._logger.debug(`WARNING: registering type ${type} under key ${typeName} skipped, because type already exists for this key.`);
2738
+ LoggerService.get().log(`WARNING: registering type ${type} under key ${typeName} skipped, because type already exists for this key.`, LogLevelEnum.Debug, this._logCategory);
2739
+ }
2740
+ else {
2741
+ this._typeMap[typeName] = type;
2742
+ }
2743
+ }
2744
+ registerEnums(enums) {
2745
+ for (const key in enums) {
2746
+ this.registerEnum(enums[key], key);
2747
+ }
2748
+ }
2749
+ registerEnum(enumType, enumName) {
2750
+ // try to find name from decorator
2751
+ defineReflectEnumName(enumType, enumName);
2752
+ if (typeof this._enumMap[enumName] !== 'undefined') {
2753
+ LoggerService.get().log(`Registering enum ${enumName} skipped, because enum already exists.`, LogLevelEnum.Debug, this._logCategory);
2754
+ }
2755
+ else {
2756
+ this._enumMap[enumName] = enumType;
2757
+ }
2758
+ }
2759
+ }
2760
+
2761
+ var PermissionTypeEnum;
2762
+ (function (PermissionTypeEnum) {
2763
+ PermissionTypeEnum["All"] = "ALL";
2764
+ PermissionTypeEnum["Any"] = "ANY";
2765
+ PermissionTypeEnum["Rbac"] = "ROLE_BASED_ACCESS_CONTROL";
2766
+ PermissionTypeEnum["Service"] = "SERVICE";
2767
+ })(PermissionTypeEnum || (PermissionTypeEnum = {}));
2768
+ class APermissions {
2769
+ constructor(type) {
2770
+ this._authorizationType = type;
2771
+ }
2772
+ get authorizationType() {
2773
+ return this._authorizationType;
2774
+ }
2775
+ }
2776
+ var Permissions;
2777
+ (function (Permissions) {
2778
+ class All extends APermissions {
2779
+ constructor() {
2780
+ super(PermissionTypeEnum.All);
2781
+ this._permissions = [];
2782
+ }
2783
+ static of(...permissions) {
2784
+ const inst = new All();
2785
+ inst.and(...permissions);
2786
+ return inst;
2787
+ }
2788
+ get permissions() {
2789
+ return this._permissions;
2790
+ }
2791
+ and(...permissions) {
2792
+ this._permissions.push(...permissions);
2793
+ return this;
2794
+ }
2795
+ }
2796
+ Permissions.All = All;
2797
+ class Any extends APermissions {
2798
+ constructor() {
2799
+ super(PermissionTypeEnum.Any);
2800
+ this._permissions = [];
2801
+ }
2802
+ static of(...permissions) {
2803
+ const inst = new Any();
2804
+ inst.or(...permissions);
2805
+ return inst;
2806
+ }
2807
+ get permissions() {
2808
+ return this._permissions;
2809
+ }
2810
+ or(...permissions) {
2811
+ this._permissions.push(...permissions);
2812
+ return this;
2813
+ }
2814
+ }
2815
+ Permissions.Any = Any;
2816
+ class Roles extends APermissions {
2817
+ constructor() {
2818
+ super(PermissionTypeEnum.Rbac);
2819
+ this._roles = [];
2820
+ }
2821
+ static of(...roles) {
2822
+ const inst = new Roles();
2823
+ inst.or(...roles);
2824
+ return inst;
2825
+ }
2826
+ get roles() {
2827
+ return this._roles;
2828
+ }
2829
+ and(...roles) {
2830
+ if (this._roles.length === 0) {
2831
+ this._roles.push([]);
2832
+ }
2833
+ this._roles[this._roles.length - 1].push(...roles);
2834
+ return this;
2835
+ }
2836
+ or(...roles) {
2837
+ this._roles.push(...roles.map(s => [s]));
2838
+ return this;
2839
+ }
2840
+ }
2841
+ Permissions.Roles = Roles;
2842
+ class Service extends APermissions {
2843
+ constructor(service) {
2844
+ super(PermissionTypeEnum.Service);
2845
+ this.service = service;
2846
+ }
2847
+ static of(service) {
2848
+ return new Service(service);
2849
+ }
2850
+ }
2851
+ Permissions.Service = Service;
2852
+ })(Permissions || (Permissions = {}));
2853
+
2854
+ function isPermitted(permissions, userRoles) {
2855
+ switch (permissions.authorizationType) {
2856
+ case PermissionTypeEnum.Rbac:
2857
+ return isRbacPermitted(permissions, userRoles);
2858
+ default:
2859
+ throw new CommonsInternalError(`Permission type "${permissions.authorizationType}" not implemented`);
2860
+ }
2861
+ }
2862
+ function isRbacPermitted(permissions, userRoles) {
2863
+ return permissions.roles.some(prg => prg.every(pr => userRoles.indexOf(pr) > -1));
2864
+ }
2865
+
2866
+ class PermissionService {
2867
+ constructor() {
2868
+ this.router = inject(Router);
2869
+ this.injector = inject(Injector);
2870
+ this.commons = inject(CommonsService);
2871
+ this.logger = inject(LoggerService).create('AuthorizationService');
2872
+ }
2873
+ isPermitted(permissions, route, actionCtx) {
2874
+ switch (permissions.authorizationType) {
2875
+ case PermissionTypeEnum.All:
2876
+ return this.isPermittedAll(permissions, route, actionCtx);
2877
+ case PermissionTypeEnum.Any:
2878
+ return this.isPermittedAny(permissions, route, actionCtx);
2879
+ case PermissionTypeEnum.Service:
2880
+ return this.isPermittedService(permissions, route, actionCtx);
2881
+ default:
2882
+ return this.commons.userRoles$.pipe(map(ur => isPermitted(permissions, ur)));
2883
+ }
2884
+ }
2885
+ isPermittedAll(permission, route, actionCtx) {
2886
+ return combineLatest(permission.permissions.map(p => this.isPermitted(p, route, actionCtx))).pipe(map(res => res.every(ip => ip === true)));
2887
+ }
2888
+ isPermittedAny(permission, route, actionCtx) {
2889
+ return combineLatest(permission.permissions.map(p => this.isPermitted(p, route, actionCtx))).pipe(map(res => res.some(ip => ip === true)));
2890
+ }
2891
+ isPermittedService(permission, route, actionCtx) {
2892
+ const serviceInstance = this.injector.get(permission.service);
2893
+ if (!serviceInstance) {
2894
+ this.logger.debug(`WARNING: Service instance could not be retreived for type ${permission.service}`);
2895
+ return of(false);
2896
+ }
2897
+ return serviceInstance.isPermitted(route, this.router.routerState.snapshot, actionCtx);
2898
+ }
2899
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: PermissionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2900
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: PermissionService }); }
2901
+ }
2902
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: PermissionService, decorators: [{
2903
+ type: Injectable
2904
+ }] });
2905
+
2906
+ const permissionGuard = (route) => {
2907
+ const permission = inject(PermissionService);
2908
+ const data = route.data;
2909
+ if (data.permissions) {
2910
+ return permission.isPermitted(data.permissions).pipe(first());
2911
+ }
2912
+ else {
2913
+ return of(true);
2914
+ }
2915
+ };
2916
+
2917
+ class RouteBuilder {
2918
+ constructor(route) {
2919
+ this.routePath = [];
2920
+ this.routeData = { breadcrumb: null };
2921
+ this.children = [];
2922
+ this.menuItemChildren = [];
2923
+ this.menuItemChildrenAfter = []; // append after route children
2924
+ this.route = route;
2925
+ if (this.route.path && this.route.path.length > 0) {
2926
+ this.routePath = [this.route.path];
2927
+ }
2928
+ }
2929
+ static create(path, component) {
2930
+ return new RouteBuilder({
2931
+ path: path,
2932
+ component: component
2933
+ });
2934
+ }
2935
+ static createRedirect(path, redirectTo, pathMatch = 'prefix') {
2936
+ return new RouteBuilder({
2937
+ path: path,
2938
+ redirectTo: redirectTo,
2939
+ pathMatch: pathMatch
2940
+ });
2941
+ }
2942
+ static createLazyRouteModule(path, loadChildren, canMatch) {
2943
+ const route = { path: path, loadChildren: loadChildren };
2944
+ if (canMatch?.length) {
2945
+ route.canMatch = canMatch;
2946
+ }
2947
+ return new RouteBuilder(route);
2948
+ }
2949
+ static createLazyRouteComponent(path, loadComponent, canMatch) {
2950
+ const route = { path: path, loadComponent: loadComponent };
2951
+ if (canMatch?.length) {
2952
+ route.canMatch = canMatch;
2953
+ }
2954
+ return new RouteBuilder(route);
2955
+ }
2956
+ static createFromRoute(route) {
2957
+ return new RouteBuilder(route);
2958
+ }
2959
+ withRoot(routesBuilder) {
2960
+ this.root = routesBuilder;
2961
+ return this;
2962
+ }
2963
+ withParent(parent) {
2964
+ this.parent = parent;
2965
+ this.routePath = removeRouteEmptyPathSegments([...this.parent.routePath, this.route.path ?? '']);
2966
+ return this;
2967
+ }
2968
+ withBreadcrumb(breadcrumb) {
2969
+ this.breadcrumb = breadcrumb;
2970
+ this.routeData.breadcrumb = breadcrumb;
2971
+ return this;
2972
+ }
2973
+ withPageTitle(pageTitle) {
2974
+ this.pageTitle = pageTitle;
2975
+ this.routeData.pageTitle = pageTitle;
2976
+ return this;
2977
+ }
2978
+ withRedirectTo(redirectTo) {
2979
+ this.route.redirectTo = redirectTo;
2980
+ return this;
2981
+ }
2982
+ withPathMatch(pathMatch) {
2983
+ this.route.pathMatch = pathMatch;
2984
+ return this;
2985
+ }
2986
+ withTitle(title) {
2987
+ this.withPageTitle(title);
2988
+ this.withBreadcrumb(title);
2989
+ return this;
2990
+ }
2991
+ withCanActivate(diToken) {
2992
+ if (!this.route.canActivate) {
2993
+ this.route.canActivate = [];
2994
+ }
2995
+ this.route.canActivate.push(diToken);
2996
+ return this;
2997
+ }
2998
+ withCanDeactivate(diToken) {
2999
+ if (!this.route.canDeactivate) {
3000
+ this.route.canDeactivate = [];
3001
+ }
3002
+ this.route.canDeactivate.push(diToken);
3003
+ return this;
3004
+ }
3005
+ withResolver(diToken, name) {
3006
+ if (!this.route.resolve) {
3007
+ this.route.resolve = {};
3008
+ }
3009
+ this.route.resolve[name] = diToken;
3010
+ return this;
3011
+ }
3012
+ withProvider(provider) {
3013
+ if (!this.route.providers) {
3014
+ this.route.providers = [];
3015
+ }
3016
+ this.route.providers.push(provider);
3017
+ return this;
3018
+ }
3019
+ withData(data) {
3020
+ if (!data.breadcrumb) {
3021
+ data.breadcrumb = null;
3022
+ }
3023
+ this.routeData = data;
3024
+ return this;
3025
+ }
3026
+ withCommonsMenuItem(menuItem) {
3027
+ this.menuItem = menuItem;
3028
+ return this;
3029
+ }
3030
+ withMenuItem(icon, label, routerLink, breadcrumb = false) {
3031
+ this.menuItem = this.createMenuItem(icon, label, routerLink);
3032
+ if (breadcrumb && label) {
3033
+ this.withBreadcrumb({
3034
+ label: label
3035
+ });
3036
+ }
3037
+ return this;
3038
+ }
3039
+ /**
3040
+ * Adds menu item child to this instance of menu item.
3041
+ * @param label Label.
3042
+ * @param icon Icon.
3043
+ * @param routerLink Router link.
3044
+ * @param afterRouteChildren If false, menu item child will be appended before route children menu items, at the end otherwise.
3045
+ */
3046
+ withMenuItemChild(label, icon, routerLink, afterRouteChildren = false) {
3047
+ if (afterRouteChildren) {
3048
+ this.menuItemChildrenAfter.push(this.createMenuItem(icon, label, routerLink));
3049
+ }
3050
+ else {
3051
+ this.menuItemChildren.push(this.createMenuItem(icon, label, routerLink));
3052
+ }
3053
+ return this;
3054
+ }
3055
+ /**
3056
+ * Adds menu item child to this instance of menu item.
3057
+ * @param menuItem Configuration object for menu item.
3058
+ * @param afterRouteChildren If false, menu item child will be appended before route children menu items, at the end otherwise.
3059
+ */
3060
+ withCommonsMenuItemChild(menuItem, afterRouteChildren = false) {
3061
+ if (afterRouteChildren) {
3062
+ this.menuItemChildrenAfter.push(menuItem);
3063
+ }
3064
+ else {
3065
+ this.menuItemChildren.push(menuItem);
3066
+ }
3067
+ return this;
3068
+ }
3069
+ withMenuItemLazyChildren() {
3070
+ if (!this.menuItem) {
3071
+ this.menuItem = {};
3072
+ }
3073
+ this.menuItem.lazyChildren = true;
3074
+ return this;
3075
+ }
3076
+ withPermissions(permissions) {
3077
+ this.permissions = permissions;
3078
+ this.withCanActivate(permissionGuard);
3079
+ return this;
3080
+ }
3081
+ addChild(path, component, adjustFn) {
3082
+ const childRouteBuilder = RouteBuilder.create(path, component);
3083
+ adjustFn?.(childRouteBuilder);
3084
+ return this.addChildBuilder(childRouteBuilder);
3085
+ }
3086
+ addChildBuilder(builder) {
3087
+ builder.withParent(this);
3088
+ if (this.root) {
3089
+ builder.withRoot(this.root);
3090
+ }
3091
+ this.children.push(builder);
3092
+ return this;
3093
+ }
3094
+ build() {
3095
+ const angularRoute = {
3096
+ ...this.route
3097
+ };
3098
+ if (angularRoute.data) {
3099
+ angularRoute.data = {
3100
+ ...angularRoute.data,
3101
+ ...this.routeData
3102
+ };
3103
+ }
3104
+ else {
3105
+ angularRoute.data = { ...this.routeData };
3106
+ }
3107
+ // append permissions if not already in route data
3108
+ if (this.permissions && !angularRoute.data.permissions) {
3109
+ angularRoute.data.permissions = this.permissions;
3110
+ }
3111
+ const menu = this.buildMenu();
3112
+ if (menu.length > 0) {
3113
+ angularRoute.data.menuItems = menu;
3114
+ }
3115
+ if ((this.route.children?.length ?? 0) > 0 || this.children.length > 0) {
3116
+ // route has children
3117
+ angularRoute.children = [];
3118
+ if (this.route.children?.length) {
3119
+ angularRoute.children.push(...this.route.children);
3120
+ }
3121
+ if (this.children.length) {
3122
+ for (const childRoute of this.children) {
3123
+ angularRoute.children.push(childRoute.build());
3124
+ }
3125
+ }
3126
+ }
3127
+ if (this.route.canActivate) {
3128
+ angularRoute.canActivate = [...this.route.canActivate];
3129
+ }
3130
+ if (this.route.canActivateChild) {
3131
+ angularRoute.canActivateChild = [...this.route.canActivateChild];
3132
+ }
3133
+ if (this.route.canLoad) {
3134
+ angularRoute.canLoad = [...this.route.canLoad];
3135
+ }
3136
+ if (this.route.canDeactivate) {
3137
+ angularRoute.canDeactivate = [...this.route.canDeactivate];
3138
+ }
3139
+ if (this.route.resolve) {
3140
+ angularRoute.resolve = { ...this.route.resolve };
3141
+ }
3142
+ return angularRoute;
3143
+ }
3144
+ buildMenu() {
3145
+ const menuItemBuild = this.menuItem ? { ...this.menuItem } : null;
3146
+ const routeChildrenMenuItems = this.children.flatMap(child => child.buildMenu());
3147
+ const menuItemChildren = [];
3148
+ const menuItemChildrenBuild = [];
3149
+ if (menuItemBuild?.items) {
3150
+ menuItemChildrenBuild.push(...menuItemBuild.items);
3151
+ }
3152
+ const processMenuItemChild = (child) => {
3153
+ const finalChild = { ...child };
3154
+ if (typeof finalChild.routerLink === 'undefined') {
3155
+ finalChild.routerLink = this.routePath;
3156
+ }
3157
+ if (typeof finalChild.routerLink === 'string') {
3158
+ finalChild.routerLink = [finalChild.routerLink];
3159
+ }
3160
+ if (finalChild.routerLink) {
3161
+ finalChild.routerLink = removeRouteEmptyPathSegments(finalChild.routerLink);
3162
+ }
3163
+ return finalChild;
3164
+ };
3165
+ this.menuItemChildren.forEach(child => menuItemChildren.push(processMenuItemChild(child)));
3166
+ const menuItemChildrenAfterBuild = this.menuItemChildrenAfter.map(child => processMenuItemChild(child));
3167
+ menuItemChildrenBuild.push(...menuItemChildren, ...routeChildrenMenuItems, ...menuItemChildrenAfterBuild);
3168
+ if (!menuItemBuild) {
3169
+ return menuItemChildrenBuild;
3170
+ }
3171
+ menuItemBuild.label = menuItemBuild.label ?? this.pageTitle;
3172
+ if (typeof menuItemBuild.routerLink === 'string') {
3173
+ menuItemBuild.routerLink = [menuItemBuild.routerLink];
3174
+ }
3175
+ menuItemBuild.routerLink = removeRouteEmptyPathSegments(menuItemBuild.routerLink ?? this.routePath);
3176
+ if (menuItemChildrenBuild.length > 0) {
3177
+ menuItemBuild.items = menuItemChildrenBuild;
3178
+ }
3179
+ if (!menuItemBuild.guards) {
3180
+ const guards = this.findMenuItemGuards();
3181
+ if (guards.length > 0) {
3182
+ menuItemBuild.guards = guards;
3183
+ }
3184
+ }
3185
+ if (!menuItemBuild.permissions) {
3186
+ menuItemBuild.permissions = this.findMenuItemPermissions();
3187
+ }
3188
+ return [menuItemBuild];
3189
+ }
3190
+ createMenuItem(icon, label, routerLink) {
3191
+ const menuItem = {};
3192
+ if (icon) {
3193
+ menuItem.icon = icon;
3194
+ }
3195
+ if (label) {
3196
+ menuItem.label = label;
3197
+ }
3198
+ if (routerLink) {
3199
+ menuItem.routerLink = routerLink;
3200
+ }
3201
+ return menuItem;
3202
+ }
3203
+ findMenuItemGuards() {
3204
+ const guards = [];
3205
+ if (this.route.canActivate?.length) {
3206
+ guards.push(...this.route.canActivate);
3207
+ }
3208
+ if (this.parent) {
3209
+ // Check for parent guards that should be included in decision to hide menu item!
3210
+ // Some parent routes might have guards, but no menu items, so this guards must be taken into account here,
3211
+ // because there is no parent menu item to hide.
3212
+ this.parent.findMenuItemGuards().forEach(g => {
3213
+ if (guards.indexOf(g) < 0) {
3214
+ guards.push(g);
3215
+ }
3216
+ });
3217
+ }
3218
+ return guards;
3219
+ }
3220
+ findMenuItemPermissions() {
3221
+ if (this.menuItem?.permissions) {
3222
+ return this.menuItem.permissions;
3223
+ }
3224
+ if (this.routeData.permissions) {
3225
+ // this is already built
3226
+ return this.routeData.permissions;
3227
+ }
3228
+ if (this.permissions) {
3229
+ return this.permissions;
3230
+ }
3231
+ return undefined;
3232
+ }
3233
+ }
3234
+
3235
+ class RoutesBuilder {
3236
+ constructor(layoutRoute) {
3237
+ this.routes = [];
3238
+ this.layoutRoute = layoutRoute?.withRoot(this);
3239
+ this.currentRoute = layoutRoute;
3240
+ }
3241
+ static create() {
3242
+ return new RoutesBuilder();
3243
+ }
3244
+ addAngularRoute(route, builderAdjustFn) {
3245
+ const builder = RouteBuilder.createFromRoute(route);
3246
+ builderAdjustFn?.(builder);
3247
+ return this.addRouteBuilder(builder);
3248
+ }
3249
+ addRouteRedirect(path, redirectTo, pathMatch = 'prefix') {
3250
+ return this.addRouteBuilder(RouteBuilder.createRedirect(path, redirectTo, pathMatch));
3251
+ }
3252
+ addLazyRouteComponent(path, loadComponent, canMatch, builderAdjustFn) {
3253
+ const builder = RouteBuilder.createLazyRouteComponent(path, loadComponent, canMatch);
3254
+ builderAdjustFn?.(builder);
3255
+ return this.addRouteBuilder(builder);
3256
+ }
3257
+ addLazyRouteModule(path, loadChildren, canMatch, builderAdjustFn) {
3258
+ const builder = RouteBuilder.createLazyRouteModule(path, loadChildren, canMatch);
3259
+ builderAdjustFn?.(builder);
3260
+ return this.addRouteBuilder(builder);
3261
+ }
3262
+ addRoute(path, component, builderAdjustFn) {
3263
+ const builder = RouteBuilder.create(path, component);
3264
+ builderAdjustFn?.(builder);
3265
+ return this.addRouteBuilder(builder);
3266
+ }
3267
+ addRouteBuilder(routeBuilder) {
3268
+ this.currentRoute = routeBuilder.withRoot(this);
3269
+ this.routes.push(routeBuilder);
3270
+ return this;
3271
+ }
3272
+ build() {
3273
+ let angularRoutes = [];
3274
+ for (const route of this.routes) {
3275
+ angularRoutes.push(route.build());
3276
+ }
3277
+ if (this.layoutRoute) {
3278
+ const layoutAngularRoute = this.layoutRoute.build();
3279
+ if (angularRoutes.length > 0) {
3280
+ layoutAngularRoute.children = angularRoutes;
3281
+ }
3282
+ angularRoutes = [layoutAngularRoute];
3283
+ }
3284
+ return angularRoutes;
3285
+ }
3286
+ }
3287
+
3288
+ /**
3289
+ * Maps an Observable of data with optional totalCount and data to a data list result object with provided defaults of empty array and count 0.
3290
+ */
3291
+ function mapToDataList() {
3292
+ return function (source) {
3293
+ return new Observable(subscriber => {
3294
+ return source.subscribe({
3295
+ next(value) {
3296
+ subscriber.next({
3297
+ data: value.data ?? [],
3298
+ totalCount: value.totalCount ?? value.data?.length ?? 0
3299
+ });
3300
+ }
3301
+ });
3302
+ });
3303
+ };
3304
+ }
3305
+
3306
+ function commonsInitializerProvider(handler, commonsInit) {
3307
+ return () => commonsInit.initialize(handler);
3308
+ }
3309
+
3310
+ const COMMONS_INITIALIZER_IT = new InjectionToken('COMMONS_INIZIALIZER');
3311
+
3312
+ const LOG_PUBLISHERS = new InjectionToken('LOG_PUBLISHERS');
3313
+
3314
+ class CommonsConfigurationService {
3315
+ static { this._instance = new CommonsConfigurationService(); }
3316
+ static get() {
3317
+ return CommonsConfigurationService._instance;
3318
+ }
3319
+ constructor() {
3320
+ this.jsonSources = [];
3321
+ this.objectSources = [];
3322
+ this.configuration = { ...this.projectEnvironment };
3323
+ /**
3324
+ * returns true if there is no jsonSources
3325
+ */
3326
+ this.skipJsonConfigsLoading = () => this.jsonSources === null || this.jsonSources.length === 0;
3327
+ /**
3328
+ * loads json sources or skips them returning true in both cases
3329
+ * used for `skipJsonSourceInit` configuration parameter
3330
+ */
3331
+ this.loadJsonConfigurations = () => (this.skipJsonConfigsLoading() ? of(true) : this.loadJsonSources());
3332
+ // empty, but needed for private constructor
3333
+ }
3334
+ init(httpClient, logger) {
3335
+ this.http = httpClient;
3336
+ this.logger = logger?.create('ConfigurationService');
3337
+ return this;
3338
+ }
3339
+ /**
3340
+ * Add commons module config.
3341
+ * @param config Module config.
3342
+ */
3343
+ addModuleConfigSource(config) {
3344
+ this.moduleConfig = config;
3345
+ this.mergeConfigs();
3346
+ this.logger?.debug(`Module configuration source added.`);
3347
+ }
3348
+ /**
3349
+ * Add project environment source.
3350
+ * @param environment Environment.
3351
+ */
3352
+ addEnvironmentSource(environment) {
3353
+ this.projectEnvironment = environment;
3354
+ this.mergeConfigs();
3355
+ this.logger?.debug(`Environment configuration source added.`);
3356
+ }
3357
+ /**
3358
+ * Adds new config source from JSON file loaded from HTTP.
3359
+ * @param config Config for JSON file.
3360
+ * @param loadImmediately Load is by default triggered on app initialization. If immediate load is required, pass true.
3361
+ */
3362
+ addJsonSource(config = {}, loadImmediately = false) {
3363
+ if (!config) {
3364
+ config = {};
3365
+ }
3366
+ const url = config?.url ?? 'assets/config/env{{environment}}.json';
3367
+ const enableEnvProdReplace = config?.enableEnvProd ?? false;
3368
+ const sourceInfo = {
3369
+ url: url,
3370
+ isEnvironment: false,
3371
+ environmentEnableEnvProd: enableEnvProdReplace,
3372
+ isLoaded: false
3373
+ };
3374
+ this.jsonSources.push(sourceInfo);
3375
+ this.logger?.debug(`JSON configuration source added: ${url}.`);
3376
+ if (loadImmediately) {
3377
+ return this.loadJsonConfigurations();
3378
+ }
3379
+ else {
3380
+ return of(true);
3381
+ }
3382
+ }
3383
+ /**
3384
+ * Adds new config object from any object.
3385
+ * @param config Config object.
3386
+ */
3387
+ addObjectSource(config) {
3388
+ this.objectSources.push(config);
3389
+ this.logger?.debug(`Object configuration source added.`);
3390
+ this.mergeConfigs();
3391
+ }
3392
+ loadJsonSources() {
3393
+ if (!this.http) {
3394
+ this.logger?.warn('HTTP client was not initialized. Json source cannot be loaded');
3395
+ return of(false);
3396
+ }
3397
+ const httpClient = this.http;
3398
+ return combineLatest(this.jsonSources
3399
+ .filter(source => !source.isLoaded)
3400
+ .map(sourceInfo => {
3401
+ let url = sourceInfo.url;
3402
+ sourceInfo.environment = this.projectEnvironment?.name || (this.projectEnvironment?.production ? (sourceInfo.environmentEnableEnvProd ? 'prod' : null) : 'dev');
3403
+ sourceInfo.isEnvironment = !!sourceInfo.environment;
3404
+ if (sourceInfo.isEnvironment) {
3405
+ url = url.replace('{{environment}}', '.' + sourceInfo.environment);
3406
+ }
3407
+ else {
3408
+ // replace possible environment entry and change source info url
3409
+ url = url.replace('{{environment}}', '');
3410
+ sourceInfo.url = url;
3411
+ }
3412
+ this.logger?.debug(`Loading JSON configuration source from ${url}.`);
3413
+ return httpClient.get(url).pipe(catchError((err) => {
3414
+ if (sourceInfo.isEnvironment) {
3415
+ const noEnvUrl = sourceInfo.url.replace('{{environment}}', '');
3416
+ sourceInfo.environment = null;
3417
+ return httpClient.get(noEnvUrl);
3418
+ }
3419
+ else {
3420
+ this.logger?.warn(`Configuration file ${url} not loaded`, err);
3421
+ return of(false);
3422
+ }
3423
+ }), map(configuration => {
3424
+ if (typeof configuration !== 'object') {
3425
+ return false;
3426
+ }
3427
+ sourceInfo.configuration = configuration;
3428
+ sourceInfo.isLoaded = true;
3429
+ return true;
3430
+ }));
3431
+ })).pipe(map(sourceResults => sourceResults.every(sr => sr)), tap(() => this.mergeConfigs()));
3432
+ }
3433
+ /**
3434
+ * Get configuration.
3435
+ */
3436
+ getConfig() {
3437
+ return this.configuration;
3438
+ }
3439
+ /**
3440
+ * Get configuration value for key.
3441
+ * @param key Configuration key.
3442
+ */
3443
+ getConfigValue(key) {
3444
+ return this.configuration[key] ? this.configuration[key] : null;
3445
+ }
3446
+ /**
3447
+ * Has configuration for key.
3448
+ * @param key Configuration key.
3449
+ */
3450
+ hasConfigKey(key) {
3451
+ return Object.keys(this.configuration).some(k => k === key);
3452
+ }
3453
+ /**
3454
+ * Merges configuration from multiple sources with
3455
+ */
3456
+ mergeConfigs() {
3457
+ let config = {};
3458
+ // 1. object sources have highest priority
3459
+ if (this.objectSources.length) {
3460
+ for (const objConfig of this.objectSources) {
3461
+ config = objectDeepMerge(config, objConfig);
3462
+ }
3463
+ }
3464
+ // 2. JSON sources come next
3465
+ const jsonConfigs = this.jsonSources.filter(source => source.isLoaded && typeof source.configuration === 'object').map(source => source.configuration);
3466
+ if (jsonConfigs.length) {
3467
+ for (const jsonConfig of jsonConfigs) {
3468
+ if (jsonConfig) {
3469
+ config = objectDeepMerge(config, jsonConfig);
3470
+ }
3471
+ }
3472
+ }
3473
+ // 3. project env has the next priority
3474
+ if (this.projectEnvironment) {
3475
+ config = objectDeepMerge(config, this.projectEnvironment);
3476
+ }
3477
+ // 4. module config has the lowest priority
3478
+ if (this.moduleConfig) {
3479
+ config = objectDeepMerge(config, this.moduleConfig);
3480
+ }
3481
+ this.configuration = config;
3482
+ }
3483
+ }
3484
+
3485
+ class CommonsRouterService {
3486
+ constructor(router) {
3487
+ this.router = router;
3488
+ this.logger = inject(LoggerService).create('CommonsRouterService');
3489
+ this.routesLoadedPropKey = '_loadedRoutes';
3490
+ this.currentNavigationModuleKeys = [];
3491
+ this.lazyLoadedRoutesConfig = {};
3492
+ }
3493
+ getRouteLoadedChildren(path) {
3494
+ return this.getOrCreateRouteForModule(this.getModulePathFromRouterLink(path)).loadedRoutes;
3495
+ }
3496
+ getRouteLoadedChildren$(path) {
3497
+ return this.getOrCreateRouteForModule(this.getModulePathFromRouterLink(path)).loadedRoutesSubject.asObservable().pipe(first());
3498
+ }
3499
+ initialize() {
3500
+ this.router.events.subscribe(event => {
3501
+ if (event instanceof NavigationStart) {
3502
+ this.startNavigation(event.url);
3503
+ }
3504
+ else if (event instanceof RouteConfigLoadStart) {
3505
+ this.markNavigationConfigLoad(event.route);
3506
+ }
3507
+ else if (event instanceof RouteConfigLoadEnd) {
3508
+ this.markNavigationConfigLoad(event.route, true);
3509
+ }
3510
+ else if (event instanceof NavigationEnd || event instanceof NavigationCancel || event instanceof NavigationError) {
3511
+ this.finishNavigation();
3512
+ }
3513
+ });
3514
+ }
3515
+ startNavigation(url) {
3516
+ this.currentNavigationPath = url.split('?')[0].split('#')[0];
3517
+ this.currentNavigationModuleKeys = [];
3518
+ }
3519
+ finishNavigation() {
3520
+ if (this.currentNavigationModuleKeys.length) {
3521
+ this.currentNavigationModuleKeys.forEach(k => this.getLoadedRoutesFromRoute(k, true));
3522
+ }
3523
+ this.currentNavigationPath = undefined;
3524
+ }
3525
+ markNavigationConfigLoad(route, isEnd = false) {
3526
+ const routePath = route.path ?? '';
3527
+ let moduleKey = routePath;
3528
+ const currentNavigationPathRoutePathIdx = this.currentNavigationPath?.indexOf(routePath) ?? -1;
3529
+ if (this.currentNavigationPath && currentNavigationPathRoutePathIdx >= 0) {
3530
+ moduleKey = this.currentNavigationPath.substring(0, currentNavigationPathRoutePathIdx + routePath.length);
3531
+ }
3532
+ else if (this.currentNavigationPath && routePath !== this.currentNavigationPath && !routePath.startsWith('/')) {
3533
+ // usually means that redirect to currentNavigationPath was done, additionally, route path was also triggered on lazy routes load
3534
+ moduleKey = `${this.currentNavigationPath}/${routePath}`;
3535
+ }
3536
+ if (!isEnd && this.currentNavigationModuleKeys.indexOf(moduleKey) < 0) {
3537
+ this.currentNavigationModuleKeys.push(moduleKey);
3538
+ }
3539
+ this.logger.trace(`Config load ${isEnd ? 'end' : 'start'} for ${moduleKey} (routePath: ${routePath}; navigationUrl: ${this.currentNavigationPath})`);
3540
+ const config = this.getOrCreateRouteForModule(moduleKey);
3541
+ config.route = route;
3542
+ config.isLoadEnd = isEnd;
3543
+ if (isEnd) {
3544
+ this.getLoadedRoutesFromRoute(moduleKey);
3545
+ }
3546
+ }
3547
+ getLoadedRoutesFromRoute(moduleKey, isFinish = false) {
3548
+ const moduleConfig = this.lazyLoadedRoutesConfig[moduleKey];
3549
+ if (!moduleConfig?.route || Array.isArray(moduleConfig.loadedRoutes)) {
3550
+ return;
3551
+ }
3552
+ moduleConfig.loadedRoutes = moduleConfig.route[this.routesLoadedPropKey];
3553
+ if (!Array.isArray(moduleConfig.loadedRoutes) && isFinish) {
3554
+ // if is called from finish and no lazy loaded routes are matched from router events, try finding in route config, it should be there!
3555
+ this.logger.trace(`Route loadedRoutes for ${moduleKey} not found, searching in router config now`);
3556
+ const route = this.findRouteInRouteConfig(moduleKey);
3557
+ if (route) {
3558
+ moduleConfig.route = route;
3559
+ moduleConfig.loadedRoutes = moduleConfig.route[this.routesLoadedPropKey];
3560
+ }
3561
+ else {
3562
+ this.logger.warn(`Route loadedRoutes for ${moduleKey} were not found in router config`);
3563
+ }
3564
+ }
3565
+ if (typeof moduleConfig.loadedRoutes !== 'undefined') {
3566
+ moduleConfig.loadedRoutesSubject.next(moduleConfig.loadedRoutes);
3567
+ moduleConfig.loadedRoutesSubject.complete();
3568
+ this.logger.trace(`Config load for ${moduleKey} is complete`, moduleConfig);
3569
+ }
3570
+ }
3571
+ /**
3572
+ * Search for route config by module path by recursive scanning of router config tree.
3573
+ * @param modulePath Path of module that is searched.
3574
+ * @param routes Routes to be scanned. If not provided, it starts on root router config.
3575
+ * @private
3576
+ */
3577
+ findRouteInRouteConfig(modulePath, routes = this.router.config) {
3578
+ if (modulePath.startsWith('/')) {
3579
+ modulePath = modulePath.substring(1);
3580
+ }
3581
+ for (const route of routes) {
3582
+ if (typeof route.path === 'undefined') {
3583
+ continue;
3584
+ }
3585
+ let routePath = route.path;
3586
+ if (routePath.startsWith('/')) {
3587
+ routePath = routePath.substring(1);
3588
+ }
3589
+ const longestPathMatch = this.findLongestPathMatch(modulePath, routePath);
3590
+ if (longestPathMatch === null) {
3591
+ continue;
3592
+ }
3593
+ // there is a partial or full match
3594
+ if (route.loadChildren && modulePath === longestPathMatch) {
3595
+ // it's a hit!
3596
+ return route;
3597
+ }
3598
+ else if (route.loadChildren && Array.isArray(route[this.routesLoadedPropKey])) {
3599
+ const result = this.findRouteInRouteConfig(modulePath.substring(longestPathMatch.length, modulePath.length), route[this.routesLoadedPropKey]);
3600
+ if (result) {
3601
+ return result;
3602
+ }
3603
+ }
3604
+ else if (route.children) {
3605
+ const result = this.findRouteInRouteConfig(modulePath.substring(longestPathMatch.length, modulePath.length), route.children);
3606
+ if (result) {
3607
+ return result;
3608
+ }
3609
+ }
3610
+ }
3611
+ return null;
3612
+ }
3613
+ /**
3614
+ * Finds longest path match of source to match string. If match is '', it is considered as a match in Angular routing.
3615
+ * @param source Source string from on which comparison is based.
3616
+ * @param match Match string to which the source is matched to.
3617
+ * @private
3618
+ */
3619
+ findLongestPathMatch(source, match) {
3620
+ const sourceSegments = source.split('/');
3621
+ const matchSegments = match.split('/');
3622
+ if (matchSegments.length === 1 && matchSegments[0] === '') {
3623
+ // it's a hit, because empty route must always be processed (kind of a "abstract" route)
3624
+ return '';
3625
+ }
3626
+ if (sourceSegments[0] === matchSegments[0]) {
3627
+ // there is a match, find how long it is
3628
+ for (let i = 1; i < sourceSegments.length; i++) {
3629
+ if (sourceSegments[i] !== matchSegments[i]) {
3630
+ // end of match
3631
+ return sourceSegments.slice(0, i).join('/');
3632
+ }
3633
+ }
3634
+ // there is full match
3635
+ return sourceSegments.join('/');
3636
+ }
3637
+ return null;
3638
+ }
3639
+ getOrCreateRouteForModule(moduleKey) {
3640
+ if (!this.lazyLoadedRoutesConfig[moduleKey]) {
3641
+ this.lazyLoadedRoutesConfig[moduleKey] = {
3642
+ loadedRoutesSubject: new ReplaySubject(1),
3643
+ isLoadEnd: false
3644
+ };
3645
+ }
3646
+ return this.lazyLoadedRoutesConfig[moduleKey];
3647
+ }
3648
+ getModulePathFromRouterLink(path) {
3649
+ return ('/' + (Array.isArray(path) ? path.join('/') : path)).replace(/\/\//g, '/');
3650
+ }
3651
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: CommonsRouterService, deps: [{ token: i1$1.Router }], target: i0.ɵɵFactoryTarget.Injectable }); }
3652
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: CommonsRouterService }); }
3653
+ }
3654
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: CommonsRouterService, decorators: [{
3655
+ type: Injectable
3656
+ }], ctorParameters: () => [{ type: i1$1.Router }] });
3657
+
3658
+ var CommonsInitEventEnum;
3659
+ (function (CommonsInitEventEnum) {
3660
+ CommonsInitEventEnum[CommonsInitEventEnum["CommonsInitStart"] = 0] = "CommonsInitStart";
3661
+ CommonsInitEventEnum[CommonsInitEventEnum["ConfigSourceModuleLoaded"] = 1] = "ConfigSourceModuleLoaded";
3662
+ CommonsInitEventEnum[CommonsInitEventEnum["ConfigSourceProjectEnvLoaded"] = 2] = "ConfigSourceProjectEnvLoaded";
3663
+ CommonsInitEventEnum[CommonsInitEventEnum["ConfigSourceJsonAdded"] = 3] = "ConfigSourceJsonAdded";
3664
+ CommonsInitEventEnum[CommonsInitEventEnum["ConfigSourceJsonLoaded"] = 4] = "ConfigSourceJsonLoaded";
3665
+ CommonsInitEventEnum[CommonsInitEventEnum["CommonsInitEnd"] = 5] = "CommonsInitEnd";
3666
+ CommonsInitEventEnum[CommonsInitEventEnum["CommonsInitError"] = 6] = "CommonsInitError";
3667
+ })(CommonsInitEventEnum || (CommonsInitEventEnum = {}));
3668
+ class CommonsInitService {
3669
+ constructor() {
3670
+ this.logger = inject(LoggerService);
3671
+ this.logPublishers = inject(LOG_PUBLISHERS, { optional: true });
3672
+ this.config = inject(CommonsConfigurationService);
3673
+ this.commons = inject(CommonsService);
3674
+ this.commonsRouter = inject(CommonsRouterService);
3675
+ this.moduleConfig = inject(COMMONS_MODULE_CONFIG_IT, { optional: true });
3676
+ this.commonsInitializers = inject(COMMONS_INITIALIZER_IT, { optional: true });
3677
+ this.isInitialized = false;
3678
+ this.isInitializedSubject = new ReplaySubject();
3679
+ this.commonsInitServiceEvents = new Subject();
3680
+ }
3681
+ get events$() {
3682
+ return this.commonsInitServiceEvents.asObservable();
3683
+ }
3684
+ get isInitialized$() {
3685
+ return this.isInitializedSubject.asObservable().pipe(take(1));
3686
+ }
3687
+ initialize(handler) {
3688
+ if (this.isInitialized) {
3689
+ return of(void 0);
3690
+ }
3691
+ this.isInitialized = true;
3692
+ LoggerService.configure({ timestampFormat: this.moduleConfig?.log?.timestampFormat });
3693
+ const ctxLogger = this.logger.create('CommonsInitService');
3694
+ ctxLogger.debug('Commons initialization is starting');
3695
+ this.commonsInitServiceEvents.next(CommonsInitEventEnum.CommonsInitStart);
3696
+ // init http client
3697
+ this.httpClient = new HttpClient(handler);
3698
+ // init router
3699
+ this.commonsRouter.initialize();
3700
+ // init configurations with settings from module config
3701
+ this.config.init(this.httpClient, this.logger);
3702
+ this.config.addModuleConfigSource(this.moduleConfig ?? undefined);
3703
+ this.commonsInitServiceEvents.next(CommonsInitEventEnum.ConfigSourceModuleLoaded);
3704
+ if (this.moduleConfig?.configuration?.projectEnvironment) {
3705
+ this.config.addEnvironmentSource(this.moduleConfig.configuration.projectEnvironment);
3706
+ this.commonsInitServiceEvents.next(CommonsInitEventEnum.ConfigSourceProjectEnvLoaded);
3707
+ }
3708
+ // init configurations with settings from module config for json source
3709
+ if (!(this.moduleConfig?.configuration?.skipJsonSourceInit ?? false)) {
3710
+ const jsonSourceEnableEnvProd = this.moduleConfig?.configuration?.jsonSourceEnableEnvProd ?? false;
3711
+ const jsonSource = this.moduleConfig?.configuration?.jsonSource;
3712
+ if (!jsonSource) {
3713
+ this.config.addJsonSource({ enableEnvProd: jsonSourceEnableEnvProd });
3714
+ }
3715
+ else if (Array.isArray(jsonSource)) {
3716
+ jsonSource.forEach(source => this.config.addJsonSource({ url: source, enableEnvProd: jsonSourceEnableEnvProd }));
3717
+ }
3718
+ else {
3719
+ this.config.addJsonSource({ url: jsonSource, enableEnvProd: jsonSourceEnableEnvProd });
3720
+ }
3721
+ this.commonsInitServiceEvents.next(CommonsInitEventEnum.ConfigSourceJsonAdded);
3722
+ }
3723
+ return this.config.loadJsonConfigurations().pipe(mergeMap(() => {
3724
+ if (!(this.moduleConfig?.configuration?.skipJsonSourceInit ?? false)) {
3725
+ this.commonsInitServiceEvents.next(CommonsInitEventEnum.ConfigSourceJsonLoaded);
3726
+ }
3727
+ // init logger
3728
+ LoggerService.init(this.config, this.logPublishers ?? []);
3729
+ if (this.commonsInitializers) {
3730
+ ctxLogger.debug('Project initializers are being initialized');
3731
+ return combineLatest(this.commonsInitializers.map(ci => ci())).pipe(map(res => res));
3732
+ }
3733
+ else {
3734
+ return of(true);
3735
+ }
3736
+ }), map(() => {
3737
+ ctxLogger.debug('Commons initialization is finished');
3738
+ this.commonsInitServiceEvents.next(CommonsInitEventEnum.CommonsInitEnd);
3739
+ this.commonsInitServiceEvents.complete();
3740
+ this.isInitializedSubject.next(true);
3741
+ return this.commons.reset();
3742
+ }), catchError(err => {
3743
+ ctxLogger.warn('Commons initialization failed with error', err);
3744
+ this.commonsInitServiceEvents.next(CommonsInitEventEnum.CommonsInitError);
3745
+ this.commonsInitServiceEvents.complete();
3746
+ this.isInitializedSubject.next(false);
3747
+ return throwError(() => err);
3748
+ }));
3749
+ }
3750
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: CommonsInitService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
3751
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: CommonsInitService }); }
3752
+ }
3753
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: CommonsInitService, decorators: [{
3754
+ type: Injectable
3755
+ }] });
3756
+
3757
+ class LocalStorageService {
3758
+ constructor() {
3759
+ this._configKey = 'CommonsUserPrefs';
3760
+ }
3761
+ buildLocalStorageKey(type, key) {
3762
+ return `${this._configKey}_${type}_${key}`;
3763
+ }
3764
+ getItem(type, key) {
3765
+ const localstorageData = localStorage.getItem(this.buildLocalStorageKey(type, key));
3766
+ if (localstorageData) {
3767
+ return JSON.parse(localstorageData);
3768
+ }
3769
+ return undefined;
3770
+ }
3771
+ setItem(type, key, value) {
3772
+ localStorage.setItem(this.buildLocalStorageKey(type, key), JSON.stringify(value));
3773
+ }
3774
+ removeItem(type, key) {
3775
+ localStorage.removeItem(this.buildLocalStorageKey(type, key));
3776
+ }
3777
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: LocalStorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
3778
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: LocalStorageService }); }
3779
+ }
3780
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: LocalStorageService, decorators: [{
3781
+ type: Injectable
3782
+ }] });
3783
+
3784
+ var StyleSizeEnum;
3785
+ (function (StyleSizeEnum) {
3786
+ StyleSizeEnum[StyleSizeEnum["ExtraSmall"] = 0] = "ExtraSmall";
3787
+ StyleSizeEnum[StyleSizeEnum["Small"] = 1] = "Small";
3788
+ StyleSizeEnum[StyleSizeEnum["Normal"] = 2] = "Normal";
3789
+ StyleSizeEnum[StyleSizeEnum["Large"] = 3] = "Large";
3790
+ StyleSizeEnum[StyleSizeEnum["ExtraLarge"] = 4] = "ExtraLarge";
3791
+ })(StyleSizeEnum || (StyleSizeEnum = {}));
3792
+ var StyleLevelEnum;
3793
+ (function (StyleLevelEnum) {
3794
+ StyleLevelEnum[StyleLevelEnum["Default"] = 0] = "Default";
3795
+ StyleLevelEnum[StyleLevelEnum["Primary"] = 1] = "Primary";
3796
+ StyleLevelEnum[StyleLevelEnum["Secondary"] = 2] = "Secondary";
3797
+ StyleLevelEnum[StyleLevelEnum["Info"] = 3] = "Info";
3798
+ StyleLevelEnum[StyleLevelEnum["Help"] = 4] = "Help";
3799
+ StyleLevelEnum[StyleLevelEnum["Success"] = 5] = "Success";
3800
+ StyleLevelEnum[StyleLevelEnum["Warning"] = 6] = "Warning";
3801
+ StyleLevelEnum[StyleLevelEnum["Danger"] = 7] = "Danger";
3802
+ })(StyleLevelEnum || (StyleLevelEnum = {}));
3803
+
3804
+ class Styles {
3805
+ static { this.BUTTON_ROUNDED_WIDTH_XS = 26; }
3806
+ static { this.BUTTON_ROUNDED_WIDTH_SM = 28; }
3807
+ static { this.BUTTON_ROUNDED_WIDTH = 32; }
3808
+ static { this.BUTTON_ROUNDED_WIDTH_LG = 45; }
3809
+ static { this.ACTION_BUTTON_MARGIN_X = 2; }
3810
+ static { this.TABLE_CELL_PADDING_X = 8; } // left and right paddings are same
3811
+ static { this.TABLE_CELL_PADDING_X_SM = 4; }
3812
+ static { this.TABLE_CELL_PADDING_X_LG = 12; }
3813
+ }
3814
+
3815
+ var CommonsFeatureTypeEnum;
3816
+ (function (CommonsFeatureTypeEnum) {
3817
+ CommonsFeatureTypeEnum[CommonsFeatureTypeEnum["Layout"] = 0] = "Layout";
3818
+ CommonsFeatureTypeEnum[CommonsFeatureTypeEnum["Tableview"] = 1] = "Tableview";
3819
+ CommonsFeatureTypeEnum[CommonsFeatureTypeEnum["DataApiAsClassV1"] = 2] = "DataApiAsClassV1";
3820
+ })(CommonsFeatureTypeEnum || (CommonsFeatureTypeEnum = {}));
3821
+ function provideCommons(config, ...features) {
3822
+ const providers = [
3823
+ // primeng services
3824
+ DialogService,
3825
+ MessageService,
3826
+ ConfirmationService,
3827
+ // services
3828
+ CommonsInitService,
3829
+ CommonsService,
3830
+ CommonsRouterService,
3831
+ PermissionService,
3832
+ LocalStorageService,
3833
+ {
3834
+ provide: COMMONS_MODULE_CONFIG_IT,
3835
+ useValue: config
3836
+ },
3837
+ {
3838
+ provide: TypeRegistry,
3839
+ useFactory: () => TypeRegistry.get()
3840
+ },
3841
+ {
3842
+ provide: CommonsConfigurationService,
3843
+ useFactory: () => CommonsConfigurationService.get()
3844
+ },
3845
+ {
3846
+ provide: APP_INITIALIZER,
3847
+ useFactory: commonsInitializerProvider,
3848
+ deps: [HttpBackend, CommonsInitService],
3849
+ multi: true
3850
+ },
3851
+ {
3852
+ provide: LoggerService,
3853
+ useFactory: () => LoggerService.get()
3854
+ },
3855
+ {
3856
+ provide: LOG_PUBLISHERS,
3857
+ useClass: LogPublisherConsoleService,
3858
+ multi: true
3859
+ },
3860
+ {
3861
+ provide: BROWSER_STORAGE_IT,
3862
+ useFactory: () => localStorage
3863
+ },
3864
+ {
3865
+ provide: ErrorHandler,
3866
+ useClass: CommonsErrorHandler
3867
+ }
3868
+ ];
3869
+ features.forEach(f => {
3870
+ providers.push(...f.providers);
3871
+ });
3872
+ return providers;
3873
+ }
3874
+
3875
+ // action
3876
+
3877
+ /**
3878
+ * Generated bundle index. Do not edit.
3879
+ */
3880
+
3881
+ export { ACommonsErrorBase, APermissions, BROWSER_STORAGE_IT, BooleanPipe, COMMONS_INITIALIZER_IT, COMMONS_MODULE_CONFIG_IT, ClassMapPipe, CommonsConfigurationService, CommonsErrorHandler, CommonsFeatureTypeEnum, CommonsHttpError, CommonsInitEventEnum, CommonsInitService, CommonsInternalError, CommonsRouterService, CommonsService, ComponentDirective, DataProvider, DataProviderInst, DialogKeydownHandlerDirective, EnumName, EnumPipe, EnumerateAsyncPipe, EnumeratePipe, ErrorPageComponent, FilterMatchMode, GetterPipe, I18nPropertyPipe, JsonPathPipe, LOG_PUBLISHERS, LocalStorageService, LogLevelEnum, LogPublisherConsoleService, LoggerService, NotFoundPageComponent, NotificationWrapperComponent, ParametrizePipe, PermissionService, PermissionTypeEnum, Permissions, RouteBuilder, RoutesBuilder, StyleLevelEnum, StyleSizeEnum, Styles, TemplateDirective, TemplatePipe, TypeName, TypeRegistry, adjustRouteMenuLazyChildrenRouterLinks, angularDateFormatHasSeconds, angularDateFormatHasTime, appendRoutePathToBasePath, boolean$Attribute, commonsActionErrorContextToString, commonsErrorToString, commonsInitializerProvider, copyDataListParams, dataListParamsFilterToUrlQuery, dataListParamsFilterValueToUrlString, dataListParamsFiltersToUrlQuery, dataListParamsSortToUrlQuery, dataListParamsToUrlQuery, dateToIsoString, defineReflectEnumName, defineReflectTypeName, doesUrlMatchRouterLink, errorCauseToString, errorToString, escapeHtml, escapeHtmlAny, findReflectEnumName, findReflectTypeName, findTemplateByName, flattenObjectKeys, fromAngularDateFormatToPrime, fromEnumConstantsAsValueArray, fromEnumValuesAsValueArray, fromSubscribeError, fromTableLoadToDataListParams, fromUrlQueryToDataListParams, getEnumConstantName, getEnumConstantNameFromObject, getEnumConstantNames, getEnumConstantNamesFromObject, getEnumConstantValuesAsNumber, getEnumConstantValuesAsString, getEnumerationI18nBaseKey, getErrorLogLevel, getErrorName, getHttpErrorResponse, getHttpErrorResponseStatus, getI18n, getI18nAsync, getI18nClassGroupKey, getI18nClassKeyBasePath, getI18nClassName, getI18nClassNameAsync, getI18nClassParams, getI18nClassParamsAsync, getI18nClassPropertyKey, getI18nClassTabKey, getI18nErrorParams, getI18nForError, getI18nTypeGroupKey, getI18nTypeKeyBasePath, getI18nTypeName, getI18nTypeNameAsync, getI18nTypeParams, getI18nTypeParamsAsync, getI18nTypePropertyKey, getI18nTypeTabKey, getObjectGetters, getObjectProperties, getObjectPropertyByPath, httpErrorResponseToString, isHttpErrorResponse, isPermitted, isRbacPermitted, itemIdToDefined, itemIdToNumber, itemIdToString, mapToDataList, mergeDataListParamsWithDefaults, number$Attribute, objectDeepCopy, objectDeepMerge, permissionGuard, populateI18nParams, populateI18nTypeParams, provideCommons, reflectEnumNameKey, reflectTypeNameExists, reflectTypeNameKey, removeRouteEmptyPathSegments, selectEnumerationI18n, selectI18n, stringify, toEnumerationI18nEnumerate, toObservable, toastMessage, valueToDefined };
3882
+ //# sourceMappingURL=mediusinc-mng-commons-core.mjs.map