@verisoft/ui-core 18.6.0 → 18.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (333) hide show
  1. package/.eslintrc.json +48 -0
  2. package/README.md +52 -3
  3. package/jest.config.ts +21 -0
  4. package/ng-package.json +7 -0
  5. package/package.json +19 -35
  6. package/project.json +36 -0
  7. package/{index.d.ts → src/index.ts} +6 -6
  8. package/src/lib/common/angular-helper.ts +44 -0
  9. package/src/lib/common/constants.ts +5 -0
  10. package/src/lib/common/control.models.ts +71 -0
  11. package/src/lib/common/datasource-component.model.spec.ts +42 -0
  12. package/src/lib/common/datasource-component.model.ts +43 -0
  13. package/{lib/common/deactivate-guard.model.d.ts → src/lib/common/deactivate-guard.model.ts} +5 -4
  14. package/src/lib/common/download-file.ts +20 -0
  15. package/src/lib/common/filter.ts +7 -0
  16. package/{lib/common/icons.d.ts → src/lib/common/icons.ts} +34 -34
  17. package/{lib/common/index.d.ts → src/lib/common/index.ts} +10 -10
  18. package/{lib/common/notificable-property.model.d.ts → src/lib/common/notificable-property.model.ts} +5 -4
  19. package/src/lib/common/rxjs.spec.ts +58 -0
  20. package/src/lib/common/rxjs.ts +21 -0
  21. package/src/lib/components/action-button-group/action-button-group.model.ts +15 -0
  22. package/src/lib/components/action-button-group/action-button.model.ts +15 -0
  23. package/{lib/components/action-button-group/index.d.ts → src/lib/components/action-button-group/index.ts} +2 -2
  24. package/src/lib/components/base-form/base-form-input.component.ts +121 -0
  25. package/src/lib/components/base-form/base-form.component.ts +236 -0
  26. package/src/lib/components/base-form/directives/detail-store.directive.ts +219 -0
  27. package/{lib/components/base-form/index.d.ts → src/lib/components/base-form/index.ts} +4 -4
  28. package/src/lib/components/base-form/models/base-form-input.models.ts +11 -0
  29. package/src/lib/components/base-form/models/base-form.models.ts +31 -0
  30. package/{lib/components/base-form/models/index.d.ts → src/lib/components/base-form/models/index.ts} +2 -2
  31. package/{lib/components/breadcrumb/breadcrumb.model.d.ts → src/lib/components/breadcrumb/breadcrumb.model.ts} +21 -16
  32. package/src/lib/components/breadcrumb/breadcrumb.service.ts +9 -0
  33. package/src/lib/components/breadcrumb/breadcrumbcore.component.ts +115 -0
  34. package/src/lib/components/breadcrumb/index.ts +3 -0
  35. package/{lib/components/button/button.model.d.ts → src/lib/components/button/button.model.ts} +21 -17
  36. package/src/lib/components/button/index.ts +1 -0
  37. package/{lib/components/calendar/calendar.model.d.ts → src/lib/components/calendar/calendar.model.ts} +16 -12
  38. package/src/lib/components/calendar/index.ts +1 -0
  39. package/src/lib/components/checkbox/checkbox.model.ts +8 -0
  40. package/src/lib/components/checkbox/index.ts +1 -0
  41. package/src/lib/components/confirm-dialog/confirm-dialog.model.ts +31 -0
  42. package/src/lib/components/confirm-dialog/index.ts +1 -0
  43. package/{lib/components/dropdown/dropdown.model.d.ts → src/lib/components/dropdown/dropdown.model.ts} +16 -12
  44. package/src/lib/components/dropdown/index.ts +1 -0
  45. package/src/lib/components/dynamic-component/dynamic-component.model.ts +2 -0
  46. package/src/lib/components/dynamic-component/index.ts +1 -0
  47. package/src/lib/components/filter/filter.model.ts +17 -0
  48. package/{lib/components/filter/index.d.ts → src/lib/components/filter/index.ts} +1 -1
  49. package/{lib/components/form-field/form-field.model.d.ts → src/lib/components/form-field/form-field.model.ts} +15 -11
  50. package/src/lib/components/form-field/index.ts +1 -0
  51. package/{lib/components/generic-field/generic-field.model.d.ts → src/lib/components/generic-field/generic-field.model.ts} +10 -6
  52. package/src/lib/components/generic-field/index.ts +1 -0
  53. package/src/lib/components/generic-form/generic-form.component.ts +33 -0
  54. package/{lib/components/generic-form/index.d.ts → src/lib/components/generic-form/index.ts} +1 -1
  55. package/{lib/components/header/header.model.d.ts → src/lib/components/header/header.model.ts} +18 -11
  56. package/src/lib/components/header/index.ts +1 -0
  57. package/src/lib/components/icons/icons.component.ts +17 -0
  58. package/src/lib/components/icons/icons.model.ts +10 -0
  59. package/src/lib/components/icons/index.ts +2 -0
  60. package/{lib/components/index.d.ts → src/lib/components/index.ts} +35 -35
  61. package/src/lib/components/input-group/index.ts +1 -0
  62. package/{lib/components/input-group/input-group.model.d.ts → src/lib/components/input-group/input-group.model.ts} +17 -12
  63. package/src/lib/components/loader/index.ts +1 -0
  64. package/src/lib/components/loader/loader.model.ts +7 -0
  65. package/src/lib/components/multiselect/index.ts +1 -0
  66. package/{lib/components/multiselect/mutiselect.model.d.ts → src/lib/components/multiselect/mutiselect.model.ts} +13 -9
  67. package/src/lib/components/number-input/index.ts +1 -0
  68. package/{lib/components/number-input/number-input.model.d.ts → src/lib/components/number-input/number-input.model.ts} +14 -10
  69. package/{lib/components/page-header/index.d.ts → src/lib/components/page-header/index.ts} +3 -3
  70. package/{lib/components/page-header/page-header.model.d.ts → src/lib/components/page-header/page-header.model.ts} +11 -7
  71. package/src/lib/components/page-header/page-header.service.ts +9 -0
  72. package/src/lib/components/page-header/page-headercore.component.ts +40 -0
  73. package/src/lib/components/password/index.ts +1 -0
  74. package/{lib/components/password/password.model.d.ts → src/lib/components/password/password.model.ts} +25 -19
  75. package/src/lib/components/radiobutton/index.ts +1 -0
  76. package/{lib/components/radiobutton/radiobutton.model.d.ts → src/lib/components/radiobutton/radiobutton.model.ts} +16 -11
  77. package/src/lib/components/section/index.ts +1 -0
  78. package/{lib/components/section/section.model.d.ts → src/lib/components/section/section.model.ts} +11 -7
  79. package/src/lib/components/side-menu/directives/side-menu-service.directive.ts +31 -0
  80. package/{lib/components/side-menu/index.d.ts → src/lib/components/side-menu/index.ts} +4 -4
  81. package/src/lib/components/side-menu/services/side-menu-provider.service.ts +13 -0
  82. package/src/lib/components/side-menu/services/side-menu.service.ts +62 -0
  83. package/src/lib/components/side-menu/side-menu.model.ts +67 -0
  84. package/src/lib/components/slider/index.ts +1 -0
  85. package/{lib/components/slider/slider.model.d.ts → src/lib/components/slider/slider.model.ts} +13 -9
  86. package/src/lib/components/snackbar/index.ts +1 -0
  87. package/src/lib/components/snackbar/snackbar.model.ts +7 -0
  88. package/src/lib/components/stepper/index.ts +1 -0
  89. package/{lib/components/stepper/stepper.model.d.ts → src/lib/components/stepper/stepper.model.ts} +24 -19
  90. package/src/lib/components/switch/index.ts +1 -0
  91. package/src/lib/components/switch/switch.model.ts +8 -0
  92. package/src/lib/components/tab-view/index.ts +1 -0
  93. package/{lib/components/tab-view/tab-view.model.d.ts → src/lib/components/tab-view/tab-view.model.ts} +22 -17
  94. package/src/lib/components/table/column-configuration.ts +38 -0
  95. package/{lib/components/table/index.d.ts → src/lib/components/table/index.ts} +4 -4
  96. package/src/lib/components/table/table-builder.ts +93 -0
  97. package/src/lib/components/table/table-column.directive.ts +62 -0
  98. package/src/lib/components/table/table.models.ts +261 -0
  99. package/src/lib/components/table-filter/index.ts +1 -0
  100. package/{lib/components/table-filter/table-filter.model.d.ts → src/lib/components/table-filter/table-filter.model.ts} +22 -17
  101. package/src/lib/components/textarea/index.ts +1 -0
  102. package/{lib/components/textarea/textarea.model.d.ts → src/lib/components/textarea/textarea.model.ts} +13 -9
  103. package/src/lib/components/textfield/index.ts +1 -0
  104. package/{lib/components/textfield/textfield.model.d.ts → src/lib/components/textfield/textfield.model.ts} +13 -9
  105. package/src/lib/components/tristatecheckbox/index.ts +1 -0
  106. package/src/lib/components/tristatecheckbox/tristatecheckbox.model.ts +8 -0
  107. package/src/lib/components/unsubscribe.component.ts +12 -0
  108. package/src/lib/directives/datasource.directive.ts +275 -0
  109. package/{lib/directives/index.d.ts → src/lib/directives/index.ts} +4 -4
  110. package/src/lib/directives/shortcut.directive.ts +37 -0
  111. package/src/lib/directives/table-datasource.directive.ts +184 -0
  112. package/src/lib/directives/table-filter.directive.ts +69 -0
  113. package/src/lib/format/format.ts +74 -0
  114. package/src/lib/pipes/error/error.codes.ts +11 -0
  115. package/src/lib/pipes/error/error.models.ts +27 -0
  116. package/src/lib/pipes/error/error.pipe.ts +27 -0
  117. package/src/lib/pipes/error/warning.codes.ts +5 -0
  118. package/src/lib/pipes/error/warning.pipe.ts +27 -0
  119. package/src/lib/pipes/helper/enumToList.pipe.ts +16 -0
  120. package/{lib/pipes/index.d.ts → src/lib/pipes/index.ts} +7 -7
  121. package/src/lib/pipes/keyOrFn/keyOrFn.pipe.ts +23 -0
  122. package/src/lib/services/confirm-dialog.service.ts +44 -0
  123. package/{lib/services/index.d.ts → src/lib/services/index.ts} +4 -4
  124. package/src/lib/services/leave-form.service.ts +53 -0
  125. package/src/lib/services/screen-size.service.ts +25 -0
  126. package/src/lib/services/table.service.ts +22 -0
  127. package/src/test-setup.ts +8 -0
  128. package/tsconfig.json +28 -0
  129. package/tsconfig.lib.json +17 -0
  130. package/tsconfig.lib.prod.json +9 -0
  131. package/tsconfig.spec.json +16 -0
  132. package/esm2022/index.mjs +0 -7
  133. package/esm2022/lib/common/angular-helper.mjs +0 -23
  134. package/esm2022/lib/common/constants.mjs +0 -4
  135. package/esm2022/lib/common/control.models.mjs +0 -63
  136. package/esm2022/lib/common/datasource-component.model.mjs +0 -14
  137. package/esm2022/lib/common/deactivate-guard.model.mjs +0 -2
  138. package/esm2022/lib/common/download-file.mjs +0 -13
  139. package/esm2022/lib/common/filter.mjs +0 -7
  140. package/esm2022/lib/common/icons.mjs +0 -2
  141. package/esm2022/lib/common/index.mjs +0 -11
  142. package/esm2022/lib/common/notificable-property.model.mjs +0 -2
  143. package/esm2022/lib/common/rxjs.mjs +0 -11
  144. package/esm2022/lib/components/action-button-group/action-button-group.model.mjs +0 -3
  145. package/esm2022/lib/components/action-button-group/action-button.model.mjs +0 -2
  146. package/esm2022/lib/components/action-button-group/index.mjs +0 -3
  147. package/esm2022/lib/components/base-form/base-form-input.component.mjs +0 -100
  148. package/esm2022/lib/components/base-form/base-form.component.mjs +0 -187
  149. package/esm2022/lib/components/base-form/directives/detail-store.directive.mjs +0 -163
  150. package/esm2022/lib/components/base-form/index.mjs +0 -5
  151. package/esm2022/lib/components/base-form/models/base-form-input.models.mjs +0 -7
  152. package/esm2022/lib/components/base-form/models/base-form.models.mjs +0 -10
  153. package/esm2022/lib/components/base-form/models/index.mjs +0 -3
  154. package/esm2022/lib/components/breadcrumb/breadcrumb.model.mjs +0 -3
  155. package/esm2022/lib/components/breadcrumb/breadcrumb.service.mjs +0 -16
  156. package/esm2022/lib/components/breadcrumb/breadcrumbcore.component.mjs +0 -88
  157. package/esm2022/lib/components/breadcrumb/index.mjs +0 -4
  158. package/esm2022/lib/components/button/button.model.mjs +0 -3
  159. package/esm2022/lib/components/button/index.mjs +0 -2
  160. package/esm2022/lib/components/calendar/calendar.model.mjs +0 -3
  161. package/esm2022/lib/components/calendar/index.mjs +0 -2
  162. package/esm2022/lib/components/checkbox/checkbox.model.mjs +0 -3
  163. package/esm2022/lib/components/checkbox/index.mjs +0 -2
  164. package/esm2022/lib/components/confirm-dialog/confirm-dialog.model.mjs +0 -3
  165. package/esm2022/lib/components/confirm-dialog/index.mjs +0 -2
  166. package/esm2022/lib/components/dropdown/dropdown.model.mjs +0 -3
  167. package/esm2022/lib/components/dropdown/index.mjs +0 -2
  168. package/esm2022/lib/components/dynamic-component/dynamic-component.model.mjs +0 -2
  169. package/esm2022/lib/components/dynamic-component/index.mjs +0 -2
  170. package/esm2022/lib/components/filter/filter.model.mjs +0 -3
  171. package/esm2022/lib/components/filter/index.mjs +0 -2
  172. package/esm2022/lib/components/form-field/form-field.model.mjs +0 -3
  173. package/esm2022/lib/components/form-field/index.mjs +0 -2
  174. package/esm2022/lib/components/generic-field/generic-field.model.mjs +0 -3
  175. package/esm2022/lib/components/generic-field/index.mjs +0 -2
  176. package/esm2022/lib/components/generic-form/generic-form.component.mjs +0 -10
  177. package/esm2022/lib/components/generic-form/index.mjs +0 -2
  178. package/esm2022/lib/components/header/header.model.mjs +0 -4
  179. package/esm2022/lib/components/header/index.mjs +0 -2
  180. package/esm2022/lib/components/icons/icons.component.mjs +0 -29
  181. package/esm2022/lib/components/icons/icons.model.mjs +0 -3
  182. package/esm2022/lib/components/icons/index.mjs +0 -3
  183. package/esm2022/lib/components/index.mjs +0 -36
  184. package/esm2022/lib/components/input-group/index.mjs +0 -2
  185. package/esm2022/lib/components/input-group/input-group.model.mjs +0 -3
  186. package/esm2022/lib/components/loader/index.mjs +0 -2
  187. package/esm2022/lib/components/loader/loader.model.mjs +0 -3
  188. package/esm2022/lib/components/multiselect/index.mjs +0 -2
  189. package/esm2022/lib/components/multiselect/mutiselect.model.mjs +0 -3
  190. package/esm2022/lib/components/number-input/index.mjs +0 -2
  191. package/esm2022/lib/components/number-input/number-input.model.mjs +0 -3
  192. package/esm2022/lib/components/page-header/index.mjs +0 -4
  193. package/esm2022/lib/components/page-header/page-header.model.mjs +0 -3
  194. package/esm2022/lib/components/page-header/page-header.service.mjs +0 -16
  195. package/esm2022/lib/components/page-header/page-headercore.component.mjs +0 -52
  196. package/esm2022/lib/components/password/index.mjs +0 -2
  197. package/esm2022/lib/components/password/password.model.mjs +0 -11
  198. package/esm2022/lib/components/radiobutton/index.mjs +0 -2
  199. package/esm2022/lib/components/radiobutton/radiobutton.model.mjs +0 -3
  200. package/esm2022/lib/components/section/index.mjs +0 -2
  201. package/esm2022/lib/components/section/section.model.mjs +0 -3
  202. package/esm2022/lib/components/side-menu/directives/side-menu-service.directive.mjs +0 -31
  203. package/esm2022/lib/components/side-menu/index.mjs +0 -5
  204. package/esm2022/lib/components/side-menu/services/side-menu-provider.service.mjs +0 -25
  205. package/esm2022/lib/components/side-menu/services/side-menu.service.mjs +0 -50
  206. package/esm2022/lib/components/side-menu/side-menu.model.mjs +0 -6
  207. package/esm2022/lib/components/slider/index.mjs +0 -2
  208. package/esm2022/lib/components/slider/slider.model.mjs +0 -3
  209. package/esm2022/lib/components/snackbar/index.mjs +0 -2
  210. package/esm2022/lib/components/snackbar/snackbar.model.mjs +0 -3
  211. package/esm2022/lib/components/stepper/index.mjs +0 -2
  212. package/esm2022/lib/components/stepper/stepper.model.mjs +0 -3
  213. package/esm2022/lib/components/switch/index.mjs +0 -2
  214. package/esm2022/lib/components/switch/switch.model.mjs +0 -3
  215. package/esm2022/lib/components/tab-view/index.mjs +0 -2
  216. package/esm2022/lib/components/tab-view/tab-view.model.mjs +0 -3
  217. package/esm2022/lib/components/table/column-configuration.mjs +0 -32
  218. package/esm2022/lib/components/table/index.mjs +0 -5
  219. package/esm2022/lib/components/table/table-builder.mjs +0 -68
  220. package/esm2022/lib/components/table/table-column.directive.mjs +0 -86
  221. package/esm2022/lib/components/table/table.models.mjs +0 -150
  222. package/esm2022/lib/components/table-filter/index.mjs +0 -2
  223. package/esm2022/lib/components/table-filter/table-filter.model.mjs +0 -3
  224. package/esm2022/lib/components/textarea/index.mjs +0 -2
  225. package/esm2022/lib/components/textarea/textarea.model.mjs +0 -3
  226. package/esm2022/lib/components/textfield/index.mjs +0 -2
  227. package/esm2022/lib/components/textfield/textfield.model.mjs +0 -3
  228. package/esm2022/lib/components/tristatecheckbox/index.mjs +0 -2
  229. package/esm2022/lib/components/tristatecheckbox/tristatecheckbox.model.mjs +0 -3
  230. package/esm2022/lib/components/unsubscribe.component.mjs +0 -16
  231. package/esm2022/lib/directives/datasource.directive.mjs +0 -175
  232. package/esm2022/lib/directives/index.mjs +0 -5
  233. package/esm2022/lib/directives/shortcut.directive.mjs +0 -46
  234. package/esm2022/lib/directives/table-datasource.directive.mjs +0 -124
  235. package/esm2022/lib/directives/table-filter.directive.mjs +0 -56
  236. package/esm2022/lib/format/format.mjs +0 -63
  237. package/esm2022/lib/pipes/error/error.codes.mjs +0 -10
  238. package/esm2022/lib/pipes/error/error.models.mjs +0 -21
  239. package/esm2022/lib/pipes/error/error.pipe.mjs +0 -31
  240. package/esm2022/lib/pipes/error/warning.codes.mjs +0 -4
  241. package/esm2022/lib/pipes/error/warning.pipe.mjs +0 -31
  242. package/esm2022/lib/pipes/helper/enumToList.pipe.mjs +0 -22
  243. package/esm2022/lib/pipes/index.mjs +0 -8
  244. package/esm2022/lib/pipes/keyOrFn/keyOrFn.pipe.mjs +0 -31
  245. package/esm2022/lib/services/confirm-dialog.service.mjs +0 -45
  246. package/esm2022/lib/services/index.mjs +0 -5
  247. package/esm2022/lib/services/leave-form.service.mjs +0 -52
  248. package/esm2022/lib/services/screen-size.service.mjs +0 -29
  249. package/esm2022/lib/services/table.service.mjs +0 -27
  250. package/esm2022/verisoft-ui-core.mjs +0 -5
  251. package/fesm2022/verisoft-ui-core.mjs +0 -2014
  252. package/fesm2022/verisoft-ui-core.mjs.map +0 -1
  253. package/lib/common/angular-helper.d.ts +0 -1
  254. package/lib/common/constants.d.ts +0 -3
  255. package/lib/common/control.models.d.ts +0 -62
  256. package/lib/common/datasource-component.model.d.ts +0 -19
  257. package/lib/common/download-file.d.ts +0 -2
  258. package/lib/common/filter.d.ts +0 -1
  259. package/lib/common/rxjs.d.ts +0 -2
  260. package/lib/components/action-button-group/action-button-group.model.d.ts +0 -12
  261. package/lib/components/action-button-group/action-button.model.d.ts +0 -14
  262. package/lib/components/base-form/base-form-input.component.d.ts +0 -30
  263. package/lib/components/base-form/base-form.component.d.ts +0 -50
  264. package/lib/components/base-form/directives/detail-store.directive.d.ts +0 -35
  265. package/lib/components/base-form/models/base-form-input.models.d.ts +0 -7
  266. package/lib/components/base-form/models/base-form.models.d.ts +0 -18
  267. package/lib/components/breadcrumb/breadcrumb.service.d.ts +0 -8
  268. package/lib/components/breadcrumb/breadcrumbcore.component.d.ts +0 -30
  269. package/lib/components/breadcrumb/index.d.ts +0 -3
  270. package/lib/components/button/index.d.ts +0 -1
  271. package/lib/components/calendar/index.d.ts +0 -1
  272. package/lib/components/checkbox/checkbox.model.d.ts +0 -4
  273. package/lib/components/checkbox/index.d.ts +0 -1
  274. package/lib/components/confirm-dialog/confirm-dialog.model.d.ts +0 -25
  275. package/lib/components/confirm-dialog/index.d.ts +0 -1
  276. package/lib/components/dropdown/index.d.ts +0 -1
  277. package/lib/components/dynamic-component/dynamic-component.model.d.ts +0 -3
  278. package/lib/components/dynamic-component/index.d.ts +0 -1
  279. package/lib/components/filter/filter.model.d.ts +0 -13
  280. package/lib/components/form-field/index.d.ts +0 -1
  281. package/lib/components/generic-field/index.d.ts +0 -1
  282. package/lib/components/generic-form/generic-form.component.d.ts +0 -30
  283. package/lib/components/header/index.d.ts +0 -1
  284. package/lib/components/icons/icons.component.d.ts +0 -6
  285. package/lib/components/icons/icons.model.d.ts +0 -6
  286. package/lib/components/icons/index.d.ts +0 -2
  287. package/lib/components/input-group/index.d.ts +0 -1
  288. package/lib/components/loader/index.d.ts +0 -1
  289. package/lib/components/loader/loader.model.d.ts +0 -3
  290. package/lib/components/multiselect/index.d.ts +0 -1
  291. package/lib/components/number-input/index.d.ts +0 -1
  292. package/lib/components/page-header/page-header.service.d.ts +0 -8
  293. package/lib/components/page-header/page-headercore.component.d.ts +0 -20
  294. package/lib/components/password/index.d.ts +0 -1
  295. package/lib/components/radiobutton/index.d.ts +0 -1
  296. package/lib/components/section/index.d.ts +0 -1
  297. package/lib/components/side-menu/directives/side-menu-service.directive.d.ts +0 -11
  298. package/lib/components/side-menu/services/side-menu-provider.service.d.ts +0 -10
  299. package/lib/components/side-menu/services/side-menu.service.d.ts +0 -15
  300. package/lib/components/side-menu/side-menu.model.d.ts +0 -42
  301. package/lib/components/slider/index.d.ts +0 -1
  302. package/lib/components/snackbar/index.d.ts +0 -1
  303. package/lib/components/snackbar/snackbar.model.d.ts +0 -3
  304. package/lib/components/stepper/index.d.ts +0 -1
  305. package/lib/components/switch/index.d.ts +0 -1
  306. package/lib/components/switch/switch.model.d.ts +0 -4
  307. package/lib/components/tab-view/index.d.ts +0 -1
  308. package/lib/components/table/column-configuration.d.ts +0 -12
  309. package/lib/components/table/table-builder.d.ts +0 -15
  310. package/lib/components/table/table-column.directive.d.ts +0 -25
  311. package/lib/components/table/table.models.d.ts +0 -132
  312. package/lib/components/table-filter/index.d.ts +0 -1
  313. package/lib/components/textarea/index.d.ts +0 -1
  314. package/lib/components/textfield/index.d.ts +0 -1
  315. package/lib/components/tristatecheckbox/index.d.ts +0 -1
  316. package/lib/components/tristatecheckbox/tristatecheckbox.model.d.ts +0 -4
  317. package/lib/components/unsubscribe.component.d.ts +0 -9
  318. package/lib/directives/datasource.directive.d.ts +0 -32
  319. package/lib/directives/shortcut.directive.d.ts +0 -11
  320. package/lib/directives/table-datasource.directive.d.ts +0 -29
  321. package/lib/directives/table-filter.directive.d.ts +0 -17
  322. package/lib/format/format.d.ts +0 -9
  323. package/lib/pipes/error/error.codes.d.ts +0 -5
  324. package/lib/pipes/error/error.models.d.ts +0 -8
  325. package/lib/pipes/error/error.pipe.d.ts +0 -8
  326. package/lib/pipes/error/warning.codes.d.ts +0 -5
  327. package/lib/pipes/error/warning.pipe.d.ts +0 -8
  328. package/lib/pipes/helper/enumToList.pipe.d.ts +0 -7
  329. package/lib/pipes/keyOrFn/keyOrFn.pipe.d.ts +0 -7
  330. package/lib/services/confirm-dialog.service.d.ts +0 -12
  331. package/lib/services/leave-form.service.d.ts +0 -13
  332. package/lib/services/screen-size.service.d.ts +0 -10
  333. package/lib/services/table.service.d.ts +0 -13
