@verisoft/ui-core 18.4.0 → 18.6.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 (332) hide show
  1. package/esm2022/index.mjs +7 -0
  2. package/esm2022/lib/common/angular-helper.mjs +23 -0
  3. package/esm2022/lib/common/constants.mjs +4 -0
  4. package/esm2022/lib/common/control.models.mjs +63 -0
  5. package/esm2022/lib/common/datasource-component.model.mjs +14 -0
  6. package/esm2022/lib/common/deactivate-guard.model.mjs +2 -0
  7. package/esm2022/lib/common/download-file.mjs +13 -0
  8. package/esm2022/lib/common/filter.mjs +7 -0
  9. package/esm2022/lib/common/icons.mjs +2 -0
  10. package/esm2022/lib/common/index.mjs +11 -0
  11. package/esm2022/lib/common/notificable-property.model.mjs +2 -0
  12. package/esm2022/lib/common/rxjs.mjs +11 -0
  13. package/esm2022/lib/components/action-button-group/action-button-group.model.mjs +3 -0
  14. package/esm2022/lib/components/action-button-group/action-button.model.mjs +2 -0
  15. package/esm2022/lib/components/action-button-group/index.mjs +3 -0
  16. package/esm2022/lib/components/base-form/base-form-input.component.mjs +100 -0
  17. package/esm2022/lib/components/base-form/base-form.component.mjs +187 -0
  18. package/esm2022/lib/components/base-form/directives/detail-store.directive.mjs +163 -0
  19. package/esm2022/lib/components/base-form/index.mjs +5 -0
  20. package/esm2022/lib/components/base-form/models/base-form-input.models.mjs +7 -0
  21. package/esm2022/lib/components/base-form/models/base-form.models.mjs +10 -0
  22. package/esm2022/lib/components/base-form/models/index.mjs +3 -0
  23. package/esm2022/lib/components/breadcrumb/breadcrumb.model.mjs +3 -0
  24. package/esm2022/lib/components/breadcrumb/breadcrumb.service.mjs +16 -0
  25. package/esm2022/lib/components/breadcrumb/breadcrumbcore.component.mjs +88 -0
  26. package/esm2022/lib/components/breadcrumb/index.mjs +4 -0
  27. package/esm2022/lib/components/button/button.model.mjs +3 -0
  28. package/esm2022/lib/components/button/index.mjs +2 -0
  29. package/esm2022/lib/components/calendar/calendar.model.mjs +3 -0
  30. package/esm2022/lib/components/calendar/index.mjs +2 -0
  31. package/esm2022/lib/components/checkbox/checkbox.model.mjs +3 -0
  32. package/esm2022/lib/components/checkbox/index.mjs +2 -0
  33. package/esm2022/lib/components/confirm-dialog/confirm-dialog.model.mjs +3 -0
  34. package/esm2022/lib/components/confirm-dialog/index.mjs +2 -0
  35. package/esm2022/lib/components/dropdown/dropdown.model.mjs +3 -0
  36. package/esm2022/lib/components/dropdown/index.mjs +2 -0
  37. package/esm2022/lib/components/dynamic-component/dynamic-component.model.mjs +2 -0
  38. package/esm2022/lib/components/dynamic-component/index.mjs +2 -0
  39. package/esm2022/lib/components/filter/filter.model.mjs +3 -0
  40. package/esm2022/lib/components/filter/index.mjs +2 -0
  41. package/esm2022/lib/components/form-field/form-field.model.mjs +3 -0
  42. package/esm2022/lib/components/form-field/index.mjs +2 -0
  43. package/esm2022/lib/components/generic-field/generic-field.model.mjs +3 -0
  44. package/esm2022/lib/components/generic-field/index.mjs +2 -0
  45. package/esm2022/lib/components/generic-form/generic-form.component.mjs +10 -0
  46. package/esm2022/lib/components/generic-form/index.mjs +2 -0
  47. package/esm2022/lib/components/header/header.model.mjs +4 -0
  48. package/esm2022/lib/components/header/index.mjs +2 -0
  49. package/esm2022/lib/components/icons/icons.component.mjs +29 -0
  50. package/esm2022/lib/components/icons/icons.model.mjs +3 -0
  51. package/esm2022/lib/components/icons/index.mjs +3 -0
  52. package/esm2022/lib/components/index.mjs +36 -0
  53. package/esm2022/lib/components/input-group/index.mjs +2 -0
  54. package/esm2022/lib/components/input-group/input-group.model.mjs +3 -0
  55. package/esm2022/lib/components/loader/index.mjs +2 -0
  56. package/esm2022/lib/components/loader/loader.model.mjs +3 -0
  57. package/esm2022/lib/components/multiselect/index.mjs +2 -0
  58. package/esm2022/lib/components/multiselect/mutiselect.model.mjs +3 -0
  59. package/esm2022/lib/components/number-input/index.mjs +2 -0
  60. package/esm2022/lib/components/number-input/number-input.model.mjs +3 -0
  61. package/esm2022/lib/components/page-header/index.mjs +4 -0
  62. package/esm2022/lib/components/page-header/page-header.model.mjs +3 -0
  63. package/esm2022/lib/components/page-header/page-header.service.mjs +16 -0
  64. package/esm2022/lib/components/page-header/page-headercore.component.mjs +52 -0
  65. package/esm2022/lib/components/password/index.mjs +2 -0
  66. package/esm2022/lib/components/password/password.model.mjs +11 -0
  67. package/esm2022/lib/components/radiobutton/index.mjs +2 -0
  68. package/esm2022/lib/components/radiobutton/radiobutton.model.mjs +3 -0
  69. package/esm2022/lib/components/section/index.mjs +2 -0
  70. package/esm2022/lib/components/section/section.model.mjs +3 -0
  71. package/esm2022/lib/components/side-menu/directives/side-menu-service.directive.mjs +31 -0
  72. package/esm2022/lib/components/side-menu/index.mjs +5 -0
  73. package/esm2022/lib/components/side-menu/services/side-menu-provider.service.mjs +25 -0
  74. package/esm2022/lib/components/side-menu/services/side-menu.service.mjs +50 -0
  75. package/esm2022/lib/components/side-menu/side-menu.model.mjs +6 -0
  76. package/esm2022/lib/components/slider/index.mjs +2 -0
  77. package/esm2022/lib/components/slider/slider.model.mjs +3 -0
  78. package/esm2022/lib/components/snackbar/index.mjs +2 -0
  79. package/esm2022/lib/components/snackbar/snackbar.model.mjs +3 -0
  80. package/esm2022/lib/components/stepper/index.mjs +2 -0
  81. package/esm2022/lib/components/stepper/stepper.model.mjs +3 -0
  82. package/esm2022/lib/components/switch/index.mjs +2 -0
  83. package/esm2022/lib/components/switch/switch.model.mjs +3 -0
  84. package/esm2022/lib/components/tab-view/index.mjs +2 -0
  85. package/esm2022/lib/components/tab-view/tab-view.model.mjs +3 -0
  86. package/esm2022/lib/components/table/column-configuration.mjs +32 -0
  87. package/esm2022/lib/components/table/index.mjs +5 -0
  88. package/esm2022/lib/components/table/table-builder.mjs +68 -0
  89. package/esm2022/lib/components/table/table-column.directive.mjs +86 -0
  90. package/esm2022/lib/components/table/table.models.mjs +150 -0
  91. package/esm2022/lib/components/table-filter/index.mjs +2 -0
  92. package/esm2022/lib/components/table-filter/table-filter.model.mjs +3 -0
  93. package/esm2022/lib/components/textarea/index.mjs +2 -0
  94. package/esm2022/lib/components/textarea/textarea.model.mjs +3 -0
  95. package/esm2022/lib/components/textfield/index.mjs +2 -0
  96. package/esm2022/lib/components/textfield/textfield.model.mjs +3 -0
  97. package/esm2022/lib/components/tristatecheckbox/index.mjs +2 -0
  98. package/esm2022/lib/components/tristatecheckbox/tristatecheckbox.model.mjs +3 -0
  99. package/esm2022/lib/components/unsubscribe.component.mjs +16 -0
  100. package/esm2022/lib/directives/datasource.directive.mjs +175 -0
  101. package/esm2022/lib/directives/index.mjs +5 -0
  102. package/esm2022/lib/directives/shortcut.directive.mjs +46 -0
  103. package/esm2022/lib/directives/table-datasource.directive.mjs +124 -0
  104. package/esm2022/lib/directives/table-filter.directive.mjs +56 -0
  105. package/esm2022/lib/format/format.mjs +63 -0
  106. package/esm2022/lib/pipes/error/error.codes.mjs +10 -0
  107. package/esm2022/lib/pipes/error/error.models.mjs +21 -0
  108. package/esm2022/lib/pipes/error/error.pipe.mjs +31 -0
  109. package/esm2022/lib/pipes/error/warning.codes.mjs +4 -0
  110. package/esm2022/lib/pipes/error/warning.pipe.mjs +31 -0
  111. package/esm2022/lib/pipes/helper/enumToList.pipe.mjs +22 -0
  112. package/esm2022/lib/pipes/index.mjs +8 -0
  113. package/esm2022/lib/pipes/keyOrFn/keyOrFn.pipe.mjs +31 -0
  114. package/esm2022/lib/services/confirm-dialog.service.mjs +45 -0
  115. package/esm2022/lib/services/index.mjs +5 -0
  116. package/esm2022/lib/services/leave-form.service.mjs +52 -0
  117. package/esm2022/lib/services/screen-size.service.mjs +29 -0
  118. package/esm2022/lib/services/table.service.mjs +27 -0
  119. package/esm2022/verisoft-ui-core.mjs +5 -0
  120. package/fesm2022/verisoft-ui-core.mjs +2014 -0
  121. package/fesm2022/verisoft-ui-core.mjs.map +1 -0
  122. package/{src/index.ts → index.d.ts} +6 -6
  123. package/lib/common/angular-helper.d.ts +1 -0
  124. package/lib/common/constants.d.ts +3 -0
  125. package/lib/common/control.models.d.ts +62 -0
  126. package/lib/common/datasource-component.model.d.ts +19 -0
  127. package/{src/lib/common/deactivate-guard.model.ts → lib/common/deactivate-guard.model.d.ts} +4 -5
  128. package/lib/common/download-file.d.ts +2 -0
  129. package/lib/common/filter.d.ts +1 -0
  130. package/{src/lib/common/icons.ts → lib/common/icons.d.ts} +34 -34
  131. package/{src/lib/common/index.ts → lib/common/index.d.ts} +10 -10
  132. package/{src/lib/common/notificable-property.model.ts → lib/common/notificable-property.model.d.ts} +4 -5
  133. package/lib/common/rxjs.d.ts +2 -0
  134. package/lib/components/action-button-group/action-button-group.model.d.ts +12 -0
  135. package/lib/components/action-button-group/action-button.model.d.ts +14 -0
  136. package/{src/lib/components/action-button-group/index.ts → lib/components/action-button-group/index.d.ts} +2 -2
  137. package/lib/components/base-form/base-form-input.component.d.ts +30 -0
  138. package/lib/components/base-form/base-form.component.d.ts +50 -0
  139. package/lib/components/base-form/directives/detail-store.directive.d.ts +35 -0
  140. package/{src/lib/components/base-form/index.ts → lib/components/base-form/index.d.ts} +4 -4
  141. package/lib/components/base-form/models/base-form-input.models.d.ts +7 -0
  142. package/lib/components/base-form/models/base-form.models.d.ts +18 -0
  143. package/{src/lib/components/base-form/models/index.ts → lib/components/base-form/models/index.d.ts} +2 -2
  144. package/{src/lib/components/breadcrumb/breadcrumb.model.ts → lib/components/breadcrumb/breadcrumb.model.d.ts} +16 -21
  145. package/lib/components/breadcrumb/breadcrumb.service.d.ts +8 -0
  146. package/lib/components/breadcrumb/breadcrumbcore.component.d.ts +30 -0
  147. package/lib/components/breadcrumb/index.d.ts +3 -0
  148. package/{src/lib/components/button/button.model.ts → lib/components/button/button.model.d.ts} +17 -21
  149. package/lib/components/button/index.d.ts +1 -0
  150. package/{src/lib/components/calendar/calendar.model.ts → lib/components/calendar/calendar.model.d.ts} +12 -16
  151. package/lib/components/calendar/index.d.ts +1 -0
  152. package/lib/components/checkbox/checkbox.model.d.ts +4 -0
  153. package/lib/components/checkbox/index.d.ts +1 -0
  154. package/lib/components/confirm-dialog/confirm-dialog.model.d.ts +25 -0
  155. package/lib/components/confirm-dialog/index.d.ts +1 -0
  156. package/{src/lib/components/dropdown/dropdown.model.ts → lib/components/dropdown/dropdown.model.d.ts} +12 -16
  157. package/lib/components/dropdown/index.d.ts +1 -0
  158. package/lib/components/dynamic-component/dynamic-component.model.d.ts +3 -0
  159. package/lib/components/dynamic-component/index.d.ts +1 -0
  160. package/lib/components/filter/filter.model.d.ts +13 -0
  161. package/{src/lib/components/filter/index.ts → lib/components/filter/index.d.ts} +1 -1
  162. package/{src/lib/components/form-field/form-field.model.ts → lib/components/form-field/form-field.model.d.ts} +11 -15
  163. package/lib/components/form-field/index.d.ts +1 -0
  164. package/{src/lib/components/generic-field/generic-field.model.ts → lib/components/generic-field/generic-field.model.d.ts} +6 -10
  165. package/lib/components/generic-field/index.d.ts +1 -0
  166. package/lib/components/generic-form/generic-form.component.d.ts +30 -0
  167. package/{src/lib/components/generic-form/index.ts → lib/components/generic-form/index.d.ts} +1 -1
  168. package/{src/lib/components/header/header.model.ts → lib/components/header/header.model.d.ts} +11 -18
  169. package/lib/components/header/index.d.ts +1 -0
  170. package/lib/components/icons/icons.component.d.ts +6 -0
  171. package/lib/components/icons/icons.model.d.ts +6 -0
  172. package/lib/components/icons/index.d.ts +2 -0
  173. package/{src/lib/components/index.ts → lib/components/index.d.ts} +35 -35
  174. package/lib/components/input-group/index.d.ts +1 -0
  175. package/{src/lib/components/input-group/input-group.model.ts → lib/components/input-group/input-group.model.d.ts} +12 -17
  176. package/lib/components/loader/index.d.ts +1 -0
  177. package/lib/components/loader/loader.model.d.ts +3 -0
  178. package/lib/components/multiselect/index.d.ts +1 -0
  179. package/{src/lib/components/multiselect/mutiselect.model.ts → lib/components/multiselect/mutiselect.model.d.ts} +9 -13
  180. package/lib/components/number-input/index.d.ts +1 -0
  181. package/{src/lib/components/number-input/number-input.model.ts → lib/components/number-input/number-input.model.d.ts} +10 -14
  182. package/{src/lib/components/page-header/index.ts → lib/components/page-header/index.d.ts} +3 -3
  183. package/{src/lib/components/page-header/page-header.model.ts → lib/components/page-header/page-header.model.d.ts} +7 -11
  184. package/lib/components/page-header/page-header.service.d.ts +8 -0
  185. package/lib/components/page-header/page-headercore.component.d.ts +20 -0
  186. package/lib/components/password/index.d.ts +1 -0
  187. package/{src/lib/components/password/password.model.ts → lib/components/password/password.model.d.ts} +19 -25
  188. package/lib/components/radiobutton/index.d.ts +1 -0
  189. package/{src/lib/components/radiobutton/radiobutton.model.ts → lib/components/radiobutton/radiobutton.model.d.ts} +11 -16
  190. package/lib/components/section/index.d.ts +1 -0
  191. package/{src/lib/components/section/section.model.ts → lib/components/section/section.model.d.ts} +7 -11
  192. package/lib/components/side-menu/directives/side-menu-service.directive.d.ts +11 -0
  193. package/{src/lib/components/side-menu/index.ts → lib/components/side-menu/index.d.ts} +4 -4
  194. package/lib/components/side-menu/services/side-menu-provider.service.d.ts +10 -0
  195. package/lib/components/side-menu/services/side-menu.service.d.ts +15 -0
  196. package/lib/components/side-menu/side-menu.model.d.ts +42 -0
  197. package/lib/components/slider/index.d.ts +1 -0
  198. package/{src/lib/components/slider/slider.model.ts → lib/components/slider/slider.model.d.ts} +9 -13
  199. package/lib/components/snackbar/index.d.ts +1 -0
  200. package/lib/components/snackbar/snackbar.model.d.ts +3 -0
  201. package/lib/components/stepper/index.d.ts +1 -0
  202. package/{src/lib/components/stepper/stepper.model.ts → lib/components/stepper/stepper.model.d.ts} +19 -24
  203. package/lib/components/switch/index.d.ts +1 -0
  204. package/lib/components/switch/switch.model.d.ts +4 -0
  205. package/lib/components/tab-view/index.d.ts +1 -0
  206. package/{src/lib/components/tab-view/tab-view.model.ts → lib/components/tab-view/tab-view.model.d.ts} +17 -22
  207. package/lib/components/table/column-configuration.d.ts +12 -0
  208. package/{src/lib/components/table/index.ts → lib/components/table/index.d.ts} +4 -4
  209. package/lib/components/table/table-builder.d.ts +15 -0
  210. package/lib/components/table/table-column.directive.d.ts +25 -0
  211. package/lib/components/table/table.models.d.ts +132 -0
  212. package/lib/components/table-filter/index.d.ts +1 -0
  213. package/{src/lib/components/table-filter/table-filter.model.ts → lib/components/table-filter/table-filter.model.d.ts} +17 -22
  214. package/lib/components/textarea/index.d.ts +1 -0
  215. package/{src/lib/components/textarea/textarea.model.ts → lib/components/textarea/textarea.model.d.ts} +9 -13
  216. package/lib/components/textfield/index.d.ts +1 -0
  217. package/{src/lib/components/textfield/textfield.model.ts → lib/components/textfield/textfield.model.d.ts} +9 -13
  218. package/lib/components/tristatecheckbox/index.d.ts +1 -0
  219. package/lib/components/tristatecheckbox/tristatecheckbox.model.d.ts +4 -0
  220. package/lib/components/unsubscribe.component.d.ts +9 -0
  221. package/lib/directives/datasource.directive.d.ts +32 -0
  222. package/{src/lib/directives/index.ts → lib/directives/index.d.ts} +4 -4
  223. package/lib/directives/shortcut.directive.d.ts +11 -0
  224. package/lib/directives/table-datasource.directive.d.ts +29 -0
  225. package/lib/directives/table-filter.directive.d.ts +17 -0
  226. package/lib/format/format.d.ts +9 -0
  227. package/lib/pipes/error/error.codes.d.ts +5 -0
  228. package/lib/pipes/error/error.models.d.ts +8 -0
  229. package/lib/pipes/error/error.pipe.d.ts +8 -0
  230. package/lib/pipes/error/warning.codes.d.ts +5 -0
  231. package/lib/pipes/error/warning.pipe.d.ts +8 -0
  232. package/lib/pipes/helper/enumToList.pipe.d.ts +7 -0
  233. package/{src/lib/pipes/index.ts → lib/pipes/index.d.ts} +7 -7
  234. package/lib/pipes/keyOrFn/keyOrFn.pipe.d.ts +7 -0
  235. package/lib/services/confirm-dialog.service.d.ts +12 -0
  236. package/{src/lib/services/index.ts → lib/services/index.d.ts} +4 -4
  237. package/lib/services/leave-form.service.d.ts +13 -0
  238. package/lib/services/screen-size.service.d.ts +10 -0
  239. package/lib/services/table.service.d.ts +13 -0
  240. package/package.json +35 -19
  241. package/.eslintrc.json +0 -48
  242. package/jest.config.ts +0 -21
  243. package/ng-package.json +0 -7
  244. package/project.json +0 -36
  245. package/src/lib/common/angular-helper.ts +0 -44
  246. package/src/lib/common/constants.ts +0 -5
  247. package/src/lib/common/control.models.ts +0 -71
  248. package/src/lib/common/datasource-component.model.spec.ts +0 -42
  249. package/src/lib/common/datasource-component.model.ts +0 -43
  250. package/src/lib/common/download-file.ts +0 -20
  251. package/src/lib/common/filter.ts +0 -7
  252. package/src/lib/common/rxjs.spec.ts +0 -58
  253. package/src/lib/common/rxjs.ts +0 -21
  254. package/src/lib/components/action-button-group/action-button-group.model.ts +0 -15
  255. package/src/lib/components/action-button-group/action-button.model.ts +0 -15
  256. package/src/lib/components/base-form/base-form-input.component.ts +0 -121
  257. package/src/lib/components/base-form/base-form.component.ts +0 -236
  258. package/src/lib/components/base-form/directives/detail-store.directive.ts +0 -219
  259. package/src/lib/components/base-form/models/base-form-input.models.ts +0 -11
  260. package/src/lib/components/base-form/models/base-form.models.ts +0 -31
  261. package/src/lib/components/breadcrumb/breadcrumb.service.ts +0 -9
  262. package/src/lib/components/breadcrumb/breadcrumbcore.component.ts +0 -115
  263. package/src/lib/components/breadcrumb/index.ts +0 -3
  264. package/src/lib/components/button/index.ts +0 -1
  265. package/src/lib/components/calendar/index.ts +0 -1
  266. package/src/lib/components/checkbox/checkbox.model.ts +0 -8
  267. package/src/lib/components/checkbox/index.ts +0 -1
  268. package/src/lib/components/confirm-dialog/confirm-dialog.model.ts +0 -31
  269. package/src/lib/components/confirm-dialog/index.ts +0 -1
  270. package/src/lib/components/dropdown/index.ts +0 -1
  271. package/src/lib/components/dynamic-component/dynamic-component.model.ts +0 -2
  272. package/src/lib/components/dynamic-component/index.ts +0 -1
  273. package/src/lib/components/filter/filter.model.ts +0 -17
  274. package/src/lib/components/form-field/index.ts +0 -1
  275. package/src/lib/components/generic-field/index.ts +0 -1
  276. package/src/lib/components/generic-form/generic-form.component.ts +0 -33
  277. package/src/lib/components/header/index.ts +0 -1
  278. package/src/lib/components/icons/icons.component.ts +0 -17
  279. package/src/lib/components/icons/icons.model.ts +0 -10
  280. package/src/lib/components/icons/index.ts +0 -2
  281. package/src/lib/components/input-group/index.ts +0 -1
  282. package/src/lib/components/loader/index.ts +0 -1
  283. package/src/lib/components/loader/loader.model.ts +0 -7
  284. package/src/lib/components/multiselect/index.ts +0 -1
  285. package/src/lib/components/number-input/index.ts +0 -1
  286. package/src/lib/components/page-header/page-header.service.ts +0 -9
  287. package/src/lib/components/page-header/page-headercore.component.ts +0 -40
  288. package/src/lib/components/password/index.ts +0 -1
  289. package/src/lib/components/radiobutton/index.ts +0 -1
  290. package/src/lib/components/section/index.ts +0 -1
  291. package/src/lib/components/side-menu/directives/side-menu-service.directive.ts +0 -31
  292. package/src/lib/components/side-menu/services/side-menu-provider.service.ts +0 -13
  293. package/src/lib/components/side-menu/services/side-menu.service.ts +0 -62
  294. package/src/lib/components/side-menu/side-menu.model.ts +0 -67
  295. package/src/lib/components/slider/index.ts +0 -1
  296. package/src/lib/components/snackbar/index.ts +0 -1
  297. package/src/lib/components/snackbar/snackbar.model.ts +0 -7
  298. package/src/lib/components/stepper/index.ts +0 -1
  299. package/src/lib/components/switch/index.ts +0 -1
  300. package/src/lib/components/switch/switch.model.ts +0 -8
  301. package/src/lib/components/tab-view/index.ts +0 -1
  302. package/src/lib/components/table/column-configuration.ts +0 -38
  303. package/src/lib/components/table/table-builder.ts +0 -93
  304. package/src/lib/components/table/table-column.directive.ts +0 -62
  305. package/src/lib/components/table/table.models.ts +0 -261
  306. package/src/lib/components/table-filter/index.ts +0 -1
  307. package/src/lib/components/textarea/index.ts +0 -1
  308. package/src/lib/components/textfield/index.ts +0 -1
  309. package/src/lib/components/tristatecheckbox/index.ts +0 -1
  310. package/src/lib/components/tristatecheckbox/tristatecheckbox.model.ts +0 -8
  311. package/src/lib/components/unsubscribe.component.ts +0 -12
  312. package/src/lib/directives/datasource.directive.ts +0 -275
  313. package/src/lib/directives/shortcut.directive.ts +0 -37
  314. package/src/lib/directives/table-datasource.directive.ts +0 -184
  315. package/src/lib/directives/table-filter.directive.ts +0 -69
  316. package/src/lib/format/format.ts +0 -74
  317. package/src/lib/pipes/error/error.codes.ts +0 -11
  318. package/src/lib/pipes/error/error.models.ts +0 -27
  319. package/src/lib/pipes/error/error.pipe.ts +0 -27
  320. package/src/lib/pipes/error/warning.codes.ts +0 -5
  321. package/src/lib/pipes/error/warning.pipe.ts +0 -27
  322. package/src/lib/pipes/helper/enumToList.pipe.ts +0 -16
  323. package/src/lib/pipes/keyOrFn/keyOrFn.pipe.ts +0 -23
  324. package/src/lib/services/confirm-dialog.service.ts +0 -44
  325. package/src/lib/services/leave-form.service.ts +0 -53
  326. package/src/lib/services/screen-size.service.ts +0 -25
  327. package/src/lib/services/table.service.ts +0 -22
  328. package/src/test-setup.ts +0 -8
  329. package/tsconfig.json +0 -30
  330. package/tsconfig.lib.json +0 -17
  331. package/tsconfig.lib.prod.json +0 -10
  332. package/tsconfig.spec.json +0 -16
