vc-create-dashboard 3.0.83 → 3.0.84

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 (419) hide show
  1. package/README.md +24 -24
  2. package/karma.conf.js +44 -0
  3. package/ng-package.json +7 -0
  4. package/package.json +11 -25
  5. package/src/lib/categoryList.ts +23 -0
  6. package/src/lib/configurations.ts +8 -0
  7. package/src/lib/create-dashboard-container/categories/categories-config.ts +18 -0
  8. package/src/lib/create-dashboard-container/categories/categories.component.html +150 -0
  9. package/src/lib/create-dashboard-container/categories/categories.component.less +252 -0
  10. package/src/lib/create-dashboard-container/categories/categories.component.spec.ts +43 -0
  11. package/src/lib/create-dashboard-container/categories/categories.component.ts +220 -0
  12. package/src/lib/create-dashboard-container/configure-widgets/configure-widgets/configure-widgets.component.html +141 -0
  13. package/src/lib/create-dashboard-container/configure-widgets/configure-widgets/configure-widgets.component.less +381 -0
  14. package/src/lib/create-dashboard-container/configure-widgets/configure-widgets/configure-widgets.component.spec.ts +48 -0
  15. package/src/lib/create-dashboard-container/configure-widgets/configure-widgets/configure-widgets.component.ts +392 -0
  16. package/src/lib/create-dashboard-container/configure-widgets/configure-widgets/widget.interface.ts +9 -0
  17. package/src/lib/create-dashboard-container/configure-widgets/configure-widgets.module.ts +30 -0
  18. package/src/lib/create-dashboard-container/constants/assets.constant.ts +37 -0
  19. package/src/lib/create-dashboard-container/create-dashboard-config.ts +24 -0
  20. package/src/lib/create-dashboard-container/create-dashboard-mockData.ts +341 -0
  21. package/src/lib/create-dashboard-container/create-dashboard.component.html +660 -0
  22. package/src/lib/create-dashboard-container/create-dashboard.component.less +1579 -0
  23. package/src/lib/create-dashboard-container/create-dashboard.component.ts +1886 -0
  24. package/src/lib/create-dashboard-container/create-dashboard.module.ts +76 -0
  25. package/src/lib/create-dashboard-container/directives/directives.module.ts +18 -0
  26. package/src/lib/create-dashboard-container/directives/scroll-in-view.directive.ts +28 -0
  27. package/src/lib/create-dashboard-container/form-group/form-group.component.html +288 -0
  28. package/src/lib/create-dashboard-container/form-group/form-group.component.less +450 -0
  29. package/src/lib/create-dashboard-container/form-group/form-group.component.spec.ts +90 -0
  30. package/src/lib/create-dashboard-container/form-group/form-group.component.ts +163 -0
  31. package/src/lib/create-dashboard-container/frequency/frequency.component.html +61 -0
  32. package/src/lib/create-dashboard-container/frequency/frequency.component.less +183 -0
  33. package/src/lib/create-dashboard-container/frequency/frequency.component.spec.ts +120 -0
  34. package/src/lib/create-dashboard-container/frequency/frequency.component.ts +303 -0
  35. package/{lib/create-dashboard-container/interfaces/widget-data-model.d.ts → src/lib/create-dashboard-container/interfaces/widget-data-model.ts} +8 -8
  36. package/src/lib/create-dashboard-container/pipes/filter.pipe.ts +25 -0
  37. package/src/lib/create-dashboard-container/pipes/search-program.pipe.ts +31 -0
  38. package/src/lib/create-dashboard-container/pipes/search.pipe.ts +23 -0
  39. package/src/lib/create-dashboard-container/pipes/text-count.pipe.spec.ts +8 -0
  40. package/src/lib/create-dashboard-container/pipes/text-count.pipe.ts +14 -0
  41. package/src/lib/create-dashboard-container/program-list/constant.ts +36 -0
  42. package/src/lib/create-dashboard-container/program-list/information-block/information-block.component.html +9 -0
  43. package/src/lib/create-dashboard-container/program-list/information-block/information-block.component.less +63 -0
  44. package/src/lib/create-dashboard-container/program-list/information-block/information-block.component.ts +15 -0
  45. package/src/lib/create-dashboard-container/program-list/interfaces/data-source.interface.ts +6 -0
  46. package/src/lib/create-dashboard-container/program-list/interfaces/list-item.interface.ts +8 -0
  47. package/src/lib/create-dashboard-container/program-list/interfaces/selection-predicate.interface.ts +4 -0
  48. package/src/lib/create-dashboard-container/program-list/list-container/list-container.component.less +57 -0
  49. package/src/lib/create-dashboard-container/program-list/list-container/list-container.component.ts +30 -0
  50. package/src/lib/create-dashboard-container/program-list/pipes/check-selected-items.pipes.ts +19 -0
  51. package/src/lib/create-dashboard-container/program-list/program-list/program-list.component.html +158 -0
  52. package/src/lib/create-dashboard-container/program-list/program-list/program-list.component.less +679 -0
  53. package/src/lib/create-dashboard-container/program-list/program-list/program-list.component.ts +342 -0
  54. package/src/lib/create-dashboard-container/program-list/program-list.module.ts +36 -0
  55. package/src/lib/create-dashboard-container/program-list/services/list-utils.service.ts +22 -0
  56. package/src/lib/create-dashboard-container/program-list/services/program-list-api.service.ts +24 -0
  57. package/src/lib/create-dashboard-container/responsibility-center/responsibility-center.component.html +70 -0
  58. package/src/lib/create-dashboard-container/responsibility-center/responsibility-center.component.less +181 -0
  59. package/src/lib/create-dashboard-container/responsibility-center/responsibility-center.component.spec.ts +41 -0
  60. package/src/lib/create-dashboard-container/responsibility-center/responsibility-center.component.ts +154 -0
  61. package/src/lib/create-dashboard-container/risk-categories/risk-categories-config.ts +18 -0
  62. package/src/lib/create-dashboard-container/risk-categories/risk-categories.component.html +152 -0
  63. package/src/lib/create-dashboard-container/risk-categories/risk-categories.component.less +230 -0
  64. package/src/lib/create-dashboard-container/risk-categories/risk-categories.component.spec.ts +39 -0
  65. package/src/lib/create-dashboard-container/risk-categories/risk-categories.component.ts +209 -0
  66. package/src/lib/create-dashboard-container/services/auth.service.ts +27 -0
  67. package/src/lib/create-dashboard-container/services/configure-widgets.service.spec.ts +19 -0
  68. package/src/lib/create-dashboard-container/services/configure-widgets.service.ts +235 -0
  69. package/src/lib/create-dashboard-container/services/create-dashboard.service.spec.ts +19 -0
  70. package/src/lib/create-dashboard-container/services/create-dashboard.service.ts +287 -0
  71. package/src/lib/create-dashboard-container/services/pagination.service.spec.ts +16 -0
  72. package/src/lib/create-dashboard-container/services/pagination.service.ts +25 -0
  73. package/src/lib/create-dashboard-container/services/urlConfig.service.ts +21 -0
  74. package/src/lib/create-dashboard-container/user-list/user-list.component.html +358 -0
  75. package/src/lib/create-dashboard-container/user-list/user-list.component.less +451 -0
  76. package/src/lib/create-dashboard-container/user-list/user-list.component.spec.ts +153 -0
  77. package/src/lib/create-dashboard-container/user-list/user-list.component.ts +472 -0
  78. package/{lib/create-dashboard-container/user-list/user-list.config.d.ts → src/lib/create-dashboard-container/user-list/user-list.config.ts} +13 -13
  79. package/src/lib/create-dashboard-container/utils/dashboard-edit.utils.ts +235 -0
  80. package/src/lib/create-dashboard.service.ts +8 -0
  81. package/src/lib/ui-kit/action-dialog/access-capability/access-capability.component.html +22 -0
  82. package/src/lib/ui-kit/action-dialog/access-capability/access-capability.component.less +218 -0
  83. package/src/lib/ui-kit/action-dialog/access-capability/access-capability.component.ts +30 -0
  84. package/src/lib/ui-kit/action-dialog/action-dialog.module.ts +53 -0
  85. package/src/lib/ui-kit/action-dialog/active/active.component.html +25 -0
  86. package/src/lib/ui-kit/action-dialog/active/active.component.less +168 -0
  87. package/src/lib/ui-kit/action-dialog/active/active.component.ts +31 -0
  88. package/src/lib/ui-kit/action-dialog/assesment-confirmation/assesment-confirmation.component.html +18 -0
  89. package/src/lib/ui-kit/action-dialog/assesment-confirmation/assesment-confirmation.component.less +98 -0
  90. package/src/lib/ui-kit/action-dialog/assesment-confirmation/assesment-confirmation.component.ts +18 -0
  91. package/src/lib/ui-kit/action-dialog/confirmation/confirmation.component.html +20 -0
  92. package/src/lib/ui-kit/action-dialog/confirmation/confirmation.component.less +325 -0
  93. package/src/lib/ui-kit/action-dialog/confirmation/confirmation.component.ts +26 -0
  94. package/src/lib/ui-kit/action-dialog/delete/delete.component.html +24 -0
  95. package/src/lib/ui-kit/action-dialog/delete/delete.component.less +240 -0
  96. package/src/lib/ui-kit/action-dialog/delete/delete.component.ts +22 -0
  97. package/src/lib/ui-kit/action-dialog/error/error.component.html +20 -0
  98. package/src/lib/ui-kit/action-dialog/error/error.component.less +103 -0
  99. package/src/lib/ui-kit/action-dialog/error/error.component.ts +18 -0
  100. package/src/lib/ui-kit/action-dialog/inactive/inactive.component.html +25 -0
  101. package/src/lib/ui-kit/action-dialog/inactive/inactive.component.less +167 -0
  102. package/src/lib/ui-kit/action-dialog/inactive/inactive.component.ts +29 -0
  103. package/src/lib/ui-kit/action-dialog/link/link.component.html +57 -0
  104. package/src/lib/ui-kit/action-dialog/link/link.component.less +222 -0
  105. package/src/lib/ui-kit/action-dialog/link/link.component.ts +18 -0
  106. package/src/lib/ui-kit/action-dialog/move/move.component.html +43 -0
  107. package/src/lib/ui-kit/action-dialog/move/move.component.less +157 -0
  108. package/src/lib/ui-kit/action-dialog/move/move.component.ts +25 -0
  109. package/src/lib/ui-kit/action-dialog/my-rating/my-rating.component.html +19 -0
  110. package/src/lib/ui-kit/action-dialog/my-rating/my-rating.component.less +97 -0
  111. package/src/lib/ui-kit/action-dialog/my-rating/my-rating.component.ts +18 -0
  112. package/src/lib/ui-kit/action-dialog/upload/upload.component.html +19 -0
  113. package/src/lib/ui-kit/action-dialog/upload/upload.component.less +97 -0
  114. package/src/lib/ui-kit/action-dialog/upload/upload.component.ts +12 -0
  115. package/src/lib/ui-kit/chart/bar/bar.component.html +28 -0
  116. package/src/lib/ui-kit/chart/bar/bar.component.less +13 -0
  117. package/src/lib/ui-kit/chart/bar/bar.component.ts +44 -0
  118. package/src/lib/ui-kit/chart/chart.module.ts +12 -0
  119. package/src/lib/ui-kit/chart/pipes/segmenter.pipe.ts +28 -0
  120. package/src/lib/ui-kit/chart/pipes/x-calculator.pipe.ts +22 -0
  121. package/src/lib/ui-kit/circle-progresss/circle/circle.component.html +37 -0
  122. package/src/lib/ui-kit/circle-progresss/circle/circle.component.less +1448 -0
  123. package/src/lib/ui-kit/circle-progresss/circle/circle.component.ts +19 -0
  124. package/src/lib/ui-kit/circle-progresss/circle-progresss.module.ts +10 -0
  125. package/src/lib/ui-kit/click-outside/click-outside.directive.ts +16 -0
  126. package/src/lib/ui-kit/click-outside/click-outside.module.ts +16 -0
  127. package/src/lib/ui-kit/color-palette/color-palette.component.html +110 -0
  128. package/src/lib/ui-kit/color-palette/color-palette.component.less +54 -0
  129. package/src/lib/ui-kit/color-palette/color-palette.component.ts +28 -0
  130. package/src/lib/ui-kit/color-palette/color-palette.module.ts +10 -0
  131. package/src/lib/ui-kit/dashboard-footer/dashboard-footer/dashboard-footer.component.html +37 -0
  132. package/src/lib/ui-kit/dashboard-footer/dashboard-footer/dashboard-footer.component.less +335 -0
  133. package/src/lib/ui-kit/dashboard-footer/dashboard-footer/dashboard-footer.component.spec.ts +25 -0
  134. package/src/lib/ui-kit/dashboard-footer/dashboard-footer/dashboard-footer.component.ts +44 -0
  135. package/src/lib/ui-kit/dashboard-footer/dashboard-footer-config.ts +11 -0
  136. package/src/lib/ui-kit/dashboard-footer/dashboard-footer.module.ts +22 -0
  137. package/src/lib/ui-kit/dialog/dialog-config.ts +6 -0
  138. package/src/lib/ui-kit/dialog/dialog-injector.ts +18 -0
  139. package/src/lib/ui-kit/dialog/dialog-ref.ts +12 -0
  140. package/src/lib/ui-kit/dialog/dialog.component.css +89 -0
  141. package/src/lib/ui-kit/dialog/dialog.component.html +27 -0
  142. package/src/lib/ui-kit/dialog/dialog.component.ts +112 -0
  143. package/src/lib/ui-kit/dialog/dialog.module.ts +11 -0
  144. package/src/lib/ui-kit/dialog/dialog.service.ts +57 -0
  145. package/src/lib/ui-kit/dialog/insertion.directive.ts +8 -0
  146. package/src/lib/ui-kit/floating-bar/floating-bar.component.html +42 -0
  147. package/src/lib/ui-kit/floating-bar/floating-bar.component.less +355 -0
  148. package/src/lib/ui-kit/floating-bar/floating-bar.component.spec.ts +25 -0
  149. package/src/lib/ui-kit/floating-bar/floating-bar.component.ts +40 -0
  150. package/src/lib/ui-kit/floating-bar/floating-bar.module.ts +22 -0
  151. package/src/lib/ui-kit/formgroup/click-outside.directive.ts +16 -0
  152. package/src/lib/ui-kit/formgroup/cs-checkbox/cs-checkbox.component.html +11 -0
  153. package/src/lib/ui-kit/formgroup/cs-checkbox/cs-checkbox.component.less +102 -0
  154. package/src/lib/ui-kit/formgroup/cs-checkbox/cs-checkbox.component.ts +19 -0
  155. package/src/lib/ui-kit/formgroup/cs-radio/cs-radio.component.html +11 -0
  156. package/src/lib/ui-kit/formgroup/cs-radio/cs-radio.component.less +125 -0
  157. package/src/lib/ui-kit/formgroup/cs-radio/cs-radio.component.ts +21 -0
  158. package/src/lib/ui-kit/formgroup/cs-radio-group/cs-radio-group.component.html +4 -0
  159. package/src/lib/ui-kit/formgroup/cs-radio-group/cs-radio-group.component.less +0 -0
  160. package/src/lib/ui-kit/formgroup/cs-radio-group/cs-radio-group.component.ts +12 -0
  161. package/src/lib/ui-kit/formgroup/cs-select/cs-select.component.html +78 -0
  162. package/src/lib/ui-kit/formgroup/cs-select/cs-select.component.less +259 -0
  163. package/src/lib/ui-kit/formgroup/cs-select/cs-select.component.ts +92 -0
  164. package/src/lib/ui-kit/formgroup/cs-switch/cs-switch.component.html +30 -0
  165. package/src/lib/ui-kit/formgroup/cs-switch/cs-switch.component.less +103 -0
  166. package/src/lib/ui-kit/formgroup/cs-switch/cs-switch.component.ts +23 -0
  167. package/src/lib/ui-kit/formgroup/formgroup.module.ts +35 -0
  168. package/src/lib/ui-kit/formgroup/pipes/pascal.pipe.ts +13 -0
  169. package/src/lib/ui-kit/formgroup/pipes/searchMultiSelect.pipe.ts +18 -0
  170. package/src/lib/ui-kit/line-loader/line-loader.component.html +3 -0
  171. package/src/lib/ui-kit/line-loader/line-loader.component.less +34 -0
  172. package/src/lib/ui-kit/line-loader/line-loader.component.ts +14 -0
  173. package/src/lib/ui-kit/line-loader/line-loader.module.ts +10 -0
  174. package/src/lib/ui-kit/loaders/loaders.module.ts +18 -0
  175. package/src/lib/ui-kit/loaders/table-loader/table-loader.component.html +17 -0
  176. package/src/lib/ui-kit/loaders/table-loader/table-loader.component.less +136 -0
  177. package/src/lib/ui-kit/loaders/table-loader/table-loader.component.ts +17 -0
  178. package/src/lib/ui-kit/longpress/longpress.directive.ts +28 -0
  179. package/src/lib/ui-kit/longpress/longpress.module.ts +10 -0
  180. package/src/lib/ui-kit/multi-select/cs-multiselect/cs-multiselect.component.html +51 -0
  181. package/src/lib/ui-kit/multi-select/cs-multiselect/cs-multiselect.component.less +367 -0
  182. package/src/lib/ui-kit/multi-select/cs-multiselect/cs-multiselect.component.spec.ts +24 -0
  183. package/src/lib/ui-kit/multi-select/cs-multiselect/cs-multiselect.component.ts +141 -0
  184. package/src/lib/ui-kit/multi-select/cs-multiselect-option/cs-multiselect-option.component.html +9 -0
  185. package/src/lib/ui-kit/multi-select/cs-multiselect-option/cs-multiselect-option.component.less +105 -0
  186. package/src/lib/ui-kit/multi-select/cs-multiselect-option/cs-multiselect-option.component.spec.ts +27 -0
  187. package/src/lib/ui-kit/multi-select/cs-multiselect-option/cs-multiselect-option.component.ts +24 -0
  188. package/src/lib/ui-kit/multi-select/multi-select.module.ts +24 -0
  189. package/src/lib/ui-kit/multi-select/multi-select.service.ts +10 -0
  190. package/src/lib/ui-kit/no-data/no-data.component.html +14 -0
  191. package/src/lib/ui-kit/no-data/no-data.component.less +86 -0
  192. package/src/lib/ui-kit/no-data/no-data.component.ts +26 -0
  193. package/src/lib/ui-kit/no-data/no-data.module.ts +10 -0
  194. package/src/lib/ui-kit/pagination/pagination.component.html +11 -0
  195. package/src/lib/ui-kit/pagination/pagination.component.less +72 -0
  196. package/src/lib/ui-kit/pagination/pagination.component.spec.ts +25 -0
  197. package/src/lib/ui-kit/pagination/pagination.component.ts +138 -0
  198. package/src/lib/ui-kit/pagination/pagination.module.ts +10 -0
  199. package/src/lib/ui-kit/pipes/pipes.module.ts +10 -0
  200. package/src/lib/ui-kit/pipes/safeHTML.pipe.ts +12 -0
  201. package/src/lib/ui-kit/pipes/trim.pipe.ts +10 -0
  202. package/src/lib/ui-kit/popover/popover.component.html +6 -0
  203. package/src/lib/ui-kit/popover/popover.component.less +20 -0
  204. package/src/lib/ui-kit/popover/popover.component.ts +127 -0
  205. package/src/lib/ui-kit/popover/popover.directive.ts +72 -0
  206. package/src/lib/ui-kit/popover/popover.module.ts +13 -0
  207. package/src/lib/ui-kit/popover/popover.service.ts +17 -0
  208. package/src/lib/ui-kit/ripple/ripple.directive.ts +36 -0
  209. package/src/lib/ui-kit/ripple/ripple.module.ts +10 -0
  210. package/src/lib/ui-kit/select/cs-option/cs-option.component.html +8 -0
  211. package/src/lib/ui-kit/select/cs-option/cs-option.component.less +49 -0
  212. package/src/lib/ui-kit/select/cs-option/cs-option.component.ts +31 -0
  213. package/src/lib/ui-kit/select/cs-select/cs-select.component.html +16 -0
  214. package/src/lib/ui-kit/select/cs-select/cs-select.component.less +142 -0
  215. package/src/lib/ui-kit/select/cs-select/cs-select.component.ts +98 -0
  216. package/src/lib/ui-kit/select/safe-html.pipe.ts +13 -0
  217. package/src/lib/ui-kit/select/select.module.ts +13 -0
  218. package/src/lib/ui-kit/services/cs-select.service.ts +10 -0
  219. package/src/lib/ui-kit/smiley-dialog/smiley-dialog.component.html +30 -0
  220. package/src/lib/ui-kit/smiley-dialog/smiley-dialog.component.less +442 -0
  221. package/src/lib/ui-kit/smiley-dialog/smiley-dialog.component.ts +40 -0
  222. package/src/lib/ui-kit/smiley-dialog/smiley-dialog.module.ts +11 -0
  223. package/src/lib/ui-kit/snack-bar/snack-bar/snack-bar.component.html +10 -0
  224. package/src/lib/ui-kit/snack-bar/snack-bar/snack-bar.component.less +110 -0
  225. package/src/lib/ui-kit/snack-bar/snack-bar/snack-bar.component.ts +42 -0
  226. package/src/lib/ui-kit/snack-bar/snack-bar.module.ts +10 -0
  227. package/src/lib/ui-kit/snack-bar/snack-bar.service.ts +18 -0
  228. package/src/lib/ui-kit/time-filter/time-filter.component.html +126 -0
  229. package/src/lib/ui-kit/time-filter/time-filter.component.less +482 -0
  230. package/src/lib/ui-kit/time-filter/time-filter.component.ts +284 -0
  231. package/src/lib/ui-kit/time-filter/time-filter.module.ts +10 -0
  232. package/src/lib/ui-kit/tooltip/tooltip.directive.ts +150 -0
  233. package/src/lib/ui-kit/tooltip/tooltip.module.ts +10 -0
  234. package/src/lib/ui-kit/v-loader/loader/loader.component.html +6 -0
  235. package/src/lib/ui-kit/v-loader/loader/loader.component.less +52 -0
  236. package/src/lib/ui-kit/v-loader/loader/loader.component.ts +22 -0
  237. package/src/lib/ui-kit/v-loader/loader-inline/loader-inline.component.html +6 -0
  238. package/src/lib/ui-kit/v-loader/loader-inline/loader-inline.component.less +52 -0
  239. package/src/lib/ui-kit/v-loader/loader-inline/loader-inline.component.ts +22 -0
  240. package/src/lib/ui-kit/v-loader/v-loader.module.ts +11 -0
  241. package/src/public-api.ts +11 -0
  242. package/src/test.ts +28 -0
  243. package/tsconfig.lib.json +20 -0
  244. package/tsconfig.lib.prod.json +10 -0
  245. package/tsconfig.spec.json +17 -0
  246. package/esm2022/lib/configurations.mjs +0 -7
  247. package/esm2022/lib/create-dashboard-container/categories/categories-config.mjs +0 -2
  248. package/esm2022/lib/create-dashboard-container/categories/categories.component.mjs +0 -212
  249. package/esm2022/lib/create-dashboard-container/configure-widgets/configure-widgets/configure-widgets.component.mjs +0 -350
  250. package/esm2022/lib/create-dashboard-container/configure-widgets/configure-widgets/widget.interface.mjs +0 -2
  251. package/esm2022/lib/create-dashboard-container/configure-widgets/configure-widgets.module.mjs +0 -47
  252. package/esm2022/lib/create-dashboard-container/constants/assets.constant.mjs +0 -37
  253. package/esm2022/lib/create-dashboard-container/create-dashboard-config.mjs +0 -2
  254. package/esm2022/lib/create-dashboard-container/create-dashboard.component.mjs +0 -1520
  255. package/esm2022/lib/create-dashboard-container/create-dashboard.module.mjs +0 -127
  256. package/esm2022/lib/create-dashboard-container/directives/directives.module.mjs +0 -24
  257. package/esm2022/lib/create-dashboard-container/directives/scroll-in-view.directive.mjs +0 -36
  258. package/esm2022/lib/create-dashboard-container/form-group/form-group.component.mjs +0 -153
  259. package/esm2022/lib/create-dashboard-container/frequency/frequency.component.mjs +0 -309
  260. package/esm2022/lib/create-dashboard-container/interfaces/widget-data-model.mjs +0 -2
  261. package/esm2022/lib/create-dashboard-container/pipes/filter.pipe.mjs +0 -30
  262. package/esm2022/lib/create-dashboard-container/pipes/search-program.pipe.mjs +0 -37
  263. package/esm2022/lib/create-dashboard-container/pipes/search.pipe.mjs +0 -25
  264. package/esm2022/lib/create-dashboard-container/pipes/text-count.pipe.mjs +0 -19
  265. package/esm2022/lib/create-dashboard-container/program-list/constant.mjs +0 -31
  266. package/esm2022/lib/create-dashboard-container/program-list/information-block/information-block.component.mjs +0 -13
  267. package/esm2022/lib/create-dashboard-container/program-list/interfaces/list-item.interface.mjs +0 -2
  268. package/esm2022/lib/create-dashboard-container/program-list/list-container/list-container.component.mjs +0 -50
  269. package/esm2022/lib/create-dashboard-container/program-list/pipes/check-selected-items.pipes.mjs +0 -23
  270. package/esm2022/lib/create-dashboard-container/program-list/program-list/program-list.component.mjs +0 -294
  271. package/esm2022/lib/create-dashboard-container/program-list/program-list.module.mjs +0 -60
  272. package/esm2022/lib/create-dashboard-container/program-list/services/list-utils.service.mjs +0 -27
  273. package/esm2022/lib/create-dashboard-container/program-list/services/program-list-api.service.mjs +0 -35
  274. package/esm2022/lib/create-dashboard-container/responsibility-center/responsibility-center.component.mjs +0 -149
  275. package/esm2022/lib/create-dashboard-container/risk-categories/risk-categories-config.mjs +0 -2
  276. package/esm2022/lib/create-dashboard-container/risk-categories/risk-categories.component.mjs +0 -206
  277. package/esm2022/lib/create-dashboard-container/services/auth.service.mjs +0 -31
  278. package/esm2022/lib/create-dashboard-container/services/configure-widgets.service.mjs +0 -238
  279. package/esm2022/lib/create-dashboard-container/services/create-dashboard.service.mjs +0 -243
  280. package/esm2022/lib/create-dashboard-container/services/pagination.service.mjs +0 -28
  281. package/esm2022/lib/create-dashboard-container/user-list/user-list.component.mjs +0 -440
  282. package/esm2022/lib/create-dashboard-container/user-list/user-list.config.mjs +0 -2
  283. package/esm2022/lib/create-dashboard-container/utils/dashboard-edit.utils.mjs +0 -181
  284. package/esm2022/lib/create-dashboard.service.mjs +0 -14
  285. package/esm2022/lib/ui-kit/dashboard-footer/dashboard-footer/dashboard-footer.component.mjs +0 -52
  286. package/esm2022/lib/ui-kit/dashboard-footer/dashboard-footer-config.mjs +0 -2
  287. package/esm2022/lib/ui-kit/dashboard-footer/dashboard-footer.module.mjs +0 -32
  288. package/esm2022/lib/ui-kit/dialog/dialog-config.mjs +0 -7
  289. package/esm2022/lib/ui-kit/dialog/dialog-injector.mjs +0 -17
  290. package/esm2022/lib/ui-kit/dialog/dialog-ref.mjs +0 -11
  291. package/esm2022/lib/ui-kit/dialog/dialog.component.mjs +0 -96
  292. package/esm2022/lib/ui-kit/dialog/dialog.module.mjs +0 -20
  293. package/esm2022/lib/ui-kit/dialog/dialog.service.mjs +0 -56
  294. package/esm2022/lib/ui-kit/dialog/insertion.directive.mjs +0 -17
  295. package/esm2022/lib/ui-kit/floating-bar/floating-bar.component.mjs +0 -57
  296. package/esm2022/lib/ui-kit/floating-bar/floating-bar.module.mjs +0 -32
  297. package/esm2022/lib/ui-kit/formgroup/click-outside.directive.mjs +0 -30
  298. package/esm2022/lib/ui-kit/formgroup/cs-checkbox/cs-checkbox.component.mjs +0 -29
  299. package/esm2022/lib/ui-kit/formgroup/cs-radio/cs-radio.component.mjs +0 -34
  300. package/esm2022/lib/ui-kit/formgroup/cs-radio-group/cs-radio-group.component.mjs +0 -14
  301. package/esm2022/lib/ui-kit/formgroup/cs-select/cs-select.component.mjs +0 -119
  302. package/esm2022/lib/ui-kit/formgroup/cs-switch/cs-switch.component.mjs +0 -39
  303. package/esm2022/lib/ui-kit/formgroup/formgroup.module.mjs +0 -55
  304. package/esm2022/lib/ui-kit/formgroup/pipes/pascal.pipe.mjs +0 -19
  305. package/esm2022/lib/ui-kit/formgroup/pipes/searchMultiSelect.pipe.mjs +0 -24
  306. package/esm2022/lib/ui-kit/loaders/loaders.module.mjs +0 -24
  307. package/esm2022/lib/ui-kit/loaders/table-loader/table-loader.component.mjs +0 -18
  308. package/esm2022/lib/ui-kit/no-data/no-data.component.mjs +0 -47
  309. package/esm2022/lib/ui-kit/no-data/no-data.module.mjs +0 -18
  310. package/esm2022/lib/ui-kit/pagination/pagination.component.mjs +0 -130
  311. package/esm2022/lib/ui-kit/pagination/pagination.module.mjs +0 -18
  312. package/esm2022/lib/ui-kit/popover/popover.component.mjs +0 -129
  313. package/esm2022/lib/ui-kit/popover/popover.directive.mjs +0 -93
  314. package/esm2022/lib/ui-kit/popover/popover.module.mjs +0 -21
  315. package/esm2022/lib/ui-kit/popover/popover.service.mjs +0 -23
  316. package/esm2022/lib/ui-kit/select/cs-option/cs-option.component.mjs +0 -41
  317. package/esm2022/lib/ui-kit/select/cs-select/cs-select.component.mjs +0 -107
  318. package/esm2022/lib/ui-kit/select/safe-html.pipe.mjs +0 -21
  319. package/esm2022/lib/ui-kit/select/select.module.mjs +0 -21
  320. package/esm2022/lib/ui-kit/services/cs-select.service.mjs +0 -16
  321. package/esm2022/lib/ui-kit/smiley-dialog/smiley-dialog.component.mjs +0 -52
  322. package/esm2022/lib/ui-kit/smiley-dialog/smiley-dialog.module.mjs +0 -18
  323. package/esm2022/lib/ui-kit/snack-bar/snack-bar/snack-bar.component.mjs +0 -46
  324. package/esm2022/lib/ui-kit/snack-bar/snack-bar.module.mjs +0 -18
  325. package/esm2022/lib/ui-kit/snack-bar/snack-bar.service.mjs +0 -23
  326. package/esm2022/lib/ui-kit/tooltip/tooltip.directive.mjs +0 -168
  327. package/esm2022/lib/ui-kit/tooltip/tooltip.module.mjs +0 -18
  328. package/esm2022/lib/ui-kit/v-loader/loader/loader.component.mjs +0 -24
  329. package/esm2022/lib/ui-kit/v-loader/loader-inline/loader-inline.component.mjs +0 -24
  330. package/esm2022/lib/ui-kit/v-loader/v-loader.module.mjs +0 -19
  331. package/esm2022/public-api.mjs +0 -10
  332. package/esm2022/vc-create-dashboard.mjs +0 -5
  333. package/fesm2022/vc-create-dashboard.mjs +0 -6511
  334. package/fesm2022/vc-create-dashboard.mjs.map +0 -1
  335. package/index.d.ts +0 -5
  336. package/lib/configurations.d.ts +0 -4
  337. package/lib/create-dashboard-container/categories/categories-config.d.ts +0 -18
  338. package/lib/create-dashboard-container/categories/categories.component.d.ts +0 -66
  339. package/lib/create-dashboard-container/configure-widgets/configure-widgets/configure-widgets.component.d.ts +0 -113
  340. package/lib/create-dashboard-container/configure-widgets/configure-widgets/widget.interface.d.ts +0 -9
  341. package/lib/create-dashboard-container/configure-widgets/configure-widgets.module.d.ts +0 -14
  342. package/lib/create-dashboard-container/constants/assets.constant.d.ts +0 -35
  343. package/lib/create-dashboard-container/create-dashboard-config.d.ts +0 -18
  344. package/lib/create-dashboard-container/create-dashboard.component.d.ts +0 -216
  345. package/lib/create-dashboard-container/create-dashboard.module.d.ts +0 -37
  346. package/lib/create-dashboard-container/directives/directives.module.d.ts +0 -8
  347. package/lib/create-dashboard-container/directives/scroll-in-view.directive.d.ts +0 -12
  348. package/lib/create-dashboard-container/form-group/form-group.component.d.ts +0 -48
  349. package/lib/create-dashboard-container/frequency/frequency.component.d.ts +0 -39
  350. package/lib/create-dashboard-container/pipes/filter.pipe.d.ts +0 -7
  351. package/lib/create-dashboard-container/pipes/search-program.pipe.d.ts +0 -7
  352. package/lib/create-dashboard-container/pipes/search.pipe.d.ts +0 -7
  353. package/lib/create-dashboard-container/pipes/text-count.pipe.d.ts +0 -7
  354. package/lib/create-dashboard-container/program-list/constant.d.ts +0 -24
  355. package/lib/create-dashboard-container/program-list/information-block/information-block.component.d.ts +0 -6
  356. package/lib/create-dashboard-container/program-list/interfaces/list-item.interface.d.ts +0 -5
  357. package/lib/create-dashboard-container/program-list/list-container/list-container.component.d.ts +0 -9
  358. package/lib/create-dashboard-container/program-list/pipes/check-selected-items.pipes.d.ts +0 -7
  359. package/lib/create-dashboard-container/program-list/program-list/program-list.component.d.ts +0 -119
  360. package/lib/create-dashboard-container/program-list/program-list.module.d.ts +0 -17
  361. package/lib/create-dashboard-container/program-list/services/list-utils.service.d.ts +0 -7
  362. package/lib/create-dashboard-container/program-list/services/program-list-api.service.d.ts +0 -14
  363. package/lib/create-dashboard-container/responsibility-center/responsibility-center.component.d.ts +0 -62
  364. package/lib/create-dashboard-container/risk-categories/risk-categories-config.d.ts +0 -18
  365. package/lib/create-dashboard-container/risk-categories/risk-categories.component.d.ts +0 -66
  366. package/lib/create-dashboard-container/services/auth.service.d.ts +0 -11
  367. package/lib/create-dashboard-container/services/configure-widgets.service.d.ts +0 -23
  368. package/lib/create-dashboard-container/services/create-dashboard.service.d.ts +0 -82
  369. package/lib/create-dashboard-container/services/pagination.service.d.ts +0 -12
  370. package/lib/create-dashboard-container/user-list/user-list.component.d.ts +0 -123
  371. package/lib/create-dashboard-container/utils/dashboard-edit.utils.d.ts +0 -16
  372. package/lib/create-dashboard.service.d.ts +0 -6
  373. package/lib/ui-kit/dashboard-footer/dashboard-footer/dashboard-footer.component.d.ts +0 -17
  374. package/lib/ui-kit/dashboard-footer/dashboard-footer-config.d.ts +0 -11
  375. package/lib/ui-kit/dashboard-footer/dashboard-footer.module.d.ts +0 -10
  376. package/lib/ui-kit/dialog/dialog-config.d.ts +0 -6
  377. package/lib/ui-kit/dialog/dialog-injector.d.ts +0 -7
  378. package/lib/ui-kit/dialog/dialog-ref.d.ts +0 -7
  379. package/lib/ui-kit/dialog/dialog.component.d.ts +0 -33
  380. package/lib/ui-kit/dialog/dialog.module.d.ts +0 -9
  381. package/lib/ui-kit/dialog/dialog.service.d.ts +0 -17
  382. package/lib/ui-kit/dialog/insertion.directive.d.ts +0 -8
  383. package/lib/ui-kit/floating-bar/floating-bar.component.d.ts +0 -20
  384. package/lib/ui-kit/floating-bar/floating-bar.module.d.ts +0 -10
  385. package/lib/ui-kit/formgroup/click-outside.directive.d.ts +0 -10
  386. package/lib/ui-kit/formgroup/cs-checkbox/cs-checkbox.component.d.ts +0 -13
  387. package/lib/ui-kit/formgroup/cs-radio/cs-radio.component.d.ts +0 -15
  388. package/lib/ui-kit/formgroup/cs-radio-group/cs-radio-group.component.d.ts +0 -8
  389. package/lib/ui-kit/formgroup/cs-select/cs-select.component.d.ts +0 -36
  390. package/lib/ui-kit/formgroup/cs-switch/cs-switch.component.d.ts +0 -15
  391. package/lib/ui-kit/formgroup/formgroup.module.d.ts +0 -17
  392. package/lib/ui-kit/formgroup/pipes/pascal.pipe.d.ts +0 -7
  393. package/lib/ui-kit/formgroup/pipes/searchMultiSelect.pipe.d.ts +0 -7
  394. package/lib/ui-kit/loaders/loaders.module.d.ts +0 -8
  395. package/lib/ui-kit/loaders/table-loader/table-loader.component.d.ts +0 -9
  396. package/lib/ui-kit/no-data/no-data.component.d.ts +0 -19
  397. package/lib/ui-kit/no-data/no-data.module.d.ts +0 -8
  398. package/lib/ui-kit/pagination/pagination.component.d.ts +0 -21
  399. package/lib/ui-kit/pagination/pagination.module.d.ts +0 -8
  400. package/lib/ui-kit/popover/popover.component.d.ts +0 -28
  401. package/lib/ui-kit/popover/popover.directive.d.ts +0 -17
  402. package/lib/ui-kit/popover/popover.module.d.ts +0 -9
  403. package/lib/ui-kit/popover/popover.service.d.ts +0 -13
  404. package/lib/ui-kit/select/cs-option/cs-option.component.d.ts +0 -16
  405. package/lib/ui-kit/select/cs-select/cs-select.component.d.ts +0 -32
  406. package/lib/ui-kit/select/safe-html.pipe.d.ts +0 -10
  407. package/lib/ui-kit/select/select.module.d.ts +0 -11
  408. package/lib/ui-kit/services/cs-select.service.d.ts +0 -7
  409. package/lib/ui-kit/smiley-dialog/smiley-dialog.component.d.ts +0 -17
  410. package/lib/ui-kit/smiley-dialog/smiley-dialog.module.d.ts +0 -8
  411. package/lib/ui-kit/snack-bar/snack-bar/snack-bar.component.d.ts +0 -17
  412. package/lib/ui-kit/snack-bar/snack-bar.module.d.ts +0 -8
  413. package/lib/ui-kit/snack-bar/snack-bar.service.d.ts +0 -9
  414. package/lib/ui-kit/tooltip/tooltip.directive.d.ts +0 -28
  415. package/lib/ui-kit/tooltip/tooltip.module.d.ts +0 -8
  416. package/lib/ui-kit/v-loader/loader/loader.component.d.ts +0 -11
  417. package/lib/ui-kit/v-loader/loader-inline/loader-inline.component.d.ts +0 -11
  418. package/lib/ui-kit/v-loader/v-loader.module.d.ts +0 -9
  419. package/public-api.d.ts +0 -3
