@verisoft/ui-primeng 19.0.1-1 → 20.1.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 (280) hide show
  1. package/.eslintrc.json +43 -0
  2. package/README.md +377 -3
  3. package/assets/.gitkeep +0 -0
  4. package/assets/sass/main.scss +9 -26
  5. package/assets/sass/themes/_verisoft_theme.scss +2 -0
  6. package/assets/sass/vendors/_bootstrap.scss +2 -2
  7. package/assets/sass/vendors/_primeng.scss +1 -2
  8. package/jest.config.ts +22 -0
  9. package/ng-package.json +14 -0
  10. package/package.json +14 -27
  11. package/project.json +36 -0
  12. package/{index.d.ts → src/index.ts} +4 -0
  13. package/src/lib/components/breadcrumb/breadcrumb.component.html +11 -0
  14. package/src/lib/components/breadcrumb/breadcrumb.component.scss +18 -0
  15. package/src/lib/components/breadcrumb/breadcrumb.component.spec.ts +21 -0
  16. package/src/lib/components/breadcrumb/breadcrumb.component.stories.ts +36 -0
  17. package/src/lib/components/breadcrumb/breadcrumb.component.ts +27 -0
  18. package/src/lib/components/breadcrumb/breadcrumb.pipe.ts +13 -0
  19. package/src/lib/components/button/button-severity.pipe.ts +20 -0
  20. package/src/lib/components/button/button.component.html +20 -0
  21. package/src/lib/components/button/button.component.scss +0 -0
  22. package/src/lib/components/button/button.component.spec.ts +21 -0
  23. package/src/lib/components/button/button.component.ts +49 -0
  24. package/src/lib/components/calendar/calendar.component.html +53 -0
  25. package/src/lib/components/calendar/calendar.component.scss +0 -0
  26. package/src/lib/components/calendar/calendar.component.spec.ts +21 -0
  27. package/src/lib/components/calendar/calendar.component.ts +70 -0
  28. package/src/lib/components/checkbox/checkbox.component.html +20 -0
  29. package/src/lib/components/checkbox/checkbox.component.scss +15 -0
  30. package/src/lib/components/checkbox/checkbox.component.spec.ts +21 -0
  31. package/src/lib/components/checkbox/checkbox.component.stories.ts +72 -0
  32. package/src/lib/components/checkbox/checkbox.component.ts +46 -0
  33. package/src/lib/components/confirm-dialog/confirm-dialog.component.html +51 -0
  34. package/src/lib/components/confirm-dialog/confirm-dialog.component.scss +3 -0
  35. package/src/lib/components/confirm-dialog/confirm-dialog.component.spec.ts +21 -0
  36. package/src/lib/components/confirm-dialog/confirm-dialog.component.stories.ts +74 -0
  37. package/src/lib/components/confirm-dialog/confirm-dialog.component.ts +73 -0
  38. package/src/lib/components/dropdown/dropdown.component.html +93 -0
  39. package/src/lib/components/dropdown/dropdown.component.scss +16 -0
  40. package/src/lib/components/dropdown/dropdown.component.spec.ts +21 -0
  41. package/src/lib/components/dropdown/dropdown.component.ts +139 -0
  42. package/src/lib/components/dropdown-button/dropdown-button.component.html +1 -0
  43. package/src/lib/components/dropdown-button/dropdown-button.component.ts +20 -0
  44. package/src/lib/components/dropdown-button/index.ts +1 -0
  45. package/src/lib/components/errors/error.component.html +7 -0
  46. package/src/lib/components/errors/error.component.scss +3 -0
  47. package/src/lib/components/errors/error.component.ts +34 -0
  48. package/src/lib/components/errors/index.ts +1 -0
  49. package/src/lib/components/feature-list/directives/feature-list-column.directive.ts +32 -0
  50. package/src/lib/components/feature-list/directives/feature-list-filter-field.directive.ts +8 -0
  51. package/src/lib/components/feature-list/feature-list-filter.pipe.ts +21 -0
  52. package/src/lib/components/feature-list/feature-list-page.component.ts +32 -0
  53. package/src/lib/components/feature-list/feature-list-page.model.ts +42 -0
  54. package/src/lib/components/feature-list/feature-list.component.html +59 -0
  55. package/src/lib/components/feature-list/feature-list.component.scss +10 -0
  56. package/src/lib/components/feature-list/feature-list.component.ts +341 -0
  57. package/src/lib/components/filter/directives/filter-field.directive.ts +34 -0
  58. package/src/lib/components/filter/filter.component.html +68 -0
  59. package/src/lib/components/filter/filter.component.scss +0 -0
  60. package/src/lib/components/filter/filter.component.spec.ts +21 -0
  61. package/src/lib/components/filter/filter.component.stories.ts +23 -0
  62. package/src/lib/components/filter/filter.component.ts +281 -0
  63. package/src/lib/components/filter/filter.model.ts +18 -0
  64. package/src/lib/components/form-field/form-field.component.html +42 -0
  65. package/src/lib/components/form-field/form-field.component.scss +0 -0
  66. package/src/lib/components/form-field/form-field.component.spec.ts +21 -0
  67. package/src/lib/components/form-field/form-field.component.stories.ts +69 -0
  68. package/src/lib/components/form-field/form-field.component.ts +37 -0
  69. package/src/lib/components/header/header.component.html +84 -0
  70. package/src/lib/components/header/header.component.scss +0 -0
  71. package/src/lib/components/header/header.component.spec.ts +21 -0
  72. package/src/lib/components/header/header.component.stories.ts +24 -0
  73. package/src/lib/components/header/header.component.ts +65 -0
  74. package/src/lib/components/header/services/header-provider.service.ts +15 -0
  75. package/src/lib/components/icon/icon.component.html +2 -0
  76. package/src/lib/components/icon/icon.component.scss +51 -0
  77. package/src/lib/components/icon/icon.component.ts +86 -0
  78. package/src/lib/components/icon/index.ts +2 -0
  79. package/src/lib/components/input-group/input-group.component.html +34 -0
  80. package/src/lib/components/input-group/input-group.component.spec.ts +21 -0
  81. package/src/lib/components/input-group/input-group.component.ts +58 -0
  82. package/src/lib/components/loader/loader.component.html +5 -0
  83. package/src/lib/components/loader/loader.component.scss +0 -0
  84. package/src/lib/components/loader/loader.component.spec.ts +21 -0
  85. package/src/lib/components/loader/loader.component.ts +16 -0
  86. package/src/lib/components/multiselect/multiselect.component.html +67 -0
  87. package/src/lib/components/multiselect/multiselect.component.scss +0 -0
  88. package/src/lib/components/multiselect/multiselect.component.spec.ts +21 -0
  89. package/src/lib/components/multiselect/multiselect.component.ts +120 -0
  90. package/src/lib/components/number-input/number-input.component.html +22 -0
  91. package/src/lib/components/number-input/number-input.component.spec.ts +21 -0
  92. package/src/lib/components/number-input/number-input.component.ts +55 -0
  93. package/src/lib/components/page-header/page-header.component.html +35 -0
  94. package/src/lib/components/page-header/page-header.component.scss +0 -0
  95. package/src/lib/components/page-header/page-header.component.spec.ts +21 -0
  96. package/src/lib/components/page-header/page-header.component.ts +31 -0
  97. package/src/lib/components/password/password.component.html +24 -0
  98. package/src/lib/components/password/password.component.scss +0 -0
  99. package/src/lib/components/password/password.component.spec.ts +21 -0
  100. package/src/lib/components/password/password.component.ts +56 -0
  101. package/src/lib/components/radiobutton/radiobutton.component.html +34 -0
  102. package/src/lib/components/radiobutton/radiobutton.component.scss +6 -0
  103. package/src/lib/components/radiobutton/radiobutton.component.spec.ts +21 -0
  104. package/src/lib/components/radiobutton/radiobutton.component.stories.ts +71 -0
  105. package/src/lib/components/radiobutton/radiobutton.component.ts +61 -0
  106. package/src/lib/components/section/section.component.html +25 -0
  107. package/src/lib/components/section/section.component.scss +0 -0
  108. package/src/lib/components/section/section.component.spec.ts +21 -0
  109. package/src/lib/components/section/section.component.ts +31 -0
  110. package/src/lib/components/shared-components/.eslintrc.json +42 -0
  111. package/src/lib/components/shared-components/action-button-group/action-button-group.component.html +25 -0
  112. package/src/lib/components/shared-components/action-button-group/action-button-group.component.scss +0 -0
  113. package/src/lib/components/shared-components/action-button-group/action-button-group.component.spec.ts +21 -0
  114. package/src/lib/components/shared-components/action-button-group/action-button-group.component.ts +111 -0
  115. package/src/lib/components/shared-components/action-button-group/components/action-button/action-button.component.html +10 -0
  116. package/src/lib/components/shared-components/action-button-group/components/action-button/action-button.component.scss +0 -0
  117. package/src/lib/components/shared-components/action-button-group/components/action-button/action-button.component.spec.ts +21 -0
  118. package/src/lib/components/shared-components/action-button-group/components/action-button/action-button.component.ts +69 -0
  119. package/src/lib/components/shared-components/dynamic-component/dynamic-component-factory.service.ts +142 -0
  120. package/src/lib/components/shared-components/dynamic-component/dynamic-component.component.ts +56 -0
  121. package/{lib/components/shared-components/dynamic-component/index.d.ts → src/lib/components/shared-components/dynamic-component/index.ts} +2 -2
  122. package/src/lib/components/shared-components/generic-field/generic-field.component.html +98 -0
  123. package/src/lib/components/shared-components/generic-field/generic-field.component.spec.ts +21 -0
  124. package/src/lib/components/shared-components/generic-field/generic-field.component.ts +90 -0
  125. package/{lib/components/shared-components/generic-field/index.d.ts → src/lib/components/shared-components/generic-field/index.ts} +1 -1
  126. package/src/lib/components/shared-components/generic-form/generic-form.component.html +46 -0
  127. package/src/lib/components/shared-components/generic-form/generic-form.component.spec.ts +21 -0
  128. package/src/lib/components/shared-components/generic-form/generic-form.component.ts +56 -0
  129. package/src/lib/components/shared-components/generic-form/generic-form.model.spec.ts +82 -0
  130. package/src/lib/components/shared-components/generic-form/generic-form.model.ts +68 -0
  131. package/{lib/components/shared-components/generic-form/index.d.ts → src/lib/components/shared-components/generic-form/index.ts} +2 -2
  132. package/{lib/components/shared-components/index.d.ts → src/lib/components/shared-components/index.ts} +4 -6
  133. package/src/lib/components/side-menu/side-menu.component.html +53 -0
  134. package/src/lib/components/side-menu/side-menu.component.scss +0 -0
  135. package/src/lib/components/side-menu/side-menu.component.spec.ts +21 -0
  136. package/src/lib/components/side-menu/side-menu.component.ts +96 -0
  137. package/src/lib/components/side-menu/side-menu.module.ts +66 -0
  138. package/src/lib/components/slider/slider.component.html +19 -0
  139. package/src/lib/components/slider/slider.component.spec.ts +21 -0
  140. package/src/lib/components/slider/slider.component.ts +56 -0
  141. package/src/lib/components/snackbar/services/snackbar.service.ts +45 -0
  142. package/src/lib/components/snackbar/snackbar.component.html +3 -0
  143. package/src/lib/components/snackbar/snackbar.component.scss +0 -0
  144. package/src/lib/components/snackbar/snackbar.component.spec.ts +21 -0
  145. package/src/lib/components/snackbar/snackbar.component.stories.ts +70 -0
  146. package/src/lib/components/snackbar/snackbar.component.ts +25 -0
  147. package/src/lib/components/stepper/stepper.component.html +35 -0
  148. package/src/lib/components/stepper/stepper.component.spec.ts +21 -0
  149. package/src/lib/components/stepper/stepper.component.ts +39 -0
  150. package/src/lib/components/switch/switch.component.html +18 -0
  151. package/src/lib/components/switch/switch.component.scss +0 -0
  152. package/src/lib/components/switch/switch.component.spec.ts +21 -0
  153. package/src/lib/components/switch/switch.component.stories.ts +65 -0
  154. package/src/lib/components/switch/switch.component.ts +52 -0
  155. package/src/lib/components/tab-view/tab-view-item.component.ts +22 -0
  156. package/src/lib/components/tab-view/tab-view.component.html +41 -0
  157. package/src/lib/components/tab-view/tab-view.component.ts +55 -0
  158. package/src/lib/components/table/table-filter.pipe.ts +59 -0
  159. package/src/lib/components/table/table.component.html +127 -0
  160. package/src/lib/components/table/table.component.scss +11 -0
  161. package/src/lib/components/table/table.component.spec.ts +21 -0
  162. package/src/lib/components/table/table.component.stories.ts +55 -0
  163. package/src/lib/components/table/table.component.ts +288 -0
  164. package/src/lib/components/table/table.models.ts +26 -0
  165. package/src/lib/components/tag/index.ts +2 -0
  166. package/src/lib/components/tag/tag.component.html +12 -0
  167. package/src/lib/components/tag/tag.component.scss +33 -0
  168. package/src/lib/components/tag/tag.component.ts +83 -0
  169. package/src/lib/components/textarea/textarea.component.html +40 -0
  170. package/src/lib/components/textarea/textarea.component.scss +5 -0
  171. package/src/lib/components/textarea/textarea.component.spec.ts +21 -0
  172. package/src/lib/components/textarea/textarea.component.stories.ts +98 -0
  173. package/src/lib/components/textarea/textarea.component.ts +62 -0
  174. package/src/lib/components/textfield/textfield.component.html +82 -0
  175. package/src/lib/components/textfield/textfield.component.scss +23 -0
  176. package/src/lib/components/textfield/textfield.component.spec.ts +21 -0
  177. package/src/lib/components/textfield/textfield.component.stories.ts +85 -0
  178. package/src/lib/components/textfield/textfield.component.ts +68 -0
  179. package/src/lib/components/tooltip/index.ts +1 -0
  180. package/src/lib/components/tooltip/tooltip.component.html +3 -0
  181. package/src/lib/components/tooltip/tooltip.component.ts +17 -0
  182. package/src/lib/icons.ts +36 -0
  183. package/src/lib/interceptors/http-error-message.interceptor.ts +35 -0
  184. package/src/lib/pages/not-found-page/not-found-page.component.html +26 -0
  185. package/src/lib/pages/not-found-page/not-found-page.component.scss +0 -0
  186. package/src/lib/pages/not-found-page/not-found-page.component.spec.ts +21 -0
  187. package/src/lib/pages/not-found-page/not-found-page.component.ts +16 -0
  188. package/src/tab-view.ts +1 -0
  189. package/src/test-setup.ts +8 -0
  190. package/tsconfig.json +29 -0
  191. package/tsconfig.lib.json +18 -0
  192. package/tsconfig.lib.prod.json +9 -0
  193. package/tsconfig.spec.json +16 -0
  194. package/fesm2022/verisoft-ui-primeng.mjs +0 -2880
  195. package/fesm2022/verisoft-ui-primeng.mjs.map +0 -1
  196. package/lib/components/breadcrumb/breadcrumb.component.d.ts +0 -6
  197. package/lib/components/breadcrumb/breadcrumb.pipe.d.ts +0 -9
  198. package/lib/components/button/button-severity.pipe.d.ts +0 -9
  199. package/lib/components/button/button.component.d.ts +0 -20
  200. package/lib/components/calendar/calendar.component.d.ts +0 -17
  201. package/lib/components/checkbox/checkbox.component.d.ts +0 -10
  202. package/lib/components/confirm-dialog/confirm-dialog.component.d.ts +0 -15
  203. package/lib/components/dropdown/dropdown.component.d.ts +0 -38
  204. package/lib/components/dropdown-button/dropdown-button.component.d.ts +0 -14
  205. package/lib/components/dropdown-button/index.d.ts +0 -1
  206. package/lib/components/errors/error.component.d.ts +0 -16
  207. package/lib/components/errors/index.d.ts +0 -1
  208. package/lib/components/form-field/form-field.component.d.ts +0 -12
  209. package/lib/components/header/header.component.d.ts +0 -23
  210. package/lib/components/header/services/header-provider.service.d.ts +0 -10
  211. package/lib/components/input-group/input-group.component.d.ts +0 -9
  212. package/lib/components/loader/loader.component.d.ts +0 -6
  213. package/lib/components/multiselect/multiselect.component.d.ts +0 -34
  214. package/lib/components/number-input/number-input.component.d.ts +0 -14
  215. package/lib/components/page-header/page-header.component.d.ts +0 -10
  216. package/lib/components/password/password.component.d.ts +0 -11
  217. package/lib/components/radiobutton/radiobutton.component.d.ts +0 -10
  218. package/lib/components/section/section.component.d.ts +0 -12
  219. package/lib/components/shared-components/action-button-group/action-button-group.component.d.ts +0 -28
  220. package/lib/components/shared-components/action-button-group/components/action-button/action-button.component.d.ts +0 -24
  221. package/lib/components/shared-components/dynamic-component/dynamic-component-factory.service.d.ts +0 -17
  222. package/lib/components/shared-components/dynamic-component/dynamic-component.component.d.ts +0 -16
  223. package/lib/components/shared-components/feature-list/directives/feature-list-column.directive.d.ts +0 -10
  224. package/lib/components/shared-components/feature-list/directives/feature-list-filter-field.directive.d.ts +0 -6
  225. package/lib/components/shared-components/feature-list/feature-list-filter.pipe.d.ts +0 -9
  226. package/lib/components/shared-components/feature-list/feature-list-page.component.d.ts +0 -9
  227. package/lib/components/shared-components/feature-list/feature-list-page.model.d.ts +0 -23
  228. package/lib/components/shared-components/feature-list/feature-list.component.d.ts +0 -62
  229. package/lib/components/shared-components/filter/directives/filter-field.directive.d.ts +0 -20
  230. package/lib/components/shared-components/filter/filter.component.d.ts +0 -53
  231. package/lib/components/shared-components/filter/filter.model.d.ts +0 -2
  232. package/lib/components/shared-components/generic-field/generic-field.component.d.ts +0 -28
  233. package/lib/components/shared-components/generic-form/generic-form.component.d.ts +0 -15
  234. package/lib/components/shared-components/generic-form/generic-form.model.d.ts +0 -4
  235. package/lib/components/side-menu/side-menu.component.d.ts +0 -27
  236. package/lib/components/side-menu/side-menu.module.d.ts +0 -13
  237. package/lib/components/slider/slider.component.d.ts +0 -12
  238. package/lib/components/snackbar/services/snackbar.service.d.ts +0 -12
  239. package/lib/components/snackbar/snackbar.component.d.ts +0 -9
  240. package/lib/components/stepper/stepper.component.d.ts +0 -17
  241. package/lib/components/switch/switch.component.d.ts +0 -9
  242. package/lib/components/tab-view/tab-view-item.component.d.ts +0 -12
  243. package/lib/components/tab-view/tab-view.component.d.ts +0 -17
  244. package/lib/components/table/table-filter.pipe.d.ts +0 -13
  245. package/lib/components/table/table.component.d.ts +0 -67
  246. package/lib/components/table/table.models.d.ts +0 -4
  247. package/lib/components/textarea/textarea.component.d.ts +0 -12
  248. package/lib/components/textfield/textfield.component.d.ts +0 -12
  249. package/lib/components/tooltip/index.d.ts +0 -1
  250. package/lib/components/tooltip/tooltip.component.d.ts +0 -10
  251. package/lib/icons.d.ts +0 -2
  252. package/lib/interceptors/http-error-message.interceptor.d.ts +0 -11
  253. /package/{lib/components/breadcrumb/index.d.ts → src/lib/components/breadcrumb/index.ts} +0 -0
  254. /package/{lib/components/button/index.d.ts → src/lib/components/button/index.ts} +0 -0
  255. /package/{lib/components/calendar/index.d.ts → src/lib/components/calendar/index.ts} +0 -0
  256. /package/{lib/components/checkbox/index.d.ts → src/lib/components/checkbox/index.ts} +0 -0
  257. /package/{lib/components/confirm-dialog/index.d.ts → src/lib/components/confirm-dialog/index.ts} +0 -0
  258. /package/{lib/components/dropdown/index.d.ts → src/lib/components/dropdown/index.ts} +0 -0
  259. /package/{lib/components/shared-components/feature-list/index.d.ts → src/lib/components/feature-list/index.ts} +0 -0
  260. /package/{lib/components/shared-components/filter/index.d.ts → src/lib/components/filter/index.ts} +0 -0
  261. /package/{lib/components/form-field/index.d.ts → src/lib/components/form-field/index.ts} +0 -0
  262. /package/{lib/components/header/index.d.ts → src/lib/components/header/index.ts} +0 -0
  263. /package/{lib/components/input-group/index.d.ts → src/lib/components/input-group/index.ts} +0 -0
  264. /package/{lib/components/loader/index.d.ts → src/lib/components/loader/index.ts} +0 -0
  265. /package/{lib/components/multiselect/index.d.ts → src/lib/components/multiselect/index.ts} +0 -0
  266. /package/{lib/components/number-input/index.d.ts → src/lib/components/number-input/index.ts} +0 -0
  267. /package/{lib/components/page-header/index.d.ts → src/lib/components/page-header/index.ts} +0 -0
  268. /package/{lib/components/password/index.d.ts → src/lib/components/password/index.ts} +0 -0
  269. /package/{lib/components/radiobutton/index.d.ts → src/lib/components/radiobutton/index.ts} +0 -0
  270. /package/{lib/components/section/index.d.ts → src/lib/components/section/index.ts} +0 -0
  271. /package/{lib/components/shared-components/action-button-group/index.d.ts → src/lib/components/shared-components/action-button-group/index.ts} +0 -0
  272. /package/{lib/components/side-menu/index.d.ts → src/lib/components/side-menu/index.ts} +0 -0
  273. /package/{lib/components/slider/index.d.ts → src/lib/components/slider/index.ts} +0 -0
  274. /package/{lib/components/snackbar/index.d.ts → src/lib/components/snackbar/index.ts} +0 -0
  275. /package/{lib/components/stepper/index.d.ts → src/lib/components/stepper/index.ts} +0 -0
  276. /package/{lib/components/switch/index.d.ts → src/lib/components/switch/index.ts} +0 -0
  277. /package/{lib/components/tab-view/index.d.ts → src/lib/components/tab-view/index.ts} +0 -0
  278. /package/{lib/components/table/index.d.ts → src/lib/components/table/index.ts} +0 -0
  279. /package/{lib/components/textarea/index.d.ts → src/lib/components/textarea/index.ts} +0 -0
  280. /package/{lib/components/textfield/index.d.ts → src/lib/components/textfield/index.ts} +0 -0