@@ -1,2014 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { SimpleChange, InjectionToken, inject, Component, Input, Injectable, EventEmitter, Output, signal, ChangeDetectorRef, Directive, HostListener, Optional, Inject, TemplateRef, ContentChild, Pipe } from '@angular/core';
3
- import { startWith, switchMap, merge, map, debounceTime, BehaviorSubject, Subject, takeUntil, filter, tap, of, catchError } from 'rxjs';
4
- import { CommonModule } from '@angular/common';
5
- import * as i1 from '@angular/forms';
6
- import { FormControlName, FormControlDirective, NgModel, FormControl, ReactiveFormsModule } from '@angular/forms';
7
- import { ERROR_PROVIDER_TOKEN, BASE_URL_PATH, normalizeRequest, DEFAULT_SEARCH_LIMIT, convertDatasource, BaseHttpService, toCzechDateTimeString } from '@verisoft/core';
8
- import { cloneDeep } from 'lodash-es';
9
- import { TranslateService } from '@ngx-translate/core';
10
- import * as i1$1 from '@angular/router';
11
- import { ActivatedRoute, Router, NavigationEnd } from '@angular/router';
12
- import { Store, createSelector, createFeatureSelector } from '@ngrx/store';
13
- import { createResetStateAction, createInitNewDetailAction, createInitDetailAction, createUpdateDetailAction, createUpdateFormStateAction, createUpdateDetailSetErrorsAction } from '@verisoft/store';
14
- import { v4 } from 'uuid';
15
- import { HttpClient } from '@angular/common/http';
16
-
17
- function setComponentProperties(component, value, firstChange = false) {
18
- if (!value || !component) {
19
- return;
20
- }
21
- const simpleChanges = Object.keys(value).reduce((changes, property) => {
22
- const indexedComponent = component;
23
- const indexedValue = value;
24
- const previousValue = indexedComponent[property];
25
- const currentValue = indexedValue[property];
26
- if (currentValue !== previousValue) {
27
- indexedComponent[property] = currentValue;
28
- const change = new SimpleChange(previousValue, currentValue, firstChange);
29
- return { ...changes, [property]: change };
30
- }
31
- return changes;
32
- }, {});
33
- const changeableComponent = component;
34
- if (changeableComponent['ngOnChanges']) {
35
- changeableComponent.ngOnChanges(simpleChanges);
36
- }
37
- }
38
-
39
- var ControlSeverity;
40
- (function (ControlSeverity) {
41
- ControlSeverity["success"] = "success";
42
- ControlSeverity["info"] = "info";
43
- ControlSeverity["warning"] = "warning";
44
- ControlSeverity["danger"] = "danger";
45
- ControlSeverity["help"] = "help";
46
- ControlSeverity["primary"] = "primary";
47
- ControlSeverity["secondary"] = "secondary";
48
- ControlSeverity["contrast"] = "contrast";
49
- })(ControlSeverity || (ControlSeverity = {}));
50
- var GovControlSeverity;
51
- (function (GovControlSeverity) {
52
- GovControlSeverity["primary"] = "primary";
53
- GovControlSeverity["secondary"] = "secondary";
54
- GovControlSeverity["neutral"] = "neutral";
55
- GovControlSeverity["error"] = "error";
56
- GovControlSeverity["success"] = "success";
57
- GovControlSeverity["warning"] = "warning";
58
- })(GovControlSeverity || (GovControlSeverity = {}));
59
- var GovButtonType;
60
- (function (GovButtonType) {
61
- GovButtonType["solid"] = "solid";
62
- GovButtonType["outlined"] = "outlined";
63
- GovButtonType["base"] = "base";
64
- GovButtonType["link"] = "link";
65
- })(GovButtonType || (GovButtonType = {}));
66
- var IconPosition;
67
- (function (IconPosition) {
68
- IconPosition["left"] = "left";
69
- IconPosition["right"] = "right";
70
- })(IconPosition || (IconPosition = {}));
71
- var SlotPosition;
72
- (function (SlotPosition) {
73
- SlotPosition["top"] = "top";
74
- SlotPosition["bottom"] = "bottom";
75
- })(SlotPosition || (SlotPosition = {}));
76
- var FieldSize;
77
- (function (FieldSize) {
78
- FieldSize["small"] = "small";
79
- FieldSize["medium"] = "medium";
80
- FieldSize["large"] = "large";
81
- })(FieldSize || (FieldSize = {}));
82
- var FieldAlign;
83
- (function (FieldAlign) {
84
- FieldAlign["left"] = "left";
85
- FieldAlign["center"] = "center";
86
- FieldAlign["right"] = "right";
87
- })(FieldAlign || (FieldAlign = {}));
88
- var FieldType;
89
- (function (FieldType) {
90
- FieldType["text"] = "text";
91
- FieldType["number"] = "number";
92
- FieldType["password"] = "password";
93
- FieldType["search"] = "search";
94
- FieldType["date"] = "date";
95
- })(FieldType || (FieldType = {}));
96
- var LayoutType;
97
- (function (LayoutType) {
98
- LayoutType["horizontal"] = "horizontal";
99
- LayoutType["vertical"] = "vertical";
100
- })(LayoutType || (LayoutType = {}));
101
-
102
- const DEFAULT_DEBOUNCE_TIME = 300;
103
- const DEFAULT_PAGINATION = [10, 25, 50, 100];
104
- const MAX_COLUMN_CHAR_COUNT = 30;
105
-
106
- function setDataToArray(targetArray, data, offset = 0, total = undefined, defaultItem = undefined) {
107
- const totalItems = total ?? data.length + offset;
108
- if (!targetArray) {
109
- targetArray = Array(totalItems).fill(defaultItem);
110
- }
111
- if (targetArray.length < totalItems) {
112
- targetArray = targetArray.concat(new Array(totalItems - targetArray.length).fill(defaultItem));
113
- }
114
- for (let i = 0; i < data.length; i++) {
115
- targetArray[i + offset] = data[i] ?? defaultItem;
116
- }
117
- return targetArray;
118
- }
119
-
120
- function isFilterEmpty(filter) {
121
- if (filter == undefined) {
122
- return true;
123
- }
124
- return !Object.entries(filter).some((x) => x[1] != undefined);
125
- }
126
-
127
- function queryListChanged(list) {
128
- return list.changes.pipe(startWith({}), switchMap(() => {
129
- const actionPropertyChanges$ = list
130
- .toArray()
131
- .filter((action) => action.propertyChanged)
132
- .map((action) => action.propertyChanged);
133
- return merge(...actionPropertyChanges$).pipe(startWith({}), map(() => list.toArray()));
134
- }), debounceTime(50));
135
- }
136
-
137
- function downloadText(filename, text, mimeType = 'text/plain') {
138
- const blob = new Blob([text], { type: mimeType });
139
- downloadFile(filename, blob);
140
- }
141
- function downloadFile(filename, blob) {
142
- const url = window.URL.createObjectURL(blob);
143
- const a = document.createElement('a');
144
- a.href = url;
145
- a.download = filename;
146
- a.click();
147
- window.URL.revokeObjectURL(url);
148
- }
149
-
150
- const ACTION_BUTTON_GROUP_COMPONENT_TOKEN = new InjectionToken('ActionButtonGroupComponentToken');
151
-
152
- const noop = () => {
153
- /* */
154
- };
155
- class BaseFormInputComponent {
156
- control;
157
- ngControl;
158
- errorService = inject(ERROR_PROVIDER_TOKEN);
159
- formControl;
160
- constructor(control) {
161
- this.control = control;
162
- this.ngControl = control;
163
- if (this.control) {
164
- this.ngControl.valueAccessor = this;
165
- }
166
- }
167
- label;
168
- required = false;
169
- readonly;
170
- disabled;
171
- tooltip;
172
- formDisplay = 'flex';
173
- clearable = true;
174
- placeholder = '';
175
- testId;
176
- inputId = Math.random().toString(36).substring(2);
177
- selectionChanged = noop;
178
- onTouch = noop;
179
- registerOnChange(fn) {
180
- this.selectionChanged = fn;
181
- }
182
- registerOnTouched(fn) {
183
- this.onTouch = fn;
184
- }
185
- // eslint-disable-next-line @typescript-eslint/no-empty-function
186
- writeValue(value) { }
187
- ngOnInit() {
188
- if (this.ngControl) {
189
- if (this.ngControl instanceof FormControlName) {
190
- this.formControl =
191
- this.ngControl.control ||
192
- this.ngControl.formDirective?.form.controls[this.ngControl.name];
193
- }
194
- else if (this.ngControl instanceof FormControlDirective ||
195
- this.ngControl instanceof NgModel) {
196
- this.formControl = this.ngControl.control;
197
- if (this.ngControl instanceof NgModel) {
198
- this.formControl.valueChanges.subscribe(() => this.ngControl?.viewToModelUpdate(this.control?.value));
199
- }
200
- }
201
- else {
202
- this.formControl = new FormControl();
203
- }
204
- }
205
- else {
206
- this.formControl = new FormControl();
207
- }
208
- }
209
- isRequired() {
210
- if (this.ngControl) {
211
- const validator = this.ngControl?.control?.validator?.({});
212
- return this.required || (validator && validator['required']);
213
- }
214
- return this.required;
215
- }
216
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: BaseFormInputComponent, deps: [{ token: i1.NgControl }], target: i0.ɵɵFactoryTarget.Component });
217
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.8", type: BaseFormInputComponent, isStandalone: true, selector: "ng-component", inputs: { label: "label", required: "required", readonly: "readonly", disabled: "disabled", tooltip: "tooltip", formDisplay: "formDisplay", clearable: "clearable", placeholder: "placeholder", testId: "testId" }, ngImport: i0, template: '', isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }] });
218
- }
219
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: BaseFormInputComponent, decorators: [{
220
- type: Component,
221
- args: [{
222
- template: '',
223
- standalone: true,
224
- imports: [CommonModule, ReactiveFormsModule],
225
- }]
226
- }], ctorParameters: () => [{ type: i1.NgControl }], propDecorators: { label: [{
227
- type: Input
228
- }], required: [{
229
- type: Input
230
- }], readonly: [{
231
- type: Input
232
- }], disabled: [{
233
- type: Input
234
- }], tooltip: [{
235
- type: Input
236
- }], formDisplay: [{
237
- type: Input
238
- }], clearable: [{
239
- type: Input
240
- }], placeholder: [{
241
- type: Input
242
- }], testId: [{
243
- type: Input
244
- }] } });
245
-
246
- class ScreenSizeService {
247
- isMobileBlock = new BehaviorSubject(false);
248
- prevState = false;
249
- constructor() {
250
- this.checkScreenSize();
251
- window.addEventListener('resize', async () => {
252
- await this.checkScreenSize();
253
- });
254
- }
255
- async checkScreenSize() {
256
- const isMobile = window.matchMedia('(max-width: 768px)').matches;
257
- if (isMobile !== this.prevState) {
258
- this.prevState = isMobile;
259
- this.isMobileBlock.next(isMobile);
260
- }
261
- }
262
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: ScreenSizeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
263
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: ScreenSizeService, providedIn: 'root' });
264
- }
265
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: ScreenSizeService, decorators: [{
266
- type: Injectable,
267
- args: [{
268
- providedIn: 'root',
269
- }]
270
- }], ctorParameters: () => [] });
271
-
272
- class DialogService {
273
- showEvent = new EventEmitter();
274
- closeEvent = new EventEmitter();
275
- showDialog(data) {
276
- const mappedData = this.mapInputAndOutpus(data);
277
- this.showEvent.emit({
278
- ...data,
279
- data: mappedData,
280
- });
281
- }
282
- mapInputAndOutpus(data) {
283
- const inputsAndOutputs = data.data;
284
- return {
285
- ...data.data,
286
- ...(Object.keys(inputsAndOutputs ?? {})
287
- .filter((key) => typeof inputsAndOutputs[key] === 'function')
288
- .reduce((acc, key) => {
289
- acc[key] = (value) => {
290
- if (typeof inputsAndOutputs[key] === 'function') {
291
- inputsAndOutputs[key](value);
292
- }
293
- };
294
- return acc;
295
- }, {})),
296
- };
297
- }
298
- closeModal() {
299
- this.closeEvent.emit();
300
- }
301
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: DialogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
302
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: DialogService, providedIn: 'root' });
303
- }
304
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: DialogService, decorators: [{
305
- type: Injectable,
306
- args: [{
307
- providedIn: 'root',
308
- }]
309
- }], propDecorators: { showEvent: [{
310
- type: Output
311
- }], closeEvent: [{
312
- type: Output
313
- }] } });
314
-
315
- class PreventUnsavedChangesDirective {
316
- dialogService = inject(DialogService);
317
- translateService = inject(TranslateService);
318
- Icons;
319
- canDeactivate(component) {
320
- if (!component || !component.canDeactivate) {
321
- return true;
322
- }
323
- const result = component.canDeactivate();
324
- return result;
325
- }
326
- showConfirmationDialog() {
327
- const resultSubject = new Subject();
328
- const title = this.translateService.instant('VALIDATIONS.UNSAVED_CHANGES');
329
- const message = this.translateService.instant('VALIDATIONS.LEAVING_UNSAVED_FORM');
330
- const leaveButton = this.translateService.instant('BUTTONS.LEAVE');
331
- const stayButton = this.translateService.instant('BUTTONS.STAY');
332
- this.dialogService.showDialog({
333
- title: title,
334
- headerIcon: this.Icons.infoCircle,
335
- innerHTML: `<p>${message}</p>`,
336
- showCancelButton: true,
337
- confirmButtonText: stayButton,
338
- cancelButtonText: leaveButton,
339
- confirmButtonFn: () => {
340
- resultSubject.next(false);
341
- resultSubject.complete();
342
- this.dialogService.closeModal();
343
- },
344
- cancelButtonFn: () => {
345
- resultSubject.next(true);
346
- resultSubject.complete();
347
- this.dialogService.closeModal();
348
- },
349
- });
350
- return resultSubject.asObservable();
351
- }
352
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: PreventUnsavedChangesDirective, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
353
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: PreventUnsavedChangesDirective, providedIn: 'root' });
354
- }
355
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: PreventUnsavedChangesDirective, decorators: [{
356
- type: Injectable,
357
- args: [{
358
- providedIn: 'root',
359
- }]
360
- }] });
361
-
362
- class TableService {
363
- reload = signal(Symbol());
364
- /**
365
- * If name is set, reload a specific table with the set`[tableName]`
366
- *
367
- * If name is NOT set, reload all tables in the current DOM
368
- * */
369
- forceReload(name) {
370
- if (name) {
371
- this.reload.set({ name: name, symbol: Symbol() });
372
- }
373
- else {
374
- this.reload.set(Symbol());
375
- }
376
- }
377
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: TableService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
378
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: TableService, providedIn: 'root' });
379
- }
380
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: TableService, decorators: [{
381
- type: Injectable,
382
- args: [{
383
- providedIn: 'root'
384
- }]
385
- }] });
386
-
387
- class BaseInputControls {
388
- value;
389
- ngControl;
390
- label;
391
- required;
392
- }
393
-
394
- function isFormStateEqual(current, other) {
395
- if (!current && !other) {
396
- return true;
397
- }
398
- if (current && other) {
399
- return current.dirty === other.dirty && current.valid === other.valid;
400
- }
401
- return false;
402
- }
403
-
404
- class BaseFormDirective {
405
- data;
406
- dataChange = new EventEmitter();
407
- statusChange = new EventEmitter();
408
- formSubmit = new EventEmitter();
409
- formClear = new EventEmitter();
410
- formDestroyed$ = new Subject();
411
- keys = [];
412
- formGroup;
413
- cd = inject(ChangeDetectorRef);
414
- valueInitialization = false;
415
- lastState;
416
- guardViewChild;
417
- formSubmitted = false;
418
- guard = inject(PreventUnsavedChangesDirective);
419
- unloadHandler(event) {
420
- if (this.formGroup.dirty) {
421
- event.preventDefault();
422
- }
423
- }
424
- canDeactivate() {
425
- if (this.formGroup.dirty && !this.formSubmitted) {
426
- const result = this.guard.showConfirmationDialog();
427
- return result;
428
- }
429
- return true;
430
- }
431
- ngOnInit() {
432
- this.initializeFormGroup();
433
- }
434
- ngOnChanges(changes) {
435
- if (changes['data'] && this.formGroup) {
436
- this.valueInitialization = true;
437
- const dirty = this.formGroup.dirty;
438
- this.formGroup.patchValue(this.fromModel(this.data), {
439
- emitEvent: false,
440
- onlySelf: true,
441
- });
442
- this.formGroup.updateValueAndValidity();
443
- if (!dirty) {
444
- this.formGroup.markAsPristine();
445
- }
446
- this.valueInitialization = false;
447
- this.createAndEmitIfFormStateChanged();
448
- }
449
- }
450
- ngAfterViewInit() {
451
- this.cd.detectChanges();
452
- }
453
- ngOnDestroy() {
454
- this.formDestroyed$.next();
455
- this.formDestroyed$.complete();
456
- }
457
- createCompleteData() {
458
- const change = this.toModel(this.formGroup?.value);
459
- this.recursiveObjectAttributesTransformation(change);
460
- const updatedData = this.applyChanges(cloneDeep(this.data), cloneDeep(change));
461
- return updatedData;
462
- }
463
- submit() {
464
- this.formSubmitted = true;
465
- this.formGroup.markAllAsTouched();
466
- if (!this.formGroup.invalid) {
467
- this.formSubmit.emit(this.createCompleteData());
468
- }
469
- this.formGroup.markAsPristine();
470
- }
471
- clear() {
472
- this.formClear.emit();
473
- }
474
- initializeFormGroup() {
475
- this.formGroup = this.createFormGroup();
476
- this.valueInitialization = true;
477
- this.formGroup.patchValue(this.fromModel(this.data), {
478
- emitEvent: false,
479
- onlySelf: true,
480
- });
481
- this.formGroup.markAsPristine();
482
- this.initValueChanges();
483
- this.initStatusChanges();
484
- this.valueInitialization = false;
485
- }
486
- initValueChanges() {
487
- this.formGroup.valueChanges
488
- .pipe(takeUntil(this.formDestroyed$), filter(() => !this.valueInitialization), map((value) => {
489
- const change = this.toModel(value);
490
- this.recursiveObjectAttributesTransformation(change);
491
- const updatedData = this.applyChanges(cloneDeep(this.data), cloneDeep(change));
492
- return updatedData;
493
- }))
494
- .subscribe((updatedData) => {
495
- this.dataChange.emit(updatedData);
496
- });
497
- }
498
- initStatusChanges() {
499
- this.formGroup.statusChanges
500
- .pipe(takeUntil(this.formDestroyed$))
501
- .subscribe(() => {
502
- if (!this.valueInitialization) {
503
- this.createAndEmitIfFormStateChanged();
504
- }
505
- });
506
- this.createAndEmitIfFormStateChanged();
507
- }
508
- createAndEmitIfFormStateChanged() {
509
- const formState = {
510
- valid: !this.formGroup.invalid,
511
- dirty: this.formGroup.dirty,
512
- };
513
- if (!isFormStateEqual(formState, this.lastState)) {
514
- this.lastState = formState;
515
- this.statusChange.emit(formState);
516
- }
517
- }
518
- applyChanges(data, changes) {
519
- return Object.assign(data || {}, changes);
520
- }
521
- toModel(data) {
522
- return data || {};
523
- }
524
- fromModel(data) {
525
- return { ...(data || {}) };
526
- }
527
- recursiveObjectAttributesTransformation(obj) {
528
- this.recursiveObjectAttributesTraversal(obj, this.transformEmptyStringToNullStringFn);
529
- }
530
- recursiveObjectAttributesTraversal(obj, transformationFn) {
531
- if (obj === null ||
532
- transformationFn === null ||
533
- typeof transformationFn !== 'function') {
534
- return;
535
- }
536
- const traverse = (obj) => {
537
- for (const key in obj) {
538
- // eslint-disable-next-line no-prototype-builtins
539
- if (obj.hasOwnProperty(key)) {
540
- transformationFn(obj, key);
541
- if (typeof obj[key] === 'object') {
542
- traverse(obj[key]);
543
- }
544
- }
545
- }
546
- };
547
- traverse(obj);
548
- }
549
- transformEmptyStringToNullStringFn(obj, key) {
550
- // if empty string - transformation to null string
551
- if (typeof obj[key] === 'string' && obj[key] === '') {
552
- try {
553
- obj[key] = null;
554
- }
555
- catch (error) {
556
- console.error(`Cannot modify ${key}: ${error}`);
557
- }
558
- }
559
- }
560
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: BaseFormDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
561
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.8", type: BaseFormDirective, isStandalone: true, selector: "[v-baseForm]", inputs: { data: "data" }, outputs: { dataChange: "dataChange", statusChange: "statusChange", formSubmit: "formSubmit", formClear: "formClear" }, host: { listeners: { "window:beforeunload": "unloadHandler($event)" } }, usesOnChanges: true, ngImport: i0 });
562
- }
563
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: BaseFormDirective, decorators: [{
564
- type: Directive,
565
- args: [{
566
- // eslint-disable-next-line @angular-eslint/directive-selector
567
- selector: '[v-baseForm]',
568
- standalone: true,
569
- }]
570
- }], propDecorators: { data: [{
571
- type: Input
572
- }], dataChange: [{
573
- type: Output
574
- }], statusChange: [{
575
- type: Output
576
- }], formSubmit: [{
577
- type: Output
578
- }], formClear: [{
579
- type: Output
580
- }], unloadHandler: [{
581
- type: HostListener,
582
- args: ['window:beforeunload', ['$event']]
583
- }] } });
584
-
585
- class UnsubscribeComponent {
586
- destroyed$ = new Subject();
587
- ngOnDestroy() {
588
- this.destroyed$.next();
589
- this.destroyed$.complete();
590
- }
591
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: UnsubscribeComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
592
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.8", type: UnsubscribeComponent, ngImport: i0 });
593
- }
594
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: UnsubscribeComponent, decorators: [{
595
- type: Directive
596
- }] });
597
-
598
- class DetailStoreDirective extends UnsubscribeComponent {
599
- form;
600
- detailsRepository;
601
- autoBind = true;
602
- detailId;
603
- ngrxFeatureKey;
604
- destroyForm = true;
605
- readonly = false;
606
- readonlyControlNames = [];
607
- store = inject(Store);
608
- cdr = inject(ChangeDetectorRef);
609
- route = inject(ActivatedRoute);
610
- itemCache = null;
611
- loaded;
612
- ngOnInit() {
613
- if (!this.loaded) {
614
- this.listenFormState();
615
- }
616
- this.listenFormChange();
617
- this.listenFormStatusChange();
618
- }
619
- ngAfterViewInit() {
620
- if (this.autoBind && !this.loaded) {
621
- this.initForm();
622
- }
623
- }
624
- ngOnDestroy() {
625
- super.ngOnDestroy();
626
- if (this.destroyForm) {
627
- this.store.dispatch(createResetStateAction(this.detailsRepository)());
628
- }
629
- }
630
- initForm() {
631
- if (this.detailId === 'create') {
632
- this.store.dispatch(createInitNewDetailAction(this.detailsRepository)());
633
- }
634
- else {
635
- this.store.dispatch(createInitDetailAction(this.detailsRepository)({ obj: this.detailId }));
636
- }
637
- if (this.readonly) {
638
- this.form.formGroup.disable();
639
- return;
640
- }
641
- this.readonlyControlNames.forEach(x => {
642
- this.form.formGroup.get(x)?.disable();
643
- });
644
- }
645
- listenFormState() {
646
- const selectIncomeData = createSelector(createFeatureSelector(this.ngrxFeatureKey), (state) => state?.[this.detailsRepository]);
647
- this.store
648
- .select(selectIncomeData)
649
- .pipe(takeUntil(this.destroyed$))
650
- .subscribe(({ item, loaded, backendValidationErrors } = {
651
- item: undefined,
652
- loaded: false,
653
- saveItemState: { saveInProgress: false },
654
- backendValidationErrors: []
655
- }) => {
656
- if (item
657
- && ((item.validationErrors || item.validationWarnings) && !this.form.formGroup.dirty)
658
- || backendValidationErrors.length) {
659
- this.handleValidation('propertyName', item.validationWarnings || [], 'validationWarning', 'warningMessage');
660
- this.handleValidation('propertyName', item.validationErrors || [], 'validationError', 'errorMessage');
661
- if (this.itemCache && this.isStateChanged(item) && backendValidationErrors.length) {
662
- backendValidationErrors = this.dispatchErrors(item, backendValidationErrors);
663
- }
664
- this.handleBackendValidation(backendValidationErrors);
665
- this.cdr.markForCheck();
666
- }
667
- this.itemCache = item;
668
- this.loaded = loaded;
669
- this.cdr.detectChanges();
670
- });
671
- }
672
- listenFormChange() {
673
- this.form.dataChange.pipe(takeUntil(this.destroyed$)).subscribe((item) => {
674
- this.store.dispatch(createUpdateDetailAction(this.detailsRepository)({ item }));
675
- });
676
- }
677
- listenFormStatusChange() {
678
- this.form.statusChange
679
- .pipe(takeUntil(this.destroyed$))
680
- .subscribe((formState) => {
681
- this.store.dispatch(createUpdateFormStateAction(this.detailsRepository)({ formState }));
682
- });
683
- }
684
- handleValidation = (controlName, errors, errorKey, messageKey) => {
685
- if (errors.length > 0)
686
- return;
687
- errors.forEach((error) => {
688
- const control = this.form.formGroup.get(error[controlName]);
689
- if (control) {
690
- control.disabled
691
- ? control.disable({ emitEvent: false, onlySelf: true })
692
- : control.enable({ emitEvent: false, onlySelf: true });
693
- control.setErrors({ [errorKey]: error[messageKey] }, { emitEvent: true });
694
- control.markAsDirty();
695
- }
696
- });
697
- };
698
- handleBackendValidation(errors) {
699
- errors.forEach(({ parameters, code }) => {
700
- const control = this.form.formGroup.get(this.normalizePropertyNames(parameters));
701
- if (!control)
702
- return;
703
- control[control.disabled ? "disable" : "enable"]({ emitEvent: false, onlySelf: true });
704
- control.setErrors({ "validationError": code }, { emitEvent: true });
705
- control.markAsDirty();
706
- });
707
- }
708
- dispatchErrors(item, errors) {
709
- const error = errors.filter((e) => {
710
- return this.itemCache[this.normalizePropertyNames(e.parameters)] === item[this.normalizePropertyNames(e.parameters)];
711
- });
712
- this.store.dispatch(createUpdateDetailSetErrorsAction(this.detailsRepository)({ error }));
713
- return error;
714
- }
715
- normalizePropertyNames(input) {
716
- return String(input[0]).toLocaleLowerCase() + String(input).slice(1);
717
- }
718
- isStateChanged(item) {
719
- return item !== this.itemCache;
720
- }
721
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: DetailStoreDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
722
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.8", type: DetailStoreDirective, isStandalone: true, selector: "[v-useDetailStore]", inputs: { form: "form", detailsRepository: "detailsRepository", autoBind: "autoBind", detailId: "detailId", ngrxFeatureKey: "ngrxFeatureKey", destroyForm: "destroyForm", readonly: "readonly", readonlyControlNames: "readonlyControlNames" }, exportAs: ["useDetailStore"], usesInheritance: true, ngImport: i0 });
723
- }
724
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: DetailStoreDirective, decorators: [{
725
- type: Directive,
726
- args: [{
727
- // eslint-disable-next-line @angular-eslint/directive-selector
728
- selector: '[v-useDetailStore]',
729
- exportAs: 'useDetailStore',
730
- standalone: true,
731
- }]
732
- }], propDecorators: { form: [{
733
- type: Input,
734
- args: [{ required: true }]
735
- }], detailsRepository: [{
736
- type: Input,
737
- args: [{ required: true }]
738
- }], autoBind: [{
739
- type: Input
740
- }], detailId: [{
741
- type: Input
742
- }], ngrxFeatureKey: [{
743
- type: Input,
744
- args: [{ required: true }]
745
- }], destroyForm: [{
746
- type: Input
747
- }], readonly: [{
748
- type: Input
749
- }], readonlyControlNames: [{
750
- type: Input
751
- }] } });
752
-
753
- const BREADCRUMB_COMPONENT_TOKEN = new InjectionToken('BreadcrumbComponentToken');
754
-
755
- class BreadcrumbService {
756
- routeChange = new EventEmitter();
757
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: BreadcrumbService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
758
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: BreadcrumbService, providedIn: 'root' });
759
- }
760
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: BreadcrumbService, decorators: [{
761
- type: Injectable,
762
- args: [{
763
- providedIn: 'root',
764
- }]
765
- }], propDecorators: { routeChange: [{
766
- type: Output
767
- }] } });
768
-
769
- class BreadcrumbCoreComponent extends UnsubscribeComponent {
770
- items = [];
771
- homeRoute = '/';
772
- useHomeRoute = false;
773
- static ROUTE_DATA_BREADCRUMB = 'breadcrumb';
774
- static ROUTE_DATA_BREADCRUMB_URL = 'breadcrumb_url';
775
- static ROUTE_DATA_NO_BREADCRUMB_ROUTE = 'breadcrumb_no_route';
776
- static BREADCRUMB_HIDE = 'breadcrumb_hide';
777
- home = { icon: 'pi pi-home', routerLink: this.homeRoute };
778
- router = inject(Router);
779
- activatedRoute = inject(ActivatedRoute);
780
- breadcrumbService = inject(BreadcrumbService);
781
- cdr = inject(ChangeDetectorRef);
782
- ngOnInit() {
783
- this.initBreadcrumbsCreation();
784
- this.initRouteChangeListen();
785
- }
786
- initBreadcrumbsCreation() {
787
- this.router.events
788
- .pipe(filter((event) => event instanceof NavigationEnd), takeUntil(this.destroyed$))
789
- .subscribe(() => (this.items = this.createBreadcrumbs(this.activatedRoute.root)));
790
- }
791
- initRouteChangeListen() {
792
- this.breadcrumbService.routeChange
793
- .pipe(filter((x) => x.label !== 'Undefined'), takeUntil(this.destroyed$))
794
- .subscribe((x) => {
795
- this.items = [
796
- ...this.items,
797
- {
798
- label: x.label,
799
- routerLink: x.routerLink,
800
- url: x.url,
801
- class: 'breadcrumb',
802
- },
803
- ];
804
- this.cdr.detectChanges();
805
- });
806
- }
807
- createBreadcrumbs(route, routerLink = '', breadcrumbs = []) {
808
- const children = route.children;
809
- if (children.length === 0) {
810
- return breadcrumbs;
811
- }
812
- for (const child of children) {
813
- const routeURL = child.snapshot.url
814
- .map((segment) => segment.path)
815
- .join('/');
816
- if (!child.snapshot.data[BreadcrumbCoreComponent.BREADCRUMB_HIDE]) {
817
- if (BreadcrumbCoreComponent.ROUTE_DATA_BREADCRUMB_URL !== undefined) {
818
- const route = child.snapshot.data[BreadcrumbCoreComponent.ROUTE_DATA_BREADCRUMB_URL];
819
- routerLink += `/${route}`;
820
- }
821
- if (!BreadcrumbCoreComponent.ROUTE_DATA_BREADCRUMB_URL && routeURL !== '') {
822
- routerLink += `/${routeURL}`;
823
- }
824
- const label = child.snapshot.data[BreadcrumbCoreComponent.ROUTE_DATA_BREADCRUMB];
825
- if (label &&
826
- BreadcrumbCoreComponent.ROUTE_DATA_NO_BREADCRUMB_ROUTE &&
827
- child.snapshot.data[BreadcrumbCoreComponent.ROUTE_DATA_NO_BREADCRUMB_ROUTE]) {
828
- breadcrumbs.push({ label, routerLink: undefined });
829
- }
830
- else if (label && child.snapshot.routeConfig?.path !== '') {
831
- breadcrumbs.push({ label, routerLink: routerLink });
832
- }
833
- }
834
- return this.createBreadcrumbs(child, routerLink, breadcrumbs);
835
- }
836
- }
837
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: BreadcrumbCoreComponent, deps: null, target: i0.ɵɵFactoryTarget.Directive });
838
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.8", type: BreadcrumbCoreComponent, inputs: { items: "items", homeRoute: "homeRoute", useHomeRoute: "useHomeRoute" }, usesInheritance: true, ngImport: i0 });
839
- }
840
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: BreadcrumbCoreComponent, decorators: [{
841
- type: Directive,
842
- args: [{}]
843
- }], propDecorators: { items: [{
844
- type: Input
845
- }], homeRoute: [{
846
- type: Input
847
- }], useHomeRoute: [{
848
- type: Input
849
- }] } });
850
-
851
- const BUTTON_COMPONENT_TOKEN = new InjectionToken('ButtonComponentToken');
852
-
853
- const CALENDAR_COMPONENT_TOKEN = new InjectionToken('CalendarComponentToken');
854
-
855
- const CHECKBOX_COMPONENT_TOKEN = new InjectionToken('CheckboxComponentToken');
856
-
857
- const CONFIRM_DIALOG_COMPONENT_TOKEN = new InjectionToken('ConfirmDialogComponentToken');
858
-
859
- const DROPDOWN_COMPONENT_TOKEN = new InjectionToken('DropdownComponentToken');
860
-
861
- const FILTER_COMPONENT_TOKEN = new InjectionToken('FilterComponentToken');
862
-
863
- const FORM_FIELD_COMPONENT_TOKEN = new InjectionToken('FormFieldComponentToken');
864
-
865
- const GENERIC_FIELD_COMPONENT_TOKEN = new InjectionToken('GenericFieldComponentToken');
866
-
867
- var GenericFieldType;
868
- (function (GenericFieldType) {
869
- GenericFieldType["dropdown"] = "dropdown";
870
- GenericFieldType["checkbox"] = "checkbox";
871
- GenericFieldType["simplecheckbox"] = "simplecheckbox";
872
- GenericFieldType["calendar"] = "calendar";
873
- GenericFieldType["multiselect"] = "multiselect";
874
- GenericFieldType["text"] = "text";
875
- })(GenericFieldType || (GenericFieldType = {}));
876
-
877
- const HEADER_COMPONENT_TOKEN = new InjectionToken('HeaderComponentToken');
878
- const SETTINGS_MENU = new InjectionToken('SETTINGS_MENU');
879
-
880
- const INPUT_GROUP_COMPONENT_TOKEN = new InjectionToken('HeaderComponentToken');
881
-
882
- const LOADER_COMPONENT_TOKEN = new InjectionToken('LoaderComponentToken');
883
-
884
- const MULTISELECT_COMPONENT_TOKEN = new InjectionToken('MultiselectComponentToken');
885
-
886
- const NUMBER_INPUT_COMPONENT_TOKEN = new InjectionToken('NumberInputComponentToken');
887
-
888
- const PAGE_HEADER_COMPONENT_TOKEN = new InjectionToken('PageHeaderComponentToken');
889
-
890
- class PageHeaderService {
891
- pageHeader = new EventEmitter();
892
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: PageHeaderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
893
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: PageHeaderService, providedIn: 'root' });
894
- }
895
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: PageHeaderService, decorators: [{
896
- type: Injectable,
897
- args: [{
898
- providedIn: 'root',
899
- }]
900
- }], propDecorators: { pageHeader: [{
901
- type: Output
902
- }] } });
903
-
904
- class PageHeaderCoreComponent extends UnsubscribeComponent {
905
- router;
906
- cdr;
907
- headerService;
908
- title;
909
- subtitle;
910
- showBackButton;
911
- size = FieldSize.small;
912
- constructor(router, cdr, headerService) {
913
- super();
914
- this.router = router;
915
- this.cdr = cdr;
916
- this.headerService = headerService;
917
- }
918
- ngOnInit() {
919
- this.headerService.pageHeader
920
- .pipe(takeUntil(this.destroyed$))
921
- .subscribe((x) => {
922
- this.title = x.title;
923
- this.subtitle = x.subtitle;
924
- this.showBackButton = x.showBackButton ?? false;
925
- this.cdr.detectChanges();
926
- });
927
- }
928
- locationBack() {
929
- history.back();
930
- }
931
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: PageHeaderCoreComponent, deps: [{ token: i1$1.Router }, { token: i0.ChangeDetectorRef }, { token: PageHeaderService }], target: i0.ɵɵFactoryTarget.Directive });
932
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.8", type: PageHeaderCoreComponent, inputs: { title: "title", subtitle: "subtitle", showBackButton: "showBackButton", size: "size" }, usesInheritance: true, ngImport: i0 });
933
- }
934
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: PageHeaderCoreComponent, decorators: [{
935
- type: Directive,
936
- args: [{}]
937
- }], ctorParameters: () => [{ type: i1$1.Router }, { type: i0.ChangeDetectorRef }, { type: PageHeaderService }], propDecorators: { title: [{
938
- type: Input
939
- }], subtitle: [{
940
- type: Input
941
- }], showBackButton: [{
942
- type: Input
943
- }], size: [{
944
- type: Input
945
- }] } });
946
-
947
- const PASSWORD_COMPONENT_TOKEN = new InjectionToken('PasswordComponentToken');
948
- var PasswordStrength;
949
- (function (PasswordStrength) {
950
- PasswordStrength[PasswordStrength["None"] = 0] = "None";
951
- PasswordStrength[PasswordStrength["Low"] = 1] = "Low";
952
- PasswordStrength[PasswordStrength["Medium"] = 2] = "Medium";
953
- PasswordStrength[PasswordStrength["High"] = 3] = "High";
954
- PasswordStrength[PasswordStrength["Superb"] = 4] = "Superb";
955
- })(PasswordStrength || (PasswordStrength = {}));
956
-
957
- const RADIOBUTTON_COMPONENT_TOKEN = new InjectionToken('RadiobuttonComponentToken');
958
-
959
- const SECTION_COMPONENT_TOKEN = new InjectionToken('SectionComponentToken');
960
-
961
- const MENU_TOKEN = new InjectionToken('MENU');
962
- const LOGO_ROUTER_ROUTE = new InjectionToken('LOGO_ROUTER_ROUTE');
963
- const SIDE_MENU_COMPONENT_TOKEN = new InjectionToken('SideMenuComponentToken');
964
- const SIDE_MENU_STATE_TOKEN = new InjectionToken('SideMenuStateToken');
965
-
966
- class SideMenuService {
967
- _menuItems = new BehaviorSubject([]);
968
- stateToken = inject(SIDE_MENU_STATE_TOKEN);
969
- menuItems$ = this._menuItems.asObservable();
970
- menuMinimalized = false;
971
- setMenu(items) {
972
- this.resetSidemenuState(items);
973
- this._menuItems.next(items);
974
- }
975
- saveMinimalizedState(minimalized) {
976
- this.stateToken.minimalized = minimalized;
977
- localStorage.setItem('SideMenuStateToken', JSON.stringify(this.stateToken));
978
- }
979
- saveExpandedState(item) {
980
- const expanded = this.stateToken.expanded?.find((i) => i === item.label);
981
- if (!expanded) {
982
- this.stateToken.expanded?.push(item.label);
983
- localStorage.setItem('SideMenuStateToken', JSON.stringify(this.stateToken));
984
- return;
985
- }
986
- this.stateToken.expanded = this.stateToken.expanded?.filter((i) => i !== item.label);
987
- localStorage.setItem('SideMenuStateToken', JSON.stringify(this.stateToken));
988
- }
989
- resetSidemenuState(items) {
990
- if (typeof this.stateToken === 'string') {
991
- this.stateToken = JSON.parse(this.stateToken);
992
- }
993
- this.menuMinimalized = this.stateToken.minimalized;
994
- const localStorageValue = this.stateToken.expanded;
995
- if (!localStorageValue)
996
- return;
997
- if (items) {
998
- for (let index = 0; index < items.length; index++) {
999
- const element = items[index];
1000
- element.expanded = !!localStorageValue.find((i) => i === element.label);
1001
- }
1002
- }
1003
- }
1004
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: SideMenuService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1005
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: SideMenuService, providedIn: 'root' });
1006
- }
1007
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: SideMenuService, decorators: [{
1008
- type: Injectable,
1009
- args: [{ providedIn: 'root' }]
1010
- }] });
1011
-
1012
- class SideMenuProviderService {
1013
- menu;
1014
- menuService;
1015
- constructor(menu = [], menuService) {
1016
- this.menu = menu;
1017
- this.menuService = menuService;
1018
- menuService.setMenu(menu);
1019
- }
1020
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: SideMenuProviderService, deps: [{ token: MENU_TOKEN, optional: true }, { token: SideMenuService }], target: i0.ɵɵFactoryTarget.Injectable });
1021
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: SideMenuProviderService });
1022
- }
1023
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: SideMenuProviderService, decorators: [{
1024
- type: Injectable
1025
- }], ctorParameters: () => [{ type: undefined, decorators: [{
1026
- type: Optional
1027
- }, {
1028
- type: Inject,
1029
- args: [MENU_TOKEN]
1030
- }] }, { type: SideMenuService }] });
1031
-
1032
- class MenuServiceDirective extends UnsubscribeComponent {
1033
- menuService = inject(SideMenuService);
1034
- cdr = inject(ChangeDetectorRef);
1035
- sideMenu = inject(SIDE_MENU_COMPONENT_TOKEN);
1036
- ngAfterViewInit() {
1037
- this.menuService.menuItems$.pipe(takeUntil(this.destroyed$)).subscribe((items) => {
1038
- if (this.sideMenu) {
1039
- this.sideMenu.items = items;
1040
- }
1041
- });
1042
- this.cdr.detectChanges();
1043
- }
1044
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: MenuServiceDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
1045
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.8", type: MenuServiceDirective, isStandalone: true, selector: "v-side-menu[useMenuService]", exportAs: ["useMenuService"], usesInheritance: true, ngImport: i0 });
1046
- }
1047
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: MenuServiceDirective, decorators: [{
1048
- type: Directive,
1049
- args: [{
1050
- // eslint-disable-next-line @angular-eslint/directive-selector
1051
- selector: 'v-side-menu[useMenuService]',
1052
- exportAs: 'useMenuService',
1053
- standalone: true,
1054
- }]
1055
- }] });
1056
-
1057
- const SLIDER_COMPONENT_TOKEN = new InjectionToken('SliderComponentToken');
1058
-
1059
- const SNACKBAR_COMPONENT_TOKEN = new InjectionToken('SnackbarComponentToken');
1060
-
1061
- const STEPPER_COMPONENT_TOKEN = new InjectionToken('StepperComponentToken');
1062
-
1063
- const SWITCH_COMPONENT_TOKEN = new InjectionToken('SwitchComponentToken');
1064
-
1065
- const TAB_VIEW_COMPONENT_TOKEN = new InjectionToken('TabVIewComponentToken');
1066
-
1067
- const TABLE_COMPONENT_TOKEN = new InjectionToken('TabVIewComponentToken');
1068
- const TABLE_COLUMN_PROVIDER = new InjectionToken('TABLE_COLUMN_PROVIDER');
1069
- var TableSelectionMode;
1070
- (function (TableSelectionMode) {
1071
- TableSelectionMode["single"] = "single";
1072
- TableSelectionMode["multiple"] = "multiple";
1073
- })(TableSelectionMode || (TableSelectionMode = {}));
1074
- var TableButtonSeverity;
1075
- (function (TableButtonSeverity) {
1076
- TableButtonSeverity["success"] = "success";
1077
- TableButtonSeverity["info"] = "info";
1078
- TableButtonSeverity["warning"] = "warning";
1079
- TableButtonSeverity["danger"] = "danger";
1080
- TableButtonSeverity["help"] = "help";
1081
- TableButtonSeverity["primary"] = "primary";
1082
- TableButtonSeverity["secondary"] = "secondary";
1083
- TableButtonSeverity["contrast"] = "contrast";
1084
- })(TableButtonSeverity || (TableButtonSeverity = {}));
1085
- var ColumnVisibility;
1086
- (function (ColumnVisibility) {
1087
- ColumnVisibility["visible"] = "visible";
1088
- ColumnVisibility["hidden"] = "hidden";
1089
- ColumnVisibility["default"] = "default";
1090
- })(ColumnVisibility || (ColumnVisibility = {}));
1091
- function LinkRenderer(text, href) {
1092
- return (row, index) => {
1093
- return '<a href="' + href + '">' + text + '</a>';
1094
- };
1095
- }
1096
- function routerRenderer(link, text) {
1097
- return (row, index) => {
1098
- return { text: text, link: link };
1099
- };
1100
- }
1101
- function Renderer(fnc) {
1102
- return (row) => {
1103
- return fnc(row);
1104
- };
1105
- }
1106
- class ColumnModel {
1107
- configuration;
1108
- sortDirection = undefined;
1109
- columnClass;
1110
- queryParams;
1111
- routerLink;
1112
- valueGetter;
1113
- headerGetter;
1114
- template;
1115
- actions;
1116
- sortable;
1117
- id;
1118
- // eslint-disable-next-line @typescript-eslint/ban-types
1119
- format;
1120
- textAlign;
1121
- width;
1122
- forceVisibility = ColumnVisibility.default;
1123
- visible = true;
1124
- constructor(configuration) {
1125
- this.configuration = configuration;
1126
- this.id = this.configuration.id;
1127
- if (this.configuration.format) {
1128
- this.format = this.configuration.format;
1129
- }
1130
- if (this.configuration.value) {
1131
- this.valueGetter = (row, index) => {
1132
- const value = this.configuration.value?.(row, index) ?? '-';
1133
- return this.format ? this.format(value, row) : value;
1134
- };
1135
- }
1136
- else {
1137
- this.valueGetter = (row) => {
1138
- const value = (row?.[this.configuration.id]) ?? '';
1139
- return this.format ? this.format(value, row) : value;
1140
- };
1141
- }
1142
- if (this.configuration.actions) {
1143
- this.actions = this.configuration.actions;
1144
- }
1145
- if (this.configuration.routerLink) {
1146
- this.routerLink = this.configuration.routerLink;
1147
- }
1148
- if (this.configuration.columnClass) {
1149
- this.columnClass = this.configuration.columnClass;
1150
- }
1151
- if (this.configuration.template) {
1152
- this.template = this.configuration.template;
1153
- }
1154
- if (this.configuration.headerName) {
1155
- this.headerGetter = (typeof this.configuration.headerName === 'string'
1156
- ? () => this.configuration.headerName ?? ''
1157
- : (columnId, index) => (this.configuration.headerName)?.(columnId, index) ?? this.id);
1158
- }
1159
- else {
1160
- this.headerGetter = () => "";
1161
- }
1162
- if (this.configuration.queryParams) {
1163
- this.queryParams = this.configuration.queryParams;
1164
- }
1165
- if (this.routerLink) {
1166
- this.columnClass += ' ' + 'link';
1167
- }
1168
- if (this.configuration.sortable !== undefined) {
1169
- this.sortable = this.configuration.sortable;
1170
- }
1171
- else {
1172
- this.sortable = true;
1173
- }
1174
- if (this.configuration.width) {
1175
- this.width = typeof this.configuration.width === "number" ? this.configuration.width + 'px' : this.configuration.width;
1176
- }
1177
- if (this.configuration.textAlign !== undefined) {
1178
- this.textAlign = this.configuration.textAlign;
1179
- }
1180
- if (this.configuration.forceVisibility) {
1181
- this.forceVisibility = this.configuration.forceVisibility;
1182
- }
1183
- if (this.configuration.visible !== undefined) {
1184
- this.visible = this.configuration.visible;
1185
- }
1186
- }
1187
- }
1188
- class RowModel {
1189
- row;
1190
- index;
1191
- id;
1192
- selected;
1193
- marked;
1194
- focused;
1195
- expanded;
1196
- fnc;
1197
- customRoute;
1198
- constructor(row, selected, expanded, marked, index, fnc, customRoute, entityKey) {
1199
- this.row = row;
1200
- this.id = row['id'] ?? v4();
1201
- this.index = index;
1202
- this.selected = selected;
1203
- this.expanded = expanded;
1204
- this.marked = marked;
1205
- this.fnc = fnc;
1206
- this.customRoute = createCustomRoute(row, entityKey, customRoute);
1207
- }
1208
- }
1209
- function createCustomRoute(row, entityKey, customRoute) {
1210
- return customRoute && entityKey
1211
- ? `${customRoute}/` + row[entityKey]
1212
- : undefined;
1213
- }
1214
-
1215
- class TableColumnDirective {
1216
- template;
1217
- index = 0;
1218
- id;
1219
- columnClass;
1220
- sortable;
1221
- routerLink;
1222
- queryParams;
1223
- headerName;
1224
- width;
1225
- textAlign = FieldAlign.left;
1226
- format;
1227
- forceVisibility = ColumnVisibility.default;
1228
- visible = true;
1229
- getDefinition() {
1230
- return {
1231
- id: this.id,
1232
- columnClass: this.columnClass,
1233
- template: this.template,
1234
- headerName: this.headerName,
1235
- routerLink: this.routerLink,
1236
- queryParams: this.queryParams,
1237
- sortable: this.sortable,
1238
- width: this.width,
1239
- format: this.format,
1240
- textAlign: this.textAlign,
1241
- forceVisibility: this.forceVisibility,
1242
- visible: this.visible,
1243
- };
1244
- }
1245
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: TableColumnDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1246
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.8", type: TableColumnDirective, isStandalone: true, selector: "v-table-column", inputs: { index: "index", id: "id", columnClass: "columnClass", sortable: "sortable", routerLink: "routerLink", queryParams: "queryParams", headerName: "headerName", width: "width", textAlign: "textAlign", format: "format", forceVisibility: "forceVisibility", visible: "visible" }, providers: [
1247
- {
1248
- provide: TABLE_COLUMN_PROVIDER,
1249
- useExisting: TableColumnDirective,
1250
- multi: true,
1251
- },
1252
- ], queries: [{ propertyName: "template", first: true, predicate: TemplateRef, descendants: true }], ngImport: i0 });
1253
- }
1254
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: TableColumnDirective, decorators: [{
1255
- type: Directive,
1256
- args: [{
1257
- // eslint-disable-next-line @angular-eslint/directive-selector
1258
- selector: 'v-table-column',
1259
- standalone: true,
1260
- providers: [
1261
- {
1262
- provide: TABLE_COLUMN_PROVIDER,
1263
- useExisting: TableColumnDirective,
1264
- multi: true,
1265
- },
1266
- ],
1267
- }]
1268
- }], propDecorators: { template: [{
1269
- type: ContentChild,
1270
- args: [TemplateRef]
1271
- }], index: [{
1272
- type: Input
1273
- }], id: [{
1274
- type: Input
1275
- }], columnClass: [{
1276
- type: Input
1277
- }], sortable: [{
1278
- type: Input
1279
- }], routerLink: [{
1280
- type: Input
1281
- }], queryParams: [{
1282
- type: Input
1283
- }], headerName: [{
1284
- type: Input
1285
- }], width: [{
1286
- type: Input
1287
- }], textAlign: [{
1288
- type: Input
1289
- }], format: [{
1290
- type: Input
1291
- }], forceVisibility: [{
1292
- type: Input
1293
- }], visible: [{
1294
- type: Input
1295
- }] } });
1296
-
1297
- class ColumnConfiguration {
1298
- id;
1299
- column = {};
1300
- constructor(id) {
1301
- this.id = id;
1302
- this.column.id = id;
1303
- }
1304
- headerName(headerName) {
1305
- this.column.headerName = headerName;
1306
- return this;
1307
- }
1308
- sortable(sortable) {
1309
- this.column.sortable = sortable;
1310
- return this;
1311
- }
1312
- columnClass(columnClass) {
1313
- this.column.columnClass = columnClass;
1314
- return this;
1315
- }
1316
- valueFunction(value) {
1317
- this.column.value = value;
1318
- return this;
1319
- }
1320
- type(type) {
1321
- this.column.type = type;
1322
- return this;
1323
- }
1324
- build() {
1325
- return this.column;
1326
- }
1327
- }
1328
-
1329
- class TableBuilder {
1330
- columns = [];
1331
- addColumn(id, config) {
1332
- const columnConfig = new ColumnConfiguration(id);
1333
- config?.(columnConfig);
1334
- this.columns.push(columnConfig.build());
1335
- return this;
1336
- }
1337
- addTextColumn(id, config) {
1338
- return this.addColumn(id, (x) => {
1339
- config?.(x);
1340
- x.type('text');
1341
- });
1342
- }
1343
- addNumberColumn(id, config) {
1344
- return this.addColumn(id, (x) => {
1345
- config?.(x);
1346
- x.type('number').columnClass('text-end');
1347
- });
1348
- }
1349
- addDateColumn(id, config) {
1350
- return this.addColumn(id, (x) => {
1351
- config?.(x);
1352
- x.type('date').valueFunction((row) => covertFromDateToUserLocale(row, id));
1353
- });
1354
- }
1355
- addBooleanColumn(id, config) {
1356
- return this.addColumn(id, (x) => {
1357
- config?.(x);
1358
- x.type('boolean');
1359
- });
1360
- }
1361
- addEnumColumn(id, config) {
1362
- return this.addColumn(id, (x) => {
1363
- config?.(x);
1364
- x.type('enum');
1365
- });
1366
- }
1367
- build() {
1368
- return this.columns;
1369
- }
1370
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: TableBuilder, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1371
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: TableBuilder, providedIn: 'root' });
1372
- }
1373
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: TableBuilder, decorators: [{
1374
- type: Injectable,
1375
- args: [{
1376
- providedIn: 'root',
1377
- }]
1378
- }] });
1379
- function covertFromDateToUserLocale(row, id) {
1380
- const value = row[id];
1381
- if (value === undefined) {
1382
- return '';
1383
- }
1384
- const locale = navigator.language;
1385
- if (value instanceof Date) {
1386
- return value.toLocaleDateString(locale);
1387
- }
1388
- if (typeof value === 'string' && !isNaN(Date.parse(value))) {
1389
- return new Date(value).toLocaleDateString(locale);
1390
- }
1391
- return value;
1392
- }
1393
-
1394
- const TABLE_FILTER_COMPONENT_TOKEN = new InjectionToken('TableFilterComponentToken');
1395
-
1396
- const TEXTAREA_COMPONENT_TOKEN = new InjectionToken('TextareaComponentToken');
1397
-
1398
- const TEXTFIELD_COMPONENT_TOKEN = new InjectionToken('TextfieldComponentToken');
1399
-
1400
- const TRISTATE_CHECKBOX_COMPONENT_TOKEN = new InjectionToken('TristateCheckboxComponentToken');
1401
-
1402
- const ICONS_COMPONENT_TOKEN = new InjectionToken('IconsComponentToken');
1403
-
1404
- class IconsComponent {
1405
- name;
1406
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: IconsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1407
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.8", type: IconsComponent, isStandalone: true, selector: "ng-component", inputs: { name: "name" }, providers: [
1408
- {
1409
- provide: ICONS_COMPONENT_TOKEN,
1410
- useExisting: IconsComponent
1411
- }
1412
- ], ngImport: i0, template: '', isInline: true });
1413
- }
1414
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: IconsComponent, decorators: [{
1415
- type: Component,
1416
- args: [{
1417
- standalone: true,
1418
- template: '',
1419
- providers: [
1420
- {
1421
- provide: ICONS_COMPONENT_TOKEN,
1422
- useExisting: IconsComponent
1423
- }
1424
- ]
1425
- }]
1426
- }], propDecorators: { name: [{
1427
- type: Input
1428
- }] } });
1429
-
1430
- class DatasourceDirective extends UnsubscribeComponent {
1431
- datasource;
1432
- autoBind = true;
1433
- loadingText = '... loading ...';
1434
- filterField = 'fulltext';
1435
- transformFn;
1436
- extraFilter;
1437
- get activeComponent() {
1438
- return (this.dropdownComponent ??
1439
- this.multiSelectComponent ??
1440
- this.genericField);
1441
- }
1442
- httpClient = inject(HttpClient);
1443
- baseUrl = inject(BASE_URL_PATH);
1444
- changeDetectorRef = inject(ChangeDetectorRef);
1445
- isAllDataLoaded = false;
1446
- parameters$ = new BehaviorSubject({});
1447
- lastParameter = {};
1448
- dropdownComponent = inject(DROPDOWN_COMPONENT_TOKEN, { optional: true });
1449
- multiSelectComponent = inject(MULTISELECT_COMPONENT_TOKEN, {
1450
- optional: true,
1451
- });
1452
- genericField = inject(GENERIC_FIELD_COMPONENT_TOKEN, { optional: true });
1453
- dataSourceService;
1454
- loadingPlaceholderItem = {};
1455
- ngOnInit() {
1456
- this.activeComponent.showed
1457
- .pipe(takeUntil(this.destroyed$))
1458
- .subscribe(() => {
1459
- if (!this.autoBind &&
1460
- !this.activeComponent.options &&
1461
- !this.activeComponent.loading) {
1462
- this.parameters$.next({});
1463
- }
1464
- });
1465
- this.activeComponent.lazyLoad
1466
- .pipe(takeUntil(this.destroyed$))
1467
- .subscribe((value) => {
1468
- this.parameters$.next({ offset: value?.offset, limit: value?.limit });
1469
- });
1470
- this.activeComponent.filtered
1471
- .pipe(takeUntil(this.destroyed$))
1472
- .subscribe((value) => {
1473
- const property = this.filterField ?? this.activeComponent.optionLabel;
1474
- if (property) {
1475
- this.parameters$.next({
1476
- offset: 0,
1477
- filter: {
1478
- [property]: value.filter ? value.filter : undefined,
1479
- ...(this.extraFilter ?? {})
1480
- },
1481
- useNewData: true,
1482
- });
1483
- }
1484
- });
1485
- this.parameters$
1486
- .pipe(takeUntil(this.destroyed$), filter(request => !this.isDataForRequestLoaded(request)), map((request) => {
1487
- const extendedParams = normalizeRequest({ ...this.lastParameter, ...request }, DEFAULT_SEARCH_LIMIT);
1488
- extendedParams.useNewData = request.useNewData ?? false;
1489
- return extendedParams;
1490
- }), tap((request) => {
1491
- this.lastParameter = request;
1492
- }), debounceTime(DEFAULT_DEBOUNCE_TIME), tap(() => {
1493
- this.changeComponent(this.activeComponent, {
1494
- loading: true,
1495
- });
1496
- }), switchMap((request) => this.dataSourceService
1497
- ? this.dataSourceService(request).pipe(map((response) => ({ request, response })))
1498
- : of({
1499
- request,
1500
- response: {
1501
- data: [],
1502
- total: 0,
1503
- limit: request.limit,
1504
- offset: request.offset,
1505
- },
1506
- })), catchError((request) => {
1507
- this.changeComponent(this.activeComponent, {
1508
- loading: false,
1509
- });
1510
- return of({
1511
- request: request,
1512
- response: {
1513
- data: [],
1514
- total: 0,
1515
- limit: request.limit,
1516
- offset: request.offset,
1517
- },
1518
- });
1519
- }))
1520
- .subscribe(({ request, response }) => this.setDataToControl(request, response));
1521
- }
1522
- ngOnChanges(changes) {
1523
- if (changes['datasource']) {
1524
- this.dataSourceService = convertDatasource(this.datasource, this.baseUrl, this.httpClient);
1525
- if (this.autoBind) {
1526
- this.parameters$.next({ offset: 0 });
1527
- }
1528
- }
1529
- }
1530
- isDataForRequestLoaded(request) {
1531
- if (request.useNewData) {
1532
- return false;
1533
- }
1534
- const offset = request.offset ?? 0;
1535
- const limit = request.limit ?? DEFAULT_SEARCH_LIMIT;
1536
- const options = this.activeComponent.options;
1537
- if (!options) {
1538
- return false;
1539
- }
1540
- if (options.length < offset + limit) {
1541
- return false;
1542
- }
1543
- const allItemsFilled = options.slice(offset, offset + limit).every(item => item !== undefined && item != this.loadingPlaceholderItem);
1544
- return allItemsFilled;
1545
- }
1546
- setDataToControl(request, result) {
1547
- this.isAllDataLoaded = result.total <= result.data.length;
1548
- const data = result.data;
1549
- const total = result.total;
1550
- const offset = request.offset;
1551
- const transferedData = this.transformFn
1552
- ? data.map((x) => this.transformFn?.(x))
1553
- : data;
1554
- if (this.activeComponent.optionLabel) {
1555
- this.loadingPlaceholderItem[this.activeComponent.optionLabel] =
1556
- this.loadingText;
1557
- }
1558
- if (this.activeComponent.optionValue) {
1559
- this.loadingPlaceholderItem[this.activeComponent.optionValue] = -1;
1560
- }
1561
- const options = request.useNewData ? undefined : this.activeComponent.options;
1562
- const newOptions = setDataToArray(options, transferedData, offset, total, this.loadingPlaceholderItem);
1563
- this.changeComponent(this.activeComponent, {
1564
- options: newOptions,
1565
- loading: false,
1566
- lazy: !this.isAllDataLoaded,
1567
- });
1568
- }
1569
- changeComponent(component, value) {
1570
- setComponentProperties(component, value);
1571
- this.changeDetectorRef.detectChanges();
1572
- }
1573
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: DatasourceDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
1574
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.8", type: DatasourceDirective, isStandalone: true, selector: "v-dropdown[useDatasource], v-multiselect[useDatasource], v-generic-field[useDatasource]", inputs: { datasource: "datasource", autoBind: "autoBind", loadingText: "loadingText", filterField: "filterField", transformFn: "transformFn", extraFilter: "extraFilter" }, usesInheritance: true, usesOnChanges: true, ngImport: i0 });
1575
- }
1576
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: DatasourceDirective, decorators: [{
1577
- type: Directive,
1578
- args: [{
1579
- selector:
1580
- // eslint-disable-next-line @angular-eslint/directive-selector
1581
- 'v-dropdown[useDatasource], v-multiselect[useDatasource], v-generic-field[useDatasource]',
1582
- standalone: true,
1583
- }]
1584
- }], propDecorators: { datasource: [{
1585
- type: Input
1586
- }], autoBind: [{
1587
- type: Input
1588
- }], loadingText: [{
1589
- type: Input
1590
- }], filterField: [{
1591
- type: Input
1592
- }], transformFn: [{
1593
- type: Input
1594
- }], extraFilter: [{
1595
- type: Input
1596
- }] } });
1597
-
1598
- class TableDatasourceDirective extends UnsubscribeComponent {
1599
- store = inject(Store);
1600
- autoBind = true;
1601
- tableName;
1602
- debounceTime = DEFAULT_DEBOUNCE_TIME;
1603
- datasource;
1604
- extraFilter;
1605
- transformFn;
1606
- tableComponent = inject(TABLE_COMPONENT_TOKEN, {
1607
- self: true,
1608
- });
1609
- changeDetectorRef = inject(ChangeDetectorRef);
1610
- httpClient = inject(HttpClient);
1611
- baseUrl = inject(BASE_URL_PATH);
1612
- dataSourceService;
1613
- parameters$ = new BehaviorSubject({});
1614
- params$ = this.parameters$.asObservable();
1615
- ngOnInit() {
1616
- if (!this.tableName) {
1617
- throw new Error('Property tableName must be defined.');
1618
- }
1619
- this.tableComponent.lazyLoad.pipe(takeUntil(this.destroyed$)).subscribe((value) => {
1620
- this.parameters$.next({
1621
- offset: value?.offset,
1622
- limit: value?.limit,
1623
- filter: { ...value?.filter, ...this.extraFilter },
1624
- sort: value?.sort,
1625
- });
1626
- });
1627
- this.parameters$
1628
- .pipe(takeUntil(this.destroyed$), map((request) => normalizeRequest({
1629
- ...request,
1630
- filter: { ...request.filter, ...this.extraFilter },
1631
- })), debounceTime(this.debounceTime), tap(() => {
1632
- this.changeComponent(this.tableComponent, {
1633
- lazy: true,
1634
- loading: true,
1635
- });
1636
- }), switchMap((request) => this.dataSourceService
1637
- ? this.dataSourceService(request).pipe(map((response) => ({ request, response })))
1638
- : of({
1639
- request,
1640
- response: {
1641
- data: [],
1642
- total: 0,
1643
- limit: request.limit,
1644
- offset: request.offset,
1645
- },
1646
- })), catchError((request) => {
1647
- this.changeComponent(this.tableComponent, {
1648
- loading: false,
1649
- });
1650
- return of({
1651
- request: request,
1652
- response: {
1653
- data: [],
1654
- total: 0,
1655
- limit: request.limit,
1656
- offset: request.offset,
1657
- },
1658
- });
1659
- }))
1660
- .subscribe(({ request, response }) => this.setDataToControl(request, response));
1661
- }
1662
- ngOnChanges(changes) {
1663
- if (changes['datasource']) {
1664
- this.dataSourceService = convertDatasource(this.datasource, this.baseUrl, this.httpClient);
1665
- if (this.autoBind) {
1666
- this.parameters$.next({ offset: 0 });
1667
- }
1668
- }
1669
- }
1670
- reload() {
1671
- this.parameters$.next({ ...this.parameters$.value });
1672
- }
1673
- changeComponent(component, value) {
1674
- setComponentProperties(component, value);
1675
- this.changeDetectorRef.detectChanges();
1676
- }
1677
- setDataToControl(request, result) {
1678
- const data = result.data;
1679
- const total = result.total;
1680
- const transferedData = this.transformFn ? data.map((x) => this.transformFn?.(x)) : data;
1681
- this.changeComponent(this.tableComponent, {
1682
- lazy: !isFilterEmpty(request.filter) || data?.length < total || this.datasource instanceof BaseHttpService,
1683
- data: transferedData,
1684
- loading: false,
1685
- total,
1686
- });
1687
- }
1688
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: TableDatasourceDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
1689
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.8", type: TableDatasourceDirective, isStandalone: true, selector: "v-table[useDatasource]", inputs: { autoBind: "autoBind", tableName: "tableName", debounceTime: "debounceTime", datasource: "datasource", extraFilter: "extraFilter", transformFn: "transformFn" }, exportAs: ["useDatasource"], usesInheritance: true, usesOnChanges: true, ngImport: i0 });
1690
- }
1691
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: TableDatasourceDirective, decorators: [{
1692
- type: Directive,
1693
- args: [{
1694
- // eslint-disable-next-line @angular-eslint/directive-selector
1695
- selector: 'v-table[useDatasource]',
1696
- exportAs: 'useDatasource',
1697
- standalone: true,
1698
- }]
1699
- }], propDecorators: { autoBind: [{
1700
- type: Input
1701
- }], tableName: [{
1702
- type: Input,
1703
- args: [{ required: true }]
1704
- }], debounceTime: [{
1705
- type: Input
1706
- }], datasource: [{
1707
- type: Input
1708
- }], extraFilter: [{
1709
- type: Input
1710
- }], transformFn: [{
1711
- type: Input
1712
- }] } });
1713
-
1714
- class ButtonShortCutDirective {
1715
- shortCutFn;
1716
- shortCutKey;
1717
- keyMap = {};
1718
- onKeyDown(event) {
1719
- this.keyMap[event.key.toLowerCase()] = true;
1720
- this.checkShortcut();
1721
- }
1722
- onKeyUp(event) {
1723
- this.keyMap[event.key.toLowerCase()] = false;
1724
- }
1725
- checkShortcut() {
1726
- if (this.shortCutKey && this.shortCutFn) {
1727
- const keys = this.shortCutKey.toLowerCase().split('+');
1728
- const isShortcutPressed = keys.every((key) => this.keyMap[key]);
1729
- if (isShortcutPressed) {
1730
- this.shortCutFn?.();
1731
- keys.forEach((key) => (this.keyMap[key] = false));
1732
- }
1733
- }
1734
- }
1735
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: ButtonShortCutDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1736
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.8", type: ButtonShortCutDirective, isStandalone: true, selector: "v-button[useShortCut]", inputs: { shortCutFn: "shortCutFn", shortCutKey: "shortCutKey" }, host: { listeners: { "document:keydown": "onKeyDown($event)", "document:keyup": "onKeyUp($event)" } }, exportAs: ["useShortCut"], ngImport: i0 });
1737
- }
1738
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: ButtonShortCutDirective, decorators: [{
1739
- type: Directive,
1740
- args: [{
1741
- // eslint-disable-next-line @angular-eslint/directive-selector
1742
- selector: 'v-button[useShortCut]',
1743
- exportAs: 'useShortCut',
1744
- standalone: true,
1745
- }]
1746
- }], propDecorators: { shortCutFn: [{
1747
- type: Input
1748
- }], shortCutKey: [{
1749
- type: Input
1750
- }], onKeyDown: [{
1751
- type: HostListener,
1752
- args: ['document:keydown', ['$event']]
1753
- }], onKeyUp: [{
1754
- type: HostListener,
1755
- args: ['document:keyup', ['$event']]
1756
- }] } });
1757
-
1758
- class TableFilterDirective {
1759
- filterComponent;
1760
- filterChange$ = new Subject();
1761
- subscription = undefined;
1762
- tableComponent = inject(TABLE_COMPONENT_TOKEN);
1763
- changeDetectorRef = inject(ChangeDetectorRef);
1764
- ngOnChanges(changes) {
1765
- if (changes['filterComponent']) {
1766
- this.unRegister();
1767
- this.register();
1768
- }
1769
- }
1770
- onFilterChange(value) {
1771
- if (this.tableComponent?.filter !== value) {
1772
- setComponentProperties(this.tableComponent, {
1773
- filter: value,
1774
- currentPage: 1,
1775
- });
1776
- this.changeDetectorRef.detectChanges();
1777
- }
1778
- }
1779
- ngOnDestroy() {
1780
- this.unRegister();
1781
- }
1782
- unRegister() {
1783
- this.subscription?.unsubscribe();
1784
- }
1785
- register() {
1786
- this.filterComponent.registerOnChange((value) => {
1787
- this.filterChange$.next(value);
1788
- });
1789
- this.subscription = this.filterChange$
1790
- .pipe(debounceTime(this.filterComponent.debounceTime ? 0 : DEFAULT_DEBOUNCE_TIME))
1791
- .subscribe((value) => this.onFilterChange(value));
1792
- }
1793
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: TableFilterDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1794
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.8", type: TableFilterDirective, isStandalone: true, selector: "v-table[useFilter]", inputs: { filterComponent: "filterComponent" }, exportAs: ["tableFilterDirective"], usesOnChanges: true, ngImport: i0 });
1795
- }
1796
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: TableFilterDirective, decorators: [{
1797
- type: Directive,
1798
- args: [{
1799
- // eslint-disable-next-line @angular-eslint/directive-selector
1800
- selector: 'v-table[useFilter]',
1801
- standalone: true,
1802
- exportAs: 'tableFilterDirective',
1803
- }]
1804
- }], propDecorators: { filterComponent: [{
1805
- type: Input,
1806
- args: [{ required: true }]
1807
- }] } });
1808
-
1809
- const ErrorCodesFns = {
1810
- required: () => `This field is required!`,
1811
- email: () => `Email is in wrong format!`,
1812
- iban: () => `IBAN is in wrong format!`,
1813
- lowStrength: () => `Password too weak!`,
1814
- customPasswordRequirements: () => `Password does not meet minimal requirements.`,
1815
- fieldsNotMatching: () => `Passwords are not the same!`,
1816
- validationError: (value) => `${value}`,
1817
- };
1818
-
1819
- function getFirstErrorFromControl(control) {
1820
- if (!control || !control.errors) {
1821
- return null;
1822
- }
1823
- const errors = control.errors ?? false;
1824
- if (errors) {
1825
- const key = Object.keys(control.errors)[0];
1826
- const value = control.errors[key];
1827
- return { key, value };
1828
- }
1829
- return null;
1830
- }
1831
- function getFirstError(errors) {
1832
- if (errors) {
1833
- const key = Object.keys(errors)[0];
1834
- const value = errors[key];
1835
- return { key, value };
1836
- }
1837
- return null;
1838
- }
1839
-
1840
- const EMPTY$1 = '';
1841
- class ErrorPipe {
1842
- transform(errors) {
1843
- if (!errors) {
1844
- return EMPTY$1;
1845
- }
1846
- const error = getFirstError(errors);
1847
- if (error) {
1848
- const errorFn = ErrorCodesFns[error.key];
1849
- if (!errorFn) {
1850
- return EMPTY$1;
1851
- }
1852
- return ErrorCodesFns[error.key](error.value);
1853
- }
1854
- return EMPTY$1;
1855
- }
1856
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: ErrorPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1857
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.8", ngImport: i0, type: ErrorPipe, isStandalone: true, name: "error" });
1858
- }
1859
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: ErrorPipe, decorators: [{
1860
- type: Pipe,
1861
- args: [{
1862
- name: 'error',
1863
- standalone: true,
1864
- }]
1865
- }] });
1866
-
1867
- const WarningCodesFns = {
1868
- validationWarning: (value) => `${value}`,
1869
- };
1870
-
1871
- const EMPTY = '';
1872
- class WarningPipe {
1873
- transform(warnings) {
1874
- if (!warnings) {
1875
- return EMPTY;
1876
- }
1877
- const error = getFirstError(warnings);
1878
- if (error) {
1879
- const errorFn = WarningCodesFns[error.key];
1880
- if (!errorFn) {
1881
- return EMPTY;
1882
- }
1883
- return WarningCodesFns[error.key](error.value);
1884
- }
1885
- return EMPTY;
1886
- }
1887
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: WarningPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1888
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.8", ngImport: i0, type: WarningPipe, isStandalone: true, name: "warning" });
1889
- }
1890
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: WarningPipe, decorators: [{
1891
- type: Pipe,
1892
- args: [{
1893
- name: 'warning',
1894
- standalone: true,
1895
- }]
1896
- }] });
1897
-
1898
- /* eslint-disable @typescript-eslint/no-explicit-any */
1899
- class KeyOrFunctionPipe {
1900
- transform(keyOrFn, row) {
1901
- if (keyOrFn instanceof Function) {
1902
- return keyOrFn(row);
1903
- }
1904
- else if (typeof keyOrFn === 'string') {
1905
- const value = row[keyOrFn];
1906
- if (value) {
1907
- return value;
1908
- }
1909
- }
1910
- else if (typeof keyOrFn === 'boolean') {
1911
- return keyOrFn;
1912
- }
1913
- return '';
1914
- }
1915
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: KeyOrFunctionPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1916
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.8", ngImport: i0, type: KeyOrFunctionPipe, isStandalone: true, name: "keyOrFn", pure: false });
1917
- }
1918
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: KeyOrFunctionPipe, decorators: [{
1919
- type: Pipe,
1920
- args: [{
1921
- name: 'keyOrFn',
1922
- pure: false,
1923
- standalone: true,
1924
- }]
1925
- }] });
1926
-
1927
- class EnumToListPipe {
1928
- transform(data) {
1929
- return Object.keys(data)
1930
- .filter(key => isNaN(Number(key)))
1931
- .map(key => ({
1932
- label: key,
1933
- value: data[key],
1934
- }));
1935
- }
1936
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: EnumToListPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1937
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.8", ngImport: i0, type: EnumToListPipe, isStandalone: true, name: "enumToList" });
1938
- }
1939
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: EnumToListPipe, decorators: [{
1940
- type: Pipe,
1941
- args: [{
1942
- name: 'enumToList',
1943
- standalone: true,
1944
- }]
1945
- }] });
1946
-
1947
- /* eslint-disable @typescript-eslint/ban-types */
1948
- class Format {
1949
- static concatArray(value, itemFormatter, delimeter = ';') {
1950
- if (!value) {
1951
- return '';
1952
- }
1953
- return value
1954
- .map(item => itemFormatter ? itemFormatter(item) : item)
1955
- .filter(item => item !== undefined && item !== null)
1956
- .join(`${delimeter} `);
1957
- }
1958
- static czechDate(value) {
1959
- return toCzechDateTimeString(value);
1960
- }
1961
- static date(value) {
1962
- if (!value) {
1963
- return '';
1964
- }
1965
- if (typeof value === 'string') {
1966
- value = new Date(value);
1967
- }
1968
- return value.getDate() + '. ' + (value.getMonth() + 1) + '. ' + value.getFullYear();
1969
- }
1970
- static dateAndTime(value) {
1971
- if (!value) {
1972
- return '';
1973
- }
1974
- if (typeof value === 'string') {
1975
- value = new Date(value);
1976
- }
1977
- return ('0' + value.getDate()).slice(-2)
1978
- + '.' + ('0' + (value.getMonth() + 1)).slice(-2)
1979
- + '.' + value.getFullYear() + ' ' + ('0' + value.getHours()).slice(-2)
1980
- + ':' + ('0' + value.getMinutes()).slice(-2) + ':' + ('0' + value.getSeconds()).slice(-2);
1981
- }
1982
- static convertToUserLocaleDate(value) {
1983
- if (!value) {
1984
- return '';
1985
- }
1986
- if (typeof value === 'string') {
1987
- value = new Date(value);
1988
- }
1989
- return value.toLocaleDateString(navigator.language, { timeZone: 'UTC' });
1990
- }
1991
- static bool(value) {
1992
- if (value) {
1993
- return 'Yes';
1994
- }
1995
- else {
1996
- return 'No';
1997
- }
1998
- }
1999
- static boolWithIcon(value) {
2000
- if (value) {
2001
- return `<span>✓</span>`;
2002
- }
2003
- else {
2004
- return `<span>⨯</span>`;
2005
- }
2006
- }
2007
- }
2008
-
2009
- /**
2010
- * Generated bundle index. Do not edit.
2011
- */
2012
-
2013
- export { ACTION_BUTTON_GROUP_COMPONENT_TOKEN, BREADCRUMB_COMPONENT_TOKEN, BUTTON_COMPONENT_TOKEN, BaseFormDirective, BaseFormInputComponent, BaseInputControls, BreadcrumbCoreComponent, BreadcrumbService, ButtonShortCutDirective, CALENDAR_COMPONENT_TOKEN, CHECKBOX_COMPONENT_TOKEN, CONFIRM_DIALOG_COMPONENT_TOKEN, ColumnConfiguration, ColumnModel, ColumnVisibility, ControlSeverity, DEFAULT_DEBOUNCE_TIME, DEFAULT_PAGINATION, DROPDOWN_COMPONENT_TOKEN, DatasourceDirective, DetailStoreDirective, DialogService, EnumToListPipe, ErrorCodesFns, ErrorPipe, FILTER_COMPONENT_TOKEN, FORM_FIELD_COMPONENT_TOKEN, FieldAlign, FieldSize, FieldType, Format, GENERIC_FIELD_COMPONENT_TOKEN, GenericFieldType, GovButtonType, GovControlSeverity, HEADER_COMPONENT_TOKEN, ICONS_COMPONENT_TOKEN, INPUT_GROUP_COMPONENT_TOKEN, IconPosition, IconsComponent, KeyOrFunctionPipe, LOADER_COMPONENT_TOKEN, LOGO_ROUTER_ROUTE, LayoutType, LinkRenderer, MAX_COLUMN_CHAR_COUNT, MENU_TOKEN, MULTISELECT_COMPONENT_TOKEN, MenuServiceDirective, NUMBER_INPUT_COMPONENT_TOKEN, PAGE_HEADER_COMPONENT_TOKEN, PASSWORD_COMPONENT_TOKEN, PageHeaderCoreComponent, PageHeaderService, PasswordStrength, PreventUnsavedChangesDirective, RADIOBUTTON_COMPONENT_TOKEN, Renderer, RowModel, SECTION_COMPONENT_TOKEN, SETTINGS_MENU, SIDE_MENU_COMPONENT_TOKEN, SIDE_MENU_STATE_TOKEN, SLIDER_COMPONENT_TOKEN, SNACKBAR_COMPONENT_TOKEN, STEPPER_COMPONENT_TOKEN, SWITCH_COMPONENT_TOKEN, ScreenSizeService, SideMenuProviderService, SideMenuService, SlotPosition, TABLE_COLUMN_PROVIDER, TABLE_COMPONENT_TOKEN, TABLE_FILTER_COMPONENT_TOKEN, TAB_VIEW_COMPONENT_TOKEN, TEXTAREA_COMPONENT_TOKEN, TEXTFIELD_COMPONENT_TOKEN, TRISTATE_CHECKBOX_COMPONENT_TOKEN, TableBuilder, TableButtonSeverity, TableColumnDirective, TableDatasourceDirective, TableFilterDirective, TableSelectionMode, TableService, UnsubscribeComponent, WarningCodesFns, WarningPipe, downloadFile, downloadText, getFirstError, getFirstErrorFromControl, isFilterEmpty, isFormStateEqual, queryListChanged, routerRenderer, setComponentProperties, setDataToArray };
2014
- //# sourceMappingURL=verisoft-ui-core.mjs.map