tango-app-ui-shared 3.5.1-task.1 → 3.5.1-task.2

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 (396) hide show
  1. package/.eslintrc.json +37 -0
  2. package/ng-package.json +7 -0
  3. package/package.json +12 -25
  4. package/src/lib/guards/auth.guard.ts +20 -0
  5. package/src/lib/guards/lead.guard.ts +16 -0
  6. package/src/lib/guards/stores.guard.ts +16 -0
  7. package/src/lib/guards/tickets.guard.ts +16 -0
  8. package/{lib/i18n/index.d.ts → src/lib/i18n/index.ts} +2 -2
  9. package/src/lib/i18n/translation.module.ts +9 -0
  10. package/src/lib/i18n/translation.service.ts +61 -0
  11. package/src/lib/i18n/vocabs/ch.ts +105 -0
  12. package/src/lib/i18n/vocabs/de.ts +105 -0
  13. package/src/lib/i18n/vocabs/en.ts +105 -0
  14. package/src/lib/i18n/vocabs/es.ts +105 -0
  15. package/src/lib/i18n/vocabs/fr.ts +105 -0
  16. package/src/lib/i18n/vocabs/jp.ts +105 -0
  17. package/src/lib/interceptors/http-auth-interceptor.ts +225 -0
  18. package/src/lib/interfaces/global-state.ts +6 -0
  19. package/src/lib/modules/common/common-shared.module.ts +20 -0
  20. package/src/lib/modules/common/custom-select/custom-select.component.html +42 -0
  21. package/src/lib/modules/common/custom-select/custom-select.component.scss +131 -0
  22. package/src/lib/modules/common/custom-select/custom-select.component.spec.ts +23 -0
  23. package/src/lib/modules/common/custom-select/custom-select.component.ts +149 -0
  24. package/src/lib/modules/common/filters/filters.component.html +76 -0
  25. package/src/lib/modules/common/filters/filters.component.scss +131 -0
  26. package/src/lib/modules/common/filters/filters.component.spec.ts +23 -0
  27. package/src/lib/modules/common/filters/filters.component.ts +181 -0
  28. package/src/lib/modules/common/pagination/pagination.component.html +26 -0
  29. package/src/lib/modules/common/pagination/pagination.component.scss +63 -0
  30. package/src/lib/modules/common/pagination/pagination.component.spec.ts +23 -0
  31. package/src/lib/modules/common/pagination/pagination.component.ts +46 -0
  32. package/src/lib/modules/errors/error403/error403.component.html +25 -0
  33. package/src/lib/modules/errors/error403/error403.component.scss +0 -0
  34. package/src/lib/modules/errors/error403/error403.component.spec.ts +23 -0
  35. package/src/lib/modules/errors/error403/error403.component.ts +28 -0
  36. package/src/lib/modules/errors/error404/error404.component.html +24 -0
  37. package/src/lib/modules/errors/error404/error404.component.scss +0 -0
  38. package/src/lib/modules/errors/error404/error404.component.spec.ts +25 -0
  39. package/src/lib/modules/errors/error404/error404.component.ts +50 -0
  40. package/src/lib/modules/errors/error500/error500.component.html +24 -0
  41. package/src/lib/modules/errors/error500/error500.component.scss +0 -0
  42. package/src/lib/modules/errors/error500/error500.component.spec.ts +25 -0
  43. package/src/lib/modules/errors/error500/error500.component.ts +50 -0
  44. package/src/lib/modules/errors/errors-routing.module.ts +40 -0
  45. package/src/lib/modules/errors/errors.component.html +15 -0
  46. package/src/lib/modules/errors/errors.component.scss +4 -0
  47. package/src/lib/modules/errors/errors.component.spec.ts +25 -0
  48. package/src/lib/modules/errors/errors.component.ts +42 -0
  49. package/src/lib/modules/errors/errors.module.ts +25 -0
  50. package/src/lib/modules/errors/invalid-ip/invalid-ip.component.html +16 -0
  51. package/src/lib/modules/errors/invalid-ip/invalid-ip.component.scss +0 -0
  52. package/src/lib/modules/errors/invalid-ip/invalid-ip.component.spec.ts +23 -0
  53. package/src/lib/modules/errors/invalid-ip/invalid-ip.component.ts +43 -0
  54. package/src/lib/modules/intro/contact-support/contact-support.component.html +30 -0
  55. package/src/lib/modules/intro/contact-support/contact-support.component.scss +60 -0
  56. package/src/lib/modules/intro/contact-support/contact-support.component.spec.ts +23 -0
  57. package/src/lib/modules/intro/contact-support/contact-support.component.ts +17 -0
  58. package/src/lib/modules/intro/intro-routing.module.ts +16 -0
  59. package/src/lib/modules/intro/intro.module.ts +21 -0
  60. package/src/lib/modules/intro/lead-intro/lead-intro.component.html +325 -0
  61. package/src/lib/modules/intro/lead-intro/lead-intro.component.scss +185 -0
  62. package/src/lib/modules/intro/lead-intro/lead-intro.component.spec.ts +23 -0
  63. package/src/lib/modules/intro/lead-intro/lead-intro.component.ts +120 -0
  64. package/src/lib/modules/layout/components/csm-assign-confirmation/csm-assign-confirmation.component.html +44 -0
  65. package/src/lib/modules/layout/components/csm-assign-confirmation/csm-assign-confirmation.component.scss +28 -0
  66. package/src/lib/modules/layout/components/csm-assign-confirmation/csm-assign-confirmation.component.spec.ts +23 -0
  67. package/src/lib/modules/layout/components/csm-assign-confirmation/csm-assign-confirmation.component.ts +24 -0
  68. package/src/lib/modules/layout/content/content.component.html +12 -0
  69. package/src/lib/modules/layout/content/content.component.scss +0 -0
  70. package/src/lib/modules/layout/content/content.component.ts +102 -0
  71. package/src/lib/modules/layout/footer/footer.component.html +29 -0
  72. package/src/lib/modules/layout/footer/footer.component.scss +7 -0
  73. package/src/lib/modules/layout/footer/footer.component.spec.ts +25 -0
  74. package/src/lib/modules/layout/footer/footer.component.ts +13 -0
  75. package/src/lib/modules/layout/header/header-menu/header-menu.component.html +27 -0
  76. package/src/lib/modules/layout/header/header-menu/header-menu.component.scss +4 -0
  77. package/src/lib/modules/layout/header/header-menu/header-menu.component.spec.ts +25 -0
  78. package/src/lib/modules/layout/header/header-menu/header-menu.component.ts +38 -0
  79. package/src/lib/modules/layout/header/header.component.html +90 -0
  80. package/src/lib/modules/layout/header/header.component.scss +7 -0
  81. package/src/lib/modules/layout/header/header.component.spec.ts +25 -0
  82. package/src/lib/modules/layout/header/header.component.ts +139 -0
  83. package/src/lib/modules/layout/header/navbar/navbar.component.html +156 -0
  84. package/src/lib/modules/layout/header/navbar/navbar.component.scss +223 -0
  85. package/src/lib/modules/layout/header/navbar/navbar.component.spec.ts +23 -0
  86. package/src/lib/modules/layout/header/navbar/navbar.component.ts +255 -0
  87. package/src/lib/modules/layout/header/notifications-inner/notifications-inner.component.html +200 -0
  88. package/src/lib/modules/layout/header/notifications-inner/notifications-inner.component.scss +139 -0
  89. package/src/lib/modules/layout/header/notifications-inner/notifications-inner.component.ts +76 -0
  90. package/src/lib/modules/layout/header/page-title/page-title.component.html +32 -0
  91. package/src/lib/modules/layout/header/page-title/page-title.component.scss +11 -0
  92. package/src/lib/modules/layout/header/page-title/page-title.component.ts +47 -0
  93. package/src/lib/modules/layout/keenicon/icons.json +1 -0
  94. package/src/lib/modules/layout/keenicon/keenicon.component.html +4 -0
  95. package/src/lib/modules/layout/keenicon/keenicon.component.scss +0 -0
  96. package/src/lib/modules/layout/keenicon/keenicon.component.spec.ts +23 -0
  97. package/src/lib/modules/layout/keenicon/keenicon.component.ts +30 -0
  98. package/src/lib/modules/layout/layout/layout.component.html +71 -0
  99. package/src/lib/modules/layout/layout/layout.component.scss +23 -0
  100. package/src/lib/modules/layout/layout/layout.component.ts +425 -0
  101. package/src/lib/modules/layout/layout.module.ts +127 -0
  102. package/src/lib/modules/layout/scripts-init/scripts-init.component.html +0 -0
  103. package/src/lib/modules/layout/scripts-init/scripts-init.component.ts +81 -0
  104. package/src/lib/modules/layout/scroll-top/scroll-top.component.html +1 -0
  105. package/src/lib/modules/layout/scroll-top/scroll-top.component.ts +75 -0
  106. package/src/lib/modules/layout/sidebar/sidebar-footer/sidebar-footer.component.html +70 -0
  107. package/src/lib/modules/layout/sidebar/sidebar-footer/sidebar-footer.component.scss +57 -0
  108. package/src/lib/modules/layout/sidebar/sidebar-footer/sidebar-footer.component.spec.ts +23 -0
  109. package/src/lib/modules/layout/sidebar/sidebar-footer/sidebar-footer.component.ts +101 -0
  110. package/src/lib/modules/layout/sidebar/sidebar-logo/sidebar-logo.component.html +26 -0
  111. package/src/lib/modules/layout/sidebar/sidebar-logo/sidebar-logo.component.scss +0 -0
  112. package/src/lib/modules/layout/sidebar/sidebar-logo/sidebar-logo.component.spec.ts +23 -0
  113. package/src/lib/modules/layout/sidebar/sidebar-logo/sidebar-logo.component.ts +36 -0
  114. package/src/lib/modules/layout/sidebar/sidebar-menu/sidebar-menu.component.html +705 -0
  115. package/src/lib/modules/layout/sidebar/sidebar-menu/sidebar-menu.component.scss +38 -0
  116. package/src/lib/modules/layout/sidebar/sidebar-menu/sidebar-menu.component.spec.ts +23 -0
  117. package/src/lib/modules/layout/sidebar/sidebar-menu/sidebar-menu.component.ts +118 -0
  118. package/src/lib/modules/layout/sidebar/sidebar.component.html +16 -0
  119. package/src/lib/modules/layout/sidebar/sidebar.component.scss +3 -0
  120. package/src/lib/modules/layout/sidebar/sidebar.component.spec.ts +23 -0
  121. package/src/lib/modules/layout/sidebar/sidebar.component.ts +203 -0
  122. package/src/lib/modules/layout/toolbar/accounting/accounting.component.html +84 -0
  123. package/src/lib/modules/layout/toolbar/accounting/accounting.component.scss +0 -0
  124. package/src/lib/modules/layout/toolbar/accounting/accounting.component.spec.ts +23 -0
  125. package/src/lib/modules/layout/toolbar/accounting/accounting.component.ts +14 -0
  126. package/src/lib/modules/layout/toolbar/classic/classic.component.html +69 -0
  127. package/src/lib/modules/layout/toolbar/classic/classic.component.scss +238 -0
  128. package/src/lib/modules/layout/toolbar/classic/classic.component.spec.ts +23 -0
  129. package/src/lib/modules/layout/toolbar/classic/classic.component.ts +389 -0
  130. package/src/lib/modules/layout/toolbar/client-settings/client-settings.component.html +4 -0
  131. package/src/lib/modules/layout/toolbar/client-settings/client-settings.component.scss +3 -0
  132. package/src/lib/modules/layout/toolbar/client-settings/client-settings.component.spec.ts +23 -0
  133. package/src/lib/modules/layout/toolbar/client-settings/client-settings.component.ts +91 -0
  134. package/src/lib/modules/layout/toolbar/date-single-select/date-single-select.component.html +22 -0
  135. package/src/lib/modules/layout/toolbar/date-single-select/date-single-select.component.scss +156 -0
  136. package/src/lib/modules/layout/toolbar/date-single-select/date-single-select.component.spec.ts +23 -0
  137. package/src/lib/modules/layout/toolbar/date-single-select/date-single-select.component.ts +229 -0
  138. package/src/lib/modules/layout/toolbar/datepicker/datepicker.component.html +14 -0
  139. package/src/lib/modules/layout/toolbar/datepicker/datepicker.component.scss +149 -0
  140. package/src/lib/modules/layout/toolbar/datepicker/datepicker.component.spec.ts +23 -0
  141. package/src/lib/modules/layout/toolbar/datepicker/datepicker.component.ts +174 -0
  142. package/src/lib/modules/layout/toolbar/extended/extended.component.html +100 -0
  143. package/src/lib/modules/layout/toolbar/extended/extended.component.scss +0 -0
  144. package/src/lib/modules/layout/toolbar/extended/extended.component.spec.ts +23 -0
  145. package/src/lib/modules/layout/toolbar/extended/extended.component.ts +12 -0
  146. package/src/lib/modules/layout/toolbar/metrics-header/metrics-header.component.html +311 -0
  147. package/src/lib/modules/layout/toolbar/metrics-header/metrics-header.component.scss +311 -0
  148. package/src/lib/modules/layout/toolbar/metrics-header/metrics-header.component.spec.ts +23 -0
  149. package/src/lib/modules/layout/toolbar/metrics-header/metrics-header.component.ts +1555 -0
  150. package/src/lib/modules/layout/toolbar/reports/reports.component.html +62 -0
  151. package/src/lib/modules/layout/toolbar/reports/reports.component.scss +0 -0
  152. package/src/lib/modules/layout/toolbar/reports/reports.component.spec.ts +23 -0
  153. package/src/lib/modules/layout/toolbar/reports/reports.component.ts +14 -0
  154. package/src/lib/modules/layout/toolbar/saas/saas.component.html +77 -0
  155. package/src/lib/modules/layout/toolbar/saas/saas.component.scss +0 -0
  156. package/src/lib/modules/layout/toolbar/saas/saas.component.spec.ts +23 -0
  157. package/src/lib/modules/layout/toolbar/saas/saas.component.ts +14 -0
  158. package/src/lib/modules/layout/toolbar/single-clientstore-date/single-clientstore-date.component.html +1 -0
  159. package/src/lib/modules/layout/toolbar/single-clientstore-date/single-clientstore-date.component.scss +0 -0
  160. package/src/lib/modules/layout/toolbar/single-clientstore-date/single-clientstore-date.component.spec.ts +23 -0
  161. package/src/lib/modules/layout/toolbar/single-clientstore-date/single-clientstore-date.component.ts +10 -0
  162. package/src/lib/modules/layout/toolbar/single-store/single-store.component.html +39 -0
  163. package/src/lib/modules/layout/toolbar/single-store/single-store.component.scss +172 -0
  164. package/src/lib/modules/layout/toolbar/single-store/single-store.component.spec.ts +23 -0
  165. package/src/lib/modules/layout/toolbar/single-store/single-store.component.ts +186 -0
  166. package/src/lib/modules/layout/toolbar/single-storedate/single-storedate.component.html +17 -0
  167. package/src/lib/modules/layout/toolbar/single-storedate/single-storedate.component.scss +172 -0
  168. package/src/lib/modules/layout/toolbar/single-storedate/single-storedate.component.spec.ts +23 -0
  169. package/src/lib/modules/layout/toolbar/single-storedate/single-storedate.component.ts +179 -0
  170. package/src/lib/modules/layout/toolbar/storesingle/storesingle.component.html +4 -0
  171. package/src/lib/modules/layout/toolbar/storesingle/storesingle.component.scss +19 -0
  172. package/src/lib/modules/layout/toolbar/storesingle/storesingle.component.spec.ts +23 -0
  173. package/src/lib/modules/layout/toolbar/storesingle/storesingle.component.ts +105 -0
  174. package/src/lib/modules/layout/toolbar/toolbar.component.html +56 -0
  175. package/src/lib/modules/layout/toolbar/toolbar.component.scss +0 -0
  176. package/src/lib/modules/layout/toolbar/toolbar.component.spec.ts +25 -0
  177. package/src/lib/modules/layout/toolbar/toolbar.component.ts +352 -0
  178. package/src/lib/modules/layout/toolbar/traffic-header/traffic-header/traffic-header.component.html +259 -0
  179. package/src/lib/modules/layout/toolbar/traffic-header/traffic-header/traffic-header.component.scss +311 -0
  180. package/src/lib/modules/layout/toolbar/traffic-header/traffic-header/traffic-header.component.spec.ts +23 -0
  181. package/src/lib/modules/layout/toolbar/traffic-header/traffic-header/traffic-header.component.ts +1200 -0
  182. package/src/lib/modules/layout/toolbar/traffic-nob/traffic-nob.component.html +199 -0
  183. package/src/lib/modules/layout/toolbar/traffic-nob/traffic-nob.component.scss +311 -0
  184. package/src/lib/modules/layout/toolbar/traffic-nob/traffic-nob.component.spec.ts +23 -0
  185. package/src/lib/modules/layout/toolbar/traffic-nob/traffic-nob.component.ts +899 -0
  186. package/src/lib/modules/layout/toolbar/trax-header/trax-header.component.html +204 -0
  187. package/src/lib/modules/layout/toolbar/trax-header/trax-header.component.scss +311 -0
  188. package/src/lib/modules/layout/toolbar/trax-header/trax-header.component.spec.ts +23 -0
  189. package/src/lib/modules/layout/toolbar/trax-header/trax-header.component.ts +1045 -0
  190. package/src/lib/modules/layout/toolbar/trax-withoutdate/trax-withoutdate.component.html +190 -0
  191. package/src/lib/modules/layout/toolbar/trax-withoutdate/trax-withoutdate.component.scss +311 -0
  192. package/src/lib/modules/layout/toolbar/trax-withoutdate/trax-withoutdate.component.spec.ts +23 -0
  193. package/src/lib/modules/layout/toolbar/trax-withoutdate/trax-withoutdate.component.ts +825 -0
  194. package/src/lib/modules/notification/conformation/conformation.component.html +25 -0
  195. package/src/lib/modules/notification/conformation/conformation.component.scss +0 -0
  196. package/src/lib/modules/notification/conformation/conformation.component.spec.ts +23 -0
  197. package/src/lib/modules/notification/conformation/conformation.component.ts +23 -0
  198. package/src/lib/modules/notification/notification/notification.component.html +209 -0
  199. package/src/lib/modules/notification/notification/notification.component.scss +211 -0
  200. package/src/lib/modules/notification/notification/notification.component.spec.ts +23 -0
  201. package/src/lib/modules/notification/notification/notification.component.ts +310 -0
  202. package/src/lib/modules/notification/notification-routing.module.ts +20 -0
  203. package/src/lib/modules/notification/notification.module.ts +21 -0
  204. package/src/lib/pipes/customDate.pipe.ts +18 -0
  205. package/src/lib/routes/route-wraper-modules/analyse-wrapper.module.ts +12 -0
  206. package/src/lib/routes/route-wraper-modules/edge-wrapper.module.ts +11 -0
  207. package/src/lib/routes/route-wraper-modules/manage-wrapper.module.ts +11 -0
  208. package/src/lib/routes/route-wraper-modules/profile-wrapper.module.ts +12 -0
  209. package/src/lib/routes/route-wraper-modules/store-wrapper.module.ts +11 -0
  210. package/src/lib/routes/route-wraper-modules/ticket-wrapper.module.ts +10 -0
  211. package/src/lib/routes/routing.ts +56 -0
  212. package/src/lib/services/auth.service.ts +173 -0
  213. package/src/lib/services/notification.service.spec.ts +16 -0
  214. package/src/lib/services/notification.service.ts +73 -0
  215. package/src/lib/services/toast.service.ts +82 -0
  216. package/{public-api.d.ts → src/public-api.ts} +71 -44
  217. package/tsconfig.lib.json +14 -0
  218. package/tsconfig.lib.prod.json +10 -0
  219. package/tsconfig.spec.json +14 -0
  220. package/esm2022/lib/guards/auth.guard.mjs +0 -26
  221. package/esm2022/lib/guards/lead.guard.mjs +0 -16
  222. package/esm2022/lib/guards/stores.guard.mjs +0 -16
  223. package/esm2022/lib/guards/tickets.guard.mjs +0 -16
  224. package/esm2022/lib/i18n/index.mjs +0 -3
  225. package/esm2022/lib/i18n/translation.module.mjs +0 -17
  226. package/esm2022/lib/i18n/translation.service.mjs +0 -53
  227. package/esm2022/lib/i18n/vocabs/ch.mjs +0 -106
  228. package/esm2022/lib/i18n/vocabs/de.mjs +0 -106
  229. package/esm2022/lib/i18n/vocabs/en.mjs +0 -106
  230. package/esm2022/lib/i18n/vocabs/es.mjs +0 -106
  231. package/esm2022/lib/i18n/vocabs/fr.mjs +0 -106
  232. package/esm2022/lib/i18n/vocabs/jp.mjs +0 -106
  233. package/esm2022/lib/interceptors/http-auth-interceptor.mjs +0 -124
  234. package/esm2022/lib/interfaces/global-state.mjs +0 -2
  235. package/esm2022/lib/modules/common/common-shared.module.mjs +0 -31
  236. package/esm2022/lib/modules/common/custom-select/custom-select.component.mjs +0 -155
  237. package/esm2022/lib/modules/common/filters/filters.component.mjs +0 -179
  238. package/esm2022/lib/modules/common/pagination/pagination.component.mjs +0 -49
  239. package/esm2022/lib/modules/errors/error403/error403.component.mjs +0 -33
  240. package/esm2022/lib/modules/errors/error404/error404.component.mjs +0 -44
  241. package/esm2022/lib/modules/errors/error500/error500.component.mjs +0 -45
  242. package/esm2022/lib/modules/errors/errors-routing.module.mjs +0 -48
  243. package/esm2022/lib/modules/errors/errors.component.mjs +0 -39
  244. package/esm2022/lib/modules/errors/errors.module.mjs +0 -37
  245. package/esm2022/lib/modules/errors/invalid-ip/invalid-ip.component.mjs +0 -44
  246. package/esm2022/lib/modules/intro/contact-support/contact-support.component.mjs +0 -19
  247. package/esm2022/lib/modules/intro/intro-routing.module.mjs +0 -24
  248. package/esm2022/lib/modules/intro/intro.module.mjs +0 -32
  249. package/esm2022/lib/modules/intro/lead-intro/lead-intro.component.mjs +0 -110
  250. package/esm2022/lib/modules/layout/components/csm-assign-confirmation/csm-assign-confirmation.component.mjs +0 -31
  251. package/esm2022/lib/modules/layout/content/content.component.mjs +0 -107
  252. package/esm2022/lib/modules/layout/footer/footer.component.mjs +0 -17
  253. package/esm2022/lib/modules/layout/header/header-menu/header-menu.component.mjs +0 -41
  254. package/esm2022/lib/modules/layout/header/header.component.mjs +0 -100
  255. package/esm2022/lib/modules/layout/header/navbar/navbar.component.mjs +0 -256
  256. package/esm2022/lib/modules/layout/header/notifications-inner/notifications-inner.component.mjs +0 -79
  257. package/esm2022/lib/modules/layout/header/page-title/page-title.component.mjs +0 -56
  258. package/esm2022/lib/modules/layout/keenicon/icons.json +0 -1
  259. package/esm2022/lib/modules/layout/keenicon/keenicon.component.mjs +0 -37
  260. package/esm2022/lib/modules/layout/layout/layout.component.mjs +0 -314
  261. package/esm2022/lib/modules/layout/layout.module.mjs +0 -195
  262. package/esm2022/lib/modules/layout/scripts-init/scripts-init.component.mjs +0 -74
  263. package/esm2022/lib/modules/layout/scroll-top/scroll-top.component.mjs +0 -74
  264. package/esm2022/lib/modules/layout/sidebar/sidebar-footer/sidebar-footer.component.mjs +0 -118
  265. package/esm2022/lib/modules/layout/sidebar/sidebar-logo/sidebar-logo.component.mjs +0 -45
  266. package/esm2022/lib/modules/layout/sidebar/sidebar-menu/sidebar-menu.component.mjs +0 -111
  267. package/esm2022/lib/modules/layout/sidebar/sidebar.component.mjs +0 -134
  268. package/esm2022/lib/modules/layout/toolbar/accounting/accounting.component.mjs +0 -16
  269. package/esm2022/lib/modules/layout/toolbar/classic/classic.component.mjs +0 -331
  270. package/esm2022/lib/modules/layout/toolbar/client-settings/client-settings.component.mjs +0 -88
  271. package/esm2022/lib/modules/layout/toolbar/date-single-select/date-single-select.component.mjs +0 -201
  272. package/esm2022/lib/modules/layout/toolbar/datepicker/datepicker.component.mjs +0 -150
  273. package/esm2022/lib/modules/layout/toolbar/extended/extended.component.mjs +0 -15
  274. package/esm2022/lib/modules/layout/toolbar/metrics-header/metrics-header.component.mjs +0 -1321
  275. package/esm2022/lib/modules/layout/toolbar/reports/reports.component.mjs +0 -18
  276. package/esm2022/lib/modules/layout/toolbar/saas/saas.component.mjs +0 -18
  277. package/esm2022/lib/modules/layout/toolbar/single-clientstore-date/single-clientstore-date.component.mjs +0 -11
  278. package/esm2022/lib/modules/layout/toolbar/single-store/single-store.component.mjs +0 -176
  279. package/esm2022/lib/modules/layout/toolbar/single-storedate/single-storedate.component.mjs +0 -166
  280. package/esm2022/lib/modules/layout/toolbar/storesingle/storesingle.component.mjs +0 -105
  281. package/esm2022/lib/modules/layout/toolbar/toolbar.component.mjs +0 -314
  282. package/esm2022/lib/modules/layout/toolbar/traffic-header/traffic-header/traffic-header.component.mjs +0 -1060
  283. package/esm2022/lib/modules/layout/toolbar/traffic-nob/traffic-nob.component.mjs +0 -795
  284. package/esm2022/lib/modules/layout/toolbar/trax-header/trax-header.component.mjs +0 -880
  285. package/esm2022/lib/modules/layout/toolbar/trax-withoutdate/trax-withoutdate.component.mjs +0 -729
  286. package/esm2022/lib/modules/notification/conformation/conformation.component.mjs +0 -22
  287. package/esm2022/lib/modules/notification/notification/notification.component.mjs +0 -317
  288. package/esm2022/lib/modules/notification/notification-routing.module.mjs +0 -28
  289. package/esm2022/lib/modules/notification/notification.module.mjs +0 -32
  290. package/esm2022/lib/pipes/customDate.pipe.mjs +0 -22
  291. package/esm2022/lib/routes/route-wraper-modules/edge-wrapper.module.mjs +0 -18
  292. package/esm2022/lib/routes/route-wraper-modules/manage-wrapper.module.mjs +0 -18
  293. package/esm2022/lib/routes/route-wraper-modules/profile-wrapper.module.mjs +0 -18
  294. package/esm2022/lib/routes/route-wraper-modules/store-wrapper.module.mjs +0 -18
  295. package/esm2022/lib/routes/route-wraper-modules/ticket-wrapper.module.mjs +0 -18
  296. package/esm2022/lib/routes/routing.mjs +0 -53
  297. package/esm2022/lib/services/auth.service.mjs +0 -136
  298. package/esm2022/lib/services/notification.service.mjs +0 -74
  299. package/esm2022/lib/services/toast.service.mjs +0 -83
  300. package/esm2022/public-api.mjs +0 -56
  301. package/esm2022/tango-app-ui-shared.mjs +0 -5
  302. package/fesm2022/tango-app-ui-shared-edge-wrapper.module-CFDk0tvS.mjs +0 -21
  303. package/fesm2022/tango-app-ui-shared-edge-wrapper.module-CFDk0tvS.mjs.map +0 -1
  304. package/fesm2022/tango-app-ui-shared-intro.module-DYh4ZRha.mjs +0 -188
  305. package/fesm2022/tango-app-ui-shared-intro.module-DYh4ZRha.mjs.map +0 -1
  306. package/fesm2022/tango-app-ui-shared-manage-wrapper.module-BHyh4Njw.mjs +0 -21
  307. package/fesm2022/tango-app-ui-shared-manage-wrapper.module-BHyh4Njw.mjs.map +0 -1
  308. package/fesm2022/tango-app-ui-shared-notification.module-C5ZmCf8U.mjs +0 -400
  309. package/fesm2022/tango-app-ui-shared-notification.module-C5ZmCf8U.mjs.map +0 -1
  310. package/fesm2022/tango-app-ui-shared-profile-wrapper.module-BNC1AGOk.mjs +0 -21
  311. package/fesm2022/tango-app-ui-shared-profile-wrapper.module-BNC1AGOk.mjs.map +0 -1
  312. package/fesm2022/tango-app-ui-shared-store-wrapper.module-DdaCYHdv.mjs +0 -21
  313. package/fesm2022/tango-app-ui-shared-store-wrapper.module-DdaCYHdv.mjs.map +0 -1
  314. package/fesm2022/tango-app-ui-shared-ticket-wrapper.module-r32uKkDO.mjs +0 -21
  315. package/fesm2022/tango-app-ui-shared-ticket-wrapper.module-r32uKkDO.mjs.map +0 -1
  316. package/fesm2022/tango-app-ui-shared.mjs +0 -11026
  317. package/fesm2022/tango-app-ui-shared.mjs.map +0 -1
  318. package/index.d.ts +0 -5
  319. package/lib/guards/auth.guard.d.ts +0 -10
  320. package/lib/guards/lead.guard.d.ts +0 -2
  321. package/lib/guards/stores.guard.d.ts +0 -2
  322. package/lib/guards/tickets.guard.d.ts +0 -2
  323. package/lib/i18n/translation.module.d.ts +0 -8
  324. package/lib/i18n/translation.service.d.ts +0 -19
  325. package/lib/i18n/vocabs/ch.d.ts +0 -104
  326. package/lib/i18n/vocabs/de.d.ts +0 -104
  327. package/lib/i18n/vocabs/en.d.ts +0 -104
  328. package/lib/i18n/vocabs/es.d.ts +0 -104
  329. package/lib/i18n/vocabs/fr.d.ts +0 -104
  330. package/lib/i18n/vocabs/jp.d.ts +0 -104
  331. package/lib/interceptors/http-auth-interceptor.d.ts +0 -19
  332. package/lib/interfaces/global-state.d.ts +0 -5
  333. package/lib/modules/common/common-shared.module.d.ts +0 -13
  334. package/lib/modules/common/custom-select/custom-select.component.d.ts +0 -33
  335. package/lib/modules/common/filters/filters.component.d.ts +0 -38
  336. package/lib/modules/common/pagination/pagination.component.d.ts +0 -18
  337. package/lib/modules/errors/error403/error403.component.d.ts +0 -14
  338. package/lib/modules/errors/error404/error404.component.d.ts +0 -15
  339. package/lib/modules/errors/error500/error500.component.d.ts +0 -15
  340. package/lib/modules/errors/errors-routing.module.d.ts +0 -7
  341. package/lib/modules/errors/errors.component.d.ts +0 -13
  342. package/lib/modules/errors/errors.module.d.ts +0 -13
  343. package/lib/modules/errors/invalid-ip/invalid-ip.component.d.ts +0 -17
  344. package/lib/modules/intro/contact-support/contact-support.component.d.ts +0 -9
  345. package/lib/modules/intro/intro-routing.module.d.ts +0 -7
  346. package/lib/modules/intro/intro.module.d.ts +0 -11
  347. package/lib/modules/intro/lead-intro/lead-intro.component.d.ts +0 -31
  348. package/lib/modules/layout/components/csm-assign-confirmation/csm-assign-confirmation.component.d.ts +0 -13
  349. package/lib/modules/layout/content/content.component.d.ts +0 -25
  350. package/lib/modules/layout/footer/footer.component.d.ts +0 -8
  351. package/lib/modules/layout/header/header-menu/header-menu.component.d.ts +0 -18
  352. package/lib/modules/layout/header/header.component.d.ts +0 -30
  353. package/lib/modules/layout/header/navbar/navbar.component.d.ts +0 -45
  354. package/lib/modules/layout/header/notifications-inner/notifications-inner.component.d.ts +0 -25
  355. package/lib/modules/layout/header/page-title/page-title.component.d.ts +0 -23
  356. package/lib/modules/layout/keenicon/keenicon.component.d.ts +0 -13
  357. package/lib/modules/layout/layout/layout.component.d.ts +0 -82
  358. package/lib/modules/layout/layout.module.d.ts +0 -49
  359. package/lib/modules/layout/scripts-init/scripts-init.component.d.ts +0 -19
  360. package/lib/modules/layout/scroll-top/scroll-top.component.d.ts +0 -19
  361. package/lib/modules/layout/sidebar/sidebar-footer/sidebar-footer.component.d.ts +0 -39
  362. package/lib/modules/layout/sidebar/sidebar-logo/sidebar-logo.component.d.ts +0 -19
  363. package/lib/modules/layout/sidebar/sidebar-menu/sidebar-menu.component.d.ts +0 -23
  364. package/lib/modules/layout/sidebar/sidebar.component.d.ts +0 -36
  365. package/lib/modules/layout/toolbar/accounting/accounting.component.d.ts +0 -8
  366. package/lib/modules/layout/toolbar/classic/classic.component.d.ts +0 -48
  367. package/lib/modules/layout/toolbar/client-settings/client-settings.component.d.ts +0 -16
  368. package/lib/modules/layout/toolbar/date-single-select/date-single-select.component.d.ts +0 -28
  369. package/lib/modules/layout/toolbar/datepicker/datepicker.component.d.ts +0 -28
  370. package/lib/modules/layout/toolbar/extended/extended.component.d.ts +0 -8
  371. package/lib/modules/layout/toolbar/metrics-header/metrics-header.component.d.ts +0 -103
  372. package/lib/modules/layout/toolbar/reports/reports.component.d.ts +0 -9
  373. package/lib/modules/layout/toolbar/saas/saas.component.d.ts +0 -9
  374. package/lib/modules/layout/toolbar/single-clientstore-date/single-clientstore-date.component.d.ts +0 -5
  375. package/lib/modules/layout/toolbar/single-store/single-store.component.d.ts +0 -33
  376. package/lib/modules/layout/toolbar/single-storedate/single-storedate.component.d.ts +0 -34
  377. package/lib/modules/layout/toolbar/storesingle/storesingle.component.d.ts +0 -24
  378. package/lib/modules/layout/toolbar/toolbar.component.d.ts +0 -55
  379. package/lib/modules/layout/toolbar/traffic-header/traffic-header/traffic-header.component.d.ts +0 -93
  380. package/lib/modules/layout/toolbar/traffic-nob/traffic-nob.component.d.ts +0 -80
  381. package/lib/modules/layout/toolbar/trax-header/trax-header.component.d.ts +0 -83
  382. package/lib/modules/layout/toolbar/trax-withoutdate/trax-withoutdate.component.d.ts +0 -74
  383. package/lib/modules/notification/conformation/conformation.component.d.ts +0 -10
  384. package/lib/modules/notification/notification/notification.component.d.ts +0 -63
  385. package/lib/modules/notification/notification-routing.module.d.ts +0 -7
  386. package/lib/modules/notification/notification.module.d.ts +0 -11
  387. package/lib/pipes/customDate.pipe.d.ts +0 -7
  388. package/lib/routes/route-wraper-modules/edge-wrapper.module.d.ts +0 -7
  389. package/lib/routes/route-wraper-modules/manage-wrapper.module.d.ts +0 -7
  390. package/lib/routes/route-wraper-modules/profile-wrapper.module.d.ts +0 -7
  391. package/lib/routes/route-wraper-modules/store-wrapper.module.d.ts +0 -7
  392. package/lib/routes/route-wraper-modules/ticket-wrapper.module.d.ts +0 -7
  393. package/lib/routes/routing.d.ts +0 -3
  394. package/lib/services/auth.service.d.ts +0 -47
  395. package/lib/services/notification.service.d.ts +0 -30
  396. package/lib/services/toast.service.d.ts +0 -10