@@ -0,0 +1,342 @@
1
+ import { Component, Input, Output, EventEmitter, TemplateRef, OnInit, OnChanges, SimpleChanges, OnDestroy } from '@angular/core';
2
+ import { ListItem } from '../interfaces/list-item.interface';
3
+ import { PROGRAM_TABLE_HEADERS, PAGINATION_OPTIONS, PROGRAM_TYPE_LIST, PROGRAM_NO_DATA } from '../constant';
4
+ import { ListUtilsService } from '../services/list-utils.service';
5
+ import { ProgramListApiService } from '../services/program-list-api.service';
6
+ import { Subject } from 'rxjs';
7
+ import { debounceTime, takeUntil } from 'rxjs/operators';
8
+ import { ASSETS } from '../../constants/assets.constant';
9
+ /**
10
+ * A reusable component for displaying and managing a list of programs with filtering, pagination, and category viewing capabilities.
11
+ *
12
+ * Features:
13
+ * - Program listing with pagination
14
+ * - Search functionality with debounce
15
+ * - Program type filtering
16
+ * - Category viewing for selected programs
17
+ * - Multi-select capability
18
+ *
19
+ * @template T Extends ListItem interface for type safety of list items
20
+ */
21
+
22
+ interface Category {
23
+ id: string;
24
+ name: string;
25
+ parent?: string;
26
+ parentTree?: string[];
27
+ [key: string]: any;
28
+ }
29
+ @Component({
30
+ selector: 'app-program-list',
31
+ templateUrl: './program-list.component.html',
32
+ styleUrls: ['./program-list.component.less']
33
+ })
34
+ export class ProgramListComponent<T extends ListItem> implements OnInit, OnChanges, OnDestroy {
35
+ /** Array of items to be displayed in the list */
36
+ @Input() items: T[] = [];
37
+
38
+ /** Object containing selected items, keyed by program ID */
39
+ @Input() selectedItems: any | null = {};
40
+
41
+ /** URL configuration object for API endpoints */
42
+ @Input() url: any = {};
43
+
44
+ /** Event emitted when an item is selected */
45
+ @Output() itemSelected = new EventEmitter<T>();
46
+
47
+ /** Event emitted when an item is deselected */
48
+ @Output() itemDeselected = new EventEmitter<T>();
49
+
50
+ /** Event emitted when the selection changes */
51
+ @Output() itemsSelectedChange = new EventEmitter<T[]>();
52
+
53
+ tableHeaders = PROGRAM_TABLE_HEADERS;
54
+ currentPage = PAGINATION_OPTIONS.DEFAULT_CURRENT_PAGE;
55
+ pageSize = PAGINATION_OPTIONS.PAGE_SIZE;
56
+ totalPages = 0;
57
+ searchTerm = '';
58
+ paginatedItems: T[] = [];
59
+ activeProgram: any | null = null;
60
+ categoryList: any = {};
61
+ programTypeList: any[] = PROGRAM_TYPE_LIST;
62
+ selectedProgramType: any[] = [];
63
+ loaderState: any = {
64
+ programList: false,
65
+ categoryList: false,
66
+ };
67
+ appliedProgramType: any[] = [];
68
+ PROGRAM_NO_DATA: any = PROGRAM_NO_DATA;
69
+ ASSETS: any = ASSETS;
70
+ programCategoryList: any = {};
71
+
72
+
73
+ /** Subject for handling debounced search */
74
+ private searchSubject = new Subject<string>();
75
+
76
+ /** Subject for cleanup subscriptions */
77
+ private destroy$ = new Subject<void>();
78
+
79
+ constructor(
80
+ private listUtils: ListUtilsService,
81
+ private programListApiService: ProgramListApiService
82
+ ) {
83
+ // Initialize debounced search
84
+ this.searchSubject.pipe(
85
+ debounceTime(300),
86
+ takeUntil(this.destroy$)
87
+ ).subscribe(() => {
88
+ this.performSearch();
89
+ });
90
+ }
91
+
92
+ /** Initialize component by fetching program list */
93
+ ngOnInit(): void {
94
+ this.getProgramList();
95
+ }
96
+
97
+ /** Handle changes to inputs */
98
+ ngOnChanges(changes: SimpleChanges): void {
99
+ if (changes['items'] || changes['selectedItems']) {
100
+ this.paginateItems(this.items);
101
+ this.focusFirstProgramWithSelections();
102
+ }
103
+ }
104
+
105
+ private focusFirstProgramWithSelections(): void {
106
+ if (!this.items?.length || !this.selectedItems) {
107
+ return;
108
+ }
109
+ const programId = Object.keys(this.selectedItems).find(
110
+ (key) => (this.selectedItems[key] ?? []).length > 0
111
+ );
112
+ if (!programId) {
113
+ return;
114
+ }
115
+ const program = this.items.find(
116
+ (item: any) => String(item?.id) === String(programId)
117
+ );
118
+ if (program && String(this.activeProgram?.id) !== String(program?.id)) {
119
+ this.viewCategory(program);
120
+ }
121
+ }
122
+
123
+ /** Fetch program list from API */
124
+ getProgramList(): void {
125
+ this.loaderState.programList = true;
126
+ this.programListApiService.getProgramList(this.url.programList).subscribe((res: any) => {
127
+ this.items = Array.isArray(res?.data?.programs) ? res.data.programs : [];
128
+ this.loadData(this.items);
129
+ this.loaderState.programList = false;
130
+ });
131
+ }
132
+
133
+ /**
134
+ * Load data and initialize pagination
135
+ * @param data Array of items to load
136
+ */
137
+ loadData(data: any): void {
138
+ this.goToPage(1, data);
139
+ }
140
+
141
+ /**
142
+ * Handle item selection/deselection
143
+ * @param event Selection event
144
+ * @param item Item being selected/deselected
145
+ */
146
+ selectItem(event: any, item: any): void {
147
+ const selectedObject = this.activeProgram.id.toString();
148
+ if (event) {
149
+ if(!this.selectedItems[selectedObject]) {
150
+ this.selectedItems[selectedObject] = [];
151
+ }
152
+ this.selectedItems[selectedObject].push(item);
153
+ } else {
154
+ this.selectedItems[selectedObject] = this.selectedItems[
155
+ this.activeProgram.id
156
+ ].filter(
157
+ (selected: any) => String(selected?.id) !== String(item?.id)
158
+ );
159
+ }
160
+ this.itemsSelectedChange.emit(this.selectedItems);
161
+ }
162
+
163
+ /**
164
+ * Deselect a specific item
165
+ * @param item Item to deselect
166
+ */
167
+ deselectItem(item: T): void {
168
+ this.itemsSelectedChange.emit(this.selectedItems);
169
+ this.itemDeselected.emit(item);
170
+ }
171
+
172
+ /**
173
+ * Check if an item is selected
174
+ * @param item Item to check
175
+ * @returns Boolean indicating if item is selected
176
+ */
177
+ isSelected(item: T): boolean {
178
+ return false;
179
+ }
180
+
181
+ /**
182
+ * Navigate to specific page
183
+ * @param page Page number to navigate to
184
+ * @param data Data to paginate
185
+ */
186
+ goToPage(page: number, data: any): void {
187
+ this.currentPage = page;
188
+ this.paginateItems(data);
189
+ }
190
+
191
+ /**
192
+ * Get array of page numbers for pagination
193
+ * @returns Array of page numbers
194
+ */
195
+ getPageNumbers(): number[] {
196
+ return this.listUtils.getPageNumbers(this.items?.length ?? 0, this.pageSize);
197
+ }
198
+
199
+ /**
200
+ * Paginate items and update view
201
+ * @param data Data to paginate
202
+ */
203
+ paginateItems(data: any): void {
204
+ const items = Array.isArray(data) ? data : [];
205
+ this.totalPages = Math.ceil(items.length / this.pageSize) || 0;
206
+ this.paginatedItems = items;
207
+ }
208
+
209
+ /**
210
+ * View categories for a selected program
211
+ * @param item Program to view categories for
212
+ */
213
+ viewCategory(item?: any): void {
214
+ this.activeProgram = item;
215
+ if(!item || this.categoryList[item.id]) return;
216
+ this.loaderState.categoryList = true;
217
+ this.checkProgramCategoryExists(item?.id);
218
+ }
219
+
220
+ checkProgramCategoryExists(id: string): void {
221
+ if(this.programCategoryList[id]) {
222
+ this.categoryList[id] = this.addParentTreeToCategories(this.programCategoryList[id]);
223
+ this.loaderState.categoryList = false;
224
+ return;
225
+ }
226
+ this.fetchProgramCategoryList(id);
227
+ }
228
+
229
+ fetchProgramCategoryList(id: string): void {
230
+ const URL = `${this.url.categoryList}&id=${id}`;
231
+ this.programListApiService.getProgramList(URL).subscribe((res: any) => {
232
+ this.programCategoryList[id] = res?.data?.categories ?? [];
233
+ this.categoryList[id] = this.addParentTreeToCategories(this.programCategoryList[id]);
234
+ this.loaderState.categoryList = false;
235
+ });
236
+ }
237
+
238
+
239
+ /**
240
+ * Add parent tree information to categories
241
+ * @param categories Array of categories
242
+ * @returns Categories with parent tree information
243
+ */
244
+ addParentTreeToCategories(categories: any[]): any[] {
245
+ if (!categories?.length) return [];
246
+
247
+ const categoryMap = new Map(categories.map(category => [category.id, category]));
248
+
249
+ const getParentTree = (category: Category): string[] => {
250
+ const parentTree: string[] = [];
251
+ let currentParent = category.parent;
252
+
253
+ while (currentParent) {
254
+ const parentCategory = categoryMap.get(currentParent);
255
+ if (!parentCategory) break;
256
+
257
+ parentTree.push(parentCategory.name);
258
+ currentParent = parentCategory.parent;
259
+ }
260
+
261
+ return parentTree;
262
+ };
263
+
264
+ return categories.map(category => ({
265
+ ...category,
266
+ parentTree: getParentTree(category)
267
+ }));
268
+
269
+ }
270
+
271
+ /**
272
+ * Handle program type filter selection
273
+ * @param event Selection event
274
+ * @param item Program type being selected/deselected
275
+ */
276
+ selectFilter(event: any, item: any): void {
277
+ if(event) {
278
+ this.selectedProgramType.push(item.id);
279
+ } else {
280
+ this.selectedProgramType = this.selectedProgramType.filter((selected: any) => selected !== item.id);
281
+ }
282
+ }
283
+
284
+ /** Reset all applied filters */
285
+ resetFilter(): void {
286
+ this.selectedProgramType = [];
287
+ this.onFilterChange();
288
+ }
289
+
290
+ /** Apply selected filters to the program list */
291
+ onFilterChange(): void {
292
+ const items = Array.isArray(this.items) ? this.items : [];
293
+ if (this.selectedProgramType.length > 0) {
294
+ const filteredItems = items.filter((item: any) =>
295
+ this.selectedProgramType.includes(item.type)
296
+ );
297
+ this.paginateItems(filteredItems);
298
+ } else {
299
+ this.paginateItems(items);
300
+ }
301
+
302
+ this.appliedProgramType = this.programTypeList.filter((item: any) => this.selectedProgramType.includes(item.id));
303
+ this.checkCategoryAvailbility();
304
+
305
+ }
306
+
307
+ checkCategoryAvailbility(): void {
308
+ const isSelectedProgramAvailable = this.paginatedItems.some((item: any) => item?.id === this.activeProgram?.id);
309
+ if(!isSelectedProgramAvailable) {
310
+ this.categoryList = [];
311
+ this.activeProgram = null;
312
+ }
313
+ }
314
+
315
+ /** Trigger debounced search */
316
+ search(): void {
317
+ this.searchSubject.next(this.searchTerm);
318
+ }
319
+
320
+ /** Perform search on items */
321
+ private performSearch(): void {
322
+ const items = Array.isArray(this.items) ? this.items : [];
323
+ const filteredItems = items.filter((item: any) =>
324
+ item?.name?.toLowerCase().includes(this.searchTerm?.toLowerCase())
325
+ );
326
+ this.currentPage = 1;
327
+ this.paginateItems(filteredItems);
328
+ this.checkCategoryAvailbility();
329
+ }
330
+
331
+ /** Cleanup subscriptions on component destruction */
332
+ ngOnDestroy(): void {
333
+ this.destroy$.next();
334
+ this.destroy$.complete();
335
+ }
336
+
337
+ closePopover(event: any): void {
338
+ if(event) {
339
+ this.selectedProgramType = this.appliedProgramType.map((item: any) => item?.id);
340
+ }
341
+ }
342
+ }
@@ -0,0 +1,36 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { FormsModule } from '@angular/forms';
4
+
5
+ import { ProgramListComponent } from './program-list/program-list.component';
6
+ import { NoDataModule } from '../../ui-kit/no-data/no-data.module';
7
+ import { PopoverModule } from '../../ui-kit/popover/popover.module';
8
+ import { CheckSelectedItemsPipe } from './pipes/check-selected-items.pipes';
9
+ import { FormgroupModule } from '../../ui-kit/formgroup/formgroup.module';
10
+ import { LoadersModule } from '../../ui-kit/loaders/loaders.module';
11
+ import { ListContainerComponent } from './list-container/list-container.component';
12
+ import { SearchProgramPipe } from '../pipes/search-program.pipe';
13
+ import { InformationBlockComponent } from './information-block/information-block.component';
14
+ @NgModule({
15
+ declarations: [
16
+ ProgramListComponent,
17
+ CheckSelectedItemsPipe,
18
+ ListContainerComponent,
19
+ SearchProgramPipe,
20
+ InformationBlockComponent
21
+ ],
22
+ imports: [
23
+ CommonModule,
24
+ FormsModule,
25
+ FormgroupModule,
26
+ NoDataModule,
27
+ PopoverModule,
28
+ LoadersModule,
29
+ ],
30
+ exports: [
31
+ ProgramListComponent,
32
+ ListContainerComponent,
33
+ InformationBlockComponent
34
+ ]
35
+ })
36
+ export class ProgramListModule { }
@@ -0,0 +1,22 @@
1
+ // list-utils.service.ts
2
+ import { Injectable } from '@angular/core';
3
+
4
+ @Injectable({
5
+ providedIn: 'root'
6
+ })
7
+ export class ListUtilsService {
8
+ paginate<T>(items: T[], currentPage: number, pageSize: number): T[] {
9
+ const startIndex = (currentPage - 1) * pageSize;
10
+ const endIndex = startIndex + pageSize;
11
+ return items.slice(startIndex, endIndex);
12
+ }
13
+
14
+ getPageNumbers(totalItems: number, pageSize: number): number[] {
15
+ const totalPages = Math.ceil(totalItems / pageSize);
16
+ const pages = [];
17
+ for (let i = 1; i <= totalPages; i++) {
18
+ pages.push(i);
19
+ }
20
+ return pages;
21
+ }
22
+ }
@@ -0,0 +1,24 @@
1
+ import { Injectable, Optional } from '@angular/core';
2
+ import { HttpClient } from '@angular/common/http';
3
+ import { Observable } from 'rxjs';
4
+ import { Configurations } from '../../../configurations';
5
+
6
+ @Injectable({
7
+ providedIn: 'root',
8
+ })
9
+ export class ProgramListApiService {
10
+ env!: any;
11
+
12
+ constructor(
13
+ private http: HttpClient,
14
+ @Optional() config?: Configurations
15
+ ) {
16
+ if (config) {
17
+ this.env = config.envConfig;
18
+ }
19
+ }
20
+
21
+ getProgramList(apiUrl: string): Observable<any> {
22
+ return this.http.get<any>(`${this.env.complianceGet}${apiUrl}`);
23
+ }
24
+ }
@@ -0,0 +1,70 @@
1
+ <div class="responsibility-center" [class.animate-slideInRight]="animation">
2
+ <div
3
+ class="responsibility-center-head vx-d-flex vx-align-center vx-justify-between vx-pl-4 vx-pr-4"
4
+ >
5
+ <div class="vx-fs-14 vx-fw-500 vx-label-txt">
6
+ Select Responsibility Center(s)
7
+ </div>
8
+ </div>
9
+ <div class="responsibility-center-body">
10
+ <div class="responsibility-center-search vx-mb-2">
11
+ <i class="icons">&#xe90b;</i>
12
+ <input
13
+ type="text"
14
+ [(ngModel)]="search"
15
+ placeholder="Search Responsibility Center"
16
+ />
17
+ </div>
18
+
19
+ <ng-container
20
+ *ngIf="responsibilityCentersList | filter : search as searchList"
21
+ >
22
+ <div class="select-all" *ngIf="searchList.length > 1">
23
+ <app-cs-checkbox
24
+ [ngValue]="checkSelectAll()"
25
+ (ngValueChange)="selectAll($event)"
26
+ >
27
+ <strong>{{
28
+ checkSelectAll() ? "Deselect All" : "Select All"
29
+ }}</strong>
30
+ </app-cs-checkbox>
31
+ </div>
32
+ <ul class="responsibility-center-list" *ngIf="searchList.length > 0">
33
+ <li *ngFor="let rc of searchList; let i = index">
34
+ <app-cs-checkbox
35
+ [ngValue]="selectedIds.includes(rc.item_id)"
36
+ (ngValueChange)="selectRc(rc.item_id, $event)"
37
+ >
38
+ <ul class="responsibility-center-list-name">
39
+ <li
40
+ *ngFor="let entity of rc.rc_name; let j = index"
41
+ [arTooltip]="entity"
42
+ placement="bottom-left"
43
+ delay="0"
44
+ >
45
+ <i class="icons" *ngIf="j !== 0">&#xe910;</i>
46
+ {{ entity }}
47
+ <!-- <span class="name">{{entity}}</span> -->
48
+ </li>
49
+ </ul>
50
+ </app-cs-checkbox>
51
+ </li>
52
+ </ul>
53
+ <app-no-data
54
+ *ngIf="searchList.length == 0"
55
+ [noDataImage]="ASSETS.search_data"
56
+ [noDataText]="'No data to display'"
57
+ >
58
+ </app-no-data>
59
+ </ng-container>
60
+
61
+ <div class="responsibility-center-footer">
62
+ <app-dashboard-footer
63
+ [footerDetails]="footerDetails"
64
+ (cancelEvent)="closeRcList.emit()"
65
+ (deleteEvent)="selectRc($event.item_id, false)"
66
+ (submitEvent)="save()"
67
+ ></app-dashboard-footer>
68
+ </div>
69
+ </div>
70
+ </div>
@@ -0,0 +1,181 @@
1
+ @import url("https://cdn.v-comply.com/design-system/css/icons/icons.css");
2
+ @import url("https://cdn.v-comply.com/design-system/css/display/display.css");
3
+ @import url("https://cdn.v-comply.com/design-system/css/alignment/alignment.css");
4
+ @import url("https://cdn.v-comply.com/design-system/css/text/text.css");
5
+ @import url("https://cdn.v-comply.com/design-system/css/color/color.css");
6
+ @import url("https://cdn.v-comply.com/design-system/css/width/width.css");
7
+ @import url("https://cdn.v-comply.com/design-system/css/margin/margin.css");
8
+ @import url("https://cdn.v-comply.com/design-system/css/margin/margin-top.css");
9
+ @import url("https://cdn.v-comply.com/design-system/css/margin/margin-bottom.css");
10
+ @import url("https://cdn.v-comply.com/design-system/css/margin/margin-left.css");
11
+ @import url("https://cdn.v-comply.com/design-system/css/margin/margin-right.css");
12
+ @import url("https://cdn.v-comply.com/design-system/css/padding/padding.css");
13
+ @import url("https://cdn.v-comply.com/design-system/css/padding/padding-top.css");
14
+ @import url("https://cdn.v-comply.com/design-system/css/padding/padding-bottom.css");
15
+ @import url("https://cdn.v-comply.com/design-system/css/padding/padding-left.css");
16
+ @import url("https://cdn.v-comply.com/design-system/css/padding/padding-right.css");
17
+
18
+ ::ng-deep .responsibility-center {
19
+ background: #FFFFFF;
20
+ border-right: 1px solid #F1F1F1;
21
+ position: fixed;
22
+ top: 0;
23
+ right: 500px;
24
+ bottom: 0;
25
+ left: 0;
26
+
27
+ &-head {
28
+ background: #fbfbfb;
29
+ height: 2.75rem;
30
+ border-bottom: 1px solid #f1f1f1;
31
+ }
32
+
33
+ &-body {
34
+ height: calc(100vh - 2.75rem);
35
+ padding: 2rem;
36
+ position: relative;
37
+
38
+ .select-all {
39
+ display : flex;
40
+ padding-bottom: 1rem;
41
+
42
+ app-cs-checkbox {
43
+ display: flex;
44
+
45
+ label {
46
+ span.value {
47
+ font-weight: 600 !important;
48
+ max-width: unset !important;
49
+ font-size: 12px !important;
50
+
51
+ strong {
52
+ color: #161b2f !important;
53
+ font-weight: 600 !important;
54
+ }
55
+ }
56
+ }
57
+ }
58
+ }
59
+
60
+ ul {
61
+ padding: 0;
62
+ margin : 0;
63
+
64
+ &.responsibility-center-list {
65
+ display : block;
66
+ height: calc(100vh - 256px);
67
+ margin-bottom: 16px;
68
+ overflow: hidden;
69
+ overflow-y: auto;
70
+
71
+ &::-webkit-scrollbar-track {
72
+ background: transparent;
73
+ }
74
+
75
+ li {
76
+ width : 100%;
77
+ padding : 0 0 1rem;
78
+ list-style: none;
79
+
80
+ app-cs-checkbox,
81
+ app-cs-radio {
82
+ display: flex;
83
+
84
+ label {
85
+ width: 100%;
86
+
87
+ span.value {
88
+ width : auto;
89
+ justify-content: flex-start;
90
+ line-height : 18px !important;
91
+ }
92
+ }
93
+
94
+ ul {
95
+ &.responsibility-center-list-name {
96
+ display : flex;
97
+ justify-content: flex-start;
98
+ width : auto;
99
+ max-width : 100%;
100
+
101
+ li {
102
+ list-style : none;
103
+ color : #747576;
104
+ font-size : 12px;
105
+ font-weight: 400;
106
+ width : auto;
107
+ padding : 0 8px 0 0;
108
+ max-width : 100%;
109
+ display: block;
110
+ text-overflow: ellipsis;
111
+ white-space: nowrap;
112
+ overflow: hidden;
113
+ // display : flex;
114
+
115
+ i {
116
+ font-size : 8px;
117
+ padding-right: 4px;
118
+ color : #747576;
119
+ position: relative;
120
+ }
121
+
122
+ span.name {
123
+ list-style : none;
124
+ color : #747576;
125
+ font-size : 12px;
126
+ font-weight : 400;
127
+ display : -webkit-box;
128
+ -webkit-line-clamp: 1;
129
+ -webkit-box-orient: vertical;
130
+ overflow : hidden;
131
+ width : auto;
132
+ min-width : calc(100% - 20px);
133
+ padding : 0;
134
+ }
135
+
136
+ &:first-child {
137
+ color: #1E5DD3;
138
+ max-width: 100%;
139
+ }
140
+
141
+ &:last-of-type {
142
+ color: #34AA44;
143
+ }
144
+ }
145
+ }
146
+ }
147
+ }
148
+ }
149
+ }
150
+ }
151
+ }
152
+
153
+ &-search {
154
+ position: relative;
155
+
156
+ input {
157
+ height : 2.75rem;
158
+ line-height : 1.5rem;
159
+ padding : .5rem 1rem .5rem 2.5rem;
160
+ outline : none;
161
+ border : 1px solid #7475763f;
162
+ border-radius: .25rem;
163
+ width : 100%;
164
+ font-size : 14px;
165
+ color : #747576;
166
+
167
+ &:focus {
168
+ border-color: #1e5dd3;
169
+ }
170
+ }
171
+
172
+ i {
173
+ position: absolute;
174
+ left: 1rem;
175
+ top: 1rem;
176
+ pointer-events: none;
177
+ color: #f1f1f1;
178
+ font-size: 12px;
179
+ }
180
+ }
181
+ }