@@ -0,0 +1,73 @@
1
+ import { CommonModule } from '@angular/common';
2
+ import { ChangeDetectorRef, Component, OnInit } from '@angular/core';
3
+ import {
4
+ CONFIRM_DIALOG_COMPONENT_TOKEN,
5
+ ConfirmDialogCore,
6
+ DialogData,
7
+ DialogService,
8
+ UnsubscribeComponent,
9
+ } from '@verisoft/ui-core';
10
+ import { AvatarModule } from 'primeng/avatar';
11
+ import { DialogModule } from 'primeng/dialog';
12
+ import { takeUntil } from 'rxjs';
13
+ import { ButtonComponent } from '../button';
14
+ import { DynamicComponent } from '../shared-components';
15
+
16
+ @Component({
17
+ selector: 'v-confirm-dialog',
18
+ imports: [
19
+ CommonModule,
20
+ DialogModule,
21
+ ButtonComponent,
22
+ AvatarModule,
23
+ DynamicComponent,
24
+ ],
25
+ templateUrl: './confirm-dialog.component.html',
26
+ styleUrl: './confirm-dialog.component.scss',
27
+ providers: [
28
+ {
29
+ provide: CONFIRM_DIALOG_COMPONENT_TOKEN,
30
+ useExisting: ConfirmDialogComponent,
31
+ },
32
+ ]
33
+ })
34
+ export class ConfirmDialogComponent
35
+ extends UnsubscribeComponent
36
+ implements OnInit, ConfirmDialogCore
37
+ {
38
+ constructor(
39
+ private readonly dialogService: DialogService,
40
+ private readonly cdr: ChangeDetectorRef
41
+ ) {
42
+ super();
43
+ }
44
+
45
+ visible = false;
46
+ protected closable = false;
47
+ data!: DialogData;
48
+
49
+ ngOnInit(): void {
50
+ this.dialogService.showEvent
51
+ .pipe(takeUntil(this.destroyed$))
52
+ .subscribe((x: DialogData) => {
53
+ this.data = x;
54
+ this.visible = true;
55
+ this.cdr.detectChanges();
56
+ });
57
+ }
58
+
59
+ protected dialogClick(confirm: boolean) {
60
+ const { confirmButtonFn, cancelButtonFn } = this.data;
61
+
62
+ if (confirm && confirmButtonFn) {
63
+ confirmButtonFn();
64
+ }
65
+
66
+ if (!confirm && cancelButtonFn) {
67
+ cancelButtonFn();
68
+ }
69
+
70
+ this.visible = false;
71
+ this.cdr.detectChanges();
72
+ }
73
+ }
@@ -0,0 +1,93 @@
1
+ <div class="v-dropdown">
2
+ @if (label && !floatLabel) {
3
+ <v-form-field
4
+ [label]="label"
5
+ [tooltip]="tooltip"
6
+ [required]="isRequired()"
7
+ [testId]="testId"
8
+ [display]="formDisplay"
9
+ >
10
+ <p-select
11
+ class="w-100"
12
+ appendTo="body"
13
+ [formControl]="formControl"
14
+ [filter]="filter"
15
+ [title]="label"
16
+ [options]="options"
17
+ [optionLabel]="optionLabel"
18
+ [optionValue]="optionValue"
19
+ [loading]="loading"
20
+ [placeholder]="placeholder ?? ''"
21
+ [virtualScroll]="lazy"
22
+ [virtualScrollItemSize]="virtualOptionSize"
23
+ [virtualScrollOptions]="virtualScrollOptions"
24
+ [tooltip]="tooltip"
25
+ [required]="isRequired()"
26
+ [showClear]="formControl && clearable && !readonly"
27
+ [editable]="editable"
28
+ [dataKey]="optionValue"
29
+ (showEvent)="onDropdownShow()"
30
+ (clearEvent)="onDropdownClear()"
31
+ (onFilter)="filterChange($event)"
32
+ >
33
+ </p-select>
34
+ </v-form-field>
35
+ <v-validation-message [ngControl]="ngControl"></v-validation-message>
36
+ }
37
+ @if (!label && !floatLabel) {
38
+ <p-select
39
+ class="w-100"
40
+ appendTo="body"
41
+ [formControl]="formControl"
42
+ [filter]="filter"
43
+ [title]="label"
44
+ [options]="options"
45
+ [optionLabel]="optionLabel"
46
+ [optionValue]="optionValue"
47
+ [loading]="loading"
48
+ [placeholder]="placeholder ? placeholder : label"
49
+ [tooltip]="tooltip"
50
+ [required]="isRequired()"
51
+ [showClear]="formControl && clearable && !readonly"
52
+ [editable]="editable"
53
+ [dataKey]="optionValue"
54
+ [virtualScroll]="lazy"
55
+ [virtualScrollItemSize]="virtualOptionSize"
56
+ [virtualScrollOptions]="virtualScrollOptions"
57
+ (showEvent)="onDropdownShow()"
58
+ (clearEvent)="onDropdownClear()"
59
+ (onFilter)="filterChange($event)"
60
+ >
61
+ </p-select>
62
+ }
63
+ @if (floatLabel && !label) {
64
+ <p-floatLabel>
65
+ <p-select
66
+ class="w-100"
67
+ appendTo="body"
68
+ [formControl]="formControl"
69
+ [title]="label"
70
+ [options]="options"
71
+ [optionLabel]="optionLabel"
72
+ [optionValue]="optionValue"
73
+ [loading]="loading"
74
+ [placeholder]="placeholder ? placeholder : label"
75
+ [filter]="filter"
76
+ [tooltip]="tooltip"
77
+ [required]="isRequired()"
78
+ [showClear]="formControl && clearable && !readonly"
79
+ [editable]="editable"
80
+ [dataKey]="optionValue"
81
+ [virtualScroll]="lazy"
82
+ [virtualScrollItemSize]="virtualOptionSize"
83
+ [virtualScrollOptions]="virtualScrollOptions"
84
+ (showEvent)="onDropdownShow()"
85
+ (clearEvent)="onDropdownClear()"
86
+ (onFilter)="filterChange($event)"
87
+ (lazyLoad)="onLazyLoad($any($event))"
88
+ >
89
+ </p-select>
90
+ <label [for]="inputId">{{ floatLabel }}</label>
91
+ </p-floatLabel>
92
+ }
93
+ </div>
@@ -0,0 +1,16 @@
1
+ .v-dropdown {
2
+ justify-content: center;
3
+ width: 100%;
4
+ }
5
+
6
+ .p-dropdown-items-wrapper,
7
+ .p-scroller-viewport,
8
+ .p-scroller {
9
+ min-width: 8rem !important;
10
+ overflow-x: hidden;
11
+ overflow-y: auto;
12
+ }
13
+
14
+ .p-dropdown {
15
+ width: 100%;
16
+ }
@@ -0,0 +1,21 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+ import { DropdownComponent } from './dropdown.component';
3
+
4
+ describe('DropdownComponent', () => {
5
+ let component: DropdownComponent<any>;
6
+ let fixture: ComponentFixture<DropdownComponent<any>>;
7
+
8
+ beforeEach(async () => {
9
+ await TestBed.configureTestingModule({
10
+ imports: [DropdownComponent],
11
+ }).compileComponents();
12
+
13
+ fixture = TestBed.createComponent(DropdownComponent);
14
+ component = fixture.componentInstance;
15
+ fixture.detectChanges();
16
+ });
17
+
18
+ it('should create', () => {
19
+ expect(component).toBeTruthy();
20
+ });
21
+ });
@@ -0,0 +1,139 @@
1
+
2
+ import {
3
+ ChangeDetectionStrategy,
4
+ Component,
5
+ EventEmitter,
6
+ forwardRef,
7
+ Input,
8
+ OnChanges,
9
+ OnDestroy,
10
+ Optional,
11
+ Output,
12
+ Self,
13
+ SimpleChanges,
14
+ ViewEncapsulation,
15
+ OnInit,
16
+ } from '@angular/core';
17
+ import {
18
+ ControlValueAccessor,
19
+ NgControl,
20
+ ReactiveFormsModule,
21
+ } from '@angular/forms';
22
+ import { FilterEvent, LazyLoadEvent } from '@verisoft/core';
23
+ import {
24
+ BaseFormInputComponent,
25
+ BaseInputControls,
26
+ DROPDOWN_COMPONENT_TOKEN,
27
+ DropdownCore
28
+ } from '@verisoft/ui-core';
29
+ import { ScrollerOptions } from 'primeng/api';
30
+ import { FloatLabelModule } from 'primeng/floatlabel';
31
+ import { MessageModule } from 'primeng/message';
32
+ import { ScrollerLazyLoadEvent } from 'primeng/scroller';
33
+ import { SelectModule, SelectFilterEvent } from 'primeng/select';
34
+ import { TooltipModule } from 'primeng/tooltip';
35
+ import { Subject } from 'rxjs';
36
+ import { ErrorComponent } from '../errors';
37
+ import { FormFieldComponent } from '../form-field';
38
+
39
+ @Component({
40
+ selector: 'v-dropdown',
41
+ imports: [
42
+ ReactiveFormsModule,
43
+ SelectModule,
44
+ TooltipModule,
45
+ FormFieldComponent,
46
+ MessageModule,
47
+ FloatLabelModule,
48
+ ErrorComponent
49
+ ],
50
+ templateUrl: './dropdown.component.html',
51
+ styleUrls: ['./dropdown.component.scss'],
52
+ changeDetection: ChangeDetectionStrategy.OnPush,
53
+ encapsulation: ViewEncapsulation.None,
54
+ providers: [
55
+ {
56
+ provide: BaseInputControls,
57
+ useExisting: forwardRef(() => DropdownComponent),
58
+ multi: true,
59
+ },
60
+ {
61
+ provide: DROPDOWN_COMPONENT_TOKEN,
62
+ useExisting: DropdownComponent,
63
+ },
64
+ ]
65
+ })
66
+ export class DropdownComponent<T>
67
+ extends BaseFormInputComponent
68
+ implements
69
+ ControlValueAccessor,
70
+ OnChanges,
71
+ OnDestroy,
72
+ OnInit,
73
+ DropdownCore<T>
74
+ {
75
+ constructor(@Optional() @Self() ngControl: NgControl) {
76
+ super(ngControl);
77
+ }
78
+
79
+ @Input() options: T[] | undefined = [];
80
+ @Input() optionLabel: string | undefined;
81
+ @Input() optionValue: string | undefined;
82
+ @Input() dropdownIcon?: string;
83
+ @Input() floatLabel?: string;
84
+ @Input() editable = false;
85
+ @Input() loading = false;
86
+ @Input() lazy = false;
87
+ @Input() filter = true;
88
+ @Input() forceMinWidth = false;
89
+ @Input() showFilter = false;
90
+ @Input() localSearch = false;
91
+
92
+ @Output() showed = new EventEmitter<any>();
93
+ @Output() cleared = new EventEmitter<any>();
94
+ @Output() lazyLoad = new EventEmitter<LazyLoadEvent>();
95
+ @Output() filtered = new EventEmitter<FilterEvent>();
96
+
97
+ private destroy$ = new Subject<void>();
98
+
99
+ virtualScrollOptions!: ScrollerOptions | undefined;
100
+ virtualOptionSize = 37.5;
101
+
102
+ ngOnChanges(changes: SimpleChanges): void {
103
+ if (changes['lazy'] || changes['loading']) {
104
+ this.virtualScrollOptions = this.lazy
105
+ ? {
106
+ showLoader: this.loading,
107
+ lazy: true,
108
+ onLazyLoad: this.onLazyLoad.bind(this),
109
+ }
110
+ : undefined;
111
+ }
112
+ }
113
+
114
+ ngOnDestroy(): void {
115
+ this.destroy$.next();
116
+ this.destroy$.complete();
117
+ }
118
+
119
+ onLazyLoad(event: ScrollerLazyLoadEvent): void {
120
+ this.lazyLoad.emit({
121
+ offset: event.first,
122
+ limit: event.last - event.first,
123
+ });
124
+ }
125
+
126
+ filterChange(event: SelectFilterEvent): void {
127
+ this.filtered.emit({
128
+ filter: event.filter,
129
+ });
130
+ }
131
+
132
+ onDropdownShow(): void {
133
+ this.showed.emit();
134
+ }
135
+
136
+ onDropdownClear(): void {
137
+ this.cleared.emit();
138
+ }
139
+ }
@@ -0,0 +1 @@
1
+ <p>NOT implemented </p>
@@ -0,0 +1,20 @@
1
+ import { Component, input } from "@angular/core";
2
+ import { DropdownButtonCore, DROPDOWN_BUTTON_COMPONENT_TOKEN, ControlSeverityType, ControlSeverity, FieldSizeType, MenuItem } from "@verisoft/ui-core";
3
+
4
+ @Component({
5
+ selector: 'v-dropdown-button',
6
+ templateUrl: './dropdown-button.component.html',
7
+ providers: [
8
+ { provide: DROPDOWN_BUTTON_COMPONENT_TOKEN, useExisting: DropdownButtonComponent }
9
+ ]
10
+ })
11
+ export class DropdownButtonComponent implements DropdownButtonCore {
12
+ label = input<string | undefined>();
13
+ icon = input<string | undefined>();
14
+ rounded = input<boolean | undefined>(false);
15
+ raised = input<boolean | undefined>(false);
16
+ outlined = input<boolean | undefined>(false);
17
+ severity = input<ControlSeverityType | undefined>(ControlSeverity.primary);
18
+ size = input<FieldSizeType | undefined>();
19
+ items = input<MenuItem[] | undefined>(undefined);
20
+ }
@@ -0,0 +1 @@
1
+ export * from './dropdown-button.component';
@@ -0,0 +1,7 @@
1
+
2
+ @if (ngControl && ngControl.errors) {
3
+ <p-message
4
+ [severity]="severity"
5
+ text="{{ getErrorMessage(ngControl.errors) | async }}">
6
+ </p-message>
7
+ }
@@ -0,0 +1,3 @@
1
+ .p-message-content {
2
+ color: #e60017;
3
+ }
@@ -0,0 +1,34 @@
1
+ import { CommonModule } from "@angular/common";
2
+ import { Component, inject, Input, } from "@angular/core";
3
+ import { NgControl, ValidationErrors } from "@angular/forms";
4
+ import { ERROR_PROVIDER_TOKEN } from "@verisoft/core";
5
+ import { SlotPosition, SlotPositionType } from "@verisoft/ui-core";
6
+ import { MessageModule } from "primeng/message";
7
+ import { Observable } from "rxjs";
8
+ import { Icons } from "../../icons";
9
+
10
+ @Component({
11
+ selector: "v-validation-message",
12
+ templateUrl: "./error.component.html",
13
+ styleUrl: "./error.component.scss",
14
+ imports: [CommonModule, MessageModule]
15
+ })
16
+ export class ErrorComponent {
17
+ @Input({ required: true }) ngControl?: NgControl;
18
+
19
+ @Input() errorSlot: SlotPositionType = SlotPosition.bottom
20
+
21
+ @Input() messageSlot: SlotPositionType = SlotPosition.bottom
22
+
23
+ @Input() variant = 'simple';
24
+
25
+ @Input() severity = 'error';
26
+
27
+ readonly errorService = inject(ERROR_PROVIDER_TOKEN);
28
+
29
+ icons = Icons
30
+
31
+ getErrorMessage(errors: ValidationErrors): Observable<string | undefined> {
32
+ return this.errorService.mapError(errors);
33
+ }
34
+ }
@@ -0,0 +1 @@
1
+ export * from './error.component';
@@ -0,0 +1,32 @@
1
+ import { Directive, Input } from '@angular/core';
2
+ import { GenericFieldType, GenericFieldTypeType, TableColumnDirective } from '@verisoft/ui-core';
3
+ import { FEATURE_LIST_COLUMN_PROVIDER, FeatureListColumnDefinition, FeatureListColumnProvider } from '../feature-list-page.model';
4
+
5
+ @Directive({
6
+ // eslint-disable-next-line @angular-eslint/directive-selector
7
+ selector: 'v-feature-list-column',
8
+ standalone: true,
9
+ providers: [
10
+ {
11
+ provide: FEATURE_LIST_COLUMN_PROVIDER,
12
+ useExisting: FeatureListColumnDirective,
13
+ multi: true,
14
+ },
15
+ ],
16
+ })
17
+ export class FeatureListColumnDirective<T>
18
+ extends TableColumnDirective<T>
19
+ implements FeatureListColumnProvider<T>
20
+ {
21
+ @Input() filter = false;
22
+
23
+ @Input() type: GenericFieldTypeType = GenericFieldType.text;
24
+
25
+ override getDefinition(): FeatureListColumnDefinition<T> {
26
+ const definition = super.getDefinition() as FeatureListColumnDefinition<T>;
27
+ definition.filter = this.filter;
28
+ definition.type = this.type;
29
+ definition.format = this.format;
30
+ return definition;
31
+ }
32
+ }
@@ -0,0 +1,8 @@
1
+ import { Directive } from '@angular/core';
2
+ import { FilterFieldDirective } from '../../filter';
3
+ @Directive({
4
+ // eslint-disable-next-line @angular-eslint/directive-selector
5
+ selector: 'v-feature-list-filter-field',
6
+ standalone: true,
7
+ })
8
+ export class FeatureListFilterFieldDirective extends FilterFieldDirective {}
@@ -0,0 +1,21 @@
1
+ import { Pipe, PipeTransform } from "@angular/core";
2
+ import { GenericFieldDefinition, GenericFieldType } from "@verisoft/ui-core";
3
+ import { FeatureListColumnDefinition } from "./feature-list-page.model";
4
+
5
+ @Pipe({
6
+ name: 'featureListColumn',
7
+ standalone: true,
8
+ })
9
+ export class FeatureListFilterPipe<T> implements PipeTransform {
10
+ transform(value: FeatureListColumnDefinition<T>[] | undefined): GenericFieldDefinition[] | undefined {
11
+ if (!value){
12
+ return undefined;
13
+ }
14
+
15
+ return value.filter(x => x.filter).map((x, index) => ({
16
+ name: x.id,
17
+ label: typeof x.headerName === 'function'? x.headerName(x.id, index) : x.headerName ?? '',
18
+ type: x.type as GenericFieldType,
19
+ }));
20
+ }
21
+ }
@@ -0,0 +1,32 @@
1
+ import { Component, inject } from '@angular/core';
2
+ import { ActivatedRoute } from '@angular/router';
3
+ import {
4
+ FEATURE_LIST_PAGE_CONFIG_PROPERTY,
5
+ FeatureListPageConfig,
6
+ } from './feature-list-page.model';
7
+ import { FeatureListComponent } from './feature-list.component';
8
+
9
+ @Component({
10
+ selector: 'v-feature-list-page',
11
+ imports: [FeatureListComponent],
12
+ template: `
13
+ <v-feature-list
14
+ [title]="config.title"
15
+ [tableName]="config.tableName"
16
+ [showAdd]="config.showAdd ?? true"
17
+ [showDownload]="config.showDownload ?? true"
18
+ [showDelete]="config.showDelete ?? true"
19
+ >
20
+ </v-feature-list>
21
+ `
22
+ })
23
+ export class FeatureListPageComponent {
24
+ config!: FeatureListPageConfig;
25
+
26
+ private readonly activatedRoute = inject(ActivatedRoute);
27
+
28
+ constructor() {
29
+ this.config =
30
+ this.activatedRoute.snapshot.data[FEATURE_LIST_PAGE_CONFIG_PROPERTY];
31
+ }
32
+ }
@@ -0,0 +1,42 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ import { Route } from '@angular/router';
3
+ import { ColumnDefinition, GenericFieldTypeType } from '@verisoft/ui-core';
4
+ import { FeatureListPageComponent } from './feature-list-page.component';
5
+
6
+ export interface FeatureListPageConfig {
7
+ title: string;
8
+ datasource: string;
9
+ tableName: string;
10
+ showAdd?: boolean;
11
+ showDownload?: boolean;
12
+ showDelete?: boolean;
13
+ }
14
+
15
+ export const FEATURE_LIST_PAGE_CONFIG_PROPERTY = 'feature_list_config';
16
+
17
+ export function addFeatureListPage(
18
+ value: Partial<Route> & { config: FeatureListPageConfig }
19
+ ): Route {
20
+ const { config, ...route } = value;
21
+ return {
22
+ component: FeatureListPageComponent,
23
+ ...route,
24
+ data: {
25
+ [FEATURE_LIST_PAGE_CONFIG_PROPERTY]: config,
26
+ ...(route.data ?? {}),
27
+ },
28
+ };
29
+ }
30
+
31
+ export interface FeatureListColumnDefinition<T> extends ColumnDefinition<T> {
32
+ filter?: boolean;
33
+ type?: GenericFieldTypeType;
34
+ }
35
+
36
+ export const FEATURE_LIST_COLUMN_PROVIDER = new InjectionToken(
37
+ 'FEATURE_LIST_COLUMN_PROVIDER'
38
+ );
39
+
40
+ export interface FeatureListColumnProvider<T> {
41
+ getDefinition: () => FeatureListColumnDefinition<T>;
42
+ }
@@ -0,0 +1,59 @@
1
+ <div class="feature-list__container full-height-container">
2
+ <v-filter
3
+ #filter
4
+ [title]="title"
5
+ [fields]="columns | featureListColumn"
6
+ [filters]="filters"
7
+ [fulltextFieldName]="fulltextFieldName"
8
+ [showFulltext]="showFulltext"
9
+ [showFilters]="showExtendedFilter"
10
+ >
11
+ <v-action-button-group
12
+ [maxItems]="maxVisibleActions"
13
+ [maxItemsMobile]="maxVisibleMobileActions"
14
+ >
15
+ @if (showAdd) {
16
+ <v-action-button
17
+ [icon]="icons.add"
18
+ label="Add"
19
+ [disabled]="!canAdd"
20
+ (click)="addClick.emit()"
21
+ ></v-action-button>
22
+ } @if (showDelete){
23
+ <v-action-button
24
+ [icon]="icons.delete"
25
+ label="Delete"
26
+ [disabled]="!canDelete || !selection.length"
27
+ (click)="startDeleteItems()"
28
+ ></v-action-button>
29
+ } @if (showDownload){
30
+ <v-action-button
31
+ [icon]="icons.download"
32
+ label="Download"
33
+ [disabled]="!canDownload"
34
+ (click)="startDownload()"
35
+ ></v-action-button>
36
+ }
37
+ </v-action-button-group>
38
+ </v-filter>
39
+ <div class="feature-list__table-container full-height-container">
40
+ <div class="full-height-container">
41
+ <v-table
42
+ useDatasource
43
+ useFilter
44
+ [filterComponent]="filter"
45
+ class="full-height-container"
46
+ [selectionMode]="selectionMode"
47
+ [tableName]="tableName"
48
+ [autoBind]="true"
49
+ [datasource]="datasource"
50
+ [columns]="columns"
51
+ [extraFilter]="extraFilter"
52
+ [maximumColumnLength]="maximumColumnLength"
53
+ [disableCustomClicks]="disableCustomClicks"
54
+ (selectionChange)="selectItems($event)"
55
+ >
56
+ </v-table>
57
+ </div>
58
+ </div>
59
+ </div>
@@ -0,0 +1,10 @@
1
+ .full-height-container {
2
+ display: flex;
3
+ flex-direction: column;
4
+ flex-grow: 1;
5
+ height: 100%;
6
+ }
7
+
8
+ :host {
9
+ @extend .full-height-container;
10
+ }