@@ -0,0 +1,825 @@
1
+ import {
2
+ ChangeDetectorRef,
3
+ Component,
4
+ HostListener,
5
+ OnInit,
6
+ } from "@angular/core";
7
+ import dayjs from "dayjs";
8
+ import "dayjs/locale/en";
9
+ import { GlobalStateService } from "tango-app-ui-global";
10
+ import { Router } from "@angular/router";
11
+ import { AuthService } from "../../../../services/auth.service";
12
+
13
+ @Component({
14
+ selector: 'lib-trax-withoutdate',
15
+ templateUrl: './trax-withoutdate.component.html',
16
+ styleUrl: './trax-withoutdate.component.scss'
17
+ })
18
+ export class TraxWithoutdateComponent implements OnInit {
19
+ dayjs = dayjs;
20
+ isCustomDate = (m: dayjs.Dayjs) => {
21
+ const isValidDate = m > this.dayjs();
22
+ return isValidDate ? "invalid-date" : false;
23
+ };
24
+
25
+ selectedDateRange: any = { startDate: dayjs().subtract(30, 'days'),
26
+ endDate: dayjs().subtract(1, "days"),};
27
+ selectedFilters: any = {
28
+ client: null,
29
+ clientName: null,
30
+ clients: [],
31
+ store: null,
32
+ stores: [],
33
+ date: null,
34
+ group: [],
35
+ location: [],
36
+ };
37
+ Opendropdown: boolean = false;
38
+ dropdownOpen: string | null = null; // 'location' or 'group'
39
+ searchLocationText: string = "";
40
+ searchGroupText: string = "";
41
+ locations: any[] = [];
42
+ filteredLocations: any[] = [];
43
+ groupsData: any[] = [];
44
+ filteredGroups: any[] = [];
45
+ filteredStores: any[] = [];
46
+ stores:any[] = []
47
+ searchStoreText:string = '';
48
+ clientList:any = []
49
+ selectedClient:any
50
+ locationLabel: any[]=[];
51
+ groupLabel: any[]=[];
52
+ users: any;
53
+ url: any;
54
+ constructor(
55
+ private auth: AuthService,private router: Router,
56
+ public gs: GlobalStateService,
57
+ private cd: ChangeDetectorRef,
58
+ ) {}
59
+
60
+ @HostListener('document:click', ['$event'])
61
+ onClick (event: MouseEvent) {
62
+ const target = event.target as HTMLElement;
63
+ if(!target.closest('.dropdown1')) {
64
+ this.Opendropdown = false;
65
+ }
66
+ }
67
+ closeDropdown1(){
68
+ this.Opendropdown = false;
69
+ }
70
+ ngOnInit(): void {
71
+ this.url = this.router.url.split("?")[0].split('/');
72
+ const user = JSON.parse(localStorage.getItem('user-info') as string);
73
+ this.users = user;
74
+ this.gs?.manageRefreshTrigger?.subscribe((e) => {
75
+ if (e) {
76
+ if (user.userType === 'tango') {
77
+ this.getClient();
78
+ } else{
79
+ const storedFilters = localStorage.getItem("header-filters");
80
+ if (storedFilters) {
81
+ const headerFilters = JSON.parse(storedFilters);
82
+ this.filteredStores = headerFilters?.stores.map((store:any) => ({
83
+ ...store,
84
+ checked: store.checked
85
+ }));
86
+ }
87
+ }
88
+ }
89
+ });
90
+
91
+ if (user.userType === 'tango') {
92
+ this.getClient();
93
+ } else {
94
+ this.getLocations();
95
+ this.getGroups();
96
+ this.getStore();
97
+ }
98
+
99
+ const storedFilters = localStorage.getItem("header-filters");
100
+ if (storedFilters) {
101
+ const headerFilters = JSON.parse(storedFilters);
102
+
103
+ // Initialize selectedFilters with defaults or existing values
104
+ this.selectedFilters = {
105
+ client: headerFilters.client || this.users.client,
106
+ clientName: headerFilters.clientName || '',
107
+ clients: headerFilters.clients || [],
108
+ store: headerFilters.store || null,
109
+ date: headerFilters.date || {},
110
+ stores: headerFilters.stores || [],
111
+ group: headerFilters.group || [],
112
+ location: headerFilters.location || []
113
+ };
114
+
115
+ // Sync filtered data with stored selections
116
+ this.filteredLocations = this.syncWithLocalStorage(headerFilters.location);
117
+ this.filteredGroups = this.syncWithLocalStorage(headerFilters.group);
118
+ this.filteredStores = this.syncWithLocalStorage(headerFilters.stores);
119
+ // Format date range if it exists
120
+ // Emit data via service and update localStorage
121
+ this.emitAndStoreFilters();
122
+ } else {
123
+ // Initialize empty states if no header filters are present in localStorage
124
+ this.resetFilters();
125
+ }
126
+ }
127
+ private syncWithLocalStorage(items: any[]): any[] {
128
+ return items
129
+ ? items.map((item: any) => ({
130
+ ...item,
131
+ checked: item.checked === true
132
+ }))
133
+ : [];
134
+ }
135
+ private emitAndStoreFilters(): void {
136
+ this.gs.dataRangeValue.next(this.selectedFilters);
137
+ localStorage.setItem("header-filters", JSON.stringify(this.selectedFilters));
138
+ }
139
+
140
+ private resetFilters(): void {
141
+ this.selectedFilters = {
142
+ client: null,
143
+ clientName: '',
144
+ clients: [],
145
+ store: null,
146
+ date: {},
147
+ stores: [],
148
+ group: [],
149
+ location: []
150
+ };
151
+ this.filteredLocations = [];
152
+ this.filteredGroups = [];
153
+ this.filteredStores = [];
154
+ }
155
+ getClient(){
156
+ this.auth.getClients().subscribe({
157
+ next: (e) => {
158
+ if (e) {
159
+ this.clientList = e.data.result;
160
+ const headerFilters: any = JSON.parse(
161
+ localStorage.getItem("header-filters") || "{}"
162
+ );
163
+ if (headerFilters.client) {
164
+ this.clientList.find((obj: any) => {
165
+ if (obj.clientId === headerFilters.client) {
166
+ this.selectedClient = obj;
167
+ }
168
+ });
169
+
170
+ this.selectedFilters.client = headerFilters.client;
171
+ this.selectedFilters.clientName = headerFilters.clientName;
172
+ this.selectedFilters.clients = headerFilters.clients;
173
+ this.selectedFilters.store = headerFilters.store;
174
+ this.selectedFilters.date = headerFilters.date;
175
+ this.selectedFilters.stores = headerFilters.stores;
176
+ this.selectedFilters.group = headerFilters.group;
177
+ this.selectedFilters.location = headerFilters.location;
178
+ this.gs.dataRangeValue.next(this.selectedFilters);
179
+ // Ensure locations and groups are loaded before fetching stores
180
+ this.getLocations();
181
+ this.getGroups();
182
+ // Fetch stores only after locations and groups are set
183
+ this.getStore();
184
+ } else {
185
+ this.selectedClient = this.clientList[0];
186
+ this.selectedFilters.client = this.selectedClient.clientId;
187
+ this.selectedFilters.clientName = this.selectedClient.clientName
188
+ this.selectedFilters.clients = headerFilters.clients;
189
+ this.selectedFilters.store = headerFilters.store;
190
+ this.selectedFilters.date = headerFilters.date;
191
+ this.selectedFilters.stores = headerFilters.stores;
192
+ this.selectedFilters.group = headerFilters.group;
193
+ this.selectedFilters.location = headerFilters.location;
194
+ localStorage.setItem(
195
+ "header-filters",
196
+ JSON.stringify(this.selectedFilters)
197
+ );
198
+ this.gs.dataRangeValue.next(this.selectedFilters);
199
+ this.cd.detectChanges();
200
+ // Ensure locations and groups are loaded before fetching stores
201
+ this.getLocations();
202
+ this.getGroups();
203
+ // Fetch stores only after locations and groups are set
204
+ this.getStore();
205
+ }
206
+
207
+
208
+ } else {
209
+ this.selectedClient = this.clientList[0];
210
+ this.selectedFilters.client = this.selectedClient.clientId;
211
+ this.selectedFilters.clientName = this.selectedClient.clientName
212
+ // Ensure locations and groups are loaded before fetching stores
213
+ this.getLocations();
214
+ this.getGroups();
215
+ // Fetch stores only after locations and groups are set
216
+ this.getStore();
217
+ localStorage.setItem(
218
+ "header-filters",
219
+ JSON.stringify(this.selectedFilters)
220
+ );
221
+ this.gs.dataRangeValue.next(this.selectedFilters);
222
+ // console.log("4")
223
+ this.cd.detectChanges();
224
+ }
225
+ },
226
+ });
227
+ }
228
+ onClientSelect(event: any): void {
229
+ // Update the selected client
230
+ this.selectedClient = event;
231
+ // Clear previous filtered data and selections
232
+ this.filteredGroups = [];
233
+ this.filteredStores = [];
234
+ this.filteredLocations = [];
235
+ this.selectedFilters.stores = [];
236
+ this.selectedFilters.group = [];
237
+ this.selectedFilters.location = [];
238
+
239
+ // Fetch header filters from localStorage
240
+ const headerFilters: any = JSON.parse(localStorage.getItem("header-filters") || "{}");
241
+
242
+ // Update the selected filters with the new client
243
+ this.selectedFilters.client = this.selectedClient.clientId;
244
+ this.selectedFilters.clientName = this.selectedClient.clientName;
245
+
246
+ // Remove old store, group, and location data from the header filters
247
+ delete headerFilters.stores;
248
+ delete headerFilters.groups;
249
+ delete headerFilters.location;
250
+
251
+ // Fetch new data based on the new client
252
+ this.getLocations();
253
+ this.getStore();
254
+ this.getGroups();
255
+
256
+ // Update localStorage with the new client selection and empty filter data
257
+ localStorage.setItem('header-filters', JSON.stringify(this.selectedFilters));
258
+ window.location.reload()
259
+ this.cd.detectChanges();
260
+ }
261
+
262
+
263
+
264
+
265
+
266
+
267
+
268
+ opendropdown(e:MouseEvent) {
269
+ e.stopPropagation();
270
+ this.Opendropdown = !this.Opendropdown;
271
+ }
272
+ getLocations(): void {
273
+ // const headerFilters: any = JSON.parse(localStorage.getItem("header-filters") || "{}");
274
+ let obj ={
275
+ clientId: this.selectedFilters.client ? this.selectedFilters.client :this.users.clientId,
276
+ city: [],
277
+ group: [],
278
+ }
279
+ this.auth.getLocation(obj).subscribe({
280
+ next: (res: any) => {
281
+ let cityList = this.selectedFilters?.location?.filter((location:any) => location.checked).map((loc:any) => loc.city);
282
+ // Map the fetched locations with default unchecked state
283
+ this.locations = res?.data?.locationData.map((city: any) => ({
284
+ city: city.city,
285
+ checked: cityList?.includes(city.city) ? true : false,
286
+ }));
287
+
288
+ // Sync the fetched locations with any stored checked values in localStorage
289
+ if (this.selectedFilters.location && Array.isArray(this.selectedFilters.location)) {
290
+ this.filteredLocations = this.locations.map(location => {
291
+ const matchedLocation = this.selectedFilters.location.find((loc: any) => loc.city === location.city);
292
+ return matchedLocation ? { ...location, checked: matchedLocation.checked } : location;
293
+ });
294
+ } else {
295
+ this.filteredLocations = this.locations;
296
+ }
297
+
298
+ if(this.searchLocationText) {
299
+ this.filteredLocations = this.locations.filter((location:any) => location.city.toLowerCase().includes(this.searchLocationText.toLowerCase()))
300
+ }
301
+ const selectedLocations = this.locations.filter((location) => location.checked).map((location) => location.city);
302
+ if (selectedLocations.length > 0) {
303
+ setTimeout(()=>{
304
+ this.getStore(); // Fetch stores based on selected groups
305
+ },1000)
306
+ }
307
+ },
308
+ error: (err) => {
309
+ console.error("Failed to fetch locations", err);
310
+ },
311
+ });
312
+ }
313
+
314
+ isAllLocationsSelected(): boolean {
315
+ return this.filteredLocations.every(location => location.checked);
316
+
317
+ }
318
+
319
+ selectedLocationsLabel(): string {
320
+ const selectedLocations = this.locationLabel = this.searchLocationText.length ? this.locations
321
+ .filter(location => location.checked).map(location => location.city) : this.filteredLocations
322
+ .filter(location => location.checked).map(location => location.city);
323
+ return selectedLocations.length === 0
324
+ ? ''
325
+ : selectedLocations.length === 1
326
+ ? selectedLocations[0]
327
+ : `${selectedLocations.length} locations`;
328
+ }
329
+
330
+ removeLocation(): void {
331
+ this.Reset();
332
+ }
333
+
334
+ getGroups(): void {
335
+ const city = this.locations
336
+ .filter(location => location.checked)
337
+ .map(location => location.city);
338
+ const obj = { city,clientId:this.selectedFilters.client ? this.selectedFilters.client :this.users.clientId,group:[] };
339
+ this.auth.getGroups(obj).subscribe({
340
+ next: (res: any) => {
341
+ let checkedGroup = this.selectedFilters?.group?.filter((group:any) => group.checked).map((group:any) => group.groupName);
342
+ const combinedGroups = res?.data?.groupData?.map((groupName: any) => ({
343
+ groupName: groupName.groupName,
344
+ checked: checkedGroup?.includes(groupName.groupName) ? true : false,
345
+ }));
346
+ this.groupsData = combinedGroups;
347
+ if(this.searchGroupText.length) {
348
+ this.filteredGroups = combinedGroups.filter((item:any) => item.groupName.toLowerCase().includes(this.searchGroupText));
349
+ }
350
+ else {
351
+ this.filteredGroups = combinedGroups;
352
+ }
353
+
354
+ // Auto-fetch stores when groups are selected
355
+ const selectedGroups = this.groupsData.filter((group) => group.checked).map((group) => group.groupName);
356
+ if (selectedGroups.length > 0) {
357
+ setTimeout(()=>{
358
+ this.getStore(); // Fetch stores based on selected groups
359
+ },1000)
360
+ }
361
+ },
362
+ error: (err) => {
363
+ console.error("Failed to fetch groups", err);
364
+ },
365
+ });
366
+ }
367
+
368
+ toggleDropdown(type: 'location' | 'group' | 'store'): void {
369
+ if (this.dropdownOpen === type) {
370
+ // If the dropdown is open, close it and avoid resetting the selected values unnecessarily
371
+ this.dropdownOpen = null;
372
+ } else {
373
+ // Open the specific dropdown and handle data fetching only if necessary
374
+ this.dropdownOpen = type;
375
+
376
+ if (type === 'group') {
377
+ // Fetch groups only if there are selected cities and no active search text
378
+ const selectedCities = this.locations
379
+ .filter((location) => location.checked)
380
+ .map((location) => location.city);
381
+
382
+ // Fetch groups only if locations are selected, no search text exists, and dropdown is opened
383
+ if (this.filteredLocations.length > 0 || (selectedCities.length > 0 && !this.searchGroupText.trim())) {
384
+ this.getGroups();
385
+ } else {
386
+ this.filteredGroups = []; // Clear groups if no locations are selected
387
+ }
388
+ }
389
+
390
+ if (type === 'store') {
391
+ // Fetch stores only if not already fetched and no search text is active
392
+ if ((!this.filteredStores || this.filteredStores.length === 0) && !this.searchStoreText.trim()) {
393
+ this.getStore();
394
+ }
395
+ }
396
+ }
397
+ }
398
+
399
+
400
+ handleGroupDropdownClick(): void {
401
+ if (this.dropdownOpen === 'group') {
402
+ this.resetSelectedGroups();
403
+ }
404
+ this.toggleDropdown('group');
405
+ }
406
+
407
+ resetSelectedGroups(): void {
408
+ this.filteredGroups.forEach((group) => (group.checked = false));
409
+ this.searchGroupText = "";
410
+ }
411
+ selectedGroupsLabel(): string {
412
+ const selectedGroups = this.groupLabel = this.searchGroupText.length ? this.groupsData.filter((group) => group.checked) : this.filteredGroups.filter((group) => group.checked);
413
+ return selectedGroups.length === 0
414
+ ? ""
415
+ : selectedGroups.length === 1
416
+ ? selectedGroups[0].groupName
417
+ : `${selectedGroups.length} Clusters`;
418
+ }
419
+ removeGroup(): void {
420
+ this.Reset();
421
+
422
+ }
423
+
424
+
425
+ isAllGroupsSelected(): boolean {
426
+
427
+ return this.filteredGroups.length ? this.filteredGroups.every((group) => group.checked) : false;
428
+ }
429
+
430
+ getStore(): void {
431
+ const city = this.locations
432
+ .filter(location => location.checked)
433
+ .map(location => location.city);
434
+
435
+ const group = this.groupsData
436
+ .filter(group => group.checked)
437
+ .map(group => group.groupName);
438
+
439
+ const data = { city, clusters:group, clientId: this.users.clientId ? this.users.clientId : this.selectedFilters.client };
440
+
441
+ this.auth.getHeadertraxStores(data).subscribe({
442
+ next: (res: any) => {
443
+ if(res &&res.code ===200){
444
+ this.stores = res.data.storesData;
445
+ // Retrieve checked store IDs from selectedFilters
446
+ const checkedStoreIds = this.selectedFilters?.stores
447
+ ? this.selectedFilters.stores.filter((store: any) => store.checked).map((store: any) => store.storeId)
448
+ : [];
449
+
450
+ this.stores.forEach(store => {
451
+ if (checkedStoreIds.includes(store.storeId)) {
452
+ store.checked = true; // Sync the checked state with full store list
453
+ }
454
+ });
455
+
456
+
457
+ // Map the stores and retain the 'checked' status
458
+ if(this.searchStoreText.length) {
459
+ this.filteredStores = this.stores?.filter(store => store.storeName.toLowerCase().includes(this.searchStoreText));
460
+ }
461
+ else {
462
+ this.filteredStores = this.stores;
463
+ }
464
+ // Ensure selectedFilters is in sync with filteredStores
465
+ if (!this.selectedFilters.stores || !this.selectedFilters.stores.length) {
466
+ this.stores.forEach(store => {
467
+ store.checked = true; // Sync the checked state with full store list
468
+ });
469
+
470
+ // No previously selected stores, mark all as checked
471
+ this.filteredStores = this.selectedFilters.stores = this.filteredStores.map(store => ({
472
+ ...store,
473
+ checked: true
474
+ }));
475
+ } else {
476
+ // Update selectedFilters to reflect current state of stores
477
+ this.selectedFilters.stores = this.filteredStores.map(store => ({
478
+ ...store,
479
+ checked: store.checked
480
+ }));
481
+ }
482
+ // Update localStorage with the latest selectedFilters
483
+ localStorage.setItem('header-filters', JSON.stringify(this.selectedFilters));
484
+
485
+ // Emit data via service
486
+ // this.gs.dataRangeValue.next(this.selectedFilters);
487
+ // Trigger change detection to reflect changes in the UI
488
+ this.cd.detectChanges();
489
+ } else {
490
+ this.stores =[];
491
+ this.selectedFilters.stores=[];
492
+ this.filteredStores =[];
493
+ this.selectedFilters.stores = this.filteredStores.map(store => ({
494
+ ...store,
495
+ checked: false
496
+ }));
497
+ localStorage.setItem('header-filters', JSON.stringify(this.selectedFilters));
498
+ }
499
+ },
500
+ error: (err) => {
501
+ this.stores =[];
502
+ this.selectedFilters.stores=[];
503
+ this.filteredStores =[];
504
+ this.selectedFilters.stores = this.filteredStores.map(store => ({
505
+ ...store,
506
+ checked: false
507
+ }));
508
+ localStorage.setItem('header-filters', JSON.stringify(this.selectedFilters));
509
+ console.error("Failed to fetch stores", err);
510
+ },
511
+ });
512
+ }
513
+
514
+
515
+ resetSelectedStores(): void {
516
+ this.filteredStores.forEach((store) => (store.checked = false));
517
+ this.searchStoreText = "";
518
+ }
519
+
520
+ selectedStoresLabel(): string {
521
+ const selectedStores = this.searchStoreText.length ? this.stores.filter((store) => store.checked) : this.filteredStores.filter((store) => store.checked);
522
+ return selectedStores.length === 0
523
+ ? "0 Stores"
524
+ : selectedStores.length === 1
525
+ ? selectedStores[0].storeName
526
+ : `${selectedStores.length} Stores`;
527
+ }
528
+
529
+ isAllStoresSelected(): boolean {
530
+ return this.filteredStores.length > 0 && this.filteredStores.every(store => store.checked);
531
+ }
532
+ // Method to handle dropdown item selection
533
+ updateSelectedStores(): void {
534
+ this.filteredStores.forEach(store => {
535
+ const filteredStore = this.stores.findIndex(fStore => fStore.storeId === store.storeId);
536
+ if (filteredStore != -1) {
537
+ this.stores[filteredStore].checked = store.checked; // Sync the checked state with full store list
538
+ }
539
+ });
540
+ // Update selectedFilters based on the current store selection
541
+ this.selectedFilters.stores = this.stores.filter(store => store.checked);
542
+
543
+ // Update localStorage with the latest selection
544
+ localStorage.setItem('header-filters', JSON.stringify(this.selectedFilters));
545
+
546
+ // Emit updated filters via service
547
+ // this.gs.dataRangeValue.next(this.selectedFilters);
548
+
549
+ // Trigger change detection if necessary
550
+ this.cd.detectChanges();
551
+ }
552
+ toggleSelectAllLocations(event: any): void {
553
+ const isChecked = event.target.checked;
554
+ this.filteredLocations.forEach((location) => (location.checked = isChecked));
555
+ this.updateSelectedLocations();
556
+ }
557
+
558
+ toggleSelectAllStores(event: Event): void {
559
+ const checked = (event.target as HTMLInputElement).checked;
560
+
561
+ // Apply the selection to both filtered and full list of stores
562
+ this.filteredStores.forEach(store => store.checked = checked);
563
+ this.stores.forEach(store => {
564
+ const filteredStore = this.filteredStores.find(fStore => fStore.storeId === store.storeId);
565
+ if (filteredStore) {
566
+ store.checked = checked; // Sync the checked state with full store list
567
+ }
568
+ });
569
+
570
+ // Update the selected stores and persist the selection
571
+ this.updateSelectedStores();
572
+ }
573
+
574
+ updateSelectedLocations(): void {
575
+ // When locations are selected, fetch the related groups
576
+ const selectedCities = this.filteredLocations
577
+ .filter((location) => location.checked)
578
+ .map((location) => location.city);
579
+ this.filteredLocations.forEach((location:any) => {
580
+ let findLocationIndex = this.locations.findIndex((loc:any) => loc.city == location.city);
581
+ if(findLocationIndex != -1) {
582
+ this.locations[findLocationIndex].checked = location.checked;
583
+ }
584
+ })
585
+ if (selectedCities.length > 0 || !selectedCities.length) {
586
+ this.selectedFilters.stores =[];
587
+ this.groupsData =[]
588
+ this.getGroups(); // Fetch groups based on selected cities
589
+ // If there are selected groups, fetch the stores based on selected groups
590
+ this.getStore();
591
+ this.selectedFilters.location = this.locations;
592
+
593
+ } else {
594
+ this.filteredGroups = []; // Clear groups if no locations are selected
595
+ this.selectedFilters.location = [];
596
+ }
597
+
598
+ this.selectedFilters.group = [];
599
+ this.filteredStores = []; // Reset stores as well
600
+ this.searchGroupText = '';
601
+ this.searchStoreText = '';
602
+ // this.Opendropdown = false;
603
+ }
604
+
605
+ toggleSelectAllGroups(event: any): void {
606
+ const isChecked = event.target.checked;
607
+ this.filteredGroups.forEach((group) => (group.checked = isChecked));
608
+ this.updateSelectedGroups();
609
+ // if (!isChecked) {
610
+ // this.selectedFilters.stores =[];
611
+ // // If there are selected groups, fetch the stores based on selected groups
612
+ // this.getStore();
613
+ // }
614
+ }
615
+
616
+ updateSelectedGroups(): void {
617
+ // Fetch the relevant stores after groups are selected
618
+ const selectedGroups = this.filteredGroups
619
+ .filter((group) => group.checked)
620
+ .map((group) => group.groupName);
621
+
622
+ this.filteredGroups.forEach((group:any) => {
623
+ let findGroupIndex = this.groupsData.findIndex((item:any) => item.groupName == group.groupName);
624
+ if(findGroupIndex != -1) {
625
+ this.groupsData[findGroupIndex].checked = group.checked;
626
+ }
627
+ })
628
+ if (selectedGroups.length > 0 || !selectedGroups.length) {
629
+ this.selectedFilters.stores =[];
630
+ // If there are selected groups, fetch the stores based on selected groups
631
+ this.getStore();
632
+ this.selectedFilters.group = this.groupsData;
633
+ } else {
634
+ // If no groups are selected, clear the stores list
635
+ this.filteredStores = [];
636
+
637
+ // Also, update localStorage to reflect the cleared store selection
638
+ this.selectedFilters.stores = [];
639
+ localStorage.setItem('header-filters', JSON.stringify(this.selectedFilters));
640
+
641
+ // Emit data via service
642
+ // this.gs.dataRangeValue.next(this.selectedFilters);
643
+ }
644
+
645
+ // Clear the search store text when groups are updated
646
+ this.searchStoreText = '';
647
+ }
648
+
649
+ Reset(): void {
650
+ setTimeout(()=>{
651
+ // Clear selected groups, stores, and locations
652
+ this.filteredGroups = [];
653
+ this.filteredStores = [];
654
+ this.filteredLocations = []; // Reset locations as well
655
+ this.locations =[];this.groupsData =[]; this.stores =[];
656
+ // Clear search input fields
657
+ this.searchLocationText = "";
658
+ this.searchGroupText = "";
659
+ this.searchStoreText = "";
660
+ this.selectedFilters.stores =[];
661
+ this.selectedFilters.group =[];
662
+ this.selectedFilters.location =[];
663
+
664
+
665
+ // Fetch locations, groups, and stores again
666
+ this.getLocations();
667
+ this.getStore();
668
+ this.getGroups();
669
+ // Reset the filters in selectedFilters
670
+
671
+
672
+ // // Once stores are fetched, mark all as checked
673
+ // setTimeout(() => {
674
+ // this.filteredStores = this.stores.map(store => ({
675
+ // ...store,
676
+ // checked: true // Mark all stores as checked
677
+ // }));
678
+
679
+ // // Sync selectedFilters with the updated store state
680
+ // this.selectedFilters.stores = this.filteredStores.map(store => ({
681
+ // ...store,
682
+ // checked: true
683
+ // }));
684
+
685
+ // Update localStorage with the latest selectedFilters
686
+ localStorage.setItem('header-filters', JSON.stringify(this.selectedFilters));
687
+ window.location.reload()
688
+ // Emit the reset filters to update other components if needed
689
+ // this.gs.dataRangeValue.next(this.selectedFilters);
690
+ // Trigger change detection
691
+ this.cd.detectChanges();
692
+ // Adding a slight delay to ensure stores are fetched first
693
+
694
+
695
+ // Close dropdown after reset if necessary
696
+ this.Opendropdown = false;
697
+ },100)
698
+ }
699
+
700
+
701
+
702
+ Apply(): void {
703
+ // Close the dropdown
704
+ this.Opendropdown = false;
705
+
706
+ // Fetch existing filters from localStorage
707
+ const headerFilters: any = JSON.parse(localStorage.getItem("header-filters") || "{}");
708
+ this.selectedFilters.store = null
709
+ // Ensure current selections are reflected
710
+ this.selectedFilters.location = this.locations;
711
+ this.selectedFilters.group = this.groupsData;
712
+ this.selectedFilters.stores = headerFilters.stores ? headerFilters.stores : this.stores;
713
+
714
+
715
+ // Store updated filters back in localStorage
716
+ localStorage.setItem("header-filters", JSON.stringify(this.selectedFilters));
717
+ window.location.reload()
718
+ // Emit the updated filters via the service
719
+ // this.gs.dataRangeValue.next(this.selectedFilters);
720
+ // Trigger refresh if necessary
721
+ // this.gs.manageRefreshTrigger.next(true);
722
+ this.cd.detectChanges();
723
+ }
724
+
725
+ filterLocations(): void {
726
+ const searchText = this.searchLocationText.toLowerCase();
727
+
728
+ if (searchText) {
729
+ // Preserve the checked state during filtering
730
+ this.filteredLocations = this.locations
731
+ .map(location => ({
732
+ ...location,
733
+ checked: this.filteredLocations.find(l => l.city === location.city)?.checked || false
734
+ }))
735
+ .filter(location =>
736
+ location?.city?.toLowerCase().includes(searchText)
737
+ );
738
+ } else {
739
+ // Restore the original checked state when search text is cleared
740
+ this.filteredLocations = this.locations.map(location => ({
741
+ ...location,
742
+ checked: this.selectedFilters.location.find((l:any) => l.city === location.city)?.checked || false
743
+ }));
744
+ }
745
+ }
746
+
747
+
748
+ filterGroups(): void {
749
+ const searchText = this.searchGroupText.toLowerCase();
750
+
751
+ if (searchText) {
752
+ // Preserve the checked state during filtering
753
+ this.filteredGroups = this.groupsData
754
+ .map(group => ({
755
+ ...group,
756
+ checked: this.filteredGroups.find(g => g.groupName === group.groupName)?.checked || false
757
+ }))
758
+ .filter(group =>
759
+ group?.groupName?.toLowerCase().includes(searchText)
760
+ );
761
+ } else {
762
+ // Restore the original checked state when search text is cleared
763
+ this.filteredGroups = this.groupsData.map(group => ({
764
+ ...group,
765
+ checked: this.selectedFilters.group.find((g:any) => g.groupName === group.groupName)?.checked || false
766
+ }));
767
+ }
768
+ }
769
+
770
+
771
+ filterStores(): void {
772
+ const searchText = this.searchStoreText.toLowerCase();
773
+ // Preserve checked states during filtering
774
+ if (searchText) {
775
+ // Filter based on search text while preserving checked state
776
+ this.filteredStores = this.stores
777
+ .map(store => ({
778
+ ...store,
779
+ // Check if the store is already checked in filteredStores, fallback to original stores' checked state
780
+ checked: this.selectedFilters.stores.find((s: any) => s.storeId === store.storeId)?.checked || store.checked || false
781
+ }))
782
+ .filter(store => store.storeName.toLowerCase().includes(searchText));
783
+ } else {
784
+ // When the search text is cleared, restore the original list with preserved checked states
785
+ this.filteredStores = this.stores.map(store => ({
786
+ ...store,
787
+ // Preserve the checked state based on the selected filters
788
+ checked: this.selectedFilters.stores.find((s: any) => s.storeId === store.storeId)?.checked || store.checked || false
789
+ }));
790
+ }
791
+ }
792
+
793
+
794
+
795
+ closeDropdown(): void {
796
+ this.dropdownOpen = null;
797
+ }
798
+
799
+ @HostListener("document:click", ["$event"])
800
+ clickOutside(event: MouseEvent): void {
801
+ const clickedInside = (event.target as HTMLElement).closest(
802
+ ".dropdown-container"
803
+ );
804
+ const clickedoutSide = (event.target as HTMLElement).closest(
805
+ ".dropdown1"
806
+ );
807
+ if (!clickedInside) {
808
+ this.closeDropdown();
809
+ }
810
+ if(!clickedoutSide) {
811
+ this.closeDropdown1();
812
+ }
813
+
814
+ }
815
+ }
816
+ interface City {
817
+ city: string;
818
+ }
819
+
820
+ interface Location {
821
+ city: City;
822
+ checked: boolean;
823
+ }
824
+
825
+