@@ -1,236 +0,0 @@
1
- import {
2
- AfterViewInit,
3
- ChangeDetectorRef,
4
- Directive,
5
- EventEmitter,
6
- HostListener,
7
- inject,
8
- Input,
9
- OnChanges,
10
- OnDestroy,
11
- OnInit,
12
- Output,
13
- SimpleChanges,
14
- ViewChild,
15
- } from '@angular/core';
16
- import { FormGroup } from '@angular/forms';
17
- import { cloneDeep } from 'lodash-es';
18
- import { Subject, takeUntil, filter, map, Observable } from 'rxjs';
19
- import { PreventUnsavedChangesCore } from '../../common';
20
- import { PreventUnsavedChangesDirective } from '../../services';
21
- import { FormState, isFormStateEqual } from './models';
22
- @Directive({
23
- // eslint-disable-next-line @angular-eslint/directive-selector
24
- selector: '[v-baseForm]',
25
- standalone: true,
26
- })
27
- export abstract class BaseFormDirective<T extends object>
28
- implements OnInit, OnChanges, OnDestroy, AfterViewInit, PreventUnsavedChangesCore
29
- {
30
- @Input() data!: T | any;
31
- @Output() dataChange = new EventEmitter<T>();
32
- @Output() statusChange = new EventEmitter<FormState>();
33
- @Output() formSubmit = new EventEmitter<T>();
34
- @Output() formClear = new EventEmitter<void>();
35
-
36
- formDestroyed$ = new Subject<void>();
37
- keys: { key: string; alias?: string; type?: string; readOnly: string }[] = [];
38
- formGroup!: FormGroup;
39
- cd = inject(ChangeDetectorRef);
40
- valueInitialization = false;
41
- lastState!: FormState;
42
- guardViewChild!: ViewChild;
43
- formSubmitted = false;
44
- protected guard = inject(PreventUnsavedChangesDirective);
45
-
46
- @HostListener('window:beforeunload', ['$event'])
47
- unloadHandler(event: BeforeUnloadEvent) {
48
- if (this.formGroup.dirty) {
49
- event.preventDefault();
50
- }
51
- }
52
-
53
- canDeactivate(): Observable<boolean> | Promise<boolean> | boolean {
54
- if (this.formGroup.dirty && !this.formSubmitted) {
55
- const result = this.guard.showConfirmationDialog();
56
- return result;
57
- }
58
-
59
- return true;
60
- }
61
-
62
- ngOnInit(): void {
63
- this.initializeFormGroup();
64
- }
65
-
66
- ngOnChanges(changes: SimpleChanges): void {
67
- if (changes['data'] && this.formGroup) {
68
- this.valueInitialization = true;
69
- const dirty = this.formGroup.dirty;
70
-
71
- this.formGroup.patchValue(this.fromModel(this.data), {
72
- emitEvent: false,
73
- onlySelf: true,
74
- });
75
-
76
- this.formGroup.updateValueAndValidity();
77
- if (!dirty) {
78
- this.formGroup.markAsPristine();
79
- }
80
-
81
- this.valueInitialization = false;
82
- this.createAndEmitIfFormStateChanged();
83
- }
84
- }
85
-
86
- ngAfterViewInit() {
87
- this.cd.detectChanges();
88
- }
89
-
90
- ngOnDestroy(): void {
91
- this.formDestroyed$.next();
92
- this.formDestroyed$.complete();
93
- }
94
-
95
- abstract createFormGroup(): FormGroup;
96
-
97
- createCompleteData() {
98
- const change = this.toModel(this.formGroup?.value);
99
- this.recursiveObjectAttributesTransformation(change);
100
- const updatedData = this.applyChanges(
101
- cloneDeep(this.data),
102
- cloneDeep(change)
103
- );
104
-
105
- return updatedData;
106
- }
107
-
108
- submit() {
109
- this.formSubmitted = true;
110
- this.formGroup.markAllAsTouched();
111
- if (!this.formGroup.invalid) {
112
- this.formSubmit.emit(this.createCompleteData());
113
- }
114
- this.formGroup.markAsPristine();
115
- }
116
-
117
- clear() {
118
- this.formClear.emit();
119
- }
120
-
121
- private initializeFormGroup() {
122
- this.formGroup = this.createFormGroup();
123
- this.valueInitialization = true;
124
- this.formGroup.patchValue(this.fromModel(this.data), {
125
- emitEvent: false,
126
- onlySelf: true,
127
- });
128
-
129
- this.formGroup.markAsPristine();
130
- this.initValueChanges();
131
- this.initStatusChanges();
132
- this.valueInitialization = false;
133
- }
134
-
135
- private initValueChanges() {
136
- this.formGroup.valueChanges
137
- .pipe(
138
- takeUntil(this.formDestroyed$),
139
- filter(() => !this.valueInitialization),
140
- map((value) => {
141
- const change = this.toModel(value);
142
- this.recursiveObjectAttributesTransformation(change);
143
- const updatedData = this.applyChanges(
144
- cloneDeep(this.data),
145
- cloneDeep(change)
146
- );
147
- return updatedData;
148
- })
149
- )
150
- .subscribe((updatedData) => {
151
- this.dataChange.emit(updatedData);
152
- });
153
- }
154
-
155
- private initStatusChanges() {
156
- this.formGroup.statusChanges
157
- .pipe(takeUntil(this.formDestroyed$))
158
- .subscribe(() => {
159
- if (!this.valueInitialization) {
160
- this.createAndEmitIfFormStateChanged();
161
- }
162
- });
163
-
164
- this.createAndEmitIfFormStateChanged();
165
- }
166
-
167
- private createAndEmitIfFormStateChanged() {
168
- const formState: FormState = {
169
- valid: !this.formGroup.invalid,
170
- dirty: this.formGroup.dirty,
171
- };
172
-
173
- if (!isFormStateEqual(formState, this.lastState)) {
174
- this.lastState = formState;
175
- this.statusChange.emit(formState);
176
- }
177
- }
178
-
179
- protected applyChanges(data: T, changes: Partial<T>): T {
180
- return Object.assign(data || ({} as T), changes);
181
- }
182
-
183
- protected toModel(data: T): Partial<T> {
184
- return data || {};
185
- }
186
-
187
- protected fromModel(data: T): T {
188
- return { ...(data || {}) } as T;
189
- }
190
-
191
- private recursiveObjectAttributesTransformation(obj: any): void {
192
- this.recursiveObjectAttributesTraversal(
193
- obj,
194
- this.transformEmptyStringToNullStringFn
195
- );
196
- }
197
-
198
- private recursiveObjectAttributesTraversal(
199
- obj: any,
200
- transformationFn: (obj: any, key: string) => void
201
- ) {
202
- if (
203
- obj === null ||
204
- transformationFn === null ||
205
- typeof transformationFn !== 'function'
206
- ) {
207
- return;
208
- }
209
-
210
- const traverse = (obj: any) => {
211
- for (const key in obj) {
212
- // eslint-disable-next-line no-prototype-builtins
213
- if (obj.hasOwnProperty(key)) {
214
- transformationFn(obj, key);
215
-
216
- if (typeof obj[key] === 'object') {
217
- traverse(obj[key]);
218
- }
219
- }
220
- }
221
- };
222
-
223
- traverse(obj);
224
- }
225
-
226
- private transformEmptyStringToNullStringFn(obj: any, key: string) {
227
- // if empty string - transformation to null string
228
- if (typeof obj[key] === 'string' && obj[key] === '') {
229
- try {
230
- obj[key] = null;
231
- } catch (error) {
232
- console.error(`Cannot modify ${key}: ${error}`)
233
- }
234
- }
235
- }
236
- }
@@ -1,219 +0,0 @@
1
- import {
2
- Directive,
3
- AfterViewInit,
4
- inject,
5
- Input,
6
- OnInit,
7
- ChangeDetectorRef,
8
- OnDestroy,
9
- } from '@angular/core';
10
- import { ActivatedRoute } from '@angular/router';
11
- import { createFeatureSelector, createSelector, Store } from '@ngrx/store';
12
- import {
13
- BackendValidationError,
14
- createInitDetailAction,
15
- createInitNewDetailAction,
16
- createResetStateAction,
17
- createUpdateDetailAction,
18
- createUpdateDetailSetErrorsAction,
19
- createUpdateFormStateAction,
20
- DetailState,
21
- } from '@verisoft/store';
22
- import { takeUntil } from 'rxjs';
23
- import { UnsubscribeComponent } from '../../unsubscribe.component';
24
- import { BaseFormDirective } from '../base-form.component';
25
-
26
- @Directive({
27
- // eslint-disable-next-line @angular-eslint/directive-selector
28
- selector: '[v-useDetailStore]',
29
- exportAs: 'useDetailStore',
30
- standalone: true,
31
- })
32
- export class DetailStoreDirective
33
- extends UnsubscribeComponent
34
- implements OnInit, AfterViewInit, OnDestroy
35
- {
36
- @Input({ required: true }) form!: BaseFormDirective<any>;
37
-
38
- @Input({ required: true }) detailsRepository!: string;
39
-
40
- @Input() autoBind = true;
41
-
42
- @Input() detailId!: string | number | undefined;
43
-
44
- @Input({ required: true }) ngrxFeatureKey!: string;
45
-
46
- @Input() destroyForm = true;
47
-
48
- @Input() readonly = false;
49
-
50
- @Input() readonlyControlNames: string[] = [];
51
-
52
- store = inject(Store);
53
- cdr = inject(ChangeDetectorRef);
54
- route = inject(ActivatedRoute);
55
-
56
- private itemCache: any = null;
57
- private loaded!: boolean;
58
-
59
- ngOnInit(): void {
60
- if (!this.loaded) {
61
- this.listenFormState();
62
- }
63
- this.listenFormChange();
64
- this.listenFormStatusChange();
65
- }
66
-
67
- ngAfterViewInit(): void {
68
- if (this.autoBind && !this.loaded) {
69
- this.initForm();
70
- }
71
- }
72
-
73
- override ngOnDestroy(): void {
74
- super.ngOnDestroy();
75
- if (this.destroyForm) {
76
- this.store.dispatch(createResetStateAction(this.detailsRepository)());
77
- }
78
- }
79
-
80
- private initForm() {
81
- if (this.detailId === 'create') {
82
- this.store.dispatch(createInitNewDetailAction(this.detailsRepository)());
83
- } else {
84
- this.store.dispatch(
85
- createInitDetailAction(this.detailsRepository)({ obj: this.detailId })
86
- );
87
- }
88
-
89
- if (this.readonly) {
90
- this.form.formGroup.disable();
91
- return;
92
- }
93
-
94
- this.readonlyControlNames.forEach(x => {
95
- this.form.formGroup.get(x)?.disable();
96
- });
97
- }
98
-
99
- private listenFormState() {
100
- const selectIncomeData = createSelector(
101
- createFeatureSelector<any>(this.ngrxFeatureKey),
102
- (state: any) => state?.[this.detailsRepository] as DetailState<any>
103
- );
104
- this.store
105
- .select(selectIncomeData)
106
- .pipe(takeUntil(this.destroyed$))
107
- .subscribe(
108
- (
109
- { item, loaded, backendValidationErrors } = {
110
- item: undefined,
111
- loaded: false,
112
- saveItemState: { saveInProgress: false },
113
- backendValidationErrors: []
114
- }
115
- ) => {
116
- if (item
117
- && ((item.validationErrors || item.validationWarnings) && !this.form.formGroup.dirty)
118
- || backendValidationErrors.length
119
- ) {
120
- this.handleValidation(
121
- 'propertyName',
122
- item.validationWarnings || [],
123
- 'validationWarning',
124
- 'warningMessage'
125
- );
126
- this.handleValidation(
127
- 'propertyName',
128
- item.validationErrors || [],
129
- 'validationError',
130
- 'errorMessage'
131
- );
132
-
133
- if (this.itemCache && this.isStateChanged(item) && backendValidationErrors.length) {
134
- backendValidationErrors = this.dispatchErrors(item, backendValidationErrors);
135
- }
136
-
137
- this.handleBackendValidation(backendValidationErrors);
138
- this.cdr.markForCheck();
139
- }
140
-
141
- this.itemCache = item;
142
-
143
- this.loaded = loaded;
144
- this.cdr.detectChanges();
145
- }
146
- );
147
- }
148
-
149
- private listenFormChange() {
150
- this.form.dataChange.pipe(takeUntil(this.destroyed$)).subscribe((item) => {
151
- this.store.dispatch(
152
- createUpdateDetailAction(this.detailsRepository)({ item })
153
- );
154
- });
155
- }
156
-
157
- private listenFormStatusChange() {
158
- this.form.statusChange
159
- .pipe(takeUntil(this.destroyed$))
160
- .subscribe((formState) => {
161
- this.store.dispatch(
162
- createUpdateFormStateAction(this.detailsRepository)({ formState })
163
- );
164
- });
165
- }
166
-
167
- private handleValidation = (
168
- controlName: string,
169
- errors: any[],
170
- errorKey: string,
171
- messageKey: string
172
- ) => {
173
- if (errors.length > 0) return;
174
- errors.forEach((error: any) => {
175
- const control = this.form.formGroup.get(error[controlName]);
176
- if (control) {
177
- control.disabled
178
- ? control.disable({ emitEvent: false, onlySelf: true })
179
- : control.enable({ emitEvent: false, onlySelf: true });
180
- control.setErrors(
181
- { [errorKey]: error[messageKey] },
182
- { emitEvent: true }
183
- );
184
- control.markAsDirty();
185
- }
186
- });
187
- };
188
-
189
- private handleBackendValidation(errors: BackendValidationError[]) {
190
- errors.forEach(({ parameters, code }: BackendValidationError) => {
191
- const control = this.form.formGroup.get(this.normalizePropertyNames(parameters));
192
- if (!control) return;
193
-
194
- control[control.disabled ? "disable" : "enable"]({ emitEvent: false, onlySelf: true });
195
- control.setErrors({ "validationError": code }, { emitEvent: true });
196
- control.markAsDirty();
197
- });
198
- }
199
-
200
- private dispatchErrors(item: any, errors: BackendValidationError[]): BackendValidationError[] {
201
- const error = errors.filter((e: BackendValidationError) => {
202
- return this.itemCache[this.normalizePropertyNames(e.parameters)] === item[this.normalizePropertyNames(e.parameters)];
203
- });
204
-
205
- this.store.dispatch(
206
- createUpdateDetailSetErrorsAction(this.detailsRepository)({ error })
207
- );
208
-
209
- return error;
210
- }
211
-
212
- private normalizePropertyNames(input: string): string {
213
- return String(input[0]).toLocaleLowerCase() + String(input).slice(1);
214
- }
215
-
216
- private isStateChanged(item: any): boolean {
217
- return item !== this.itemCache;
218
- }
219
- }
@@ -1,11 +0,0 @@
1
- import { NgControl } from '@angular/forms';
2
-
3
- export abstract class BaseInputControls<T> {
4
- value?: T | null;
5
-
6
- readonly ngControl?: NgControl;
7
-
8
- readonly label?: string;
9
-
10
- readonly required!: boolean;
11
- }
@@ -1,31 +0,0 @@
1
- export interface BaseFormCore {
2
- label?: string;
3
- required: boolean;
4
- readonly: boolean;
5
- tooltip: string;
6
- formDisplay: 'flex' | 'block';
7
- clearable: boolean;
8
- placeholder?: string
9
- testId?: string;
10
- }
11
-
12
- export interface BaseFormDirectiveCore<T> {
13
- initialData: T | any;
14
- }
15
-
16
- export interface FormState {
17
- dirty: boolean;
18
- valid: boolean;
19
- }
20
-
21
- export function isFormStateEqual(current: FormState, other: FormState) {
22
- if (!current && !other) {
23
- return true;
24
- }
25
-
26
- if (current && other) {
27
- return current.dirty === other.dirty && current.valid === other.valid;
28
- }
29
-
30
- return false;
31
- }
@@ -1,9 +0,0 @@
1
- import { EventEmitter, Injectable, Output } from '@angular/core';
2
- import { Breadcrumb } from './breadcrumb.model';
3
-
4
- @Injectable({
5
- providedIn: 'root',
6
- })
7
- export class BreadcrumbService {
8
- @Output() routeChange: EventEmitter<Breadcrumb> = new EventEmitter();
9
- }
@@ -1,115 +0,0 @@
1
- import {
2
- ChangeDetectorRef,
3
- Directive,
4
- Input,
5
- inject,
6
- OnInit,
7
- } from '@angular/core';
8
- import { ActivatedRoute, NavigationEnd, Router } from '@angular/router';
9
- import { filter, takeUntil } from 'rxjs';
10
- import { MenuItem } from '../side-menu';
11
- import { UnsubscribeComponent } from '../unsubscribe.component';
12
- import { BreadcrumbCore } from './breadcrumb.model';
13
- import { BreadcrumbService } from './breadcrumb.service';
14
-
15
- @Directive({})
16
- export class BreadcrumbCoreComponent
17
- extends UnsubscribeComponent
18
- implements BreadcrumbCore, OnInit
19
- {
20
- @Input() items: MenuItem[] = [];
21
- @Input() homeRoute = '/';
22
- @Input() useHomeRoute = false;
23
-
24
- static readonly ROUTE_DATA_BREADCRUMB = 'breadcrumb';
25
- static readonly ROUTE_DATA_BREADCRUMB_URL = 'breadcrumb_url';
26
- static readonly ROUTE_DATA_NO_BREADCRUMB_ROUTE = 'breadcrumb_no_route';
27
- static readonly BREADCRUMB_HIDE = 'breadcrumb_hide';
28
- readonly home = { icon: 'pi pi-home', routerLink: this.homeRoute };
29
-
30
- router = inject(Router);
31
- activatedRoute = inject(ActivatedRoute);
32
- breadcrumbService = inject(BreadcrumbService);
33
- cdr = inject(ChangeDetectorRef);
34
-
35
- ngOnInit(): void {
36
- this.initBreadcrumbsCreation();
37
- this.initRouteChangeListen();
38
- }
39
-
40
- private initBreadcrumbsCreation() {
41
- this.router.events
42
- .pipe(
43
- filter((event) => event instanceof NavigationEnd),
44
- takeUntil(this.destroyed$)
45
- )
46
- .subscribe(
47
- () => (this.items = this.createBreadcrumbs(this.activatedRoute.root))
48
- );
49
- }
50
-
51
- private initRouteChangeListen() {
52
- this.breadcrumbService.routeChange
53
- .pipe(
54
- filter((x) => x.label !== 'Undefined'),
55
- takeUntil(this.destroyed$)
56
- )
57
- .subscribe((x) => {
58
- this.items = [
59
- ...this.items,
60
- {
61
- label: x.label,
62
- routerLink: x.routerLink,
63
- url: x.url,
64
- class: 'breadcrumb',
65
- },
66
- ];
67
- this.cdr.detectChanges();
68
- });
69
- }
70
-
71
- private createBreadcrumbs(
72
- route: ActivatedRoute,
73
- routerLink = '',
74
- breadcrumbs: MenuItem[] = []
75
- ): any {
76
- const children: ActivatedRoute[] = route.children;
77
-
78
- if (children.length === 0) {
79
- return breadcrumbs;
80
- }
81
-
82
- for (const child of children) {
83
- const routeURL: string = child.snapshot.url
84
- .map((segment) => segment.path)
85
- .join('/');
86
-
87
- if (!child.snapshot.data[BreadcrumbCoreComponent.BREADCRUMB_HIDE]) {
88
- if (BreadcrumbCoreComponent.ROUTE_DATA_BREADCRUMB_URL !== undefined) {
89
- const route =
90
- child.snapshot.data[BreadcrumbCoreComponent.ROUTE_DATA_BREADCRUMB_URL];
91
- routerLink += `/${route}`;
92
- }
93
-
94
- if (!BreadcrumbCoreComponent.ROUTE_DATA_BREADCRUMB_URL && routeURL !== '') {
95
- routerLink += `/${routeURL}`;
96
- }
97
-
98
- const label = child.snapshot.data[BreadcrumbCoreComponent.ROUTE_DATA_BREADCRUMB];
99
- if (
100
- label &&
101
- BreadcrumbCoreComponent.ROUTE_DATA_NO_BREADCRUMB_ROUTE &&
102
- child.snapshot.data[
103
- BreadcrumbCoreComponent.ROUTE_DATA_NO_BREADCRUMB_ROUTE
104
- ]
105
- ) {
106
- breadcrumbs.push({ label, routerLink: undefined });
107
- } else if (label && child.snapshot.routeConfig?.path !== '') {
108
- breadcrumbs.push({ label, routerLink: routerLink });
109
- }
110
- }
111
-
112
- return this.createBreadcrumbs(child, routerLink, breadcrumbs);
113
- }
114
- }
115
- }
@@ -1,3 +0,0 @@
1
- export * from './breadcrumb.model';
2
- export * from './breadcrumbcore.component'
3
- export * from './breadcrumb.service';
@@ -1 +0,0 @@
1
- export * from './button.model';
@@ -1 +0,0 @@
1
- export * from './calendar.model';
@@ -1,8 +0,0 @@
1
- import { InjectionToken } from '@angular/core';
2
- import { BaseFormCore } from '../base-form';
3
-
4
- export const CHECKBOX_COMPONENT_TOKEN = new InjectionToken<CheckboxCore>(
5
- 'CheckboxComponentToken'
6
- );
7
-
8
- export type CheckboxCore = BaseFormCore
@@ -1 +0,0 @@
1
- export * from './checkbox.model';
@@ -1,31 +0,0 @@
1
- import { InjectionToken, Type } from '@angular/core';
2
- import { SafeHtml } from "@angular/platform-browser";
3
- import { ControlSeverityType } from '../../common';
4
-
5
- export const CONFIRM_DIALOG_COMPONENT_TOKEN = new InjectionToken<ConfirmDialogCore>(
6
- 'ConfirmDialogComponentToken'
7
- );
8
-
9
- export type ConfirmDialogCore = object
10
-
11
- export interface DialogData {
12
- title?: string;
13
- headerIcon?: string;
14
- severity?: ControlSeverityType;
15
- showCancelButton?: boolean;
16
- buttonOrder?: 'confirm-cancel' | 'cancel-confirm';
17
- confirmButtonText?: string;
18
- confirmButtonFn?: () => void;
19
- cancelButtonFn?: () => void;
20
- cancelButtonText?: string;
21
- innerHTML?: string | SafeHtml;
22
- data?: unknown;
23
- componentType?: Type<unknown>;
24
- closable?: boolean;
25
- width?: string;
26
- height?: string;
27
- }
28
-
29
- export interface ExtendedDialogData<TInputs = any, TOutputs = any> extends DialogData {
30
- data?: TInputs & TOutputs;
31
- }
@@ -1 +0,0 @@
1
- export * from './confirm-dialog.model';
@@ -1 +0,0 @@
1
- export * from './dropdown.model';
@@ -1,2 +0,0 @@
1
- export type ExtendedComponent<TComponent> =
2
- Partial<TComponent> & { [key: string]: (value: any) => void; };
@@ -1 +0,0 @@
1
- export * from './dynamic-component.model';